#include #include "TH1F.h" #include "Stntuple/alg/TStnElectronID.hh" #include "Stntuple/obj/TStnElectron.hh" #include "Stntuple/obj/TStnTrack.hh" #include "Stntuple/alg/TStntuple.hh" ClassImp(TStnElectronID) //_____________________________________________________________________________ void TStnElectronID::ReadV1(TBuffer& R__b) { struct TStnElectronID_V1_t { TObject fObject; Int_t fFidEleTight; Int_t fFidEleLoose; Float_t fMaxEta; Float_t fMinEt; Float_t fMaxHadEm; Float_t fHadEmSlope; Float_t fMaxIso; Float_t fMaxTIso; Float_t fMaxIso1; Float_t fMinPt; Float_t fMinNCotAxHits; // min number of hits per segment Float_t fMinNCotStHits; Float_t fMinNCotAxSeg; // min number of segments per track Float_t fMinNCotStSeg; Float_t fMaxD0; Float_t fMaxChi2Strip; Float_t fMaxXCes; Float_t fMinZCes; Float_t fMaxZCes; Float_t fMaxZ0; Float_t fMinDelX; Float_t fMaxDelX; Float_t fMaxDelZ; Float_t fMinEOverP; Float_t fMaxEOverP; Float_t fMaxLshr; Float_t fMaxLshr2; Float_t fMaxBcZ0; Float_t fMinBcDelX; Float_t fMaxBcDelX; Float_t fMaxBcDelZ; Float_t fMinLooseEt; Float_t fMinLoosePt; Float_t fMaxLooseEta; Float_t fMaxLooseXCes; Float_t fMinLooseZCes; Float_t fMaxLooseZCes; Int_t fLooseCentral; // if 1 use only central electrons } id ; id.fObject.Streamer(R__b); R__b >> id.fFidEleTight; R__b >> id.fFidEleLoose; R__b >> id.fMaxEta; R__b >> id.fMinEt; R__b >> id.fMaxHadEm; R__b >> id.fHadEmSlope; R__b >> id.fMaxIso; R__b >> id.fMaxTIso; R__b >> id.fMaxIso1; R__b >> id.fMinPt; R__b >> id.fMinNCotAxHits; R__b >> id.fMinNCotStHits; R__b >> id.fMinNCotAxSeg; R__b >> id.fMinNCotStSeg; R__b >> id.fMaxD0; R__b >> id.fMaxChi2Strip; R__b >> id.fMaxXCes; R__b >> id.fMinZCes; R__b >> id.fMaxZCes; R__b >> id.fMaxZ0; R__b >> id.fMinDelX; R__b >> id.fMaxDelX; R__b >> id.fMaxDelZ; R__b >> id.fMinEOverP; R__b >> id.fMaxEOverP; R__b >> id.fMaxLshr; R__b >> id.fMaxLshr2; R__b >> id.fMaxBcZ0; R__b >> id.fMinBcDelX; R__b >> id.fMaxBcDelX; R__b >> id.fMaxBcDelZ; R__b >> id.fMinLooseEt; R__b >> id.fMinLoosePt; R__b >> id.fMaxLooseEta; R__b >> id.fMaxLooseXCes; R__b >> id.fMinLooseZCes; R__b >> id.fMaxLooseZCes; R__b >> id.fLooseCentral; fUseMask = 0xFFFFFFFF; //----------------------------------------------------------------------------- // in principle need to copy back - later ! //----------------------------------------------------------------------------- } //______________________________________________________________________________ void TStnElectronID::Streamer(TBuffer &R__b) { // Stream an object of class TStnElectronID. v2 current UInt_t R__s, R__c; int nwi = ((Int_t* )&fMaxMomEta)-&fLooseCentral; int nwf = ((Float_t*)&fEOR )-&fMaxMomEta; if (R__b.IsReading()) { Version_t R__v = R__b.ReadVersion(&R__s, &R__c); if (R__v == 1) ReadV1(R__b); else if (R__v >= 2) { //----------------------------------------------------------------------------- // version 2,3 //----------------------------------------------------------------------------- TNamed::Streamer(R__b); R__b.ReadFastArray(&fLooseCentral,nwi); R__b.ReadFastArray(&fMaxMomEta ,nwf); } R__b.CheckByteCount(R__s, R__c, TStnElectronID::IsA()); } else { R__c = R__b.WriteVersion(TStnElectronID::IsA(), kTRUE); TNamed::Streamer(R__b); R__b.WriteFastArray(&fLooseCentral,nwi); R__b.WriteFastArray(&fMaxMomEta ,nwf); R__b.SetByteCount(R__c, kTRUE); } } //_____________________________________________________________________________ TStnElectronID::TStnElectronID(const char* Name, const char* Title): TNamed(Name,Title) { // we are using 2-tower Et, but 3-tower Lshr... fMaxDetEta = 1.2; // need it only for the fake rates fMaxMomEta = 10.; // need it only for tau ID eff's fFidEleTight = 4; // seed track as extrapolated into CES plane fMinEt = 20.; fMinEOverP = 0.5; fMaxEOverP = 2.0; fMaxIso = 1.e6; fMaxIso1 = 0.1; fMaxTIso = 1.e6; fMaxHadEm = 0.05; fHadEmSlope = 0.00045; fMinPt = 10.; fMinNCotAxHits = 5; // for 5.3 fMinNCotStHits = 5; fMinNCotAxSeg = 3; fMinNCotStSeg = 3; //----------------------------------------------------------------------------- // by default check only beam-constrained Z0, however may want to do different //----------------------------------------------------------------------------- fMaxZ0 = 1.e10; fMaxD0 = 1.e6; fMaxBcZ0 = 60.; fMaxChi2Strip = 10. ; fMinZCes = 9. ; fMaxXCes = 21.5; fMaxZCes = 230.; fMinDelX = -1.e10; fMaxDelX = 1.e10; fMaxDelZ = 1.e10; fMinBcDelX = -3.; fMaxBcDelX = 1.5; fMaxBcDelZ = 3.; fMaxLshr = 0.2; fMaxLshr2 = 1.e6; //----------------------------------------------------------------------------- // standard loose electron cuts: by default only count loose central electrons //----------------------------------------------------------------------------- fLooseCentral = 1; fFidEleLoose = 4; fMinLooseEt = 20; fMinLoosePt = 10; fMaxLooseEta = 100; fMinLooseZCes = 9.; fMaxLooseZCes = 230.; fMaxLooseXCes = 21.5; //----------------------------------------------------------------------------- // standard loose electron cuts: by default only count loose central electrons //----------------------------------------------------------------------------- fMinPlugEt = 20.0; fMaxPlugIso1 = 0.1; fUseMask = 0xFFFFFFFF; fCalcNCotSeg = 0; } //_____________________________________________________________________________ TStnElectronID::~TStnElectronID() { } //_____________________________________________________________________________ int TStnElectronID::IDWord(TStnElectron* Ele) { // standard ETF cuts for high-Pt electrons // we are using 2-tower Et, but 3-tower Lshr... // use isolation corrected for the leakage across the wedges double d0, sdx, sbcdx; Int_t n_ax_seg, n_st_seg; TStnTrack* trk; TStntuple* stn = TStntuple::Instance(); Int_t id_word = 0; double det_eta = Ele->DetEta(); double trk_eta = Ele->Momentum()->Eta(); double atr_eta = TMath::Abs(trk_eta); double et = Ele->Et()*Ele->Etcor(); double iso1_corr = Ele->Iso1Corr(); double iso_corr = Ele->IsoCorr(); double pt, ep ; //----------------------------------------------------------------------------- // note that track pointer should be set by you! //----------------------------------------------------------------------------- trk = Ele->Track(); if (trk) { pt = stn->LarrysPt(trk,1); ep = fabs(et/pt); } else { pt = Ele->TrackPt(); ep = Ele->EP(); } double max_hadem = fMaxHadEm+fHadEmSlope*Ele->BcE(); double scaled_chi2 = stn->ScaledCesChi2(Ele->Chi2Strip(),Ele->BcE()); if (! Ele->IsCentral() ) id_word |= kCentralBit; if (Ele->FidEleTrk() != fFidEleTight ) id_word |= kFidEleBit; if (et < fMinEt ) id_word |= kEtBit ; if (Ele->HadEm() > max_hadem ) id_word |= kHadEmBit; if (atr_eta > fMaxMomEta ) id_word |= kHadEmBit; if (iso_corr > fMaxIso ) id_word |= kIsoBit; if (iso1_corr > fMaxIso1 ) id_word |= kIso1Bit; if (Ele->TrackIso() > fMaxTIso ) id_word |= kTIsoBit; if (trk == NULL) { //----------------------------------------------------------------------------- // electron doesn't have a track, check chi^2 on both branches //----------------------------------------------------------------------------- id_word |= kPtBit; id_word |= kCotNAxBit; id_word |= kCotNStBit; id_word |= kTrackZ0Bit; id_word |= kTrackD0Bit; if (scaled_chi2 > fMaxChi2Strip ) id_word |= kChi2StripBit; id_word |= kXCesBit; id_word |= kZCesBit; id_word |= kDelXBit; id_word |= kDelZBit; } else { //----------------------------------------------------------------------------- // electron has a track, axial SL's have even numbers //----------------------------------------------------------------------------- d0 = TStntuple::CorrectedD0(Ele); sdx = Ele->DelX ()*Ele->Charge(); sbcdx = Ele->BcDelX()*Ele->Charge(); if (fCalcNCotSeg == 0) { n_ax_seg = trk->NAxSeg(); n_st_seg = trk->NStSeg(); } else { n_ax_seg = trk->NCotAxSeg(int(fMinNCotAxHits)); n_st_seg = trk->NCotStSeg(int(fMinNCotStHits)); } if (Ele->TrackBcPt() < fMinPt ) id_word |= kPtBit; if (n_ax_seg < fMinNCotAxSeg ) id_word |= kCotNAxBit; if (n_st_seg < fMinNCotStSeg ) id_word |= kCotNStBit; if (TMath::Abs(d0) > fMaxD0 ) id_word |= kTrackD0Bit; if ((ep < fMinEOverP) || (ep > fMaxEOverP) ) id_word |= kEOverPBit; if (scaled_chi2 > fMaxChi2Strip ) id_word |= kChi2StripBit; //----------------------------------------------------------------------------- // cut independently on beam-constrained and unconstrained parameters //----------------------------------------------------------------------------- if (TMath::Abs(Ele->Z0()) > fMaxZ0 ) id_word |= kTrackZ0Bit; if ((sdx > fMaxDelX) || (sdx < fMinDelX) ) id_word |= kDelXBit; if (TMath::Abs(Ele->DelZ()) > fMaxDelZ ) id_word |= kDelZBit; //----------------------------------------------------------------------------- // beam-constrained ones //----------------------------------------------------------------------------- // if (fabs(Ele->TrackBcZ0()) > fMaxBcZ0 ) id_word |= kTrackBcZ0Bit; if (fabs(trk->BcZ0()) > fMaxBcZ0 ) id_word |= kTrackBcZ0Bit; if ((sbcdx > fMaxBcDelX) || (sbcdx < fMinBcDelX)) id_word |= kTrackBcDelXBit; if (fabs(Ele->BcDelZ()) > fMaxBcDelZ ) id_word |= kTrackBcDelZBit; if ( (TMath::Abs(Ele->TrackZCes()) < fMinZCes) || (TMath::Abs(Ele->TrackZCes()) > fMaxZCes) ) { id_word |= kZCesBit; } if (TMath::Abs(Ele->TrackXCes()) > fMaxXCes ) id_word |= kXCesBit; } if (TMath::Abs(Ele->Lshr ()) > fMaxLshr ) id_word |= kLshrBit; // if (TMath::Abs(Ele->Lshr2 ()) > fMaxLshr2) id_word |= kLshr2Bit; return (id_word & fUseMask); } //_____________________________________________________________________________ int TStnElectronID::TightIDWord(TStnElectron* Ele) { // "tight" (in top analysis sense) electron ID return IDWord(Ele); } //_____________________________________________________________________________ int TStnElectronID::LooseIDWord(TStnElectron* Ele) { // loose electron ID: require electron to be central (including the check of // detector eta) and track-based FidEle, then check only Et, Pt and Z(CES) int id_word = 0; double deteta = Ele->DetEta(); double iso1_corr = Ele->Iso1Corr(); double iso_corr = Ele->IsoCorr(); double max_hadem = fMaxHadEm+fHadEmSlope*Ele->BcE(); TStnTrack* trk = Ele->Track(); //----------------------------------------------------------------------------- // electron cuts, if fMinLoosePt == 0 check only Et //----------------------------------------------------------------------------- if (Ele->Et() < fMinLooseEt ) id_word |= kEtBit; if (fLooseCentral) { if (! Ele->IsCentral() ) id_word |= kCentralBit; } if (fMinLoosePt > 0) { if (iso_corr > fMaxIso ) id_word |= kIsoBit; if (iso1_corr > fMaxIso1 ) id_word |= kIso1Bit; if (Ele->HadEm() > max_hadem ) id_word |= kHadEmBit; //----------------------------------------------------------------------------- // fMinLoosePt > 0: check track-based quantities //----------------------------------------------------------------------------- if (! trk ) id_word |= kTrackBcZ0Bit; else if (fabs(trk->BcZ0()) > fMaxBcZ0 ) id_word |= kTrackBcZ0Bit; else if (fabs(Ele->Z0 ()) > fMaxZ0 ) id_word |= kTrackZ0Bit; if (fabs(deteta) > fMaxLooseEta ) id_word |= kDetEtaBit; if (fLooseCentral) { //----------------------------------------------------------------------------- // CES fiducial cuts are the same as for tight electrons //----------------------------------------------------------------------------- if (Ele->FidEleTrk() != fFidEleLoose ) id_word |= kFidEleBit; if (Ele->TrackPt() < fMinLoosePt ) id_word |= kPtBit; if ( fabs(Ele->TrackXCes()) > fMaxLooseXCes) id_word |= kXCesBit; if ( (fabs(Ele->TrackZCes()) < fMinLooseZCes) || (fabs(Ele->TrackZCes()) > fMaxLooseZCes) ) { id_word |= kZCesBit; } } } return (id_word & fUseMask); } //_____________________________________________________________________________ int TStnElectronID::PlugIDWord(TStnElectron* Ele) { // plug electron ID: require electron to be central (including the check of // detector eta) and track-based FidEle, then check only Et, Pt and Z(CES) int id_word = 0; double deteta = Ele->DetEta(); double peseta = Ele->PesEta(); TStnTrack* trk = Ele->Track(); //----------------------------------------------------------------------------- if ( ! Ele->IsPlug() ) id_word |= kDetectorBit; //----------------------------------------------------------------------------- // fMinLoosePt > 0: check track-based quantities //----------------------------------------------------------------------------- if (fabs(peseta) > 2.8 ) id_word |= kDetEtaBit; if (fabs(peseta) < 1.2 ) id_word |= kDetEtaBit; if (Ele->Et() < fMinPlugEt ) id_word |= kEtBit; //----------------------------------------------------------------------------- // PES //----------------------------------------------------------------------------- if ((Ele->Pes5x9(0) < 0.65) || (Ele->Pes5x9(0)>1.0) || (Ele->Pes5x9(1) < 0.65) || (Ele->Pes5x9(1)>1.0) ) id_word |= kPes5x9Bit; if (Ele->Pem3x3FitTower() == 0 ) id_word |= kPemFitTowerBit; if (Ele->Chi2Three() > 10. ) id_word |= kPemChi2Bit; double max_hadem; if (Ele->EmE() < 100) max_hadem = 0.05; else max_hadem = 0.05+0.0026*TMath::Log(Ele->EmE()/100.); if (Ele->HadEm() > max_hadem ) id_word |= kHadEmBit; // this should be defined separately // for the plug, so far it is 0 // note that for plug electrons isolation // leakage is not yet defined in Stntuple double iso1_corr = Ele->Iso1Corr(); if (iso1_corr > fMaxPlugIso1 ) id_word |= kIso1Bit; return (id_word & fUseMask); } //_____________________________________________________________________________ // distributions for ID variables // Plot 5 sets of histograms: // -------------------------- // set 1: for all the electrons // set 2: for the parameter given all the rest cuts were successfull // set 3&4: for the cuts in sequence they are applied // // Mode = 1 : tight ID // Mode = 2 : loose ID //----------------------------------------------------------------------------- void TStnElectronID::FillHistograms(Hist_t& Hist, TStnElectron* Ele, Int_t Mode) { int id_word; TStntuple* stn = TStntuple::Instance(); TStnTrack* trk; const TLorentzVector* mom = Ele->Momentum(); // iele = Ele->Number(); if (Mode == 1) id_word = IDWord(Ele); else if (Mode == 2) id_word = LooseIDWord(Ele); double det_eta = Ele->DetEta(); double mom_eta = mom->Eta(); double et = Ele->Et(); // *Ele->Etcor(); double iso_corr = Ele->IsoCorr(); double iso1_corr = Ele->Iso1Corr(); double ep = et/Ele->TrackBcPt(); double max_hadem = MaxHadEm()+HadEmSlope()*Ele->E(); double scaled_chi2 = stn->ScaledCesChi2(Ele->Chi2Strip(),Ele->E()); //----------------------------------------------------------------------------- // 0. acceptance //----------------------------------------------------------------------------- Hist.fCentral[0]->Fill(Ele->IsCentral()); if ((id_word & ~kCentralBit) == 0) Hist.fCentral[1]->Fill(Ele->IsCentral()); if (id_word == 0) Hist.fCentral[4]->Fill(Ele->IsCentral()); // Hist.fSeedIEta[0]->Fill(Ele->SeedIEta()); // if ((id_word & ~kSeedIEtaBit) == 0) Hist.fSeedIEta[1]->Fill(Ele->SeedIEta()); // if (id_word == 0) Hist.fSeedIEta[4]->Fill(Ele->SeedIEta()); // Hist.fWedgeNumber[0]->Fill(Ele->WedgeNumber()); // if ((id_word & ~kSeedIEtaBit) == 0) // Hist.fWedgeNumber[1]->Fill(Ele->WedgeNumber()); // if (id_word == 0) Hist.fWedgeNumber[4]->Fill(Ele->WedgeNumber()); Hist.fDetEta[0]->Fill(Ele->DetEta()); if ((id_word & ~kDetEtaBit) == 0) Hist.fDetEta[1]->Fill(Ele->DetEta()); if (id_word == 0) Hist.fDetEta[4]->Fill(Ele->DetEta()); // Hist.fMomEta[0]->Fill(mom_eta); // if ((id_word & ~kMomEtaBit) == 0) Hist.fMomEta[1]->Fill(mom_eta); // if (id_word == 0) Hist.fMomEta[4]->Fill(mom_eta); Hist.fFidEle[0]->Fill(Ele->FidEleTrk()); if ((id_word & ~kFidEleBit) == 0) Hist.fFidEle[1]->Fill(Ele->FidEleTrk()); if (id_word == 0) Hist.fFidEle[4]->Fill(Ele->FidEleTrk()); //----------------------------------------------------------------------------- // 4. electron Et //----------------------------------------------------------------------------- Hist.fEt[0]->Fill(et); if ((id_word & ~kEtBit ) == 0) Hist.fEt[1]->Fill(et); if (id_word == 0) Hist.fEt[4]->Fill(et); //----------------------------------------------------------------------------- // 2. HAD/EM //----------------------------------------------------------------------------- Hist.fHadEm[0]->Fill(Ele->HadEm()); if ((id_word & ~kHadEmBit) == 0) Hist.fHadEm[1]->Fill(Ele->HadEm()); if (id_word == 0) Hist.fHadEm[4]->Fill(Ele->HadEm()); //----------------------------------------------------------------------------- // 1. calorimetry isolation //----------------------------------------------------------------------------- Hist.fIso[0]->Fill(iso_corr); if ((id_word & ~kIsoBit) == 0) Hist.fIso[1]->Fill(iso_corr); if (id_word == 0) Hist.fIso[4]->Fill(iso_corr); Hist.fIso1[0]->Fill(iso1_corr); if ((id_word & ~kIso1Bit) == 0) Hist.fIso1[1]->Fill(iso1_corr); if (id_word == 0) Hist.fIso1[4]->Fill(iso1_corr); Hist.fTIso[0]->Fill(Ele->TrackIso()); if ((id_word & ~kTIsoBit) == 0) Hist.fTIso[1]->Fill(Ele->TrackIso()); if (id_word == 0) Hist.fTIso[4]->Fill(Ele->TrackIso()); //----------------------------------------------------------------------------- // 9. fill track histograms - cut on corrected D0 //----------------------------------------------------------------------------- double d0_corr = 1.e6; int n_ax_seg = -1; int n_st_seg = -1; // track should already be set! trk = Ele->Track(); if (trk) { // electron has a track d0_corr = TStntuple::CorrectedD0(trk); n_ax_seg = trk->NAxSeg(); n_st_seg = trk->NStSeg(); } Hist.fTrackPt[0]->Fill(Ele->TrackPt()); if ((id_word & ~kPtBit) == 0) Hist.fTrackPt[1]->Fill(Ele->TrackPt()); if (id_word == 0) Hist.fTrackPt[4]->Fill(Ele->TrackPt()); Hist.fTrackD0[0]->Fill(d0_corr); if ((id_word & ~kTrackD0Bit) == 0) Hist.fTrackD0[1]->Fill(d0_corr); if (id_word == 0) Hist.fTrackD0[4]->Fill(d0_corr); Hist.fTrackZ0[0]->Fill(Ele->Z0()); if ((id_word & ~kTrackZ0Bit) == 0) Hist.fTrackZ0[1]->Fill(Ele->Z0()); if (id_word == 0) Hist.fTrackZ0[4]->Fill(Ele->Z0()); Hist.fCotNAxSeg[0]->Fill(n_ax_seg); if ((id_word & ~kCotNAxBit) == 0) Hist.fCotNAxSeg[1]->Fill(n_ax_seg); if (id_word == 0) Hist.fCotNAxSeg[4]->Fill(n_ax_seg); Hist.fCotNStSeg[0]->Fill(n_st_seg); if ((id_word & ~kCotNStBit) == 0) Hist.fCotNStSeg[1]->Fill(n_st_seg); if (id_word == 0) Hist.fCotNStSeg[4]->Fill(n_st_seg); //----------------------------------------------------------------------------- // 2.5 E/P //----------------------------------------------------------------------------- Hist.fEOverP[0]->Fill(ep); if ((id_word & ~kEOverPBit) == 0) Hist.fEOverP[1]->Fill(ep); if (id_word == 0) Hist.fEOverP[4]->Fill(ep); //----------------------------------------------------------------------------- // 6. CES //----------------------------------------------------------------------------- Hist.fChi2Strip[0]->Fill(scaled_chi2); if ((id_word & ~kChi2StripBit) == 0) Hist.fChi2Strip[1]->Fill(scaled_chi2); if (id_word == 0) Hist.fChi2Strip[4]->Fill(scaled_chi2); Hist.fXCes[0]->Fill(Ele->XCes()); if ((id_word & ~kXCesBit) == 0) Hist.fXCes[1]->Fill(Ele->XCes()); if (id_word == 0) Hist.fXCes[4]->Fill(Ele->XCes()); Hist.fZCes[0]->Fill(TMath::Abs(Ele->ZCes())); if ((id_word & ~kZCesBit) == 0) Hist.fZCes[1]->Fill(TMath::Abs(Ele->ZCes())); if (id_word == 0) Hist.fZCes[4]->Fill(Ele->ZCes()); Hist.fDelX[0]->Fill(Ele->BcDelX()); if ((id_word & ~kDelXBit) == 0) Hist.fDelX[1]->Fill(Ele->BcDelX()); if (id_word == 0) Hist.fDelX[4]->Fill(Ele->BcDelX()); Hist.fDelZ[0]->Fill(Ele->BcDelZ()); if ((id_word & ~kDelZBit) == 0) Hist.fDelZ[1]->Fill(Ele->BcDelZ()); if (id_word == 0) Hist.fDelZ[4]->Fill(Ele->BcDelZ()); //----------------------------------------------------------------------------- // 8. LSHR //----------------------------------------------------------------------------- Hist.fLshr [0]->Fill(Ele->Lshr ()); if ((id_word & ~kLshrBit) == 0) Hist.fLshr[1]->Fill(Ele->Lshr()); if (id_word == 0) Hist.fLshr[4]->Fill(Ele->Lshr()); // Hist.fLshr2[0]->Fill(Ele->Lshr2()); // if ((id_word & ~kLshr2Bit) == 0) Hist.fLshr2[1]->Fill(Ele->Lshr2()); // if (id_word == 0) Hist.fLshr2[4]->Fill(Ele->Lshr2()); //----------------------------------------------------------------------------- // single histogram showing how often every particular cut failed //----------------------------------------------------------------------------- for (int bit=0; bit<32; bit++) { if (((id_word >> bit) & 0x1) == 1) { Hist.fFailedBits->Fill(bit); } } Hist.fPassed->Fill(id_word == 0); //----------------------------------------------------------------------------- // ***** now histogram effect of cuts in the order they are applied //----------------------------------------------------------------------------- Hist.fCentral[2]->Fill(Ele->IsCentral()); if ((id_word & kCentralBit) != 0) goto END; Hist.fCentral[3]->Fill(Ele->IsCentral()); // Hist.fSeedIEta[2]->Fill(Ele->SeedIEta()); // if ((id_word & kSeedIEtaBit) != 0) goto END; // Hist.fSeedIEta[3]->Fill(Ele->SeedIEta()); // Hist.fWedgeNumber[2]->Fill(Ele->WedgeNumber()); // if ((id_word & kWedgeNumberBit) != 0) goto END; // Hist.fWedgeNumber[3]->Fill(Ele->WedgeNumber()); Hist.fDetEta[2]->Fill(Ele->DetEta()); if ((id_word & kDetEtaBit) != 0) goto END; Hist.fDetEta[3]->Fill(Ele->DetEta()); // Hist.fMomEta[2]->Fill(mom_eta); // if ((id_word & kMomEtaBit) != 0) goto END; // Hist.fMomEta[3]->Fill(mom_eta); Hist.fFidEle[2]->Fill(Ele->FidEleTrk()); if ((id_word & kFidEleBit) != 0) goto END; Hist.fFidEle[3]->Fill(Ele->FidEleTrk()); //----------------------------------------------------------------------------- // calorimetry //----------------------------------------------------------------------------- Hist.fEt[2]->Fill(et); if ((id_word & kEtBit ) != 0) goto END; Hist.fEt[3]->Fill(et); Hist.fHadEm[2]->Fill(Ele->HadEm()); if ((id_word & kHadEmBit) != 0) goto END; Hist.fHadEm[3]->Fill(Ele->HadEm()); //----------------------------------------------------------------------------- // isolation part //----------------------------------------------------------------------------- Hist.fIso[2]->Fill(iso_corr); if ((id_word & kIsoBit) != 0) goto END; Hist.fIso[3]->Fill(iso_corr); Hist.fIso1[2]->Fill(iso1_corr); if ((id_word & kIso1Bit) != 0) goto END; Hist.fIso1[3]->Fill(iso1_corr); Hist.fTIso[2]->Fill(Ele->TrackIso()); if ((id_word & kTIsoBit) != 0) goto END; Hist.fTIso[3]->Fill(Ele->TrackIso()); //----------------------------------------------------------------------------- // Tracking part //----------------------------------------------------------------------------- Hist.fTrackPt[2]->Fill(Ele->TrackPt()); if ((id_word & kPtBit) != 0) goto END; Hist.fTrackPt[3]->Fill(Ele->TrackPt()); Hist.fTrackD0[2]->Fill(d0_corr); if ((id_word & kTrackD0Bit) != 0) goto END; Hist.fTrackD0[3]->Fill(d0_corr); Hist.fTrackZ0[2]->Fill(Ele->Z0()); if ((id_word & kTrackZ0Bit) != 0) goto END; Hist.fTrackZ0[3]->Fill(Ele->Z0()); Hist.fCotNAxSeg[2]->Fill(n_ax_seg); if ((id_word & kCotNAxBit) != 0) goto END; Hist.fCotNAxSeg[3]->Fill(n_ax_seg); Hist.fCotNStSeg[2]->Fill(n_st_seg); if ((id_word & kCotNStBit) != 0) goto END; Hist.fCotNStSeg[3]->Fill(n_st_seg); //----------------------------------------------------------------------------- // E/P //----------------------------------------------------------------------------- Hist.fEOverP[2]->Fill(ep); if ((id_word & kEOverPBit) != 0) goto END; Hist.fEOverP[3]->Fill(ep); //----------------------------------------------------------------------------- // CES //----------------------------------------------------------------------------- Hist.fChi2Strip[2]->Fill(scaled_chi2); if ((id_word & kChi2StripBit) != 0) goto END; Hist.fChi2Strip[3]->Fill(scaled_chi2); Hist.fXCes[2]->Fill(Ele->XCes()); if ((id_word & kXCesBit) != 0) goto END; Hist.fXCes[3]->Fill(Ele->XCes()); Hist.fZCes[2]->Fill(TMath::Abs(Ele->ZCes())); if ((id_word & kZCesBit) != 0) goto END; Hist.fZCes[3]->Fill(TMath::Abs(Ele->ZCes())); Hist.fDelX[2]->Fill(Ele->BcDelX()); if ((id_word & kDelXBit) != 0) goto END; Hist.fDelX[3]->Fill(Ele->BcDelX()); Hist.fDelZ[2]->Fill(Ele->BcDelZ()); if ((id_word & kDelZBit) != 0) goto END; Hist.fDelZ[3]->Fill(Ele->BcDelZ()); //----------------------------------------------------------------------------- // LSHR //----------------------------------------------------------------------------- Hist.fLshr[2]->Fill(Ele->Lshr()); if ((id_word & kLshrBit) != 0) goto END; Hist.fLshr[3]->Fill(Ele->Lshr()); // Hist.fLshr2[2]->Fill(Ele->Lshr2()); // if ((id_word & kLshr2Bit) != 0) goto END; // Hist.fLshr2[3]->Fill(Ele->Lshr2()); END:; } //_____________________________________________________________________________ void TStnElectronID::Print(const char* Opt) const { printf("---------------------- electron ID cuts -----------------------\n"); printf(" bit 5: fFidEleTight = %12i\n" ,fFidEleTight); printf(" bit 5: fMaxMomEta = %12.4f\n",fMaxMomEta); printf(" bit 5: fMinEt = %12.4f\n",fMinEt ); printf(" bit 5: fMinPt = %12.4f\n",fMinPt ); printf(" bit 6: fMaxHadEm = %12.4f\n",fMaxHadEm ); printf(" bit 6: fHadEmSlope = %12.4f\n",fHadEmSlope); printf(" bit 7: fMaxIso = %12.4f\n",fMaxIso ); printf(" bit 8: fMaxIso1 = %12.4f\n",fMaxIso1 ); printf(" bit 9: fMaxTIso = %12.4f\n",fMaxTIso ); printf(" bit 11: fMinNCotAxHits = %12i\n" ,fMinNCotAxHits); printf(" bit 12: fMinNCotStHits = %12i\n" ,fMinNCotStHits); printf(" bit 11: fMinNCotAxSeg = %12i\n" ,fMinNCotAxSeg); printf(" bit 12: fMinNCotStSeg = %12i\n" ,fMinNCotStSeg); printf(" bit 13: fMaxZ0 = %12.4f\n",fMaxZ0 ); printf(" bit 14: fMaxD0 = %12.4f\n",fMaxD0 ); printf(" bit 15: fMinEOverP = %12.4f\n",fMinEOverP); printf(" bit 15: fMaxEOverP = %12.4f\n",fMaxEOverP); printf(" bit 16: fMaxChi2Strip = %12.4f\n",fMaxChi2Strip); printf(" bit 17: fMaxXCes = %12.4f\n",fMaxXCes ); printf(" bit 18: fMinZCes = %12.4f\n",fMinZCes ); printf(" bit 18: fMaxZCes = %12.4f\n",fMaxZCes ); printf(" bit 19: fMinDelX = %12.4f\n",fMinDelX ); printf(" bit 19: fMaxDelX = %12.4f\n",fMaxDelX ); printf(" bit 20: fMaxDelZ = %12.4f\n",fMaxDelZ ); printf(" bit 21: fMaxLshr = %12.4f\n",fMaxLshr ); // printf(" bit 22: fMaxLshr2 = %12.4f\n",fMaxLshr2 ); printf(" bit 23: fMaxBcZ0 = %12.4f\n",fMaxBcZ0 ); }