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. <<
")%";
258 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " <<
num <<
" [events], (" << setprecision(4) << eff * 100.
259 <<
" +/- " << setprecision(2) <<
err * 100. <<
")%";
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. <<
")%";
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. <<
")%";
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;
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 !!!";
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;
542 for (
unsigned int i = 0;
i < jetCollectionSize;
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 <<
"...";
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];
708 LogTrace(
"") <<
"\t... sieie value " <<
sieie <<
" (endcap), pass? " << electron_sel[2];
709 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? " << electron_sel[2];
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];
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];
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) {
865 if (!electron_sel[3] || flags_passed == NFLAGS) {
872 if (!electron_sel[4] || flags_passed == NFLAGS) {
879 if (!electron_sel[5] || flags_passed == NFLAGS) {
886 if (!electron_sel[6] || flags_passed == NFLAGS) {
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) {
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";
MonitorElement * ecalisoendcap_after_
Log< level::Info, true > LogVerbatim
MonitorElement * jet_et_after_
unsigned int nGoodElectrons
MonitorElement * invmass_after_
MonitorElement * hcalisobarrel_after_
double pz() const final
z coordinate of momentum vector
MonitorElement * nelectrons_before_
double pt() const final
transverse momentum
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * sieieendcap_before_
MonitorElement * sieieendcap_after_
MonitorElement * ecalisobarrel_before_
float sigmaIetaIeta() const
MonitorElement * sieiebarrel_before_
MonitorElement * hcalisobarrel_before_
MonitorElement * detainbarrel_after_
MonitorElement * ecalisobarrel_after_
MonitorElement * detainendcap_before_
Log< level::Error, false > LogError
MonitorElement * sieiebarrel_after_
MonitorElement * detainbarrel_before_
MonitorElement * mt_before_
MonitorElement * nelectrons_after_
float dr04TkSumPt() const
MonitorElement * hcalisoendcap_before_
MonitorElement * npvs_afterZ_
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * mt_after_
double px() const final
x coordinate of momentum vector
MonitorElement * jet_et_before_
MonitorElement * njets_after_
MonitorElement * pt_before_
MonitorElement * pt_after_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
double massSqr() const final
mass squared
MonitorElement * hcalisoendcap_after_
void dqmEndRun(const edm::Run &, const edm::EventSetup &) override
EwkElecDQM(const edm::ParameterSet &)
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * invmass_before_
MonitorElement * ecalisoendcap_before_
MonitorElement * jet_eta_after_
double py() const final
y coordinate of momentum vector
bool isEndcap(GeomDetEnumerators::SubDetector m)
MonitorElement * jet_eta_before_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
float deltaEtaSuperClusterTrackAtVtx() const
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
MonitorElement * invmassPU_afterZ_
MonitorElement * trkisobarrel_before_
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * met_before_
MonitorElement * trkisoendcap_before_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * met_after_
void HERE(const char *msg)
MonitorElement * trkisobarrel_after_
MonitorElement * eta_after_
MonitorElement * npvs_before_
float dr03EcalRecHitSumEt() const
MonitorElement * trkisoendcap_after_
HLTPrescaleProvider hltPrescaleProvider_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
float dr03HcalTowerSumEt(int depth=0) const
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
double energy() const final
energy
double eta() const final
momentum pseudorapidity