CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
ZMuMu_efficiencyAnalyzer Class Reference
Inheritance diagram for ZMuMu_efficiencyAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ZMuMu_efficiencyAnalyzer (const edm::ParameterSet &pset)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
bool check_ifZmumu (const Candidate *dauGen0, const Candidate *dauGen1, const Candidate *dauGen2)
 
void endJob () override
 
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

bool bothMuons_
 
unsigned int etaBins
 
double etamax_
 
double etaRange [7]
 
EDGetTokenT< GenParticleCollectiongenParticlesToken_
 
reco::CandidateBaseRef globalMuonCandRef_
 
TH1D * h_zmm1HLTminus_mass
 
TH1D * h_zmm1HLTplus_mass
 
TH1D * h_zmm2HLT_mass
 
TH1D * h_zmm_mass
 
TH1D * h_zmmNotIsominus_mass
 
TH1D * h_zmmNotIsoplus_mass
 
TH1D * h_zmsminus_mass
 
TH1D * h_zmsplus_mass
 
TH1D * h_zmtminus_mass
 
TH1D * h_zmtplus_mass
 
vector< TH1D * > hmumu1HLTminus_eta
 
vector< TH1D * > hmumu1HLTminus_pt
 
vector< TH1D * > hmumu1HLTplus_eta
 
vector< TH1D * > hmumu1HLTplus_pt
 
vector< TH1D * > hmumu2HLTminus_eta
 
vector< TH1D * > hmumu2HLTminus_pt
 
vector< TH1D * > hmumu2HLTplus_eta
 
vector< TH1D * > hmumu2HLTplus_pt
 
vector< TH1D * > hmumuNotIsominus_eta
 
vector< TH1D * > hmumuNotIsominus_pt
 
vector< TH1D * > hmumuNotIsoplus_eta
 
vector< TH1D * > hmumuNotIsoplus_pt
 
vector< TH1D * > hmustaminus_eta
 
vector< TH1D * > hmustaminus_pt
 
vector< TH1D * > hmustaplus_eta
 
vector< TH1D * > hmustaplus_pt
 
vector< TH1D * > hmutrackminus_eta
 
vector< TH1D * > hmutrackminus_pt
 
vector< TH1D * > hmutrackplus_eta
 
vector< TH1D * > hmutrackplus_pt
 
double isoMax_
 
double massMax_
 
double massMin_
 
EDGetTokenT< CandidateViewmuonsToken_
 
int nGlobalMuonsMatched_passed
 
OverlapChecker overlap_
 
EDGetTokenT< VertexCollectionprimaryVerticesToken_
 
unsigned int ptBins
 
double ptmin_
 
double ptRange [5]
 
reco::CandidateBaseRef standAloneMuonCandRef_
 
reco::CandidateBaseRef trackMuonCandRef_
 
EDGetTokenT< CandidateViewtracksToken_
 
EDGetTokenT< GenParticleMatchzMuMuMatchMapToken_
 
EDGetTokenT< CandidateViewzMuMuToken_
 
EDGetTokenT< GenParticleMatchzMuStandAloneMatchMapToken_
 
EDGetTokenT< CandidateViewzMuStandAloneToken_
 
EDGetTokenT< GenParticleMatchzMuTrackMatchMapToken_
 
EDGetTokenT< CandidateViewzMuTrackToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 47 of file ZMuMu_efficiencyAnalyzer.cc.

Constructor & Destructor Documentation

ZMuMu_efficiencyAnalyzer::ZMuMu_efficiencyAnalyzer ( const edm::ParameterSet pset)

Definition at line 106 of file ZMuMu_efficiencyAnalyzer.cc.

References gather_cfg::cout, etaBins, etaRange, h_zmm1HLTminus_mass, h_zmm1HLTplus_mass, h_zmm2HLT_mass, h_zmm_mass, h_zmmNotIsominus_mass, h_zmmNotIsoplus_mass, h_zmsminus_mass, h_zmsplus_mass, h_zmtminus_mass, h_zmtplus_mass, hmumu1HLTminus_eta, hmumu1HLTminus_pt, hmumu1HLTplus_eta, hmumu1HLTplus_pt, hmumu2HLTminus_eta, hmumu2HLTminus_pt, hmumu2HLTplus_eta, hmumu2HLTplus_pt, hmumuNotIsominus_eta, hmumuNotIsominus_pt, hmumuNotIsoplus_eta, hmumuNotIsoplus_pt, hmustaminus_eta, hmustaminus_pt, hmustaplus_eta, hmustaplus_pt, hmutrackminus_eta, hmutrackminus_pt, hmutrackplus_eta, hmutrackplus_pt, mps_fire::i, TFileDirectory::make(), TFileService::make(), TFileService::mkdir(), nGlobalMuonsMatched_passed, ptBins, ptRange, and AlCaHLTBitMon_QueryRunRegistry::string.

