48 using namespace isodeposit;
61 virtual void endJob();
72 double etamin_, etamax_,
ptmin_, massMin_, massMax_, isoMax_;
74 double ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_, alpha_, beta_;
82 TH1D *h_trackProbe_eta, *
h_trackProbe_pt, *h_staProbe_eta, *h_staProbe_pt, *h_ProbeOk_eta, *h_ProbeOk_pt;
101 double isolation(
const T *
t,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta,
bool relativeIsolation) {
115 vetosTrk.push_back(
new ConeVeto( dir, dRVetoTrk ));
119 vetosEcal.push_back(
new ConeVeto( dir, 0.));
123 vetosHcal.push_back(
new ConeVeto( dir, 0. ));
126 double isovalueTrk = (trkIso->
sumWithin(dRTrk,vetosTrk));
127 double isovalueEcal = (ecalIso->
sumWithin(dREcal,vetosEcal));
128 double isovalueHcal = (hcalIso->
sumWithin(dRHcal,vetosHcal));
131 double iso = alpha*( ((1+
beta)/2*isovalueEcal) + ((1-
beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk) ;
132 if(relativeIsolation) iso /= t->pt();
137 double candidateIsolation(
const reco::Candidate*
c,
double ptThreshold,
double etEcalThreshold,
double etHcalThreshold ,
double dRVetoTrk,
double dRTrk,
double dREcal ,
double dRHcal,
double alpha,
double beta,
bool relativeIsolation) {
139 if(mu != 0)
return isolation(mu, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal , dRHcal, alpha, beta, relativeIsolation);
141 if(trk != 0)
return isolation(trk, ptThreshold, etEcalThreshold, etHcalThreshold ,dRVetoTrk, dRTrk, dREcal ,
142 dRHcal, alpha, beta, relativeIsolation);
144 <<
"Candidate daughter #0 is neither pat::Muons nor pat::GenericParticle\n";
165 using namespace reco;
172 zMuMu_(pset.getParameter<
InputTag>(
"zMuMu")),
173 zMuMuMatchMap_(pset.getParameter<
InputTag>(
"zMuMuMatchMap")),
174 zMuStandAlone_(pset.getParameter<
InputTag>(
"zMuStandAlone")),
175 zMuStandAloneMatchMap_(pset.getParameter<
InputTag>(
"zMuStandAloneMatchMap")),
176 zMuTrack_(pset.getParameter<
InputTag>(
"zMuTrack")),
177 zMuTrackMatchMap_(pset.getParameter<
InputTag>(
"zMuTrackMatchMap")),
178 muons_(pset.getParameter<
InputTag>(
"muons")),
179 tracks_(pset.getParameter<
InputTag>(
"tracks")),
180 genParticles_(pset.getParameter<
InputTag>(
"genParticles" ) ),
182 bothMuons_(pset.getParameter<bool>(
"bothMuons")),
183 etamin_(pset.getUntrackedParameter<double>(
"etamin")),
184 etamax_(pset.getUntrackedParameter<double>(
"etamax")),
185 ptmin_(pset.getUntrackedParameter<double>(
"ptmin")),
186 massMin_(pset.getUntrackedParameter<double>(
"zMassMin")),
187 massMax_(pset.getUntrackedParameter<double>(
"zMassMax")),
188 isoMax_(pset.getUntrackedParameter<double>(
"isomax")),
189 ptThreshold_(pset.getUntrackedParameter<double>(
"ptThreshold")),
190 etEcalThreshold_(pset.getUntrackedParameter<double>(
"etEcalThreshold")),
191 etHcalThreshold_(pset.getUntrackedParameter<double>(
"etHcalThreshold")),
192 dRVetoTrk_(pset.getUntrackedParameter<double>(
"deltaRVetoTrk")),
193 dRTrk_(pset.getUntrackedParameter<double>(
"deltaRTrk")),
194 dREcal_(pset.getUntrackedParameter<double>(
"deltaREcal")),
195 dRHcal_(pset.getUntrackedParameter<double>(
"deltaRHcal")),
196 alpha_(pset.getUntrackedParameter<double>(
"alpha")),
197 beta_(pset.getUntrackedParameter<double>(
"beta")),
198 relativeIsolation_(pset.getUntrackedParameter<bool>(
"relativeIsolation")),
199 hltPath_(pset.getUntrackedParameter<std::string >(
"hltPath")) {
203 double etaRange[8] = {-2.5,-2.,-1.2,-0.8,0.8,1.2,2.,2.5};
204 double ptRange[4] = {20.,40.,60.,100.};
240 event.getByLabel(
zMuMu_, zMuMu);
244 event.getByLabel(
muons_, muons);
245 event.getByLabel(
tracks_, tracks);
258 bool zMuMu_found =
false;
261 if (zMuMu->size() > 0 ) {
263 for(
unsigned int i = 0;
i < zMuMu->size(); ++
i) {
274 double iso0 =
candidateIsolation(lep0,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
275 double iso1 =
candidateIsolation(lep1,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
281 double mass = zMuMuCand.
mass();
289 bool trig0found =
false;
290 bool trig1found =
false;
291 if( mu0HLTMatches.size()>0 )
293 if( mu1HLTMatches.size()>0 )
335 bool zMuSta_found =
false;
336 if (!zMuMu_found && zMuStandAlone->size() > 0 ) {
338 for(
unsigned int i = 0;
i < zMuStandAlone->size(); ++
i) {
339 const Candidate & zMuStandAloneCand = (*zMuStandAlone)[
i];
341 GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
350 double iso0 =
candidateIsolation(lep0,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
351 double iso1 =
candidateIsolation(lep1,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
353 double pt0 = zMuStandAloneCand.
daughter(0)->
pt();
354 double pt1 = zMuStandAloneCand.
daughter(1)->
pt();
355 double eta0 = zMuStandAloneCand.
daughter(0)->
eta();
356 double eta1 = zMuStandAloneCand.
daughter(1)->
eta();
357 double mass = zMuStandAloneCand.
mass();
363 bool trig0found =
false;
364 if( mu0HLTMatches.size()>0 )
383 bool zMuTrack_found =
false;
384 if (!zMuMu_found && !zMuSta_found && zMuTrack->size() > 0 ) {
386 for(
unsigned int i = 0;
i < zMuTrack->size(); ++
i) {
387 const Candidate & zMuTrackCand = (*zMuTrack)[
i];
395 double iso0 =
candidateIsolation(lep0,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
396 double iso1 =
candidateIsolation(lep1,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
403 double mass = zMuTrackCand.
mass();
409 bool trig0found =
false;
410 if( mu0HLTMatches.size()>0 )
413 GenParticleRef zMuTrackMatch = (*zMuTrackMatchMap)[zMuTrackCandRef];
415 zMuTrack_found =
true;
432 int partId0 = dauGen0->
pdgId();
433 int partId1 = dauGen1->
pdgId();
434 int partId2 = dauGen2->
pdgId();
435 bool muplusFound=
false;
436 bool muminusFound=
false;
438 if (partId0==13 || partId1==13 || partId2==13) muminusFound=
true;
439 if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=
true;
440 if (partId0==23 || partId1==23 || partId2==23) ZFound=
true;
441 return muplusFound*muminusFound*ZFound;
446 int partId0 = dauGen0->
pdgId();
447 int partId1 = dauGen1->
pdgId();
448 int partId2 = dauGen2->
pdgId();
450 if (partId0 == ipart) {
453 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
454 ptpart = dauMuGen->
pt();
458 if (partId1 == ipart) {
461 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
462 ptpart = dauMuGen->
pt();
466 if (partId2 == ipart) {
470 ptpart = dauMuGen->
pt();
479 int partId0 = dauGen0->
pdgId();
480 int partId1 = dauGen1->
pdgId();
481 int partId2 = dauGen2->
pdgId();
483 if (partId0 == ipart) {
486 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
487 etapart = dauMuGen->
eta();
491 if (partId1 == ipart) {
494 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
495 etapart = dauMuGen->
eta();
499 if (partId2 == ipart) {
503 etapart = dauMuGen->
eta();
512 int partId0 = dauGen0->
pdgId();
513 int partId1 = dauGen1->
pdgId();
514 int partId2 = dauGen2->
pdgId();
516 if (partId0 == ipart) {
519 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
520 phipart = dauMuGen->
phi();
524 if (partId1 == ipart) {
527 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
528 phipart = dauMuGen->
phi();
532 if (partId2 == ipart) {
536 phipart = dauMuGen->
phi();
545 int partId0 = dauGen0->
pdgId();
546 int partId1 = dauGen1->
pdgId();
547 int partId2 = dauGen2->
pdgId();
549 if (partId0 == ipart) {
552 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
553 p4part = dauMuGen->
p4();
557 if (partId1 == ipart) {
560 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
561 p4part = dauMuGen->
p4();
565 if (partId2 == ipart) {
569 p4part = dauMuGen->
p4();
590 double err_effHLT_afterIso=
sqrt( effHLT_afterIso * (1 - effHLT_afterIso)/nGLB_afterIso);
591 double err_effsta_afterIso =
sqrt(effSta_afterIso*(1-effSta_afterIso)/n1_afterIso);
592 double err_efftrk_afterIso =
sqrt(effTrk_afterIso*(1-effTrk_afterIso)/n2_afterIso);
595 cout <<
"------------------------------------ Counters --------------------------------" << endl;
601 cout <<
"number of events zMuMu with mu1 only triggered " << nMu1onlyTriggered << endl;
602 cout <<
"=========================================" << endl;
606 cout <<
"n. of ZMuSta MC matched and passing ALL cuts: " << nStaMuonsMatched_passedIso << endl;
607 cout <<
"n. of ZmuTrck MC matched and passing ALL cuts: " << nTracksMuonsMatched_passedIso << endl;
609 cout <<
"=================================================================================" << endl;
610 cout <<
"Iso efficiency: " << eff_Iso <<
" +/- " << err_effIso << endl;
611 cout <<
"HLT efficiency: " << effHLT_afterIso <<
" +/- " << err_effHLT_afterIso << endl;
612 cout <<
"eff StandAlone (after Isocut) : " << effSta_afterIso <<
"+/-" << err_effsta_afterIso << endl;
613 cout <<
"eff Tracker (after Isocut) : " << effTrk_afterIso <<
"+/-" << err_efftrk_afterIso << endl;
edm::InputTag zMuStandAlone_
ZMuMu_MCanalyzer(const edm::ParameterSet &pset)
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
double candidateIsolation(const reco::Candidate *c, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta, bool relativeIsolation)
virtual double pt() const =0
transverse momentum
int nGlobalMuonsMatched_passedIso
#define DEFINE_FWK_MODULE(type)
virtual double mass() const =0
mass
virtual int status() const =0
status word
float getParticlePhi(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=true) const
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
bool check_ifZmumu(const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
edm::InputTag zMuTrackMatchMap_
bool isNonnull() const
Checks for non-null.
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
virtual size_type numberOfDaughters() const =0
number of daughters
edm::ValueMap< float > IsolationCollection
edm::InputTag zMuMuMatchMap_
int nTracksMuonsMatched_passedIso
reco::CandidateBaseRef trackMuonCandRef_
edm::InputTag zMuStandAloneMatchMap_
edm::InputTag genParticles_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int nGlobalMuonsMatched_passed
virtual int pdgId() const =0
PDG identifier.
int n2GlobalMuonsMatched_passedIso2Trg
int nStaMuonsMatched_passedIso
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
int n2GlobalMuonsMatched_passedIso
float getParticleEta(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
T * make() const
make new ROOT object
isodeposit::AbsVetos AbsVetos
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
float getParticlePt(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
Particle::LorentzVector getParticleP4(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual const CandidateBaseRef & masterClone() const =0