CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZMuMu_MCanalyzer Class Reference
Inheritance diagram for ZMuMu_MCanalyzer:
edm::EDAnalyzer

Public Member Functions

 ZMuMu_MCanalyzer (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
bool check_ifZmumu (const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
 
virtual void endJob ()
 
float getParticleEta (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)
 
float getParticlePhi (const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
 
float getParticlePt (const int ipart, const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
 

Private Attributes

double alpha_
 
double beta_
 
bool bothMuons_
 
double dREcal_
 
double dRHcal_
 
double dRTrk_
 
double dRVetoTrk_
 
double etamax_
 
double etamin_
 
double etEcalThreshold_
 
double etHcalThreshold_
 
edm::InputTag genParticles_
 
reco::CandidateBaseRef globalMuonCandRef_
 
TH1D * h_ProbeOk_eta
 
TH1D * h_ProbeOk_pt
 
TH1D * h_staProbe_eta
 
TH1D * h_staProbe_pt
 
TH1D * h_trackProbe_eta
 
TH1D * h_trackProbe_pt
 
string hltPath_
 
double isoMax_
 
double massMax_
 
double massMin_
 
edm::InputTag muonIso_
 
edm::InputTag muonMatchMap_
 
edm::InputTag muons_
 
int n2GlobalMuonsMatched_passedIso
 
int n2GlobalMuonsMatched_passedIso2Trg
 
int nGlobalMuonsMatched_passed
 
int nGlobalMuonsMatched_passedIso
 
int nMu0onlyTriggered
 
int nMu1onlyTriggered
 
int nStaMuonsMatched_passedIso
 
int nTracksMuonsMatched_passedIso
 
int nZMuMu_matched
 
int nZMuSta_matched
 
int nZMuTrk_matched
 
OverlapChecker overlap_
 
double ptmin_
 
double ptThreshold_
 
bool relativeIsolation_
 
reco::CandidateBaseRef standAloneMuonCandRef_
 
edm::InputTag trackIso_
 
reco::CandidateBaseRef trackMuonCandRef_
 
edm::InputTag tracks_
 
edm::InputTag zMuMu_
 
edm::InputTag zMuMuMatchMap_
 
edm::InputTag zMuStandAlone_
 
edm::InputTag zMuStandAloneMatchMap_
 
edm::InputTag zMuTrack_
 
edm::InputTag zMuTrackMatchMap_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 51 of file ZMuMu_MCanalyzer.cc.

Constructor & Destructor Documentation

ZMuMu_MCanalyzer::ZMuMu_MCanalyzer ( const edm::ParameterSet pset)

Definition at line 171 of file ZMuMu_MCanalyzer.cc.

References MuonErrorMatrixValues_cff::etaRange, h_ProbeOk_eta, h_ProbeOk_pt, h_staProbe_eta, h_staProbe_pt, h_trackProbe_eta, h_trackProbe_pt, TFileDirectory::make(), n2GlobalMuonsMatched_passedIso, n2GlobalMuonsMatched_passedIso2Trg, nGlobalMuonsMatched_passed, nGlobalMuonsMatched_passedIso, nMu0onlyTriggered, nMu1onlyTriggered, nStaMuonsMatched_passedIso, nTracksMuonsMatched_passedIso, nZMuMu_matched, nZMuSta_matched, nZMuTrk_matched, and MuonErrorMatrixValues_cff::ptRange.

171  :
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" ) ),
181 
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")) {
201 
202  // binning of entries array (at moment defined by hand and not in cfg file)
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.};
205 
206  // general histograms
207  h_trackProbe_eta = fs->make<TH1D>("trackProbeEta","Eta of tracks",7,etaRange);
208  h_trackProbe_pt = fs->make<TH1D>("trackProbePt","Pt of tracks",3,ptRange);
209  h_staProbe_eta = fs->make<TH1D>("standAloneProbeEta","Eta of standAlone",7,etaRange);
210  h_staProbe_pt = fs->make<TH1D>("standAloneProbePt","Pt of standAlone",3,ptRange);
211  h_ProbeOk_eta = fs->make<TH1D>("probeOkEta","Eta of probe Ok",7,etaRange);
212  h_ProbeOk_pt = fs->make<TH1D>("probeOkPt","Pt of probe ok",3,ptRange);
213 
214  // clear global counters
221  nMu0onlyTriggered = 0;
222  nMu1onlyTriggered = 0;
223  nZMuMu_matched = 0;
224  nZMuSta_matched = 0;
225  nZMuTrk_matched = 0;
226 }
T getParameter(std::string const &) const
edm::InputTag zMuStandAlone_
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag zMuTrackMatchMap_
edm::InputTag zMuMuMatchMap_
edm::InputTag zMuStandAloneMatchMap_
edm::InputTag zMuTrack_
edm::InputTag genParticles_
edm::InputTag muons_
int n2GlobalMuonsMatched_passedIso2Trg
edm::InputTag tracks_
T * make() const
make new ROOT object
edm::InputTag zMuMu_

Member Function Documentation

void ZMuMu_MCanalyzer::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 228 of file ZMuMu_MCanalyzer.cc.

References abs, alpha_, beta_, candidateIsolation(), reco::Candidate::daughter(), dREcal_, dRHcal_, dRTrk_, dRVetoTrk_, reco::Candidate::eta(), etamax_, etamin_, etEcalThreshold_, etHcalThreshold_, genParticleCandidates2GenParticles_cfi::genParticles, genParticles_, h_ProbeOk_eta, h_ProbeOk_pt, h_staProbe_eta, h_staProbe_pt, h_trackProbe_eta, h_trackProbe_pt, hltPath_, i, edm::Ref< C, T, F >::isNonnull(), isoMax_, reco::Candidate::mass(), massMax_, massMin_, reco::Candidate::masterClone(), ExpressReco_HICollisions_FallBack::muons, muons_, n2GlobalMuonsMatched_passedIso, n2GlobalMuonsMatched_passedIso2Trg, nGlobalMuonsMatched_passed, nGlobalMuonsMatched_passedIso, nMu0onlyTriggered, nMu1onlyTriggered, nStaMuonsMatched_passedIso, nTracksMuonsMatched_passedIso, nZMuMu_matched, nZMuSta_matched, nZMuTrk_matched, reco::Candidate::pt(), ptmin_, ptThreshold_, relativeIsolation_, testEve_cfg::tracks, tracks_, pat::PATObject< ObjectType >::triggerObjectMatchesByPath(), ZMuMuAnalysisNtupler_cff::zMuMu, zMuMu_, zMuMuMatchMap_, zMuStandAlone_, zMuStandAloneMatchMap_, zMuTrack_, and zMuTrackMatchMap_.

228  {
230  Handle<GenParticleMatch> zMuMuMatchMap; //Map of Z made by Mu global + Mu global
231  Handle<CandidateView> zMuStandAlone;
232  Handle<GenParticleMatch> zMuStandAloneMatchMap; //Map of Z made by Mu + StandAlone
233  Handle<CandidateView> zMuTrack;
234  Handle<GenParticleMatch> zMuTrackMatchMap; //Map of Z made by Mu + Track
235  Handle<CandidateView> muons; //Collection of Muons
236  Handle<CandidateView> tracks; //Collection of Tracks
237 
238  Handle<GenParticleCollection> genParticles; // Collection of Generatd Particles
239 
240  event.getByLabel(zMuMu_, zMuMu);
241  event.getByLabel(zMuStandAlone_, zMuStandAlone);
242  event.getByLabel(zMuTrack_, zMuTrack);
243  event.getByLabel(genParticles_, genParticles);
244  event.getByLabel(muons_, muons);
245  event.getByLabel(tracks_, tracks);
246 
247  /*
248  cout << "********* zMuMu size : " << zMuMu->size() << endl;
249  cout << "********* zMuStandAlone size : " << zMuStandAlone->size() << endl;
250  cout << "********* zMuTrack size : " << zMuTrack->size() << endl;
251  cout << "********* muons size : " << muons->size() << endl;
252  cout << "********* tracks size : " << tracks->size() << endl;
253  */
254  // std::cout<<"Run-> "<<event.id().run()<<std::endl;
255  // std::cout<<"Event-> "<<event.id().event()<<std::endl;
256 
257 
258  bool zMuMu_found = false;
259 
260  // loop on ZMuMu
261  if (zMuMu->size() > 0 ) {
262  event.getByLabel(zMuMuMatchMap_, zMuMuMatchMap);
263  for(unsigned int i = 0; i < zMuMu->size(); ++i) { //loop on candidates
264  const Candidate & zMuMuCand = (*zMuMu)[i]; //the candidate
265  CandidateBaseRef zMuMuCandRef = zMuMu->refAt(i);
266 
267  const Candidate * lep0 = zMuMuCand.daughter( 0 );
268  const Candidate * lep1 = zMuMuCand.daughter( 1 );
269  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
270  // double trkiso0 = muonDau0.trackIso();
271  const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone());
272  //double trkiso1 = muonDau1.trackIso();
273 
276 
277  double pt0 = zMuMuCand.daughter(0)->pt();
278  double pt1 = zMuMuCand.daughter(1)->pt();
279  double eta0 = zMuMuCand.daughter(0)->eta();
280  double eta1 = zMuMuCand.daughter(1)->eta();
281  double mass = zMuMuCand.mass();
282 
283  // HLT match
284  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
286  const pat::TriggerObjectStandAloneCollection mu1HLTMatches =
288 
289  bool trig0found = false;
290  bool trig1found = false;
291  if( mu0HLTMatches.size()>0 )
292  trig0found = true;
293  if( mu1HLTMatches.size()>0 )
294  trig1found = true;
295 
296  GenParticleRef zMuMuMatch = (*zMuMuMatchMap)[zMuMuCandRef];
297  if(zMuMuMatch.isNonnull()) { // ZMuMu matched
298  zMuMu_found = true;
299  nZMuMu_matched++;
300  if (pt0>ptmin_ && pt1>ptmin_ && abs(eta0)>etamin_ && abs(eta1) >etamin_ && abs(eta0)<etamax_ && abs(eta1) <etamax_ && mass >massMin_ && mass < massMax_ && (trig0found || trig1found)) { // kinematic and trigger cuts passed
301  nGlobalMuonsMatched_passed++; // first global Muon passed kine cuts
302  nGlobalMuonsMatched_passed++; // second global muon passsed kine cuts
303  if (iso0<isoMax_) nGlobalMuonsMatched_passedIso++; // first global muon passed the iso cut
304  if (iso1<isoMax_) nGlobalMuonsMatched_passedIso++; // second global muon passed the iso cut
305  if (iso0<isoMax_ && iso1<isoMax_) {
306  n2GlobalMuonsMatched_passedIso++; // both muons passed iso cut
307  if (trig0found && trig1found) n2GlobalMuonsMatched_passedIso2Trg++; // both muons have HLT
308  if (trig0found && !trig1found) nMu0onlyTriggered++;
309  if (trig1found && !trig0found) nMu1onlyTriggered++;
310  // histograms vs eta and pt
311  if (trig1found) { // check efficiency of muon0 not imposing the trigger on it
312  h_trackProbe_eta->Fill(eta0);
313  h_trackProbe_pt->Fill(pt0);
314  h_staProbe_eta->Fill(eta0);
315  h_staProbe_pt->Fill(pt0);
316  h_ProbeOk_eta->Fill(eta0);
317  h_ProbeOk_pt->Fill(pt0);
318  }
319  if (trig0found) { // check efficiency of muon1 not imposing the trigger on it
320  h_trackProbe_eta->Fill(eta1);
321  h_staProbe_eta->Fill(eta1);
322  h_trackProbe_pt->Fill(pt1);
323  h_staProbe_pt->Fill(pt1);
324  h_ProbeOk_eta->Fill(eta1);
325  h_ProbeOk_pt->Fill(pt1);
326  }
327  }
328  }
329  } // end MC match
330 
331  } // end loop on ZMuMu cand
332  } // end if ZMuMu size > 0
333 
334  // loop on ZMuSta
335  bool zMuSta_found = false;
336  if (!zMuMu_found && zMuStandAlone->size() > 0 ) {
337  event.getByLabel(zMuStandAloneMatchMap_, zMuStandAloneMatchMap);
338  for(unsigned int i = 0; i < zMuStandAlone->size(); ++i) { //loop on candidates
339  const Candidate & zMuStandAloneCand = (*zMuStandAlone)[i]; //the candidate
340  CandidateBaseRef zMuStandAloneCandRef = zMuStandAlone->refAt(i);
341  GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
342 
343  const Candidate * lep0 = zMuStandAloneCand.daughter( 0 );
344  const Candidate * lep1 = zMuStandAloneCand.daughter( 1 );
345  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
346  //double trkiso0 = muonDau0.trackIso();
347  // const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone());
348  //double trkiso1 = muonDau1.trackIso();
349 
352 
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();
358 
359  // HLT match (check just dau0 the global)
360  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
362 
363  bool trig0found = false;
364  if( mu0HLTMatches.size()>0 )
365  trig0found = true;
366 
367  if(zMuStandAloneMatch.isNonnull()) { // ZMuStandAlone matched
368  zMuSta_found = true;
369  nZMuSta_matched++;
370  if (pt0>ptmin_ && pt1>ptmin_ && abs(eta0)>etamin_ && abs(eta1)>etamin_ && abs(eta0)<etamax_ && abs(eta1) <etamax_ && mass >massMin_ &&
371  mass < massMax_ && iso0<isoMax_ && iso1 < isoMax_ && trig0found) { // all cuts and trigger passed
373  // histograms vs eta and pt
374  h_staProbe_eta->Fill(eta1);
375  h_staProbe_pt->Fill(pt1);
376  }
377  } // end MC match
378  } // end loop on ZMuStandAlone cand
379  } // end if ZMuStandAlone size > 0
380 
381 
382  // loop on ZMuTrack
383  bool zMuTrack_found = false;
384  if (!zMuMu_found && !zMuSta_found && zMuTrack->size() > 0 ) {
385  event.getByLabel(zMuTrackMatchMap_, zMuTrackMatchMap);
386  for(unsigned int i = 0; i < zMuTrack->size(); ++i) { //loop on candidates
387  const Candidate & zMuTrackCand = (*zMuTrack)[i]; //the candidate
388  CandidateBaseRef zMuTrackCandRef = zMuTrack->refAt(i);
389  const Candidate * lep0 = zMuTrackCand.daughter( 0 );
390  const Candidate * lep1 = zMuTrackCand.daughter( 1 );
391  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
392  //double trkiso0 = muonDau0.trackIso();
393  //const pat::GenericParticle & trackDau1 = dynamic_cast<const pat::GenericParticle &>(*lep1->masterClone());
394  //double trkiso1 = trackDau1.trackIso();
397 
398 
399  double pt0 = zMuTrackCand.daughter(0)->pt();
400  double pt1 = zMuTrackCand.daughter(1)->pt();
401  double eta0 = zMuTrackCand.daughter(0)->eta();
402  double eta1 = zMuTrackCand.daughter(1)->eta();
403  double mass = zMuTrackCand.mass();
404 
405  // HLT match (check just dau0 the global)
406  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
408 
409  bool trig0found = false;
410  if( mu0HLTMatches.size()>0 )
411  trig0found = true;
412 
413  GenParticleRef zMuTrackMatch = (*zMuTrackMatchMap)[zMuTrackCandRef];
414  if(zMuTrackMatch.isNonnull()) { // ZMuTrack matched
415  zMuTrack_found = true;
416  nZMuTrk_matched++;
417  if (pt0>ptmin_ && pt1>ptmin_ && abs(eta0)>etamin_ && abs(eta1)>etamin_ && abs(eta0)<etamax_ && abs(eta1) <etamax_ && mass >massMin_ &&
418  mass < massMax_ && iso0<isoMax_ && iso1 < isoMax_ && trig0found) { // all cuts and trigger passed
420  // histograms vs eta and pt
421  h_trackProbe_eta->Fill(eta1);
422  h_trackProbe_pt->Fill(pt1);
423  }
424  } // end MC match
425  } // end loop on ZMuTrack cand
426  } // end if ZMuTrack size > 0
427 
428 } // end analyze
edm::InputTag zMuStandAlone_
int i
Definition: DBlmapReader.cc:9
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
virtual double mass() const =0
mass
#define abs(x)
Definition: mlp_lapack.h:159
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=true) const
Definition: PATObject.h:584
edm::InputTag zMuTrackMatchMap_
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:248
edm::InputTag zMuMuMatchMap_
edm::InputTag zMuStandAloneMatchMap_
edm::InputTag zMuTrack_
edm::InputTag genParticles_
edm::InputTag muons_
int n2GlobalMuonsMatched_passedIso2Trg
edm::InputTag tracks_
tuple tracks
Definition: testEve_cfg.py:39
Analysis-level muon class.
Definition: Muon.h:47
tuple zMuMu
zMuMu vector of PSet is common to all categories except zMuTrk category
virtual double eta() const =0
momentum pseudorapidity
virtual const CandidateBaseRef & masterClone() const =0
edm::InputTag zMuMu_
bool ZMuMu_MCanalyzer::check_ifZmumu ( const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 430 of file ZMuMu_MCanalyzer.cc.

References reco::Candidate::pdgId().

431 {
432  int partId0 = dauGen0->pdgId();
433  int partId1 = dauGen1->pdgId();
434  int partId2 = dauGen2->pdgId();
435  bool muplusFound=false;
436  bool muminusFound=false;
437  bool ZFound=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;
442 }
virtual int pdgId() const =0
PDG identifier.
void ZMuMu_MCanalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 578 of file ZMuMu_MCanalyzer.cc.

References gather_cfg::cout, n2GlobalMuonsMatched_passedIso, n2GlobalMuonsMatched_passedIso2Trg, nGlobalMuonsMatched_passed, nGlobalMuonsMatched_passedIso, nMu0onlyTriggered, nMu1onlyTriggered, nStaMuonsMatched_passedIso, nTracksMuonsMatched_passedIso, nZMuMu_matched, nZMuSta_matched, nZMuTrk_matched, and mathSSE::sqrt().

578  {
579 
580 
582  double err_effIso = sqrt(eff_Iso*(1-eff_Iso)/nGlobalMuonsMatched_passed);
583 
587  double effSta_afterIso = (2*n2GlobalMuonsMatched_passedIso2Trg+nMu0onlyTriggered+nMu1onlyTriggered)/n1_afterIso;
588  double effTrk_afterIso = (2*n2GlobalMuonsMatched_passedIso2Trg+nMu0onlyTriggered+nMu1onlyTriggered)/n2_afterIso;
589  double effHLT_afterIso = (2.* n2GlobalMuonsMatched_passedIso2Trg)/(2.* n2GlobalMuonsMatched_passedIso2Trg + nMu0onlyTriggered + nMu1onlyTriggered);
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);
593 
594 
595  cout << "------------------------------------ Counters --------------------------------" << endl;
596 
597  cout << "number of events zMuMu matched " << nZMuMu_matched << endl;
598  cout << "number of events zMuSta matched " << nZMuSta_matched << endl;
599  cout << "number of events zMuTk matched " << nZMuTrk_matched << endl;
600  cout << "number of events zMuMu with mu0 only triggered " << nMu0onlyTriggered << endl;
601  cout << "number of events zMuMu with mu1 only triggered " << nMu1onlyTriggered << endl;
602  cout << "=========================================" << endl;
603  cout << "n. of global muons MC matched and passing cuts: " << nGlobalMuonsMatched_passed << endl;
604  cout << "n. of global muons MC matched and passing also Iso cut: " << nGlobalMuonsMatched_passedIso << endl;
605  cout << "n. of Z -> 2 global muons MC matched and passing ALL cuts: " << n2GlobalMuonsMatched_passedIso << 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;
608  cout << "n. of Z -> 2 global muons MC matched and passing ALL cuts and both triggered: " << n2GlobalMuonsMatched_passedIso2Trg << 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;
614 
615 }
T sqrt(T t)
Definition: SSEVec.h:28
int n2GlobalMuonsMatched_passedIso2Trg
tuple cout
Definition: gather_cfg.py:41
float ZMuMu_MCanalyzer::getParticleEta ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 477 of file ZMuMu_MCanalyzer.cc.

