CMS 3D CMS Logo

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

#include <ProductDeDxDiscriminator.h>

Inheritance diagram for ProductDeDxDiscriminator:
BaseDeDxEstimator

Public Member Functions

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

Constructor & Destructor Documentation

◆ ProductDeDxDiscriminator()

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

Definition at line 10 of file ProductDeDxDiscriminator.h.

10  {
12  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  }

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

Member Function Documentation

◆ beginRun()

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

◆ dedx()

std::pair<float, float> ProductDeDxDiscriminator::dedx ( const reco::DeDxHitCollection Hits)
inlineoverridevirtual

Implements BaseDeDxEstimator.

Definition at line 22 of file ProductDeDxDiscriminator.h.

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 =
27  Hits[i].charge() /
28  (10.0 *
29  meVperADCStrip); // 10/meVperADCStrip in order to be compatible with the map content in ADC/mm instead of MeV/cm
30 
31  int BinX = Prob_ChargePath->GetXaxis()->FindBin(Hits[i].momentum());
32  int BinY = Prob_ChargePath->GetYaxis()->FindBin(path);
33  int BinZ = Prob_ChargePath->GetZaxis()->FindBin(charge);
34  float prob = Prob_ChargePath->GetBinContent(BinX, BinY, BinZ);
35  if (prob >= 0)
36  vect_probs.push_back(prob);
37  }
38 
39  size_t size = vect_probs.size();
40  if (size <= 0)
41  return std::make_pair(-1, -1);
42  float TotalProb = 1;
43  for (size_t i = 0; i < size; i++) {
44  if (vect_probs[i] <= 0.0001) {
45  TotalProb *= pow(0.0001, 1.0 / size);
46  } else {
47  TotalProb *= pow(vect_probs[i], 1.0 / size);
48  }
49  }
50  return std::make_pair(TotalProb, -1);
51  }

References VtxSmearedBeamProfile_cfi::BinX, VtxSmearedBeamProfile_cfi::BinY, ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, meVperADCStrip, castor_dqm_sourceclient_file_cfg::path, funct::pow(), TtFullHadEvtBuilder_cfi::prob, Prob_ChargePath, and findQualityFiles::size.

Member Data Documentation

◆ meVperADCStrip

float ProductDeDxDiscriminator::meVperADCStrip
private

Definition at line 54 of file ProductDeDxDiscriminator.h.

Referenced by dedx(), and ProductDeDxDiscriminator().

◆ Prob_ChargePath

TH3F* ProductDeDxDiscriminator::Prob_ChargePath
private

Definition at line 57 of file ProductDeDxDiscriminator.h.

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

◆ ProbabilityMode

std::string ProductDeDxDiscriminator::ProbabilityMode
private

Definition at line 56 of file ProductDeDxDiscriminator.h.

Referenced by beginRun(), and ProductDeDxDiscriminator().

◆ Reccord

std::string ProductDeDxDiscriminator::Reccord
private

Definition at line 55 of file ProductDeDxDiscriminator.h.

Referenced by beginRun(), and ProductDeDxDiscriminator().

ProductDeDxDiscriminator::meVperADCStrip
float meVperADCStrip
Definition: ProductDeDxDiscriminator.h:54
VtxSmearedBeamProfile_cfi.BinX
BinX
Definition: VtxSmearedBeamProfile_cfi.py:28
mps_fire.i
i
Definition: mps_fire.py:355
DeDxTools::buildDiscrimMap
void buildDiscrimMap(edm::Run const &run, const edm::EventSetup &iSetup, std::string Reccord, std::string ProbabilityMode, TH3F *&Prob_ChargePath)
Definition: DeDxTools.cc:280
ProductDeDxDiscriminator::Reccord
std::string Reccord
Definition: ProductDeDxDiscriminator.h:55
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
VtxSmearedBeamProfile_cfi.BinY
BinY
Definition: VtxSmearedBeamProfile_cfi.py:29
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
ProductDeDxDiscriminator::ProbabilityMode
std::string ProbabilityMode
Definition: ProductDeDxDiscriminator.h:56
ProductDeDxDiscriminator::Prob_ChargePath
TH3F * Prob_ChargePath
Definition: ProductDeDxDiscriminator.h:57
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
TtFullHadEvtBuilder_cfi.prob
prob
Definition: TtFullHadEvtBuilder_cfi.py:33
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443