41 trigTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"TrigTag", edm::
InputTag(
"TriggerResults::HLT"))),
43 elecTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"ElecTag", edm::
InputTag(
"gsfElectrons"))),
44 metTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"METTag", edm::
InputTag(
"met"))),
46 jetTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"JetTag", edm::
InputTag(
"sisCone5CaloJets"))),
47 vertexTag_ (cfg.getUntrackedParameter<edm::
InputTag> (
"VertexTag", edm::
InputTag(
"offlinePrimaryVertices"))),
52 elecTrig_(cfg.getUntrackedParameter<std::vector< std::
string > >(
"ElecTrig")),
54 ptCut_(cfg.getUntrackedParameter<double>(
"PtCut", 10.)),
56 etaCut_(cfg.getUntrackedParameter<double>(
"EtaCut", 2.4)),
57 sieieCutBarrel_(cfg.getUntrackedParameter<double>(
"SieieBarrel", 0.01)),
58 sieieCutEndcap_(cfg.getUntrackedParameter<double>(
"SieieEndcap", 0.028)),
59 detainCutBarrel_(cfg.getUntrackedParameter<double>(
"DetainBarrel", 0.0071)),
60 detainCutEndcap_(cfg.getUntrackedParameter<double>(
"DetainEndcap", 0.0066)),
64 ecalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"EcalIsoCutBarrel", 5.7)),
65 ecalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"EcalIsoCutEndcap", 5.0)),
66 hcalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"HcalIsoCutBarrel", 8.1)),
67 hcalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"HcalIsoCutEndcap", 3.4)),
68 trkIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"TrkIsoCutBarrel", 7.2)),
69 trkIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"TrkIsoCutEndcap", 5.1)),
70 mtMin_(cfg.getUntrackedParameter<double>(
"MtMin", -999999)),
71 mtMax_(cfg.getUntrackedParameter<double>(
"MtMax", 999999.)),
72 metMin_(cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
73 metMax_(cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
87 eJetMin_(cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
88 nJetMax_(cfg.getUntrackedParameter<int>(
"NJetMax", 999999)),
89 PUMax_(cfg.getUntrackedParameter<unsigned int>(
"PUMax", 60)),
90 PUBinCount_(cfg.getUntrackedParameter<unsigned int>(
"PUBinCount", 12))
117 bool isConfigChanged =
false;
131 char chtitle[256] =
"";
225 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
233 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
metTag_.
label().data());
253 snprintf(chtitle, 255,
"Jet with highest E_{T} (%s)",
jetTag_.
label().data());
257 snprintf(chtitle, 255,
"Eta of Jet with highest E_{T} (%s)",
jetTag_.
label().data());
278 LogVerbatim(
"") <<
"\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
279 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
280 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
281 LogVerbatim(
"") <<
"Overall efficiency: " <<
"(" << setprecision(4) << esel*100. <<
" +/- "<< setprecision(2) <<
sqrt(esel*(1-esel)/all)*100. <<
")%";
292 double err =
sqrt(eff*(1-eff)/all);
293 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%";
298 err =
sqrt(eff*(1-eff)/all);
301 if (
nrec>0) effstep = eeid/erec;
303 LogVerbatim(
"") <<
"Passing eID cuts: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%, to previous step: (" << setprecision(4) << effstep*100. <<
" +/- "<< setprecision(2) << errstep*100. <<
")%";
308 err =
sqrt(eff*(1-eff)/all);
311 if (
neid>0) effstep = eiso/eeid;
313 LogVerbatim(
"") <<
"Passing isolation cuts: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%, to previous step: (" << setprecision(4) << effstep*100. <<
" +/- "<< setprecision(2) << errstep*100. <<
")%";
328 err =
sqrt(eff*(1-eff)/all);
331 if (
niso>0) effstep = esel/eiso;
333 LogVerbatim(
"") <<
"Passing HLT criteria: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%, to previous step: (" << setprecision(4) << effstep*100. <<
" +/- "<< setprecision(2) << errstep*100. <<
")%";
355 LogVerbatim(
"") <<
">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
361 bool rec_sel =
false;
362 bool eid_sel =
false;
363 bool iso_sel =
false;
365 bool all_sel =
false;
381 unsigned int electronCollectionSize = electronCollection->size();
397 const MET&
met = metCollection->at(0);
408 double met_et =
sqrt(met_px*met_px+met_py*met_py);
409 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
417 LogError(
"") <<
">>> Vertex collection does not exist !!!";
420 for (
unsigned int i=0;
i<vertexCollection->size();
i++) {
421 const Vertex& vertex = vertexCollection->at(
i);
422 if (vertex.
isValid()) npvCount++;
434 bool trigger_fired =
false;
449 for (
unsigned int i=0;
i<triggerResults->size();
i++)
465 if (trigPath==0) found=
true;
469 bool prescaled=
false;
472 if (prescaleValue != 1) prescaled =
true;
475 if(triggerResults->accept(
i) && !prescaled) trigger_fired=
true;
480 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" for one of ( " ;
509 float electron_et = -8.0;
510 float electron_eta = -8.0;
511 float electron_phi = -8.0;
512 float electron2_et = -9.0;
513 float electron2_eta = -9.0;
514 float electron2_phi = -9.0;
516 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
522 electron_et = elec.
pt();
523 electron_eta = elec.
eta();
524 electron_phi = elec.
phi();
528 electron2_et = elec.
pt();
529 electron2_eta = elec.
eta();
530 electron2_phi = elec.
phi();
535 float jet_eta = -8.0;
537 float jet2_et = -9.0;
538 unsigned int jetCollectionSize = jetCollection->size();
540 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
541 const Jet&
jet = jetCollection->at(
i);
543 float jet_current_et = jet.
et();
546 if ( electron_et>0.0 && fabs(jet.
eta()-electron_eta ) < 0.2
549 if ( electron2_et>0.0&& fabs(jet.
eta()-electron2_eta) < 0.2
561 if (jet_current_et > jet_et)
567 else if (jet_current_et > jet2_et)
582 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
583 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
591 bool hlt_hist_done =
false;
593 bool met_hist_done =
false;
596 bool njets_hist_done =
false;
600 const int NFLAGS = 11;
609 bool electron_sel[NFLAGS];
624 double goodElectron[2][6];
626 for (
unsigned int i = 0;
i < 2;
i++)
628 for (
unsigned int j = 0;
j < 6;
j++)
631 goodElectron[
i][
j] = 0.;
635 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
637 for (
int j=0;
j<NFLAGS; ++
j)
639 electron_sel[
j] =
false;
647 LogTrace(
"") <<
"> elec: processing electron number " <<
i <<
"...";
656 electron[
i][2] = elec.
energy();
657 electron[
i][3] = elec.
px();
658 electron[
i][4] = elec.
py();
659 electron[
i][5] = elec.
pz();
663 double pt = elec.
pt();
664 double px = elec.
px();
665 double py = elec.
py();
667 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
668 if (pt>
ptCut_) electron_sel[0] =
true;
669 if (fabs(eta)<
etaCut_) electron_sel[1] =
true;
671 bool isBarrel =
false;
672 bool isEndcap =
false;
673 if (eta < 1.4442 && eta > -1.4442)
677 else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4))
709 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (barrel), pass? " << electron_sel[2];
710 LogTrace(
"") <<
"\t... detain value " << detain <<
" (barrel), pass? " << electron_sel[3];
714 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (endcap), pass? " << electron_sel[2];
715 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? " << electron_sel[2];
749 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (barrel), pass? " << electron_sel[4];
750 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (barrel), pass? " << electron_sel[5];
751 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (barrel), pass? " << electron_sel[6];
755 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (endcap), pass? " << electron_sel[4];
756 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (endcap), pass? " << electron_sel[5];
757 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (endcap), pass? " << electron_sel[6];
776 if (trigger_fired) electron_sel[7] =
true;
780 double w_et = met_et+pt;
781 double w_px = met_px+px;
782 double w_py = met_py+py;
784 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
785 massT = (massT>0) ?
sqrt(massT) : 0;
787 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
788 if (massT>
mtMin_ && massT<
mtMax_) electron_sel[8] =
true;
803 if (njets<=
nJetMax_) electron_sel[10] =
true;
806 int flags_passed = 0;
807 bool rec_sel_this =
true;
808 bool eid_sel_this =
true;
809 bool iso_sel_this =
true;
810 bool all_sel_this =
true;
811 for (
int j=0;
j<NFLAGS; ++
j)
813 if (electron_sel[
j]) flags_passed += 1;
814 if (j<2 && !electron_sel[j]) rec_sel_this =
false;
815 if (j<4 && !electron_sel[j]) eid_sel_this =
false;
816 if (j<7 && !electron_sel[j]) iso_sel_this =
false;
817 if (!electron_sel[j]) all_sel_this =
false;
844 if (rec_sel_this) rec_sel =
true;
846 if (eid_sel_this) iso_sel =
true;
848 if (iso_sel_this) iso_sel =
true;
851 if (all_sel_this) all_sel =
true;
854 if (flags_passed >= (NFLAGS-1))
856 if (!electron_sel[0] || flags_passed==NFLAGS)
860 if (!electron_sel[1] || flags_passed==NFLAGS)
864 if (!electron_sel[2] || flags_passed==NFLAGS)
875 if (!electron_sel[3] || flags_passed==NFLAGS)
886 if (!electron_sel[4] || flags_passed==NFLAGS)
897 if (!electron_sel[5] || flags_passed==NFLAGS)
908 if (!electron_sel[6] || flags_passed==NFLAGS)
935 if (!electron_sel[7] || flags_passed==NFLAGS)
942 hlt_hist_done =
true;
943 if (!electron_sel[8] || flags_passed==NFLAGS)
947 if (!electron_sel[9] || flags_passed==NFLAGS)
949 if (!met_hist_done) {
953 met_hist_done =
true;
962 if (!electron_sel[10] || flags_passed==NFLAGS) {
963 if (!njets_hist_done)
973 njets_hist_done =
true;
983 if (electronCollectionSize > 1)
985 invMass =
sqrt(electron[0][1] + electron[1][1] + 2*(electron[0][2]*electron[1][2] - (electron[0][3]*electron[1][3] + electron[0][4]*electron[1][4] + electron[0][5]*electron[1][5]) ) );
993 invMass =
sqrt(goodElectron[0][1] + goodElectron[1][1] + 2*(goodElectron[0][2]*goodElectron[1][2] - (goodElectron[0][3]*goodElectron[1][3] + goodElectron[0][4]*goodElectron[1][4] + goodElectron[0][5]*goodElectron[1][5]) ) );
1000 if (rec_sel)
nrec++;
1001 if (eid_sel)
neid++;
1002 if (iso_sel)
niso++;
1008 LogTrace(
"") <<
">>>> Event ACCEPTED";
1010 LogTrace(
"") <<
">>>> Event REJECTED";
1024 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
1026 if (deltaPhi > 3.1415926) {
1027 deltaPhi = 2 * 3.1415926 -
deltaPhi;
MonitorElement * ecalisoendcap_after_
virtual double energy() const GCC11_FINAL
energy
MonitorElement * jet_et_after_
virtual double et() const GCC11_FINAL
transverse energy
unsigned int nGoodElectrons
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_
HLTConfigProvider hltConfigProvider_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * sieieendcap_before_
MonitorElement * sieieendcap_after_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
MonitorElement * ecalisobarrel_before_
MonitorElement * sieiebarrel_before_
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hcalisobarrel_before_
float dr04TkSumPt() const
MonitorElement * detainbarrel_after_
MonitorElement * ecalisobarrel_after_
MonitorElement * detainendcap_before_
MonitorElement * trig_before_
MonitorElement * sieiebarrel_after_
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
MonitorElement * detainbarrel_before_
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
MonitorElement * mt_before_
MonitorElement * nelectrons_after_
MonitorElement * hcalisoendcap_before_
MonitorElement * npvs_afterZ_
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * mt_after_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
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_
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hcalisoendcap_after_
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
EwkElecDQM(const edm::ParameterSet &)
MonitorElement * invmass_before_
MonitorElement * ecalisoendcap_before_
MonitorElement * jet_eta_after_
MonitorElement * trig_after_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * jet_eta_before_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
static const char *const trigNames[]
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
MonitorElement * invmassPU_afterZ_
MonitorElement * trkisobarrel_before_
std::string const & triggerName(unsigned int index) const
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
MonitorElement * met_before_
MonitorElement * trkisoendcap_before_
float dr03EcalRecHitSumEt() const
virtual float massSqr() const GCC11_FINAL
mass squared
MonitorElement * met_after_
MonitorElement * trkisobarrel_after_
MonitorElement * eta_after_
const std::vector< std::string > elecTrig_
MonitorElement * npvs_before_
unsigned int prescaleSize() const
MonitorElement * trkisoendcap_after_
float dr03HcalTowerSumEt() const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * eta_before_
MonitorElement * invmassPU_before_
void setCurrentFolder(const std::string &fullpath)