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";
215 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
216 if( corrFactor->jecSet()==set ){
return (corrFactor-
jec_.begin()); }
223 std::vector<std::string> sets;
224 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
225 sets.push_back(corrFactor->jecSet());
231 return set>=0 ?
jec_.at(set).correctionLabels() : std::vector<std::string>();
239 if(set.empty() ||
jec_.at(
idx).jecSet()==set){
240 if(
jec_[
idx].jecLevel(level)>=0){
244 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
248 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
249 <<
"for a jet energy correction set with label " << set <<
"\n";
257 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n";
260 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
261 <<
"for a jet energy correction set with index " << set <<
"\n";
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 JEC set " << set <<
" does not exist. \n";
306 float discriminator = -1000.;
307 const std::string & theLabel = ((aLabel ==
"" || aLabel ==
"default")) ?
"trackCountingHighEffBJetTags" : aLabel;
313 return discriminator;
333 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
334 return static_cast<const T *
>( baseTagInfo );
341 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
342 return static_cast<const T *
>( baseTagInfo );
352 return (label.empty() ? tagInfoByType<reco::TrackIPTagInfo>()
353 : dynamic_cast<const reco::TrackIPTagInfo *>(
tagInfo(label)) );
358 return (label.empty() ? tagInfoByType<reco::SoftLeptonTagInfo>()
359 : dynamic_cast<const reco::SoftLeptonTagInfo *>(
tagInfo(label)) );
364 return (label.empty() ? tagInfoByType<reco::SecondaryVertexTagInfo>()
365 : dynamic_cast<const reco::SecondaryVertexTagInfo *>(
tagInfo(label)) );
372 if (idx == std::string::npos) {
400 for(
auto const& tower : caloTowers) {
411 for(
auto const& cand : pfCandidates) {
458 std::unique_ptr<std::vector<CaloTowerPtr>> caloTowersTemp{
new std::vector<CaloTowerPtr>{}};
466 icalo != iend; ++icalo ) {
467 caloTowersTemp->emplace_back( icalo->ptr() );
476 icalo != iend; ++icalo ) {
477 caloTowersTemp->emplace_back( &
caloTowers_, icalo - ibegin );
484 caloTowersTemp->reserve(nDaughters);
485 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
489 caloTowersTemp->emplace_back( dau.
id(), caloTower,dau.
key() );
492 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
502 std::unique_ptr<std::vector<reco::PFCandidatePtr>> pfCandidatesTemp{
new std::vector<reco::PFCandidatePtr>{}};
511 ipf != iend; ++ipf ) {
512 pfCandidatesTemp->emplace_back( ipf->ptr() );
518 for ( reco::PFCandidateCollection::const_iterator ibegin=
pfCandidates_.begin(),
521 ipf != iend; ++ipf ) {
522 pfCandidatesTemp->emplace_back( &
pfCandidates_, ipf - ibegin );
529 pfCandidatesTemp->reserve(nDaughters);
530 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
534 pfCandidatesTemp->emplace_back( dau.
id(), pfCandidate,dau.
key() );
537 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
virtual double energy() const GCC11_FINAL
energy
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.
reco::TrackRefVector associatedTracks_
reco::PFCandidateCollection pfCandidates_
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
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
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
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 float phi() const GCC11_FINAL
momentum azimuthal angle
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
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_
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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
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.
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_
virtual void setP4(const LorentzVector &p4) GCC11_FINAL
set 4-momentum
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_
virtual float pt() const GCC11_FINAL
transverse momentum
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
bool isNonnull() const
Checks for non-null.
JetCorrFactors::Flavor currentJECFlavor_
bool embeddedPFCandidates_
static std::string const source
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
const Specific & getSpecific() const