15 embeddedCaloTowers_(
false),
16 embeddedPFCandidates_(
false),
18 isCaloTowerCached_(
false),
19 isPFCandidateCached_(
false)
26 embeddedCaloTowers_(
false),
27 embeddedPFCandidates_(
false),
29 isCaloTowerCached_(
false),
30 isPFCandidateCached_(
false)
38 embeddedCaloTowers_(
false),
39 embeddedPFCandidates_(
false),
41 isCaloTowerCached_(
false),
42 isPFCandidateCached_(
false)
50 embeddedCaloTowers_(
false),
51 embeddedPFCandidates_(
false),
53 isCaloTowerCached_(
false),
54 isPFCandidateCached_(
false)
64 out <<
"\tpat::Jet: ";
65 out << std::setiosflags(std::ios::right);
66 out << std::setiosflags(std::ios::fixed);
67 out << std::setprecision(3);
68 out <<
" E/pT/eta/phi "
81 specificCalo_.push_back( (static_cast<const reco::CaloJet&>(source)).getSpecific() );
93 edm::LogWarning(
"OptionalProductNotFound") <<
" in pat::Jet, Attempted to add Calo Specifics to JPT Jets, but failed."
94 <<
" Jet ID for JPT Jets will not be available for you." << std::endl;
97 specificPF_.push_back( (static_cast<const reco::PFJet&>(source)).getSpecific() );
127 if (caloTower != 0) {
131 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
173 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
224 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
225 if( corrFactor->jecSet()==
set ){
return (corrFactor-
jec_.begin()); }
232 std::vector<std::string> sets;
233 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
234 sets.push_back(corrFactor->jecSet());
240 return set>=0 ?
jec_.at(set).correctionLabels() : std::vector<std::string>();
247 for(
unsigned int idx=0; idx<
jec_.size(); ++idx){
248 if(set.empty() ||
jec_.at(idx).jecSet()==
set){
249 if(
jec_[idx].jecLevel(level)>=0){
253 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
257 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
258 <<
"for a jet energy correction set with label " << set <<
"\n";
266 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n";
269 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
270 <<
"for a jet energy correction set with index " << set <<
"\n";
281 for(
unsigned int idx=0; idx<
jec_.size(); ++idx){
282 if(set.empty() ||
jec_.at(idx).jecSet()==
set){
283 if(
jec_[idx].jecLevel(level)>=0){
287 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
291 throw cms::Exception(
"InvalidRequest") <<
"This JEC set " << set <<
" does not exist. \n";
315 float discriminator = -1000.;
316 const std::string & theLabel = ((aLabel ==
"" || aLabel ==
"default")) ?
"trackCountingHighEffBJetTags" : aLabel;
322 return discriminator;
342 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
343 return static_cast<const T *
>( baseTagInfo );
350 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
351 return static_cast<const T *
>( baseTagInfo );
361 return (label.empty() ? tagInfoByType<reco::TrackIPTagInfo>()
362 : dynamic_cast<const reco::TrackIPTagInfo *>(
tagInfo(label)) );
367 return (label.empty() ? tagInfoByType<reco::SoftLeptonTagInfo>()
368 : dynamic_cast<const reco::SoftLeptonTagInfo *>(
tagInfo(label)) );
373 return (label.empty() ? tagInfoByType<reco::SecondaryVertexTagInfo>()
374 : dynamic_cast<const reco::SecondaryVertexTagInfo *>(
tagInfo(label)) );
381 if (idx == std::string::npos) {
408 for(
unsigned int i = 0;
i < caloTowers.size(); ++
i) {
418 for(
unsigned int i = 0;
i < pfCandidates.size(); ++
i) {
472 icalo != iend; ++icalo ) {
481 icalo != iend; ++icalo ) {
495 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
514 ipf != iend; ++ipf ) {
520 for ( reco::PFCandidateCollection::const_iterator ibegin=
pfCandidates_.begin(),
523 ipf != iend; ++ipf ) {
537 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_
std::vector< CaloTowerPtr > caloTowersTemp_
const std::vector< std::string > availableJECLevels(const int &set=0) const
bool jecSetsAvailable() const
Jets made from CaloTowers.
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
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
method to cache the constituents to allow "user-friendly" access
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
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const T * tagInfoByType() const
Jets made from PFObjects.
virtual double eta() const
momentum pseudorapidity
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
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
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 ...
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.
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
bool isPFCandidateCached_
int partonFlavour() const
return the parton-based flavour of the jet
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
const reco::SoftLeptonTagInfo * tagInfoSoftLepton(const std::string &label="") const
void setJetCharge(float jetCharge)
method to set the jet charge
virtual size_t numberOfDaughters() const
virtual double pt() const
transverse momentum
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.
CaloTowerCollection caloTowers_
const std::vector< std::string > availableJECSets() const
-— methods for jet corrections -—
bool isCaloTowerCached_
cache calo towers
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.
std::vector< reco::PFCandidatePtr > pfCandidatesTemp_
unsigned int currentJECSet_
std::vector< reco::GenJet > genJet_
void setHadronFlavour(int hadronFl)
method to set the hadron-based flavour of the jet
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
virtual double phi() const
momentum azimuthal angle
bool isNonnull() const
Checks for non-null.
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
JetCorrFactors::Flavor currentJECFlavor_
bool embeddedPFCandidates_
value_type const * get() const
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
void set(const std::string &name, int value)
set the flag, with a run-time name
const Specific & getSpecific() const