106  :
107  zMuMuToken_(consumes<CandidateView>(pset.getParameter<InputTag>("zMuMu"))),
108  zMuMuMatchMapToken_(mayConsume<GenParticleMatch>(pset.getParameter<InputTag>("zMuMuMatchMap"))),
109  zMuStandAloneToken_(consumes<CandidateView>(pset.getParameter<InputTag>("zMuStandAlone"))),
110  zMuStandAloneMatchMapToken_(mayConsume<GenParticleMatch>(pset.getParameter<InputTag>("zMuStandAloneMatchMap"))),
111  zMuTrackToken_(consumes<CandidateView>(pset.getParameter<InputTag>("zMuTrack"))),
112  zMuTrackMatchMapToken_(mayConsume<GenParticleMatch>(pset.getParameter<InputTag>("zMuTrackMatchMap"))),
113  muonsToken_(consumes<CandidateView>(pset.getParameter<InputTag>("muons"))),
114  tracksToken_(consumes<CandidateView>(pset.getParameter<InputTag>("tracks"))),
115  genParticlesToken_(consumes<GenParticleCollection>(pset.getParameter<InputTag>("genParticles"))),
116  primaryVerticesToken_(consumes<VertexCollection>(pset.getParameter<InputTag>("primaryVertices"))),
117 
118  bothMuons_(pset.getParameter<bool>("bothMuons")),
119 
120  etamax_(pset.getUntrackedParameter<double>("etamax")),
121  ptmin_(pset.getUntrackedParameter<double>("ptmin")),
122  massMin_(pset.getUntrackedParameter<double>("zMassMin")),
123  massMax_(pset.getUntrackedParameter<double>("zMassMax")),
124  isoMax_(pset.getUntrackedParameter<double>("isomax")) {
126 
127  // general histograms
128  h_zmm_mass = fs->make<TH1D>("zmm_mass","zmumu mass",100,0.,200.);
129  h_zmm2HLT_mass = fs->make<TH1D>("zmm2HLT_mass","zmumu 2HLT mass",100,0.,200.);
130  h_zmm1HLTplus_mass = fs->make<TH1D>("zmm1HLTplus_mass","zmumu 1HLT plus mass",100,0.,200.);
131  h_zmmNotIsoplus_mass = fs->make<TH1D>("zmmNotIsoplus_mass","zmumu a least One Not Iso plus mass",100,0.,200.);
132  h_zmsplus_mass = fs->make<TH1D>("zmsplus_mass","zmusta plus mass",100,0.,200.);
133  h_zmtplus_mass = fs->make<TH1D>("zmtplus_mass","zmutrack plus mass",100,0.,200.);
134  h_zmm1HLTminus_mass = fs->make<TH1D>("zmm1HLTminus_mass","zmumu 1HLT minus mass",100,0.,200.);
135  h_zmmNotIsominus_mass = fs->make<TH1D>("zmmNotIsominus_mass","zmumu a least One Not Iso minus mass",100,0.,200.);
136  h_zmsminus_mass = fs->make<TH1D>("zmsminus_mass","zmusta minus mass",100,0.,200.);
137  h_zmtminus_mass = fs->make<TH1D>("zmtminus_mass","zmutrack minus mass",100,0.,200.);
138 
139  cout << "primo" << endl;
140  // creating histograms for each Pt, eta interval
141 
142  TFileDirectory etaDirectory = fs->mkdir("etaIntervals"); // in this directory will be saved all the histos of different eta intervals
143  TFileDirectory ptDirectory = fs->mkdir("ptIntervals"); // in this directory will be saved all the histos of different pt intervals
144 
145  // binning of entries array (at moment defined by hand and not in cfg file)
146  etaBins = 6;
147  ptBins = 4;
148  double etaRangeTmp[7] = {-2.,-1.2,-0.8,0.,0.8,1.2,2.};
149  double ptRangeTmp[5] = {20.,40.,60.,80.,100.};
150  for (unsigned int i=0;i<=etaBins;i++) etaRange[i] = etaRangeTmp[i];
151  for (unsigned int i=0;i<=ptBins;i++) ptRange[i] = ptRangeTmp[i];
152 
153  // eta histograms creation
154  cout << "eta istograms creation " << endl;
155 
156  for (unsigned int i=0;i<etaBins;i++) {
157  cout << " bin eta plus " << i << endl;
158  // muon plus
159  double range0 = etaRange[i];
160  double range1= etaRange[i+1];
161  std::string ap, bp;
162  ap = "zmumu2HLTplus_etaRange" + std::to_string(i);
163  bp = "zmumu2HLT plus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
164  cout << ap << " " << bp << endl;
165  hmumu2HLTplus_eta.push_back(etaDirectory.make<TH1D>(ap.c_str(), bp.c_str(), 200, 0., 200.));
166  ap = "zmumu1HLTplus_etaRange" + std::to_string(i);
167  bp = "zmumu1HLT plus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
168  cout << ap << " " << bp << endl;
169  hmumu1HLTplus_eta.push_back(etaDirectory.make<TH1D>(ap.c_str(), bp.c_str(), 200, 0., 200.));
170  ap = "zmustaplus_etaRange" + std::to_string(i);
171  bp = "zmusta plus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
172  cout << ap << " " << bp << endl;
173  hmustaplus_eta.push_back(etaDirectory.make<TH1D>(ap.c_str(), bp.c_str(), 50, 0., 200.));
174  ap = "zmutrackplus_etaRange" + std::to_string(i);
175  bp = "zmutrack plus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
176  cout << ap << " " << bp << endl;
177  hmutrackplus_eta.push_back(etaDirectory.make<TH1D>(ap.c_str(), bp.c_str(), 100, 0., 200.));
178  ap = "zmumuNotIsoplus_etaRange" + std::to_string(i);
179  bp = "zmumuNotIso plus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
180  cout << ap << " " << bp << endl;
181  hmumuNotIsoplus_eta.push_back(etaDirectory.make<TH1D>(ap.c_str(), bp.c_str(), 100, 0., 200.));
182  // muon minus
183  cout << " bin eta minus " << i << endl;
184  std::string am, bm;
185  am = "zmumu2HLTminus_etaRange" + std::to_string(i);
186  bm = "zmumu2HLT minus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
187  cout << am << " " << bm << endl;
188  hmumu2HLTminus_eta.push_back(etaDirectory.make<TH1D>(am.c_str(), bm.c_str(), 200, 0., 200.));
189  am = "zmumu1HLTminus_etaRange" + std::to_string(i);
190  bm = "zmumu1HLT minus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
191  cout << am << " " << bm << endl;
192  hmumu1HLTminus_eta.push_back(etaDirectory.make<TH1D>(am.c_str(), bm.c_str(), 200, 0., 200.));
193  am = "zmustaminus_etaRange" + std::to_string(i);
194  bm = "zmusta minus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
195  cout << am << " " << bm << endl;
196  hmustaminus_eta.push_back(etaDirectory.make<TH1D>(am.c_str(), bm.c_str(), 50, 0., 200.));
197  am = "zmutrackminus_etaRange" + std::to_string(i);
198  bm = "zmutrack minus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
199  cout << am << " " << bm << endl;
200  hmutrackminus_eta.push_back(etaDirectory.make<TH1D>(am.c_str(), bm.c_str(), 100, 0., 200.));
201  am = "zmumuNotIsominus_etaRange" + std::to_string(i);
202  bm = "zmumuNotIso minus mass eta Range " + std::to_string(range0) + " to " + std::to_string(range1);
203  cout << am << " " << bm << endl;
204  hmumuNotIsominus_eta.push_back(etaDirectory.make<TH1D>(am.c_str(), bm.c_str(), 100, 0., 200.));
205  }
206 
207  // pt histograms creation
208  cout << "pt istograms creation " << endl;
209 
210  for (unsigned int i=0;i<ptBins;i++) {
211  double range0 = ptRange[i];
212  double range1= ptRange[i+1];
213  // muon plus
214  cout << " bin pt plus " << i << endl;
215  std::string ap1, bp1;
216  ap1 = "zmumu2HLTplus_ptRange" + std::to_string(i);
217  bp1 = "zmumu2HLT plus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
218  cout << ap1 << " " << bp1 << endl;
219  hmumu2HLTplus_pt.push_back(ptDirectory.make<TH1D>(ap1.c_str(), bp1.c_str(), 200, 0., 200.));
220  ap1 = "zmumu1HLTplus_ptRange" + std::to_string(i);
221  bp1 = "zmumu1HLT plus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
222  cout << ap1 << " " << bp1 << endl;
223  hmumu1HLTplus_pt.push_back(ptDirectory.make<TH1D>(ap1.c_str(), bp1.c_str(), 200, 0., 200.));
224  ap1 = "zmustaplus_ptRange" + std::to_string(i);
225  bp1 = "zmusta plus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
226  cout << ap1 << " " << bp1 << endl;
227  hmustaplus_pt.push_back(ptDirectory.make<TH1D>(ap1.c_str(), bp1.c_str(), 50, 0., 200.));
228  ap1 = "zmutrackplus_ptRange" + std::to_string(i);
229  bp1 = "zmutrack plus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
230  cout << ap1 << " " << bp1 << endl;
231  hmutrackplus_pt.push_back(ptDirectory.make<TH1D>(ap1.c_str(), bp1.c_str(), 100, 0., 200.));
232  ap1 = "zmumuNotIsoplus_ptRange" + std::to_string(i);
233  bp1 = "zmumuNotIso plus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
234  cout << ap1 << " " << bp1 << endl;
235  hmumuNotIsoplus_pt.push_back(ptDirectory.make<TH1D>(ap1.c_str(), bp1.c_str(), 100, 0., 200.));
236  // muon minus
237  cout << " bin pt minus " << i << endl;
238  std::string am1, bm1;
239  am1 = "zmumu2HLTminus_ptRange" + std::to_string(i);
240  bm1 = "zmumu2HLT minus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
241  cout << am1 << " " << bm1 << endl;
242  hmumu2HLTminus_pt.push_back(ptDirectory.make<TH1D>(am1.c_str(), bm1.c_str(), 200, 0., 200.));
243  am1 = "zmumu1HLTminus_ptRange" + std::to_string(i);
244  bm1 = "zmumu1HLT minus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
245  cout << am1 << " " << bm1 << endl;
246  hmumu1HLTminus_pt.push_back(ptDirectory.make<TH1D>(am1.c_str(), bm1.c_str(), 200, 0., 200.));
247  am1 = "zmustaminus_ptRange" + std::to_string(i);
248  bm1 = "zmusta minus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
249  cout << am1 << " " << bm1 << endl;
250  hmustaminus_pt.push_back(ptDirectory.make<TH1D>(am1.c_str(), bm1.c_str(), 50, 0., 200.));
251  am1 = "zmutrackminus_ptRange" + std::to_string(i);
252  bm1 = "zmutrack minus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
253  cout << am1 << " " << bm1 << endl;
254  hmutrackminus_pt.push_back(ptDirectory.make<TH1D>(am1.c_str(), bm1.c_str(), 100, 0., 200.));
255  am1 = "zmumuNotIsominus_ptRange" + std::to_string(i);
256  bm1 = "zmumuNotIso minus mass pt Range " + std::to_string(range0) + " to " + std::to_string(range1);
257  cout << am1 << " " << bm1 << endl;
258  hmumuNotIsominus_pt.push_back(ptDirectory.make<TH1D>(am1.c_str(), bm1.c_str(), 100, 0., 200.));
259  }
260 
261  // clear global counters
263 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
EDGetTokenT< GenParticleMatch > zMuMuMatchMapToken_
EDGetTokenT< CandidateView > muonsToken_
EDGetTokenT< GenParticleMatch > zMuStandAloneMatchMapToken_
EDGetTokenT< GenParticleCollection > genParticlesToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
EDGetTokenT< CandidateView > tracksToken_
EDGetTokenT< GenParticleMatch > zMuTrackMatchMapToken_
EDGetTokenT< CandidateView > zMuTrackToken_
T * make(const Args &...args) const
make new ROOT object
EDGetTokenT< CandidateView > zMuStandAloneToken_
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
EDGetTokenT< VertexCollection > primaryVerticesToken_
EDGetTokenT< CandidateView > zMuMuToken_

Member Function Documentation

void ZMuMu_efficiencyAnalyzer::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overrideprivate

Definition at line 265 of file ZMuMu_efficiencyAnalyzer.cc.

References funct::abs(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::Candidate::charge(), reco::Candidate::daughter(), edm::View< T >::empty(), PVValHelper::eta, reco::Candidate::eta(), etaBins, etamax_, etaRange, GenHFHadronMatcher_cfi::genParticles, genParticlesToken_, h_zmm1HLTminus_mass, h_zmm1HLTplus_mass, h_zmm2HLT_mass, h_zmm_mass, h_zmsminus_mass, h_zmsplus_mass, h_zmtminus_mass, h_zmtplus_mass, hmumu1HLTminus_eta, hmumu1HLTminus_pt, hmumu1HLTplus_eta, hmumu1HLTplus_pt, hmumu2HLTminus_eta, hmumu2HLTminus_pt, hmumu2HLTplus_eta, hmumu2HLTplus_pt, hmustaminus_eta, hmustaminus_pt, hmustaplus_eta, hmustaplus_pt, hmutrackminus_eta, hmutrackminus_pt, hmutrackplus_eta, hmutrackplus_pt, mps_fire::i, reco::Muon::isGlobalMuon(), isoMax_, RazorAnalyzer::lep1, ResonanceBuilder::mass, reco::Candidate::mass(), massMax_, massMin_, reco::Candidate::masterClone(), extraflags_cff::muons, muonsToken_, jets_cff::primaryVertices, primaryVerticesToken_, EnergyCorrector::pt, reco::Candidate::pt(), hiDetachedQuadStep_cff::pt1, ptBins, ptmin_, ptRange, edm::View< T >::refAt(), edm::View< T >::size(), pat::Muon::trackIso(), pat::GenericParticle::trackIso(), l1t::tracks, tracksToken_, pat::PATObject< ObjectType >::triggerObjectMatchesByPath(), zMuMuToken_, zMuStandAloneMatchMapToken_, zMuStandAloneToken_, zMuTrackMatchMapToken_, and zMuTrackToken_.

265  {
266  Handle<CandidateView> zMuMu;
267  Handle<GenParticleMatch> zMuMuMatchMap; //Map of Z made by Mu global + Mu global
268  Handle<CandidateView> zMuStandAlone;
269  Handle<GenParticleMatch> zMuStandAloneMatchMap; //Map of Z made by Mu + StandAlone
270  Handle<CandidateView> zMuTrack;
271  Handle<GenParticleMatch> zMuTrackMatchMap; //Map of Z made by Mu + Track
272  Handle<CandidateView> muons; //Collection of Muons
273  Handle<CandidateView> tracks; //Collection of Tracks
274 
275  Handle<GenParticleCollection> genParticles; // Collection of Generatd Particles
276  Handle<VertexCollection> primaryVertices; // Collection of primary Vertices
277 
278  event.getByToken(zMuMuToken_, zMuMu);
279  event.getByToken(zMuStandAloneToken_, zMuStandAlone);
280  event.getByToken(zMuTrackToken_, zMuTrack);
281  event.getByToken(genParticlesToken_, genParticles);
282  event.getByToken(primaryVerticesToken_, primaryVertices);
283  event.getByToken(muonsToken_, muons);
284  event.getByToken(tracksToken_, tracks);
285 
286  /*
287  cout << "********* zMuMu size : " << zMuMu->size() << endl;
288  cout << "********* zMuStandAlone size : " << zMuStandAlone->size() << endl;
289  cout << "********* zMuTrack size : " << zMuTrack->size() << endl;
290  cout << "********* muons size : " << muons->size() << endl;
291  cout << "********* tracks size : " << tracks->size() << endl;
292  cout << "********* vertices size : " << primaryVertices->size() << endl;
293  */
294 
295  // std::cout<<"Run-> "<<event.id().run()<<std::endl;
296  // std::cout<<"Event-> "<<event.id().event()<<std::endl;
297 
298 
299 
300  bool zMuMu_found = false;
301  // loop on ZMuMu
302  if (!zMuMu->empty() ) {
303  for(unsigned int i = 0; i < zMuMu->size(); ++i) { //loop on candidates
304  const Candidate & zMuMuCand = (*zMuMu)[i]; //the candidate
305  CandidateBaseRef zMuMuCandRef = zMuMu->refAt(i);
306 
307  const Candidate * lep0 = zMuMuCand.daughter( 0 );
308  const Candidate * lep1 = zMuMuCand.daughter( 1 );
309  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
310  double trkiso0 = muonDau0.trackIso();
311  const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone());
312  double trkiso1 = muonDau1.trackIso();
313 
314  // kinemtic variables
315  double pt0 = zMuMuCand.daughter(0)->pt();
316  double pt1 = zMuMuCand.daughter(1)->pt();
317  double eta0 = zMuMuCand.daughter(0)->eta();
318  double eta1 = zMuMuCand.daughter(1)->eta();
319  double charge0 = zMuMuCand.daughter(0)->charge();
320  double charge1 = zMuMuCand.daughter(1)->charge();
321  double mass = zMuMuCand.mass();
322 
323  // HLT match
324  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
325  muonDau0.triggerObjectMatchesByPath( "HLT_Mu9" );
326  const pat::TriggerObjectStandAloneCollection mu1HLTMatches =
327  muonDau1.triggerObjectMatchesByPath( "HLT_Mu9" );
328 
329  bool trig0found = false;
330  bool trig1found = false;
331  if( !mu0HLTMatches.empty() )
332  trig0found = true;
333  if( !mu1HLTMatches.empty() )
334  trig1found = true;
335 
336  // kinematic selection
337 
338  bool checkOppositeCharge = false;
339  if (charge0 != charge1) checkOppositeCharge = true;
340  if (pt0>ptmin_ && pt1>ptmin_ && abs(eta0)<etamax_ && abs(eta1)<etamax_ && mass>massMin_ && mass<massMax_ && checkOppositeCharge) {
341  if (trig0found || trig1found) { // at least one muon match HLT
342  zMuMu_found = true; // Z found as global-global (so don't check Zms and Zmt)
343  if (trkiso0 < isoMax_ && trkiso1 < isoMax_) { // both muons are isolated
344  if (trig0found && trig1found) {
345 
346  // ******************** category zmm 2 HLT ****************
347 
348  h_zmm2HLT_mass->Fill(mass);
349  h_zmm_mass->Fill(mass);
350 
351  // check the cynematics to fill correct histograms
352 
353  for (unsigned int j=0;j<etaBins;j++) { // eta Bins loop
354  double range0 = etaRange[j];
355  double range1= etaRange[j+1];
356 
357  // eta histograms
358 
359  if (eta0>=range0 && eta0<range1)
360  {
361  if (charge0<0) hmumu2HLTminus_eta[j]->Fill(mass); // mu- in bin eta
362  if (charge0>0) hmumu2HLTplus_eta[j]->Fill(mass); // mu+ in bin eta
363  }
364  if (eta1>=range0 && eta1<range1)
365  {
366  if (charge1<0) hmumu2HLTminus_eta[j]->Fill(mass); // mu- in bin eta
367  if (charge1>0) hmumu2HLTplus_eta[j]->Fill(mass); // mu+ in bin eta
368  }
369  } // end loop etaBins
370 
371  for (unsigned int j=0;j<ptBins;j++) { // pt Bins loop
372  double range0pt = ptRange[j];
373  double range1pt = ptRange[j+1];
374  // pt histograms
375  if (pt0>=range0pt && pt0<range1pt)
376  {
377  if (charge0<0) hmumu2HLTminus_pt[j]->Fill(mass); // mu- in bin eta
378  if (charge0>0) hmumu2HLTplus_pt[j]->Fill(mass); // mu+ in bin eta
379  }
380  if (pt1>=range0pt && pt1<range1pt)
381  {
382  if (charge1<0) hmumu2HLTminus_pt[j]->Fill(mass); // mu- in bin eta
383  if (charge1>0) hmumu2HLTplus_pt[j]->Fill(mass); // mu+ in bin eta
384  }
385  } // end loop ptBins
386 
387  } // ******************* end category zmm 2 HLT ****************
388 
389  if (!trig0found || !trig1found) {
390  // ****************** category zmm 1 HLT ******************
391  h_zmm_mass->Fill(mass);
392  double eta = 9999;
393  double pt = 9999;
394  double charge = 0;
395  if (trig0found) {
396  eta = eta1; // check muon not HLT matched
397  pt = pt1;
398  charge = charge1;
399  } else {
400  eta = eta0;
401  pt =pt0;
402  charge = charge0;
403  }
404  if (charge<0) h_zmm1HLTminus_mass->Fill(mass);
405  if (charge>0) h_zmm1HLTplus_mass->Fill(mass);
406 
407  for (unsigned int j=0;j<etaBins;j++) { // eta Bins loop
408  double range0 = etaRange[j];
409  double range1= etaRange[j+1];
410  // eta histograms fill the bin of the muon not HLT matched
411  if (eta>=range0 && eta<range1)
412  {
413  if (charge<0) hmumu1HLTminus_eta[j]->Fill(mass);
414  if (charge>0) hmumu1HLTplus_eta[j]->Fill(mass);
415  }
416  } // end loop etaBins
417  for (unsigned int j=0;j<ptBins;j++) { // pt Bins loop
418  double range0 = ptRange[j];
419  double range1= ptRange[j+1];
420  // pt histograms
421  if (pt>=range0 && pt<range1)
422  {
423  if (charge<0) hmumu1HLTminus_pt[j]->Fill(mass);
424  if (charge>0) hmumu1HLTplus_pt[j]->Fill(mass);
425  }
426  } // end loop ptBins
427 
428  } // ****************** end category zmm 1 HLT ***************
429 
430  } else { // one or both muons are not isolated
431  // ***************** category zmumuNotIso **************** (per ora non studio iso vs eta e pt da capire meglio)
432 
433  } // end if both muons isolated
434 
435  } // end if at least 1 HLT trigger found
436  } // end if kinematic selection
437 
438 
439  } // end loop on ZMuMu cand
440  } // end if ZMuMu size > 0
441 
442  // loop on ZMuSta
443  bool zMuSta_found = false;
444  if (!zMuMu_found && !zMuStandAlone->empty() ) {
445  event.getByToken(zMuStandAloneMatchMapToken_, zMuStandAloneMatchMap);
446  for(unsigned int i = 0; i < zMuStandAlone->size(); ++i) { //loop on candidates
447  const Candidate & zMuStandAloneCand = (*zMuStandAlone)[i]; //the candidate
448  CandidateBaseRef zMuStandAloneCandRef = zMuStandAlone->refAt(i);
449  GenParticleRef zMuStandAloneMatch = (*zMuStandAloneMatchMap)[zMuStandAloneCandRef];
450 
451  const Candidate * lep0 = zMuStandAloneCand.daughter( 0 );
452  const Candidate * lep1 = zMuStandAloneCand.daughter( 1 );
453  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
454  double trkiso0 = muonDau0.trackIso();
455  const pat::Muon & muonDau1 = dynamic_cast<const pat::Muon &>(*lep1->masterClone());
456  double trkiso1 = muonDau1.trackIso();
457  double pt0 = zMuStandAloneCand.daughter(0)->pt();
458  double pt1 = zMuStandAloneCand.daughter(1)->pt();
459  double eta0 = zMuStandAloneCand.daughter(0)->eta();
460  double eta1 = zMuStandAloneCand.daughter(1)->eta();
461  double charge0 = zMuStandAloneCand.daughter(0)->charge();
462  double charge1 = zMuStandAloneCand.daughter(1)->charge();
463  double mass = zMuStandAloneCand.mass();
464 
465  // HLT match
466  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
467  muonDau0.triggerObjectMatchesByPath( "HLT_Mu9" );
468  const pat::TriggerObjectStandAloneCollection mu1HLTMatches =
469  muonDau1.triggerObjectMatchesByPath( "HLT_Mu9" );
470 
471  bool trig0found = false;
472  bool trig1found = false;
473  if( !mu0HLTMatches.empty() )
474  trig0found = true;
475  if( !mu1HLTMatches.empty() )
476  trig1found = true;
477 
478  // check HLT match of Global muon and save eta, pt of second muon (standAlone)
479  bool trigGlbfound = false;
480  double pt =999.;
481  double eta = 999.;
482  double charge = 0;
483  if (muonDau0.isGlobalMuon()) {
484  trigGlbfound = trig0found;
485  pt = pt1;
486  eta = eta1;
487  charge = charge1;
488  }
489  if (muonDau1.isGlobalMuon()) {
490  trigGlbfound = trig1found;
491  pt = pt0;
492  eta = eta0;
493  charge = charge0;
494  }
495 
496  bool checkOppositeCharge = false;
497  if (charge0 != charge1) checkOppositeCharge = true;
498 
499  if (checkOppositeCharge && trigGlbfound && pt0>ptmin_ && pt1>ptmin_ && abs(eta0)<etamax_ && abs(eta1)<etamax_ && mass>massMin_ && mass<massMax_ && trkiso0<isoMax_ && trkiso1<isoMax_ ) { // global mu match HLT + kinematic cuts + opposite charge
500 
501  if (charge<0) h_zmsminus_mass->Fill(mass);
502  if (charge>0) h_zmsplus_mass->Fill(mass);
503 
504  for (unsigned int j=0;j<etaBins;j++) { // eta Bins loop
505  double range0 = etaRange[j];
506  double range1= etaRange[j+1];
507  // eta histograms
508  if (eta>=range0 && eta<range1) {
509  if (charge<0) hmustaminus_eta[j]->Fill(mass);
510  if (charge>0) hmustaplus_eta[j]->Fill(mass);
511  }
512  } // end loop etaBins
513  for (unsigned int j=0;j<ptBins;j++) { // pt Bins loop
514  double range0 = ptRange[j];
515  double range1= ptRange[j+1];
516  // pt histograms
517  if (pt>=range0 && pt<range1) {
518  if (charge<0) hmustaminus_pt[j]->Fill(mass);
519  if (charge>0) hmustaplus_pt[j]->Fill(mass);
520  }
521  } // end loop ptBins
522 
523  } // end if trigGlbfound + kinecuts + OppostieCharge
524  } // end loop on ZMuStandAlone cand
525  } // end if ZMuStandAlone size > 0
526 
527 
528  // loop on ZMuTrack
529  // bool zMuTrack_found = false;
530  if (!zMuMu_found && !zMuSta_found && !zMuTrack->empty() ) {
531  event.getByToken(zMuTrackMatchMapToken_, zMuTrackMatchMap);
532  for(unsigned int i = 0; i < zMuTrack->size(); ++i) { //loop on candidates
533  const Candidate & zMuTrackCand = (*zMuTrack)[i]; //the candidate
534  CandidateBaseRef zMuTrackCandRef = zMuTrack->refAt(i);
535  const Candidate * lep0 = zMuTrackCand.daughter( 0 );
536  const Candidate * lep1 = zMuTrackCand.daughter( 1 );
537  const pat::Muon & muonDau0 = dynamic_cast<const pat::Muon &>(*lep0->masterClone());
538  double trkiso0 = muonDau0.trackIso();
539  const pat::GenericParticle & trackDau1 = dynamic_cast<const pat::GenericParticle &>(*lep1->masterClone());
540  double trkiso1 = trackDau1.trackIso();
541  double pt0 = zMuTrackCand.daughter(0)->pt();
542  double pt1 = zMuTrackCand.daughter(1)->pt();
543  double eta0 = zMuTrackCand.daughter(0)->eta();
544  double eta1 = zMuTrackCand.daughter(1)->eta();
545  double charge0 = zMuTrackCand.daughter(0)->charge();
546  double charge1 = zMuTrackCand.daughter(1)->charge();
547  double mass = zMuTrackCand.mass();
548 
549  // HLT match (check just dau0 the global)
550  const pat::TriggerObjectStandAloneCollection mu0HLTMatches =
551  muonDau0.triggerObjectMatchesByPath( "HLT_Mu9" );
552 
553  bool trig0found = false;
554  if( !mu0HLTMatches.empty() )
555  trig0found = true;
556 
557  bool checkOppositeCharge = false;
558  if (charge0 != charge1) checkOppositeCharge = true;
559 
560  if (checkOppositeCharge && trig0found && pt0>ptmin_ && pt1>ptmin_ && abs(eta0)<etamax_ && abs(eta1)<etamax_ && mass>massMin_ && mass<massMax_ && trkiso0<isoMax_ && trkiso1<isoMax_ ) { // global mu match HLT + kinematic cuts + opposite charge
561 
562  if (charge1<0) h_zmtminus_mass->Fill(mass);
563  if (charge1>0) h_zmtplus_mass->Fill(mass);
564 
565  for (unsigned int j=0;j<etaBins;j++) { // eta Bins loop
566  double range0 = etaRange[j];
567  double range1= etaRange[j+1];
568  // eta histograms
569  if (eta1>=range0 && eta1<range1) {
570  if (charge1<0) hmutrackminus_eta[j]->Fill(mass); // just check muon1 (mu0 is global by definition)
571  if (charge1>0) hmutrackplus_eta[j]->Fill(mass); // just check muon1 (mu0 is global by definition)
572  }
573  } // end loop etaBins
574  for (unsigned int j=0;j<ptBins;j++) { // pt Bins loop
575  double range0 = ptRange[j];
576  double range1= ptRange[j+1];
577  // pt histograms
578  if (pt1>=range0 && pt1<range1) {
579  if (charge1<0) hmutrackminus_pt[j]->Fill(mass); // just check muon1 (mu0 is global by definition)
580  if (charge1>0) hmutrackplus_pt[j]->Fill(mass); // just check muon1 (mu0 is global by definition)
581  }
582  } // end loop ptBins
583 
584  } // end if trig0found
585 
586 
587  } // end loop on ZMuTrack cand
588  } // end if ZMuTrack size > 0
589 
590 } // end analyze
EDGetTokenT< CandidateView > muonsToken_
EDGetTokenT< GenParticleMatch > zMuStandAloneMatchMapToken_
virtual const Candidate * daughter(size_type i) const =0
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
EDGetTokenT< GenParticleCollection > genParticlesToken_
size_type size() const
std::vector< TriggerObjectStandAlone > TriggerObjectStandAloneCollection
Collection of TriggerObjectStandAlone.
EDGetTokenT< CandidateView > tracksToken_
float trackIso() const
float trackIso() const
Definition: Muon.h:177
EDGetTokenT< GenParticleMatch > zMuTrackMatchMapToken_
EDGetTokenT< CandidateView > zMuTrackToken_
RefToBase< value_type > refAt(size_type i) const
Analysis-level Generic Particle class (e.g. for hadron or muon not fully reconstructed) ...
bool isGlobalMuon() const override
Definition: Muon.h:291
bool empty() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const TriggerObjectStandAloneCollection triggerObjectMatchesByPath(const std::string &namePath, const bool pathLastFilterAccepted=false, const bool pathL3FilterAccepted=true) const
Definition: PATObject.h:612
EDGetTokenT< CandidateView > zMuStandAloneToken_
virtual const CandidateBaseRef & masterClone() const =0
virtual double eta() const =0
momentum pseudorapidity
primaryVertices
Definition: jets_cff.py:27
virtual double pt() const =0
transverse momentum
virtual double mass() const =0
mass
virtual int charge() const =0
electric charge
EDGetTokenT< VertexCollection > primaryVerticesToken_
lep1
print &#39;MRbb(1b)&#39;,event.mr_bb
EDGetTokenT< CandidateView > zMuMuToken_
Analysis-level muon class.
Definition: Muon.h:51
bool ZMuMu_efficiencyAnalyzer::check_ifZmumu ( const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 592 of file ZMuMu_efficiencyAnalyzer.cc.

References reco::Candidate::pdgId().

593 {
594  int partId0 = dauGen0->pdgId();
595  int partId1 = dauGen1->pdgId();
596  int partId2 = dauGen2->pdgId();
597  bool muplusFound=false;
598  bool muminusFound=false;
599  bool ZFound=false;
600  if (partId0==13 || partId1==13 || partId2==13) muminusFound=true;
601  if (partId0==-13 || partId1==-13 || partId2==-13) muplusFound=true;
602  if (partId0==23 || partId1==23 || partId2==23) ZFound=true;
603  return (muplusFound && muminusFound && ZFound);
604 }
virtual int pdgId() const =0
PDG identifier.
void ZMuMu_efficiencyAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 740 of file ZMuMu_efficiencyAnalyzer.cc.

References DEFINE_FWK_MODULE.

740  {
741 
742 
743 
744 }
float ZMuMu_efficiencyAnalyzer::getParticleEta ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 639 of file ZMuMu_efficiencyAnalyzer.cc.

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

640 {
641  int partId0 = dauGen0->pdgId();
642  int partId1 = dauGen1->pdgId();
643  int partId2 = dauGen2->pdgId();
644  float etapart=0.;
645  if (partId0 == ipart) {
646  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
647  const Candidate * dauMuGen = dauGen0->daughter(k);
648  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
649  etapart = dauMuGen->eta();
650  }
651  }
652  }
653  if (partId1 == ipart) {
654  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
655  const Candidate * dauMuGen = dauGen1->daughter(k);
656  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
657  etapart = dauMuGen->eta();
658  }
659  }
660  }
661  if (partId2 == ipart) {
662  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
663  const Candidate * dauMuGen = dauGen2->daughter(k);
664  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
665  etapart = dauMuGen->eta();
666  }
667  }
668  }
669  return etapart;
670 }
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
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
virtual double eta() const =0
momentum pseudorapidity
virtual size_type numberOfDaughters() const =0
number of daughters
Particle::LorentzVector ZMuMu_efficiencyAnalyzer::getParticleP4 ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 705 of file ZMuMu_efficiencyAnalyzer.cc.

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

