CMS 3D CMS Logo

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

#include <CaloTowersCreator.h>

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

Public Member Functions

 CaloTowersCreator (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~CaloTowersCreator ()
 
- 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 ()
 

Public Attributes

double EBEScale
 
double EEEScale
 
double HBEScale
 
double HEDEScale
 
double HESEScale
 
double HF1EScale
 
double HF2EScale
 
double HOEScale
 

Static Private Member Functions

static const std::vector
< double > & 
getGridValues ()
 

Private Attributes

CaloTowersCreationAlgo algo_
 
bool allowMissingInputs_
 
edm::ESWatcher
< IdealGeometryRecord
caloTowerConstituentsWatcher_
 
std::vector< edm::InputTagecalLabels_
 
edm::InputTag hbheLabel_
 
edm::ESWatcher
< HcalChannelQualityRcd
hcalChStatusWatcher_
 
edm::ESWatcher
< HcalSeverityLevelComputerRcd
hcalSevLevelWatcher_
 
edm::InputTag hfLabel_
 
edm::InputTag hoLabel_
 
unsigned int theEcalAcceptSeverityLevel_
 
unsigned int theEcalAcceptSeverityLevelForRejectedHit_
 
unsigned int theHcalAcceptSeverityLevel_
 
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
 
bool theRecoveredEcalHitsAreUsed_
 
bool theRecoveredHcalHitsAreUsed_
 
bool useRejectedHitsOnly_
 
bool useRejectedRecoveredEcalHits_
 
bool useRejectedRecoveredHcalHits_
 

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

Date:
2010/11/24 19:52:16
Revision:
1.7

Original author: J. Mans - Minnesota

Definition at line 27 of file CaloTowersCreator.h.

Constructor & Destructor Documentation

CaloTowersCreator::CaloTowersCreator ( const edm::ParameterSet ps)
explicit

Definition at line 31 of file CaloTowersCreator.cc.

References EBEScale, EScales::EBScale, EEEScale, EScales::EEScale, HBEScale, EScales::HBScale, HEDEScale, EScales::HEDScale, HESEScale, EScales::HESScale, HF1EScale, EScales::HF1Scale, HF2EScale, EScales::HF2Scale, HOEScale, EScales::HOScale, and EScales::instanceLabel.

31  :
32  algo_(conf.getParameter<double>("EBThreshold"),
33  conf.getParameter<double>("EEThreshold"),
34 
35  conf.getParameter<bool>("UseEtEBTreshold"),
36  conf.getParameter<bool>("UseEtEETreshold"),
37  conf.getParameter<bool>("UseSymEBTreshold"),
38  conf.getParameter<bool>("UseSymEETreshold"),
39 
40 
41  conf.getParameter<double>("HcalThreshold"),
42  conf.getParameter<double>("HBThreshold"),
43  conf.getParameter<double>("HESThreshold"),
44  conf.getParameter<double>("HEDThreshold"),
45  conf.getParameter<double>("HOThreshold0"),
46  conf.getParameter<double>("HOThresholdPlus1"),
47  conf.getParameter<double>("HOThresholdMinus1"),
48  conf.getParameter<double>("HOThresholdPlus2"),
49  conf.getParameter<double>("HOThresholdMinus2"),
50  conf.getParameter<double>("HF1Threshold"),
51  conf.getParameter<double>("HF2Threshold"),
52  conf.getParameter<std::vector<double> >("EBGrid"),
53  conf.getParameter<std::vector<double> >("EBWeights"),
54  conf.getParameter<std::vector<double> >("EEGrid"),
55  conf.getParameter<std::vector<double> >("EEWeights"),
56  conf.getParameter<std::vector<double> >("HBGrid"),
57  conf.getParameter<std::vector<double> >("HBWeights"),
58  conf.getParameter<std::vector<double> >("HESGrid"),
59  conf.getParameter<std::vector<double> >("HESWeights"),
60  conf.getParameter<std::vector<double> >("HEDGrid"),
61  conf.getParameter<std::vector<double> >("HEDWeights"),
62  conf.getParameter<std::vector<double> >("HOGrid"),
63  conf.getParameter<std::vector<double> >("HOWeights"),
64  conf.getParameter<std::vector<double> >("HF1Grid"),
65  conf.getParameter<std::vector<double> >("HF1Weights"),
66  conf.getParameter<std::vector<double> >("HF2Grid"),
67  conf.getParameter<std::vector<double> >("HF2Weights"),
68  conf.getParameter<double>("EBWeight"),
69  conf.getParameter<double>("EEWeight"),
70  conf.getParameter<double>("HBWeight"),
71  conf.getParameter<double>("HESWeight"),
72  conf.getParameter<double>("HEDWeight"),
73  conf.getParameter<double>("HOWeight"),
74  conf.getParameter<double>("HF1Weight"),
75  conf.getParameter<double>("HF2Weight"),
76  conf.getParameter<double>("EcutTower"),
77  conf.getParameter<double>("EBSumThreshold"),
78  conf.getParameter<double>("EESumThreshold"),
79  conf.getParameter<bool>("UseHO"),
80  // (for momentum reconstruction algorithm)
81  conf.getParameter<int>("MomConstrMethod"),
82  conf.getParameter<double>("MomHBDepth"),
83  conf.getParameter<double>("MomHEDepth"),
84  conf.getParameter<double>("MomEBDepth"),
85  conf.getParameter<double>("MomEEDepth")
86  ),
87 
88  hbheLabel_(conf.getParameter<edm::InputTag>("hbheInput")),
89  hoLabel_(conf.getParameter<edm::InputTag>("hoInput")),
90  hfLabel_(conf.getParameter<edm::InputTag>("hfInput")),
91  ecalLabels_(conf.getParameter<std::vector<edm::InputTag> >("ecalInputs")),
92  allowMissingInputs_(conf.getParameter<bool>("AllowMissingInputs")),
93 
94  theHcalAcceptSeverityLevel_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevel")),
95  theEcalAcceptSeverityLevel_(conf.getParameter<unsigned int>("EcalAcceptSeverityLevel")),
96 
97  theRecoveredHcalHitsAreUsed_(conf.getParameter<bool>("UseHcalRecoveredHits")),
98  theRecoveredEcalHitsAreUsed_(conf.getParameter<bool>("UseEcalRecoveredHits")),
99 
100  // paramaters controlling the use of rejected hits
101 
102  useRejectedHitsOnly_(conf.getParameter<bool>("UseRejectedHitsOnly")),
103 
104  theHcalAcceptSeverityLevelForRejectedHit_(conf.getParameter<unsigned int>("HcalAcceptSeverityLevelForRejectedHit")),
105  theEcalAcceptSeverityLevelForRejectedHit_(conf.getParameter<unsigned int>("EcalAcceptSeverityLevelForRejectedHit")),
106  useRejectedRecoveredHcalHits_(conf.getParameter<bool>("UseRejectedRecoveredHcalHits")),
107  useRejectedRecoveredEcalHits_(conf.getParameter<bool>("UseRejectedRecoveredEcalHits"))
108 
109 
110 
111 {
120  if (EScales.instanceLabel=="") produces<CaloTowerCollection>();
121  else produces<CaloTowerCollection>(EScales.instanceLabel);
122 }
double HF2Scale
Definition: EScales.h:18
edm::InputTag hbheLabel_
unsigned int theEcalAcceptSeverityLevel_
CaloTowersCreationAlgo algo_
double EEScale
Definition: EScales.h:12
double HOScale
Definition: EScales.h:16
double HF1Scale
Definition: EScales.h:17
double HEDScale
Definition: EScales.h:15
edm::InputTag hfLabel_
edm::InputTag hoLabel_
unsigned int theEcalAcceptSeverityLevelForRejectedHit_
double EBScale
Definition: EScales.h:11
double HBScale
Definition: EScales.h:13
tuple conf
Definition: dbtoconf.py:185
std::string instanceLabel
Definition: EScales.h:19
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
unsigned int theHcalAcceptSeverityLevel_
std::vector< edm::InputTag > ecalLabels_
double HESScale
Definition: EScales.h:14
Definition: EScales.h:4
virtual CaloTowersCreator::~CaloTowersCreator ( )
inlinevirtual

Definition at line 30 of file CaloTowersCreator.h.

30 { }

Member Function Documentation

const std::vector< double > & CaloTowersCreator::getGridValues ( )
staticprivate

Definition at line 11 of file CaloTowersCreator.cc.

12 {
13  static std::vector<double> retval;
14 
15  if (retval.size() == 0)
16  {
17  retval.push_back(0.);
18  retval.push_back(10.);
19  retval.push_back(20.);
20  retval.push_back(30.);
21  retval.push_back(40.);
22  retval.push_back(50.);
23  retval.push_back(100.);
24  retval.push_back(1000.);
25  }
26 
27  return retval;
28 }
void CaloTowersCreator::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 124 of file CaloTowersCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), caloTowerConstituentsWatcher_, edm::ESWatcher< T >::check(), EBEScale, EcalBarrel, EcalEndcap, ecalLabels_, EEEScale, CaloTowersCreationAlgo::finish(), edm::EventSetup::get(), edm::Event::getByLabel(), HBEScale, hbheLabel_, hcalChStatusWatcher_, hcalSevLevelWatcher_, HEDEScale, HESEScale, HF1EScale, HF2EScale, hfLabel_, HOEScale, hoLabel_, i, EScales::instanceLabel, CaloTowersCreationAlgo::makeHcalDropChMap(), edm::productstatus::present(), CaloTowersCreationAlgo::process(), parseEventContent::prod, edm::ESHandle< class >::product(), edm::Event::put(), CaloTowersCreationAlgo::setEBEScale(), CaloTowersCreationAlgo::setEbHandle(), CaloTowersCreationAlgo::setEcalAcceptSeverityLevel(), CaloTowersCreationAlgo::setEcalAcceptSeverityLevelForRejectedHit(), CaloTowersCreationAlgo::setEcalChStatusFromDB(), CaloTowersCreationAlgo::setEcalSevLvlAlgo(), CaloTowersCreationAlgo::setEEEScale(), CaloTowersCreationAlgo::setEeHandle(), CaloTowersCreationAlgo::setGeometry(), CaloTowersCreationAlgo::setHBEScale(), CaloTowersCreationAlgo::setHcalAcceptSeverityLevel(), CaloTowersCreationAlgo::setHcalAcceptSeverityLevelForRejectedHit(), CaloTowersCreationAlgo::setHcalChStatusFromDB(), CaloTowersCreationAlgo::setHcalSevLvlComputer(), CaloTowersCreationAlgo::setHEDEScale(), CaloTowersCreationAlgo::setHESEScale(), CaloTowersCreationAlgo::setHF1EScale(), CaloTowersCreationAlgo::setHF2EScale(), CaloTowersCreationAlgo::setHOEScale(), CaloTowersCreationAlgo::setRecoveredEcalHitsAreUsed(), CaloTowersCreationAlgo::setRecoveredHcalHitsAreUsed(), CaloTowersCreationAlgo::setUseRejectedHitsOnly(), CaloTowersCreationAlgo::setUseRejectedRecoveredEcalHits(), CaloTowersCreationAlgo::setUseRejectedRecoveredHcalHits(), theEcalAcceptSeverityLevel_, theEcalAcceptSeverityLevelForRejectedHit_, theHcalAcceptSeverityLevel_, theHcalAcceptSeverityLevelForRejectedHit_, theRecoveredEcalHitsAreUsed_, theRecoveredHcalHitsAreUsed_, useRejectedHitsOnly_, useRejectedRecoveredEcalHits_, and useRejectedRecoveredHcalHits_.

