14 embeddedCaloTowers_(
false),
15 embeddedPFCandidates_(
false),
23 embeddedCaloTowers_(
false),
24 embeddedPFCandidates_(
false),
33 embeddedCaloTowers_(
false),
34 embeddedPFCandidates_(
false),
43 embeddedCaloTowers_(
false),
44 embeddedPFCandidates_(
false),
55 out <<
"\tpat::Jet: ";
56 out << std::setiosflags(std::ios::right);
57 out << std::setiosflags(std::ios::fixed);
58 out << std::setprecision(3);
59 out <<
" E/pT/eta/phi "
72 specificCalo_.push_back( (static_cast<const reco::CaloJet&>(source)).getSpecific() );
84 edm::LogWarning(
"OptionalProductNotFound") <<
" in pat::Jet, Attempted to add Calo Specifics to JPT Jets, but failed."
85 <<
" Jet ID for JPT Jets will not be available for you." << std::endl;
88 specificPF_.push_back( (static_cast<const reco::PFJet&>(source)).getSpecific() );
118 if (caloTower != 0) {
122 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
164 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
249 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
250 if( corrFactor->jecSet()==set ){
return (corrFactor-
jec_.begin()); }
257 std::vector<std::string> sets;
258 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
259 sets.push_back(corrFactor->jecSet());
265 return set>=0 ?
jec_.at(set).correctionLabels() : std::vector<std::string>();
273 if(set.empty() ||
jec_.at(
idx).jecSet()==set){
274 if(
jec_[
idx].jecLevel(level)>=0){
278 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
282 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
283 <<
"for a jet energy correction set with label " << set <<
"\n";
291 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n";
294 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
295 <<
"for a jet energy correction set with index " << set <<
"\n";
307 if(set.empty() ||
jec_.at(
idx).jecSet()==set){
308 if(
jec_[
idx].jecLevel(level)>=0){
312 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
316 throw cms::Exception(
"InvalidRequest") <<
"This JEC set " << set <<
" does not exist. \n";
340 float discriminator = -1000.;
341 const std::string & theLabel = ((aLabel ==
"" || aLabel ==
"default")) ?
"trackCountingHighEffBJetTags" : aLabel;
347 return discriminator;
367 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
368 return static_cast<const T *
>( baseTagInfo );
375 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
376 return static_cast<const T *
>( baseTagInfo );
386 return (label.empty() ? tagInfoByType<reco::TrackIPTagInfo>()
387 : dynamic_cast<const reco::TrackIPTagInfo *>(
tagInfo(label)) );
392 return (label.empty() ? tagInfoByType<reco::SoftLeptonTagInfo>()
393 : dynamic_cast<const reco::SoftLeptonTagInfo *>(
tagInfo(label)) );
398 return (label.empty() ? tagInfoByType<reco::SecondaryVertexTagInfo>()
399 : dynamic_cast<const reco::SecondaryVertexTagInfo *>(
tagInfo(label)) );
406 if (idx == std::string::npos) {
434 for(
auto const& tower : caloTowers) {
445 for(
auto const& cand : pfCandidates) {
492 std::unique_ptr<std::vector<CaloTowerPtr>> caloTowersTemp{
new std::vector<CaloTowerPtr>{}};
500 icalo != iend; ++icalo ) {
501 caloTowersTemp->emplace_back( icalo->ptr() );
510 icalo != iend; ++icalo ) {
511 caloTowersTemp->emplace_back( &
caloTowers_, icalo - ibegin );
518 caloTowersTemp->reserve(nDaughters);
519 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
523 caloTowersTemp->emplace_back( dau.
id(), caloTower,dau.
key() );
526 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
536 std::unique_ptr<std::vector<reco::PFCandidatePtr>> pfCandidatesTemp{
new std::vector<reco::PFCandidatePtr>{}};
545 ipf != iend; ++ipf ) {
546 pfCandidatesTemp->emplace_back( ipf->ptr() );
552 for ( reco::PFCandidateCollection::const_iterator ibegin=
pfCandidates_.begin(),
555 ipf != iend; ++ipf ) {
556 pfCandidatesTemp->emplace_back( &
pfCandidates_, ipf - ibegin );
563 pfCandidatesTemp->reserve(nDaughters);
564 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
568 pfCandidatesTemp->emplace_back( dau.
id(), pfCandidate,dau.
key() );
571 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
void setPartonFlavour(const int partonFlavour)
Set the parton-based flavour.
void setGenJetRef(const edm::FwdRef< reco::GenJetCollection > &gj)
method to set the matched generated jet reference, embedding if requested
float jecFactor(const std::string &level, const std::string &flavor="none", const std::string &set="") const
const reco::SecondaryVertexTagInfo * tagInfoSecondaryVertex(const std::string &label="") const
reco::GenJetRefVector genJetRef_
CaloTowerFwdPtrVector caloTowersFwdPtr_
const std::vector< std::string > availableJECLevels(const int &set=0) const
bool jecSetsAvailable() const
Jets made from CaloTowers.
virtual float pt() const
transverse momentum
reco::TrackRefVector associatedTracks_
reco::PFCandidateCollection pfCandidates_
std::vector< std::pair< std::string, float > > pairDiscriVector_
const reco::GenJet * genJet() const
return the matched generated jet
CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
const Specific & getSpecific() const
block accessors
virtual float phi() const
momentum azimuthal angle
Base class for all types of Jets.
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
void setHadronFlavour(const int hadronFlavour)
Set the hadron-based flavour.
TagInfoFwdPtrCollection tagInfosFwdPtr_
edm::FwdRef< reco::GenJetCollection > genJetFwdRef_
std::vector< CaloTower >::const_iterator const_iterator
void setJetFlavourInfo(const reco::JetFlavourInfo &jetFlavourInfo)
method to set the JetFlavourInfo of the jet
virtual void setP4(const LorentzVector &p4)
set 4-momentum
void cacheCaloTowers() const
cache calo towers
void tryImportSpecific(const reco::Jet &source)
constructor helper that tries to import the specific info from the source jet
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
void setCaloTowers(const CaloTowerFwdPtrCollection &caloTowers)
method to store the CaloJet constituents internally
const reco::TrackIPTagInfo * tagInfoTrackIP(const std::string &label="") const
const reco::TrackRefVector & associatedTracks() const
method to return a vector of refs to the tracks associated to this jet
edm::AtomicPtrCache< std::vector< CaloTowerPtr > > caloTowersTemp_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void reset()
unsets the value and deletes the memory
const T * tagInfoByType() const
Jets made from PFObjects.
std::vector< reco::PFCandidatePtr > const & getPFConstituents() const
void addTagInfo(const std::string &label, const TagInfoFwdPtrCollection::value_type &info)
std::vector< PFSpecific > specificPF_
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
daughters dau
collection of references to daughters
bool isCaloJet() const
check to see if the jet is a reco::CaloJet
edm::OwnVector< reco::BaseTagInfo > tagInfos_
int hadronFlavour() const
return the hadron-based flavour of the jet
const reco::JetFlavourInfo & jetFlavourInfo() const
return the JetFlavourInfo of the jet
void setAssociatedTracks(const reco::TrackRefVector &tracks)
method to set the vector of refs to the tracks associated to this jet
virtual double energy() const
energy
virtual size_t numberOfDaughters() const
number of daughters
reco::JetFlavourInfo jetFlavourInfo_
std::ostream & operator<<(std::ostream &, BeamSpot beam)
std::vector< CaloSpecific > specificCalo_
T const * get() const
Returns C++ pointer to the item.
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 ...
virtual float eta() const
momentum pseudorapidity
CaloTowerPtr getCaloConstituent(unsigned fIndex) const
convert generic constituent to specific type
Jets made from CaloJets corrected for ZSP and tracks.
unsigned int currentJECLevel_
edm::Ptr< CaloTower > CaloTowerPtr
ProductID id() const
Accessor for product ID.
T const * get() const
Returns C++ pointer to the item.
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
Class storing the jet flavour information.
virtual const reco::Candidate * daughter(size_t i) const
int jecSet(const std::string &label) const
return true if this jet carries the jet correction factors of a different set, for systematic studies...
Jets made from MC generator particles.
const reco::BaseTagInfo * tagInfo(const std::string &label) const
const int getPartonFlavour() const
Return the parton-based flavour.
void setPartonFlavour(int partonFl)
method to set the parton-based flavour of the jet
Container::value_type value_type
int partonFlavour() const
return the parton-based flavour of the jet
bool isPFJet() const
check to see if the jet is a reco::PFJet
JetCorrFactors::Flavor currentJECFlavor() const
return flavour of the current step of jet energy corrections
std::vector< CaloTowerPtr > const & getCaloConstituents() const
std::vector< pat::JetCorrFactors > jec_
std::vector< std::string > tagInfoLabels_
const_iterator end() const
bool isJPTJet() const
check to see if the jet is a reco::JPTJet
const reco::SoftLeptonTagInfo * tagInfoSoftLepton(const std::string &label="") const
void setJetCharge(float jetCharge)
method to set the jet charge
bool set(std::unique_ptr< T > iNewValue) const
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
std::vector< JPTSpecific > specificJPT_
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
void addBDiscriminatorPair(const std::pair< std::string, float > &thePair)
method to add a algolabel-discriminator pair
std::string currentJECLevel() const
return the name of the current step of jet energy corrections
Analysis-level calorimeter jet class.
virtual size_t numberOfDaughters() const
CaloTowerCollection caloTowers_
const std::vector< std::string > availableJECSets() const
-— methods for jet corrections -—
void cachePFCandidates() const
method to cache the constituents to allow "user-friendly" access
Particle reconstructed by the particle flow algorithm.
reco::PFCandidateFwdPtrVector pfCandidatesFwdPtr_
void setPFCandidates(const PFCandidateFwdPtrCollection &pfCandidates)
method to store the PFCandidate constituents internally
size_type size() const
Size of the RefVector.
Templated PAT object container.
reco::PFCandidatePtr getPFConstituent(unsigned fIndex) const
convert generic constituent to specific type
const int getHadronFlavour() const
Return the hadron-based flavour.
volatile std::atomic< bool > shutdown_flag false
unsigned int currentJECSet_
std::vector< reco::GenJet > genJet_
void setHadronFlavour(int hadronFl)
method to set the hadron-based flavour of the jet
edm::AtomicPtrCache< std::vector< reco::PFCandidatePtr > > pfCandidatesTemp_
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
bool isNonnull() const
Checks for non-null.
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
JetCorrFactors::Flavor currentJECFlavor_
bool embeddedPFCandidates_
static std::string const source
value_type const * get() const
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
std::string currentJECSet() const
returns the label of the current set of jet energy corrections
const_iterator begin() const
const std::vector< std::pair< std::string, float > > & getPairDiscri() const
get vector of paire labelname-disciValue
float jetCharge() const
method to return the JetCharge computed when creating the Jet
bool jecSetAvailable(const std::string &set) const
const Specific & getSpecific() const