44 metTag_(cfg.getUntrackedParameter<edm::
InputTag>(
"METTag",
46 jetTag_(cfg.getUntrackedParameter<edm::
InputTag>(
47 "JetTag", edm::
InputTag(
"sisCone5CaloJets"))),
49 cfg.getUntrackedParameter<edm::
InputTag>(
50 "TrigTag", edm::
InputTag(
"TriggerResults::HLT")))),
52 cfg.getUntrackedParameter<edm::
InputTag>(
53 "ElecTag", edm::
InputTag(
"gsfElectrons")))),
55 cfg.getUntrackedParameter<edm::
InputTag>(
"METTag",
58 cfg.getUntrackedParameter<edm::
InputTag>(
59 "JetTag", edm::
InputTag(
"sisCone5CaloJets")))),
61 cfg.getUntrackedParameter<edm::
InputTag>(
62 "VertexTag", edm::
InputTag(
"offlinePrimaryVertices")))),
65 "BeamSpotTag", edm::
InputTag(
"BeamSpot")))),
73 cfg.getUntrackedParameter<std::vector<std::
string> >(
"ElecTrig")),
75 ptCut_(cfg.getUntrackedParameter<double>(
"PtCut", 10.)),
77 etaCut_(cfg.getUntrackedParameter<double>(
"EtaCut", 2.4)),
78 sieieCutBarrel_(cfg.getUntrackedParameter<double>(
"SieieBarrel", 0.01)),
79 sieieCutEndcap_(cfg.getUntrackedParameter<double>(
"SieieEndcap", 0.028)),
81 cfg.getUntrackedParameter<double>(
"DetainBarrel", 0.0071)),
83 cfg.getUntrackedParameter<double>(
"DetainEndcap", 0.0066)),
90 cfg.getUntrackedParameter<double>(
"EcalIsoCutBarrel", 5.7)),
92 cfg.getUntrackedParameter<double>(
"EcalIsoCutEndcap", 5.0)),
94 cfg.getUntrackedParameter<double>(
"HcalIsoCutBarrel", 8.1)),
96 cfg.getUntrackedParameter<double>(
"HcalIsoCutEndcap", 3.4)),
98 cfg.getUntrackedParameter<double>(
"TrkIsoCutBarrel", 7.2)),
100 cfg.getUntrackedParameter<double>(
"TrkIsoCutEndcap", 5.1)),
101 mtMin_(cfg.getUntrackedParameter<double>(
"MtMin", -999999)),
102 mtMax_(cfg.getUntrackedParameter<double>(
"MtMax", 999999.)),
103 metMin_(cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
104 metMax_(cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
121 eJetMin_(cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
122 nJetMax_(cfg.getUntrackedParameter<int>(
"NJetMax", 999999)),
123 PUMax_(cfg.getUntrackedParameter<unsigned int>(
"PUMax", 60)),
124 PUBinCount_(cfg.getUntrackedParameter<unsigned int>(
"PUBinCount", 12)),
125 hltPrescaleProvider_(cfg, consumesCollector(), *this)
142 bool isConfigChanged =
false;
156 char chtitle[256] =
"";
159 "Electron transverse momentum [GeV]", 100, 0., 100.);
161 "Electron transverse momentum [GeV]", 100, 0., 100.);
164 "Electron pseudo-rapidity", 50, -2.5, 2.5);
166 "Electron pseudo-rapidity", 50, -2.5, 2.5);
169 "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
171 "Electron #sigma_{i#etai#eta} (barrel)", 70, 0., 0.07);
174 "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
176 "Electron #sigma_{i#etai#eta} (endcap)", 70, 0., 0.07);
179 "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
181 "Electron #Delta#eta_{in} (barrel)", 40, -0.02, 0.02);
184 "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
186 "Electron #Delta#eta_{in} (endcap)", 40, -0.02, 0.02);
189 "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
191 "Absolute electron ECAL isolation variable (barrel) [GeV]", 50, 0., 50.);
194 "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
196 "Absolute electron ECAL isolation variable (endcap) [GeV]", 50, 0., 50.);
199 "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
201 "Absolute electron HCAL isolation variable (barrel) [GeV]", 50, 0., 50.);
204 "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
206 "Absolute electron HCAL isolation variable (endcap) [GeV]", 50, 0., 50.);
209 "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
211 "Absolute electron track isolation variable (barrel) [GeV]", 50, 0., 50.);
214 "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
216 "Absolute electron track isolation variable (endcap) [GeV]", 50, 0., 50.);
223 "Di-electron invariant mass [GeV]", 100, 0., 200.);
225 "Di-electron invariant mass [GeV]", 100, 0., 200.);
228 "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
231 "Di-electron invariant mass [GeV] vs PU; mass [GeV]; PU count", 100, 0.,
235 "Number of Valid Primary Vertices; nGoodPVs",
PUMax_ + 1, -0.5,
PUMax_ + 0.5);
238 "Number of Valid Primary Vertices; nGoodPVs",
PUMax_ + 1, -0.5,
PUMax_ + 0.5);
241 "Number of electrons in event", 10, -0.5, 9.5);
243 "Number of electrons in event", 10, -0.5, 9.5);
245 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
250 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
255 snprintf(chtitle, 255,
"Number of jets (%s) above %.2f GeV",
260 snprintf(chtitle, 255,
"Jet with highest E_{T} (%s)",
jetTag_.
label().data());
264 snprintf(chtitle, 255,
"Eta of Jet with highest E_{T} (%s)",
276 LogVerbatim(
"") <<
"\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
277 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
278 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
280 <<
"(" << setprecision(4) << esel * 100. <<
" +/- "
281 << setprecision(2) <<
sqrt(esel * (1 - esel) / all) * 100.
293 double err =
sqrt(eff * (1 - eff) / all);
294 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " << num <<
" [events], ("
295 << setprecision(4) << eff * 100. <<
" +/- " << setprecision(2)
296 << err * 100. <<
")%";
301 err =
sqrt(eff * (1 - eff) / all);
304 if (
nrec > 0) effstep = eeid / erec;
305 if (
nrec > 0) errstep =
sqrt(effstep * (1 - effstep) /
nrec);
306 LogVerbatim(
"") <<
"Passing eID cuts: " << num <<
" [events], ("
307 << setprecision(4) << eff * 100. <<
" +/- " << setprecision(2)
308 << err * 100. <<
")%, to previous step: (" << setprecision(4)
309 << effstep * 100. <<
" +/- " << setprecision(2)
310 << errstep * 100. <<
")%";
315 err =
sqrt(eff * (1 - eff) / all);
318 if (
neid > 0) effstep = eiso / eeid;
319 if (
neid > 0) errstep =
sqrt(effstep * (1 - effstep) /
neid);
320 LogVerbatim(
"") <<
"Passing isolation cuts: " << num <<
" [events], ("
321 << setprecision(4) << eff * 100. <<
" +/- " << setprecision(2)
322 << err * 100. <<
")%, to previous step: (" << setprecision(4)
323 << effstep * 100. <<
" +/- " << setprecision(2)
324 << errstep * 100. <<
")%";
342 err =
sqrt(eff * (1 - eff) / all);
345 if (
niso > 0) effstep = esel / eiso;
346 if (
niso > 0) errstep =
sqrt(effstep * (1 - effstep) /
niso);
347 LogVerbatim(
"") <<
"Passing HLT criteria: " << num <<
" [events], ("
348 << setprecision(4) << eff * 100. <<
" +/- " << setprecision(2)
349 << err * 100. <<
")%, to previous step: (" << setprecision(4)
350 << effstep * 100. <<
" +/- " << setprecision(2)
351 << errstep * 100. <<
")%";
379 LogVerbatim(
"") <<
">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
387 bool rec_sel =
false;
388 bool eid_sel =
false;
389 bool iso_sel =
false;
390 bool all_sel =
false;
398 unsigned int electronCollectionSize = electronCollection->size();
416 const MET&
met = metCollection->at(0);
427 double met_et =
sqrt(met_px * met_px + met_py * met_py);
428 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px
429 <<
", " << met_py <<
" [GeV]";
436 LogError(
"") <<
">>> Vertex collection does not exist !!!";
440 for (
unsigned int i = 0;
i < vertexCollection->size();
i++) {
441 const Vertex& vertex = vertexCollection->at(
i);
442 if (vertex.
isValid()) npvCount++;
453 bool trigger_fired =
false;
511 if (prescaleSet == -1) {
512 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
517 for (
unsigned int i = 0;
518 (
i < triggerResults->size()) && (trigger_fired ==
false);
i++) {
520 if (!triggerResults->accept(
i))
continue;
529 if (!found)
continue;
532 if (hltConfigProvider.
prescaleValue(prescaleSet, trigName) != 1)
continue;
536 trigger_fired =
true;
539 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" for one of ( ";
552 float electron_et = -8.0;
553 float electron_eta = -8.0;
554 float electron_phi = -8.0;
555 float electron2_et = -9.0;
556 float electron2_eta = -9.0;
557 float electron2_phi = -9.0;
559 for (
unsigned int i = 0;
i < electronCollectionSize;
i++) {
563 electron_et = elec.
pt();
564 electron_eta = elec.
eta();
565 electron_phi = elec.
phi();
568 electron2_et = elec.
pt();
569 electron2_eta = elec.
eta();
570 electron2_phi = elec.
phi();
575 float jet_eta = -8.0;
577 float jet2_et = -9.0;
578 unsigned int jetCollectionSize = jetCollection->size();
580 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
581 const Jet&
jet = jetCollection->at(
i);
583 float jet_current_et = jet.
et();
586 if (electron_et > 0.0 && fabs(jet.
eta() - electron_eta) < 0.2 &&
589 if (electron2_et > 0.0 && fabs(jet.
eta() - electron2_eta) < 0.2 &&
601 if (jet_current_et > jet_et) {
605 }
else if (jet_current_et > jet2_et) {
618 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
620 <<
" [GeV]: " <<
njets;
627 bool hlt_hist_done =
false;
629 bool met_hist_done =
false;
632 bool njets_hist_done =
false;
636 const int NFLAGS = 11;
645 bool electron_sel[NFLAGS];
662 double goodElectron[2][6];
664 for (
unsigned int i = 0;
i < 2;
i++) {
665 for (
unsigned int j = 0;
j < 6;
j++) {
667 goodElectron[
i][
j] = 0.;
671 for (
unsigned int i = 0;
i < electronCollectionSize;
i++) {
672 for (
int j = 0;
j < NFLAGS; ++
j) {
673 electron_sel[
j] =
false;
681 LogTrace(
"") <<
"> elec: processing electron number " <<
i <<
"...";
689 electron[
i][2] = elec.
energy();
690 electron[
i][3] = elec.
px();
691 electron[
i][4] = elec.
py();
692 electron[
i][5] = elec.
pz();
696 double pt = elec.
pt();
697 double px = elec.
px();
698 double py = elec.
py();
700 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;
702 if (pt >
ptCut_) electron_sel[0] =
true;
703 if (fabs(eta) <
etaCut_) electron_sel[1] =
true;
707 if (eta < 1.4442 && eta > -1.4442) {
709 }
else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4)) {
741 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (barrel), pass? "
743 LogTrace(
"") <<
"\t... detain value " << detain <<
" (barrel), pass? "
745 }
else if (isEndcap) {
746 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (endcap), pass? "
748 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? "
755 }
else if (isEndcap) {
777 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar
778 <<
" (barrel), pass? " << electron_sel[4];
779 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar
780 <<
" (barrel), pass? " << electron_sel[5];
781 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar
782 <<
" (barrel), pass? " << electron_sel[6];
783 }
else if (isEndcap) {
784 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar
785 <<
" (endcap), pass? " << electron_sel[4];
786 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar
787 <<
" (endcap), pass? " << electron_sel[5];
788 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar
789 <<
" (endcap), pass? " << electron_sel[6];
797 }
else if (isEndcap) {
804 if (trigger_fired) electron_sel[7] =
true;
807 double w_et = met_et +
pt;
808 double w_px = met_px + px;
809 double w_py = met_py + py;
811 double massT = w_et * w_et - w_px * w_px - w_py * w_py;
812 massT = (massT > 0) ?
sqrt(massT) : 0;
814 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et
815 <<
", " << w_px <<
", " << w_py <<
" [GeV]";
816 if (massT >
mtMin_ && massT <
mtMax_) electron_sel[8] =
true;
831 if (njets <=
nJetMax_) electron_sel[10] =
true;
834 int flags_passed = 0;
835 bool rec_sel_this =
true;
836 bool eid_sel_this =
true;
837 bool iso_sel_this =
true;
838 bool all_sel_this =
true;
839 for (
int j = 0;
j < NFLAGS; ++
j) {
840 if (electron_sel[
j]) flags_passed += 1;
841 if (j < 2 && !electron_sel[j]) rec_sel_this =
false;
842 if (j < 4 && !electron_sel[j]) eid_sel_this =
false;
843 if (j < 7 && !electron_sel[j]) iso_sel_this =
false;
844 if (!electron_sel[j]) all_sel_this =
false;
869 if (rec_sel_this) rec_sel =
true;
871 if (eid_sel_this) iso_sel =
true;
873 if (iso_sel_this) iso_sel =
true;
876 if (all_sel_this) all_sel =
true;
879 if (flags_passed >= (NFLAGS - 1)) {
880 if (!electron_sel[0] || flags_passed == NFLAGS) {
883 if (!electron_sel[1] || flags_passed == NFLAGS) {
886 if (!electron_sel[2] || flags_passed == NFLAGS) {
889 }
else if (isEndcap) {
893 if (!electron_sel[3] || flags_passed == NFLAGS) {
896 }
else if (isEndcap) {
900 if (!electron_sel[4] || flags_passed == NFLAGS) {
903 }
else if (isEndcap) {
907 if (!electron_sel[5] || flags_passed == NFLAGS) {
910 }
else if (isEndcap) {
914 if (!electron_sel[6] || flags_passed == NFLAGS) {
917 }
else if (isEndcap) {
937 if (!electron_sel[7] || flags_passed == NFLAGS) {
938 if (!hlt_hist_done) {
942 hlt_hist_done =
true;
943 if (!electron_sel[8] || flags_passed == NFLAGS) {
946 if (!electron_sel[9] || flags_passed == NFLAGS) {
947 if (!met_hist_done) {
951 met_hist_done =
true;
962 if (!electron_sel[10] || flags_passed == NFLAGS) {
963 if (!njets_hist_done) {
972 njets_hist_done =
true;
983 if (electronCollectionSize > 1) {
984 invMass =
sqrt(electron[0][1] + electron[1][1] +
985 2 * (electron[0][2] * electron[1][2] -
986 (electron[0][3] * electron[1][3] +
987 electron[0][4] * electron[1][4] +
988 electron[0][5] * electron[1][5])));
995 invMass =
sqrt(goodElectron[0][1] + goodElectron[1][1] +
996 2 * (goodElectron[0][2] * goodElectron[1][2] -
997 (goodElectron[0][3] * goodElectron[1][3] +
998 goodElectron[0][4] * goodElectron[1][4] +
999 goodElectron[0][5] * goodElectron[1][5])));
1006 if (rec_sel)
nrec++;
1007 if (eid_sel)
neid++;
1008 if (iso_sel)
niso++;
1014 LogTrace(
"") <<
">>>> Event ACCEPTED";
1016 LogTrace(
"") <<
">>>> Event REJECTED";
1027 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
1029 if (deltaPhi > 3.1415926) {
1030 deltaPhi = 2 * 3.1415926 -
deltaPhi;
MonitorElement * ecalisoendcap_after_
MonitorElement * jet_et_after_
unsigned int nGoodElectrons
void dqmBeginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * invmass_after_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * hcalisobarrel_after_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * nelectrons_before_
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
virtual double energy() const final
energy
MonitorElement * sieieendcap_before_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * sieieendcap_after_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
MonitorElement * ecalisobarrel_before_
bool isBarrel(GeomDetEnumerators::SubDetector m)
MonitorElement * sieiebarrel_before_
MonitorElement * hcalisobarrel_before_
virtual double phi() const final
momentum azimuthal angle
float dr04TkSumPt() const
MonitorElement * detainbarrel_after_
MonitorElement * ecalisobarrel_after_
MonitorElement * detainendcap_before_
MonitorElement * trig_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
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
float sigmaIetaIeta() const
MonitorElement * jet_et_before_
MonitorElement * njets_after_
MonitorElement * pt_before_
MonitorElement * pt_after_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hcalisoendcap_after_
MonitorElement * book1D(Args &&...args)
EwkElecDQM(const edm::ParameterSet &)
virtual double py() const final
y coordinate of momentum vector
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * invmass_before_
MonitorElement * ecalisoendcap_before_
static std::string const triggerResults
MonitorElement * jet_eta_after_
MonitorElement * trig_after_
bool isEndcap(GeomDetEnumerators::SubDetector m)
virtual double pz() const final
z coordinate of momentum vector
MonitorElement * jet_eta_before_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
static const char *const trigNames[]
void setCurrentFolder(const std::string &fullpath)
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
MonitorElement * invmassPU_afterZ_
MonitorElement * book2D(Args &&...args)
MonitorElement * trkisobarrel_before_
std::string const & triggerName(unsigned int index) const
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
MonitorElement * met_before_
MonitorElement * trkisoendcap_before_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
float dr03EcalRecHitSumEt() const
HLTConfigProvider const & hltConfigProvider() const
edm::EDGetTokenT< edm::TriggerResults > trigTag_
void HERE(const char *msg)
MonitorElement * met_after_
MonitorElement * trkisobarrel_after_
MonitorElement * eta_after_
const std::vector< std::string > elecTrig_
MonitorElement * npvs_before_
MonitorElement * trkisoendcap_after_
float dr03HcalTowerSumEt() const
HLTPrescaleProvider hltPrescaleProvider_
virtual double px() const final
x coordinate of momentum vector
virtual double et() const final
transverse energy
virtual double eta() const final
momentum pseudorapidity
MonitorElement * eta_before_
MonitorElement * invmassPU_before_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
virtual double massSqr() const final
mass squared
virtual double pt() const final
transverse momentum
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override