CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloRecHitCandidateProducer Class Reference

#include <CaloRecHitCandidateProducer.h>

Inheritance diagram for CaloRecHitCandidateProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 CaloRecHitCandidateProducer (const edm::ParameterSet &)
 
double cellTresholdAndWeight (const CaloRecHit &, const HcalTopology &) const
 
void produce (edm::Event &, const edm::EventSetup &)
 
 ~CaloRecHitCandidateProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Attributes

bool mAllowMissingInputs
 
double mEBthreshold
 
double mEBweight
 
std::vector< edm::InputTagmEcalLabels
 
double mEEthreshold
 
double mEEweight
 
edm::InputTag mHBHELabel
 source collection tag More...
 
double mHBthreshold
 
double mHBweight
 
double mHEDthreshold
 
double mHEDweight
 
double mHESthreshold
 
double mHESweight
 
double mHF1threshold
 
double mHF1weight
 
double mHF2threshold
 
double mHF2weight
 
edm::InputTag mHFLabel
 
edm::InputTag mHOLabel
 
double mHOthreshold
 
double mHOweight
 
bool mUseHO
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 13 of file CaloRecHitCandidateProducer.h.

Constructor & Destructor Documentation

CaloRecHitCandidateProducer::CaloRecHitCandidateProducer ( const edm::ParameterSet fConfig)

Definition at line 67 of file CaloRecHitCandidateProducer.cc.