References abs, reco::Candidate::daughter(), reco::Candidate::eta(), gen::k, reco::Candidate::numberOfDaughters(), reco::Candidate::pdgId(), and reco::Candidate::status().

478 {
479  int partId0 = dauGen0->pdgId();
480  int partId1 = dauGen1->pdgId();
481  int partId2 = dauGen2->pdgId();
482  float etapart=0.;
483  if (partId0 == ipart) {
484  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
485  const Candidate * dauMuGen = dauGen0->daughter(k);
486  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
487  etapart = dauMuGen->eta();
488  }
489  }
490  }
491  if (partId1 == ipart) {
492  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
493  const Candidate * dauMuGen = dauGen1->daughter(k);
494  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
495  etapart = dauMuGen->eta();
496  }
497  }
498  }
499  if (partId2 == ipart) {
500  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
501  const Candidate * dauMuGen = dauGen2->daughter(k);
502  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
503  etapart = dauMuGen->eta();
504  }
505  }
506  }
507  return etapart;
508 }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual size_type numberOfDaughters() const =0
number of daughters
int k[5][pyjets_maxn]
virtual int pdgId() const =0
PDG identifier.
virtual double eta() const =0
momentum pseudorapidity
Particle::LorentzVector ZMuMu_MCanalyzer::getParticleP4 ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 543 of file ZMuMu_MCanalyzer.cc.

