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 | Private Attributes
CaloTowersReCreator Class Reference

#include <CaloTowersReCreator.h>

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

Public Member Functions

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

Private Attributes

CaloTowersCreationAlgo algo_
 
bool allowMissingInputs_
 
edm::InputTag caloLabel_
 

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:
2006/08/17 15:23:34
Revision:
1.0

Definition at line 21 of file CaloTowersReCreator.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file CaloTowersReCreator.cc.

References EBEScale, EEEScale, edm::ParameterSet::getParameter(), HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, HOEScale, and ctEScales::instanceLabel.

7  :
8  algo_(0.,0., false, false, false, false, 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0., // thresholds cannot be reapplied
9  conf.getParameter<std::vector<double> >("EBGrid"),
10  conf.getParameter<std::vector<double> >("EBWeights"),
11  conf.getParameter<std::vector<double> >("EEGrid"),
12  conf.getParameter<std::vector<double> >("EEWeights"),
13  conf.getParameter<std::vector<double> >("HBGrid"),
14  conf.getParameter<std::vector<double> >("HBWeights"),
15  conf.getParameter<std::vector<double> >("HESGrid"),
16  conf.getParameter<std::vector<double> >("HESWeights"),
17  conf.getParameter<std::vector<double> >("HEDGrid"),
18  conf.getParameter<std::vector<double> >("HEDWeights"),
19  conf.getParameter<std::vector<double> >("HOGrid"),
20  conf.getParameter<std::vector<double> >("HOWeights"),
21  conf.getParameter<std::vector<double> >("HF1Grid"),
22  conf.getParameter<std::vector<double> >("HF1Weights"),
23  conf.getParameter<std::vector<double> >("HF2Grid"),
24  conf.getParameter<std::vector<double> >("HF2Weights"),
25  conf.getParameter<double>("EBWeight"),
26  conf.getParameter<double>("EEWeight"),
27  conf.getParameter<double>("HBWeight"),
28  conf.getParameter<double>("HESWeight"),
29  conf.getParameter<double>("HEDWeight"),
30  conf.getParameter<double>("HOWeight"),
31  conf.getParameter<double>("HF1Weight"),
32  conf.getParameter<double>("HF2Weight"),
33  0.,0.,0.,
34  conf.getParameter<bool>("UseHO"),
35  // (these have no effect on recreation: here for compatibility)
36  conf.getParameter<int>("MomConstrMethod"),
37  conf.getParameter<double>("MomHBDepth"),
38  conf.getParameter<double>("MomHEDepth"),
39  conf.getParameter<double>("MomEBDepth"),
40  conf.getParameter<double>("MomEEDepth")
41 
42  ),
43  caloLabel_(conf.getParameter<edm::InputTag>("caloLabel")),
44  allowMissingInputs_(false)
45 {
46  EBEScale=conf.getParameter<double>("EBEScale");
47  EEEScale=conf.getParameter<double>("EEEScale");
48  HBEScale=conf.getParameter<double>("HBEScale");
49  HESEScale=conf.getParameter<double>("HESEScale");
50  HEDEScale=conf.getParameter<double>("HEDEScale");
51  HOEScale=conf.getParameter<double>("HOEScale");
52  HF1EScale=conf.getParameter<double>("HF1EScale");
53  HF2EScale=conf.getParameter<double>("HF2EScale");
54  if (ctEScales.instanceLabel=="") produces<CaloTowerCollection>();
55  else produces<CaloTowerCollection>(ctEScales.instanceLabel);
56  // two notes:
57  // 1) all this could go in a pset
58  // 2) not clear the instanceLabel thing
59 }
CaloTowersCreationAlgo algo_
std::string instanceLabel
Definition: ctEScales.h:13
tuple conf
Definition: dbtoconf.py:185
virtual CaloTowersReCreator::~CaloTowersReCreator ( )
inlinevirtual

Definition at line 24 of file CaloTowersReCreator.h.

24 { }

Member Function Documentation

void CaloTowersReCreator::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDProducer.

Definition at line 61 of file CaloTowersReCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), caloLabel_, EBEScale, EEEScale, edm::EventSetup::get(), edm::Event::getByLabel(), HBEScale, HEDEScale, HESEScale, HF1EScale, HF2EScale, HOEScale, ctEScales::instanceLabel, edm::HandleBase::isValid(), parseEventContent::prod, edm::ESHandle< class >::product(), edm::Event::put(), CaloTowersCreationAlgo::rescaleTowers(), CaloTowersCreationAlgo::setEBEScale(), CaloTowersCreationAlgo::setEEEScale(), CaloTowersCreationAlgo::setGeometry(), CaloTowersCreationAlgo::setHBEScale(), CaloTowersCreationAlgo::setHEDEScale(), CaloTowersCreationAlgo::setHESEScale(), CaloTowersCreationAlgo::setHF1EScale(), CaloTowersCreationAlgo::setHF2EScale(), and CaloTowersCreationAlgo::setHOEScale().

61  {
62  // get the necessary event setup objects...
66  c.get<CaloGeometryRecord>().get(pG);
67  c.get<IdealGeometryRecord>().get(htopo);
68  c.get<IdealGeometryRecord>().get(cttopo);
69 
78  algo_.setGeometry(cttopo.product(),htopo.product(),pG.product());
79 
80  algo_.begin(); // clear the internal buffer
81 
82  // Step A/C: Get Inputs and process (repeatedly)
84  e.getByLabel(caloLabel_,calt);
85 
86 /*
87  if (!calt.isValid()) {
88  // can't find it!
89  if (!allowMissingInputs_) {
90  *calt; // will throw the proper exception
91  }
92  } else {
93  algo_.process(*calt);
94  }
95 
96  // Step B: Create empty output
97  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
98 
99  // Step C: Process
100  algo_.finish(*prod);
101 
102  // Step D: Put into the event
103  if (ctEScales.instanceLabel=="") e.put(prod);
104  else e.put(prod,ctEScales.instanceLabel);
105 */
106 
107  // modified to rescale the CaloTowers directly
108  // without going through metatowers
109  // required for the algorithms that make use of individual
110  // crystal information
111 
112  if (!calt.isValid()) {
113  // can't find it!
114  if (!allowMissingInputs_) {
115  *calt; // will throw the proper exception
116  }
117  } else {
118  // Step B: Create empty output
119  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
120 
121  // step C: rescale (without going threough metataowers)
122  algo_.rescaleTowers(*calt, *prod);
123 
124  // Step D: Put into the event
125  if (ctEScales.instanceLabel=="") e.put(prod);
127  }
128 
129 }
CaloTowersCreationAlgo algo_
std::string instanceLabel
Definition: ctEScales.h:13
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerFwd.h:15
void setGeometry(const CaloTowerConstituentsMap *cttopo, const HcalTopology *htopo, const CaloGeometry *geo)

Member Data Documentation

CaloTowersCreationAlgo CaloTowersReCreator::algo_
private

Definition at line 29 of file CaloTowersReCreator.h.

Referenced by produce().

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 31 of file CaloTowersReCreator.h.

Referenced by produce().

edm::InputTag CaloTowersReCreator::caloLabel_
private

Definition at line 30 of file CaloTowersReCreator.h.

Referenced by produce().

double CaloTowersReCreator::EBEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::EEEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HBEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HEDEScale

Definition at line 27 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HESEScale

Definition at line 26 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF1EScale

Definition at line 27 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF2EScale

Definition at line 27 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HOEScale

Definition at line 27 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().