CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ProductDeDxDiscriminator Class Reference

#include <ProductDeDxDiscriminator.h>

Inheritance diagram for ProductDeDxDiscriminator:
BaseDeDxEstimator

Public Member Functions

virtual void beginRun (edm::Run const &run, const edm::EventSetup &iSetup)
 
virtual std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits)
 
 ProductDeDxDiscriminator (const edm::ParameterSet &iConfig)
 
- 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 7 of file ProductDeDxDiscriminator.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file ProductDeDxDiscriminator.h.

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

10  {
11  meVperADCStrip = iConfig.getParameter<double>("MeVperADCStrip"); //currently needed until the map on the database are redone
12  Reccord = iConfig.getParameter<std::string> ("Reccord");
13  ProbabilityMode = iConfig.getParameter<std::string> ("ProbabilityMode");
15  }
T getParameter(std::string const &) const
#define NULL
Definition: scimark2.h:8

Member Function Documentation

virtual void ProductDeDxDiscriminator::beginRun ( edm::Run const &  run,
const edm::EventSetup iSetup 
)
inlinevirtual

Reimplemented from BaseDeDxEstimator.

Definition at line 17 of file ProductDeDxDiscriminator.h.

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

17  {
19  }
void buildDiscrimMap(edm::Run const &run, const edm::EventSetup &iSetup, std::string Reccord, std::string ProbabilityMode, TH3F *&Prob_ChargePath)
Definition: DeDxTools.cc:221
virtual std::pair<float,float> ProductDeDxDiscriminator::dedx ( const reco::DeDxHitCollection Hits)
inlinevirtual

Implements BaseDeDxEstimator.

Definition at line 21 of file ProductDeDxDiscriminator.h.

References reco_application_tbsim_DetSim-Digi_cfg::BinX, reco_application_tbsim_DetSim-Digi_cfg::BinY, RecoTauCleanerPlugins::charge, i, meVperADCStrip, fed_dqm_sourceclient-live_cfg::path, funct::pow(), Prob_ChargePath, and findQualityFiles::size.

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

Member Data Documentation

float ProductDeDxDiscriminator::meVperADCStrip
private

Definition at line 45 of file ProductDeDxDiscriminator.h.

Referenced by dedx(), and ProductDeDxDiscriminator().

TH3F* ProductDeDxDiscriminator::Prob_ChargePath
private

Definition at line 48 of file ProductDeDxDiscriminator.h.

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

std::string ProductDeDxDiscriminator::ProbabilityMode
private

Definition at line 47 of file ProductDeDxDiscriminator.h.

Referenced by beginRun(), and ProductDeDxDiscriminator().

std::string ProductDeDxDiscriminator::Reccord
private

Definition at line 46 of file ProductDeDxDiscriminator.h.

Referenced by beginRun(), and ProductDeDxDiscriminator().