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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 6 of file CaloTowersReCreator.cc.

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

6  :
7  algo_(0.,0., false, false, false, false, 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0., // thresholds cannot be reapplied
8  conf.getParameter<std::vector<double> >("EBGrid"),
9  conf.getParameter<std::vector<double> >("EBWeights"),
10  conf.getParameter<std::vector<double> >("EEGrid"),
11  conf.getParameter<std::vector<double> >("EEWeights"),
12  conf.getParameter<std::vector<double> >("HBGrid"),
13  conf.getParameter<std::vector<double> >("HBWeights"),
14  conf.getParameter<std::vector<double> >("HESGrid"),
15  conf.getParameter<std::vector<double> >("HESWeights"),
16  conf.getParameter<std::vector<double> >("HEDGrid"),
17  conf.getParameter<std::vector<double> >("HEDWeights"),
18  conf.getParameter<std::vector<double> >("HOGrid"),
19  conf.getParameter<std::vector<double> >("HOWeights"),
20  conf.getParameter<std::vector<double> >("HF1Grid"),
21  conf.getParameter<std::vector<double> >("HF1Weights"),
22  conf.getParameter<std::vector<double> >("HF2Grid"),
23  conf.getParameter<std::vector<double> >("HF2Weights"),
24  conf.getParameter<double>("EBWeight"),
25  conf.getParameter<double>("EEWeight"),
26  conf.getParameter<double>("HBWeight"),
27  conf.getParameter<double>("HESWeight"),
28  conf.getParameter<double>("HEDWeight"),
29  conf.getParameter<double>("HOWeight"),
30  conf.getParameter<double>("HF1Weight"),
31  conf.getParameter<double>("HF2Weight"),
32  0.,0.,0.,
33  conf.getParameter<bool>("UseHO"),
34  // (these have no effect on recreation: here for compatibility)
35  conf.getParameter<int>("MomConstrMethod"),
36  conf.getParameter<double>("MomHBDepth"),
37  conf.getParameter<double>("MomHEDepth"),
38  conf.getParameter<double>("MomEBDepth"),
39  conf.getParameter<double>("MomEEDepth")
40 
41  ),
42  allowMissingInputs_(false)
43 {
44  tok_calo_ = consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("caloLabel"));
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  // two notes:
55  // 1) all this could go in a pset
56  // 2) not clear the instanceLabel thing
57 }
CaloTowersCreationAlgo algo_
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 59 of file CaloTowersReCreator.cc.

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

59  {
60  // get the necessary event setup objects...
64  c.get<CaloGeometryRecord>().get(pG);
65  c.get<IdealGeometryRecord>().get(htopo);
66  c.get<IdealGeometryRecord>().get(cttopo);
67 
76  algo_.setGeometry(cttopo.product(),htopo.product(),pG.product());
77 
78  algo_.begin(); // clear the internal buffer
79 
80  // Step A/C: Get Inputs and process (repeatedly)
82  e.getByToken(tok_calo_,calt);
83 
84 
85  // modified to rescale the CaloTowers directly
86  // without going through metatowers
87  // required for the algorithms that make use of individual
88  // crystal information
89 
90  if (!calt.isValid()) {
91  // can't find it!
92  if (!allowMissingInputs_) {
93  *calt; // will throw the proper exception
94  }
95  } else {
96  // Step B: Create empty output
97  std::auto_ptr<CaloTowerCollection> prod(new CaloTowerCollection());
98 
99  // step C: rescale (without going threough metataowers)
100  algo_.rescaleTowers(*calt, *prod);
101 
102  }
103 }
CaloTowersCreationAlgo algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
bool isValid() const
Definition: HandleBase.h:75
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
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().