124  {
125  // get the necessary event setup objects...
129  c.get<CaloGeometryRecord>().get(pG);
130  c.get<IdealGeometryRecord>().get(htopo);
131  c.get<IdealGeometryRecord>().get(cttopo);
132 
133  // ECAL channel status map ****************************************
135  c.get<EcalChannelStatusRcd>().get( ecalChStatus );
136  const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product();
137 
138  // HCAL channel status map ****************************************
139  edm::ESHandle<HcalChannelQuality> hcalChStatus;
140  c.get<HcalChannelQualityRcd>().get( hcalChStatus );
141  const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product();
142 
143  // Assignment of severity levels **********************************
144  edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
145  c.get<HcalSeverityLevelComputerRcd>().get(hcalSevLvlComputerHndl);
146  const HcalSeverityLevelComputer* hcalSevLvlComputer = hcalSevLvlComputerHndl.product();
147 
148  edm::ESHandle<EcalSeverityLevelAlgo> ecalSevLvlAlgoHndl;
149  c.get<EcalSeverityLevelAlgoRcd>().get(ecalSevLvlAlgoHndl);
150  const EcalSeverityLevelAlgo* ecalSevLvlAlgo = ecalSevLvlAlgoHndl.product();
151 
152 
161  algo_.setGeometry(cttopo.product(),htopo.product(),pG.product());
162 
163  // for treatment of problematic and anomalous cells
164 
165  algo_.setHcalChStatusFromDB(dbHcalChStatus);
166  algo_.setEcalChStatusFromDB(dbEcalChStatus);
167 
170 
173 
174  algo_.setHcalSevLvlComputer(hcalSevLvlComputer);
175  algo_.setEcalSevLvlAlgo(ecalSevLvlAlgo);
176 
177 
179 
182 
185 
186 
187 
188 
189 
190  algo_.begin(); // clear the internal buffer
191 
192  // can't chain these in a big OR statement, or else it'll
193  // get triggered for each of the first three events
194  bool check1 = hcalSevLevelWatcher_.check(c);
195  bool check2 = hcalChStatusWatcher_.check(c);
196  bool check3 = caloTowerConstituentsWatcher_.check(c);
197  if(check1 || check2 || check3)
198  {
200  }
201 
202  // ----------------------------------------------------------
203  // For ecal error handling need to
204  // have access to the EB and EE collections at the end of
205  // tower reconstruction.
206 
209 
210  for (std::vector<edm::InputTag>::const_iterator i=ecalLabels_.begin();
211  i!=ecalLabels_.end(); i++) {
212 
214 
215  if (! e.getByLabel(*i,ec_tmp) ) continue;
216  if (ec_tmp->size()==0) continue;
217 
218  // check if this is EB or EE
219  if ( (ec_tmp->begin()->detid()).subdetId() == EcalBarrel ) {
220  ebHandle = ec_tmp;
221  }
222  else if ((ec_tmp->begin()->detid()).subdetId() == EcalEndcap ) {
223  eeHandle = ec_tmp;
224  }
225 
226  }
227 
228  algo_.setEbHandle(ebHandle);
229  algo_.setEeHandle(eeHandle);
230 
231  //-----------------------------------------------------------
232 
233 
234 
235  bool present;
236 
237  // Step A/C: Get Inputs and process (repeatedly)
239  present=e.getByLabel(hbheLabel_,hbhe);
240  if (present || !allowMissingInputs_) algo_.process(*hbhe);
241 
243  present=e.getByLabel(hoLabel_,ho);
244  if (present || !allowMissingInputs_) algo_.process(*ho);
245 
247  present=e.getByLabel(hfLabel_,hf);
248  if (present || !allowMissingInputs_) algo_.process(*hf);
249 
250  std::vector<edm::InputTag>::const_iterator i;
251  for (i=ecalLabels_.begin(); i!=ecalLabels_.end(); i++) {
253  present=e.getByLabel(*i,ec);
254  if (present || !allowMissingInputs_) algo_.process(*ec);
255  }
256 
257  // Step B: Create empty output
258  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
259 
260  // Step C: Process
261  algo_.finish(*prod);
262 
263  // Step D: Put into the event
264  if (EScales.instanceLabel=="") e.put(prod);
265  else e.put(prod,EScales.instanceLabel);
266 
267 
268 }
edm::InputTag hbheLabel_
int i
Definition: DBlmapReader.cc:9
unsigned int theEcalAcceptSeverityLevel_
void setEcalChStatusFromDB(const EcalChannelStatus *s)
CaloTowersCreationAlgo algo_
void setEcalAcceptSeverityLevel(unsigned int level)
void setHcalChStatusFromDB(const HcalChannelQuality *s)
void finish(CaloTowerCollection &destCollection)
void setEeHandle(const edm::Handle< EcalRecHitCollection > ee)
void setEbHandle(const edm::Handle< EcalRecHitCollection > eb)
void setUseRejectedRecoveredEcalHits(bool flag)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
void setHcalAcceptSeverityLevelForRejectedHit(unsigned int level)
void setHcalSevLvlComputer(const HcalSeverityLevelComputer *c)
edm::InputTag hfLabel_
edm::InputTag hoLabel_
unsigned int theEcalAcceptSeverityLevelForRejectedHit_
void setRecoveredEcalHitsAreUsed(bool flag)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
edm::ESWatcher< HcalChannelQualityRcd > hcalChStatusWatcher_
void process(const HBHERecHitCollection &hbhe)
ProductStatus present()
Definition: ProductStatus.h:17
std::string instanceLabel
Definition: EScales.h:19
unsigned int theHcalAcceptSeverityLevelForRejectedHit_
void setRecoveredHcalHitsAreUsed(bool flag)
const T & get() const
Definition: EventSetup.h:55
void setEcalAcceptSeverityLevelForRejectedHit(unsigned int level)
T const * product() const
Definition: ESHandle.h:62
void setUseRejectedHitsOnly(bool flag)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
unsigned int theHcalAcceptSeverityLevel_
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerFwd.h:15
void setHcalAcceptSeverityLevel(unsigned int level)
std::vector< edm::InputTag > ecalLabels_
edm::ESWatcher< HcalSeverityLevelComputerRcd > hcalSevLevelWatcher_
void setEcalSevLvlAlgo(const EcalSeverityLevelAlgo *a)
void setUseRejectedRecoveredHcalHits(bool flag)
edm::ESWatcher< IdealGeometryRecord > caloTowerConstituentsWatcher_
void setGeometry(const CaloTowerConstituentsMap *cttopo, const HcalTopology *htopo, const CaloGeometry *geo)
Definition: EScales.h:4

