--- calo/flight/CaloProfile/inc/CaloProfile.h 2007/11/09 09:11:24 1.1.1.1 +++ calo/flight/CaloProfile/inc/CaloProfile.h 2009/08/12 14:54:15 1.8 @@ -5,8 +5,13 @@ #ifndef caloprofile_h #define caloprofile_h -#include +#define EMPTY -1 +#define MAX 50 +#include +#include +#include +#include #include #include #include @@ -24,10 +29,16 @@ #include #include #include -#include + +#include using namespace std; +struct stack{ + char data[MAX]; + int top; +}; + /** * */ @@ -62,9 +73,11 @@ void Clear(); void Clear(Option_t *option){Clear();}; void Delete(); + void Delete(Option_t *option){Delete();}; // void Process(); ///< Process data void Print(); + void Print(Option_t *option){Print();}; // ClassDef(CaloLat,1); }; @@ -84,13 +97,74 @@ UInt_t OBT; UInt_t PKT; UInt_t atime; + UInt_t fOBT; + UInt_t fPKT; + UInt_t fatime; + // + Int_t N; + Int_t NC; + Bool_t sel; + Bool_t cont; + Int_t mask18b; + // + Float_t chi2; + Float_t ndf; + Float_t E0; + Float_t a; + Float_t b; + Float_t errE0; + Float_t erra; + Float_t errb; + Float_t etmax; + Float_t asymm; + Float_t X0pl; + Float_t defE0; + Float_t umax; + Float_t lmax; + TString sumax; + TString slmax; + Int_t fitresult; + // + Bool_t no18x; + Bool_t maskXE; + Bool_t maskYE; + Bool_t maskXO; + Bool_t maskYO; // Float_t eplane[2][22]; // + CaloLevel2 *clp; + // + Float_t Evaluate(TString s, Float_t max); // expression must be of the form "5*t"."t+10","t-(4*t)"... + // public: // // + void Fit(); + void Fit(Bool_t draw); + // + // Double_t ccurve(Double_t *t, Double_t *par); + // + void SetCaloLevel2Pointer(CaloLevel2 *cp){ clp = cp;}; + // + Float_t Get_E0(){this->Fit(); return E0;}; + Float_t Get_defE0(){this->Fit(); return defE0;}; + Float_t Get_a(){this->Fit(); return a;}; + Float_t Get_b(){this->Fit(); return b;}; + Float_t Get_errE0(){this->Fit(); return errE0;}; + Float_t Get_erra(){this->Fit(); return erra;}; + Float_t Get_errb(){this->Fit(); return errb;}; + Float_t Get_chi2(){this->Fit(); return chi2;}; + Float_t Get_ndf(){this->Fit(); return ndf;}; + Float_t Get_nchi2(){this->Fit(); if ( ndf > 0 ) return (chi2/ndf); return 0;}; + Float_t Get_tmax(){this->Fit(); if ( b != 0 ) return ((a-1.)/b); return 0;}; + Float_t Get_asymm(){this->Fit(); return asymm;}; + Float_t Get_exptmax(){this->Process(); return etmax;}; + Float_t Get_X0pl(){this->Process(); return X0pl;}; + Int_t Get_fitresult(){this->Fit(); return fitresult;}; + // + void ForceNextFit(){atime=0;fatime=0;}; void Draw(); void Draw(Int_t); // @@ -99,15 +173,83 @@ ~CaloLong(){ Delete(); }; // void SetDebug(Bool_t d){ debug=d; }; + void UsePlane18X(){ no18x=false; }; + // + void MaskSection(TString); + void UnMaskSection(TString); + void UnMaskSections(); + void Selection(){sel = true; cont = false;}; ///< Set selection mode: planes from 1 to 22-N are used, plane 18 - N is masked if "emulate18" variable is true (DEFAULT); + void Contamination(){sel = false; cont = true;}; ///< Set contamination mode: planes from N to 22 are used. + void SetNoWpreSampler(Int_t n); + void SetNoWcalo(Int_t n); + void SplitInto(Int_t NoWpreSampler, Int_t NoWcalo); + Int_t GetNoWpreSampler(){return N;}; ///< Get the number of W planes used as presampler. + Int_t GetNoWcalo(){return NC;}; ///< Get the number of W planes used as calorimeter. + void SetEnergies(Float_t myene[][22]); + // + void SetLowerLimit(Float_t l){ lmax = l; }; + void SetUpperLimit(Float_t u){ umax = u; }; + void SetLowerLimit(TString sl){ slmax = sl; };// expression must be of the form "5*t"."t+10","t-(4*t)"... where t will be replaced by the fitted maximum (X0) + void SetUpperLimit(TString su){ sumax = su; };// expression must be of the form "5*t"."t+10","t-(4*t)"... where t will be replaced by the fitted maximum (X0) + // + Float_t GetLowerLimit(){ return lmax;}; + Float_t GetUpperLimit(){ return umax;}; + // + void Clear(); + void Clear(Option_t *option){Clear();}; + void Delete(); + void Delete(Option_t *option){Delete();}; + // + void Process(); ///< Process data + void Print(); + void Print(Option_t *option){Print();}; + // + ClassDef(CaloLong,2); +}; + +/** + * + */ +class Calo2D : public TObject { + + private: + // + PamLevel2 *L2; + Bool_t debug; + // + // needed to avoid reprocessing the same event over and over to obtain the variables + // + UInt_t OBT; + UInt_t PKT; + UInt_t atime; + // + Float_t estrip[23][96][96]; + Int_t smax[23]; + Int_t smay[23]; + // + + public: + // + // + void Draw(); + void Draw(Int_t); + // + Calo2D(); + Calo2D(PamLevel2 *L2); + ~Calo2D(){ Delete(); }; + // + void SetDebug(Bool_t d){ debug=d; }; // void Clear(); void Clear(Option_t *option){Clear();}; void Delete(); + void Delete(Option_t *option){Delete();}; // void Process(); ///< Process data void Print(); + void Print(Option_t *option){Print();}; // - ClassDef(CaloLong,1); + ClassDef(Calo2D,1); }; #endif