1 #ifndef RecoTrackerDeDx_SmirnovDeDxDiscriminator_h 2 #define RecoTrackerDeDx_SmirnovDeDxDiscriminator_h 23 std::vector<float> vect_probs;
24 for(
size_t i = 0;
i< Hits.size();
i ++){
25 float path = Hits[
i].pathLength() * 10.0;
32 if(prob>=0)vect_probs.push_back(prob);
35 size_t size = vect_probs.size();
36 if(size<=0)
return std::make_pair( -1 , -1);
37 std::sort(vect_probs.begin(), vect_probs.end(), std::less<float>() );
38 float TotalProb = 1.0/(12*
size);
40 TotalProb +=
pow(vect_probs[
i-1] - ((2.0*
i-1.0)/(2.0*size)),2);
42 TotalProb *= (3.0/
size);
43 return std::make_pair( TotalProb , -1);
T getParameter(std::string const &) const
std::string ProbabilityMode
std::vector< DeDxHit > DeDxHitCollection
virtual std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits)
virtual void beginRun(edm::Run const &run, const edm::EventSetup &iSetup)
SmirnovDeDxDiscriminator(const edm::ParameterSet &iConfig)
Power< A, B >::type pow(const A &a, const B &b)