Member Data Documentation

CaloTowersCreationAlgo CaloTowersCreator::algo_
private

Definition at line 39 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::allowMissingInputs_
private

Definition at line 42 of file CaloTowersCreator.h.

Referenced by produce().

edm::ESWatcher<IdealGeometryRecord> CaloTowersCreator::caloTowerConstituentsWatcher_
private

Definition at line 65 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::EBEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

std::vector<edm::InputTag> CaloTowersCreator::ecalLabels_
private

Definition at line 41 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::EEEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HBEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

edm::InputTag CaloTowersCreator::hbheLabel_
private

Definition at line 40 of file CaloTowersCreator.h.

Referenced by produce().

edm::ESWatcher<HcalChannelQualityRcd> CaloTowersCreator::hcalChStatusWatcher_
private

Definition at line 64 of file CaloTowersCreator.h.

Referenced by produce().

edm::ESWatcher<HcalSeverityLevelComputerRcd> CaloTowersCreator::hcalSevLevelWatcher_
private

Definition at line 63 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::HEDEScale

Definition at line 33 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HESEScale

Definition at line 32 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HF1EScale

Definition at line 33 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

double CaloTowersCreator::HF2EScale

Definition at line 33 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

edm::InputTag CaloTowersCreator::hfLabel_
private