References abs, reco::Candidate::daughter(), gen::k, reco::Candidate::numberOfDaughters(), reco::Candidate::p4(), reco::Candidate::pdgId(), and reco::Candidate::status().

544 {
545  int partId0 = dauGen0->pdgId();
546  int partId1 = dauGen1->pdgId();
547  int partId2 = dauGen2->pdgId();
548  Particle::LorentzVector p4part(0.,0.,0.,0.);
549  if (partId0 == ipart) {
550  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
551  const Candidate * dauMuGen = dauGen0->daughter(k);
552  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
553  p4part = dauMuGen->p4();
554  }
555  }
556  }
557  if (partId1 == ipart) {
558  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
559  const Candidate * dauMuGen = dauGen1->daughter(k);
560  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
561  p4part = dauMuGen->p4();
562  }
563  }
564  }
565  if (partId2 == ipart) {
566  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
567  const Candidate * dauMuGen = dauGen2->daughter(k);
568  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
569  p4part = dauMuGen->p4();
570  }
571  }
572  }
573  return p4part;
574 }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual size_type numberOfDaughters() const =0
number of daughters
int k[5][pyjets_maxn]
virtual int pdgId() const =0
PDG identifier.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Particle.h:26
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
float ZMuMu_MCanalyzer::getParticlePhi ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 510 of file ZMuMu_MCanalyzer.cc.

