CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PATJetProducer.cc
Go to the documentation of this file.
1 //
2 
3 
5 
8 
12 
20 
22 
25 
27 
29 
32 
34 
35 #include <vector>
36 #include <memory>
37 #include <algorithm>
38 
39 
40 using namespace pat;
41 
42 
44  useUserData_(iConfig.exists("userData"))
45 {
46  // initialize configurables
47  jetsToken_ = consumes<edm::View<reco::Jet> >(iConfig.getParameter<edm::InputTag>( "jetSource" ));
48  embedCaloTowers_ = false; // parameter is optional
49  if ( iConfig.exists("embedCaloTowers") ) {
50  embedCaloTowers_ = iConfig.getParameter<bool>( "embedCaloTowers" );
51  }
52  embedPFCandidates_ = iConfig.getParameter<bool>( "embedPFCandidates" );
53  getJetMCFlavour_ = iConfig.getParameter<bool>( "getJetMCFlavour" );
54  jetPartonMapToken_ = mayConsume<reco::JetFlavourMatchingCollection>(iConfig.getParameter<edm::InputTag>( "JetPartonMapSource" ));
55  addGenPartonMatch_ = iConfig.getParameter<bool>( "addGenPartonMatch" );
56  embedGenPartonMatch_ = iConfig.getParameter<bool>( "embedGenPartonMatch" );
57  genPartonToken_ = mayConsume<edm::Association<reco::GenParticleCollection> >(iConfig.getParameter<edm::InputTag>( "genPartonMatch" ));
58  addGenJetMatch_ = iConfig.getParameter<bool>( "addGenJetMatch" );
59  embedGenJetMatch_ = iConfig.getParameter<bool>( "embedGenJetMatch" );
60  genJetToken_ = mayConsume<edm::Association<reco::GenJetCollection> >(iConfig.getParameter<edm::InputTag>( "genJetMatch" ));
61  addPartonJetMatch_ = iConfig.getParameter<bool>( "addPartonJetMatch" );
62 // partonJetToken_ = mayConsume<reco::SomePartonJetType>(iConfig.getParameter<edm::InputTag>( "partonJetSource" ));
63  addJetCorrFactors_ = iConfig.getParameter<bool>( "addJetCorrFactors" );
64  jetCorrFactorsTokens_ = edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag> >( "jetCorrFactorsSource" ), [this](edm::InputTag const & tag){return mayConsume<edm::ValueMap<JetCorrFactors> >(tag);});
65  addBTagInfo_ = iConfig.getParameter<bool>( "addBTagInfo" );
66  addDiscriminators_ = iConfig.getParameter<bool>( "addDiscriminators" );
67  discriminatorTags_ = iConfig.getParameter<std::vector<edm::InputTag> >( "discriminatorSources" );
68  discriminatorTokens_ = edm::vector_transform(discriminatorTags_, [this](edm::InputTag const & tag){return mayConsume<reco::JetFloatAssociation::Container>(tag);});
69  addTagInfos_ = iConfig.getParameter<bool>( "addTagInfos" );
70  tagInfoTags_ = iConfig.getParameter<std::vector<edm::InputTag> >( "tagInfoSources" );
71  tagInfoTokens_ =edm::vector_transform(tagInfoTags_, [this](edm::InputTag const & tag){return mayConsume<edm::View<reco::BaseTagInfo> >(tag);});
72  addAssociatedTracks_ = iConfig.getParameter<bool>( "addAssociatedTracks" );
73  trackAssociationToken_ = mayConsume<reco::JetTracksAssociation::Container>(iConfig.getParameter<edm::InputTag>( "trackAssociationSource" ));
74  addJetCharge_ = iConfig.getParameter<bool>( "addJetCharge" );
75  jetChargeToken_ = mayConsume<reco::JetFloatAssociation::Container>(iConfig.getParameter<edm::InputTag>( "jetChargeSource" ));
76  addJetID_ = iConfig.getParameter<bool>( "addJetID");
77  jetIDMapToken_ = mayConsume<reco::JetIDValueMap>(iConfig.getParameter<edm::InputTag>( "jetIDMap"));
78  // Efficiency configurables
79  addEfficiencies_ = iConfig.getParameter<bool>("addEfficiencies");
80  if (addEfficiencies_) {
81  efficiencyLoader_ = pat::helper::EfficiencyLoader(iConfig.getParameter<edm::ParameterSet>("efficiencies"), consumesCollector());
82  }
83  // Resolution configurables
84  addResolutions_ = iConfig.getParameter<bool>("addResolutions");
85  if (addResolutions_) {
86  resolutionLoader_ = pat::helper::KinResolutionsLoader(iConfig.getParameter<edm::ParameterSet>("resolutions"));
87  }
88  if (discriminatorTags_.empty()) {
89  addDiscriminators_ = false;
90  } else {
91  for (std::vector<edm::InputTag>::const_iterator it = discriminatorTags_.begin(), ed = discriminatorTags_.end(); it != ed; ++it) {
92  std::string label = it->label();
93  std::string::size_type pos = label.find("JetTags");
94  if ((pos != std::string::npos) && (pos != label.length() - 7)) {
95  label.erase(pos+7); // trim a tail after "JetTags"
96  }
97  discriminatorLabels_.push_back(label);
98  }
99  }
100  if (tagInfoTags_.empty()) {
101  addTagInfos_ = false;
102  } else {
103  for (std::vector<edm::InputTag>::const_iterator it = tagInfoTags_.begin(), ed = tagInfoTags_.end(); it != ed; ++it) {
104  std::string label = it->label();
105  std::string::size_type pos = label.find("TagInfos");
106  if ((pos != std::string::npos) && (pos != label.length() - 8)) {
107  label.erase(pos+8); // trim a tail after "TagInfos"
108  }
109  tagInfoLabels_.push_back(label);
110  }
111  }
112  if (!addBTagInfo_) { addDiscriminators_ = false; addTagInfos_ = false; }
113  // Check to see if the user wants to add user data
114  if ( useUserData_ ) {
115  userDataHelper_ = PATUserDataHelper<Jet>(iConfig.getParameter<edm::ParameterSet>("userData"), consumesCollector());
116  }
117  // produces vector of jets
118  produces<std::vector<Jet> >();
119  produces<reco::GenJetCollection> ("genJets");
120  produces<std::vector<CaloTower> > ("caloTowers");
121  produces<reco::PFCandidateCollection > ("pfCandidates");
122  produces<edm::OwnVector<reco::BaseTagInfo> > ("tagInfos");
123 }
124 
125 
126 PATJetProducer::~PATJetProducer() {
127 
128 }
129 
130 
132 {
133  // check whether dealing with MC or real data
134  if (iEvent.isRealData()){
135  getJetMCFlavour_ = false;
136  addGenPartonMatch_ = false;
137  addGenJetMatch_ = false;
138  addPartonJetMatch_ = false;
139  }
140 
141  // Get the vector of jets
143  iEvent.getByToken(jetsToken_, jets);
144 
146  if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup);
147 
148  // for jet flavour
150  if (getJetMCFlavour_) iEvent.getByToken (jetPartonMapToken_, jetFlavMatch);
151 
152  // Get the vector of generated particles from the event if needed
154  if (addGenPartonMatch_) iEvent.getByToken(genPartonToken_, partonMatch);
155  // Get the vector of GenJets from the event if needed
157  if (addGenJetMatch_) iEvent.getByToken(genJetToken_, genJetMatch);
158 /* TO BE IMPLEMENTED FOR >= 1_5_X
159  // Get the vector of PartonJets from the event if needed
160  edm::Handle<edm::View<reco::SomePartonJetType> > partonJets;
161  if (addPartonJetMatch_) iEvent.getByToken(partonJetToken_, partonJets);
162 */
163 
164  // read in the jet correction factors ValueMap
165  std::vector<edm::ValueMap<JetCorrFactors> > jetCorrs;
166  if (addJetCorrFactors_) {
167  for ( size_t i = 0; i < jetCorrFactorsTokens_.size(); ++i ) {
169  iEvent.getByToken(jetCorrFactorsTokens_[i], jetCorr);
170  jetCorrs.push_back( *jetCorr );
171  }
172  }
173 
174  // Get the vector of jet tags with b-tagging info
175  std::vector<edm::Handle<reco::JetFloatAssociation::Container> > jetDiscriminators;
177  jetDiscriminators.resize(discriminatorTokens_.size());
178  for (size_t i = 0; i < discriminatorTokens_.size(); ++i) {
179  iEvent.getByToken(discriminatorTokens_[i], jetDiscriminators[i]);
180  }
181  }
182  std::vector<edm::Handle<edm::View<reco::BaseTagInfo> > > jetTagInfos;
183  if (addBTagInfo_ && addTagInfos_) {
184  jetTagInfos.resize(tagInfoTokens_.size());
185  for (size_t i = 0; i < tagInfoTokens_.size(); ++i) {
186  iEvent.getByToken(tagInfoTokens_[i], jetTagInfos[i]);
187  }
188  }
189 
190  // tracks Jet Track Association
194  if (addJetCharge_) iEvent.getByToken(jetChargeToken_, hJetChargeAss);
195 
196  // jet ID handle
198  if ( addJetID_ ) iEvent.getByToken( jetIDMapToken_, hJetIDMap );
199 
200  // loop over jets
201  std::auto_ptr< std::vector<Jet> > patJets ( new std::vector<Jet>() );
202 
203  std::auto_ptr<reco::GenJetCollection > genJetsOut ( new reco::GenJetCollection() );
204  std::auto_ptr<std::vector<CaloTower> > caloTowersOut( new std::vector<CaloTower> () );
205  std::auto_ptr<reco::PFCandidateCollection > pfCandidatesOut( new reco::PFCandidateCollection() );
206  std::auto_ptr<edm::OwnVector<reco::BaseTagInfo> > tagInfosOut ( new edm::OwnVector<reco::BaseTagInfo>() );
207 
208 
210  edm::RefProd<std::vector<CaloTower> > h_caloTowersOut = iEvent.getRefBeforePut<std::vector<CaloTower> > ( "caloTowers" );
211  edm::RefProd<reco::PFCandidateCollection > h_pfCandidatesOut = iEvent.getRefBeforePut<reco::PFCandidateCollection > ( "pfCandidates" );
213 
214  bool first=true; // this is introduced to issue warnings only for the first jet
215  for (edm::View<reco::Jet>::const_iterator itJet = jets->begin(); itJet != jets->end(); itJet++) {
216 
217  // construct the Jet from the ref -> save ref to original object
218  unsigned int idx = itJet - jets->begin();
219  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
220  edm::Ptr<reco::Jet> jetPtr = jets->ptrAt(idx);
221  Jet ajet(jetRef);
222 
223  // add the FwdPtrs to the CaloTowers
224  if ( (ajet.isCaloJet() || ajet.isJPTJet() ) && embedCaloTowers_) {
225  const reco::CaloJet *cj = 0;
226  const reco::JPTJet * jptj = 0;
227  if ( ajet.isCaloJet()) cj = dynamic_cast<const reco::CaloJet *>(jetRef.get());
228  else {
229  jptj = dynamic_cast<const reco::JPTJet *>(jetRef.get() );
230  cj = dynamic_cast<const reco::CaloJet *>(jptj->getCaloJetRef().get() );
231  }
233  std::vector< CaloTowerPtr > itowers = cj->getCaloConstituents();
234  for ( std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(), towEnd = itowers.end(), itow = towBegin; itow != towEnd; ++itow ) {
235  if( itow->isAvailable() && itow->isNonnull() ){
236  caloTowersOut->push_back( **itow );
237  // set the "forward" ref to the thinned collection
238  edm::Ref<std::vector<CaloTower> > caloTowerRef( h_caloTowersOut, caloTowersOut->size() - 1);
239  edm::Ptr<CaloTower> caloForwardRef ( h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter() );
240  // set the "backward" ref to the original collection for association
241  edm::Ptr<CaloTower> caloBackRef ( *itow );
242  // add to the list of FwdPtr's
243  itowersRef.push_back( pat::CaloTowerFwdPtrCollection::value_type ( caloForwardRef, caloBackRef ) );
244  }
245  }
246  ajet.setCaloTowers( itowersRef );
247  }
248 
249  // add the FwdPtrs to the PFCandidates
250  if (ajet.isPFJet() && embedPFCandidates_) {
251  const reco::PFJet *cj = dynamic_cast<const reco::PFJet *>(jetRef.get());
252  pat::PFCandidateFwdPtrCollection iparticlesRef;
253  std::vector< reco::PFCandidatePtr > iparticles = cj->getPFConstituents();
254  for ( std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
255  partEnd = iparticles.end(), ipart = partBegin;
256  ipart != partEnd; ++ipart ) {
257  pfCandidatesOut->push_back( **ipart );
258  // set the "forward" ref to the thinned collection
259  edm::Ref<reco::PFCandidateCollection> pfCollectionRef( h_pfCandidatesOut, pfCandidatesOut->size() - 1);
260  edm::Ptr<reco::PFCandidate> pfForwardRef ( h_pfCandidatesOut.id(), pfCollectionRef.key(), h_pfCandidatesOut.productGetter() );
261  // set the "backward" ref to the original collection for association
262  edm::Ptr<reco::PFCandidate> pfBackRef ( *ipart );
263  // add to the list of FwdPtr's
264  iparticlesRef.push_back( pat::PFCandidateFwdPtrCollection::value_type ( pfForwardRef, pfBackRef ) );
265  }
266  ajet.setPFCandidates( iparticlesRef );
267  }
268 
269  if (addJetCorrFactors_) {
270  // add additional JetCorrs to the jet
271  for ( unsigned int i=0; i<jetCorrFactorsTokens_.size(); ++i ) {
272  const JetCorrFactors& jcf = jetCorrs[i][jetRef];
273  // uncomment for debugging
274  // jcf.print();
275  ajet.addJECFactors(jcf);
276  }
277  std::vector<std::string> levels = jetCorrs[0][jetRef].correctionLabels();
278  if(std::find(levels.begin(), levels.end(), "L2L3Residual")!=levels.end()){
279  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("L2L3Residual"));
280  }
281  else if(std::find(levels.begin(), levels.end(), "L3Absolute")!=levels.end()){
282  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("L3Absolute"));
283  }
284  else{
285  ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel("Uncorrected"));
286  if(first){
287  edm::LogWarning("L3Absolute not found") << "L2L3Residual and L3Absolute are not part of the correction applied jetCorrFactors \n"
288  << "of module " << jetCorrs[0][jetRef].jecSet() << " jets will remain"
289  << " uncorrected."; first=false;
290  }
291  }
292  }
293 
294  // get the MC flavour information for this jet
295  if (getJetMCFlavour_) {
296  ajet.setPartonFlavour( (*jetFlavMatch)[edm::RefToBase<reco::Jet>(jetRef)].getFlavour() );
297  }
298  // store the match to the generated partons
299  if (addGenPartonMatch_) {
300  reco::GenParticleRef parton = (*partonMatch)[jetRef];
301  if (parton.isNonnull() && parton.isAvailable()) {
302  ajet.setGenParton(parton, embedGenPartonMatch_);
303  } // leave empty if no match found
304  }
305  // store the match to the GenJets
306  if (addGenJetMatch_) {
307  reco::GenJetRef genjet = (*genJetMatch)[jetRef];
308  if (genjet.isNonnull() && genjet.isAvailable()) {
309  genJetsOut->push_back( *genjet );
310  // set the "forward" ref to the thinned collection
311  edm::Ref<reco::GenJetCollection > genForwardRef ( h_genJetsOut, genJetsOut->size() - 1 );
312  // set the "backward" ref to the original collection
313  edm::Ref<reco::GenJetCollection > genBackRef ( genjet );
314  // make the FwdPtr
315  edm::FwdRef<reco::GenJetCollection > genjetFwdRef ( genForwardRef, genBackRef );
316  ajet.setGenJetRef(genjetFwdRef );
317  } // leave empty if no match found
318  }
319 
320  if (efficiencyLoader_.enabled()) {
321  efficiencyLoader_.setEfficiencies( ajet, jetRef );
322  }
323 
324  // IMPORTANT: DO THIS AFTER JES CORRECTIONS
325  if (resolutionLoader_.enabled()) {
327  }
328 
329  // TO BE IMPLEMENTED FOR >=1_5_X: do the PartonJet matching
330  if (addPartonJetMatch_) {
331  }
332 
333  // add b-tag info if available & required
334  if (addBTagInfo_) {
335  if (addDiscriminators_) {
336  for (size_t k=0; k<jetDiscriminators.size(); ++k) {
337  float value = (*jetDiscriminators[k])[jetRef];
338  ajet.addBDiscriminatorPair(std::make_pair(discriminatorLabels_[k], value));
339  }
340  }
341  if (addTagInfos_) {
342  for (size_t k=0; k<jetTagInfos.size(); ++k) {
343  const edm::View<reco::BaseTagInfo> & taginfos = *jetTagInfos[k];
344  // This is not associative, so we have to search the jet
346  // Try first by 'same index'
347  if ((idx < taginfos.size()) && (taginfos[idx].jet() == jetRef)) {
348  match = taginfos.ptrAt(idx);
349  } else {
350  // otherwise fail back to a simple search
351  for (edm::View<reco::BaseTagInfo>::const_iterator itTI = taginfos.begin(), edTI = taginfos.end(); itTI != edTI; ++itTI) {
352  if (itTI->jet() == jetRef) { match = taginfos.ptrAt( itTI - taginfos.begin() ); break; }
353  }
354  }
355  if (match.isNonnull()) {
356  tagInfosOut->push_back( match->clone() );
357  // set the "forward" ptr to the thinned collection
358  edm::Ptr<reco::BaseTagInfo> tagInfoForwardPtr ( h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1 );
359  // set the "backward" ptr to the original collection for association
360  edm::Ptr<reco::BaseTagInfo> tagInfoBackPtr ( match );
361  // make FwdPtr
362  TagInfoFwdPtrCollection::value_type tagInfoFwdPtr( tagInfoForwardPtr, tagInfoBackPtr ) ;
363  ajet.addTagInfo(tagInfoLabels_[k], tagInfoFwdPtr );
364  }
365  }
366  }
367  }
368 
369  if (addAssociatedTracks_) ajet.setAssociatedTracks( (*hTrackAss)[jetRef] );
370 
371  if (addJetCharge_) ajet.setJetCharge( (*hJetChargeAss)[jetRef] );
372 
373  // add jet ID for calo jets
374  if (addJetID_ && ajet.isCaloJet() ) {
375  reco::JetID jetId = (*hJetIDMap)[ jetRef ];
376  ajet.setJetID( jetId );
377  }
378  // add jet ID jpt jets
379  else if ( addJetID_ && ajet.isJPTJet() ){
380  const reco::JPTJet *jptj = dynamic_cast<const reco::JPTJet *>(jetRef.get());
381  reco::JetID jetId = (*hJetIDMap)[ jptj->getCaloJetRef() ];
382  ajet.setJetID( jetId );
383  }
384  if ( useUserData_ ) {
385  userDataHelper_.add( ajet, iEvent, iSetup );
386  }
387  patJets->push_back(ajet);
388  }
389 
390  // sort jets in pt
391  std::sort(patJets->begin(), patJets->end(), pTComparator_);
392 
393  // put genEvt in Event
394  iEvent.put(patJets);
395 
396  iEvent.put( genJetsOut, "genJets" );
397  iEvent.put( caloTowersOut, "caloTowers" );
398  iEvent.put( pfCandidatesOut, "pfCandidates" );
399  iEvent.put( tagInfosOut, "tagInfos" );
400 
401 
402 }
403 
404 // ParameterSet description for module
406 {
408  iDesc.setComment("PAT jet producer module");
409 
410  // input source
411  iDesc.add<edm::InputTag>("jetSource", edm::InputTag("no default"))->setComment("input collection");
412 
413  // embedding
414  iDesc.addOptional<bool>("embedCaloTowers", false)->setComment("embed external CaloTowers (not to be used on AOD input)");
415  iDesc.add<bool>("embedPFCandidates", true)->setComment("embed external PFCandidates");
416 
417  // MC matching configurables
418  iDesc.add<bool>("addGenPartonMatch", true)->setComment("add MC matching");
419  iDesc.add<bool>("embedGenPartonMatch", false)->setComment("embed MC matched MC information");
420  iDesc.add<edm::InputTag>("genPartonMatch", edm::InputTag())->setComment("input with MC match information");
421 
422  iDesc.add<bool>("addGenJetMatch", true)->setComment("add MC matching");
423  iDesc.add<bool>("embedGenJetMatch", false)->setComment("embed MC matched MC information");
424  iDesc.add<edm::InputTag>("genJetMatch", edm::InputTag())->setComment("input with MC match information");
425 
426  iDesc.add<bool>("addJetCharge", true);
427  iDesc.add<edm::InputTag>("jetChargeSource", edm::InputTag("patJetCharge"));
428 
429  // jet id
430  iDesc.add<bool>("addJetID", true)->setComment("Add jet ID information");
431  iDesc.add<edm::InputTag>("jetIDMap", edm::InputTag())->setComment("jet id map");
432 
433  iDesc.add<bool>("addPartonJetMatch", false);
434  iDesc.add<edm::InputTag>("partonJetSource", edm::InputTag("NOT IMPLEMENTED"));
435 
436  // track association
437  iDesc.add<bool>("addAssociatedTracks", true);
438  iDesc.add<edm::InputTag>("trackAssociationSource", edm::InputTag("ic5JetTracksAssociatorAtVertex"));
439 
440  // tag info
441  iDesc.add<bool>("addTagInfos", true);
442  std::vector<edm::InputTag> emptyVInputTags;
443  iDesc.add<std::vector<edm::InputTag> >("tagInfoSources", emptyVInputTags);
444 
445  // jet energy corrections
446  iDesc.add<bool>("addJetCorrFactors", true);
447  iDesc.add<std::vector<edm::InputTag> >("jetCorrFactorsSource", emptyVInputTags);
448 
449  // btag discriminator tags
450  iDesc.add<bool>("addBTagInfo",true);
451  iDesc.add<bool>("addDiscriminators", true);
452  iDesc.add<std::vector<edm::InputTag> >("discriminatorSources", emptyVInputTags);
453 
454  // jet flavour idetification configurables
455  iDesc.add<bool>("getJetMCFlavour", true);
456  iDesc.add<edm::InputTag>("JetPartonMapSource", edm::InputTag("jetFlavourAssociation"));
457 
459 
460  // Efficiency configurables
461  edm::ParameterSetDescription efficienciesPSet;
462  efficienciesPSet.setAllowAnything(); // TODO: the pat helper needs to implement a description.
463  iDesc.add("efficiencies", efficienciesPSet);
464  iDesc.add<bool>("addEfficiencies", false);
465 
466  // Check to see if the user wants to add user data
467  edm::ParameterSetDescription userDataPSet;
469  iDesc.addOptional("userData", userDataPSet);
470 
471  descriptions.add("PATJetProducer", iDesc);
472 }
473 
475 
477 
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
void setJetID(reco::JetID const &id)
methods for jet ID
Definition: Jet.h:216
T getParameter(std::string const &) const
pat::helper::EfficiencyLoader efficiencyLoader_
Assists in assimilating all pat::UserData into pat objects.
void setGenParton(const reco::GenParticleRef &gp, bool embed=false)
method to set the matched parton
Definition: Jet.h:208
void setGenJetRef(const edm::FwdRef< reco::GenJetCollection > &gj)
method to set the matched generated jet reference, embedding if requested
Definition: Jet.cc:414
int i
Definition: DBlmapReader.cc:9
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void addJECFactors(const JetCorrFactors &jec)
add more sets of energy correction factors
Definition: Jet.h:154
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
edm::EDGetTokenT< reco::JetTracksAssociation::Container > trackAssociationToken_
Jets made from CaloTowers.
Definition: CaloJet.h:29
std::vector< std::string > tagInfoLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void setAllowAnything()
allow any parameter label/value pairs
pat::helper::KinResolutionsLoader resolutionLoader_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< std::string > discriminatorLabels_
bool exists(std::string const &parameterName) const
checks if a parameter exists
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:130
void setCaloTowers(const CaloTowerFwdPtrCollection &caloTowers)
method to store the CaloJet constituents internally
Definition: Jet.cc:392
bool isAvailable() const
Definition: Ref.h:276
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
Jet ID object.
Definition: JetID.h:16
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:93
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
uint16_t size_type
bool isRealData() const
Definition: EventBase.h:60
Jets made from PFObjects.
Definition: PFJet.h:21
GreaterByPt< Jet > pTComparator_
void addTagInfo(const std::string &label, const TagInfoFwdPtrCollection::value_type &info)
Definition: Jet.cc:363
bool enabled() const
&#39;true&#39; if this there is at least one efficiency configured
static void fillDescription(edm::ParameterSetDescription &iDesc)
PATJetProducer(const edm::ParameterSet &iConfig)
bool isCaloJet() const
check to see if the jet is a reco::CaloJet
Definition: Jet.h:221
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
void setComment(std::string const &value)
Ptr< value_type > ptrAt(size_type i) const
void setAssociatedTracks(const reco::TrackRefVector &tracks)
method to set the vector of refs to the tracks associated to this jet
Definition: Jet.cc:387
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
int iEvent
Definition: GenABIO.cc:243
void initializeJEC(unsigned int level, const JetCorrFactors::Flavor &flavor=JetCorrFactors::NONE, unsigned int set=0)
initialize the jet to a given JEC level during creation starting from Uncorrected ...
Definition: Jet.cc:198
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
Class for the storage of jet correction factors.
vector< PseudoJet > jets
edm::EDGetTokenT< reco::JetIDValueMap > jetIDMapToken_
Produces pat::Jet&#39;s.
void setPartonFlavour(int partonFl)
method to set the flavour of the parton underlying the jet
Definition: Jet.cc:422
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool first
Definition: L1TdeRCT.cc:79
Container::value_type value_type
RefProd< PROD > getRefBeforePut()
Definition: Event.h:128
bool isPFJet() const
check to see if the jet is a reco::PFJet
Definition: Jet.h:225
int k[5][pyjets_maxn]
bool isJPTJet() const
check to see if the jet is a reco::JPTJet
Definition: Jet.h:223
pat::PATUserDataHelper< pat::Jet > userDataHelper_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
void setJetCharge(float jetCharge)
method to set the jet charge
Definition: Jet.cc:432
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > jetPartonMapToken_
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
Definition: Jet.h:67
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
Definition: Jet.h:66
void addBDiscriminatorPair(const std::pair< std::string, float > &thePair)
method to add a algolabel-discriminator pair
Definition: Jet.cc:427
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
size_type size() const
Analysis-level calorimeter jet class.
Definition: Jet.h:70
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetToken_
std::vector< edm::EDGetTokenT< reco::JetFloatAssociation::Container > > discriminatorTokens_
void setPFCandidates(const PFCandidateFwdPtrCollection &pfCandidates)
method to store the PFCandidate constituents internally
Definition: Jet.cc:403
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genPartonToken_
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
Definition: PFJet.cc:52
const_iterator begin() const
const_iterator end() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
value_type const * get() const
Definition: RefToBase.h:212
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.