#ifndef STNTUPLE_TStnPhoton #define STNTUPLE_TStnPhoton // Required by KCC4.0 to fix minor scope injection problems in root v2.24 class TMatrixRow; class TMatrixColumn; class TMatrixDiag; #include "TLorentzVector.h" class StnPhotonsBlock_t; class CesCluster; class PesCluster; class CprCluster; class CdfEmObject; class TStnPhoton : public TObject { friend Int_t StnRun1InitPhoton(TStnPhoton* Photon, StnPhotonsBlock_t* R1Phot, Int_t I ); public: //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ Int_t fVersion; // version number from PhotonVariables TLorentzVector fMomentum; Int_t fDetector; // 0: CEM, 1: PEM Float_t fZv; // Z-coordinate of the vertex Float_t fEt; // photon Et Float_t fEtc; // corrected Et Float_t fCo4; Float_t fCo4PJW; // corrected for phi leakage and multiple vertes Float_t fCesx; Float_t fCesz; Float_t fCpr5ph; Float_t fCpr5ps; Float_t fDteta; Float_t fEveta; Float_t fCese; Float_t fCeses; Float_t fPhi; Float_t fCo7; Float_t fHadem; Float_t fLshr; Float_t fStr2; Float_t fStre2; // energy of the 2 strip cluster Float_t fWwir2; Float_t fWire2; // energy of the 2nd wire cluster Float_t fSumpt4; // sum(track Pt) in cone 0.4 Float_t fVtxocc; Float_t fPt; Int_t fN3d; // N(3d tracks) pointing to the cluster Float_t fChi; Float_t fChi3x3; Float_t fChieta; Float_t fChiphi; Float_t fStat; // photon status code Float_t fBoxiso; UInt_t fCesflg; Float_t fE; Float_t fCeswht; Float_t fCprwht; Float_t fCesslide; Int_t fWrd; Float_t fSth; Int_t fElind; Float_t fChistr; Float_t fChiwir; Float_t fCessig; Float_t fCespg; Float_t fCespb; Float_t fCprpg; Float_t fCprpb; Float_t fPt2; Int_t fNtrwd3; Float_t fCescprx; Float_t fCescprq; Float_t fTkcprx; Float_t fTime; // timing of HAD TDC's Float_t fVcor; // corr to Eiso(0.4) due to multiple int Float_t fLcor; // corr to Eiso(0.4) due to leakage Float_t fPesE; // PES 2-d u energy + v energy Float_t fPesX; // PES 2-d position Float_t fPesY; // PES Float_t fPesE2; // second PES cluster for iso Float_t fPprE; // Plug preradiator Energy Int_t fSHLinks; // links to shower max clusters Int_t fPRLinks; // links to CPR/PPR Int_t fTowInd; // seed tower and tower pattern Float_t fTowEt; // Et using tower centroid (for trigger) Float_t fTowPhi; Float_t fTowEta; Float_t fTowIso; // L3 trigger Iso (z=0) Float_t fHademT; // 2-tower (trigger tower) had/Em Float_t fLike; // Likelihood Int_t fCosStub; // bit packed number of muon stubs Int_t fNIsoTrk; // number of tracks in iso cone 0.4 Float_t fMaxIsoTrk; // Pt of max pt track in iso cone 0.4 Int_t fHaloVar; // Beam halo ID variables Float_t fPemPesDr; // Delta R PES-PEM Float_t fSpare1; Int_t fSiExpected; // packed word for hits under photon Int_t fCpr2E0; // packed word for CPR2 energies Int_t fCpr2E1; // packed word for CPR2 energies Int_t fCpr2I; // packed word for CPR2 pad indices const CesCluster* fWirep; //! these pointers are used to do the bookkeeping const CesCluster* fStrpp; //! for making the pointers between blocks const PesCluster* fPesUp; //! They are not stored, for internal use const PesCluster* fPesVp; //! const CprCluster* fCprcp; //! const CdfEmObject* fCdfEmObject; //! //------------------------------------------------------------------------------ // functions //------------------------------------------------------------------------------ TStnPhoton(); virtual ~TStnPhoton(); Int_t Version () { return fVersion; } // HLO version number Int_t CutWord () { return fWrd; } // bits for common cuts Int_t Detector () { return fDetector; } // 0: CEM, 1: PEM Float_t VertexZ () { return fZv; } // vertex z used Float_t StatusCode() { return fStat; } // status points Float_t Likelihood() { return fLike; } // photon ID likelihood Float_t Et () { return fEt; } // raw w/vertex and CES Float_t Etc () { return fEtc; } // corr for tower respnse Float_t E () { return fE; } // total uncorr energy Float_t EmE () { return E(); } // total uncorr energy Float_t ECorr () { return Momentum()->E();} // total corr energy TLorentzVector* Momentum () { return &fMomentum; } // 4-vec with vrt and CES Float_t DetEta () { return fDteta; } // detector eta Float_t Eta () { return fEveta; } // event eta w/Vtx, CES Float_t Phi () { return fPhi; } // phi with CES Float_t SinTheta () { return fSth; } // Et/E Float_t HadEm () { return fHadem; } // Had/EM (3 tower) Float_t HadEmT () { return fHademT; } // Had/EM (2 tower) Float_t LShr () { return fLshr; } // Lshare (3 tower) Float_t Time () { return fTime; } // timing of had TDC's Int_t PhiSeedIndex () { return (fTowInd>>24)&0xFF; } Int_t EtaSeedIndex () { return (fTowInd>>16)&0xFF; } Int_t TowerPattern () { return (fTowInd )&0xFFFF; } // N CEM/PEM towers in the cluster Int_t NTower () { int n=0; for(int i=0; i<16; i++) if( (fTowInd&(1<0 ) n++; return n; } Float_t TowEt () { return fTowEt; } // Et w/ tower centroid Float_t TowPhi () { return fTowPhi; } // phi w/ tower centroid Float_t TowEta () { return fTowEta; } // eta w/ tower centroid Float_t TowIso () { return fTowIso; } // iso w/ vertex z=0 Float_t Iso () { return fCo4; } // cal iso cone 0.4 Float_t SumEt4 () { return Iso(); } // cal iso cone 0.4 // corr for phi leakage and multiple vertices Float_t IsoCorr () { return fCo4PJW; } Float_t Tiso () { return fSumpt4; } // sum trk Pt, cone 0.4 Float_t SumPt4 () { return Tiso(); } // sum trk Pt, cone 0.4 Float_t Pt () { return fPt; } // max Pt trk in cluster Float_t Pt2 () { return fPt2; } // 2nd highest Pt track Int_t N3d () { return fN3d; } // N 3d trk in cluster Float_t Iso7 () { return fCo7; } // cal iso cone 0.7 Float_t SumEt7 () { return Iso7(); } // cal iso cone 0.7 // isolation energy in cone 0.4 with // different corrections // flag = 0: no corrections // = 1: correct for the leakages // = 2: correct for the leakages // and multiple interactions Float_t EIso4(int flag); Int_t NIsoTrk () { return fNIsoTrk; } // Ntrk in iso cone 0.4 Float_t MaxIsoTrk () { return fMaxIsoTrk; } // max Pt trk cone 0.4 Int_t NStub () { return (fCosStub )&0xFF;} // N muon stub Int_t NCosStub () { return (fCosStub>>16)&0xFF;} // Notrack stubs Int_t NCosStubPho(){ return (fCosStub>> 8)&0xFF;} // within 30deg Int_t Seedwedge (){ return (fHaloVar>>24)&0x3F;} // Halo study Int_t Sidewedges (){ return (fHaloVar>>18)&0x3F;} // variables Int_t Ncontig (){ return (fHaloVar>>12)&0x3F;} // Int_t HaloEast (){ return (fHaloVar>> 6)&0x3F;} // Int_t HaloWest (){ return (fHaloVar )&0x3F;} // Float_t XCes () { return fCesx; } // CES local x Float_t ZCes () { return fCesz; } // CES local z Float_t Chi2 () { return fChi; } // strip+wire avg chi2 Float_t Chi2Mean () { return Chi2(); } // strip+wire avg chi2 Float_t Chi2Strip () { return fChistr; } // CES strip chi2 Float_t Chi2Wire () { return fChiwir; } // CES wire chi2 Float_t CesEnergy () { return fCese; } // unbiased wire energy Float_t CesWireE () { return fCese; } // unbiased wire energy Float_t CesStripE () { return fCeses; } // unbiased strip energy Float_t ZCes2 () { return fStr2; } // 2nd CES cluster z Float_t CesStripE2() { return fStre2; } // 2nd CES strip E Float_t XCes2 () { return fWwir2; } // 2nd CES cluster x Float_t CesWireE2 () { return fWire2; } // 2nd CES wire E Float_t CesWht () { return fCeswht; } // Ces BG weight Float_t CesSlide () { return fCesslide; } // 2nd CES sliding cut // indices in TStnClusterBlock Int_t CesWireCluster () { int ans = (fSHLinks>>16)&0xFFFF; return (ans==0xFFFF? -1: ans); } Int_t CesStripCluster() { int ans = (fSHLinks )&0xFFFF; return (ans==0xFFFF? -1: ans); } Float_t XCpr () { return fCpr5ps; } // unbiased CPR local x Float_t CprQ () { return fCpr5ph; } // unbias CPR chrg (fC) Float_t CprEnergy () { return CprQ(); } // unbias CPR chrg (fC) Float_t CprWht () { return fCprwht; } // Cpr BG weight Float_t XCesCpr () { return fCescprx; } // Ces-seeded CPR x Float_t CesCprQ () { return fCescprq; } // Ces-seeded CPR Q (fC) // index in TStnClusterBlock Int_t CprUnbCluster () { int ans = (fPRLinks )&0xFFFF; return (ans==0xFFFF? -1: ans); } Float_t Chi3x3 () { return fChi3x3; } // PEM shape chi2 Float_t Chi2Three () { return Chi3x3(); } // PEM shape chi2 Float_t Prof5by9U () { return fChieta; } // PES 5/9 U view Float_t Prof5by9V () { return fChiphi; } // PES 5/9 V view Float_t PesDeltaR () { return fPemPesDr; } // PES-PEM Delta R Float_t PesE () { return fPesE; } // PES 2-d avg energy Float_t PesEnergy () { return PesE(); } // PES 2-d avg energy Float_t XPes () { return fPesX; } // PES 2-d position Float_t YPes () { return fPesY; } // PES 2-d position Float_t PesE2 () { return fPesE2; } // 2nd PES cluster Float_t PprE () { return fPprE; } // plug preradiator E Int_t SiExp () { return (fSiExpected>> 0)&0xFF;} // hit in line Int_t SiExpPhi () { return (fSiExpected>> 8)&0xFF;} // phi in line Int_t SiExpCone () { return (fSiExpected>>16)&0xFF;} // hit in cone Int_t NCpr2 () { return ((fCpr2I>>24)&0x7); } // number of valid Pads Int_t Cpr2E (Int_t i); // CPR2 Pad E in ADC Int_t Cpr2Ind (Int_t i) { return ((fCpr2I>>(6*i))&0x3F);} // CPR2 Pad index // indices in TStnClusterBlock Int_t PesUCluster () { int ans = (fSHLinks>>16)&0xFFFF; return (ans==0xFFFF? -1: ans); } Int_t PesVCluster () { int ans = (fSHLinks )&0xFFFF; return (ans==0xFFFF? -1: ans); } // set the indices from outside, used only in construction void SetCesWireCluster (int ind) { fSHLinks = (fSHLinks&0xFFFF) | (ind<<16); } void SetCesStrpCluster(int ind) { fSHLinks = (fSHLinks&0xFFFF0000) | ind; } void SetPesUCluster (int ind) { fSHLinks = (fSHLinks&0xFFFF) | (ind<<16); } void SetPesVCluster (int ind) { fSHLinks = (fSHLinks&0xFFFF0000) | ind; } void SetCprCluster (int ind) { fPRLinks = ind; } //these are for bookkeeping during construction of the blocks //use the accessors above for the cluster number in the stntuple const CesCluster* GetCesWireCluster() {return fWirep;} const CesCluster* GetCesStrpCluster() {return fStrpp;} const PesCluster* GetPesUCluster() {return fPesUp;} const PesCluster* GetPesVCluster() {return fPesVp;} const CprCluster* GetCprCluster() {return fCprcp;} const CdfEmObject* GetCdfEmObject() {return fCdfEmObject;} // the TClonesArray of photons can be sorted by the status word virtual Bool_t IsSortable() const { return kTRUE; } #ifdef ROOT_2_26 virtual Int_t Compare(TObject* photon); #else virtual Int_t Compare(const TObject* photon) const; #endif ClassDef(TStnPhoton,9) }; #endif