CMS 3D CMS Logo

MuonProducer.cc
Go to the documentation of this file.
1 
8 
10 
11 
12 #include <boost/foreach.hpp>
13 #define foreach BOOST_FOREACH
14 
15 #ifndef dout
16 #define dout if(debug_) std::cout
17 #endif
18 
19 using std::endl;
20 
21 typedef std::map<reco::MuonRef, unsigned int> MuToPFMap;
22 
23 
24 namespace reco {
26 }
27 
28 
30 MuonProducer::MuonProducer(const edm::ParameterSet& pSet):debug_(pSet.getUntrackedParameter<bool>("ActivateDebug",false)){
31 
32  setAlias(pSet.getParameter<std::string>("@module_label"));
33 
34  fastLabelling_ = pSet.getUntrackedParameter<bool>("FastLabelling",true);
35 
36 
38  theMuonsCollectionToken_ = consumes<reco::MuonCollection>(theMuonsCollectionLabel);
39 
40  thePFCandLabel = pSet.getParameter<edm::InputTag>("PFCandidates");
41  thePFCandToken_ = consumes<reco::PFCandidateCollection>(thePFCandLabel);
42 
43  // Variables to switch on-off the differnt parts
44  fillSelectors_ = pSet.getParameter<bool>("FillSelectorMaps");
45  fillCosmicsIdMap_ = pSet.getParameter<bool>("FillCosmicsIdMap");
46  fillPFMomentum_ = pSet.getParameter<bool>("FillPFMomentumAndAssociation");
47  fillPFIsolation_ = pSet.getParameter<bool>("FillPFIsolation");
48  fillDetectorBasedIsolation_ = pSet.getParameter<bool>("FillDetectorBasedIsolation");
49  fillShoweringInfo_ = pSet.getParameter<bool>("FillShoweringInfo");
50  fillTimingInfo_ = pSet.getParameter<bool>("FillTimingInfo");
51 
52  produces<reco::MuonCollection>();
53 
54  if(fillTimingInfo_){
55 
56  timeMapCmbToken_= consumes<reco::MuonTimeExtraMap>(edm::InputTag(theMuonsCollectionLabel.label(),"combined")) ;
57  timeMapDTToken_ = consumes<reco::MuonTimeExtraMap>(edm::InputTag(theMuonsCollectionLabel.label(),"dt")) ;
58  timeMapCSCToken_= consumes<reco::MuonTimeExtraMap>(edm::InputTag(theMuonsCollectionLabel.label(),"csc")) ;
59 
60  produces<reco::MuonTimeExtraMap>("combined");
61  produces<reco::MuonTimeExtraMap>("dt");
62  produces<reco::MuonTimeExtraMap>("csc");
63  }
64 
65  if (fillDetectorBasedIsolation_){
66  theTrackDepositName = pSet.getParameter<edm::InputTag>("TrackIsoDeposits");
67  theTrackDepositToken_ = consumes<reco::IsoDepositMap>(theTrackDepositName);
68  produces<reco::IsoDepositMap>(labelOrInstance(theTrackDepositName));
69 
70  theJetDepositName = pSet.getParameter<edm::InputTag>("JetIsoDeposits");
71  theJetDepositToken_ = consumes<reco::IsoDepositMap>(theJetDepositName);
72  produces<reco::IsoDepositMap>(labelOrInstance(theJetDepositName));
73 
74  theEcalDepositName = pSet.getParameter<edm::InputTag>("EcalIsoDeposits");
75  theEcalDepositToken_ = consumes<reco::IsoDepositMap>(theEcalDepositName);
76  produces<reco::IsoDepositMap>(theEcalDepositName.instance());
77 
78  theHcalDepositName = pSet.getParameter<edm::InputTag>("HcalIsoDeposits");
79  theHcalDepositToken_ = consumes<reco::IsoDepositMap>(theHcalDepositName);
80  produces<reco::IsoDepositMap>(theHcalDepositName.instance());
81 
82  theHoDepositName = pSet.getParameter<edm::InputTag>("HoIsoDeposits");
83  theHoDepositToken_ = consumes<reco::IsoDepositMap>(theHoDepositName);
84 
85  produces<reco::IsoDepositMap>(theHoDepositName.instance());
86  }
87 
88  if(fillSelectors_){
89  theSelectorMapNames = pSet.getParameter<InputTags>("SelectorMaps");
90 
91  for(InputTags::const_iterator tag = theSelectorMapNames.begin(); tag != theSelectorMapNames.end(); ++tag) {
93  produces<edm::ValueMap<bool> >(labelOrInstance(*tag));
94  }
95 
96  }
97 
98  if(fillShoweringInfo_){
99  theShowerMapName = pSet.getParameter<edm::InputTag>("ShowerInfoMap");
100  theShowerMapToken_ = consumes<reco::MuonShowerMap>(theShowerMapName);
101  produces<edm::ValueMap<reco::MuonShower> >(labelOrInstance(theShowerMapName));
102  }
103 
104  if(fillCosmicsIdMap_){
105  theCosmicCompMapName = pSet.getParameter<edm::InputTag>("CosmicIdMap");
106  theCosmicIdMapToken_ = consumes<edm::ValueMap<unsigned int> >(theCosmicCompMapName);
107  theCosmicCompMapToken_ = consumes<edm::ValueMap<reco::MuonCosmicCompatibility> >(theCosmicCompMapName);
108 
109  produces<edm::ValueMap<reco::MuonCosmicCompatibility> >(labelOrInstance(theCosmicCompMapName));
110  produces<edm::ValueMap<unsigned int> >(labelOrInstance(theCosmicCompMapName));
111  }
112 
113  theMuToMuMapName = theMuonsCollectionLabel.label()+"2"+theAlias+"sMap";
114  produces<edm::ValueMap<reco::MuonRef> >(theMuToMuMapName);
115 
116 
117 
118 
119  if(fillPFIsolation_){
120 
121  edm::ParameterSet pfIsoPSet = pSet.getParameter<edm::ParameterSet >("PFIsolation");
122 
123  //Define a map between the isolation and the PSet for the PFHelper
124  std::map<std::string,edm::ParameterSet> psetMap;
125 
126  //First declare what isolation you are going to read
127  std::vector<std::string> isolationLabels;
128  isolationLabels.push_back("pfIsolationR03");
129  isolationLabels.push_back("pfIsoMeanDRProfileR03");
130  isolationLabels.push_back("pfIsoSumDRProfileR03");
131  isolationLabels.push_back("pfIsolationR04");
132  isolationLabels.push_back("pfIsoMeanDRProfileR04");
133  isolationLabels.push_back("pfIsoSumDRProfileR04");
134 
135  //Fill the label,pet map and initialize MuPFIsoHelper
136  for( std::vector<std::string>::const_iterator label = isolationLabels.begin();label != isolationLabels.end();++label)
137  psetMap[*label] =pfIsoPSet.getParameter<edm::ParameterSet >(*label);
138 
140 
141  //Now loop on the mass read for each PSet the parameters and save them to the mapNames for later
142 
143  for(std::map<std::string,edm::ParameterSet>::const_iterator map = psetMap.begin();map!= psetMap.end();++map) {
144  std::map<std::string,edm::InputTag> isoMap;
145  isoMap["chargedParticle"] = map->second.getParameter<edm::InputTag>("chargedParticle");
146  isoMap["chargedHadron"] = map->second.getParameter<edm::InputTag>("chargedHadron");
147  isoMap["neutralHadron"] = map->second.getParameter<edm::InputTag>("neutralHadron");
148  isoMap["neutralHadronHighThreshold"] = map->second.getParameter<edm::InputTag>("neutralHadronHighThreshold");
149  isoMap["photon"] = map->second.getParameter<edm::InputTag>("photon");
150  isoMap["photonHighThreshold"] = map->second.getParameter<edm::InputTag>("photonHighThreshold");
151  isoMap["pu"] = map->second.getParameter<edm::InputTag>("pu");
152 
153  std::map<std::string,edm::EDGetTokenT<edm::ValueMap<double> > > isoMapToken;
154  isoMapToken["chargedParticle"] = consumes<edm::ValueMap<double> >(isoMap["chargedParticle"]);
155  isoMapToken["chargedHadron"] = consumes<edm::ValueMap<double> >(isoMap["chargedHadron"]);
156  isoMapToken["neutralHadron"] = consumes<edm::ValueMap<double> >(isoMap["neutralHadron"]);
157  isoMapToken["neutralHadronHighThreshold"] = consumes<edm::ValueMap<double> >(isoMap["neutralHadronHighThreshold"]);
158  isoMapToken["photon"] = consumes<edm::ValueMap<double> >(isoMap["photon"]);
159  isoMapToken["photonHighThreshold"] = consumes<edm::ValueMap<double> >(isoMap["photonHighThreshold"]);
160  isoMapToken["pu"] = consumes<edm::ValueMap<double> >(isoMap["pu"]);
161 
162 
163  pfIsoMapNames.push_back(isoMap);
164  pfIsoMapTokens_.push_back(isoMapToken);
165  }
166 
167 
168  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
169  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames.at(j).begin(); map != pfIsoMapNames.at(j).end(); ++map)
171 
172  }
173 
174  }
175 }
176 
180 }
181 
182 
185 
186  const std::string metname = "Muon|RecoMuon|MuonIdentification|MuonProducer";
187 
188  // the muon collection, it will be loaded in the event
189  auto outputMuons = std::make_unique<reco::MuonCollection>();
190  reco::MuonRefProd outputMuonsRefProd = event.getRefBeforePut<reco::MuonCollection>();
191 
193  event.getByToken(theMuonsCollectionToken_, inputMuons);
194  edm::OrphanHandle<reco::MuonCollection> inputMuonsOH(inputMuons.product(), inputMuons.id());
195 
197  event.getByToken(thePFCandToken_, pfCandidates);
198 
199 
200  // fetch collections for PFIso
202 
203 
204  // Fill timing information
208 
209  int nMuons=inputMuons->size();
210 
211  std::vector<reco::MuonTimeExtra> dtTimeColl(nMuons);
212  std::vector<reco::MuonTimeExtra> cscTimeColl(nMuons);
213  std::vector<reco::MuonTimeExtra> combinedTimeColl(nMuons);
214 
215  if(fillTimingInfo_){
216  event.getByToken(timeMapCmbToken_,timeMapCmb);
217  event.getByToken(timeMapDTToken_,timeMapDT);
218  event.getByToken(timeMapCSCToken_,timeMapCSC);
219  }
220 
221  std::vector<reco::IsoDeposit> trackDepColl(nMuons);
222  std::vector<reco::IsoDeposit> ecalDepColl(nMuons);
223  std::vector<reco::IsoDeposit> hcalDepColl(nMuons);
224  std::vector<reco::IsoDeposit> hoDepColl(nMuons);
225  std::vector<reco::IsoDeposit> jetDepColl(nMuons);
226 
227 
228  edm::Handle<reco::IsoDepositMap> trackIsoDepMap;
229  edm::Handle<reco::IsoDepositMap> ecalIsoDepMap;
230  edm::Handle<reco::IsoDepositMap> hcalIsoDepMap;
233 
234 
236  event.getByToken(theTrackDepositToken_,trackIsoDepMap);
237  event.getByToken(theEcalDepositToken_,ecalIsoDepMap);
238  event.getByToken(theHcalDepositToken_,hcalIsoDepMap);
239  event.getByToken(theHoDepositToken_,hoIsoDepMap);
240  event.getByToken(theJetDepositToken_,jetIsoDepMap);
241  }
242 
243 
244 
245  std::vector<std::map<std::string,edm::Handle<edm::ValueMap<double> > > > pfIsoMaps;
246  std::vector<std::map<std::string,std::vector<double> > > pfIsoMapVals;
247 
248  if(fillPFIsolation_){
249  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
250  std::map<std::string,std::vector<double> > mapVals;
251  std::map<std::string,edm::Handle<edm::ValueMap<double> > > maps;
252  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames.at(j).begin(); map != pfIsoMapNames.at(j).end(); ++map) {
254  event.getByToken(pfIsoMapTokens_.at(j)[map->first],handleTmp);
255  maps[map->first]=handleTmp;
256  mapVals[map->first].resize(nMuons);
257  }
258  pfIsoMapVals.push_back(mapVals);
259  pfIsoMaps.push_back(maps);
260 
261  }
262  }
263 
264 
265 
266  std::vector<edm::Handle<edm::ValueMap<bool> > > selectorMaps(fillSelectors_ ? theSelectorMapNames.size() : 0);
267  std::vector<std::vector<bool> > selectorMapResults(fillSelectors_ ? theSelectorMapNames.size() : 0);
268  if(fillSelectors_){
269  unsigned int s=0;
270  for(InputTags::const_iterator tag = theSelectorMapNames.begin(); tag != theSelectorMapNames.end(); ++tag, ++s){
271  event.getByToken(theSelectorMapTokens_.at(s),selectorMaps[s]);
272  selectorMapResults[s].resize(nMuons);
273  }
274  }
275 
276  edm::Handle<reco::MuonShowerMap> showerInfoMap;
277  if(fillShoweringInfo_) event.getByToken(theShowerMapToken_,showerInfoMap);
278 
279  std::vector<reco::MuonShower> showerInfoColl(nMuons);
280 
282  if(fillCosmicsIdMap_) event.getByToken(theCosmicIdMapToken_,cosmicIdMap);
283  std::vector<unsigned int> cosmicIdColl(fillCosmicsIdMap_ ? nMuons : 0);
284 
286  if(fillCosmicsIdMap_) event.getByToken(theCosmicCompMapToken_,cosmicCompMap);
287  std::vector<reco::MuonCosmicCompatibility> cosmicCompColl(fillCosmicsIdMap_ ? nMuons : 0);
288 
289 
290  std::vector<reco::MuonRef> muonRefColl(nMuons);
291 
292 
293 
294  if(inputMuons->empty()) {
295  edm::OrphanHandle<reco::MuonCollection> muonHandle = event.put(std::move(outputMuons));
296 
297  if(fillTimingInfo_){
298  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, combinedTimeColl,"combined");
299  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, dtTimeColl,"dt");
300  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, cscTimeColl,"csc");
301  }
302 
304  fillMuonMap<reco::IsoDeposit>(event, muonHandle, trackDepColl, labelOrInstance(theTrackDepositName));
305  fillMuonMap<reco::IsoDeposit>(event, muonHandle, jetDepColl, labelOrInstance(theJetDepositName));
306  fillMuonMap<reco::IsoDeposit>(event, muonHandle, ecalDepColl, theEcalDepositName.instance());
307  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hcalDepColl, theHcalDepositName.instance());
308  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hoDepColl, theHoDepositName.instance());
309  }
310 
311  if(fillSelectors_){
312  unsigned int s = 0;
313  for(InputTags::const_iterator tag = theSelectorMapNames.begin();
314  tag != theSelectorMapNames.end(); ++tag, ++s){
315  fillMuonMap<bool>(event, muonHandle, selectorMapResults[s], labelOrInstance(*tag));
316  }
317  }
318 
319  if(fillShoweringInfo_) fillMuonMap<reco::MuonShower>(event, muonHandle, showerInfoColl, labelOrInstance(theShowerMapName));
320 
321  if(fillCosmicsIdMap_){
322  fillMuonMap<unsigned int>(event, muonHandle, cosmicIdColl, labelOrInstance(theCosmicCompMapName));
323  fillMuonMap<reco::MuonCosmicCompatibility>(event, muonHandle, cosmicCompColl, labelOrInstance(theCosmicCompMapName));
324  }
325 
326  fillMuonMap<reco::MuonRef>(event,inputMuonsOH, muonRefColl, theMuToMuMapName);
327 
328  if(fillPFIsolation_){
329  for(unsigned int j=0;j<pfIsoMapNames.size();++j)
330  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames.at(j).begin(); map != pfIsoMapNames.at(j).end(); ++map) {
331  fillMuonMap<double>(event, muonHandle, pfIsoMapVals.at(j)[map->first], labelOrInstance(map->second));
332  }
333  }
334  return;
335  }
336 
337  // FIXME: add the option to swith off the Muon-PF "info association".
338 
339 
340  MuToPFMap muToPFMap;
341 
342  if(fillPFMomentum_){
343  dout << "Number of PFCandidates: " << pfCandidates->size() << endl;
344  for(unsigned int i=0;i< pfCandidates->size();++i)
345  if(abs(pfCandidates->at(i).pdgId()) == 13){
346  muToPFMap[pfCandidates->at(i).muonRef()] = i;
347  dout << "MuonRef: " << pfCandidates->at(i).muonRef().id() << " " << pfCandidates->at(i).muonRef().key() << " PF p4: " << pfCandidates->at(i).p4() << endl;
348  }
349  dout << "Number of PFMuons: " << muToPFMap.size() << endl;
350  dout << "Number of Muons in the original collection: " << inputMuons->size() << endl;
351  }
352 
353  reco::MuonRef::key_type muIndex = 0;
354  unsigned int i = 0;
355  foreach(const reco::Muon &inMuon, *inputMuons){
356 
357  reco::MuonRef muRef(inputMuons, muIndex);
358  muonRefColl[i] = reco::MuonRef(outputMuonsRefProd, muIndex++);
359 
360  // Copy the muon
361  reco::Muon outMuon = inMuon;
362 
363  if(fillPFMomentum_){
364  // search for the corresponding pf candidate
365  MuToPFMap::iterator iter = muToPFMap.find(muRef);
366  if(iter != muToPFMap.end()){
367  const auto& pfMu = pfCandidates->at(iter->second);
368  outMuon.setPFP4(pfMu.p4());
369  outMuon.setP4(pfMu.p4());//PF is the default
370  outMuon.setCharge(pfMu.charge());//PF is the default
371  outMuon.setPdgId(-13*pfMu.charge());
372  outMuon.setBestTrack(pfMu.bestMuonTrackType());
373  muToPFMap.erase(iter);
374  dout << "MuonRef: " << muRef.id() << " " << muRef.key()
375  << " Is it PF? " << outMuon.isPFMuon()
376  << " PF p4: " << outMuon.pfP4() << endl;
377  }
378 
379 
380  dout << "MuonRef: " << muRef.id() << " " << muRef.key()
381  << " Is it PF? " << outMuon.isPFMuon() << endl;
382 
383  dout << "GLB " << outMuon.isGlobalMuon()
384  << " TM " << outMuon.isTrackerMuon()
385  << " STA " << outMuon.isStandAloneMuon()
386  << " p4 " << outMuon.p4() << endl;
387  }
388 
389  // Add PF isolation info
390  if(fillPFIsolation_){
391  thePFIsoHelper->embedPFIsolation(outMuon,muRef);
392 
393  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
394  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames[j].begin(); map != pfIsoMapNames[j].end(); ++map){
395  (pfIsoMapVals[j])[map->first][i] = (*pfIsoMaps[j][map->first])[muRef];
396  }
397  }
398  }
399 
400  // Fill timing information
401  if(fillTimingInfo_){
402  combinedTimeColl[i] = (*timeMapCmb)[muRef];
403  dtTimeColl[i] = (*timeMapDT)[muRef];
404  cscTimeColl[i] = (*timeMapCSC)[muRef];
405  }
406 
408  trackDepColl[i] = (*trackIsoDepMap)[muRef];
409  ecalDepColl[i] = (*ecalIsoDepMap)[muRef];
410  hcalDepColl[i] = (*hcalIsoDepMap)[muRef];
411  hoDepColl[i] = (*hoIsoDepMap)[muRef];
412  jetDepColl[i] = (*jetIsoDepMap)[muRef];;
413  }
414 
415  if(fillSelectors_){
416  unsigned int s = 0;
417  for(InputTags::const_iterator tag = theSelectorMapNames.begin();
418  tag != theSelectorMapNames.end(); ++tag, ++s)
419  selectorMapResults[s][i] = (*selectorMaps[s])[muRef];
420  }
421 
422  // Fill the Showering Info
423  if(fillShoweringInfo_) showerInfoColl[i] = (*showerInfoMap)[muRef];
424 
425  if(fillCosmicsIdMap_){
426  cosmicIdColl[i] = (*cosmicIdMap)[muRef];
427  cosmicCompColl[i] = (*cosmicCompMap)[muRef];
428  }
429 
430  outputMuons->push_back(outMuon);
431  ++i;
432  }
433 
434  dout << "Number of Muons in the new muon collection: " << outputMuons->size() << endl;
435  edm::OrphanHandle<reco::MuonCollection> muonHandle = event.put(std::move(outputMuons));
436 
437  if(fillTimingInfo_){
438  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, combinedTimeColl,"combined");
439  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, dtTimeColl,"dt");
440  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, cscTimeColl,"csc");
441  }
442 
444  fillMuonMap<reco::IsoDeposit>(event, muonHandle, trackDepColl, labelOrInstance(theTrackDepositName));
445  fillMuonMap<reco::IsoDeposit>(event, muonHandle, jetDepColl, labelOrInstance(theJetDepositName));
446  fillMuonMap<reco::IsoDeposit>(event, muonHandle, ecalDepColl, theEcalDepositName.instance());
447  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hcalDepColl, theHcalDepositName.instance());
448  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hoDepColl, theHoDepositName.instance());
449  }
450 
451  if(fillPFIsolation_){
452 
453  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
454  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames[j].begin(); map != pfIsoMapNames[j].end(); ++map)
455  fillMuonMap<double>(event, muonHandle, pfIsoMapVals[j][map->first], labelOrInstance(map->second));
456  }
457  }
458 
459  if(fillSelectors_){
460  unsigned int s = 0;
461  for(InputTags::const_iterator tag = theSelectorMapNames.begin();
462  tag != theSelectorMapNames.end(); ++tag, ++s)
463  fillMuonMap<bool>(event, muonHandle, selectorMapResults[s], labelOrInstance(*tag));
464  }
465 
466  if(fillShoweringInfo_) fillMuonMap<reco::MuonShower>(event, muonHandle, showerInfoColl, labelOrInstance(theShowerMapName));
467 
468  if(fillCosmicsIdMap_){
469  fillMuonMap<unsigned int>(event, muonHandle, cosmicIdColl, labelOrInstance(theCosmicCompMapName));
470  fillMuonMap<reco::MuonCosmicCompatibility>(event, muonHandle, cosmicCompColl, labelOrInstance(theCosmicCompMapName));
471  }
472 
473  fillMuonMap<reco::MuonRef>(event,inputMuonsOH, muonRefColl, theMuToMuMapName);
474 
475 
476 }
477 
478 
479 
480 template<typename TYPE>
482  const edm::OrphanHandle<reco::MuonCollection>& muonHandle,
483  const std::vector<TYPE>& muonExtra,
484  const std::string& label){
485 
486  typedef typename edm::ValueMap<TYPE>::Filler FILLER;
487 
488  auto muonMap = std::make_unique<edm::ValueMap<TYPE>>();
489  if(!muonExtra.empty()){
490  FILLER filler(*muonMap);
491  filler.insert(muonHandle, muonExtra.begin(), muonExtra.end());
492  filler.fill();
493  }
494  event.put(std::move(muonMap),label);
495 }
496 
497 
499  if(fastLabelling_) return input.label();
500 
501  return input.label() != theMuonsCollectionLabel.label() ? input.label() : input.instance();
502 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonTimeExtraMap > timeMapCSCToken_
Definition: MuonProducer.h:131
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag theTrackDepositName
Definition: MuonProducer.h:102
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:169
edm::EDGetTokenT< edm::ValueMap< unsigned int > > theCosmicIdMapToken_
Definition: MuonProducer.h:123
edm::EDGetTokenT< reco::MuonTimeExtraMap > timeMapDTToken_
Definition: MuonProducer.h:130
const std::string metname
virtual ~MuonProducer()
Destructor.
bool isTrackerMuon() const
Definition: Muon.h:226
virtual void setPdgId(int pdgId) final
bool fillSelectors_
Definition: MuonProducer.h:94
#define dout
Definition: MuonProducer.cc:16
std::string theAlias
Definition: MuonProducer.h:71
edm::EDGetTokenT< edm::ValueMap< reco::MuonShower > > theShowerMapToken_
Definition: MuonProducer.h:120
bool isGlobalMuon() const
Definition: Muon.h:225
key_type key() const
Accessor for product key.
Definition: Ref.h:265
edm::InputTag theEcalDepositName
Definition: MuonProducer.h:103
bool isStandAloneMuon() const
Definition: Muon.h:227
reco::Candidate::LorentzVector pfP4() const
Definition: Muon.h:102
virtual void produce(edm::Event &, const edm::EventSetup &) override
reconstruct muons
std::vector< edm::EDGetTokenT< edm::ValueMap< bool > > > theSelectorMapTokens_
Definition: MuonProducer.h:116
edm::EDGetTokenT< reco::IsoDepositMap > theJetDepositToken_
Definition: MuonProducer.h:112
std::map< reco::MuonRef, unsigned int > MuToPFMap
Definition: MuonProducer.cc:21
ProductID id() const
Accessor for product ID.
Definition: Ref.h:259
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
bool fillCosmicsIdMap_
Definition: MuonProducer.h:95
edm::ValueMap< reco::MuonShower > MuonShowerMap
Definition: MuonProducer.cc:25
static std::string const input
Definition: EdmProvDump.cc:44
edm::EDGetTokenT< reco::IsoDepositMap > theHoDepositToken_
Definition: MuonProducer.h:111
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ProductID id() const
edm::InputTag thePFCandLabel
Definition: MuonProducer.h:87
edm::EDGetTokenT< reco::PFCandidateCollection > thePFCandToken_
Definition: MuonProducer.h:88
std::vector< std::map< std::string, edm::InputTag > > pfIsoMapNames
Definition: MuonProducer.h:136
void fillMuonMap(edm::Event &event, const edm::OrphanHandle< reco::MuonCollection > &muonHandle, const std::vector< TYPE > &muonExtra, const std::string &label)
edm::EDGetTokenT< reco::IsoDepositMap > theTrackDepositToken_
Definition: MuonProducer.h:108
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
bool fillDetectorBasedIsolation_
Definition: MuonProducer.h:98
std::vector< std::map< std::string, edm::EDGetTokenT< edm::ValueMap< double > > > > pfIsoMapTokens_
Definition: MuonProducer.h:137
void setAlias(std::string alias)
Definition: MuonProducer.h:73
TypeLabelItem const & produces()
declare what type of product will make and with which optional label
virtual void setCharge(Charge q) final
set electric charge
Definition: LeafCandidate.h:93
edm::InputTag theMuonsCollectionLabel
Definition: MuonProducer.h:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string labelOrInstance(const edm::InputTag &) const
edm::Ref< MuonCollection > MuonRef
presistent reference to a Muon
Definition: MuonFwd.h:13
edm::InputTag theShowerMapName
Definition: MuonProducer.h:119
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
edm::EDGetTokenT< reco::MuonTimeExtraMap > timeMapCmbToken_
Definition: MuonProducer.h:129
edm::InputTag theHoDepositName
Definition: MuonProducer.h:105
bool fillTimingInfo_
Definition: MuonProducer.h:100
std::vector< edm::InputTag > InputTags
Definition: MuonProducer.h:60
bool fillPFIsolation_
Definition: MuonProducer.h:97
InputTags theSelectorMapNames
Definition: MuonProducer.h:115
edm::EDGetTokenT< reco::MuonCollection > theMuonsCollectionToken_
Definition: MuonProducer.h:85
std::string theMuToMuMapName
Definition: MuonProducer.h:125
bool fillShoweringInfo_
Definition: MuonProducer.h:99
edm::EDGetTokenT< reco::IsoDepositMap > theEcalDepositToken_
Definition: MuonProducer.h:109
int embedPFIsolation(reco::Muon &, reco::MuonRef &)
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
edm::EDGetTokenT< edm::ValueMap< reco::MuonCosmicCompatibility > > theCosmicCompMapToken_
Definition: MuonProducer.h:124
std::string const & label() const
Definition: InputTag.h:36
MuPFIsoHelper * thePFIsoHelper
Definition: MuonProducer.h:127
void beginEvent(const edm::Event &iEvent)
fixed size matrix
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:91
#define begin
Definition: vmac.h:30
size_t size() const
Definition: ValueMap.h:158
edm::EDGetTokenT< reco::IsoDepositMap > theHcalDepositToken_
Definition: MuonProducer.h:110
edm::InputTag theCosmicCompMapName
Definition: MuonProducer.h:122
MuonProducer(const edm::ParameterSet &)
Constructor.
Definition: MuonProducer.cc:30
bool fastLabelling_
Definition: MuonProducer.h:82
bool isPFMuon() const
Definition: Muon.h:229
virtual void setPFP4(const reco::Candidate::LorentzVector &p4_)
edm::InputTag theHcalDepositName
Definition: MuonProducer.h:104
bool fillPFMomentum_
Definition: MuonProducer.h:96
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
std::string const & instance() const
Definition: InputTag.h:37
edm::InputTag theJetDepositName
Definition: MuonProducer.h:106
def move(src, dest)
Definition: eostools.py:510
Definition: event.py:1