CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
HLTHcalPFClusterIsolationProducer< T1 > Class Template Reference

#include <HLTHcalPFClusterIsolationProducer.h>

Inheritance diagram for HLTHcalPFClusterIsolationProducer< T1 >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTHcalPFClusterIsolationProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTHcalPFClusterIsolationProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

typedef std::vector< T1 > T1Collection
 
typedef edm::AssociationMap
< edm::OneToValue< std::vector
< T1 >, float > > 
T1IsolationMap
 
typedef edm::Ref< T1CollectionT1Ref
 

Private Attributes

bool doRhoCorrection_
 
double drMax_
 
double drVetoBarrel_
 
double drVetoEndcap_
 
float effectiveAreaBarrel_
 
float effectiveAreaEndcap_
 
double energyBarrel_
 
double energyEndcap_
 
double etaStripBarrel_
 
double etaStripEndcap_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHCAL_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFEM_
 
edm::EDGetTokenT
< reco::PFClusterCollection
pfClusterProducerHFHAD_
 
edm::EDGetTokenT< T1CollectionrecoCandidateProducer_
 
float rhoMax_
 
edm::EDGetTokenT< double > rhoProducer_
 
float rhoScale_
 
bool useHF_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T1>
class HLTHcalPFClusterIsolationProducer< T1 >

Definition at line 29 of file HLTHcalPFClusterIsolationProducer.h.

Member Typedef Documentation

template<typename T1 >
typedef std::vector<T1> HLTHcalPFClusterIsolationProducer< T1 >::T1Collection
private

Definition at line 31 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
typedef edm::AssociationMap<edm::OneToValue<std::vector<T1>, float > > HLTHcalPFClusterIsolationProducer< T1 >::T1IsolationMap
private

Definition at line 33 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
typedef edm::Ref<T1Collection> HLTHcalPFClusterIsolationProducer< T1 >::T1Ref
private

Definition at line 32 of file HLTHcalPFClusterIsolationProducer.h.

Constructor & Destructor Documentation

template<typename T1 >
HLTHcalPFClusterIsolationProducer< T1 >::HLTHcalPFClusterIsolationProducer ( const edm::ParameterSet config)
explicit

Definition at line 20 of file HLTHcalPFClusterIsolationProducer.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

20  {
21 
22  std::string recoCandidateProducerName = "recoCandidateProducer";
23  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
24 
25  recoCandidateProducer_ = consumes<T1Collection>(config.getParameter<edm::InputTag>(recoCandidateProducerName));
26  pfClusterProducerHCAL_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHCAL"));
27  useHF_ = config.getParameter<bool>("useHF");
28  if (useHF_) {
29  pfClusterProducerHFEM_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFEM"));
30  pfClusterProducerHFHAD_ = consumes<reco::PFClusterCollection>(config.getParameter<edm::InputTag>("pfClusterProducerHFHAD"));
31  }
32 
33  drMax_ = config.getParameter<double>("drMax");
34  drVetoBarrel_ = config.getParameter<double>("drVetoBarrel");
35  drVetoEndcap_ = config.getParameter<double>("drVetoEndcap");
36  etaStripBarrel_ = config.getParameter<double>("etaStripBarrel");
37  etaStripEndcap_ = config.getParameter<double>("etaStripEndcap");
38  energyBarrel_ = config.getParameter<double>("energyBarrel");
39  energyEndcap_ = config.getParameter<double>("energyEndcap");
40 
41  doRhoCorrection_ = config.getParameter<bool>("doRhoCorrection");
42  if (doRhoCorrection_)
43  rhoProducer_ = consumes<double>(config.getParameter<edm::InputTag>("rhoProducer"));
44 
45  rhoMax_ = config.getParameter<double>("rhoMax");
46  rhoScale_ = config.getParameter<double>("rhoScale");
47  effectiveAreaBarrel_ = config.getParameter<double>("effectiveAreaBarrel");
48  effectiveAreaEndcap_ = config.getParameter<double>("effectiveAreaEndcap");
49 
50  produces <T1IsolationMap >();
51 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_

Definition at line 54 of file HLTHcalPFClusterIsolationProducer.cc.

55 {}

Member Function Documentation

template<typename T1 >
void HLTHcalPFClusterIsolationProducer< T1 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 58 of file HLTHcalPFClusterIsolationProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::ifValue(), mergeVDriftHistosByStation::name, or, and AlCaHLTBitMon_QueryRunRegistry::string.

58  {
59 
60  std::string recoCandidateProducerName = "recoCandidateProducer";
61  if ((typeid(HLTHcalPFClusterIsolationProducer<T1>) == typeid(HLTHcalPFClusterIsolationProducer<reco::RecoEcalCandidate>))) recoCandidateProducerName = "recoEcalCandidateProducer";
62 
64  desc.add<edm::InputTag>(recoCandidateProducerName, edm::InputTag("hltL1SeededRecoEcalCandidatePF"));
65  desc.add<edm::InputTag>("pfClusterProducerHCAL", edm::InputTag("hltParticleFlowClusterHCAL"));
66  desc.ifValue(edm::ParameterDescription<bool>("useHF", false, true),
67  true >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag("hltParticleFlowClusterHFEM"), true) and
68  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag("hltParticleFlowClusterHFHAD"), true)) or
69  false >> (edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFEM", edm::InputTag(""), true) and
70  edm::ParameterDescription<edm::InputTag>("pfClusterProducerHFHAD", edm::InputTag(""), true)));
71  desc.add<edm::InputTag>("rhoProducer", edm::InputTag("fixedGridRhoFastjetAllCalo"));
72  desc.add<bool>("doRhoCorrection", false);
73  desc.add<double>("rhoMax", 9.9999999E7);
74  desc.add<double>("rhoScale", 1.0);
75  desc.add<double>("effectiveAreaBarrel", 0.101);
76  desc.add<double>("effectiveAreaEndcap", 0.046);
77  desc.add<double>("drMax", 0.3);
78  desc.add<double>("drVetoBarrel", 0.0);
79  desc.add<double>("drVetoEndcap", 0.0);
80  desc.add<double>("etaStripBarrel", 0.0);
81  desc.add<double>("etaStripEndcap", 0.0);
82  desc.add<double>("energyBarrel", 0.0);
83  desc.add<double>("energyEndcap", 0.0);
84  descriptions.add(std::string("hlt")+std::string(typeid(HLTHcalPFClusterIsolationProducer<T1>).name()), desc);
85 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
ParameterDescriptionBase * add(U const &iLabel, T const &value)
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::auto_ptr< ParameterDescriptionCases< T > > cases)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T1 >
void HLTHcalPFClusterIsolationProducer< T1 >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 88 of file HLTHcalPFClusterIsolationProducer.cc.

