CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PATTauProducer.cc
Go to the documentation of this file.
1 //
2 // $Id: PATTauProducer.cc,v 1.37 2012/05/20 20:12:25 rwolf Exp $
3 //
4 
6 
12 
20 
22 
25 
26 #include <vector>
27 #include <memory>
28 
29 using namespace pat;
30 
32  isolator_(iConfig.exists("userIsolation") ? iConfig.getParameter<edm::ParameterSet>("userIsolation") : edm::ParameterSet(), false) ,
33  useUserData_(iConfig.exists("userData"))
34 {
35  // initialize the configurables
36  tauSrc_ = iConfig.getParameter<edm::InputTag>( "tauSource" );
37  embedIsolationTracks_ = iConfig.getParameter<bool>( "embedIsolationTracks" );
38  embedLeadTrack_ = iConfig.getParameter<bool>( "embedLeadTrack" );
39  embedSignalTracks_ = iConfig.getParameter<bool>( "embedSignalTracks" );
40  embedLeadPFCand_ = iConfig.getParameter<bool>( "embedLeadPFCand" );
41  embedLeadPFChargedHadrCand_ = iConfig.getParameter<bool>( "embedLeadPFChargedHadrCand" );
42  embedLeadPFNeutralCand_ = iConfig.getParameter<bool>( "embedLeadPFNeutralCand" );
43  embedSignalPFCands_ = iConfig.getParameter<bool>( "embedSignalPFCands" );
44  embedSignalPFChargedHadrCands_ = iConfig.getParameter<bool>( "embedSignalPFChargedHadrCands" );
45  embedSignalPFNeutralHadrCands_ = iConfig.getParameter<bool>( "embedSignalPFNeutralHadrCands" );
46  embedSignalPFGammaCands_ = iConfig.getParameter<bool>( "embedSignalPFGammaCands" );
47  embedIsolationPFCands_ = iConfig.getParameter<bool>( "embedIsolationPFCands" );
48  embedIsolationPFChargedHadrCands_ = iConfig.getParameter<bool>( "embedIsolationPFChargedHadrCands" );
49  embedIsolationPFNeutralHadrCands_ = iConfig.getParameter<bool>( "embedIsolationPFNeutralHadrCands" );
50  embedIsolationPFGammaCands_ = iConfig.getParameter<bool>( "embedIsolationPFGammaCands" );
51  addGenMatch_ = iConfig.getParameter<bool>( "addGenMatch" );
52  if (addGenMatch_) {
53  embedGenMatch_ = iConfig.getParameter<bool>( "embedGenMatch" );
54  if (iConfig.existsAs<edm::InputTag>("genParticleMatch")) {
55  genMatchSrc_.push_back(iConfig.getParameter<edm::InputTag>( "genParticleMatch" ));
56  }
57  else {
58  genMatchSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "genParticleMatch" );
59  }
60  }
61  addGenJetMatch_ = iConfig.getParameter<bool>( "addGenJetMatch" );
62  if(addGenJetMatch_) {
63  embedGenJetMatch_ = iConfig.getParameter<bool>( "embedGenJetMatch" );
64  genJetMatchSrc_ = iConfig.getParameter<edm::InputTag>( "genJetMatch" );
65  }
66  addTauJetCorrFactors_ = iConfig.getParameter<bool>( "addTauJetCorrFactors" );
67  tauJetCorrFactorsSrc_ = iConfig.getParameter<std::vector<edm::InputTag> >( "tauJetCorrFactorsSource" );
68  // tau ID configurables
69  addTauID_ = iConfig.getParameter<bool>( "addTauID" );
70  if ( addTauID_ ) {
71  // it might be a single tau ID
72  if (iConfig.existsAs<edm::InputTag>("tauIDSource")) {
73  tauIDSrcs_.push_back(NameTag("", iConfig.getParameter<edm::InputTag>("tauIDSource")));
74  }
75  // or there might be many of them
76  if (iConfig.existsAs<edm::ParameterSet>("tauIDSources")) {
77  // please don't configure me twice
78  if (!tauIDSrcs_.empty()){
79  throw cms::Exception("Configuration") << "PATTauProducer: you can't specify both 'tauIDSource' and 'tauIDSources'\n";
80  }
81  // read the different tau ID names
82  edm::ParameterSet idps = iConfig.getParameter<edm::ParameterSet>("tauIDSources");
83  std::vector<std::string> names = idps.getParameterNamesForType<edm::InputTag>();
84  for (std::vector<std::string>::const_iterator it = names.begin(), ed = names.end(); it != ed; ++it) {
85  tauIDSrcs_.push_back(NameTag(*it, idps.getParameter<edm::InputTag>(*it)));
86  }
87  }
88  // but in any case at least once
89  if (tauIDSrcs_.empty()) throw cms::Exception("Configuration") <<
90  "PATTauProducer: id addTauID is true, you must specify either:\n" <<
91  "\tInputTag tauIDSource = <someTag>\n" << "or\n" <<
92  "\tPSet tauIDSources = { \n" <<
93  "\t\tInputTag <someName> = <someTag> // as many as you want \n " <<
94  "\t}\n";
95  }
96  // IsoDeposit configurables
97  if (iConfig.exists("isoDeposits")) {
98  edm::ParameterSet depconf = iConfig.getParameter<edm::ParameterSet>("isoDeposits");
99  if ( depconf.exists("tracker") ) isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter<edm::InputTag>("tracker")));
100  if ( depconf.exists("ecal") ) isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter<edm::InputTag>("ecal")));
101  if ( depconf.exists("hcal") ) isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter<edm::InputTag>("hcal")));
102  if ( depconf.exists("pfAllParticles") ) isoDepositLabels_.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter<edm::InputTag>("pfAllParticles")));
103  if ( depconf.exists("pfChargedHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter<edm::InputTag>("pfChargedHadron")));
104  if ( depconf.exists("pfNeutralHadron") ) isoDepositLabels_.push_back(std::make_pair(pat::PfNeutralHadronIso,depconf.getParameter<edm::InputTag>("pfNeutralHadron")));
105  if ( depconf.exists("pfGamma") ) isoDepositLabels_.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter<edm::InputTag>("pfGamma")));
106 
107  if ( depconf.exists("user") ) {
108  std::vector<edm::InputTag> userdeps = depconf.getParameter<std::vector<edm::InputTag> >("user");
109  std::vector<edm::InputTag>::const_iterator it = userdeps.begin(), ed = userdeps.end();
110  int key = UserBaseIso;
111  for ( ; it != ed; ++it, ++key) {
112  isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it));
113  }
114  }
115  }
116  // Efficiency configurables
117  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
118  if (addEfficiencies_) {
120  }
121  // Resolution configurables
122  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
123  if (addResolutions_) {
125  }
126  // Check to see if the user wants to add user data
127  if ( useUserData_ ) {
129  }
130  // produces vector of taus
131  produces<std::vector<Tau> >();
132 }
133 
135 {
136 }
137 
139 {
140  // switch off embedding (in unschedules mode)
141  if (iEvent.isRealData()){
142  addGenMatch_ = false;
143  embedGenMatch_ = false;
144  addGenJetMatch_ = false;
145  }
146 
147  // Get the collection of taus from the event
149  try {
150  iEvent.getByLabel(tauSrc_, anyTaus);
151  } catch (const edm::Exception &e) {
152  edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. Instead, an empty tau collection is being be produced.";
153  std::auto_ptr<std::vector<Tau> > patTaus(new std::vector<Tau>());
154  iEvent.put(patTaus);
155  return;
156  }
157 
158  if (isolator_.enabled()) isolator_.beginEvent(iEvent,iSetup);
159 
161  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
162 
163  std::vector<edm::Handle<edm::ValueMap<IsoDeposit> > > deposits(isoDepositLabels_.size());
164  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
165  iEvent.getByLabel(isoDepositLabels_[j].second, deposits[j]);
166  }
167 
168  // prepare the MC matching
169  std::vector<edm::Handle<edm::Association<reco::GenParticleCollection> > > genMatches(genMatchSrc_.size());
170  if (addGenMatch_) {
171  for (size_t j = 0, nd = genMatchSrc_.size(); j < nd; ++j) {
172  iEvent.getByLabel(genMatchSrc_[j], genMatches[j]);
173  }
174  }
175 
177  if (addGenJetMatch_) iEvent.getByLabel(genJetMatchSrc_, genJetMatch);
178 
179  // read in the jet correction factors ValueMap
180  std::vector<edm::ValueMap<TauJetCorrFactors> > tauJetCorrs;
181  if (addTauJetCorrFactors_) {
182  for ( size_t i = 0; i < tauJetCorrFactorsSrc_.size(); ++i ) {
184  iEvent.getByLabel(tauJetCorrFactorsSrc_[i], tauJetCorr);
185  tauJetCorrs.push_back( *tauJetCorr );
186  }
187  }
188 
189  std::auto_ptr<std::vector<Tau> > patTaus(new std::vector<Tau>());
190 
191  bool first=true; // this is introduced to issue warnings only for the first tau-jet
192  for (size_t idx = 0, ntaus = anyTaus->size(); idx < ntaus; ++idx) {
193  edm::RefToBase<reco::BaseTau> tausRef = anyTaus->refAt(idx);
194  edm::Ptr<reco::BaseTau> tausPtr = anyTaus->ptrAt(idx);
195 
196  Tau aTau(tausRef);
197  if (embedLeadTrack_) aTau.embedLeadTrack();
200  if (embedLeadPFCand_) {
201  if (aTau.isPFTau() )
202  aTau.embedLeadPFCand();
203  else
204  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
205  }
207  if (aTau.isPFTau() )
209  else
210  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
211  }
213  if (aTau.isPFTau() )
214  aTau.embedLeadPFNeutralCand();
215  else
216  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
217  }
218  if (embedSignalPFCands_) {
219  if (aTau.isPFTau() )
220  aTau.embedSignalPFCands();
221  else
222  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
223  }
225  if (aTau.isPFTau() )
227  else
228  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
229  }
231  if (aTau.isPFTau() )
233  else
234  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
235  }
237  if (aTau.isPFTau() )
239  else
240  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
241  }
243  if (aTau.isPFTau() )
244  aTau.embedIsolationPFCands();
245  else
246  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
247  }
249  if (aTau.isPFTau() )
251  else
252  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
253  }
255  if (aTau.isPFTau() )
257  else
258  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
259  }
261  if (aTau.isPFTau() )
263  else
264  edm::LogWarning("Type Error") << "Embedding a PFTau-specific information into a pat::Tau which wasn't made from a reco::PFTau is impossible.\n";
265  }
266 
267  if (addTauJetCorrFactors_) {
268  // add additional JetCorrs to the jet
269  for ( unsigned int i=0; i<tauJetCorrFactorsSrc_.size(); ++i ) {
270  const TauJetCorrFactors& tauJetCorr = tauJetCorrs[i][tausRef];
271  // uncomment for debugging
272  // tauJetCorr.print();
273  aTau.addJECFactors(tauJetCorr);
274  }
275  std::vector<std::string> levels = tauJetCorrs[0][tausRef].correctionLabels();
276  if(std::find(levels.begin(), levels.end(), "L2L3Residual")!=levels.end()){
277  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L2L3Residual"));
278  }
279  else if(std::find(levels.begin(), levels.end(), "L3Absolute")!=levels.end()){
280  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("L3Absolute"));
281  }
282  else{
283  aTau.initializeJEC(tauJetCorrs[0][tausRef].jecLevel("Uncorrected"));
284  if(first){
285  edm::LogWarning("L3Absolute not found")
286  << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
287  << "of module " << tauJetCorrs[0][tausRef].jecSet() << " jets will remain"
288  << " uncorrected.";
289  first=false;
290  }
291  }
292  }
293 
294  // store the match to the generated final state muons
295  if (addGenMatch_) {
296  for(size_t i = 0, n = genMatches.size(); i < n; ++i) {
297  reco::GenParticleRef genTau = (*genMatches[i])[tausRef];
298  aTau.addGenParticleRef(genTau);
299  }
300  if (embedGenMatch_) aTau.embedGenParticle();
301  }
302 
303  // store the match to the visible part of the generated tau
304  if (addGenJetMatch_) {
305  reco::GenJetRef genJetTau = (*genJetMatch)[tausRef];
306  if (genJetTau.isNonnull() && genJetTau.isAvailable() ) {
307  aTau.setGenJet( genJetTau );
308  } // leave empty if no match found
309  }
310 
311  // prepare ID extraction
312  if ( addTauID_ ) {
313  std::vector<pat::Tau::IdPair> ids(tauIDSrcs_.size());
314  for ( size_t i = 0; i < tauIDSrcs_.size(); ++i ) {
316  iEvent.getByLabel(tauIDSrcs_[i].second, caloTauIdDiscr);
317 
319  iEvent.getByLabel(tauIDSrcs_[i].second, pfTauIdDiscr);
320 
321  if ( typeid(*tausRef) == typeid(reco::PFTau) ) {
322  //std::cout << "filling PFTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
323  edm::Handle<reco::PFTauCollection> pfTauCollection;
324  iEvent.getByLabel(tauSrc_, pfTauCollection);
325 
327  iEvent.getByLabel(tauIDSrcs_[i].second, pfTauIdDiscr);
328 
329  ids[i].first = tauIDSrcs_[i].first;
330  ids[i].second = getTauIdDiscriminator(pfTauCollection, idx, pfTauIdDiscr);
331  } else if ( typeid(*tausRef) == typeid(reco::CaloTau) ) {
332  //std::cout << "filling CaloTauDiscriminator '" << tauIDSrcs_[i].first << "' into pat::Tau object..." << std::endl;
333  edm::Handle<reco::CaloTauCollection> caloTauCollection;
334  iEvent.getByLabel(tauSrc_, caloTauCollection);
335 
337  iEvent.getByLabel(tauIDSrcs_[i].second, caloTauIdDiscr);
338 
339  ids[i].first = tauIDSrcs_[i].first;
340  ids[i].second = getTauIdDiscriminator(caloTauCollection, idx, caloTauIdDiscr);
341  } else {
342  throw cms::Exception("Type Mismatch") <<
343  "PATTauProducer: unsupported datatype '" << typeid(*tausRef).name() << "' for tauSource\n";
344  }
345  }
346 
347  aTau.setTauIDs(ids);
348  }
349 
350  // extraction of reconstructed tau decay mode
351  // (only available for PFTaus)
352  if ( aTau.isPFTau() ) {
354  iEvent.getByLabel(tauSrc_, pfTaus);
355  reco::PFTauRef pfTauRef(pfTaus, idx);
356 
357  aTau.setDecayMode(pfTauRef->decayMode());
358  }
359 
360  // Isolation
361  if (isolator_.enabled()) {
362  isolator_.fill(*anyTaus, idx, isolatorTmpStorage_);
363  typedef pat::helper::MultiIsolator::IsolationValuePairs IsolationValuePairs;
364  // better to loop backwards, so the vector is resized less times
365  for ( IsolationValuePairs::const_reverse_iterator it = isolatorTmpStorage_.rbegin(),
366  ed = isolatorTmpStorage_.rend(); it != ed; ++it) {
367  aTau.setIsolation(it->first, it->second);
368  }
369  }
370 
371  for (size_t j = 0, nd = deposits.size(); j < nd; ++j) {
372  aTau.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[tausRef]);
373  }
374 
375  if (efficiencyLoader_.enabled()) {
376  efficiencyLoader_.setEfficiencies( aTau, tausRef );
377  }
378 
379  if (resolutionLoader_.enabled()) {
381  }
382 
383  if ( useUserData_ ) {
384  userDataHelper_.add( aTau, iEvent, iSetup );
385  }
386 
387  patTaus->push_back(aTau);
388  }
389 
390  // sort taus in pT
391  std::sort(patTaus->begin(), patTaus->end(), pTTauComparator_);
392 
393  // put genEvt object in Event
394  iEvent.put(patTaus);
395 
396  // clean up
398 }
399 
400 template <typename TauCollectionType, typename TauDiscrType>
401 float PATTauProducer::getTauIdDiscriminator(const edm::Handle<TauCollectionType>& tauCollection, size_t tauIdx, const edm::Handle<TauDiscrType>& tauIdDiscr)
402 {
403  edm::Ref<TauCollectionType> tauRef(tauCollection, tauIdx);
404  return (*tauIdDiscr)[tauRef];
405 }
406 
407 // ParameterSet description for module
409 {
411  iDesc.setComment("PAT tau producer module");
412 
413  // input source
414  iDesc.add<edm::InputTag>("tauSource", edm::InputTag())->setComment("input collection");
415 
416  // embedding
417  iDesc.add<bool>("embedIsolationTracks", false)->setComment("embed external isolation tracks");
418  iDesc.add<bool>("embedLeadTrack", false)->setComment("embed external leading track");
419  iDesc.add<bool>("embedLeadTracks", false)->setComment("embed external signal tracks");
420 
421  // MC matching configurables
422  iDesc.add<bool>("addGenMatch", true)->setComment("add MC matching");
423  iDesc.add<bool>("embedGenMatch", false)->setComment("embed MC matched MC information");
424  std::vector<edm::InputTag> emptySourceVector;
425  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("genParticleMatch", edm::InputTag(), true) xor
426  edm::ParameterDescription<std::vector<edm::InputTag> >("genParticleMatch", emptySourceVector, true)
427  )->setComment("input with MC match information");
428 
429  // MC jet matching variables
430  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC jet matching");
431  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC jet matched jet information");
432  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag("tauGenJetMatch"));
433 
434 
436 
437  // tau ID configurables
438  iDesc.add<bool>("addTauID", true)->setComment("add tau ID variables");
439  edm::ParameterSetDescription tauIDSourcesPSet;
440  tauIDSourcesPSet.setAllowAnything();
441  iDesc.addNode( edm::ParameterDescription<edm::InputTag>("tauIDSource", edm::InputTag(), true) xor
442  edm::ParameterDescription<edm::ParameterSetDescription>("tauIDSources", tauIDSourcesPSet, true)
443  )->setComment("input with electron ID variables");
444 
445  // IsoDeposit configurables
446  edm::ParameterSetDescription isoDepositsPSet;
447  isoDepositsPSet.addOptional<edm::InputTag>("tracker");
448  isoDepositsPSet.addOptional<edm::InputTag>("ecal");
449  isoDepositsPSet.addOptional<edm::InputTag>("hcal");
450  isoDepositsPSet.addOptional<edm::InputTag>("pfAllParticles");
451  isoDepositsPSet.addOptional<edm::InputTag>("pfChargedHadron");
452  isoDepositsPSet.addOptional<edm::InputTag>("pfNeutralHadron");
453  isoDepositsPSet.addOptional<edm::InputTag>("pfGamma");
454  isoDepositsPSet.addOptional<std::vector<edm::InputTag> >("user");
455  iDesc.addOptional("isoDeposits", isoDepositsPSet);
456 
457  // Efficiency configurables
458  edm::ParameterSetDescription efficienciesPSet;
459  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
460  iDesc.add("efficiencies", efficienciesPSet);
461  iDesc.add<bool>("addEfficiencies", false);
462 
463  // Check to see if the user wants to add user data
464  edm::ParameterSetDescription userDataPSet;
466  iDesc.addOptional("userData", userDataPSet);
467 
468  edm::ParameterSetDescription isolationPSet;
469  isolationPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
470  iDesc.add("userIsolation", isolationPSet);
471 
472 }
473 
475 
477 
478 
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
T getParameter(std::string const &) const
void setComment(std::string const &value)
Assists in assimilating all pat::UserData into pat objects.
int i
Definition: DBlmapReader.cc:9
std::pair< std::string, edm::InputTag > NameTag
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setIsolation(IsolationKeys key, float value)
Definition: Lepton.h:100
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
tuple pfTaus
Definition: pfTaus_cff.py:119
pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_
void setAllowAnything()
allow any parameter label/value pairs
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void embedLeadPFChargedHadrCand()
method to store the leading charged hadron candidate internally
Definition: Tau.cc:334
pat::helper::EfficiencyLoader efficiencyLoader_
bool exists(std::string const &parameterName) const
checks if a parameter exists
pat::helper::KinResolutionsLoader resolutionLoader_
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
void embedSignalPFGammaCands()
method to store the signal gamma candidates internally
Definition: Tau.cc:386
float getTauIdDiscriminator(const edm::Handle< TauCollectionType > &, size_t, const edm::Handle< TauDiscrType > &)
void embedIsolationPFCands()
method to store the isolation candidates internally
Definition: Tau.cc:397
void embedIsolationPFGammaCands()
method to store the isolation gamma candidates internally
Definition: Tau.cc:428
void setTauIDs(const std::vector< IdPair > &ids)
Definition: Tau.h:273
IsolationKeys
Enum defining isolation keys.
Definition: Isolation.h:9
void embedSignalTracks()
method to store the signal tracks internally
Definition: Tau.cc:233
edm::InputTag genJetMatchSrc_
bool isAvailable() const
Definition: Ref.h:276
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
std::vector< edm::InputTag > genMatchSrc_
bool isRealData() const
Definition: EventBase.h:60
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void setIsoDeposit(IsolationKeys key, const IsoDeposit &dep)
Sets the IsoDeposit associated with some key; if it is already existent, it is overwritten.
Definition: Lepton.h:177
bool embedIsolationPFChargedHadrCands_
void initializeJEC(unsigned int level, const unsigned int set=0)
initialize the jet to a given JEC level during creation starting from Uncorrected ...
Definition: Tau.cc:592
static void fillDescription(edm::ParameterSetDescription &iDesc)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:195
U second(std::pair< T, U > const &p)
bool enabled() const
True if it has a non null configuration.
Definition: MultiIsolator.h:50
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
void embedSignalPFChargedHadrCands()
method to store the signal charged hadrons candidates internally
Definition: Tau.cc:366
void setComment(std::string const &value)
int iEvent
Definition: GenABIO.cc:243
void embedSignalPFCands()
method to store the signal candidates internally
Definition: Tau.cc:356
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup)
pat::helper::MultiIsolator isolator_
edm::InputTag tauSrc_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
void embedGenParticle()
Definition: PATObject.h:675
bool embedIsolationPFNeutralHadrCands_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void embedLeadTrack()
method to store the leading track internally
Definition: Tau.cc:223
int j
Definition: DBlmapReader.cc:9
pat::PATUserDataHelper< pat::Tau > userDataHelper_
bool embedSignalPFNeutralHadrCands_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool first
Definition: L1TdeRCT.cc:94
Analysis-level tau class.
Definition: Tau.h:50
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
void embedIsolationPFNeutralHadrCands()
method to store the isolation neutral hadrons candidates internally
Definition: Tau.cc:418
void embedLeadPFNeutralCand()
method to store the leading neutral candidate internally
Definition: Tau.cc:345
void addGenParticleRef(const reco::GenParticleRef &ref)
Definition: PATObject.h:659
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
void embedSignalPFNeutralHadrCands()
method to store the signal neutral hadrons candidates internally
Definition: Tau.cc:376
void setDecayMode(int)
set decay mode
Definition: Tau.cc:316
std::vector< std::pair< pat::IsolationKeys, float > > IsolationValuePairs
Definition: MultiIsolator.h:16
void embedIsolationPFChargedHadrCands()
method to store the isolation charged hadrons candidates internally
Definition: Tau.cc:408
void addJECFactors(const TauJetCorrFactors &jec)
add more sets of energy correction factors
Definition: Tau.h:335
PATTauProducer(const edm::ParameterSet &iConfig)
list key
Definition: combine.py:13
bool isPFTau() const
Returns true if this pat::Tau was made from a reco::PFTau.
Definition: Tau.h:152
std::vector< edm::InputTag > tauJetCorrFactorsSrc_
void setGenJet(const reco::GenJetRef &ref)
set the matched GenJet
Definition: Tau.cc:244
void embedIsolationTracks()
method to store the isolation tracks internally
Definition: Tau.cc:212
std::vector< std::pair< pat::IsolationKeys, edm::InputTag > > isoDepositLabels_
bool embedSignalPFChargedHadrCands_
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
static const HistoName names[]
void embedLeadPFCand()
method to store the leading candidate internally
Definition: Tau.cc:323
std::vector< NameTag > tauIDSrcs_
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.
GreaterByPt< Tau > pTTauComparator_
Produces pat::Tau&#39;s.
void fill(const edm::View< T > &coll, int idx, IsolationValuePairs &isolations) const
Definition: MultiIsolator.h:82