CMS 3D CMS Logo

EgammaRegressionContainer.cc
Go to the documentation of this file.
2 
9 
11  outputTransformer_(iConfig.getParameter<double>("rangeMin"),iConfig.getParameter<double>("rangeMax")),
12  forceHighEnergyTrainingIfSaturated_(iConfig.getParameter<bool>("forceHighEnergyTrainingIfSaturated")),
13  lowEtHighEtBoundary_(iConfig.getParameter<double>("lowEtHighEtBoundary")),
14  ebLowEtForestName_(iConfig.getParameter<std::string>("ebLowEtForestName")),
15  ebHighEtForestName_(iConfig.getParameter<std::string>("ebHighEtForestName")),
16  eeLowEtForestName_(iConfig.getParameter<std::string>("eeLowEtForestName")),
17  eeHighEtForestName_(iConfig.getParameter<std::string>("eeHighEtForestName")),
18  ebLowEtForest_(nullptr),ebHighEtForest_(nullptr),
19  eeLowEtForest_(nullptr),eeHighEtForest_(nullptr)
20 {
21 
22 }
23 
25 {
27  desc.add<double>("rangeMin",-1.);
28  desc.add<double>("rangeMax",3.0);
29  desc.add<double>("lowEtHighEtBoundary",50.);
30  desc.add<bool>("forceHighEnergyTrainingIfSaturated",false);
31  desc.add<std::string>("ebLowEtForestName","electron_eb_ECALTRK_lowpt");
32  desc.add<std::string>("ebHighEtForestName","electron_eb_ECALTRK");
33  desc.add<std::string>("eeLowEtForestName","electron_ee_ECALTRK_lowpt");
34  desc.add<std::string>("eeHighEtForestName","electron_ee_ECALTRK");
35  return desc;
36 }
37 
38 namespace{
39  const GBRForestD* getForest(const edm::EventSetup& iSetup,const std::string&name){
41  iSetup.get<GBRDWrapperRcd>().get(name,handle);
42  return handle.product();
43  }
44 }
45 
47 {
48  ebLowEtForest_ = getForest(iSetup,ebLowEtForestName_);
49  ebHighEtForest_ = getForest(iSetup,ebHighEtForestName_);
50  eeLowEtForest_ = getForest(iSetup,eeLowEtForestName_);
51  eeHighEtForest_ = getForest(iSetup,eeHighEtForestName_);
52 }
53 
54 float EgammaRegressionContainer::operator()(const float et,const bool isEB,const bool isSaturated,const float* data)const
55 {
56  if(useLowEtBin(et,isSaturated)){
57  if(isEB) return outputTransformer_(ebLowEtForest_->GetResponse(data));
58  else return outputTransformer_(eeLowEtForest_->GetResponse(data));
59  }else{
60  if(isEB) return outputTransformer_(ebHighEtForest_->GetResponse(data));
62  }
63 }
64 
65 bool EgammaRegressionContainer::useLowEtBin(const float et,const bool isSaturated)const
66 {
67  if(isSaturated && forceHighEnergyTrainingIfSaturated_) return false;
68  else return et<lowEtHighEtBoundary_;
69 }
void setEventContent(const edm::EventSetup &iSetup)
double GetResponse(const float *vector) const
Definition: GBRForestD.h:51
float operator()(const float et, const bool isEB, const bool isSaturated, const float *data) const
#define nullptr
static edm::ParameterSetDescription makePSetDescription()
bool useLowEtBin(const float et, const bool isSaturated) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
et
define resolution functions of each parameter
bool isSaturated(const Digi &digi, const int &maxADCvalue, int ifirst, int n)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
T get() const
Definition: EventSetup.h:62
const EgammaBDTOutputTransformer outputTransformer_
EgammaRegressionContainer(const edm::ParameterSet &iConfig)
T const * product() const
Definition: ESHandle.h:86