CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenericAverageDeDxEstimator.h
Go to the documentation of this file.
1 #ifndef RecoTrackerDeDx_GenericAverageDeDxEstimator_h
2 #define RecoTrackerDeDx_GenericAverageDeDxEstimator_h
3 
6 
8 {
9 public:
11  m_expo = iConfig.getParameter<double>("exponent");
12  }
13 
14  virtual std::pair<float,float> dedx(const reco::DeDxHitCollection& Hits) {
15  float result=0;
16  size_t n = Hits.size();
17  for(size_t i = 0; i< n; i ++){
18  result+=pow(Hits[i].charge(),m_expo);
19  }
20  return std::make_pair( ((n>0)?pow(result/n,1./m_expo):0.0) ,-1);
21  }
22 
23 private:
24  float m_expo;
25 
26 };
27 
28 #endif
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< DeDxHit > DeDxHitCollection
Definition: DeDxHit.h:56
tuple result
Definition: query.py:137
GenericAverageDeDxEstimator(const edm::ParameterSet &iConfig)
virtual std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40