#ifndef STNTUPLE_TStnElectron #define STNTUPLE_TStnElectron #ifdef __GNUG__ #pragma interface #endif class CdfTrack; class CdfEmObject; struct StnElectronBlock_t; class TStnTrack; class TStnConversion; #include "TArrayI.h" #include "Stntuple/data/TStnTypes.hh" #include "TStnLepton.hh" class TStnElectron : public TStnLepton { friend Int_t StntupleInitElectron(TStnElectron*, const CdfEmObject*); friend Int_t StntupleInitPhoenixElectron(TStnElectron*, const CdfEmObject*); friend Int_t StnRun1InitElectron(TStnElectron* Ele, StnElectronBlock_t* Run1Ele, Int_t I) ; public: //------------------------------------------------------------------------------ // constants. 1. number of currently unused ints and floats, // v9: 3 floats, v10: 2 floats //------------------------------------------------------------------------------ enum { kNFreeInts = 1, kNFreeFloats = 0 }; // to accomodate CTC static TArrayI kMinCotHits; //------------------------------------------------------------------------------ // data members //------------------------------------------------------------------------------ protected: Int_t fIdwrd; Int_t fIswrd; Int_t fConwrd; // conversion code Int_t fFid; // bit-packed fid code (see .cc file) Int_t fDetCode; // detector code: 0: cent, 1: Plug, 2: Forw Int_t fNasl; // # of axial superlayers hit by electron Int_t fNssl; // # of stereo sl's hit by electron Int_t fTrind; // packed: trk# & 0xffff|(clst sz)<<16 Int_t fNCesClusters[2]; // #'s of matching CES clusters(0:s,1:w) Int_t fNCprClusters[2]; Int_t fNPesClusters; // # of matching PES 2D clusters Int_t fNTracks; // Ntrk matching EM cluster (new in V3) Int_t fPhoenixSeedID; // 2 int*2 words packed Int_t fPem3x3FitTower; // .ne.0 if 3x3 fit was done(new in V9) 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 Int_t fInt[kNFreeInts]; // provision for future expension //----------------------------------------------------------------------------- // float sub-block //----------------------------------------------------------------------------- Float_t fEtcor; // Et(corr) = Et(raw)*fEtcor Float_t fEt; // raw cluster Et (EM+HAD) Float_t fDteta; // detector eta Float_t fEveta; // event eta Float_t fPhi; // phi of the electron Float_t fPt; // track Pt w/o beam-constraint Float_t fPlugHadEmCut; // Plug constant-efficiency cut // (CDF 6616) Float_t fZv; // Z(vertex) of this em cluster Float_t fEp; // E/p ratio, no beam constraint Float_t fHadem; // E(had)/E(em) Float_t fXces; // X(best CES wire clstr,loc wdg coord) Float_t fDelX; // X(cluster) - X(track) Float_t fZces; // Z(best CES clust, loc wdg coord) Float_t fCesEnergy[2]; // E of the best CES clust (0:str,1:wr) Float_t fCprEnergy; // energy of the CPR cluster Float_t fDelZ; Float_t fChis; // CES strips or U for PES Float_t fChiw; // CES wires or V for PES Float_t fIso; // calor isolation cone 0.4 Et Float_t fTiso; // track isolation (relative) Float_t fZtrk; // Z position of track at CES Float_t fIso7; // calor isolation cone 0.7 Et Float_t fXtrk; // X-position of the track at CES Float_t fLshr2; // lateral sharing Float_t fChi3; // 3x3 chi**2 Float_t fPesRDeltaPhi; // Distance between PES cluster and // max-Pt track along phi direction Float_t fD0; // impact parameter of electron track Float_t fTime; // timing of HAD TDC's Float_t fLshr; // lateral sharing (3 towers) Float_t fPesEta; // Float_t fPesPhi; // Float_t fPesEnergy[2]; // 0: U, 1: V Float_t fHadEmT; // had/em for trig tower (new in V3) Float_t fEmIso4; // EM isolation energy in cone 0.4 Float_t fHadIso4; // HAD isolation energy in cone 0.4 // -------------------- extended in v5 //----------------------------------------------------------------------------- // track parameters, including parameters of beam-constrained COT track //----------------------------------------------------------------------------- Float_t fZ0; // Z0 of the electron track Float_t fBcPt; // Beam-constrained Cot-only Pt Float_t fBcZ0; // Beam-constrained Cot-only Z0 Float_t fBcPhi0; // Beam-constrained Cot-only Phi0 Float_t fBcLam0; // Beam-constrained Cot-only Lam0 Float_t fBcE; // StdBob's energy (not Et!) Float_t fBcDelX; // DelX(CES) with BC track Float_t fBcDelZ; // DelZ(CES) with BC track Float_t fLeakCorr; // (lateral Et leakage)/Et Float_t fPes5x9[2]; // 5x9 shower profile ratios (0:U,1:V) Float_t fPesXYZ[3]; // XYZ extrap to the plug (ask Cigdem) Float_t fPem3x3Eta; // eta of the pem 3x3chi2 fit Float_t fPem3x3Phi; // phi of the pem 3x3chi2 fit Float_t fPprEnergy; // energy of the PPR cluster Float_t fPesDeltaR; // Distance along radial direction // between PES cluster and max-Pt track Float_t fPesPemDeltaR; // between PES 2D & PEM tower fit (cm) Float_t fPem3x3E; // energy from 3x3 fit Float_t fFloat[kNFreeFloats]; // provision for future expansion CdfEmObject* fCdfEmObject; //! also the end of persistent record //----------------------------------------------------------------------------- // transient-only data members - make sure they are set at run-time // before you started using them //----------------------------------------------------------------------------- TStnTrack* fTrack; // ! TStnConversion* fConversion; // ! TLorentzVector fCorrMom; // ! beam-constrained, Larry-corrected Float_t fTmp [50]; // ! Int_t fITmp[50]; // ! //----------------------------------------------------------------------------- // functions //----------------------------------------------------------------------------- public: // ****** constructors and destructor TStnElectron(Int_t Number = -1); TStnElectron(GENP_PARTICLE* p); virtual ~TStnElectron(); // ****** init methods // ****** accessors Int_t Type () const { return TStnLepton::kElectron; } Int_t Number () const { return Int_t(GetUniqueID()); } Int_t DetectorCode() const { return (fDetCode ) & 0xff; } Int_t SeedIEta () const { return (fDetCode >> 8) & 0xff; } Int_t SeedIPhi () const { return (fDetCode >> 16) & 0xff; } Int_t Side () const { return (fDetCode >> 24) & 0xff; } Float_t SinTheta () const { return Momentum()->Pt()/Momentum()->P();} // wedge number (for the central electrons) Int_t WedgeNumber () const { return SeedIPhi()+24*Side(); } Int_t IsCentral () const { return DetectorCode() == 0; } Int_t IsPlug () const { return DetectorCode() == 1; } Int_t IsForward () const { return DetectorCode() == 2; } Int_t TrackNumber () const { short it = fTrind & 0xffff; return it; } Int_t ClusterSize () const { return (fTrind >> 16) & 0xff; } Int_t Conwrd () const { return fConwrd; } Int_t IDWord () const { return fIdwrd; } Int_t IdWord () const { Error("IdWord","Obsolete, use TStnElectron::IDWord(). Pasha"); return IDWord(); } Int_t IsoCode () const { return fIswrd; } Int_t FidCode () const { return fFid; } Int_t FidEleTrk () const { return (int)((char)((fFid ) & 0xff));} Int_t FidEleSmx () const { return (int)((char)((fFid >> 8) & 0xff));} Float_t XCes () const { return fXces; } Float_t ZCes () const { return fZces; } Float_t DelX () const { return fDelX; } Float_t DelXQ () const { return (Charge()>0) ? fDelX : -fDelX;} Float_t DelZ () const { return fDelZ; } Float_t TrackXCes () const { return fXtrk; } Float_t TrackZCes () const { return fZtrk; } Float_t BcDelX () const { return fBcDelX; } Float_t BcDelXQ () const { return (Charge()>0) ? fBcDelX : -fBcDelX;} Float_t BcDelZ () const { return fBcDelZ; } Float_t BcE () const { return fBcE; } Float_t XBcTrkCes () const { return fBcDelX+fXces; } Float_t ZBcTrkCes () const { return fBcDelZ+fZces; } Float_t Lshr () const { return fLshr ; } Float_t Lshr2 () const { return fLshr2; } Float_t CesEnergy(int i) const { return fCesEnergy[i]; } Float_t CprEnergy () const { return fCprEnergy; } Float_t PprEnergy () const { return fPprEnergy; } Float_t Pem3x3Eta () const { return fPem3x3Eta; } Float_t Pem3x3Phi () const { return fPem3x3Phi; } //----------------------------------------------------------------------------- // Caution: 0 is strip, 1 is wire. This follows the hardware numbering scheme // and is opposite to CesCluster ENUM defnition //----------------------------------------------------------------------------- Int_t NCesClusters(Int_t i) const { return fNCesClusters[i]; } Int_t NCprClusters() const { return fNCprClusters[0]; } Int_t NPesClusters() const { return fNPesClusters; } Int_t NTracks () const { return fNTracks; } Int_t PhoenixSeedID (Int_t I) const { return (fPhoenixSeedID >> 16*I) & 0xffff; } Int_t Pem3x3FitTower() const { return fPem3x3FitTower; } // CES chi**2's Float_t Chi2Strip () const { return fChis; } Float_t Chi2Wire () const { return fChiw; } Float_t Chi2Mean () const { return (fChis+fChiw)/2.; } Float_t Chi2Three () const { return fChi3; } Float_t DetEta () const { return fDteta; } Float_t Et () const { return Momentum()->E()*SinTheta();} Float_t Etcor () const { return fEtcor; } Float_t HadEm () const { return fHadem; } Float_t Emfr () const { return 1./(1.+fHadem); } //----------------------------------------------------------------------------- // just synonims //----------------------------------------------------------------------------- Float_t EOverP () const { return fEp; } Float_t EP () const { return fEp; } Float_t Iso () const { return fIso; } // cone 0.4 cal iso Et // cone 0.4 cal iso Et - lateral leakage Et Float_t IsoCorr () const { return fIso-LeakCorr()*EmEt(); } Float_t TrackIso () const { return fTiso; } // (cone 0.4 cal iso Et - lateral leakage Et)/Et Float_t Iso1Corr () const { return IsoCorr()/Et(); } Float_t Time () const { return fTime; } //----------------------------------------------------------------------------- // cached parameters of the track //----------------------------------------------------------------------------- Float_t TrackPt () const { return fPt; } Float_t TrackBcPt () const { return fBcPt; } // beam constr. cot-only Float_t TrackBcPhi0 () const { return fBcPhi0; } // beam constr. cot-only Float_t TrackBcLam0 () const { return fBcLam0; } // beam constr. cot-only Float_t TrackBcZ0 () const { return fBcZ0; } // beam constr. cot-only Float_t D0 () const { return fD0; } Float_t Z0 () const { return fZ0; } Float_t TrackPhi () const { return TVector2::Phi_0_2pi(Momentum()->Phi()); } //----------------------------------------------------------------------------- // New accessors from Ray Culbertson //----------------------------------------------------------------------------- Float_t EmClusEvEta () const { return fEveta; } Float_t EmClusPhi () const { return fPhi; } Float_t E () const { return Momentum()->E(); } // raw E //----------------------------------------------------------------------------- // new accessors from Evelyn Thomson //----------------------------------------------------------------------------- Float_t EmE () const { return Momentum()->E(); } // raw E Float_t HadE () const { return HadEm() * EmE(); } Float_t TotalE () const { return EmE() + HadE(); } Float_t EmClusZv () const { return fZv; } //----------------------------------------------------------------------------- // New accessors for V12 from Alon Attal //----------------------------------------------------------------------------- Float_t PlugHadEmCut() const { return fPlugHadEmCut; } // calor isolation cone 0.7 Et Float_t Iso7 () const { return fIso7; } Float_t PesRDeltaPhi() const { return fPesRDeltaPhi; } Float_t PesDeltaR () const { return fPesDeltaR; } Float_t PprPem () const { return fPprEnergy / EmE(); } //----------------------------------------------------------------------------- // parameters of the EM cluster //----------------------------------------------------------------------------- Float_t TotalEt () const { return fEt; } // EM+Had Et Float_t ClusterEt () const { return fEt; } Float_t ClusterEmEt () const { return fEt/(1.+fHadem); } Float_t ClusterHadEt() const { return fEt*fHadem/(1.+fHadem); } Float_t RawEP () const { if (fPt != TStnTypes::kUndefined) return ClusterEmEt()/fPt; else return TStnTypes::kUndefined; } Float_t EmEt () const { return EmE() * SinTheta(); } // Raw EM Et Float_t HadEt () const { return TotalEt()-EmEt(); } Float_t Nssl () const { return fNssl; } Float_t Nasl () const { return fNasl; } //end of new accessors Float_t SumEt4 () const { return fIso; } // Cone 0.4 Iso Et Float_t SumPt4 () const { return fTiso; } Float_t PesEta () const { return fPesEta; } Float_t PesPhi () const { return fPesPhi; } Float_t PesEnergy(int i) const { return fPesEnergy[i]; } Float_t Pes5x9 (Int_t I) const { return fPes5x9[I]; } Float_t PesTrkDeltaR () const { return sqrt( pow(fPesRDeltaPhi,2) + pow(fPesDeltaR,2) ); } Float_t PesPemDeltaR () const { return fPesPemDeltaR; } Float_t HadEmT () const { return fHadEmT; } Float_t EmIso4 () const { return fEmIso4; } // Em iso Et only Float_t HadIso4 () const { return fHadIso4; } // Had iso Et only // (lateral Et leakage)/Et Float_t LeakCorr () const { return fLeakCorr; } // energy leakage to the neighbouring wedges // has to be subtracted from the isolation // energy Float_t LeakageEnergy () const { return LeakCorr()*EmE();} // isolation energy in the cone 0.4 due to // the underlying event and multiple // interactions Float_t SumEt4UE(int nv12) const; 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 CdfEmObject* GetCdfEmObject() { return fCdfEmObject; } //----------------------------------------------------------------------------- // accessors for transient-only data members - make sure those are // initialized - initialization is up to you! //----------------------------------------------------------------------------- TStnTrack* Track () const { return fTrack; } TStnConversion* Conversion () const { return fConversion; } TLorentzVector* CorrMom () { return &fCorrMom; } Float_t& Tmp (Int_t i) { return fTmp[i]; } Int_t& ITmp (Int_t i) { return fITmp[i]; } //----------------------------------------------------------------------------- // modifiers //----------------------------------------------------------------------------- void SetTrackNumber(Int_t It ) { fTrind = (fTrind & 0xffff0000) | (It & 0xffff); } void SetPhoenixSeedID(Int_t It0, Int_t It1) { fPhoenixSeedID = (It0 & 0xffff) | ((It1 & 0xffff) << 16); } void SetEOverP (Double_t Ep ) { fEp = Ep; } void SetEt (Double_t Et ) { fEt = Et; } void SetEtCor (Double_t Et ) { fEtcor = Et; } void SetBcPt (Double_t Pt ) { fBcPt = Pt; } void SetTIso (Double_t TIso) { fTiso = TIso; } void SetIdWord (Int_t Word) { fIdwrd = Word; } void SetTrack (TStnTrack* Track) { fTrack = Track; } void SetConversion (TStnConversion* Conv) { fConversion = Conv; } //----------------------------------------------------------------------------- // overloaded methods of TObject //----------------------------------------------------------------------------- void Clear(const char* Opt = "") ; void Print(const char* Opt = "") const ; //----------------------------------------------------------------------------- // schema evolution // ---------------- // v4 -> v5: fD0 replaces fVtxocc, fXtrk replaces fPtrk, add fZ0, / // add 5 buffer words for future // V6 : add BcPt , use spare float // V7 : add LeakCorr, use spare float // V8 : add Phoenix ele and BC extrap, add 5 spare integers, back to 5 spare floats // V9 : add fPem3x3FitTower as spare int, fPem3x3Eta, fPem3x3Phi as 2 spare floats // V10: move PPR energy word down to the bottom // V11: use spare float for PesTrkDeltaR // V12: add Iso7, PlugHadEmCut, PesRDeltaPhi, PesDeltaR and PPR/PEM ratio // removed obsolete floats: Bte (border tower energy), Stat (stat code) // and Chid (depth chi2). No longer need float for PesTrkDeltaR. // V15 add PEM3x3 energy //----------------------------------------------------------------------------- void ReadV1 (TBuffer& R__b); void ReadV2 (TBuffer& R__b); void ReadV3 (TBuffer& R__b); void ReadV4 (TBuffer& R__b); void ReadV57(TBuffer& R__b); ClassDef(TStnElectron,15) // Electron }; #endif