39 metTag_ (cfg.getUntrackedParameter<edm::
InputTag> (
"METTag", edm::
InputTag(
"pfmet"))),
40 jetTag_ (cfg.getUntrackedParameter<edm::
InputTag> (
"JetTag", edm::
InputTag(
"ak5PFJets"))),
42 cfg.getUntrackedParameter<edm::
InputTag> (
"TrigTag",
43 edm::
InputTag(
"TriggerResults::HLT")))),
45 cfg.getUntrackedParameter<edm::
InputTag> (
"MuonTag",
48 cfg.getUntrackedParameter<edm::
InputTag> (
"METTag",
51 cfg.getUntrackedParameter<edm::
InputTag> (
"JetTag",
54 cfg.getUntrackedParameter<edm::
InputTag> (
"phoTag",
57 cfg.getUntrackedParameter<edm::
InputTag> (
"VertexTag",
58 edm::
InputTag(
"offlinePrimaryVertices")))),
60 cfg.getUntrackedParameter<edm::
InputTag> (
"beamSpotTag",
62 trigPathNames_(cfg.getUntrackedParameter<std::vector <std::
string> >(
"TrigPathNames")),
65 isAlsoTrackerMuon_(cfg.getUntrackedParameter<bool>(
"IsAlsoTrackerMuon",
true)),
66 dxyCut_ (cfg.getUntrackedParameter<double>(
"DxyCut", 0.2)),
67 normalizedChi2Cut_(cfg.getUntrackedParameter<double>(
"NormalizedChi2Cut", 10.)),
68 trackerHitsCut_ (cfg.getUntrackedParameter<int>(
"TrackerHitsCut", 11)),
69 pixelHitsCut_ (cfg.getUntrackedParameter<int>(
"PixelHitsCut", 1)),
70 muonHitsCut_ (cfg.getUntrackedParameter<int>(
"MuonHitsCut", 1)),
71 nMatchesCut_ (cfg.getUntrackedParameter<int>(
"NMatchesCut", 2)),
74 isRelativeIso_(cfg.getUntrackedParameter<bool>(
"IsRelativeIso",
true)),
75 isCombinedIso_(cfg.getUntrackedParameter<bool>(
"IsCombinedIso",
false)),
76 isoCut03_ (cfg.getUntrackedParameter<double>(
"IsoCut03", 0.1)),
77 acopCut_ (cfg.getUntrackedParameter<double>(
"AcopCut", 999.)),
78 metMin_ (cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
79 metMax_ (cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
80 mtMin_ (cfg.getUntrackedParameter<double>(
"MtMin", 50.)),
81 mtMax_ (cfg.getUntrackedParameter<double>(
"MtMax", 200.)),
82 ptCut_ (cfg.getUntrackedParameter<double>(
"PtCut", 20.)),
83 etaCut_ (cfg.getUntrackedParameter<double>(
"EtaCut", 2.4)),
86 ptThrForZ1_ (cfg.getUntrackedParameter<double>(
"PtThrForZ1", 20.)),
87 ptThrForZ2_ (cfg.getUntrackedParameter<double>(
"PtThrForZ2", 10.)),
90 dimuonMassMin_(cfg.getUntrackedParameter<double>(
"dimuonMassMin", 80.)),
91 dimuonMassMax_(cfg.getUntrackedParameter<double>(
"dimuonMassMax", 120.)),
94 eJetMin_ (cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
95 nJetMax_ (cfg.getUntrackedParameter<int>(
"NJetMax", 999999)),
98 ptThrForPhoton_(cfg.getUntrackedParameter<double>(
"ptThrForPhoton",5.)),
99 nPhoMax_(cfg.getUntrackedParameter<int>(
"nPhoMax", 999999))
120 bool isConfigChanged =
false;
132 char chtitle[256] =
"";
135 pt_after_ =
theDbe->
book1D(
"PT_AFTERWCUTS",
"Muon transverse momentum (global muon) [GeV]",100,0.,100.);
157 iso_after_ =
theDbe->
book1D(
"ISO_AFTERWCUTS",
"Absolute (combined) isolation variable [GeV]",100, 0., 20.);
167 snprintf(chtitle, 255,
"Transverse mass (%s) [GeV]",
metTag_.
label().data());
171 snprintf(chtitle, 255,
"Missing transverse energy (%s) [GeV]",
metTag_.
label().data());
176 snprintf(chtitle, 255,
"MU-MET (%s) acoplanarity",
metTag_.
label().data());
180 snprintf(chtitle, 255,
"Z selection: muons above %.2f GeV",
ptThrForZ1_);
182 snprintf(chtitle, 255,
"Z selection: muons above %.2f GeV",
ptThrForZ2_);
256 snprintf(chtitle, 255,
"Photon pseudorapidity (pT>%4.1f)",
ptThrForPhoton_);
278 unsigned int muonCollectionSize = muonCollection->size();
289 unsigned int nmuonsForZ1 = 0;
290 unsigned int nmuonsForZ2 = 0;
292 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
293 const Muon&
mu = muonCollection->at(
i);
296 double dxy = mu.
innerTrack()->dxy(beamSpotHandle->position());
298 if (fabs(dxy)>1) { cosmic=
true;
break;}
303 for (
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
304 const Muon& mu2 = muonCollection->at(
j);
328 const MET&
met = metCollection->at(0);
329 double met_et = met.
pt();
330 LogTrace(
"") <<
">>> MET, MET_px, MET_py: " << met_et <<
", " << met.
px() <<
", " << met.
py() <<
" [GeV]";
336 LogError(
"") <<
">>> Vertex collection does not exist !!!";
339 unsigned int vertexCollectionSize = vertexCollection->size();
344 for (
unsigned int i=0;
i<vertexCollectionSize;
i++) {
345 const Vertex& vertex = vertexCollection->at(
i);
346 if (vertex.
isValid()) nvvertex++;
351 bool trigger_fired =
false;
385 if (prescaleSet==-1) {
386 LogTrace(
"") <<
"Failed to determine prescaleSet\n";
391 for (
unsigned int i=0; (
i<triggerResults->size()) && (trigger_fired==
false);
i++) {
393 if (!triggerResults->accept(
i))
continue;
404 if (prescaleSet!=-1) {
412 for (
unsigned int ps=0;
438 unsigned int jetCollectionSize = jetCollection->size();
439 int njets = 0;
int LEADJET=-1;
double max_pt=0;
440 for (
unsigned int i=0;
i<jetCollectionSize;
i++) {
441 const Jet&
jet = jetCollection->at(
i);
442 double minDistance=99999;
443 for (
unsigned int j=0;
j<muonCollectionSize;
j++) {
444 const Muon&
mu = muonCollection->at(
j);
446 if (minDistance>distance) minDistance=distance;
448 if (minDistance<0.3)
continue;
449 if(jet.
et()>max_pt) { LEADJET=
i; max_pt=jet.
et();}
454 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
455 LogTrace(
"") <<
">>> Number of jets above " <<
eJetMin_ <<
" [GeV]: " << njets;
457 double lead_jet_pt=-1;
458 double lead_jet_eta=-100;
460 const Jet& leadJet = jetCollection->at(LEADJET);
463 lead_jet_pt=leadJet.
pt();
464 lead_jet_eta=leadJet.
eta();
474 for (
unsigned int i=0;
i<photonCollection->size();
i++){
475 const Photon &ph = photonCollection->at(
i);
476 double photonPt = ph.
pt();
484 LogTrace(
"") <<
" >>> N photons " << ngam << std::endl;
510 bool hlt_hist_done =
false;
511 bool zhlt_hist_done =
false;
512 bool zjets_hist_done =
false;
513 bool zfullsel_hist_done =
false;
514 bool met_hist_done =
false;
515 bool njets_hist_done =
false;
516 bool wfullsel_hist_done =
false;
519 const int NFLAGS = 11;
520 bool muon_sel[NFLAGS];
521 const int NFLAGSZ = 13;
522 bool zmuon_sel[NFLAGSZ];
525 double number_of_muons=0;
526 double number_of_goodMuons=0;
529 for (
unsigned int i=0;
i<muonCollectionSize;
i++) {
530 for (
int j=0;
j<NFLAGS; ++
j) {
536 const Muon&
mu = muonCollection->at(
i);
541 LogTrace(
"") <<
"> Wsel: processing muon number " <<
i <<
"...";
548 LogTrace(
"") <<
"\t... pt, eta: " << pt <<
" [GeV], " <<
eta;;
549 if (pt>
ptCut_) muon_sel[0] =
true;
550 if (fabs(eta)<
etaCut_) muon_sel[1] =
true;
555 double dxy = gm->dxy(beamSpotHandle->position());
556 double normalizedChi2 = gm->normalizedChi2();
557 double trackerHits = tk->hitPattern().numberOfValidTrackerHits();
558 int pixelHits = tk->hitPattern().numberOfValidPixelHits();
559 int muonHits = gm->hitPattern().numberOfValidMuonHits();
562 LogTrace(
"") <<
"\t... dxy, normalizedChi2, trackerHits, isTrackerMuon?: " << dxy <<
" [cm], " << normalizedChi2 <<
", " << trackerHits <<
", " << mu.
isTrackerMuon();
563 if (fabs(dxy)<
dxyCut_) muon_sel[2] =
true;
574 if(quality) number_of_goodMuons++;
596 if (isovar<
isoCut03_) muon_sel[4] =
true;
598 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << muon_sel[6];
603 if (trigger_fired) muon_sel[5] =
true;
610 double w_et = met_et+mu.
pt();
611 double w_px = met.
px()+mu.
px();
612 double w_py = met.
py()+mu.
py();
614 double massT = w_et*w_et - w_px*w_px - w_py*w_py;
615 massT = (massT>0) ?
sqrt(massT) : 0;
617 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << w_px <<
", " << w_py <<
" [GeV]";
624 double acop = deltaphi.
value();
625 if (acop<0) acop = - acop;
627 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
628 if (acop<
acopCut_) muon_sel[8] =
true;
632 if (nmuonsForZ1<1 || nmuonsForZ2<2) muon_sel[9] =
true;
633 if (njets<=
nJetMax_) muon_sel[10] =
true;
636 int flags_passed = 0;
637 for (
int j=0;
j<NFLAGS; ++
j) {
638 if (muon_sel[
j]) flags_passed += 1;
642 if (flags_passed >= (NFLAGS-1)) {
643 if (!muon_sel[0] || flags_passed==NFLAGS)
645 if (!muon_sel[1] || flags_passed==NFLAGS)
647 if (!muon_sel[2] || flags_passed==NFLAGS)
649 if (!muon_sel[3] || flags_passed==NFLAGS)
651 if (!muon_sel[4] || flags_passed==NFLAGS)
653 if (!muon_sel[5] || flags_passed==NFLAGS)
655 hlt_hist_done =
true;
656 if (!muon_sel[6] || flags_passed==NFLAGS)
658 if (!muon_sel[7] || flags_passed==NFLAGS)
660 met_hist_done =
true;
661 if (!muon_sel[8] || flags_passed==NFLAGS)
664 if (!muon_sel[10] || flags_passed==NFLAGS) {
665 if (!njets_hist_done) {
670 njets_hist_done =
true;
672 if( flags_passed==NFLAGS ) {
673 if (!wfullsel_hist_done){
679 wfullsel_hist_done=
true;
685 if ( muon4Z && !muon_sel[9]){
688 for (
unsigned int j=
i+1;
j<muonCollectionSize;
j++) {
690 for (
int ij=0; ij<NFLAGSZ; ++ij) {
691 zmuon_sel[ij] =
false;
694 for (
int ji=0; ji<5; ++ji ) {
695 zmuon_sel[ji] = muon_sel[ji];
698 const Muon& mu2 = muonCollection->at(
j);
700 if (mu2.
charge() * charge != -1 )
continue;
703 double pt2 = mu2.
pt();
if (pt2>
ptThrForZ2_) zmuon_sel[5] =
true;
704 double eta2=mu2.
eta();
if (fabs(eta2)<
etaCut_) zmuon_sel[6] =
true;
705 double dxy2 = gm2->dxy(beamSpotHandle->position());
if (fabs(dxy2)<
dxyCut_) zmuon_sel[7] =
true;
706 double normalizedChi22 = gm2->normalizedChi2();
707 double trackerHits2 = tk2->hitPattern().numberOfValidTrackerHits();
708 int pixelHits2 = tk2->hitPattern().numberOfValidPixelHits();
709 int muonHits2 = gm2->hitPattern().numberOfValidMuonHits();
718 zmuon_sel[8]=quality2;
725 if (isovar2<
isoCut03_) zmuon_sel[9] =
true;
726 if (trigger_fired) zmuon_sel[10] =
true;
731 if (njets <=
nJetMax_) zmuon_sel[12] =
true;
734 int flags_passed_z = 0;
736 for (
int jj=0;
jj<NFLAGSZ; ++
jj) {
737 if (zmuon_sel[
jj]) ++flags_passed_z ;
740 if (flags_passed_z >= (NFLAGSZ-1)) {
741 if (!zmuon_sel[0] || flags_passed_z==NFLAGSZ) {
pt1_afterZ_->
Fill(pt); }
745 if (!zmuon_sel[4] || flags_passed_z==NFLAGSZ) {
iso1_afterZ_->
Fill(isovar); }
746 if (!zmuon_sel[5] || flags_passed_z==NFLAGSZ) {
pt2_afterZ_->
Fill(pt2); }
750 if (!zmuon_sel[9] || flags_passed_z==NFLAGSZ) {
iso2_afterZ_->
Fill(isovar2); }
751 if (!zmuon_sel[10] || flags_passed_z==NFLAGSZ) {
753 zhlt_hist_done =
true;
756 if (!zmuon_sel[12] || flags_passed_z==NFLAGSZ ){
757 if(!zjets_hist_done){
762 zjets_hist_done=
true;
764 if(flags_passed_z==NFLAGSZ) {
766 if(!zfullsel_hist_done){
780 zfullsel_hist_done=
true;
787 if (zfullsel_hist_done) {
MonitorElement * met_before_
virtual double et() const GCC11_FINAL
transverse energy
MonitorElement * ptDiffPM_afterZ_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
MonitorElement * dimuonmass_afterZ_
tuple met
____________________________________________________________________________||
EwkMuDQM(const edm::ParameterSet &)
float sumPt
sum-pt of tracks
MonitorElement * njets_afterZ_
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual double p() const GCC11_FINAL
magnitude of momentum vector
MonitorElement * iso2_afterZ_
MonitorElement * npvs_before_
virtual TrackRef innerTrack() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * dxy1_afterZ_
MonitorElement * njets_before_
MonitorElement * dxy_before_
MonitorElement * ztrig_afterZ_
MonitorElement * trig_before_
MonitorElement * trig_after_
MonitorElement * leadingjet_eta_afterZ_
bool isTrackerMuon() const
MonitorElement * muoncharge_before_
Base class for all types of Jets.
bool isValid() const
Tells whether the vertex is valid.
edm::EDGetTokenT< reco::BeamSpot > beamSpotTag_
MonitorElement * eta2_afterZ_
edm::EDGetTokenT< edm::TriggerResults > trigTag_
MonitorElement * npvs_afterZ_
bool isGlobalMuon() const
MonitorElement * leadingjet_eta_before_
std::vector< std::string > trigPathNames_
MonitorElement * acop_before_
MonitorElement * leadingjet_pt_after_
virtual double pz() const GCC11_FINAL
z coordinate of momentum vector
MonitorElement * goodewkmuon_before_
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
MonitorElement * eta_after_
MonitorElement * muoncharge_afterZ_
MonitorElement * pt_before_
MonitorElement * dxy2_afterZ_
MonitorElement * leadingjet_pt_before_
MonitorElement * goodewkmuon1_afterZ_
MonitorElement * iso_before_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * npvs_after_
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
MonitorElement * goodewkmuon2_afterZ_
unsigned int prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
MonitorElement * njets_after_
bool isNull() const
Checks for null.
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * ngoodmuons_
MonitorElement * n_zselPt2thr_
MonitorElement * pt2_afterZ_
HLTConfigProvider hltConfigProvider_
MonitorElement * met_afterZ_
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
MonitorElement * leadingjet_eta_after_
static std::string const triggerResults
MonitorElement * mt_after_
MonitorElement * goodewkmuon_after_
MonitorElement * muoncharge_after_
MonitorElement * mt_before_
MonitorElement * eta_before_
MonitorElement * iso1_afterZ_
int numberOfMatches(ArbitrationType type=SegmentAndTrackArbitration) const
get number of chambers with matched segments
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
T value() const
Explicit access to value in case implicit conversion not OK.
static const char *const trigNames[]
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
edm::EDGetTokenT< edm::View< reco::Vertex > > vertexTag_
double normalizedChi2Cut_
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup) const
MonitorElement * pt_after_
MonitorElement * iso_after_
std::string const & triggerName(unsigned int index) const
virtual int charge() const GCC11_FINAL
electric charge
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
MonitorElement * eta1_afterZ_
MonitorElement * ptDiffPM_before_
MonitorElement * pt1_afterZ_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
MonitorElement * dxy_after_
unsigned int prescaleSize() const
MonitorElement * met_after_
volatile std::atomic< bool > shutdown_flag false
edm::EDGetTokenT< edm::View< reco::Muon > > muonTag_
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * n_zselPt1thr_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
edm::EDGetTokenT< edm::View< reco::Photon > > phoTag_
void setCurrentFolder(const std::string &fullpath)
MonitorElement * dimuonmass_before_
const MuonIsolation & isolationR03() const
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
MonitorElement * leadingjet_pt_afterZ_
MonitorElement * acop_after_