706 {
707  int partId0 = dauGen0->pdgId();
708  int partId1 = dauGen1->pdgId();
709  int partId2 = dauGen2->pdgId();
710  Particle::LorentzVector p4part(0.,0.,0.,0.);
711  if (partId0 == ipart) {
712  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
713  const Candidate * dauMuGen = dauGen0->daughter(k);
714  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
715  p4part = dauMuGen->p4();
716  }
717  }
718  }
719  if (partId1 == ipart) {
720  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
721  const Candidate * dauMuGen = dauGen1->daughter(k);
722  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
723  p4part = dauMuGen->p4();
724  }
725  }
726  }
727  if (partId2 == ipart) {
728  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
729  const Candidate * dauMuGen = dauGen2->daughter(k);
730  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
731  p4part = dauMuGen->p4();
732  }
733  }
734  }
735  return p4part;
736 }
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
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
virtual size_type numberOfDaughters() const =0
number of daughters
math::PtEtaPhiELorentzVectorF LorentzVector
float ZMuMu_efficiencyAnalyzer::getParticlePhi ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 672 of file ZMuMu_efficiencyAnalyzer.cc.

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

673 {
674  int partId0 = dauGen0->pdgId();
675  int partId1 = dauGen1->pdgId();
676  int partId2 = dauGen2->pdgId();
677  float phipart=0.;
678  if (partId0 == ipart) {
679  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
680  const Candidate * dauMuGen = dauGen0->daughter(k);
681  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
682  phipart = dauMuGen->phi();
683  }
684  }
685  }
686  if (partId1 == ipart) {
687  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
688  const Candidate * dauMuGen = dauGen1->daughter(k);
689  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
690  phipart = dauMuGen->phi();
691  }
692  }
693  }
694  if (partId2 == ipart) {
695  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
696  const Candidate * dauMuGen = dauGen2->daughter(k);
697  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
698  phipart = dauMuGen->phi();
699  }
700  }
701  }
702  return phipart;
703 }
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
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
virtual size_type numberOfDaughters() const =0
number of daughters
virtual double phi() const =0
momentum azimuthal angle
float ZMuMu_efficiencyAnalyzer::getParticlePt ( const int  ipart,
const Candidate dauGen0,
const Candidate dauGen1,
const Candidate dauGen2 
)
private

