/** * \file CaloFranzini.h * \author Emiliano Mocchiutti (2007/12/03) */ #ifndef calofranzini_h #define calofranzini_h #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // #include using namespace std; /** * * Class to store and calculate variables useful for analysis with the Franzini method */ class CaloFranzini : public TObject { private: // PamLevel2 *L2; Bool_t debug; TFile *file; Int_t nbin; TArrayF *brig; TArrayF *brigm; TArrayF *qplmean[17]; TMatrixD *hmat[17]; TMatrixF *hfmat[17]; TMatrixD *fqplmean[17]; Int_t N; Int_t NC; // // needed to avoid reprocessing the same event over and over to obtain the variables; // UInt_t OBT; UInt_t PKT; UInt_t atime; Int_t sntr; Float_t estrip[2][22][96]; Float_t qplane[43]; Bool_t sel; Bool_t cont; Bool_t crig; // Int_t mask18b; Bool_t dofull; Bool_t dolong; Int_t degfre; // Float_t longtzeta; ///< longitudinal covariance parameter used for event selection Float_t fulltzeta; ///< full calorimeter covariance parameter used for event selection // public: // CaloFranzini(); CaloFranzini(PamLevel2 *L2); ~CaloFranzini(){ Delete(); }; // Float_t GetLongTZeta(){Process(); return longtzeta;}; ///< Returns longitudinal covariance parameter used for event selection Float_t GetFullTZeta(){Process(); return fulltzeta;}; ///< Returns full calorimeter covariance parameter used for event selection // Float_t GetNormLongTZeta(); ///< Returns longitudinal covariance parameter used for event selection Float_t GetNormFullTZeta(); ///< Returns full calorimeter covariance parameter used for event selection // 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. Int_t GetDegreeOfFreedom(){return degfre;}; // TArrayF *LoadLongAverage(Float_t rig); TMatrixD *LoadCovarianceMatrix(Float_t rig); // Float_t GetAverageAt(Int_t plane, Float_t rig); Float_t GetHmatrixAt(Int_t i, Int_t j, Float_t rig); // Float_t GetFullAverageAt(Int_t plane, Int_t strip, Float_t rig); Float_t GetFullHmatrixAt(Int_t i, Int_t j, Float_t rig); // Bool_t Open(TString matrixfile); Bool_t LoadBin(); Bool_t LoadLong(); Bool_t LoadFull(); Bool_t LoadMatrices(); Bool_t LoadFullMatrices(); TFile *GetFile(){return file;}; // Bool_t CreateMatrixFile(TString matrixfile); Bool_t UpdateMatrixFile(TString matrixfile); void WriteNumBin(Int_t numbin); void WriteRigBin(TArrayF *rigbin); void WriteLongMean(TArrayF *qpl, Int_t bin); void WriteLongMatrix(TMatrixD *matrix, Int_t bin); void WriteFullMatrix(TMatrixF *matrix, Int_t bin); void WriteFullMean(TMatrixD *matrix, Int_t bin); void WriteInvertedLongMatrix(TMatrixD matrix, Int_t bin); void WriteInvertedFullMatrix(TMatrixF matrix, Int_t bin); void CloseMatrixFile(); // void CalculateLongTZeta(){ dofull = false; dolong=true; }; void CalculateFullTZeta(){ dolong = false; dofull=true; }; void SetDebug(Bool_t d){ debug=d; }; void SetNoWpreSampler(Int_t n); void SetNoWcalo(Int_t n); 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 DrawLongAverage(Float_t rig); void DrawLongAverage(Int_t bin); void UseCaloRig(){crig=true;}; // void Clear(); void Clear(Option_t *option){Clear();}; void Delete(); void Delete(Option_t *option){Delete();}; // void Process(Int_t ntrack); ///< Process data track number ntrack void Process(); ///< Process data void Print(); void Print(Option_t *option){Print();}; // ClassDef(CaloFranzini,1); }; #endif