68  : mHBHELabel (fConfig.getParameter<edm::InputTag>("hbheInput")),
69  mHOLabel (fConfig.getParameter<edm::InputTag>("hoInput")),
70  mHFLabel (fConfig.getParameter<edm::InputTag>("hfInput")),
71  mEcalLabels (fConfig.getParameter<std::vector<edm::InputTag> >("ecalInputs")),
72  mAllowMissingInputs (fConfig.getUntrackedParameter<bool>("AllowMissingInputs",false)),
73  mUseHO (fConfig.getParameter<bool>("UseHO")),
74 
75  mEBthreshold (fConfig.getParameter<double>("EBThreshold")),
76  mEEthreshold (fConfig.getParameter<double>("EEThreshold")),
77  mHBthreshold (fConfig.getParameter<double>("HBThreshold")),
78  mHESthreshold (fConfig.getParameter<double>("HESThreshold")),
79  mHEDthreshold (fConfig.getParameter<double>("HEDThreshold")),
80  mHOthreshold (fConfig.getParameter<double>("HOThreshold")),
81  mHF1threshold (fConfig.getParameter<double>("HF1Threshold")),
82  mHF2threshold (fConfig.getParameter<double>("HF2Threshold")),
83  mEBweight (fConfig.getParameter<double>("EBWeight")),
84  mEEweight (fConfig.getParameter<double>("EEWeight")),
85  mHBweight (fConfig.getParameter<double>("HBWeight")),
86  mHESweight (fConfig.getParameter<double>("HESWeight")),
87  mHEDweight (fConfig.getParameter<double>("HEDWeight")),
88  mHOweight (fConfig.getParameter<double>("HOWeight")),
89  mHF1weight (fConfig.getParameter<double>("HF1Weight")),
90  mHF2weight (fConfig.getParameter<double>("HF2Weight"))
91 {
92  produces<CandidateCollection>();
93 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< edm::InputTag > mEcalLabels
edm::InputTag mHBHELabel
source collection tag
CaloRecHitCandidateProducer::~CaloRecHitCandidateProducer ( )
inline

Definition at line 16 of file CaloRecHitCandidateProducer.h.

16 { }

Member Function Documentation

double CaloRecHitCandidateProducer::cellTresholdAndWeight ( const CaloRecHit fHit,
const HcalTopology fTopology 
) const

Definition at line 158 of file CaloRecHitCandidateProducer.cc.

References HcalDetId::depth(), DetId::det(), CaloRecHit::detid(), DetId::Ecal, EcalBarrel, EcalEndcap, CaloRecHit::energy(), HcalTopology::firstHEDoublePhiRing(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ietaAbs(), mEBthreshold, mEBweight, mEEthreshold, mEEweight, mHBthreshold, mHBweight, mHEDthreshold, mHEDweight, mHESthreshold, mHESweight, mHF1threshold, mHF1weight, mHF2threshold, mHF2weight, mHOthreshold, mHOweight, HcalDetId::subdet(), DetId::subdetId(), and crabWrap::threshold.

158  {
159  double weight = 0;
160  double threshold = 0;
161  DetId detId = fHit.detid ();
162  DetId::Detector det = detId.det ();
163  if(det == DetId::Ecal) {
164  // may or may not be EB. We'll find out.
165 
166  EcalSubdetector subdet = (EcalSubdetector)(detId.subdetId());
167  if(subdet == EcalBarrel) {
168  threshold = mEBthreshold;
169  weight = mEBweight;
170  }
171  else if(subdet == EcalEndcap) {
172  threshold = mEEthreshold;
173  weight = mEEweight;
174  }
175  }
176  else if(det == DetId::Hcal) {
177  HcalDetId hcalDetId(detId);
178  HcalSubdetector subdet = hcalDetId.subdet();
179 
180  if(subdet == HcalBarrel) {
181  threshold = mHBthreshold;
182  weight = mHBweight;
183  }
184 
185  else if(subdet == HcalEndcap) {
186  // check if it's single or double tower
187  if(hcalDetId.ietaAbs() < fTopology.firstHEDoublePhiRing()) {
188  threshold = mHESthreshold;
189  weight = mHESweight;
190  }
191  else {
192  threshold = mHEDthreshold;
193  weight = mHEDweight;
194  }
195  } else if(subdet == HcalOuter) {
196  threshold = mHOthreshold;
197  weight = mHOweight;
198  } else if(subdet == HcalForward) {
199  if(hcalDetId.depth() == 1) {
200  threshold = mHF1threshold;
201  weight = mHF1weight;
202  } else {
203  threshold = mHF2threshold;
204  weight = mHF2weight;
205  }
206  }
207  }
208  return fHit.energy () >= threshold ? weight : 0;
209 }
const DetId & detid() const
Definition: CaloRecHit.h:21
float threshold
Definition: crabWrap.py:319
float energy() const
Definition: CaloRecHit.h:19
HcalSubdetector
Definition: HcalAssistant.h:32
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:70
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
Definition: DetId.h:20
Detector
Definition: DetId.h:26
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
EcalSubdetector
void CaloRecHitCandidateProducer::produce ( edm::Event fEvent,
const edm::EventSetup fSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 95 of file CaloRecHitCandidateProducer.cc.

References geometry, edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), edm::Event::getByLabel(), i, edm::HandleBase::isValid(), mAllowMissingInputs, mEcalLabels, mHBHELabel, mHFLabel, mHOLabel, mUseHO, convertSQLitetoXML_cfg::output, edm::Event::put(), and record.

95  {
96  // get geometry
97  // const IdealGeometryRecord& record = fSetup.template get<IdealGeometryRecord>();
98  const CaloGeometryRecord& caloRecord = fSetup.get<CaloGeometryRecord>();
100  caloRecord.get (geometry);
102  ESHandle<HcalTopology> topology;
103  record.get (topology);
104  // set Output
105  auto_ptr<CandidateCollection> output ( new CandidateCollection );
106  // get and process Inputs
108  fEvent.getByLabel(mHBHELabel,hbhe);
109  if (!hbhe.isValid()) {
110  // can't find it!
111  if (!mAllowMissingInputs) {
112  *hbhe; // will throw the proper exception
113  }
114  } else {
115  processHits (hbhe, *this, *geometry, *topology, &*output);
116  }
117 
118  if (mUseHO) {
120  fEvent.getByLabel(mHOLabel,ho);
121  if (!ho.isValid()) {
122  // can't find it!
123  if (!mAllowMissingInputs) {
124  *ho; // will throw the proper exception
125  }
126  } else {
127  processHits (ho, *this, *geometry, *topology, &*output);
128  }
129  }
130 
132  fEvent.getByLabel(mHFLabel,hf);
133  if (!hf.isValid()) {
134  // can't find it!
135  if (!mAllowMissingInputs) {
136  *hf; // will throw the proper exception
137  }
138  } else {
139  processHits (hf, *this, *geometry, *topology, &*output);
140  }
141 
142  std::vector<edm::InputTag>::const_iterator i;
143  for (i=mEcalLabels.begin(); i!=mEcalLabels.end(); i++) {
145  fEvent.getByLabel(*i,ec);
146  if (!ec.isValid()) {
147  // can't find it!
148  if (!mAllowMissingInputs) {
149  *ec; // will throw the proper exception
150  }
151  } else {
152  processHits (ec, *this, *geometry, *topology, &*output);
153  }
154  }
155  fEvent.put(output);
156 }
int i
Definition: DBlmapReader.cc:9
std::vector< edm::InputTag > mEcalLabels
JetCorrectorParameters::Record record
Definition: classes.h:11
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void get(HolderT &iHolder) const
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
edm::InputTag mHBHELabel
source collection tag
const T & get() const
Definition: EventSetup.h:55
ESHandle< TrackerGeometry > geometry

Member Data Documentation

bool CaloRecHitCandidateProducer::mAllowMissingInputs
private

Definition at line 24 of file CaloRecHitCandidateProducer.h.

Referenced by produce().

double CaloRecHitCandidateProducer::mEBthreshold
private

Definition at line 26 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mEBweight
private

Definition at line 29 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

std::vector<edm::InputTag> CaloRecHitCandidateProducer::mEcalLabels
private

Definition at line 23 of file CaloRecHitCandidateProducer.h.

Referenced by produce().

double CaloRecHitCandidateProducer::mEEthreshold
private

Definition at line 26 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mEEweight
private

Definition at line 29 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

edm::InputTag CaloRecHitCandidateProducer::mHBHELabel
private

source collection tag

Definition at line 22 of file CaloRecHitCandidateProducer.h.

Referenced by produce().

double CaloRecHitCandidateProducer::mHBthreshold
private

Definition at line 27 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHBweight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHEDthreshold
private

Definition at line 27 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHEDweight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHESthreshold
private

Definition at line 27 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHESweight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHF1threshold
private

Definition at line 28 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHF1weight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHF2threshold
private

Definition at line 28 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHF2weight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

edm::InputTag CaloRecHitCandidateProducer::mHFLabel
private

Definition at line 22 of file CaloRecHitCandidateProducer.h.

Referenced by produce().

edm::InputTag CaloRecHitCandidateProducer::mHOLabel
private

Definition at line 22 of file CaloRecHitCandidateProducer.h.

Referenced by produce().

double CaloRecHitCandidateProducer::mHOthreshold
private

Definition at line 28 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

double CaloRecHitCandidateProducer::mHOweight
private

Definition at line 30 of file CaloRecHitCandidateProducer.h.

Referenced by cellTresholdAndWeight().

bool CaloRecHitCandidateProducer::mUseHO
private

Definition at line 25 of file CaloRecHitCandidateProducer.h.

Referenced by produce().