References abs, reco::Candidate::daughter(), gen::k, reco::Candidate::numberOfDaughters(), reco::Candidate::pdgId(), reco::Candidate::phi(), and reco::Candidate::status().

511 {
512  int partId0 = dauGen0->pdgId();
513  int partId1 = dauGen1->pdgId();
514  int partId2 = dauGen2->pdgId();
515  float phipart=0.;
516  if (partId0 == ipart) {
517  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
518  const Candidate * dauMuGen = dauGen0->daughter(k);
519  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
520  phipart = dauMuGen->phi();
521  }
522  }
523  }
524  if (partId1 == ipart) {
525  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
526  const Candidate * dauMuGen = dauGen1->daughter(k);
527  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
528  phipart = dauMuGen->phi();
529  }
530  }
531  }
532  if (partId2 == ipart) {
533  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
534  const Candidate * dauMuGen = dauGen2->daughter(k);
535  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
536  phipart = dauMuGen->phi();
537  }
538  }
539  }
540  return phipart;
541 }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual size_type numberOfDaughters() const =0
number of daughters
int k[5][pyjets_maxn]
virtual int pdgId() const =0
PDG identifier.
virtual double phi() const =0
momentum azimuthal angle
float ZMuMu_MCanalyzer::getParticlePt ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 444 of file ZMuMu_MCanalyzer.cc.