Definition at line 606 of file ZMuMu_efficiencyAnalyzer.cc.

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

607 {
608  int partId0 = dauGen0->pdgId();
609  int partId1 = dauGen1->pdgId();
610  int partId2 = dauGen2->pdgId();
611  float ptpart=0.;
612  if (partId0 == ipart) {
613  for(unsigned int k = 0; k < dauGen0->numberOfDaughters(); ++k) {
614  const Candidate * dauMuGen = dauGen0->daughter(k);
615  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
616  ptpart = dauMuGen->pt();
617  }
618  }
619  }
620  if (partId1 == ipart) {
621  for(unsigned int k = 0; k < dauGen1->numberOfDaughters(); ++k) {
622  const Candidate * dauMuGen = dauGen1->daughter(k);
623  if(dauMuGen->pdgId() == ipart && dauMuGen->status() ==1) {
624  ptpart = dauMuGen->pt();
625  }
626  }
627  }
628  if (partId2 == ipart) {
629  for(unsigned int k = 0; k < dauGen2->numberOfDaughters(); ++k) {
630  const Candidate * dauMuGen = dauGen2->daughter(k);
631  if(abs(dauMuGen->pdgId()) == ipart && dauMuGen->status() ==1) {
632  ptpart = dauMuGen->pt();
633  }
634  }
635  }
636  return ptpart;
637 }
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
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int k[5][pyjets_maxn]
virtual double pt() const =0
transverse momentum
virtual size_type numberOfDaughters() const =0
number of daughters

