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, 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(), common_cff::pdgId, reco::Candidate::pdgId(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::LeafCandidate::pz(), and jetUpdater_cfi::sort.
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.empty() ) {
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
const reco::ShallowClonePtrCandidate & matchedJet() const
double px() const final
x coordinate of momentum vector
FLAVOR_T flavorSource() const
collection_type::const_iterator const_iterator
FlavorHistory::FLAVOR_T flavor_type
double pz() const final
z coordinate of momentum vector
virtual int pdgId() const =0
PDG identifier.
flavor_type flavorSource_
double energy() const final
energy
Abs< T >::type abs(const T &t)
bool isNonnull() const
Checks for non-null.
const CandidatePtr & masterClonePtr() const override
returns reference to master clone pointer
double py() const final
y coordinate of momentum vector
unsigned int highestFlavor_
collection_type histories_
const reco::CandidatePtr & parton() const