// #ifndef EDBSHOWERP_H // #define EDBSHOWERP_H #ifndef ROOT_EdbShowerP #define ROOT_EdbShowerP #include "TROOT.h" #include "TFile.h" #include "TVector3.h" #include "TIndexCell.h" #include "TArrayF.h" #include "TH1F.h" #include "TCanvas.h" #include "TBenchmark.h" #include "EdbVertex.h" #include "EdbPVRec.h" #include "EdbPhys.h" #include "EdbMath.h" #include "EdbMomentumEstimator.h" #include "EdbLog.h" #include "EdbPattern.h" class EdbShowerP; using namespace std; //______________________________________________________________________________ class EdbShowerP : public EdbSegP { private: //-C- shower meta data (related to reconstruction) here: // To know which Alg and Parameters were used for this shower o be reconstructed: TString eAlgName; Int_t eAlgValue; Float_t eParaValue[10]; TString eParaString[10]; Short_t eFirstPlate; // FirstPlate is always to the starting of beam! Short_t eLastPlate; // Short_t eFirstPlatePID; // PID of Plate containing the InitiatorBT Short_t eLastPlatePID; // PID of last plate which was used for reconstruction Short_t eFirstPlateZ; // Z of Plate containing the InitiatorBT Short_t eLastPlateZ; // Z of last plate which was used for reconstruction //-C- shower data (directly related to shower characteristics) here: //-C- For class backward compability: TSortedList *eS; // array of segments which set up the shower Int_t eNpl; // number of plates passed throw Int_t eN0; // number of holes (if any) EdbTrackP *eTrackAS; //! track to which the shower start is attached to EdbVTA *eVTAS; //! vertex to which the shower start is attached to //-C- For new class settings: Int_t eNBT; // Number of BT in the shower Int_t eNBTMC; // Number of BT in the shower, only MC>=0 events Int_t eNBTMCFlag[99]; // Number of BT in the shower, only MC>=0 events // flagged with PDG Code, internal array, see corres- // ponding fill function; Int_t eNBTPlate[57]; // Number of BT in the shower per plate w.r.t to Plate of InBT (Plate of InBT===[0]) Int_t eNBTMCPlate[57]; // Number of BT in the shower, only MC>=0 events,w.r.t to Plate of InBT (Plate of InBT===[0]) Int_t eNBTMCFlagPlate[57][99]; // Number of BT in the shower, only MC>=0 events // flagged with PDG Code, internal array, see corres- // ponding fill function, w.r.t to Plate of InBT (!) Float_t ePurity; // simple purity (eNBTMC/eNBT) Float_t eEnergyMC; // Energy, defined by P() of the Initiator BaseTrack TH1F* eProfileLongitudinal; TH1F* eProfileTransversal; EdbSegP* eShowerAxisDefaultInBT; EdbSegP* eShowerAxisCenterGravityBT; //-C- shower data (extracted from shower characteristics) here: Short_t eId; Short_t ePDGId; Float_t eEnergy; Float_t eEnergyUncorrected; Float_t eEnergyCorrected; //-C- shower data: structures for the different parametrisations: struct ePara_FJ { // Variables used for FJ parametrisation Int_t nseg; // identical to <> // ... and so on ... }; struct ePara_YC { // Variables used for YC parametrisation Int_t nseg; // identical to <> // ... and so on ... }; struct ePara_LT { // Variables used for LT parametrisation Int_t nseg; // identical to <> // ... and so on ... }; struct ePara_XX { // Variables used for XX parametrisation Int_t nseg; // identical to <> // ... and so on ... }; public: EdbShowerP(int nseg=0); // default constructor, empty shower virtual ~EdbShowerP(); // virtual destructor due to inherited class void Set0(); void AddVTA(EdbVTA *vta); void ClearVTA(EdbVTA *vta); EdbTrackP *TrackAS() const {return eTrackAS;} EdbVTA *VTAS() const {return eVTAS;} //-C- Similar to TrackClass: basic functions which set or return //-C- simple values for the shower inline void SetCounters() { SetNpl(); SetN0(); } inline void SetN0( int n0 ) { eN0 = n0; } inline void SetN0() { eN0 = eNpl-N(); } inline Int_t N0() const { return eN0; } inline void SetNpl( int npl ) { eNpl=npl; } inline void SetNpl() { if(eS) eNpl = 1+TMath::Abs(GetSegment(0)->PID() - GetSegment(N()-1)->PID()); } inline Int_t Npl() const { return eNpl; } inline Int_t N() const { return (eS) ? eS->GetSize() : 0; } inline EdbSegP *GetSegmentFirst() const {return (eS) ? (EdbSegP*)(eS->First()) : 0;} inline EdbSegP *GetSegmentLast() const {return (eS) ? (EdbSegP*)(eS->Last()) : 0;} inline EdbSegP *GetSegment(int i) const {return (eS) ? (EdbSegP*)(eS->At(i)) : 0; } inline Float_t GetSegmentFirstZ() const {return (eS) ? ((EdbSegP*)eS->First())->Z() : 9999999;} inline Float_t GetSegmentLastZ() const {return (eS) ? ((EdbSegP*)eS->Last())->Z() : 9999999;} const EdbSegP *TrackStart() const; const EdbSegP *TrackEnd() const; void AddSegment(EdbSegP *s); void AddSegmentAndUpdate(EdbSegP *s); // Attention, will execute the whole Update/Calculation Procedure // for eacht BT which is attached. void RemoveSegment(EdbSegP *s); inline void Clear() { if(eS) eS->Clear(); } inline Int_t GetNBT() const { return eNBT; } inline Int_t GetNBTMC() const { return eNBTMC; } inline Int_t GetNBTMCFlag(Int_t PdgArray) const { return eNBTMCFlag[PdgArray]; } inline Int_t GetNBTPlate(Int_t PIDdiff) const { return eNBTPlate[PIDdiff]; } inline Int_t GetNBTMCPlate(Int_t PIDdiff) const { return eNBTMCPlate[PIDdiff]; } inline Int_t GetNBTMCFlagPlate(Int_t PIDdiff,Int_t PdgArray) const { return eNBTMCFlagPlate[PIDdiff][PdgArray]; } inline Float_t GetPurity() const { return ePurity; } inline TH1F* GetProfileLongitudinal() const { return eProfileLongitudinal;} inline TH1F* GetProfileTransversal() const { return eProfileTransversal;} //-C- Functions that calculate shower properties void BuildNplN0(); void BuildProfiles(); void BuildPlateProfile(); void BuildShowerAxis(); void BuildParametrisation(Int_t ParaNr); void BuildParametrisation_FJ(); void BuildParametrisation_YC(); void BuildParametrisation_LT(); void BuildParametrisation_XX(); void CalcPurity(); void Update(); // Update all shower properties. Can be called each time after BT is added or // when last BT was added. void Finalize(); // Delete the histograms only... /// ---- EXPERIMENTAL STATUS --- /// ---- EXPERIMENTAL STATUS --- //-C- Functions for advanced features: void MergeFromShower(EdbShowerP* show,Int_t MergingType=0); void MergeFromShowerByAddress(EdbShowerP* show); void MergeFromShowerByPosition(EdbShowerP* show); /// ---- EXPERIMENTAL STATUS --- //-C- Print functions with different detail level void Print(); void PrintNice(); void PrintBasics(); void PrintMetaData(); void PrintSegments(); void PrintAll(); ClassDef(EdbShowerP,1); // Root Class Definition for my Objects }; #endif /* ROOT_EdbShowerP */