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")),
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 if (!zMuMu_found && !zMuSta_found && zMuTrack->size() > 0 ) {
385 for(
unsigned int i = 0;
i < zMuTrack->size(); ++
i) {
386 const Candidate & zMuTrackCand = (*zMuTrack)[
i];
394 double iso0 =
candidateIsolation(lep0,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
395 double iso1 =
candidateIsolation(lep1,
ptThreshold_,
etEcalThreshold_,
etHcalThreshold_,
dRVetoTrk_,
dRTrk_,
dREcal_ ,
dRHcal_,
alpha_,
beta_,
relativeIsolation_);
402 double mass = zMuTrackCand.
mass();
408 bool trig0found =
false;
409 if( mu0HLTMatches.size()>0 )
412 GenParticleRef zMuTrackMatch = (*zMuTrackMatchMap)[zMuTrackCandRef];
430 int partId0 = dauGen0->
pdgId();
431 int partId1 = dauGen1->
pdgId();
432 int partId2 = dauGen2->
pdgId();
433 bool muplusFound=
false;
434 bool muminusFound=
false;
436 if (partId0==13 || partId1==13 || partId2==13) muminusFound=
true;
437 if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=
true;
438 if (partId0==23 || partId1==23 || partId2==23) ZFound=
true;
439 return muplusFound*muminusFound*ZFound;
444 int partId0 = dauGen0->
pdgId();
445 int partId1 = dauGen1->
pdgId();
446 int partId2 = dauGen2->
pdgId();
448 if (partId0 == ipart) {
451 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
452 ptpart = dauMuGen->
pt();
456 if (partId1 == ipart) {
459 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
460 ptpart = dauMuGen->
pt();
464 if (partId2 == ipart) {
468 ptpart = dauMuGen->
pt();
477 int partId0 = dauGen0->
pdgId();
478 int partId1 = dauGen1->
pdgId();
479 int partId2 = dauGen2->
pdgId();
481 if (partId0 == ipart) {
484 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
485 etapart = dauMuGen->
eta();
489 if (partId1 == ipart) {
492 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
493 etapart = dauMuGen->
eta();
497 if (partId2 == ipart) {
501 etapart = dauMuGen->
eta();
510 int partId0 = dauGen0->
pdgId();
511 int partId1 = dauGen1->
pdgId();
512 int partId2 = dauGen2->
pdgId();
514 if (partId0 == ipart) {
517 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
518 phipart = dauMuGen->
phi();
522 if (partId1 == ipart) {
525 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
526 phipart = dauMuGen->
phi();
530 if (partId2 == ipart) {
534 phipart = dauMuGen->
phi();
543 int partId0 = dauGen0->
pdgId();
544 int partId1 = dauGen1->
pdgId();
545 int partId2 = dauGen2->
pdgId();
547 if (partId0 == ipart) {
550 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
551 p4part = dauMuGen->
p4();
555 if (partId1 == ipart) {
558 if(dauMuGen->
pdgId() == ipart && dauMuGen->
status() ==1) {
559 p4part = dauMuGen->
p4();
563 if (partId2 == ipart) {
567 p4part = dauMuGen->
p4();
588 double err_effHLT_afterIso=
sqrt( effHLT_afterIso * (1 - effHLT_afterIso)/nGLB_afterIso);
589 double err_effsta_afterIso =
sqrt(effSta_afterIso*(1-effSta_afterIso)/n1_afterIso);
590 double err_efftrk_afterIso =
sqrt(effTrk_afterIso*(1-effTrk_afterIso)/n2_afterIso);
593 cout <<
"------------------------------------ Counters --------------------------------" << endl;
599 cout <<
"number of events zMuMu with mu1 only triggered " << nMu1onlyTriggered << endl;
600 cout <<
"=========================================" << endl;
604 cout <<
"n. of ZMuSta MC matched and passing ALL cuts: " << nStaMuonsMatched_passedIso << endl;
605 cout <<
"n. of ZmuTrck MC matched and passing ALL cuts: " << nTracksMuonsMatched_passedIso << endl;
607 cout <<
"=================================================================================" << endl;
608 cout <<
"Iso efficiency: " << eff_Iso <<
" +/- " << err_effIso << endl;
609 cout <<
"HLT efficiency: " << effHLT_afterIso <<
" +/- " << err_effHLT_afterIso << endl;
610 cout <<
"eff StandAlone (after Isocut) : " << effSta_afterIso <<
"+/-" << err_effsta_afterIso << endl;
611 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 float mass() const =0
mass
virtual float eta() const =0
momentum pseudorapidity
int nGlobalMuonsMatched_passedIso
#define DEFINE_FWK_MODULE(type)
virtual int status() const =0
status word
virtual float phi() const =0
momentum azimuthal angle
float getParticlePhi(const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
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
virtual float pt() const =0
transverse momentum
edm::ValueMap< float > IsolationCollection
edm::InputTag zMuMuMatchMap_
int nTracksMuonsMatched_passedIso
reco::CandidateBaseRef trackMuonCandRef_
edm::InputTag zMuStandAloneMatchMap_
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
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
const reco::PFCandidateRefVector & tracks_
isodeposit::AbsVetos AbsVetos
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Analysis-level muon class.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
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)
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