References abs, reco::Candidate::daughter(), gen::k, reco::Candidate::numberOfDaughters(), reco::Candidate::pdgId(), reco::Candidate::pt(), and reco::Candidate::status().

445 {
446  int partId0 = dauGen0->pdgId();
447  int partId1 = dauGen1->pdgId();
448  int partId2 = dauGen2->pdgId();
449  float ptpart=0.;
450  if (partId0 == ipart) {
451  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
452  const Candidate * dauMuGen = dauGen0->daughter(k);
453  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
454  ptpart = dauMuGen->pt();
455  }
456  }
457  }
458  if (partId1 == ipart) {
459  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
460  const Candidate * dauMuGen = dauGen1->daughter(k);
461  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
462  ptpart = dauMuGen->pt();
463  }
464  }
465  }
466  if (partId2 == ipart) {
467  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
468  const Candidate * dauMuGen = dauGen2->daughter(k);
469  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
470  ptpart = dauMuGen->pt();
471  }
472  }
473  }
474  return ptpart;
475 }
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual double pt() const =0
transverse momentum
virtual int status() const =0
status word
#define abs(x)
Definition: mlp_lapack.h:159
virtual size_type numberOfDaughters() const =0
number of daughters
int k[5][pyjets_maxn]
virtual int pdgId() const =0
PDG identifier.

