CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTowersReCreator.cc
Go to the documentation of this file.
6 
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 }
60 
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);
126  else e.put(prod,ctEScales.instanceLabel);
127  }
128 
129 }
130 
T getParameter(std::string const &) const
virtual void produce(edm::Event &e, const edm::EventSetup &c)
CaloTowersReCreator(const edm::ParameterSet &ps)
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:85
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple conf
Definition: dbtoconf.py:185
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)