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::EDConsumerBase 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 ()
 
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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDGetTokenT
< CaloTowerCollection
tok_calo_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 18 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, ctEScales::instanceLabel, and tok_calo_.

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  allowMissingInputs_(false)
44 {
45  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
46 
47  EBEScale=conf.getParameter<double>("EBEScale");
48  EEEScale=conf.getParameter<double>("EEEScale");
49  HBEScale=conf.getParameter<double>("HBEScale");
50  HESEScale=conf.getParameter<double>("HESEScale");
51  HEDEScale=conf.getParameter<double>("HEDEScale");
52  HOEScale=conf.getParameter<double>("HOEScale");
53  HF1EScale=conf.getParameter<double>("HF1EScale");
54  HF2EScale=conf.getParameter<double>("HF2EScale");
55  if (ctEScales.instanceLabel=="") produces<CaloTowerCollection>();
56  else produces<CaloTowerCollection>(ctEScales.instanceLabel);
57  // two notes:
58  // 1) all this could go in a pset
59  // 2) not clear the instanceLabel thing
60 }
CaloTowersCreationAlgo algo_
std::string instanceLabel
Definition: ctEScales.h:13
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
tuple conf
Definition: dbtoconf.py:185
virtual CaloTowersReCreator::~CaloTowersReCreator ( )
inlinevirtual

Definition at line 21 of file CaloTowersReCreator.h.

21 { }

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 62 of file CaloTowersReCreator.cc.

References algo_, allowMissingInputs_, CaloTowersCreationAlgo::begin(), EBEScale, EEEScale, edm::EventSetup::get(), edm::Event::getByToken(), 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(), CaloTowersCreationAlgo::setHOEScale(), and tok_calo_.

62  {
63  // get the necessary event setup objects...
67  c.get<CaloGeometryRecord>().get(pG);
68  c.get<IdealGeometryRecord>().get(htopo);
69  c.get<IdealGeometryRecord>().get(cttopo);
70 
79  algo_.setGeometry(cttopo.product(),htopo.product(),pG.product());
80 
81  algo_.begin(); // clear the internal buffer
82 
83  // Step A/C: Get Inputs and process (repeatedly)
85  e.getByToken(tok_calo_,calt);
86 
87 /*
88  if (!calt.isValid()) {
89  // can't find it!
90  if (!allowMissingInputs_) {
91  *calt; // will throw the proper exception
92  }
93  } else {
94  algo_.process(*calt);
95  }
96 
97  // Step B: Create empty output
98  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
99 
100  // Step C: Process
101  algo_.finish(*prod);
102 
103  // Step D: Put into the event
104  if (ctEScales.instanceLabel=="") e.put(prod);
105  else e.put(prod,ctEScales.instanceLabel);
106 */
107 
108  // modified to rescale the CaloTowers directly
109  // without going through metatowers
110  // required for the algorithms that make use of individual
111  // crystal information
112 
113  if (!calt.isValid()) {
114  // can't find it!
115  if (!allowMissingInputs_) {
116  *calt; // will throw the proper exception
117  }
118  } else {
119  // Step B: Create empty output
120  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
121 
122  // step C: rescale (without going threough metataowers)
123  algo_.rescaleTowers(*calt, *prod);
124 
125  // Step D: Put into the event
126  if (ctEScales.instanceLabel=="") e.put(prod);
128  }
129 
130 }
CaloTowersCreationAlgo algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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:116
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
bool isValid() const
Definition: HandleBase.h:76
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 26 of file CaloTowersReCreator.h.

Referenced by produce().

bool CaloTowersReCreator::allowMissingInputs_
private

Definition at line 28 of file CaloTowersReCreator.h.

Referenced by produce().

double CaloTowersReCreator::EBEScale

Definition at line 23 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::EEEScale

Definition at line 23 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HBEScale

Definition at line 23 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HEDEScale

Definition at line 24 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HESEScale

Definition at line 23 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF1EScale

Definition at line 24 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HF2EScale

Definition at line 24 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

double CaloTowersReCreator::HOEScale

Definition at line 24 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().

edm::EDGetTokenT<CaloTowerCollection> CaloTowersReCreator::tok_calo_
private

Definition at line 27 of file CaloTowersReCreator.h.

Referenced by CaloTowersReCreator(), and produce().