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.
5 
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 }
58 
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 }
104 
T getParameter(std::string const &) const
virtual void produce(edm::Event &e, const edm::EventSetup &c)
algo_(conf.existsAs< bool >("Correct")?conf.getParameter< bool >("Correct"):true, conf.getParameter< double >("e9e25Cut"), conf.getParameter< double >("intercept2DCut"), conf.existsAs< bool >("intercept2DSlope")?conf.getParameter< double >("intercept2DSlope"):defaultSlope2D_, conf.getParameter< std::vector< double > >("e1e9Cut"), conf.getParameter< std::vector< double > >("eCOREe9Cut"), conf.getParameter< std::vector< double > >("eSeLCut"), hfvars_)
CaloTowersReCreator(const edm::ParameterSet &ps)
CaloTowersCreationAlgo algo_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
void rescaleTowers(const CaloTowerCollection &ctInput, CaloTowerCollection &ctResult)
edm::EDGetTokenT< CaloTowerCollection > tok_calo_
bool isValid() const
Definition: HandleBase.h:76
tuple conf
Definition: dbtoconf.py:185
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
edm::SortedCollection< CaloTower > CaloTowerCollection
Definition: CaloTowerFwd.h:15
volatile std::atomic< bool > shutdown_flag false
void setGeometry(const CaloTowerConstituentsMap *cttopo, const HcalTopology *htopo, const CaloGeometry *geo)