CMS 3D CMS Logo

PileUpSubtractor.h
Go to the documentation of this file.
1 #ifndef __PUSubtractor__
2 #define __PUSubtractor__
3 
4 #include <vector>
5 
6 #include "fastjet/PseudoJet.hh"
7 #include "fastjet/ClusterSequence.hh"
8 #include "fastjet/ClusterSequenceArea.hh"
9 #include "fastjet/GhostedAreaSpec.hh"
10 
17 
22 
24 public:
25  typedef std::shared_ptr<fastjet::ClusterSequence> ClusterSequencePtr;
26  typedef std::shared_ptr<fastjet::GhostedAreaSpec> ActiveAreaSpecPtr;
27  typedef std::shared_ptr<fastjet::RangeDefinition> RangeDefPtr;
28  typedef std::shared_ptr<fastjet::JetDefinition> JetDefPtr;
29 
31  virtual ~PileUpSubtractor() { ; }
32 
33  virtual void setDefinition(JetDefPtr const& jetDef);
34  virtual void reset(std::vector<edm::Ptr<reco::Candidate> >& input,
35  std::vector<fastjet::PseudoJet>& towers,
36  std::vector<fastjet::PseudoJet>& output);
37  virtual void setupGeometryMap(edm::Event& iEvent, const edm::EventSetup& iSetup);
38  virtual void calculatePedestal(std::vector<fastjet::PseudoJet> const& coll);
39  virtual void subtractPedestal(std::vector<fastjet::PseudoJet>& coll);
40  virtual void calculateOrphanInput(std::vector<fastjet::PseudoJet>& orphanInput);
41  virtual void offsetCorrectJets();
42  virtual double getMeanAtTower(const reco::CandidatePtr& in) const;
43  virtual double getSigmaAtTower(const reco::CandidatePtr& in) const;
44  virtual double getPileUpAtTower(const reco::CandidatePtr& in) const;
45  virtual double getPileUpEnergy(int ijet) const { return jetOffset_[ijet]; }
46  virtual double getCone(double cone, double eta, double phi, double& et, double& pu);
47  int getN(const reco::CandidatePtr& in) const;
48  int getNwithJets(const reco::CandidatePtr& in) const;
49 
50  int ieta(const reco::CandidatePtr& in) const;
51  int iphi(const reco::CandidatePtr& in) const;
52 
53 protected:
54  // From jet producer
55  JetDefPtr fjJetDefinition_; // fastjet jet definition
56  ClusterSequencePtr fjClusterSeq_; // fastjet cluster sequence
57  std::vector<edm::Ptr<reco::Candidate> >* inputs_; // input candidates
58  std::vector<fastjet::PseudoJet>* fjInputs_; // fastjet inputs
59  std::vector<fastjet::PseudoJet>* fjJets_; // fastjet jets
60  std::vector<fastjet::PseudoJet> fjOriginalInputs_; // to back-up unsubtracted fastjet inputs
61 
62  // PU subtraction parameters
63  bool reRunAlgo_;
66  double jetPtMin_;
67  double puPtMin_;
68 
69  double ghostEtaMax;
71  double ghostArea;
72 
73  double nSigmaPU_; // number of sigma for pileup
74  double radiusPU_; // pileup radius
75  ActiveAreaSpecPtr fjActiveArea_; // fastjet active area definition
76  CaloGeometry const* geo_; // geometry
77  int ietamax_; // maximum eta in geometry
78  int ietamin_; // minimum eta in geometry
79  std::vector<HcalDetId> allgeomid_; // all det ids in the geometry
80  std::map<int, int> geomtowers_; // map of geometry towers to det id
81  std::map<int, int> ntowersWithJets_; // number of towers with jets
82  std::map<int, double> esigma_; // energy sigma
83  std::map<int, double> emean_; // energy mean
84 
85  std::vector<double> jetOffset_;
86 };
87 
89 namespace edm {
90  class ParameterSet;
91  class EventSetup;
92  class ConsumesCollector;
93 } // namespace edm
96 
97 #endif
PileUpSubtractor::ClusterSequencePtr
std::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
Definition: PileUpSubtractor.h:25
ConfigurationDescriptions.h
PluginFactory.h
CaloJet.h
PileUpSubtractor::ieta
int ieta(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:327
PileUpSubtractor::iphi
int iphi(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:338
input
static const std::string input
Definition: EdmProvDump.cc:48
PileUpSubtractor::reset
virtual void reset(std::vector< edm::Ptr< reco::Candidate > > &input, std::vector< fastjet::PseudoJet > &towers, std::vector< fastjet::PseudoJet > &output)
Definition: PileUpSubtractor.cc:41
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
PileUpSubtractor::ghostArea
double ghostArea
Definition: PileUpSubtractor.h:71
PileUpSubtractor::getSigmaAtTower
virtual double getSigmaAtTower(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:304
edm
HLT enums.
Definition: AlignableModifier.h:19
PileUpSubtractor::puPtMin_
double puPtMin_
Definition: PileUpSubtractor.h:67
PileUpSubtractor::JetDefPtr
std::shared_ptr< fastjet::JetDefinition > JetDefPtr
Definition: PileUpSubtractor.h:28
PileUpSubtractor::doRhoFastjet_
bool doRhoFastjet_
Definition: PileUpSubtractor.h:65
PileUpSubtractor::allgeomid_
std::vector< HcalDetId > allgeomid_
Definition: PileUpSubtractor.h:79
PileUpSubtractor::getMeanAtTower
virtual double getMeanAtTower(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:299
CandidateFwd.h
PileUpSubtractor::fjActiveArea_
ActiveAreaSpecPtr fjActiveArea_
Definition: PileUpSubtractor.h:75
PileUpSubtractor::setupGeometryMap
virtual void setupGeometryMap(edm::Event &iEvent, const edm::EventSetup &iSetup)
Definition: PileUpSubtractor.cc:57
CaloGeometry
Definition: CaloGeometry.h:21
PileUpSubtractor::ActiveAreaSpecPtr
std::shared_ptr< fastjet::GhostedAreaSpec > ActiveAreaSpecPtr
Definition: PileUpSubtractor.h:26
PileUpSubtractor::~PileUpSubtractor
virtual ~PileUpSubtractor()
Definition: PileUpSubtractor.h:31
PileUpSubtractor::setDefinition
virtual void setDefinition(JetDefPtr const &jetDef)
Definition: PileUpSubtractor.cc:53
hltPFPuppi_cfi.cone
cone
Definition: hltPFPuppi_cfi.py:32
PVValHelper::eta
Definition: PVValidationHelpers.h:69
PileUpSubtractor::doAreaFastjet_
bool doAreaFastjet_
Definition: PileUpSubtractor.h:64
PileUpSubtractor::PileUpSubtractor
PileUpSubtractor(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
Definition: PileUpSubtractor.cc:20
PileUpSubtractor::getCone
virtual double getCone(double cone, double eta, double phi, double &et, double &pu)
Definition: PileUpSubtractor.cc:283
ParameterSetDescription.h
PileUpSubtractor::geo_
CaloGeometry const * geo_
Definition: PileUpSubtractor.h:76
PileUpSubtractor::getPileUpAtTower
virtual double getPileUpAtTower(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:309
PileUpSubtractor::calculateOrphanInput
virtual void calculateOrphanInput(std::vector< fastjet::PseudoJet > &orphanInput)
Definition: PileUpSubtractor.cc:186
PileUpSubtractor::calculatePedestal
virtual void calculatePedestal(std::vector< fastjet::PseudoJet > const &coll)
Definition: PileUpSubtractor.cc:98
PileUpSubtractor::jetOffset_
std::vector< double > jetOffset_
Definition: PileUpSubtractor.h:85
PileUpSubtractor::getPileUpEnergy
virtual double getPileUpEnergy(int ijet) const
Definition: PileUpSubtractor.h:45
PileUpSubtractor::fjOriginalInputs_
std::vector< fastjet::PseudoJet > fjOriginalInputs_
Definition: PileUpSubtractor.h:60
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ParameterSet
Definition: Functions.h:16
PileUpSubtractor
Definition: PileUpSubtractor.h:23
edmplugin::PluginFactory
Definition: PluginFactory.h:34
HcalDetId.h
PileUpSubtractor::fjJets_
std::vector< fastjet::PseudoJet > * fjJets_
Definition: PileUpSubtractor.h:59
recoMuon::in
Definition: RecoMuonEnumerators.h:6
PileUpSubtractor::fjJetDefinition_
JetDefPtr fjJetDefinition_
Definition: PileUpSubtractor.h:55
PileUpSubtractor::geomtowers_
std::map< int, int > geomtowers_
Definition: PileUpSubtractor.h:80
iEvent
int iEvent
Definition: GenABIO.cc:224
PileUpSubtractor::esigma_
std::map< int, double > esigma_
Definition: PileUpSubtractor.h:82
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
edm::EventSetup
Definition: EventSetup.h:57
PileUpSubtractor::reRunAlgo_
bool reRunAlgo_
Definition: PileUpSubtractor.h:63
JetDefPtr
std::shared_ptr< fastjet::JetDefinition > JetDefPtr
Definition: JetFlavourClustering.cc:109
edm::Ptr< reco::Candidate >
DDAxes::phi
PileUpSubtractor::ghostEtaMax
double ghostEtaMax
Definition: PileUpSubtractor.h:69
PileUpSubtractor::fjInputs_
std::vector< fastjet::PseudoJet > * fjInputs_
Definition: PileUpSubtractor.h:58
HLT_2018_cff.towers
towers
Definition: HLT_2018_cff.py:35030
PileUpSubtractor::offsetCorrectJets
virtual void offsetCorrectJets()
Definition: PileUpSubtractor.cc:241
PileUpSubtractor::ietamin_
int ietamin_
Definition: PileUpSubtractor.h:78
PileUpSubtractor::getNwithJets
int getNwithJets(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:321
PileUpSubtractor::ietamax_
int ietamax_
Definition: PileUpSubtractor.h:77
PileUpSubtractor::nSigmaPU_
double nSigmaPU_
Definition: PileUpSubtractor.h:73
PileUpSubtractor::inputs_
std::vector< edm::Ptr< reco::Candidate > > * inputs_
Definition: PileUpSubtractor.h:57
CaloGeometry.h
PileUpSubtractor::jetPtMin_
double jetPtMin_
Definition: PileUpSubtractor.h:66
EventSetup.h
PileUpSubtractor::activeAreaRepeats
int activeAreaRepeats
Definition: PileUpSubtractor.h:70
PileUpSubtractor::getN
int getN(const reco::CandidatePtr &in) const
Definition: PileUpSubtractor.cc:314
muons2muons_cfi.pu
pu
Definition: muons2muons_cfi.py:31
ConsumesCollector.h
EventSetup
ParameterSet.h
PileUpSubtractor::ntowersWithJets_
std::map< int, int > ntowersWithJets_
Definition: PileUpSubtractor.h:81
edm::Event
Definition: Event.h:73
PileUpSubtractor::RangeDefPtr
std::shared_ptr< fastjet::RangeDefinition > RangeDefPtr
Definition: PileUpSubtractor.h:27
PileUpSubtractor::radiusPU_
double radiusPU_
Definition: PileUpSubtractor.h:74
PileUpSubtractor::emean_
std::map< int, double > emean_
Definition: PileUpSubtractor.h:83
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
PileUpSubtractor::subtractPedestal
virtual void subtractPedestal(std::vector< fastjet::PseudoJet > &coll)
Definition: PileUpSubtractor.cc:159
PileUpSubtractor::fjClusterSeq_
ClusterSequencePtr fjClusterSeq_
Definition: PileUpSubtractor.h:56