Definition at line 40 of file CaloTowersCreator.h.

Referenced by produce().

double CaloTowersCreator::HOEScale

Definition at line 33 of file CaloTowersCreator.h.

Referenced by CaloTowersCreator(), and produce().

edm::InputTag CaloTowersCreator::hoLabel_
private

Definition at line 40 of file CaloTowersCreator.h.

Referenced by produce().

unsigned int CaloTowersCreator::theEcalAcceptSeverityLevel_
private

Definition at line 48 of file CaloTowersCreator.h.

Referenced by produce().

unsigned int CaloTowersCreator::theEcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 59 of file CaloTowersCreator.h.

Referenced by produce().

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevel_
private

Definition at line 47 of file CaloTowersCreator.h.

Referenced by produce().

unsigned int CaloTowersCreator::theHcalAcceptSeverityLevelForRejectedHit_
private

Definition at line 58 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::theRecoveredEcalHitsAreUsed_
private

Definition at line 52 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::theRecoveredHcalHitsAreUsed_
private

Definition at line 51 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::useRejectedHitsOnly_
private

Definition at line 57 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::useRejectedRecoveredEcalHits_
private

Definition at line 61 of file CaloTowersCreator.h.

Referenced by produce().

bool CaloTowersCreator::useRejectedRecoveredHcalHits_
private

Definition at line 60 of file CaloTowersCreator.h.

Referenced by produce().