CMS 3D CMS Logo

Jet.cc
Go to the documentation of this file.
1 //
2 //
3 
8 
9 using namespace pat;
10 
12 Jet::Jet() :
13  PATObject<reco::Jet>(reco::Jet()),
14  embeddedCaloTowers_(false),
15  embeddedPFCandidates_(false),
16  jetCharge_(0.)
17 {
18 }
19 
21 Jet::Jet(const reco::Jet & aJet) :
22  PATObject<reco::Jet>(aJet),
23  embeddedCaloTowers_(false),
24  embeddedPFCandidates_(false),
25  jetCharge_(0.0)
26 {
27  tryImportSpecific(aJet);
28 }
29 
31 Jet::Jet(const edm::Ptr<reco::Jet> & aJetRef) :
32  PATObject<reco::Jet>(aJetRef),
33  embeddedCaloTowers_(false),
34  embeddedPFCandidates_(false),
35  jetCharge_(0.0)
36 {
37  tryImportSpecific(*aJetRef);
38 }
39 
41 Jet::Jet(const edm::RefToBase<reco::Jet> & aJetRef) :
42  PATObject<reco::Jet>(aJetRef),
43  embeddedCaloTowers_(false),
44  embeddedPFCandidates_(false),
45  jetCharge_(0.0)
46 {
47  tryImportSpecific(*aJetRef);
48 }
49 
51 Jet::Jet(const edm::RefToBase<pat::Jet> & aJetRef) :
52  Jet(*aJetRef)
53 {
54  refToOrig_ = edm::Ptr<reco::Candidate>(aJetRef.id(), aJetRef.get(), aJetRef.key());
55 }
56 
58 Jet::Jet(const edm::Ptr<pat::Jet> & aJetRef) :
59  Jet(*aJetRef)
60 {
61  refToOrig_ = aJetRef;
62 }
63 
64 std::ostream&
65 reco::operator<<(std::ostream& out, const pat::Jet& obj)
66 {
67  if(!out) return out;
68 
69  out << "\tpat::Jet: ";
70  out << std::setiosflags(std::ios::right);
71  out << std::setiosflags(std::ios::fixed);
72  out << std::setprecision(3);
73  out << " E/pT/eta/phi "
74  << obj.energy()<<"/"
75  << obj.pt()<<"/"
76  << obj.eta()<<"/"
77  << obj.phi();
78  return out;
79 }
80 
82 void Jet::tryImportSpecific(const reco::Jet& source)
83 {
84  const std::type_info & type = typeid(source);
85  if( type == typeid(reco::CaloJet) ){
86  specificCalo_.push_back( (static_cast<const reco::CaloJet&>(source)).getSpecific() );
87  } else if( type == typeid(reco::JPTJet) ){
88  reco::JPTJet const & jptJet = static_cast<reco::JPTJet const &>(source);
89  specificJPT_.push_back( jptJet.getSpecific() );
90  reco::CaloJet const * caloJet = nullptr;
91  if ( jptJet.getCaloJetRef().isNonnull() && jptJet.getCaloJetRef().isAvailable() ) {
92  caloJet = dynamic_cast<reco::CaloJet const *>( jptJet.getCaloJetRef().get() );
93  }
94  if ( caloJet != nullptr ) {
95  specificCalo_.push_back( caloJet->getSpecific() );
96  }
97  else {
98  edm::LogWarning("OptionalProductNotFound") << " in pat::Jet, Attempted to add Calo Specifics to JPT Jets, but failed."
99  << " Jet ID for JPT Jets will not be available for you." << std::endl;
100  }
101  } else if( type == typeid(reco::PFJet) ){
102  specificPF_.push_back( (static_cast<const reco::PFJet&>(source)).getSpecific() );
103  }
104 }
105 
107 Jet::~Jet() {
108 }
109 
111 
112 CaloTowerPtr Jet::getCaloConstituent (unsigned fIndex) const {
113  if (embeddedCaloTowers_) {
114  // Refactorized PAT access
115  if ( !caloTowersFwdPtr_.empty() ) {
116  return (fIndex < caloTowersFwdPtr_.size() ?
117  caloTowersFwdPtr_[fIndex].ptr() : CaloTowerPtr());
118  }
119  // Compatibility PAT access
120  else {
121  if ( !caloTowers_.empty() ) {
122  return (fIndex < caloTowers_.size() ?
123  CaloTowerPtr(&caloTowers_, fIndex) : CaloTowerPtr());
124 
125  }
126  }
127  }
128  // Non-embedded access
129  else {
130  Constituent dau = daughterPtr (fIndex);
131  const CaloTower* caloTower = dynamic_cast <const CaloTower*> (dau.get());
132  if (caloTower != nullptr) {
133  return CaloTowerPtr(dau.id(), caloTower, dau.key() );
134  }
135  else {
136  throw cms::Exception("Invalid Constituent") << "CaloJet constituent is not of CaloTower type";
137  }
138 
139  }
140 
141  return CaloTowerPtr ();
142 }
143 
144 
145 
146 std::vector<CaloTowerPtr> const & Jet::getCaloConstituents () const {
147  if ( !caloTowersTemp_.isSet() || !caloTowers_.empty() ) cacheCaloTowers();
148  return *caloTowersTemp_;
149 }
150 
151 
153 
154 reco::PFCandidatePtr Jet::getPFConstituent (unsigned fIndex) const {
155  if (embeddedPFCandidates_) {
156  // Refactorized PAT access
157  if ( !pfCandidatesFwdPtr_.empty() ) {
158  return (fIndex < pfCandidatesFwdPtr_.size() ?
159  pfCandidatesFwdPtr_[fIndex].ptr() : reco::PFCandidatePtr());
160  }
161  // Compatibility PAT access
162  else {
163  if ( !pfCandidates_.empty() ) {
164  return (fIndex < pfCandidates_.size() ?
165  reco::PFCandidatePtr(&pfCandidates_, fIndex) : reco::PFCandidatePtr());
166 
167  }
168  }
169  }
170  // Non-embedded access
171  else {
172  Constituent dau = daughterPtr (fIndex);
173  const reco::PFCandidate* pfCandidate = dynamic_cast <const reco::PFCandidate*> (dau.get());
174  if (pfCandidate) {
175  return reco::PFCandidatePtr(dau.id(), pfCandidate, dau.key() );
176  }
177  else {
178  throw cms::Exception("Invalid Constituent") << "PFJet constituent is not of PFCandidate type";
179  }
180 
181  }
182 
183  return reco::PFCandidatePtr ();
184 }
185 
186 std::vector<reco::PFCandidatePtr> const & Jet::getPFConstituents () const {
187  if ( !pfCandidatesTemp_.isSet() || !pfCandidates_.empty() ) cachePFCandidates();
188  return *pfCandidatesTemp_;
189 }
190 
191 const reco::Candidate * Jet::daughter(size_t i) const {
192  if (isCaloJet() || isJPTJet() ) {
193  if ( embeddedCaloTowers_ ) {
194  if ( !caloTowersFwdPtr_.empty() ) return caloTowersFwdPtr_[i].get();
195  else if ( !caloTowers_.empty() ) return &caloTowers_[i];
196  else return reco::Jet::daughter(i);
197  }
198  }
199  if (isPFJet()) {
200  if ( embeddedPFCandidates_ ) {
201  if ( !pfCandidatesFwdPtr_.empty() ) return pfCandidatesFwdPtr_[i].get();
202  else if ( !pfCandidates_.empty() ) return &pfCandidates_[i];
203  else return reco::Jet::daughter(i);
204  }
205  }
206  if ( !subjetCollections_.empty() ) {
207  if ( !daughtersTemp_.isSet() ) cacheDaughters();
208  return daughtersTemp_->at(i).get();
209  }
210  return reco::Jet::daughter(i);
211 }
212 
213 reco::CandidatePtr Jet::daughterPtr( size_t i ) const {
214  if ( !subjetCollections_.empty() ) {
215  if ( !daughtersTemp_.isSet() ) cacheDaughters();
216  return daughtersTemp_->at(i);
217  }
218  return reco::Jet::daughterPtr(i);
219 }
220 
222  if ( !subjetCollections_.empty() ) {
223  if ( !daughtersTemp_.isSet() ) cacheDaughters();
224  return *daughtersTemp_;
225  }
227 }
228 
229 size_t Jet::numberOfDaughters() const {
230  if (isCaloJet() || isJPTJet()) {
231  if ( embeddedCaloTowers_ ) {
232  if ( !caloTowersFwdPtr_.empty() ) return caloTowersFwdPtr_.size();
233  else if ( !caloTowers_.empty() ) return caloTowers_.size();
234  else return reco::Jet::numberOfDaughters();
235  }
236  }
237  if (isPFJet()) {
238  if ( embeddedPFCandidates_ ) {
239  if ( !pfCandidatesFwdPtr_.empty() ) return pfCandidatesFwdPtr_.size();
240  else if ( !pfCandidates_.empty() ) return pfCandidates_.size();
241  else return reco::Jet::numberOfDaughters();
242  }
243  }
244  if ( !subjetCollections_.empty() ) {
245  if ( !daughtersTemp_.isSet() ) cacheDaughters();
246  return daughtersTemp_->size();
247  }
249 }
250 
252 const reco::GenJet * Jet::genJet() const {
253  if (!genJet_.empty()) return &(genJet_.front());
254  else if ( !genJetRef_.empty() ) return genJetRef_[0].get();
255  else return genJetFwdRef_.get();
256 }
257 
259 int Jet::partonFlavour() const {
260  return jetFlavourInfo_.getPartonFlavour();
261 }
262 
264 int Jet::hadronFlavour() const {
265  return jetFlavourInfo_.getHadronFlavour();
266 }
267 
269 const reco::JetFlavourInfo & Jet::jetFlavourInfo() const {
270  return jetFlavourInfo_;
271 }
272 
274 
275 // initialize the jet to a given JEC level during creation starting from Uncorrected
276 void Jet::initializeJEC(unsigned int level, const JetCorrFactors::Flavor& flavor, unsigned int set)
277 {
278  currentJECSet(set);
279  currentJECLevel(level);
280  currentJECFlavor(flavor);
281  setP4(jec_[set].correction(level, flavor)*p4());
282 }
283 
285 int Jet::jecSet(const std::string& set) const
286 {
287  for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=jec_.begin(); corrFactor!=jec_.end(); ++corrFactor)
288  if( corrFactor->jecSet()==set ){ return (corrFactor-jec_.begin()); }
289  return -1;
290 }
291 
293 const std::vector<std::string> Jet::availableJECSets() const
294 {
295  std::vector<std::string> sets;
296  for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=jec_.begin(); corrFactor!=jec_.end(); ++corrFactor)
297  sets.push_back(corrFactor->jecSet());
298  return sets;
299 }
300 
301 const std::vector<std::string> Jet::availableJECLevels(const int& set) const
302 {
303  return set>=0 ? jec_.at(set).correctionLabels() : std::vector<std::string>();
304 }
305 
308 float Jet::jecFactor(const std::string& level, const std::string& flavor, const std::string& set) const
309 {
310  for(unsigned int idx=0; idx<jec_.size(); ++idx){
311  if(set.empty() || jec_.at(idx).jecSet()==set){
312  if(jec_[idx].jecLevel(level)>=0){
313  return jecFactor(jec_[idx].jecLevel(level), jec_[idx].jecFlavor(flavor), idx);
314  }
315  else{
316  throw cms::Exception("InvalidRequest") << "This JEC level " << level << " does not exist. \n";
317  }
318  }
319  }
320  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n"
321  << "for a jet energy correction set with label " << set << "\n";
322 }
323 
326 float Jet::jecFactor(const unsigned int& level, const JetCorrFactors::Flavor& flavor, const unsigned int& set) const
327 {
328  if(!jecSetsAvailable()){
329  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n";
330  }
331  if(!jecSetAvailable(set)){
332  throw cms::Exception("InvalidRequest") << "This jet does not carry any jet energy correction factor information \n"
333  << "for a jet energy correction set with index " << set << "\n";
334  }
335  return jec_.at(set).correction(level, flavor)/jec_.at(currentJECSet_).correction(currentJECLevel_, currentJECFlavor_);
336 }
337 
340 Jet Jet::correctedJet(const std::string& level, const std::string& flavor, const std::string& set) const
341 {
342  // rescale p4 of the jet; the update of current values is
343  // done within the called jecFactor function
344  for(unsigned int idx=0; idx<jec_.size(); ++idx){
345  if(set.empty() || jec_.at(idx).jecSet()==set){
346  if(jec_[idx].jecLevel(level)>=0){
347  return correctedJet(jec_[idx].jecLevel(level), jec_[idx].jecFlavor(flavor), idx);
348  }
349  else{
350  throw cms::Exception("InvalidRequest") << "This JEC level " << level << " does not exist. \n";
351  }
352  }
353  }
354  throw cms::Exception("InvalidRequest") << "This JEC set " << set << " does not exist. \n";
355 }
356 
359 Jet Jet::correctedJet(const unsigned int& level, const JetCorrFactors::Flavor& flavor, const unsigned int& set) const
360 {
361  Jet correctedJet(*this);
362  //rescale p4 of the jet
363  correctedJet.setP4(jecFactor(level, flavor, set)*p4());
364  // update current level, flavor and set
365  correctedJet.currentJECSet(set); correctedJet.currentJECLevel(level); correctedJet.currentJECFlavor(flavor);
366  return correctedJet;
367 }
368 
369 
371 
372 const std::vector<std::pair<std::string, float> > & Jet::getPairDiscri() const {
373  return pairDiscriVector_;
374 }
375 
377 float Jet::bDiscriminator(const std::string & aLabel) const {
378  float discriminator = -1000.;
379  for(int i=(int(pairDiscriVector_.size())-1); i>=0; i--){
380  if(pairDiscriVector_[i].first == aLabel){
381  discriminator = pairDiscriVector_[i].second;
382  break;
383  }
384  }
385  return discriminator;
386 }
387 
388 const reco::BaseTagInfo * Jet::tagInfo(const std::string &label) const {
389  for(int i=(int(tagInfoLabels_.size())-1); i>=0; i--){
390  if (tagInfoLabels_[i] == label) {
391  if ( !tagInfosFwdPtr_.empty() ) return tagInfosFwdPtr_[i].get();
392  else if ( !tagInfos_.empty() ) return & tagInfos_[i];
393  return nullptr;
394  }
395  }
396  return nullptr;
397 }
398 
399 
400 const reco::CandIPTagInfo *
401 Jet::tagInfoCandIP(const std::string &label) const {
402  return tagInfoByTypeOrLabel<reco::CandIPTagInfo>(label);
403 }
404 
405 const reco::TrackIPTagInfo *
406 Jet::tagInfoTrackIP(const std::string &label) const {
407  return tagInfoByTypeOrLabel<reco::TrackIPTagInfo>(label);
408 }
409 
411 Jet::tagInfoCandSoftLepton(const std::string &label) const {
412  return tagInfoByTypeOrLabel<reco::CandSoftLeptonTagInfo>(label);
413 }
414 
416 Jet::tagInfoSoftLepton(const std::string &label) const {
417  return tagInfoByTypeOrLabel<reco::SoftLeptonTagInfo>(label);
418 }
419 
421 Jet::tagInfoCandSecondaryVertex(const std::string &label) const {
422  return tagInfoByTypeOrLabel<reco::CandSecondaryVertexTagInfo>(label);
423 }
424 
426 Jet::tagInfoSecondaryVertex(const std::string &label) const {
427  return tagInfoByTypeOrLabel<reco::SecondaryVertexTagInfo>(label);
428 }
429 
431 Jet::tagInfoBoostedDoubleSV(const std::string &label) const {
432  return tagInfoByTypeOrLabel<reco::BoostedDoubleSVTagInfo>(label);
433 }
434 
435 void
436 Jet::addTagInfo(const std::string &label,
438  std::string::size_type idx = label.find("TagInfos");
439  if (idx == std::string::npos) {
440  tagInfoLabels_.push_back(label);
441  } else {
442  tagInfoLabels_.push_back(label.substr(0,idx));
443  }
444  tagInfosFwdPtr_.push_back(info);
445 }
446 
447 
448 
450 float Jet::jetCharge() const {
451  return jetCharge_;
452 }
453 
455 const reco::TrackRefVector & Jet::associatedTracks() const {
456  return associatedTracks_;
457 }
458 
460 void Jet::setAssociatedTracks(const reco::TrackRefVector &tracks) {
461  associatedTracks_ = tracks;
462 }
463 
465 void Jet::setCaloTowers(const CaloTowerFwdPtrCollection & caloTowers) {
466  caloTowersFwdPtr_.reserve(caloTowers.size());
467  for(auto const& tower : caloTowers) {
468  caloTowersFwdPtr_.push_back( tower );
469  }
470  embeddedCaloTowers_ = true;
471  caloTowersTemp_.reset();
472 }
473 
474 
476 void Jet::setPFCandidates(const PFCandidateFwdPtrCollection & pfCandidates) {
477  pfCandidatesFwdPtr_.reserve(pfCandidates.size());
478  for(auto const& cand : pfCandidates) {
479  pfCandidatesFwdPtr_.push_back(cand);
480  }
481  embeddedPFCandidates_ = true;
482  pfCandidatesTemp_.reset();
483 }
484 
485 
487 void Jet::setGenJetRef(const edm::FwdRef<reco::GenJetCollection> & gj)
488 {
489  genJetFwdRef_ = gj;
490 }
491 
492 
493 
495 void Jet::setPartonFlavour(int partonFl) {
496  jetFlavourInfo_.setPartonFlavour(partonFl);
497 }
498 
500 void Jet::setHadronFlavour(int hadronFl) {
501  jetFlavourInfo_.setHadronFlavour(hadronFl);
502 }
503 
505 void Jet::setJetFlavourInfo(const reco::JetFlavourInfo & jetFlavourInfo) {
506  jetFlavourInfo_ = jetFlavourInfo;
507 }
508 
510 void Jet::addBDiscriminatorPair(const std::pair<std::string, float> & thePair) {
511  pairDiscriVector_.push_back(thePair);
512 }
513 
515 void Jet::setJetCharge(float jetCharge) {
516  jetCharge_ = jetCharge;
517 }
518 
519 
520 
522 void Jet::cacheCaloTowers() const {
523  // Clear the cache
524  // Here is where we've embedded constituents
525  std::unique_ptr<std::vector<CaloTowerPtr>> caloTowersTemp{ new std::vector<CaloTowerPtr>{}};
526  if ( embeddedCaloTowers_ ) {
527  // Refactorized PAT access
528  if ( !caloTowersFwdPtr_.empty() ) {
529  caloTowersTemp->reserve(caloTowersFwdPtr_.size());
530  for ( CaloTowerFwdPtrVector::const_iterator ibegin=caloTowersFwdPtr_.begin(),
531  iend = caloTowersFwdPtr_.end(),
532  icalo = ibegin;
533  icalo != iend; ++icalo ) {
534  caloTowersTemp->emplace_back( icalo->ptr() );
535  }
536  }
537  // Compatibility access
538  else if ( !caloTowers_.empty() ) {
539  caloTowersTemp->reserve(caloTowers_.size());
540  for ( CaloTowerCollection::const_iterator ibegin=caloTowers_.begin(),
541  iend = caloTowers_.end(),
542  icalo = ibegin;
543  icalo != iend; ++icalo ) {
544  caloTowersTemp->emplace_back( &caloTowers_, icalo - ibegin );
545  }
546  }
547  }
548  // Non-embedded access
549  else {
550  const auto nDaughters = numberOfDaughters();
551  caloTowersTemp->reserve(nDaughters);
552  for ( unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
553  Constituent const & dau = daughterPtr (fIndex);
554  const CaloTower* caloTower = dynamic_cast <const CaloTower*> (dau.get());
555  if (caloTower) {
556  caloTowersTemp->emplace_back( dau.id(), caloTower,dau.key() );
557  }
558  else {
559  throw cms::Exception("Invalid Constituent") << "CaloJet constituent is not of CaloTower type";
560  }
561  }
562  }
563  caloTowersTemp_.set(std::move(caloTowersTemp));
564 }
565 
567 void Jet::cachePFCandidates() const {
568 
569  std::unique_ptr<std::vector<reco::PFCandidatePtr>> pfCandidatesTemp{ new std::vector<reco::PFCandidatePtr>{}};
570  // Here is where we've embedded constituents
571  if ( embeddedPFCandidates_ ) {
572  // Refactorized PAT access
573  if ( !pfCandidatesFwdPtr_.empty() ) {
574  pfCandidatesTemp->reserve(pfCandidatesFwdPtr_.size());
575  for ( PFCandidateFwdPtrCollection::const_iterator ibegin=pfCandidatesFwdPtr_.begin(),
576  iend = pfCandidatesFwdPtr_.end(),
577  ipf = ibegin;
578  ipf != iend; ++ipf ) {
579  pfCandidatesTemp->emplace_back( ipf->ptr() );
580  }
581  }
582  // Compatibility access
583  else if ( !pfCandidates_.empty() ) {
584  pfCandidatesTemp->reserve(pfCandidates_.size());
585  for ( reco::PFCandidateCollection::const_iterator ibegin=pfCandidates_.begin(),
586  iend = pfCandidates_.end(),
587  ipf = ibegin;
588  ipf != iend; ++ipf ) {
589  pfCandidatesTemp->emplace_back( &pfCandidates_, ipf - ibegin );
590  }
591  }
592  }
593  // Non-embedded access
594  else {
595  const auto nDaughters = numberOfDaughters();
596  pfCandidatesTemp->reserve(nDaughters);
597  for ( unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
598  Constituent const & dau = daughterPtr (fIndex);
599  const reco::PFCandidate* pfCandidate = dynamic_cast <const reco::PFCandidate*> (dau.get());
600  if (pfCandidate) {
601  pfCandidatesTemp->emplace_back( dau.id(), pfCandidate,dau.key() );
602  }
603  else {
604  throw cms::Exception("Invalid Constituent") << "PFJet constituent is not of PFCandidate type";
605  }
606  }
607  }
608  // Set the cache
609  pfCandidatesTemp_.set(std::move(pfCandidatesTemp));
610 }
611 
613 void Jet::cacheDaughters() const {
614  // Jets in MiniAOD produced via JetSubstructurePacker contain a mixture of subjets and particles as daughters
615  std::unique_ptr<std::vector<reco::CandidatePtr>> daughtersTemp{ new std::vector<reco::CandidatePtr>{}};
616  const std::vector<reco::CandidatePtr> & jdaus = reco::Jet::daughterPtrVector();
617  for (const reco::CandidatePtr & dau : jdaus) {
618  if (dau->isJet()) {
619  const reco::Jet *subjet = dynamic_cast<const reco::Jet *>(&*dau);
620  if (subjet) {
621  const std::vector<reco::CandidatePtr> & sjdaus = subjet->daughterPtrVector();
622  daughtersTemp->insert(daughtersTemp->end(), sjdaus.begin(), sjdaus.end());
623  }
624  } else
625  daughtersTemp->push_back( dau );
626  }
627  daughtersTemp_.set(std::move(daughtersTemp));
628 }
629 
630 
632 pat::JetPtrCollection const & Jet::subjets( unsigned int index) const {
633  if ( index < subjetCollections_.size() )
634  return subjetCollections_[index];
635  else {
636  throw cms::Exception("OutOfRange") << "Index " << index << " is out of range" << std::endl;
637  }
638 }
639 
640 
642 pat::JetPtrCollection const & Jet::subjets( std::string const & label ) const {
643  auto found = find( subjetLabels_.begin(), subjetLabels_.end(), label );
644  if ( found != subjetLabels_.end() ){
645  auto index = std::distance( subjetLabels_.begin(), found );
646  return subjetCollections_[index];
647  }
648  else {
649  throw cms::Exception("SubjetsNotFound") << "Label " << label << " does not match any subjet collection" << std::endl;
650  }
651 }
652 
654 void Jet::addSubjets( pat::JetPtrCollection const & pieces, std::string const & label ) {
655  subjetCollections_.push_back( pieces );
656  subjetLabels_.push_back( label );
657 }
type
Definition: HCALResponse.h:21
value_type const * get() const
Definition: RefToBase.h:234
Jet()
default constructor
static const TGPicture * info(bool iBackgroundIsBlack)
double eta() const final
momentum pseudorapidity
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool isAvailable() const
Definition: RefToBase.h:114
const Specific & getSpecific() const
block accessors
Definition: JPTJet.h:133
Base class for all types of Jets.
Definition: Jet.h:20
std::vector< CaloTower >::const_iterator const_iterator
double pt() const final
transverse momentum
bool isNonnull() const
Checks for non-null.
Definition: RefToBase.h:337
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
Definition: JPTJet.h:130
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
uint16_t size_type
Jets made from PFObjects.
Definition: PFJet.h:21
ProductID id() const
Definition: RefToBase.h:242
virtual const daughters & daughterPtrVector() const
references to daughtes
Definition: HeavyIon.h:7
size_t numberOfDaughters() const override
number of daughters
daughters dau
collection of references to daughters
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
Definition: Jet.py:1
size_t key() const
Definition: RefToBase.h:250
Jets made from CaloJets corrected for ZSP and tracks.
Definition: JPTJet.h:29
std::vector< edm::Ptr< pat::Jet > > JetPtrCollection
Definition: Jet.h:77
Class storing the jet flavour information.
double energy() const final
energy
T get() const
get a component
Jets made from MC generator particles.
Definition: GenJet.h:24
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
unsigned int index
Definition: LeafCandidate.h:31
~Jet() override
Destructor.
Definition: Jet.h:41
edm::Ptr< Candidate > Constituent
Definition: Jet.h:22
std::vector< CandidatePtr > daughters
collection of references to daughters
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
Definition: Jet.h:76
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
Definition: Jet.h:75
hadronFlavour
Definition: jets_cff.py:427
Analysis-level calorimeter jet class.
Definition: Jet.h:80
Particle reconstructed by the particle flow algorithm.
Definition: PFCandidate.h:40
fixed size matrix
partonFlavour
Definition: jets_cff.py:426
Jet()
Default constructor.
Definition: Jet.h:36
Templated PAT object container.
Definition: PATObject.h:49
edm::Ptr< CaloTower > CaloTowerPtr
Definition: CaloTowerDefs.h:14
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
double phi() const final
momentum azimuthal angle
static std::string const source
Definition: EdmProvDump.cc:43
void setP4(const LorentzVector &p4) final
set 4-momentum
def move(src, dest)
Definition: eostools.py:510
const Specific & getSpecific() const
Definition: CaloJet.h:149
const Specific & getSpecific() const
Definition: GenJet.h:77