References deltaR(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, reco::PFCluster::energy(), reco::CaloCluster::eta(), edm::Event::getByToken(), i, edm::AssociationMap< Tag >::insert(), reco::CaloCluster::phi(), edm::Handle< T >::product(), reco::PFCluster::pt(), edm::Event::put(), and rho.

88  {
89 
90  edm::Handle<double> rhoHandle;
91  double rho = 0.0;
92  if (doRhoCorrection_) {
93  iEvent.getByToken(rhoProducer_, rhoHandle);
94  rho = *(rhoHandle.product());
95  }
96 
97  if (rho > rhoMax_)
98  rho = rhoMax_;
99 
100  rho = rho*rhoScale_;
101 
102  edm::Handle<T1Collection> recoCandHandle;
103  edm::Handle<reco::PFClusterCollection> clusterHcalHandle;
104  edm::Handle<reco::PFClusterCollection> clusterHfemHandle;
105  edm::Handle<reco::PFClusterCollection> clusterHfhadHandle;
106 
107  iEvent.getByToken(recoCandidateProducer_,recoCandHandle);
108  iEvent.getByToken(pfClusterProducerHCAL_, clusterHcalHandle);
109  const reco::PFClusterCollection* forIsolationHcal = clusterHcalHandle.product();
110 
111  if (useHF_) {
112  iEvent.getByToken(pfClusterProducerHFEM_, clusterHfemHandle);
113  iEvent.getByToken(pfClusterProducerHFHAD_, clusterHfhadHandle);
114  }
115 
116  T1IsolationMap recoCandMap;
117 
118  float dRVeto = -1.;
119  float etaStrip = -1;
120 
121  for (unsigned int iReco = 0; iReco < recoCandHandle->size(); iReco++) {
122  T1Ref candRef(recoCandHandle, iReco);
123 
124  if (fabs(candRef->eta()) < 1.479) {
125  dRVeto = drVetoBarrel_;
126  etaStrip = etaStripBarrel_;
127  } else {
128  dRVeto = drVetoEndcap_;
129  etaStrip = etaStripEndcap_;
130  }
131 
132  float sum = 0;
133 
134  // Loop over the 3 types of PFClusters
135 
136  for(unsigned i=0; i<forIsolationHcal->size(); i++) {
137  const reco::PFCluster& pfclu = (*forIsolationHcal)[i];
138 
139  if (fabs(candRef->eta()) < 1.479) {
140  if (fabs(pfclu.pt()) < energyBarrel_)
141  continue;
142  } else {
143  if (fabs(pfclu.energy()) < energyEndcap_)
144  continue;
145  }
146 
147  float dEta = fabs(candRef->eta() - pfclu.eta());
148  if(dEta < etaStrip) continue;
149 
150  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
151  if(dR > drMax_ || dR < dRVeto) continue;
152 
153  sum += pfclu.pt();
154  }
155 
156  if (useHF_) {
157  const reco::PFClusterCollection* forIsolationHfem = clusterHfemHandle.product();
158  const reco::PFClusterCollection* forIsolationHfhad = clusterHfhadHandle.product();
159 
160  for(unsigned i=0; i<forIsolationHfem->size(); i++) {
161  const reco::PFCluster& pfclu = (*forIsolationHfem)[i];
162 
163  if (fabs(candRef->eta()) < 1.479) {
164  if (fabs(pfclu.pt()) < energyBarrel_)
165  continue;
166  } else {
167  if (fabs(pfclu.energy()) < energyEndcap_)
168  continue;
169  }
170 
171  float dEta = fabs(candRef->eta() - pfclu.eta());
172  if(dEta < etaStrip) continue;
173 
174  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
175  if(dR > drMax_ || dR < dRVeto) continue;
176 
177  sum += pfclu.pt();
178  }
179 
180  for(unsigned i=0; i<forIsolationHfhad->size(); i++) {
181  const reco::PFCluster& pfclu = (*forIsolationHfhad)[i];
182 
183  if (fabs(candRef->eta()) < 1.479) {
184  if (fabs(pfclu.pt()) < energyBarrel_)
185  continue;
186  } else {
187  if (fabs(pfclu.energy()) < energyEndcap_)
188  continue;
189  }
190 
191  float dEta = fabs(candRef->eta() - pfclu.eta());
192  if(dEta < etaStrip) continue;
193 
194  float dR = deltaR(candRef->eta(), candRef->phi(), pfclu.eta(), pfclu.phi());
195  if(dR > drMax_ || dR < dRVeto) continue;
196 
197  sum += pfclu.pt();
198  }
199  }
200 
201  if (doRhoCorrection_) {
202  if (fabs(candRef->eta()) < 1.479)
203  sum = sum - rho*effectiveAreaBarrel_;
204  else
205  sum = sum - rho*effectiveAreaEndcap_;
206  }
207 
208  recoCandMap.insert(candRef, sum);
209  }
210 
211  std::auto_ptr<T1IsolationMap> mapForEvent(new T1IsolationMap(recoCandMap));
212  iEvent.put(mapForEvent);
213 }
int i
Definition: DBlmapReader.cc:9
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
Definition: DDAxes.h:10
double pt() const
transverse momentum, massless approximation
Definition: PFCluster.h:135
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:161
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
double energy() const
cluster energy
Definition: PFCluster.h:79
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFEM_
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHFHAD_
edm::EDGetTokenT< T1Collection > recoCandidateProducer_
T const * product() const
Definition: Handle.h:81
edm::AssociationMap< edm::OneToValue< std::vector< T1 >, float > > T1IsolationMap
std::vector< PFCluster > PFClusterCollection
collection of PFCluster objects
Definition: PFClusterFwd.h:9
double phi() const
azimuthal angle of cluster centroid
Definition: CaloCluster.h:164
edm::EDGetTokenT< reco::PFClusterCollection > pfClusterProducerHCAL_

Member Data Documentation

template<typename T1 >
bool HLTHcalPFClusterIsolationProducer< T1 >::doRhoCorrection_
private

Definition at line 60 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::drMax_
private

Definition at line 50 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::drVetoBarrel_
private

Definition at line 51 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::drVetoEndcap_
private

Definition at line 52 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
float HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreaBarrel_
private

Definition at line 58 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
float HLTHcalPFClusterIsolationProducer< T1 >::effectiveAreaEndcap_
private

Definition at line 59 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::energyBarrel_
private

Definition at line 55 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::energyEndcap_
private

Definition at line 56 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::etaStripBarrel_
private

Definition at line 53 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
double HLTHcalPFClusterIsolationProducer< T1 >::etaStripEndcap_
private

Definition at line 54 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHCAL_
private

Definition at line 45 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFEM_
private

Definition at line 46 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
edm::EDGetTokenT<reco::PFClusterCollection> HLTHcalPFClusterIsolationProducer< T1 >::pfClusterProducerHFHAD_
private

Definition at line 47 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
edm::EDGetTokenT<T1Collection> HLTHcalPFClusterIsolationProducer< T1 >::recoCandidateProducer_
private

Definition at line 44 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
float HLTHcalPFClusterIsolationProducer< T1 >::rhoMax_
private

Definition at line 62 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
edm::EDGetTokenT<double> HLTHcalPFClusterIsolationProducer< T1 >::rhoProducer_
private

Definition at line 48 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
float HLTHcalPFClusterIsolationProducer< T1 >::rhoScale_
private

Definition at line 61 of file HLTHcalPFClusterIsolationProducer.h.

template<typename T1 >
bool HLTHcalPFClusterIsolationProducer< T1 >::useHF_
private

Definition at line 64 of file HLTHcalPFClusterIsolationProducer.h.