CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  std::auto_ptr<reco::MuonCollection> outputMuons(new 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(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  outMuon.setPFP4(pfCandidates->at(iter->second).p4());
368  outMuon.setP4(pfCandidates->at(iter->second).p4());//PF is the default
369  outMuon.setCharge(pfCandidates->at(iter->second).charge());//PF is the default
370  outMuon.setBestTrack(pfCandidates->at(iter->second).bestMuonTrackType());
371  muToPFMap.erase(iter);
372  dout << "MuonRef: " << muRef.id() << " " << muRef.key()
373  << " Is it PF? " << outMuon.isPFMuon()
374  << " PF p4: " << outMuon.pfP4() << endl;
375  }
376 
377 
378  dout << "MuonRef: " << muRef.id() << " " << muRef.key()
379  << " Is it PF? " << outMuon.isPFMuon() << endl;
380 
381  dout << "GLB " << outMuon.isGlobalMuon()
382  << " TM " << outMuon.isTrackerMuon()
383  << " STA " << outMuon.isStandAloneMuon()
384  << " p4 " << outMuon.p4() << endl;
385  }
386 
387  // Add PF isolation info
388  if(fillPFIsolation_){
389  thePFIsoHelper->embedPFIsolation(outMuon,muRef);
390 
391  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
392  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames[j].begin(); map != pfIsoMapNames[j].end(); ++map){
393  (pfIsoMapVals[j])[map->first][i] = (*pfIsoMaps[j][map->first])[muRef];
394  }
395  }
396  }
397 
398  // Fill timing information
399  if(fillTimingInfo_){
400  combinedTimeColl[i] = (*timeMapCmb)[muRef];
401  dtTimeColl[i] = (*timeMapDT)[muRef];
402  cscTimeColl[i] = (*timeMapCSC)[muRef];
403  }
404 
406  trackDepColl[i] = (*trackIsoDepMap)[muRef];
407  ecalDepColl[i] = (*ecalIsoDepMap)[muRef];
408  hcalDepColl[i] = (*hcalIsoDepMap)[muRef];
409  hoDepColl[i] = (*hoIsoDepMap)[muRef];
410  jetDepColl[i] = (*jetIsoDepMap)[muRef];;
411  }
412 
413  if(fillSelectors_){
414  unsigned int s = 0;
415  for(InputTags::const_iterator tag = theSelectorMapNames.begin();
416  tag != theSelectorMapNames.end(); ++tag, ++s)
417  selectorMapResults[s][i] = (*selectorMaps[s])[muRef];
418  }
419 
420  // Fill the Showering Info
421  if(fillShoweringInfo_) showerInfoColl[i] = (*showerInfoMap)[muRef];
422 
423  if(fillCosmicsIdMap_){
424  cosmicIdColl[i] = (*cosmicIdMap)[muRef];
425  cosmicCompColl[i] = (*cosmicCompMap)[muRef];
426  }
427 
428  outputMuons->push_back(outMuon);
429  ++i;
430  }
431 
432  dout << "Number of Muons in the new muon collection: " << outputMuons->size() << endl;
433  edm::OrphanHandle<reco::MuonCollection> muonHandle = event.put(outputMuons);
434 
435  if(fillTimingInfo_){
436  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, combinedTimeColl,"combined");
437  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, dtTimeColl,"dt");
438  fillMuonMap<reco::MuonTimeExtra>(event, muonHandle, cscTimeColl,"csc");
439  }
440 
442  fillMuonMap<reco::IsoDeposit>(event, muonHandle, trackDepColl, labelOrInstance(theTrackDepositName));
443  fillMuonMap<reco::IsoDeposit>(event, muonHandle, jetDepColl, labelOrInstance(theJetDepositName));
444  fillMuonMap<reco::IsoDeposit>(event, muonHandle, ecalDepColl, theEcalDepositName.instance());
445  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hcalDepColl, theHcalDepositName.instance());
446  fillMuonMap<reco::IsoDeposit>(event, muonHandle, hoDepColl, theHoDepositName.instance());
447  }
448 
449  if(fillPFIsolation_){
450 
451  for(unsigned int j=0;j<pfIsoMapNames.size();++j) {
452  for(std::map<std::string,edm::InputTag>::const_iterator map = pfIsoMapNames[j].begin(); map != pfIsoMapNames[j].end(); ++map)
453  fillMuonMap<double>(event, muonHandle, pfIsoMapVals[j][map->first], labelOrInstance(map->second));
454  }
455  }
456 
457  if(fillSelectors_){
458  unsigned int s = 0;
459  for(InputTags::const_iterator tag = theSelectorMapNames.begin();
460  tag != theSelectorMapNames.end(); ++tag, ++s)
461  fillMuonMap<bool>(event, muonHandle, selectorMapResults[s], labelOrInstance(*tag));
462  }
463 
464  if(fillShoweringInfo_) fillMuonMap<reco::MuonShower>(event, muonHandle, showerInfoColl, labelOrInstance(theShowerMapName));
465 
466  if(fillCosmicsIdMap_){
467  fillMuonMap<unsigned int>(event, muonHandle, cosmicIdColl, labelOrInstance(theCosmicCompMapName));
468  fillMuonMap<reco::MuonCosmicCompatibility>(event, muonHandle, cosmicCompColl, labelOrInstance(theCosmicCompMapName));
469  }
470 
471  fillMuonMap<reco::MuonRef>(event,inputMuonsOH, muonRefColl, theMuToMuMapName);
472 
473 
474 }
475 
476 
477 
478 template<typename TYPE>
480  const edm::OrphanHandle<reco::MuonCollection>& muonHandle,
481  const std::vector<TYPE>& muonExtra,
482  const std::string& label){
483 
484  typedef typename edm::ValueMap<TYPE>::Filler FILLER;
485 
486  std::auto_ptr<edm::ValueMap<TYPE> > muonMap(new edm::ValueMap<TYPE>());
487  if(!muonExtra.empty()){
488  FILLER filler(*muonMap);
489  filler.insert(muonHandle, muonExtra.begin(), muonExtra.end());
490  filler.fill();
491  }
492  event.put(muonMap,label);
493 }
494 
495 
497  if(fastLabelling_) return input.label();
498 
499  return input.label() != theMuonsCollectionLabel.label() ? input.label() : input.instance();
500 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonTimeExtraMap > timeMapCSCToken_
Definition: MuonProducer.h:131
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
edm::InputTag theTrackDepositName
Definition: MuonProducer.h:102
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.
virtual void setCharge(Charge q)
set electric charge
Definition: LeafCandidate.h:93
bool isTrackerMuon() const
Definition: Muon.h:219
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:218
virtual void setP4(const LorentzVector &p4)
set 4-momentum
key_type key() const
Accessor for product key.
Definition: Ref.h:266
edm::InputTag theEcalDepositName
Definition: MuonProducer.h:103
bool isStandAloneMuon() const
Definition: Muon.h:220
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:256
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:43
edm::EDGetTokenT< reco::IsoDepositMap > theHoDepositToken_
Definition: MuonProducer.h:111
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ProductID id() const
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
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
edm::InputTag theMuonsCollectionLabel
Definition: MuonProducer.h:84
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
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 &)
edm::EDGetTokenT< edm::ValueMap< reco::MuonCosmicCompatibility > > theCosmicCompMapToken_
Definition: MuonProducer.h:124
std::string const & label() const
Definition: InputTag.h:42
MuPFIsoHelper * thePFIsoHelper
Definition: MuonProducer.h:127
void beginEvent(const edm::Event &iEvent)
virtual void setBestTrack(MuonTrackType muonType)
Definition: Muon.h:91
#define begin
Definition: vmac.h:30
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:222
virtual void setPFP4(const reco::Candidate::LorentzVector &p4_)
edm::InputTag theHcalDepositName
Definition: MuonProducer.h:104
bool fillPFMomentum_
Definition: MuonProducer.h:96
volatile std::atomic< bool > shutdown_flag false
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
std::string const & instance() const
Definition: InputTag.h:43
edm::InputTag theJetDepositName
Definition: MuonProducer.h:106
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:170