Member Data Documentation

double ZMuMu_MCanalyzer::alpha_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::beta_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

bool ZMuMu_MCanalyzer::bothMuons_
private

Definition at line 70 of file ZMuMu_MCanalyzer.cc.

double ZMuMu_MCanalyzer::dREcal_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::dRHcal_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::dRTrk_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::dRVetoTrk_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::etamax_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::etamin_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::etEcalThreshold_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::etHcalThreshold_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::genParticles_
private

Definition at line 68 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

reco::CandidateBaseRef ZMuMu_MCanalyzer::globalMuonCandRef_
private

Definition at line 78 of file ZMuMu_MCanalyzer.cc.

TH1D * ZMuMu_MCanalyzer::h_ProbeOk_eta
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

TH1D * ZMuMu_MCanalyzer::h_ProbeOk_pt
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

TH1D * ZMuMu_MCanalyzer::h_staProbe_eta
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

TH1D * ZMuMu_MCanalyzer::h_staProbe_pt
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

TH1D* ZMuMu_MCanalyzer::h_trackProbe_eta
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

TH1D * ZMuMu_MCanalyzer::h_trackProbe_pt
private

Definition at line 82 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), and ZMuMu_MCanalyzer().

string ZMuMu_MCanalyzer::hltPath_
private

Definition at line 77 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::isoMax_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::massMax_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::massMin_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::muonIso_
private

