CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 &, const edm::EventSetup &iSetup) override
 
std::pair< float, float > dedx (const reco::DeDxHitCollection &Hits) override
 
 ProductDeDxDiscriminator (const edm::ParameterSet &iConfig, edm::ConsumesCollector &iCollector)
 
- Public Member Functions inherited from BaseDeDxEstimator
virtual ~BaseDeDxEstimator ()
 

Private Attributes

float meVperADCStrip
 
TH3F * Prob_ChargePath
 
std::string ProbabilityMode
 
DeDxTools::ESGetTokenH3DDVariant token_
 

Detailed Description

Definition at line 8 of file ProductDeDxDiscriminator.h.

Constructor & Destructor Documentation

ProductDeDxDiscriminator::ProductDeDxDiscriminator ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iCollector 
)
inline

Definition at line 10 of file ProductDeDxDiscriminator.h.

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

11  : token_(DeDxTools::esConsumes(iConfig.getParameter<std::string>("Reccord"), iCollector)) {
13  iConfig.getParameter<double>("MeVperADCStrip"); //currently needed until the map on the database are redone
14  ProbabilityMode = iConfig.getParameter<std::string>("ProbabilityMode");
15  Prob_ChargePath = nullptr;
16  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
DeDxTools::ESGetTokenH3DDVariant token_

Member Function Documentation

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

Reimplemented from BaseDeDxEstimator.

Definition at line 18 of file ProductDeDxDiscriminator.h.

References DeDxTools::buildDiscrimMap(), DeDxTools::getHistogramD3D(), Prob_ChargePath, ProbabilityMode, and token_.

18  {
19  auto const& histD3D = DeDxTools::getHistogramD3D(iSetup, token_);
21  }
PhysicsTools::Calibration::HistogramD3D const & getHistogramD3D(edm::EventSetup const &, ESGetTokenH3DDVariant const &)
Definition: DeDxTools.cc:302
void buildDiscrimMap(PhysicsTools::Calibration::HistogramD3D const &, std::string const &ProbabilityMode, TH3F *&Prob_ChargePath)
Definition: DeDxTools.cc:319
DeDxTools::ESGetTokenH3DDVariant token_
std::pair<float, float> ProductDeDxDiscriminator::dedx ( const reco::DeDxHitCollection Hits)
inlineoverridevirtual

Implements BaseDeDxEstimator.

Definition at line 23 of file ProductDeDxDiscriminator.h.

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

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

Member Data Documentation

float ProductDeDxDiscriminator::meVperADCStrip
private

Definition at line 55 of file ProductDeDxDiscriminator.h.

Referenced by dedx(), and ProductDeDxDiscriminator().

TH3F* ProductDeDxDiscriminator::Prob_ChargePath
private

Definition at line 58 of file ProductDeDxDiscriminator.h.

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

std::string ProductDeDxDiscriminator::ProbabilityMode
private

Definition at line 57 of file ProductDeDxDiscriminator.h.

Referenced by beginRun(), and ProductDeDxDiscriminator().

DeDxTools::ESGetTokenH3DDVariant ProductDeDxDiscriminator::token_
private

Definition at line 56 of file ProductDeDxDiscriminator.h.

Referenced by beginRun().