Member Data Documentation

bool ZMuMu_efficiencyAnalyzer::bothMuons_
private

Definition at line 70 of file ZMuMu_efficiencyAnalyzer.cc.

unsigned int ZMuMu_efficiencyAnalyzer::etaBins
private
double ZMuMu_efficiencyAnalyzer::etamax_
private

Definition at line 72 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

double ZMuMu_efficiencyAnalyzer::etaRange[7]
private

Definition at line 77 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

EDGetTokenT<GenParticleCollection> ZMuMu_efficiencyAnalyzer::genParticlesToken_
private

Definition at line 67 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

reco::CandidateBaseRef ZMuMu_efficiencyAnalyzer::globalMuonCandRef_
private

Definition at line 80 of file ZMuMu_efficiencyAnalyzer.cc.

TH1D* ZMuMu_efficiencyAnalyzer::h_zmm1HLTminus_mass
private

Definition at line 86 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D* ZMuMu_efficiencyAnalyzer::h_zmm1HLTplus_mass
private

Definition at line 85 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmm2HLT_mass
private

Definition at line 84 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D* ZMuMu_efficiencyAnalyzer::h_zmm_mass
private

Definition at line 84 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmmNotIsominus_mass
private

Definition at line 86 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmmNotIsoplus_mass
private

