CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
cms::CSJetProducer Class Reference

#include <CSJetProducer.h>

Inheritance diagram for cms::CSJetProducer:
VirtualJetProducer edm::stream::EDProducer<>

Public Member Functions

 CSJetProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~CSJetProducer () override
 
- Public Member Functions inherited from VirtualJetProducer
std::string jetType () const
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 VirtualJetProducer (const edm::ParameterSet &iConfig)
 
 ~VirtualJetProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillDescriptionsFromCSJetProducer (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from VirtualJetProducer
static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void fillDescriptionsFromVirtualJetProducer (edm::ParameterSetDescription &desc)
 

Protected Member Functions

void runAlgorithm (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
- Protected Member Functions inherited from VirtualJetProducer
virtual void addHTTTopJetTagInfoCollection (edm::Event &iEvent, const edm::EventSetup &iSetup, edm::OrphanHandle< reco::BasicJetCollection > &oh)
 
virtual void copyConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents, reco::Jet *jet)
 
virtual std::vector< reco::CandidatePtrgetConstituents (const std::vector< fastjet::PseudoJet > &fjConstituents)
 
virtual void inputTowers ()
 
virtual bool isAnomalousTower (reco::CandidatePtr input)
 
bool makeBasicJet (const JetType::Type &fTag)
 
bool makeCaloJet (const JetType::Type &fTag)
 
bool makeGenJet (const JetType::Type &fTag)
 
bool makePFClusterJet (const JetType::Type &fTag)
 
bool makePFJet (const JetType::Type &fTag)
 
virtual void makeProduces (std::string s, std::string tag="")
 
bool makeTrackJet (const JetType::Type &fTag)
 
void offsetCorrectJets (std::vector< fastjet::PseudoJet > &orphanInput)
 
virtual void output (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
template<typename T >
void writeCompoundJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 
template<typename T >
void writeJets (edm::Event &iEvent, edm::EventSetup const &iSetup)
 
template<typename T >
void writeJetsWithConstituents (edm::Event &iEvent, edm::EventSetup const &iSetup)
 function template to write out the outputs More...
 

Protected Attributes

double csAlpha_
 for constituent subtraction : R parameter More...
 
double csRParam_
 
edm::EDGetTokenT< std::vector< double > > etaToken_
 for HI constituent subtraction : alpha (power of pt in metric) More...
 
edm::EDGetTokenT< std::vector< double > > rhomToken_
 
edm::EDGetTokenT< std::vector< double > > rhoToken_
 
- Protected Attributes inherited from VirtualJetProducer
int activeAreaRepeats_
 
bool applyWeight_
 
bool doAreaDiskApprox_
 
bool doAreaFastjet_
 
bool doFastJetNonUniform_
 
bool doPUOffsetCorr_
 
bool doPVCorrection_
 
bool doRhoFastjet_
 
ActiveAreaSpecPtr fjActiveArea_
 
AreaDefinitionPtr fjAreaDefinition_
 
ClusterSequencePtr fjClusterSeq_
 
std::vector< fastjet::PseudoJet > fjInputs_
 
JetDefPtr fjJetDefinition_
 
std::vector< fastjet::PseudoJet > fjJets_
 
PluginPtr fjPlugin_
 
SelectorPtr fjSelector_
 
bool fromHTTTopJetProducer_ = false
 
double ghostArea_
 
double ghostEtaMax_
 
edm::EDGetTokenT< reco::VertexCollectioninput_vertex_token_
 
edm::EDGetTokenT< edm::ValueMap< float > > input_weights_token_
 
double inputEMin_
 
double inputEtMin_
 
std::vector< edm::Ptr< reco::Candidate > > inputs_
 
std::string jetAlgorithm_
 
std::string jetCollInstanceName_
 
double jetPtMin_
 
std::string jetType_
 
JetType::Type jetTypeE
 
unsigned int maxInputs_
 
unsigned int minSeed_
 
std::string moduleLabel_
 
unsigned int nExclude_
 
std::vector< double > puCenters_
 
std::string puSubtractorName_
 
double puWidth_
 
bool restrictInputs_
 
double rhoEtaMax_
 
double rParam_
 
edm::InputTag src_
 
edm::InputTag srcPVs_
 
std::shared_ptr< PileUpSubtractorsubtractor_
 
bool useDeterministicSeed_
 
bool useExplicitGhosts_
 
int verbosity_
 
reco::Particle::Point vertex_
 
double voronoiRfact_
 
edm::ValueMap< float > weights_
 
bool writeCompound_
 
bool writeJetsWithConst_
 

Additional Inherited Members

- Public Types inherited from VirtualJetProducer
typedef std::shared_ptr< fastjet::GhostedAreaSpec > ActiveAreaSpecPtr
 
typedef std::shared_ptr< fastjet::AreaDefinition > AreaDefinitionPtr
 
typedef std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
 
typedef std::shared_ptr< fastjet::JetDefinition > JetDefPtr
 
typedef std::shared_ptr< fastjet::JetDefinition::Plugin > PluginPtr
 
typedef std::shared_ptr< fastjet::Selector > SelectorPtr
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 22 of file CSJetProducer.h.

Constructor & Destructor Documentation

◆ CSJetProducer()

CSJetProducer::CSJetProducer ( const edm::ParameterSet ps)

Definition at line 16 of file CSJetProducer.cc.

16  : VirtualJetProducer(conf), csRParam_(-1.0), csAlpha_(0.) {
17  //get eta range, rho and rhom map
18  etaToken_ = consumes<std::vector<double>>(conf.getParameter<edm::InputTag>("etaMap"));
19  rhoToken_ = consumes<std::vector<double>>(conf.getParameter<edm::InputTag>("rho"));
20  rhomToken_ = consumes<std::vector<double>>(conf.getParameter<edm::InputTag>("rhom"));
21  csRParam_ = conf.getParameter<double>("csRParam");
22  csAlpha_ = conf.getParameter<double>("csAlpha");
23 }

References csAlpha_, csRParam_, etaToken_, edm::ParameterSet::getParameter(), rhomToken_, and rhoToken_.

◆ ~CSJetProducer()

cms::CSJetProducer::~CSJetProducer ( )
inlineoverride

Definition at line 26 of file CSJetProducer.h.

26 {}

Member Function Documentation

◆ fillDescriptions()

void CSJetProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 130 of file CSJetProducer.cc.

130  {
131  edm::ParameterSetDescription descCSJetProducer;
133  fillDescriptionsFromCSJetProducer(descCSJetProducer);
135  descCSJetProducer.add<string>("jetCollInstanceName", "");
137  descCSJetProducer.add<bool>("sumRecHits", false);
138 
140  descriptions.add("CSJetProducer", descCSJetProducer);
141 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), fillDescriptionsFromCSJetProducer(), and VirtualJetProducer::fillDescriptionsFromVirtualJetProducer().

◆ fillDescriptionsFromCSJetProducer()

void CSJetProducer::fillDescriptionsFromCSJetProducer ( edm::ParameterSetDescription desc)
static

Definition at line 143 of file CSJetProducer.cc.

143  {
144  desc.add<double>("csRParam", -1.);
145  desc.add<double>("csAlpha", 2.);
146 
147  desc.add<edm::InputTag>("etaMap", edm::InputTag("hiFJRhoProducer", "mapEtaEdges"));
148  desc.add<edm::InputTag>("rho", edm::InputTag("hiFJRhoProducer", "mapToRho"));
149  desc.add<edm::InputTag>("rhom", edm::InputTag("hiFJRhoProducer", "mapToRhoM"));
150 }

References edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

Referenced by fillDescriptions().

◆ produce()

void CSJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 25 of file CSJetProducer.cc.

25  {
26  // use the default production from one collection
28  //use runAlgorithm of this class
29 
30  //Delete allocated memory. It is allocated every time runAlgorithm is called
31  fjClusterSeq_.reset();
32 }

References VirtualJetProducer::fjClusterSeq_, iEvent, and VirtualJetProducer::produce().

◆ runAlgorithm()

void CSJetProducer::runAlgorithm ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotectedvirtual

Implements VirtualJetProducer.

Definition at line 35 of file CSJetProducer.cc.

35  {
36  // run algorithm
37  if (!doAreaFastjet_ && !doRhoFastjet_) {
38  fjClusterSeq_ = std::make_shared<fastjet::ClusterSequence>(fjInputs_, *fjJetDefinition_);
39  } else if (voronoiRfact_ <= 0) {
41  ClusterSequencePtr(new fastjet::ClusterSequenceArea(fjInputs_, *fjJetDefinition_, *fjAreaDefinition_));
42  } else {
44  new fastjet::ClusterSequenceVoronoiArea(fjInputs_, *fjJetDefinition_, fastjet::VoronoiAreaSpec(voronoiRfact_)));
45  }
46 
47  fjJets_.clear();
48  std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(fjClusterSeq_->inclusive_jets(jetPtMin_));
49 
50  //Get local rho and rhom map
54 
55  iEvent.getByToken(etaToken_, etaRanges);
56  iEvent.getByToken(rhoToken_, rhoRanges);
57  iEvent.getByToken(rhomToken_, rhomRanges);
58 
59  //Check if size of eta and background density vectors is the same
60  unsigned int bkgVecSize = etaRanges->size();
61  if (bkgVecSize < 1) {
62  throw cms::Exception("WrongBkgInput") << "Producer needs vector with background estimates\n";
63  }
64  if (bkgVecSize != (rhoRanges->size() + 1) || bkgVecSize != (rhomRanges->size() + 1)) {
65  throw cms::Exception("WrongBkgInput")
66  << "Size of etaRanges (" << bkgVecSize << ") and rhoRanges (" << rhoRanges->size() << ") and/or rhomRanges ("
67  << rhomRanges->size() << ") vectors inconsistent\n";
68  }
69 
70  //Allow the background densities to change within the jet
71 
72  for (fastjet::PseudoJet& ijet : tempJets) {
73  //----------------------------------------------------------------------
74  // sift ghosts and particles in the input jet
75  std::vector<fastjet::PseudoJet> particles, ghosts;
76  fastjet::SelectorIsPureGhost().sift(ijet.constituents(), ghosts, particles);
77  unsigned long nParticles = particles.size();
78  if (nParticles == 0)
79  continue; //don't subtract ghost jets
80 
81  //assign rho and rhom to ghosts according to local eta-dependent map
82  double rho = 1e-6;
83  double rhom = 1e-6;
84  for (fastjet::PseudoJet& ighost : ghosts) {
85  if (ighost.eta() <= etaRanges->at(0) || bkgVecSize == 1) {
86  rho = rhoRanges->at(0);
87  rhom = rhomRanges->at(0);
88  } else if (ighost.eta() >= etaRanges->at(bkgVecSize - 1)) {
89  rho = rhoRanges->at(bkgVecSize - 2);
90  rhom = rhomRanges->at(bkgVecSize - 2);
91  } else {
92  for (unsigned int ie = 0; ie < (bkgVecSize - 1); ie++) {
93  if (ighost.eta() >= etaRanges->at(ie) && ighost.eta() < etaRanges->at(ie + 1)) {
94  rho = rhoRanges->at(ie);
95  rhom = rhomRanges->at(ie);
96  break;
97  }
98  }
99  }
100  double pt = rho * ighost.area();
101  double mass_squared = std::pow(rhom * ighost.area() + pt, 2) - std::pow(pt, 2);
102  double mass = 0;
103  if (mass_squared > 0)
104  mass = sqrt(mass_squared);
105  ighost.reset_momentum_PtYPhiM(pt, ighost.rap(), ighost.phi(), mass);
106  }
107 
108  //----------------------------------------------------------------------
109  //from here use official fastjet contrib package
110 
111  fastjet::contrib::ConstituentSubtractor subtractor;
112  subtractor.set_distance_type(fastjet::contrib::ConstituentSubtractor::deltaR); // distance in eta-phi plane
113  subtractor.set_max_distance(
114  csRParam_); // free parameter for the maximal allowed distance between particle i and ghost k
115  subtractor.set_alpha(
116  csAlpha_); // free parameter for the distance measure (the exponent of particle pt). Note that in older versions of the package alpha was multiplied by two but in newer versions this is not the case anymore
117  subtractor.set_do_mass_subtraction(true);
118  subtractor.set_remove_all_zero_pt_particles(true);
119 
120  std::vector<fastjet::PseudoJet> subtracted_particles = subtractor.do_subtraction(particles, ghosts);
121 
122  //Create subtracted jets
123  fastjet::PseudoJet subtracted_jet = join(subtracted_particles);
124  if (subtracted_jet.perp() > 0.)
125  fjJets_.push_back(subtracted_jet);
126  }
127  fjJets_ = fastjet::sorted_by_pt(fjJets_);
128 }

References csAlpha_, csRParam_, PbPb_ZMuSkimMuonDPG_cff::deltaR, VirtualJetProducer::doAreaFastjet_, VirtualJetProducer::doRhoFastjet_, MillePedeFileConverter_cfg::e, bTagCommon_cff::etaRanges, etaToken_, Exception, VirtualJetProducer::fjAreaDefinition_, VirtualJetProducer::fjClusterSeq_, VirtualJetProducer::fjInputs_, VirtualJetProducer::fjJetDefinition_, VirtualJetProducer::fjJets_, iEvent, VirtualJetProducer::jetPtMin_, join(), EgHLTOffHistBins_cfi::mass, ecalTrigSettings_cff::particles, funct::pow(), DiDispStaMuonMonitor_cfi::pt, jetAnalyzer_cfi::rhom, rhomToken_, rhoToken_, mathSSE::sqrt(), and VirtualJetProducer::voronoiRfact_.

Member Data Documentation

◆ csAlpha_

double cms::CSJetProducer::csAlpha_
protected

for constituent subtraction : R parameter

Definition at line 36 of file CSJetProducer.h.

Referenced by CSJetProducer(), and runAlgorithm().

◆ csRParam_

double cms::CSJetProducer::csRParam_
protected

Definition at line 35 of file CSJetProducer.h.

Referenced by CSJetProducer(), and runAlgorithm().

◆ etaToken_

edm::EDGetTokenT<std::vector<double> > cms::CSJetProducer::etaToken_
protected

for HI constituent subtraction : alpha (power of pt in metric)

Definition at line 39 of file CSJetProducer.h.

Referenced by CSJetProducer(), and runAlgorithm().

◆ rhomToken_

edm::EDGetTokenT<std::vector<double> > cms::CSJetProducer::rhomToken_
protected

Definition at line 41 of file CSJetProducer.h.

Referenced by CSJetProducer(), and runAlgorithm().

◆ rhoToken_

edm::EDGetTokenT<std::vector<double> > cms::CSJetProducer::rhoToken_
protected

Definition at line 40 of file CSJetProducer.h.

Referenced by CSJetProducer(), and runAlgorithm().

bTagCommon_cff.etaRanges
etaRanges
Definition: bTagCommon_cff.py:42
cms::CSJetProducer::csAlpha_
double csAlpha_
for constituent subtraction : R parameter
Definition: CSJetProducer.h:36
VirtualJetProducer::produce
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: VirtualJetProducer.cc:264
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
VirtualJetProducer::ClusterSequencePtr
std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
Definition: VirtualJetProducer.h:73
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
cms::CSJetProducer::csRParam_
double csRParam_
Definition: CSJetProducer.h:35
edm::Handle
Definition: AssociativeIterator.h:50
VirtualJetProducer::voronoiRfact_
double voronoiRfact_
Definition: VirtualJetProducer.h:170
ecalTrigSettings_cff.particles
particles
Definition: ecalTrigSettings_cff.py:11
VirtualJetProducer::fjClusterSeq_
ClusterSequencePtr fjClusterSeq_
Definition: VirtualJetProducer.h:185
cms::CSJetProducer::rhoToken_
edm::EDGetTokenT< std::vector< double > > rhoToken_
Definition: CSJetProducer.h:40
VirtualJetProducer::VirtualJetProducer
VirtualJetProducer(const edm::ParameterSet &iConfig)
Definition: VirtualJetProducer.cc:113
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
VirtualJetProducer::doRhoFastjet_
bool doRhoFastjet_
Definition: VirtualJetProducer.h:167
DDAxes::rho
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
jetAnalyzer_cfi.rhom
rhom
Definition: jetAnalyzer_cfi.py:251
VirtualJetProducer::jetPtMin_
double jetPtMin_
Definition: VirtualJetProducer.h:155
iEvent
int iEvent
Definition: GenABIO.cc:224
cms::CSJetProducer::rhomToken_
edm::EDGetTokenT< std::vector< double > > rhomToken_
Definition: CSJetProducer.h:41
VirtualJetProducer::fjAreaDefinition_
AreaDefinitionPtr fjAreaDefinition_
Definition: VirtualJetProducer.h:189
cms::CSJetProducer::etaToken_
edm::EDGetTokenT< std::vector< double > > etaToken_
for HI constituent subtraction : alpha (power of pt in metric)
Definition: CSJetProducer.h:39
VirtualJetProducer::doAreaFastjet_
bool doAreaFastjet_
Definition: VirtualJetProducer.h:163
Exception
Definition: hltDiff.cc:246
VirtualJetProducer::fjJets_
std::vector< fastjet::PseudoJet > fjJets_
Definition: VirtualJetProducer.h:192
VirtualJetProducer::fjJetDefinition_
JetDefPtr fjJetDefinition_
Definition: VirtualJetProducer.h:186
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
cms::CSJetProducer::fillDescriptionsFromCSJetProducer
static void fillDescriptionsFromCSJetProducer(edm::ParameterSetDescription &desc)
Definition: CSJetProducer.cc:143
VirtualJetProducer::fjInputs_
std::vector< fastjet::PseudoJet > fjInputs_
Definition: VirtualJetProducer.h:191
edm::InputTag
Definition: InputTag.h:15
VirtualJetProducer::fillDescriptionsFromVirtualJetProducer
static void fillDescriptionsFromVirtualJetProducer(edm::ParameterSetDescription &desc)
Definition: VirtualJetProducer.cc:1016
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37