CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ASmirnovDeDxDiscriminator Class Reference

#include <ASmirnovDeDxDiscriminator.h>

Inheritance diagram for ASmirnovDeDxDiscriminator:
BaseDeDxEstimator

Public Member Functions

 ASmirnovDeDxDiscriminator (const edm::ParameterSet &iConfig)
 
void beginRun (edm::Run const &run, const edm::EventSetup &iSetup) override
 
std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits) override
 
- Public Member Functions inherited from BaseDeDxEstimator
virtual ~BaseDeDxEstimator ()
 

Private Attributes

float meVperADCStrip
 
TH3F * Prob_ChargePath
 
std::string ProbabilityMode
 
std::string Reccord
 

Detailed Description

Definition at line 8 of file ASmirnovDeDxDiscriminator.h.

Constructor & Destructor Documentation

ASmirnovDeDxDiscriminator::ASmirnovDeDxDiscriminator ( const edm::ParameterSet iConfig)
inline

Definition at line 11 of file ASmirnovDeDxDiscriminator.h.

References edm::ParameterSet::getParameter(), meVperADCStrip, Prob_ChargePath, ProbabilityMode, Reccord, and AlCaHLTBitMon_QueryRunRegistry::string.

11  {
12  meVperADCStrip = iConfig.getParameter<double>("MeVperADCStrip"); //currently needed until the map on the database are redone
13  Reccord = iConfig.getParameter<std::string> ("Reccord");
14  ProbabilityMode = iConfig.getParameter<std::string> ("ProbabilityMode");
15  Prob_ChargePath = nullptr;
16  }
T getParameter(std::string const &) const

Member Function Documentation

void ASmirnovDeDxDiscriminator::beginRun ( edm::Run const &  run,
const edm::EventSetup iSetup 
)
inlineoverridevirtual

Reimplemented from BaseDeDxEstimator.

Definition at line 18 of file ASmirnovDeDxDiscriminator.h.

References DeDxTools::buildDiscrimMap(), Prob_ChargePath, ProbabilityMode, and Reccord.

18  {
20  }
void buildDiscrimMap(edm::Run const &run, const edm::EventSetup &iSetup, std::string Reccord, std::string ProbabilityMode, TH3F *&Prob_ChargePath)
Definition: DeDxTools.cc:221
std::pair<float,float> ASmirnovDeDxDiscriminator::dedx ( const reco::DeDxHitCollection Hits)
inlineoverridevirtual

Implements BaseDeDxEstimator.

Definition at line 22 of file ASmirnovDeDxDiscriminator.h.

References ecalTB2006H4_GenSimDigiReco_cfg::BinX, ecalTB2006H4_GenSimDigiReco_cfg::BinY, ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, meVperADCStrip, callgraph::path, funct::pow(), TtFullHadEvtBuilder_cfi::prob, Prob_ChargePath, findQualityFiles::size, and jetUpdater_cfi::sort.

22  {
23  std::vector<float> vect_probs;
24  for(size_t i = 0; i< Hits.size(); i ++){
25  float path = Hits[i].pathLength() * 10.0; //x10 in order to be compatible with the map content
26  float charge = Hits[i].charge() / (10.0*meVperADCStrip); // 10/meVperADCStrip in order to be compatible with the map content in ADC/mm instead of MeV/cm
27 
28  int BinX = Prob_ChargePath->GetXaxis()->FindBin(Hits[i].momentum());
29  int BinY = Prob_ChargePath->GetYaxis()->FindBin(path);
30  int BinZ = Prob_ChargePath->GetZaxis()->FindBin(charge);
31  float prob = Prob_ChargePath->GetBinContent(BinX,BinY,BinZ);
32  if(prob>=0)vect_probs.push_back(prob);
33  }
34 
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);
39  for(size_t i=1;i<=size;i++){
40  TotalProb += vect_probs[i-1] * pow(vect_probs[i-1] - ((2.0*i-1.0)/(2.0*size)),2);
41  }
42  TotalProb *= (3.0/size);
43  return std::make_pair( TotalProb , -1);
44  }
size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

float ASmirnovDeDxDiscriminator::meVperADCStrip
private

Definition at line 47 of file ASmirnovDeDxDiscriminator.h.

Referenced by ASmirnovDeDxDiscriminator(), and dedx().

TH3F* ASmirnovDeDxDiscriminator::Prob_ChargePath
private

Definition at line 50 of file ASmirnovDeDxDiscriminator.h.

Referenced by ASmirnovDeDxDiscriminator(), beginRun(), and dedx().

std::string ASmirnovDeDxDiscriminator::ProbabilityMode
private

Definition at line 49 of file ASmirnovDeDxDiscriminator.h.

Referenced by ASmirnovDeDxDiscriminator(), and beginRun().

std::string ASmirnovDeDxDiscriminator::Reccord
private

Definition at line 48 of file ASmirnovDeDxDiscriminator.h.

Referenced by ASmirnovDeDxDiscriminator(), and beginRun().