Definition at line 85 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmsminus_mass
private

Definition at line 86 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmsplus_mass
private

Definition at line 85 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmtminus_mass
private

Definition at line 86 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

TH1D * ZMuMu_efficiencyAnalyzer::h_zmtplus_mass
private

Definition at line 85 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu1HLTminus_eta
private

Definition at line 93 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu1HLTminus_pt
private

Definition at line 94 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu1HLTplus_eta
private

Definition at line 91 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu1HLTplus_pt
private

Definition at line 92 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu2HLTminus_eta
private

Definition at line 93 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu2HLTminus_pt
private

Definition at line 94 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu2HLTplus_eta
private

Definition at line 91 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumu2HLTplus_pt
private

Definition at line 92 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumuNotIsominus_eta
private

Definition at line 93 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumuNotIsominus_pt
private

Definition at line 94 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumuNotIsoplus_eta
private

Definition at line 91 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmumuNotIsoplus_pt
private

Definition at line 92 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmustaminus_eta
private

Definition at line 93 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmustaminus_pt
private

Definition at line 94 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmustaplus_eta
private

Definition at line 91 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmustaplus_pt
private

Definition at line 92 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmutrackminus_eta
private

Definition at line 93 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmutrackminus_pt
private

Definition at line 94 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmutrackplus_eta
private

