41 metTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"METTag",
43 jetTag_(cfg.getUntrackedParameter<edm::
InputTag> (
"JetTag",
46 cfg.getUntrackedParameter<edm::
InputTag> (
"TrigTag",
47 edm::
InputTag(
"TriggerResults::HLT")))),
49 cfg.getUntrackedParameter<edm::
InputTag> (
"ElecTag",
52 cfg.getUntrackedParameter<edm::
InputTag> (
"METTag",
55 cfg.getUntrackedParameter<edm::
InputTag> (
"JetTag",
56 edm::
InputTag(
"sisCone5CaloJets")))),
58 cfg.getUntrackedParameter<edm::
InputTag> (
"VertexTag",
59 edm::
InputTag(
"offlinePrimaryVertices")))),
61 cfg.getUntrackedParameter<edm::
InputTag> (
"BeamSpotTag",
67 elecTrig_(cfg.getUntrackedParameter<std::vector< std::
string > >(
"ElecTrig")),
69 ptCut_(cfg.getUntrackedParameter<double>(
"PtCut", 10.)),
71 etaCut_(cfg.getUntrackedParameter<double>(
"EtaCut", 2.4)),
72 sieieCutBarrel_(cfg.getUntrackedParameter<double>(
"SieieBarrel", 0.01)),
73 sieieCutEndcap_(cfg.getUntrackedParameter<double>(
"SieieEndcap", 0.028)),
74 detainCutBarrel_(cfg.getUntrackedParameter<double>(
"DetainBarrel", 0.0071)),
75 detainCutEndcap_(cfg.getUntrackedParameter<double>(
"DetainEndcap", 0.0066)),
79 ecalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"EcalIsoCutBarrel", 5.7)),
80 ecalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"EcalIsoCutEndcap", 5.0)),
81 hcalIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"HcalIsoCutBarrel", 8.1)),
82 hcalIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"HcalIsoCutEndcap", 3.4)),
83 trkIsoCutBarrel_(cfg.getUntrackedParameter<double>(
"TrkIsoCutBarrel", 7.2)),
84 trkIsoCutEndcap_(cfg.getUntrackedParameter<double>(
"TrkIsoCutEndcap", 5.1)),
85 mtMin_(cfg.getUntrackedParameter<double>(
"MtMin", -999999)),
86 mtMax_(cfg.getUntrackedParameter<double>(
"MtMax", 999999.)),
87 metMin_(cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
88 metMax_(cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
102 eJetMin_(cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
103 nJetMax_(cfg.getUntrackedParameter<int>(
"NJetMax", 999999)),
104 PUMax_(cfg.getUntrackedParameter<unsigned int>(
"PUMax", 60)),
105 PUBinCount_(cfg.getUntrackedParameter<unsigned int>(
"PUBinCount", 12))
132 bool isConfigChanged =
false;
146 char chtitle[256] =
"";
240 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
248 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
metTag_.
label().data());
268 snprintf(chtitle, 255,
"Jet with highest E_{T} (%s)",
jetTag_.
label().data());
272 snprintf(chtitle, 255,
"Eta of Jet with highest E_{T} (%s)",
jetTag_.
label().data());
293 LogVerbatim(
"") <<
"\n>>>>>> SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
294 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
295 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
296 LogVerbatim(
"") <<
"Overall efficiency: " <<
"(" << setprecision(4) << esel*100. <<
" +/- "<< setprecision(2) <<
sqrt(esel*(1-esel)/all)*100. <<
")%";
307 double err =
sqrt(eff*(1-eff)/all);
308 LogVerbatim(
"") <<
"Passing Pt/Eta/Quality cuts: " << num <<
" [events], (" << setprecision(4) << eff*100. <<
" +/- "<< setprecision(2) << err*100. <<
")%";
313 err =
sqrt(eff*(1-eff)/all);
316 if (
nrec>0) effstep = eeid/erec;
318 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. <<
")%";
323 err =
sqrt(eff*(1-eff)/all);
326 if (
neid>0) effstep = eiso/eeid;
328 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. <<
")%";
343 err =
sqrt(eff*(1-eff)/all);
346 if (
niso>0) effstep = esel/eiso;
348 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. <<
")%";
370 LogVerbatim(
"") <<
">>>>>> SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
379 bool rec_sel =
false;
380 bool eid_sel =
false;
381 bool iso_sel =
false;
382 bool all_sel =
false;
390 unsigned int electronCollectionSize = electronCollection->size();
408 const MET&
met = metCollection->at(0);
419 double met_et =
sqrt(met_px*met_px+met_py*met_py);
420 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met_px <<
", " << met_py <<
" [GeV]";
428 LogError(
"") <<
">>> Vertex collection does not exist !!!";
432 for (
unsigned int i=0;
i<vertexCollection->size();
i++) {
433 const Vertex& vertex = vertexCollection->at(
i);
434 if (vertex.
isValid()) npvCount++;
445 bool trigger_fired =
false;
495 if (prescaleSet==-1) {
496 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
501 for (
unsigned int i=0; (
i<triggerResults->size()) && (trigger_fired==
false);
i++) {
503 if (!triggerResults->accept(
i))
continue;
521 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" for one of ( " ;
535 float electron_et = -8.0;
536 float electron_eta = -8.0;
537 float electron_phi = -8.0;
538 float electron2_et = -9.0;
539 float electron2_eta = -9.0;
540 float electron2_phi = -9.0;
542 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
548 electron_et = elec.
pt();
549 electron_eta = elec.
eta();
550 electron_phi = elec.
phi();
554 electron2_et = elec.
pt();
555 electron2_eta = elec.
eta();
556 electron2_phi = elec.
phi();
561 float jet_eta = -8.0;
563 float jet2_et = -9.0;
564 unsigned int jetCollectionSize = jetCollection->size();
566 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
567 const Jet&
jet = jetCollection->at(
i);
569 float jet_current_et = jet.
et();
572 if ( electron_et>0.0 && fabs(jet.
eta()-electron_eta ) < 0.2
575 if ( electron2_et>0.0&& fabs(jet.
eta()-electron2_eta) < 0.2
587 if (jet_current_et > jet_et)
593 else if (jet_current_et > jet2_et)
608 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
609 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
617 bool hlt_hist_done =
false;
619 bool met_hist_done =
false;
622 bool njets_hist_done =
false;
626 const int NFLAGS = 11;
635 bool electron_sel[NFLAGS];
650 double goodElectron[2][6];
652 for (
unsigned int i = 0;
i < 2;
i++)
654 for (
unsigned int j = 0;
j < 6;
j++)
657 goodElectron[
i][
j] = 0.;
661 for (
unsigned int i=0;
i<electronCollectionSize;
i++)
663 for (
int j=0;
j<NFLAGS; ++
j)
665 electron_sel[
j] =
false;
673 LogTrace(
"") <<
"> elec: processing electron number " <<
i <<
"...";
682 electron[
i][2] = elec.
energy();
683 electron[
i][3] = elec.
px();
684 electron[
i][4] = elec.
py();
685 electron[
i][5] = elec.
pz();
689 double pt = elec.
pt();
690 double px = elec.
px();
691 double py = elec.
py();
693 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
694 if (pt>
ptCut_) electron_sel[0] =
true;
695 if (fabs(eta)<
etaCut_) electron_sel[1] =
true;
697 bool isBarrel =
false;
698 bool isEndcap =
false;
699 if (eta < 1.4442 && eta > -1.4442)
703 else if ((eta > 1.56 && eta < 2.4) || (eta < -1.56 && eta > -2.4))
735 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (barrel), pass? " << electron_sel[2];
736 LogTrace(
"") <<
"\t... detain value " << detain <<
" (barrel), pass? " << electron_sel[3];
740 LogTrace(
"") <<
"\t... sieie value " << sieie <<
" (endcap), pass? " << electron_sel[2];
741 LogTrace(
"") <<
"\t... detain value " << detain <<
" (endcap), pass? " << electron_sel[2];
775 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (barrel), pass? " << electron_sel[4];
776 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (barrel), pass? " << electron_sel[5];
777 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (barrel), pass? " << electron_sel[6];
781 LogTrace(
"") <<
"\t... ecal isolation value " << ecalisovar <<
" (endcap), pass? " << electron_sel[4];
782 LogTrace(
"") <<
"\t... hcal isolation value " << hcalisovar <<
" (endcap), pass? " << electron_sel[5];
783 LogTrace(
"") <<
"\t... trk isolation value " << trkisovar <<
" (endcap), pass? " << electron_sel[6];
802 if (trigger_fired) electron_sel[7] =
true;
806 double w_et = met_et+
pt;
807 double w_px = met_px+px;
808 double w_py = met_py+py;
810 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
811 massT = (massT>0) ?
sqrt(massT) : 0;
813 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
814 if (massT>
mtMin_ && massT<
mtMax_) electron_sel[8] =
true;
829 if (njets<=
nJetMax_) electron_sel[10] =
true;
832 int flags_passed = 0;
833 bool rec_sel_this =
true;
834 bool eid_sel_this =
true;
835 bool iso_sel_this =
true;
836 bool all_sel_this =
true;
837 for (
int j=0;
j<NFLAGS; ++
j)
839 if (electron_sel[
j]) flags_passed += 1;
840 if (j<2 && !electron_sel[j]) rec_sel_this =
false;
841 if (j<4 && !electron_sel[j]) eid_sel_this =
false;
842 if (j<7 && !electron_sel[j]) iso_sel_this =
false;
843 if (!electron_sel[j]) all_sel_this =
false;
870 if (rec_sel_this) rec_sel =
true;
872 if (eid_sel_this) iso_sel =
true;
874 if (iso_sel_this) iso_sel =
true;
877 if (all_sel_this) all_sel =
true;
880 if (flags_passed >= (NFLAGS-1))
882 if (!electron_sel[0] || flags_passed==NFLAGS)
886 if (!electron_sel[1] || flags_passed==NFLAGS)
890 if (!electron_sel[2] || flags_passed==NFLAGS)
901 if (!electron_sel[3] || flags_passed==NFLAGS)
912 if (!electron_sel[4] || flags_passed==NFLAGS)
923 if (!electron_sel[5] || flags_passed==NFLAGS)
934 if (!electron_sel[6] || flags_passed==NFLAGS)
961 if (!electron_sel[7] || flags_passed==NFLAGS)
968 hlt_hist_done =
true;
969 if (!electron_sel[8] || flags_passed==NFLAGS)
973 if (!electron_sel[9] || flags_passed==NFLAGS)
975 if (!met_hist_done) {
979 met_hist_done =
true;
988 if (!electron_sel[10] || flags_passed==NFLAGS) {
989 if (!njets_hist_done)
999 njets_hist_done =
true;
1009 if (electronCollectionSize > 1)
1011 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]) ) );
1019 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]) ) );
1026 if (rec_sel)
nrec++;
1027 if (eid_sel)
neid++;
1028 if (iso_sel)
niso++;
1034 LogTrace(
"") <<
">>>> Event ACCEPTED";
1036 LogTrace(
"") <<
">>>> Event REJECTED";
1050 if (deltaPhi < 0) deltaPhi = -
deltaPhi;
1052 if (deltaPhi > 3.1415926) {
1053 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 float massSqr() const
mass squared
tuple met
____________________________________________________________________________||
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * nelectrons_before_
HLTConfigProvider hltConfigProvider_
virtual float pt() const
transverse momentum
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
virtual double et() const
transverse energy
MonitorElement * sieieendcap_before_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * sieieendcap_after_
virtual float phi() const
momentum azimuthal angle
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_
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_
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecTag_
virtual float eta() const
momentum pseudorapidity
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * hcalisoendcap_after_
EwkElecDQM(const edm::ParameterSet &)
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_
MonitorElement * jet_eta_before_
static const char *const trigNames[]
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup) const
MonitorElement * detainendcap_after_
MonitorElement * njets_before_
virtual double px() const
x coordinate of momentum vector
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
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
MonitorElement * met_before_
MonitorElement * trkisoendcap_before_
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
virtual double pz() const
z coordinate of momentum vector
float dr03EcalRecHitSumEt() const
edm::EDGetTokenT< edm::TriggerResults > trigTag_
MonitorElement * met_after_
void HERE(const char *msg)
MonitorElement * trkisobarrel_after_
MonitorElement * eta_after_
const std::vector< std::string > elecTrig_
MonitorElement * npvs_before_
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.
MonitorElement * eta_before_
MonitorElement * invmassPU_before_
virtual double py() const
y coordinate of momentum vector
void setCurrentFolder(const std::string &fullpath)