14 embeddedCaloTowers_(
false),
15 embeddedPFCandidates_(
false),
24 embeddedCaloTowers_(
false),
25 embeddedPFCandidates_(
false),
35 embeddedCaloTowers_(
false),
36 embeddedPFCandidates_(
false),
46 embeddedCaloTowers_(
false),
47 embeddedPFCandidates_(
false),
59 out <<
"\tpat::Jet: ";
60 out << std::setiosflags(std::ios::right);
61 out << std::setiosflags(std::ios::fixed);
62 out << std::setprecision(3);
63 out <<
" E/pT/eta/phi "
76 specificCalo_.push_back( (static_cast<const reco::CaloJet&>(source)).getSpecific() );
88 edm::LogWarning(
"OptionalProductNotFound") <<
" in pat::Jet, Attempted to add Calo Specifics to JPT Jets, but failed."
89 <<
" Jet ID for JPT Jets will not be available for you." << std::endl;
92 specificPF_.push_back( (static_cast<const reco::PFJet&>(source)).getSpecific() );
122 if (caloTower != 0) {
126 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
168 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
209 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
210 if( corrFactor->jecSet()==set ){
return (corrFactor-
jec_.begin()); }
217 std::vector<std::string> sets;
218 for(std::vector<pat::JetCorrFactors>::const_iterator corrFactor=
jec_.begin(); corrFactor!=
jec_.end(); ++corrFactor)
219 sets.push_back(corrFactor->jecSet());
225 return set>=0 ?
jec_.at(set).correctionLabels() : std::vector<std::string>();
233 if(set.empty() ||
jec_.at(
idx).jecSet()==set){
234 if(
jec_[
idx].jecLevel(level)>=0){
238 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
242 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
243 <<
"for a jet energy correction set with label " << set <<
"\n";
251 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n";
254 throw cms::Exception(
"InvalidRequest") <<
"This jet does not carry any jet energy correction factor information \n"
255 <<
"for a jet energy correction set with index " << set <<
"\n";
267 if(set.empty() ||
jec_.at(
idx).jecSet()==set){
268 if(
jec_[
idx].jecLevel(level)>=0){
272 throw cms::Exception(
"InvalidRequest") <<
"This JEC level " << level <<
" does not exist. \n";
276 throw cms::Exception(
"InvalidRequest") <<
"This JEC set " << set <<
" does not exist. \n";
300 float discriminator = -1000.;
301 const std::string & theLabel = ((aLabel ==
"" || aLabel ==
"default")) ?
"trackCountingHighEffBJetTags" : aLabel;
307 return discriminator;
327 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
328 return static_cast<const T *
>( baseTagInfo );
335 if (
typeid(*baseTagInfo) ==
typeid(
T) ) {
336 return static_cast<const T *
>( baseTagInfo );
346 return (label.empty() ? tagInfoByType<reco::TrackIPTagInfo>()
347 : dynamic_cast<const reco::TrackIPTagInfo *>(
tagInfo(label)) );
352 return (label.empty() ? tagInfoByType<reco::SoftLeptonTagInfo>()
353 : dynamic_cast<const reco::SoftLeptonTagInfo *>(
tagInfo(label)) );
358 return (label.empty() ? tagInfoByType<reco::SecondaryVertexTagInfo>()
359 : dynamic_cast<const reco::SecondaryVertexTagInfo *>(
tagInfo(label)) );
366 if (idx == std::string::npos) {
394 for(
auto const& tower : caloTowers) {
405 for(
auto const& cand : pfCandidates) {
442 std::unique_ptr<std::vector<CaloTowerPtr>> caloTowersTemp{
new std::vector<CaloTowerPtr>{}};
450 icalo != iend; ++icalo ) {
451 caloTowersTemp->emplace_back( icalo->ptr() );
460 icalo != iend; ++icalo ) {
461 caloTowersTemp->emplace_back( &
caloTowers_, icalo - ibegin );
468 caloTowersTemp->reserve(nDaughters);
469 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
473 caloTowersTemp->emplace_back( dau.
id(), caloTower,dau.
key() );
476 throw cms::Exception(
"Invalid Constituent") <<
"CaloJet constituent is not of CaloTower type";
486 std::unique_ptr<std::vector<reco::PFCandidatePtr>> pfCandidatesTemp{
new std::vector<reco::PFCandidatePtr>{}};
495 ipf != iend; ++ipf ) {
496 pfCandidatesTemp->emplace_back( ipf->ptr() );
502 for ( reco::PFCandidateCollection::const_iterator ibegin=
pfCandidates_.begin(),
505 ipf != iend; ++ipf ) {
506 pfCandidatesTemp->emplace_back( &
pfCandidates_, ipf - ibegin );
513 pfCandidatesTemp->reserve(nDaughters);
514 for (
unsigned fIndex = 0; fIndex < nDaughters; ++fIndex ) {
518 pfCandidatesTemp->emplace_back( dau.
id(), pfCandidate,dau.
key() );
521 throw cms::Exception(
"Invalid Constituent") <<
"PFJet constituent is not of PFCandidate type";
virtual double energy() const GCC11_FINAL
energy
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
TagInfoFwdPtrCollection tagInfosFwdPtr_
edm::FwdRef< reco::GenJetCollection > genJetFwdRef_
std::vector< CaloTower >::const_iterator const_iterator
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_
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
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 -—
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
void setPartonFlavour(int partonFl)
method to set the flavour of the parton underlying the jet
Container::value_type value_type
int partonFlavour() const
return the flavour of the parton underlying 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
volatile std::atomic< bool > shutdown_flag false
unsigned int currentJECSet_
std::vector< reco::GenJet > genJet_
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