Definition at line 91 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

vector<TH1D *> ZMuMu_efficiencyAnalyzer::hmutrackplus_pt
private

Definition at line 92 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

double ZMuMu_efficiencyAnalyzer::isoMax_
private

Definition at line 72 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

double ZMuMu_efficiencyAnalyzer::massMax_
private

Definition at line 72 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

double ZMuMu_efficiencyAnalyzer::massMin_
private

Definition at line 72 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<CandidateView> ZMuMu_efficiencyAnalyzer::muonsToken_
private

Definition at line 65 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

int ZMuMu_efficiencyAnalyzer::nGlobalMuonsMatched_passed
private

Definition at line 89 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by ZMuMu_efficiencyAnalyzer().

OverlapChecker ZMuMu_efficiencyAnalyzer::overlap_
private

Definition at line 81 of file ZMuMu_efficiencyAnalyzer.cc.

EDGetTokenT<VertexCollection> ZMuMu_efficiencyAnalyzer::primaryVerticesToken_
private

Definition at line 68 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

unsigned int ZMuMu_efficiencyAnalyzer::ptBins
private
double ZMuMu_efficiencyAnalyzer::ptmin_
private

Definition at line 72 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

double ZMuMu_efficiencyAnalyzer::ptRange[5]
private

Definition at line 78 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze(), and ZMuMu_efficiencyAnalyzer().

