CMS 3D CMS Logo

EgammaRegressionContainer.cc
Go to the documentation of this file.
2 
9 
11  outputTransformerLowEt_(iConfig.getParameter<double>("rangeMinLowEt"),iConfig.getParameter<double>("rangeMaxLowEt")),
12  outputTransformerHighEt_(iConfig.getParameter<double>("rangeMinHighEt"),iConfig.getParameter<double>("rangeMaxHighEt")),
13  forceHighEnergyTrainingIfSaturated_(iConfig.getParameter<bool>("forceHighEnergyTrainingIfSaturated")),
14  lowEtHighEtBoundary_(iConfig.getParameter<double>("lowEtHighEtBoundary")),
15  ebLowEtForestName_(iConfig.getParameter<std::string>("ebLowEtForestName")),
16  ebHighEtForestName_(iConfig.getParameter<std::string>("ebHighEtForestName")),
17  eeLowEtForestName_(iConfig.getParameter<std::string>("eeLowEtForestName")),
18  eeHighEtForestName_(iConfig.getParameter<std::string>("eeHighEtForestName")),
19  ebLowEtForest_(nullptr),ebHighEtForest_(nullptr),
20  eeLowEtForest_(nullptr),eeHighEtForest_(nullptr)
21 {
22 
23 }
24 
26 {
28  desc.add<double>("rangeMinLowEt",-1.);
29  desc.add<double>("rangeMaxLowEt",3.0);
30  desc.add<double>("rangeMinHighEt",-1.);
31  desc.add<double>("rangeMaxHighEt",3.0);
32  desc.add<double>("lowEtHighEtBoundary",50.);
33  desc.add<bool>("forceHighEnergyTrainingIfSaturated",false);
34  desc.add<std::string>("ebLowEtForestName","electron_eb_ECALTRK_lowpt");
35  desc.add<std::string>("ebHighEtForestName","electron_eb_ECALTRK");
36  desc.add<std::string>("eeLowEtForestName","electron_ee_ECALTRK_lowpt");
37  desc.add<std::string>("eeHighEtForestName","electron_ee_ECALTRK");
38  return desc;
39 }
40 
41 namespace{
42  const GBRForestD* getForest(const edm::EventSetup& iSetup,const std::string&name){
44  iSetup.get<GBRDWrapperRcd>().get(name,handle);
45  return handle.product();
46  }
47 }
48 
50 {
51  ebLowEtForest_ = getForest(iSetup,ebLowEtForestName_);
52  ebHighEtForest_ = getForest(iSetup,ebHighEtForestName_);
53  eeLowEtForest_ = getForest(iSetup,eeLowEtForestName_);
54  eeHighEtForest_ = getForest(iSetup,eeHighEtForestName_);
55 }
56 
57 float EgammaRegressionContainer::operator()(const float et,const bool isEB,const bool isSaturated,const float* data)const
58 {
59  if(useLowEtBin(et,isSaturated)){
60  if(isEB) return outputTransformerLowEt_(ebLowEtForest_->GetResponse(data));
62  }else{
65  }
66 }
67 
68 bool EgammaRegressionContainer::useLowEtBin(const float et,const bool isSaturated)const
69 {
70  if(isSaturated && forceHighEnergyTrainingIfSaturated_) return false;
71  else return et<lowEtHighEtBoundary_;
72 }
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
const EgammaBDTOutputTransformer outputTransformerHighEt_
const EgammaBDTOutputTransformer outputTransformerLowEt_
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:71
EgammaRegressionContainer(const edm::ParameterSet &iConfig)
T const * product() const
Definition: ESHandle.h:86