59 elecTrig_(cfg.getUntrackedParameter<
std::vector<
std::
string> >(
"ElecTrig")),
61 ptCut_(cfg.getUntrackedParameter<double>(
"PtCut", 10.)),
63 etaCut_(cfg.getUntrackedParameter<double>(
"EtaCut", 2.4)),
64 sieieCutBarrel_(cfg.getUntrackedParameter<double>(
"SieieBarrel", 0.01)),
65 sieieCutEndcap_(cfg.getUntrackedParameter<double>(
"SieieEndcap", 0.028)),
66 detainCutBarrel_(cfg.getUntrackedParameter<double>(
"DetainBarrel", 0.0071)),
67 detainCutEndcap_(cfg.getUntrackedParameter<double>(
"DetainEndcap", 0.0066)),
73 ecalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"EcalIsoCutBarrel", 5.7)),
74 ecalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"EcalIsoCutEndcap", 5.0)),
75 hcalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"HcalIsoCutBarrel", 8.1)),
76 hcalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"HcalIsoCutEndcap", 3.4)),
77 trkIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"TrkIsoCutBarrel", 7.2)),
78 trkIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"TrkIsoCutEndcap", 5.1)),
79 mtMin_(cfg.getUntrackedParameter<double>(
"MtMin", -999999)),
80 mtMax_(cfg.getUntrackedParameter<double>(
"MtMax", 999999.)),
81 metMin_(cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
82 metMax_(cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
99 eJetMin_(cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
100 nJetMax_(cfg.getUntrackedParameter<
int>(
"NJetMax", 999999)),
101 PUMax_(cfg.getUntrackedParameter<unsigned
int>(
"PUMax", 60)),
102 PUBinCount_(cfg.getUntrackedParameter<unsigned
int>(
"PUBinCount", 12)),
103 hltPrescaleProvider_(cfg, consumesCollector(), *this)
120 bool isConfigChanged =
false;
131 char chtitle[256] =
"";
133 pt_before_ = ibooker.
book1D(
"PT_BEFORECUTS",
"Electron transverse momentum [GeV]", 100, 0., 100.);
134 pt_after_ = ibooker.
book1D(
"PT_LASTCUT",
"Electron transverse momentum [GeV]", 100, 0., 100.);
136 eta_before_ = ibooker.
book1D(
"ETA_BEFORECUTS",
"Electron pseudo-rapidity", 50, -2.5, 2.5);
137 eta_after_ = ibooker.
book1D(
"ETA_LASTCUT",
"Electron pseudo-rapidity", 50, -2.5, 2.5);
146 ibooker.
book1D(
"DETAINBARREL_BEFORECUTS",
"Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
150 ibooker.
book1D(
"DETAINENDCAP_BEFORECUTS",
"Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
154 "ECALISOBARREL_BEFORECUTS",
"Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
156 ibooker.
book1D(
"ECALISOBARREL_LASTCUT",
"Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
159 "ECALISOENDCAP_BEFORECUTS",
"Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
161 ibooker.
book1D(
"ECALISOENDCAP_LASTCUT",
"Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
164 "HCALISOBARREL_BEFORECUTS",
"Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
166 ibooker.
book1D(
"HCALISOBARREL_LASTCUT",
"Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
169 "HCALISOENDCAP_BEFORECUTS",
"Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
171 ibooker.
book1D(
"HCALISOENDCAP_LASTCUT",
"Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
174 "TRKISOBARREL_BEFORECUTS",
"Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
176 ibooker.
book1D(
"TRKISOBARREL_LASTCUT",
"Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
179 "TRKISOENDCAP_BEFORECUTS",
"Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
181 ibooker.
book1D(
"TRKISOENDCAP_LASTCUT",
"Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
187 invmass_before_ = ibooker.
book1D(
"INVMASS_BEFORECUTS",
"Di-electron invariant mass [GeV]", 100, 0., 200.);
188 invmass_after_ = ibooker.
book1D(
"INVMASS_AFTERCUTS",
"Di-electron invariant mass [GeV]", 100, 0., 200.);
191 "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count",
199 "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count",
208 ibooker.
book1D(
"NPVs_BEFORECUTS",
"Number of Valid Primary Vertices; nGoodPVs",
PUMax_ + 1, -0.5,
PUMax_ + 0.5);
211 ibooker.
book1D(
"NPVs_AFTERZCUTS",
"Number of Valid Primary Vertices; nGoodPVs",
PUMax_ + 1, -0.5,
PUMax_ + 0.5);
216 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
220 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
metTag_.
label().data());
228 snprintf(chtitle, 255,
"Jet with highest E_{T} (%s)",
jetTag_.
label().data());
232 snprintf(chtitle, 255,
"Eta of Jet with highest E_{T} (%s)",
jetTag_.
label().data());
241 LogVerbatim(
"") <<
"\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
242 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
243 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
245 <<
"(" << setprecision(4) << esel * 100. <<
" +/- " << setprecision(2)
246 <<
sqrt(esel * (1 - esel) / all) * 100. <<
")%";
257 double err =
sqrt(eff * (1 - eff) / all);
258 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " << num <<
" [events], (" << setprecision(4) << eff * 100.
259 <<
" +/- " << setprecision(2) << err * 100. <<
")%";
264 err =
sqrt(eff * (1 - eff) / all);
268 effstep = eeid / erec;
270 errstep =
sqrt(effstep * (1 - effstep) /
nrec);
271 LogVerbatim(
"") <<
"Passing eID cuts: " << num <<
" [events], (" << setprecision(4) << eff * 100. <<
" +/- " 272 << setprecision(2) << err * 100. <<
")%, to previous step: (" << setprecision(4) << effstep * 100.
273 <<
" +/- " << setprecision(2) << errstep * 100. <<
")%";
278 err =
sqrt(eff * (1 - eff) / all);
282 effstep = eiso / eeid;
284 errstep =
sqrt(effstep * (1 - effstep) /
neid);
285 LogVerbatim(
"") <<
"Passing isolation cuts: " << num <<
" [events], (" << setprecision(4) << eff * 100.
286 <<
" +/- " << setprecision(2) << err * 100. <<
")%, to previous step: (" << setprecision(4)
287 << effstep * 100. <<
" +/- " << setprecision(2) << errstep * 100. <<
")%";
305 err =
sqrt(eff * (1 - eff) / all);
309 effstep = esel / eiso;
311 errstep =
sqrt(effstep * (1 - effstep) /
niso);
312 LogVerbatim(
"") <<
"Passing HLT criteria: " << num <<
" [events], (" << setprecision(4) << eff * 100.
313 <<
" +/- " << setprecision(2) << err * 100. <<
")%, to previous step: (" << setprecision(4)
314 << effstep * 100. <<
" +/- " << setprecision(2) << errstep * 100. <<
")%";
342 LogVerbatim(
"") <<
">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
349 bool rec_sel =
false;
350 bool eid_sel =
false;
351 bool iso_sel =
false;
352 bool all_sel =
false;
360 unsigned int electronCollectionSize = electronCollection->size();
378 const MET&
met = metCollection->at(0);
389 double met_et =
sqrt(met_px * met_px + met_py * met_py);
390 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
397 LogError(
"") <<
">>> Vertex collection does not exist !!!";
401 for (
unsigned int i = 0;
i < vertexCollection->size();
i++) {
473 if (prescaleSet == -1) {
474 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
514 float electron_et = -8.0;
515 float electron_eta = -8.0;
516 float electron_phi = -8.0;
517 float electron2_et = -9.0;
518 float electron2_eta = -9.0;
519 float electron2_phi = -9.0;
521 for (
unsigned int i = 0;
i < electronCollectionSize;
i++) {
525 electron_et = elec.
pt();
526 electron_eta = elec.
eta();
527 electron_phi = elec.
phi();
530 electron2_et = elec.
pt();
531 electron2_eta = elec.
eta();
532 electron2_phi = elec.
phi();
537 float jet_eta = -8.0;
539 float jet2_et = -9.0;
540 unsigned int jetCollectionSize = jetCollection->size();
542 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
543 const Jet&
jet = jetCollection->at(
i);
545 float jet_current_et = jet.
et();
548 if (electron_et > 0.0 && fabs(jet.
eta() - electron_eta) < 0.2 &&
calcDeltaPhi(jet.
phi(), electron_phi) < 0.2)
550 if (electron2_et > 0.0 && fabs(jet.
eta() - electron2_eta) < 0.2 &&
calcDeltaPhi(jet.
phi(), electron2_phi) < 0.2)
561 if (jet_current_et > jet_et) {
565 }
else if (jet_current_et > jet2_et) {
578 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
588 bool met_hist_done =
false;
591 bool njets_hist_done =
false;
595 const int NFLAGS = 10;
604 bool electron_sel[NFLAGS];
621 double goodElectron[2][6];
623 for (
unsigned int i = 0;
i < 2;
i++) {
624 for (
unsigned int j = 0;
j < 6;
j++) {
626 goodElectron[
i][
j] = 0.;
630 for (
unsigned int i = 0;
i < electronCollectionSize;
i++) {
631 for (
int j = 0;
j < NFLAGS; ++
j) {
632 electron_sel[
j] =
false;
640 LogTrace(
"") <<
"> elec: processing electron number " <<
i <<
"...";
648 electron[
i][2] = elec.
energy();
649 electron[
i][3] = elec.
px();
650 electron[
i][4] = elec.
py();
651 electron[
i][5] = elec.
pz();
655 double pt = elec.
pt();
656 double px = elec.
px();
657 double py = elec.
py();
659 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;
662 electron_sel[0] =
true;
664 electron_sel[1] =
true;
668 if (eta < 1.4442 && eta > -1.4442) {
670 }
else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4)) {
697 electron_sel[2] =
true;
699 electron_sel[2] =
true;
701 electron_sel[3] =
true;
703 electron_sel[3] =
true;
705 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (barrel), pass? " << electron_sel[2];
706 LogTrace(
"") <<
"\t... detain value " << detain <<
" (barrel), pass? " << electron_sel[3];
707 }
else if (isEndcap) {
708 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (endcap), pass? " << electron_sel[2];
709 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? " << electron_sel[2];
715 }
else if (isEndcap) {
731 electron_sel[4] =
true;
733 electron_sel[4] =
true;
735 electron_sel[5] =
true;
737 electron_sel[5] =
true;
739 electron_sel[6] =
true;
741 electron_sel[6] =
true;
743 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (barrel), pass? " << electron_sel[4];
744 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (barrel), pass? " << electron_sel[5];
745 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (barrel), pass? " << electron_sel[6];
746 }
else if (isEndcap) {
747 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (endcap), pass? " << electron_sel[4];
748 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (endcap), pass? " << electron_sel[5];
749 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (endcap), pass? " << electron_sel[6];
757 }
else if (isEndcap) {
767 double w_et = met_et +
pt;
768 double w_px = met_px +
px;
769 double w_py = met_py +
py;
771 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
772 massT = (massT > 0) ?
sqrt(massT) : 0;
774 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py
777 electron_sel[7] =
true;
780 electron_sel[8] =
true;
794 electron_sel[9] =
true;
797 int flags_passed = 0;
798 bool rec_sel_this =
true;
799 bool eid_sel_this =
true;
800 bool iso_sel_this =
true;
801 bool all_sel_this =
true;
802 for (
int j = 0;
j < NFLAGS; ++
j) {
805 if (j < 2 && !electron_sel[j])
806 rec_sel_this =
false;
807 if (j < 4 && !electron_sel[j])
808 eid_sel_this =
false;
809 if (j < 7 && !electron_sel[j])
810 iso_sel_this =
false;
811 if (!electron_sel[j])
812 all_sel_this =
false;
851 if (flags_passed >= (NFLAGS - 1)) {
852 if (!electron_sel[0] || flags_passed == NFLAGS) {
855 if (!electron_sel[1] || flags_passed == NFLAGS) {
858 if (!electron_sel[2] || flags_passed == NFLAGS) {
861 }
else if (isEndcap) {
865 if (!electron_sel[3] || flags_passed == NFLAGS) {
868 }
else if (isEndcap) {
872 if (!electron_sel[4] || flags_passed == NFLAGS) {
875 }
else if (isEndcap) {
879 if (!electron_sel[5] || flags_passed == NFLAGS) {
882 }
else if (isEndcap) {
886 if (!electron_sel[6] || flags_passed == NFLAGS) {
889 }
else if (isEndcap) {
915 if (!electron_sel[7] || flags_passed == NFLAGS) {
918 if (!electron_sel[8] || flags_passed == NFLAGS) {
919 if (!met_hist_done) {
923 met_hist_done =
true;
934 if (!electron_sel[9] || flags_passed == NFLAGS) {
935 if (!njets_hist_done) {
944 njets_hist_done =
true;
955 if (electronCollectionSize > 1) {
957 sqrt(electron[0][1] + electron[1][1] +
958 2 * (electron[0][2] * electron[1][2] - (electron[0][3] * electron[1][3] + electron[0][4] * electron[1][4] +
959 electron[0][5] * electron[1][5])));
966 invMass =
sqrt(goodElectron[0][1] + goodElectron[1][1] +
967 2 * (goodElectron[0][2] * goodElectron[1][2] -
968 (goodElectron[0][3] * goodElectron[1][3] + goodElectron[0][4] * goodElectron[1][4] +
969 goodElectron[0][5] * goodElectron[1][5])));
987 LogTrace(
"") <<
">>>> Event ACCEPTED";
989 LogTrace(
"") <<
">>>> Event REJECTED";
1002 if (deltaPhi > 3.1415926) {
1003 deltaPhi = 2 * 3.1415926 -
deltaPhi;
MonitorElement * ecalisoendcap_after_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
MonitorElement * jet_et_after_
unsigned int nGoodElectrons
MonitorElement * invmass_after_
MonitorElement * hcalisobarrel_after_
double eta() const final
momentum pseudorapidity
MonitorElement * nelectrons_before_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * sieieendcap_before_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * sieieendcap_after_
void setCurrentFolder(std::string const &fullpath)
bool isValid() const
Tells whether the vertex is valid.
MonitorElement * ecalisobarrel_before_
double px() const final
x coordinate of momentum vector
MonitorElement * sieiebarrel_before_
MonitorElement * hcalisobarrel_before_
float dr04TkSumPt() const
double pt() const final
transverse momentum
MonitorElement * detainbarrel_after_
MonitorElement * ecalisobarrel_after_
MonitorElement * detainendcap_before_
MonitorElement * sieiebarrel_after_
MonitorElement * detainbarrel_before_
MonitorElement * mt_before_
MonitorElement * nelectrons_after_
MonitorElement * hcalisoendcap_before_
MonitorElement * npvs_afterZ_
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * mt_after_
float deltaEtaSuperClusterTrackAtVtx() const
float sigmaIetaIeta() const
MonitorElement * jet_et_before_
MonitorElement * njets_after_
MonitorElement * pt_before_
MonitorElement * pt_after_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
double et() const final
transverse energy
double pz() const final
z coordinate of momentum vector
MonitorElement * hcalisoendcap_after_
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
double energy() const final
energy
EwkElecDQM(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * invmass_before_
MonitorElement * ecalisoendcap_before_
MonitorElement * jet_eta_after_
bool isEndcap(GeomDetEnumerators::SubDetector m)
MonitorElement * jet_eta_before_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
MonitorElement * invmassPU_afterZ_
MonitorElement * trkisobarrel_before_
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
MonitorElement * met_before_
MonitorElement * trkisoendcap_before_
double py() const final
y coordinate of momentum vector
double massSqr() const final
mass squared
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
float dr03EcalRecHitSumEt() const
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * met_after_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
void HERE(const char *msg)
MonitorElement * trkisobarrel_after_
MonitorElement * eta_after_
MonitorElement * npvs_before_
MonitorElement * trkisoendcap_after_
float dr03HcalTowerSumEt() const
HLTPrescaleProvider hltPrescaleProvider_
double phi() const final
momentum azimuthal angle
MonitorElement * eta_before_
MonitorElement * invmassPU_before_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &, const edm::EventSetup &) override