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] =
"";
132 for (
int i=0;
i<2; ++
i) {
227 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
235 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
metTag_.
label().data());
255 snprintf(chtitle, 255,
"Jet with highest E_{T} (%s)",
jetTag_.
label().data());
259 snprintf(chtitle, 255,
"Eta of Jet with highest E_{T} (%s)",
jetTag_.
label().data());
281 LogVerbatim(
"") <<
"\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
282 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
283 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
284 LogVerbatim(
"") <<
"Overall efficiency: " <<
"(" << setprecision(4) << esel*100. <<
" +/- "<< setprecision(2) <<
sqrt(esel*(1-esel)/all)*100. <<
")%";
295 double err =
sqrt(eff*(1-eff)/all);
296 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%";
301 err =
sqrt(eff*(1-eff)/all);
304 if (
nrec>0) effstep = eeid/erec;
306 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. <<
")%";
311 err =
sqrt(eff*(1-eff)/all);
314 if (
neid>0) effstep = eiso/eeid;
316 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. <<
")%";
331 err =
sqrt(eff*(1-eff)/all);
334 if (
niso>0) effstep = esel/eiso;
336 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. <<
")%";
358 LogVerbatim(
"") <<
">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
364 bool rec_sel =
false;
365 bool eid_sel =
false;
366 bool iso_sel =
false;
368 bool all_sel =
false;
384 unsigned int electronCollectionSize = electronCollection->size();
400 const MET&
met = metCollection->at(0);
411 double met_et =
sqrt(met_px*met_px+met_py*met_py);
412 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
420 LogError(
"") <<
">>> Vertex collection does not exist !!!";
423 for (
unsigned int i=0;
i<vertexCollection->size();
i++) {
424 const Vertex& vertex = vertexCollection->at(
i);
425 if (vertex.
isValid()) npvCount++;
437 bool trigger_fired =
false;
452 for (
unsigned int i=0;
i<triggerResults->size();
i++)
468 if (trigPath==0) found=
true;
472 bool prescaled=
false;
475 if (prescaleValue != 1) prescaled =
true;
478 if(triggerResults->accept(
i) && !prescaled) trigger_fired=
true;
483 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" for one of ( " ;
512 float electron_et = -8.0;
513 float electron_eta = -8.0;
514 float electron_phi = -8.0;
515 float electron2_et = -9.0;
516 float electron2_eta = -9.0;
517 float electron2_phi = -9.0;
519 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
525 electron_et = elec.
pt();
526 electron_eta = elec.
eta();
527 electron_phi = elec.
phi();
531 electron2_et = elec.
pt();
532 electron2_eta = elec.
eta();
533 electron2_phi = elec.
phi();
538 float jet_eta = -8.0;
540 float jet2_et = -9.0;
541 unsigned int jetCollectionSize = jetCollection->size();
543 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
544 const Jet&
jet = jetCollection->at(
i);
546 float jet_current_et = jet.
et();
549 if ( electron_et>0.0 && fabs(jet.
eta()-electron_eta ) < 0.2
552 if ( electron2_et>0.0&& fabs(jet.
eta()-electron2_eta) < 0.2
564 if (jet_current_et > jet_et)
570 else if (jet_current_et > jet2_et)
585 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
586 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
594 bool hlt_hist_done =
false;
596 bool met_hist_done =
false;
599 bool njets_hist_done =
false;
603 const int NFLAGS = 11;
612 bool electron_sel[NFLAGS];
627 double goodElectron[2][6];
629 for (
unsigned int i = 0;
i < 2;
i++)
631 for (
unsigned int j = 0;
j < 6;
j++)
634 goodElectron[
i][
j] = 0.;
638 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
640 for (
int j=0;
j<NFLAGS; ++
j)
642 electron_sel[
j] =
false;
650 LogTrace(
"") <<
"> elec: processing electron number " <<
i <<
"...";
659 electron[
i][2] = elec.
energy();
660 electron[
i][3] = elec.
px();
661 electron[
i][4] = elec.
py();
662 electron[
i][5] = elec.
pz();
666 double pt = elec.
pt();
667 double px = elec.
px();
668 double py = elec.
py();
670 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
671 if (pt>
ptCut_) electron_sel[0] =
true;
672 if (fabs(eta)<
etaCut_) electron_sel[1] =
true;
674 bool isBarrel =
false;
675 bool isEndcap =
false;
676 if (eta < 1.4442 && eta > -1.4442)
680 else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4))
712 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (barrel), pass? " << electron_sel[2];
713 LogTrace(
"") <<
"\t... detain value " << detain <<
" (barrel), pass? " << electron_sel[3];
717 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (endcap), pass? " << electron_sel[2];
718 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? " << electron_sel[2];
752 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (barrel), pass? " << electron_sel[4];
753 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (barrel), pass? " << electron_sel[5];
754 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (barrel), pass? " << electron_sel[6];
758 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (endcap), pass? " << electron_sel[4];
759 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (endcap), pass? " << electron_sel[5];
760 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (endcap), pass? " << electron_sel[6];
779 if (trigger_fired) electron_sel[7] =
true;
783 double w_et = met_et+pt;
784 double w_px = met_px+px;
785 double w_py = met_py+py;
787 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
788 massT = (massT>0) ?
sqrt(massT) : 0;
790 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
791 if (massT>
mtMin_ && massT<
mtMax_) electron_sel[8] =
true;
806 if (njets<=
nJetMax_) electron_sel[10] =
true;
809 int flags_passed = 0;
810 bool rec_sel_this =
true;
811 bool eid_sel_this =
true;
812 bool iso_sel_this =
true;
813 bool all_sel_this =
true;
814 for (
int j=0;
j<NFLAGS; ++
j)
816 if (electron_sel[
j]) flags_passed += 1;
817 if (j<2 && !electron_sel[j]) rec_sel_this =
false;
818 if (j<4 && !electron_sel[j]) eid_sel_this =
false;
819 if (j<7 && !electron_sel[j]) iso_sel_this =
false;
820 if (!electron_sel[j]) all_sel_this =
false;
847 if (rec_sel_this) rec_sel =
true;
849 if (eid_sel_this) iso_sel =
true;
851 if (iso_sel_this) iso_sel =
true;
854 if (all_sel_this) all_sel =
true;
857 if (flags_passed >= (NFLAGS-1))
859 if (!electron_sel[0] || flags_passed==NFLAGS)
863 if (!electron_sel[1] || flags_passed==NFLAGS)
867 if (!electron_sel[2] || flags_passed==NFLAGS)
878 if (!electron_sel[3] || flags_passed==NFLAGS)
889 if (!electron_sel[4] || flags_passed==NFLAGS)
900 if (!electron_sel[5] || flags_passed==NFLAGS)
911 if (!electron_sel[6] || flags_passed==NFLAGS)
938 if (!electron_sel[7] || flags_passed==NFLAGS)
945 hlt_hist_done =
true;
946 if (!electron_sel[8] || flags_passed==NFLAGS)
950 if (!electron_sel[9] || flags_passed==NFLAGS)
952 if (!met_hist_done) {
956 met_hist_done =
true;
965 if (!electron_sel[10] || flags_passed==NFLAGS) {
966 if (!njets_hist_done)
976 njets_hist_done =
true;
986 if (electronCollectionSize > 1)
988 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]) ) );
996 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]) ) );
1003 if (rec_sel)
nrec++;
1004 if (eid_sel)
neid++;
1005 if (iso_sel)
niso++;
1011 LogTrace(
"") <<
">>>> Event ACCEPTED";
1013 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
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.
virtual double et() const
transverse energy
MonitorElement * sieieendcap_before_
MonitorElement * sieieendcap_after_
virtual double massSqr() const
mass squared
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_
MonitorElement * detainbarrel_before_
MonitorElement * mt_before_
MonitorElement * nelectrons_after_
virtual double eta() const
momentum pseudorapidity
MonitorElement * hcalisoendcap_before_
MonitorElement * npvs_afterZ_
double calcDeltaPhi(double phi1, double phi2)
MonitorElement * mt_after_
virtual double energy() const
energy
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_
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_
static const char *const trigNames[]
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
virtual double px() const
x coordinate of momentum vector
MonitorElement * invmassPU_afterZ_
MonitorElement * trkisobarrel_before_
virtual double pt() const
transverse momentum
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_
virtual double pz() const
z coordinate of momentum vector
float dr03EcalRecHitSumEt() const
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 double phi() const
momentum azimuthal angle
MonitorElement * eta_before_
MonitorElement * invmassPU_before_
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)