Stores a vector of information about the flavor history of partons as well as a classification of the event.
It will return the following: nb = number of genjets that are matched to b partons nc = number of genjets that are matched to c partons
This can be used to classify the event, for instance, as W+bb (2 b partons), W+c (1 c parton), etc.
- Author
- : Salvatore Rappoccio (JHU)
Definition at line 92 of file FlavorHistoryEvent.h.
void FlavorHistoryEvent::cache |
( |
| ) |
|
Definition at line 11 of file FlavorHistoryEvent.cc.
References funct::abs(), popcon2dropbox::copy(), gather_cfg::cout, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::helpers::FlavorHistoryEventHelper::dR, reco::LeafCandidate::energy(), reco::helpers::FlavorHistoryEventHelper::flavor, reco::FlavorHistory::FLAVOR_NULL, reco::helpers::FlavorHistoryEventHelper::flavorSource, reco::FlavorHistory::flavorSource(), mps_fire::i, edm::Ptr< T >::isNonnull(), reco::ShallowClonePtrCandidate::masterClonePtr(), reco::FlavorHistory::matchedJet(), reco::FlavorHistory::parton(), cosmictrackingParticleSelector_cfi::pdgId, reco::Candidate::pdgId(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::pz().
16 if ( verbose )
cout <<
"----- Caching Flavor History Event -----" << endl;
26 vector<helpers::FlavorHistoryEventHelper> classification;
34 for ( ; i != iend; ++
i ) {
36 if ( verbose )
cout <<
" Processing flavor history: " << i - ibegin <<
" = " << endl << flavHist << endl;
46 TLorentzVector p41 ( matchedJet.
px(), matchedJet.
py(), matchedJet.
pz(), matchedJet.
energy() );
47 if ( pdgId == 5 )
nb_++;
48 if ( pdgId == 4 )
nc_++;
52 TLorentzVector p42 ( sisterJet.
px(), sisterJet.
py(), sisterJet.
pz(), sisterJet.
energy() );
58 dR = p41.DeltaR( p42 );
61 if ( verbose )
cout <<
"Adding classification: pdgId = " << pdgId <<
", flavorSource = " << flavorSource <<
", dR = " << dR << endl;
62 classification.push_back( helpers::FlavorHistoryEventHelper ( pdgId, flavorSource, dR ) );
64 if ( verbose )
cout <<
"No matched jet found, not adding to classification list" << endl;
80 if ( classification.size() > 0 ) {
83 std::sort( classification.begin(), classification.end() );
85 if ( verbose ){
cout <<
"Writing out list of classifications" << endl;
86 copy(classification.begin(), classification.end(),
87 ostream_iterator<helpers::FlavorHistoryEventHelper>(
cout,
""));
90 helpers::FlavorHistoryEventHelper
const & best = *(classification.rbegin());
flavor_type flavorSource() const
virtual const CandidatePtr & masterClonePtr() const
returns reference to master clone pointer
const reco::ShallowClonePtrCandidate & matchedJet() const
FLAVOR_T flavorSource() const
collection_type::const_iterator const_iterator
FlavorHistory::FLAVOR_T flavor_type
virtual int pdgId() const =0
PDG identifier.
virtual double px() const final
x coordinate of momentum vector
virtual double energy() const final
energy
flavor_type flavorSource_
Abs< T >::type abs(const T &t)
bool isNonnull() const
Checks for non-null.
virtual double pz() const final
z coordinate of momentum vector
unsigned int highestFlavor_
collection_type histories_
virtual double py() const final
y coordinate of momentum vector
const reco::CandidatePtr & parton() const