//_____________________________________________________________________________ // file: ExoticMods/Stntuple/obj/src/TStnElectron.cc // definition of the electron stored in STNTUPLE // // description of the inline functions in alphabetic order: // ------------------------------------------------------- // EmClusZv() : default z vertex for this cluster // EmE() : cluster EM energy, assumes DEFAULT used to fill Momentum() // EmEt() : cluster EM Et using default z vertex // Et() : em Et + had Et // HadE() : cluster HAD energy // HadEt() : cluster HAD Et using default z vertex // Iso() : total (EM+HAD) isolation Et of the electron cluster // in cone 0.4 (Et of all the towers in cone 0.4 around // the electron cluster excluding towers of the cluster // itself), for exact definition - see // ElectronObjects/src/EmCluster.cc and // http://cdfcodebrowser.fnal.gov/CdfCode/source/Electron/src/emclst_alg.cc#L45 // somehow cluster knows about Z of the vertex, so Et is // calculated with respect to it. // NCprClust(0) : number of CPR clusters found in CES-based mode matching // the electron // NCprClust(1) : number of CPR clusters found in track-based mode matching // the electron // Nasl() : Number of axial Sl on electron track // Nssl() : number of stereo Sl on electron track // Side() : 0=WEST, 1=EAST // TIso() : isolation of the electron track: // sum(Pt_i in cone 0.4)/Pt(electron), where sum index runs // over all the 3D tracks in cone=0.4 around the electron track // may not be defined, accessible through the parameters of the // electron track, for which it is defined. On a longer term // time scale will be cached in the electron record // TotalE() : cluster EM E + HAD E // TotalEt() : cluster EM Et + HAD Et using default z vertex // // to be continued... // ------------------ // // - was status code of the electron = Et of electron plus // // 1000 points for the presence of an ELES bank OR // 2000 points for the presence of a central ELES bank with Et.gt.10.0 OR // 3000 points for passing the loose R-paper cuts (NO isolation cut): // CENTRAL // ET_ELE(J).GT.20.0 // CON_ELE(J).EQ.0 // EP_ELE(J).LE.2.0 // HADEM_ELE(J).LE.0.1 // FID_ELE(J).EQ.0 // PLUG // ET_ELE(J) .GE. 15.0 // CHI3_ELE(J) .LE. 3.0 // HADEM_ELE(J) .LE. 0.1 // FID_ELE(J).EQ.0 // CON_ELE(J).EQ.0 // FORWARD // ET_ELE(J) .GT. 10.0 // HADEM_ELE(J) .LT. 0.1 // // // 5000 points for the presence of a loose plug or loose central ELES // bank as determined by TOPFND OR // 6000 points for passing the tight R-paper cuts (NO isolation cut): // CENTRAL // ET_ELE(J) .GT. 20.0 // EP_ELE(J) .LT. 2.0 .AND. EP_ELE(J) .GT. 0.5 // LSHR_ELE(J) .LE. 0.2 // CHIS_ELE(J) .LE. 10.0 // ABS(DELX_ELE(J)) .LE. 1.5 // ABS(DELZ_ELE(J)) .LE. 3.0 // ABS(EZV_ELE(J)) .LE. 60.0 // HADEM_ELE(J) .LE. 0.045 +0.055*P4E_ELE(4,J)/100.0 // FID_ELE(J).EQ.0 // CON_ELE(J).EQ.0 // // 7000 points for central ELES banks passing tight cuts except // fiducial cut as determined by TOPFND OR // 8000 points for central ELES banks passing all tight cuts OR // 9000 points for central ELES banks passing all tight cuts as well as // isolation cuts used in TOPFND // // - fiducial code fFid is a bit-packed word telling "how fiducial" // the electron is: // 0 = fiducial, otherwise, the following bits are set: // bit 0 CEM failed phi crack cut // 1 CEM failed 90 crack cut // 2 CEM failed tower 9 cut // 3 CEM failed Zprime tower 9 cut // 4 CEM Failed tower 7 chimney // 5 PEM outer eta annuli // 6 PEM inner eta annuli // 7 PEM phi cut // 8 PEM dead channel // 9 FEM inner eta annuli // 10 FEM phi cut //_____________________________________________________________________________ #ifdef __GNUG__ #pragma implementation #endif #include #ifdef CDF1 #include "run1cpp/bnk/GenpParticle.hh" #endif #include "Stntuple/obj/TStnDataBlock.hh" #include "Stntuple/obj/TStnElectron.hh" ClassImp(TStnElectron) #ifdef CDF1 static int a[9] = { 6,3,6,3,6,3,6,3,6}; TArrayI TStnElectron::kMinCotHits(9,a); #elif CDF // there is only 8 SL's in COT static int a[9] = { 6,6,6,6,6,6,6,6,100}; TArrayI TStnElectron::kMinCotHits(9,a); #endif //______________________________________________________________________________ void TStnElectron::ReadV1(TBuffer &R__b) { // Stream an object of class TStnElectron (version 1) TStnLepton::Streamer(R__b); R__b >> fEtcor; R__b >> fEt; R__b >> fDteta; R__b >> fEveta; R__b >> fPhi; R__b >> fPt; R__b >> fPlugHadEmCut; R__b >> fZv; R__b >> fEp; R__b >> fHadem; R__b >> fXces; R__b >> fDelX; R__b >> fZces; R__b >> fDelZ; R__b >> fChis; R__b >> fChiw; R__b >> fIso; R__b >> fTiso; R__b >> fIdwrd; R__b >> fIswrd; R__b >> fConwrd; R__b >> fZtrk; R__b >> fFid; R__b >> fDetCode; R__b >> fIso7; R__b >> fNasl; R__b >> fNssl; R__b >> fZ0; // was Ptrk before... R__b >> fLshr2; R__b >> fChi3; R__b >> fPesRDeltaPhi; R__b >> fD0; // was fVtxocc before... R__b >> fTime; R__b >> fTrind; R__b >> fLshr; R__b.ReadStaticArray(fNCprClusters); //----------------------------------------------------------------------------- // initialize words undefined/unused in V4, which, however, make sense in V5 //----------------------------------------------------------------------------- fXtrk = TStnDataBlock::kUndefined; fD0 = TStnDataBlock::kUndefined; //----------------------------------------------------------------------------- // words added in V5, V76, V7 //----------------------------------------------------------------------------- fBcPt = TStnDataBlock::kUndefined; fLeakCorr = TStnDataBlock::kUndefined; //----------------------------------------------------------------------------- // initialize words undefined/unused in V8, move fLeakCorr first! //----------------------------------------------------------------------------- fPhoenixSeedID = -1; fPem3x3FitTower = -1; fPem3x3FitTower = -1; for (int i=0; ifIdwrd); int nwi = ((Int_t* ) &ev.fEtcor ) - &ev.fIdwrd; int nwf = ((Float_t*) &ev.fCdfEmObject) - &ev.fEtcor; //----------------------------------------------------------------------------- // read version 5,6,7 //----------------------------------------------------------------------------- TStnLepton::Streamer(R__b); R__b.ReadFastArray(&fIdwrd,nwi); R__b.ReadFastArray(&fEtcor,nwf); //----------------------------------------------------------------------------- // initialize words undefined/unused in V8, move fLeakCorr first! //----------------------------------------------------------------------------- fPhoenixSeedID = -1; fPem3x3FitTower = 0; for (int i=0; ifLeakCorr; fBcZ0 = TStnDataBlock::kUndefined; fBcPhi0 = TStnDataBlock::kUndefined; fBcLam0 = TStnDataBlock::kUndefined; fBcDelX = TStnDataBlock::kUndefined; fBcDelZ = TStnDataBlock::kUndefined; fPes5x9[0] = TStnDataBlock::kUndefined; fPes5x9[1] = TStnDataBlock::kUndefined; fPesXYZ[0] = TStnDataBlock::kUndefined; fPesXYZ[1] = TStnDataBlock::kUndefined; fPesXYZ[2] = TStnDataBlock::kUndefined; fPem3x3Eta = TStnDataBlock::kUndefined; fPem3x3Phi = TStnDataBlock::kUndefined; fPprEnergy = TStnDataBlock::kUndefined; fIso7 = TStnDataBlock::kUndefined; fPlugHadEmCut = TStnDataBlock::kUndefined; fPesRDeltaPhi = TStnDataBlock::kUndefined; fPesDeltaR = TStnDataBlock::kUndefined; fPesPemDeltaR = TStnDataBlock::kUndefined; fPem3x3E = TStnDataBlock::kUndefined; for (int i=0; i= 15) nwf = 57; TStnLepton::Streamer(R__b); R__b.ReadFastArray(&fIdwrd,nwi); R__b.ReadFastArray(&fEtcor,nwf); } } else { R__b.WriteVersion(TStnElectron::IsA()); TStnLepton::Streamer(R__b); nwi = ((Int_t* ) &fEtcor ) - &fIdwrd; nwf = ((Float_t*) &fCdfEmObject) - &fEtcor; R__b.WriteFastArray(&fIdwrd,nwi); R__b.WriteFastArray(&fEtcor,nwf); } } //_____________________________________________________________________________ TStnElectron::TStnElectron(Int_t Number) { SetUniqueID(UInt_t(Number)); fTrack = NULL; fCdfEmObject = NULL; fConversion = NULL; for (int i=0; i 1) { x = nv12; if (x > 10.) x = 10.; if (nv12 <= 5) { ue = SLOPE1*(x-1); } else { ue = 4.5*SLOPE1 + (x-5.5)*SLOPE2; } } return ue; } //_____________________________________________________________________________ Int_t TStnElectron::Cpr2E(Int_t i) { if(i<0 || i>=NCpr2()) return -999; if(i==0) return fCpr2E0&0xFFFF; if(i==1) return (fCpr2E0>>16)&0xFFFF; if(i==2) return fCpr2E1&0xFFFF; if(i==3) return (fCpr2E1>>16)&0xFFFF; return 0; } //_____________________________________________________________________________ void TStnElectron::Clear(const char* Opt) { Error("Clear","Not implemented yet"); } //_____________________________________________________________________________ void TStnElectron::Print(const char* Opt) const { TString opt = Opt; if ( (opt == "") || (opt == "banner")) { printf("---------------------------------------------------------------"); printf("-------------------"); printf("---------------------------------------------------------------\n"); printf("Ele Fid Et Eta Phi Px Py E/p "); printf("Had/Em Lshr Z0 Zces IdWord Iso "); printf(" XCes DelX ZCes DelZ Chis Time Iso Tiso\n"); printf("---------------------------------------------------------------"); printf("-------------------"); printf("---------------------------------------------------------------\n"); } if ((opt == "data") || (opt == "")) { printf("%2d",Number()); printf(" %4x" ,((FidCode() < 999 ) ? FidCode () : 999 )); printf(" %7.3f",Momentum()->Pt()); printf(" %5.2f",Momentum()->Eta()); printf(" %6.3f",Momentum()->Phi()); printf(" %7.3f",Momentum()->Px()); printf(" %7.3f",Momentum()->Py()); printf(" %6.2f",((EOverP () < 999.99) ? EOverP () : 999.99)); printf(" %5.2f",((HadEm () < 999.99) ? HadEm () : 999.99)); printf(" %6.2f",((Lshr () < 999.99) ? Lshr () : 999.99)); printf(" %6.2f",((Z0 () < 999.99) ? Z0 () : 999.99)); printf(" %7.2f",((TrackZCes() < 999.99) ? TrackZCes() : 999.99)); printf(" 0x%08x",IDWord ()); printf(" %3i" ,IsoCode ()); printf(" %6.2f",((TrackXCes() < 999.99) ? TrackXCes() : 999.99)); printf(" %6.2f",((DelX () < 999.99) ? DelX () : 999.99)); printf(" %6.2f",((ZCes () < 999.99) ? ZCes () : 999.99)); printf(" %6.2f",((DelZ () < 999.99) ? DelZ () : 999.99)); printf(" %6.2f",((Chi2Strip() < 999.99) ? Chi2Strip() : 999.99)); printf(" %7.2f",((Time () >-999.99) ? Time () :-999.99)); printf(" %5.2f",Iso()); printf(" %5.2f",((TrackIso () < 999.99) ? TrackIso () : 999.99)); printf("\n"); } }