Definition at line 66 of file ZMuMu_MCanalyzer.cc.

edm::InputTag ZMuMu_MCanalyzer::muonMatchMap_
private

Definition at line 66 of file ZMuMu_MCanalyzer.cc.

edm::InputTag ZMuMu_MCanalyzer::muons_
private

Definition at line 66 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

int ZMuMu_MCanalyzer::n2GlobalMuonsMatched_passedIso
private

Definition at line 87 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::n2GlobalMuonsMatched_passedIso2Trg
private

Definition at line 90 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nGlobalMuonsMatched_passed
private

Definition at line 85 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nGlobalMuonsMatched_passedIso
private

Definition at line 86 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nMu0onlyTriggered
private

Definition at line 91 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nMu1onlyTriggered
private

Definition at line 92 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nStaMuonsMatched_passedIso
private

Definition at line 88 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nTracksMuonsMatched_passedIso
private

Definition at line 89 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nZMuMu_matched
private

Definition at line 94 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nZMuSta_matched
private

Definition at line 95 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

int ZMuMu_MCanalyzer::nZMuTrk_matched
private

Definition at line 96 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze(), endJob(), and ZMuMu_MCanalyzer().

OverlapChecker ZMuMu_MCanalyzer::overlap_
private

Definition at line 79 of file ZMuMu_MCanalyzer.cc.

double ZMuMu_MCanalyzer::ptmin_
private

Definition at line 72 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

double ZMuMu_MCanalyzer::ptThreshold_
private

Definition at line 74 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

bool ZMuMu_MCanalyzer::relativeIsolation_
private

Definition at line 76 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

reco::CandidateBaseRef ZMuMu_MCanalyzer::standAloneMuonCandRef_
private

Definition at line 78 of file ZMuMu_MCanalyzer.cc.

edm::InputTag ZMuMu_MCanalyzer::trackIso_
private

Definition at line 67 of file ZMuMu_MCanalyzer.cc.

reco::CandidateBaseRef ZMuMu_MCanalyzer::trackMuonCandRef_
private

Definition at line 78 of file ZMuMu_MCanalyzer.cc.

edm::InputTag ZMuMu_MCanalyzer::tracks_
private

Definition at line 67 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuMu_
private

Definition at line 63 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuMuMatchMap_
private

Definition at line 63 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuStandAlone_
private

Definition at line 64 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuStandAloneMatchMap_
private

Definition at line 64 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuTrack_
private

Definition at line 65 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().

edm::InputTag ZMuMu_MCanalyzer::zMuTrackMatchMap_
private

Definition at line 65 of file ZMuMu_MCanalyzer.cc.

Referenced by analyze().