reco::CandidateBaseRef ZMuMu_efficiencyAnalyzer::standAloneMuonCandRef_
private

Definition at line 80 of file ZMuMu_efficiencyAnalyzer.cc.

reco::CandidateBaseRef ZMuMu_efficiencyAnalyzer::trackMuonCandRef_
private

Definition at line 80 of file ZMuMu_efficiencyAnalyzer.cc.

EDGetTokenT<CandidateView> ZMuMu_efficiencyAnalyzer::tracksToken_
private

Definition at line 66 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<GenParticleMatch> ZMuMu_efficiencyAnalyzer::zMuMuMatchMapToken_
private

Definition at line 60 of file ZMuMu_efficiencyAnalyzer.cc.

EDGetTokenT<CandidateView> ZMuMu_efficiencyAnalyzer::zMuMuToken_
private

Definition at line 59 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<GenParticleMatch> ZMuMu_efficiencyAnalyzer::zMuStandAloneMatchMapToken_
private

Definition at line 62 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<CandidateView> ZMuMu_efficiencyAnalyzer::zMuStandAloneToken_
private

Definition at line 61 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<GenParticleMatch> ZMuMu_efficiencyAnalyzer::zMuTrackMatchMapToken_
private

Definition at line 64 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().

EDGetTokenT<CandidateView> ZMuMu_efficiencyAnalyzer::zMuTrackToken_
private

Definition at line 63 of file ZMuMu_efficiencyAnalyzer.cc.

Referenced by analyze().