CMS 3D CMS Logo

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

#include <SmirnovDeDxDiscriminator.h>

Inheritance diagram for SmirnovDeDxDiscriminator:
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
 
 SmirnovDeDxDiscriminator (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 SmirnovDeDxDiscriminator.h.

Constructor & Destructor Documentation

◆ SmirnovDeDxDiscriminator()

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

Definition at line 10 of file SmirnovDeDxDiscriminator.h.

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

11  : token_(deDxTools::esConsumes(iConfig.getParameter<std::string>("Record"), 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  }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
deDxTools::ESGetTokenH3DDVariant token_

Member Function Documentation

◆ beginRun()

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

Reimplemented from BaseDeDxEstimator.

Definition at line 18 of file SmirnovDeDxDiscriminator.h.

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

18  {
19  auto const& histD3D = deDxTools::getHistogramD3D(iSetup, token_);
21  }
deDxTools::ESGetTokenH3DDVariant token_
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

◆ dedx()

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

Implements BaseDeDxEstimator.

Definition at line 23 of file SmirnovDeDxDiscriminator.h.

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

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  std::sort(vect_probs.begin(), vect_probs.end(), std::less<float>());
44  float TotalProb = 1.0 / (12 * size);
45  for (size_t i = 1; i <= size; i++) {
46  TotalProb += pow(vect_probs[i - 1] - ((2.0 * i - 1.0) / (2.0 * size)), 2);
47  }
48  TotalProb *= (3.0 / size);
49  return std::make_pair(TotalProb, -1);
50  }
size
Write out results.
constexpr int pow(int x)
Definition: conifer.h:24

Member Data Documentation

◆ meVperADCStrip

float SmirnovDeDxDiscriminator::meVperADCStrip
private

Definition at line 53 of file SmirnovDeDxDiscriminator.h.

Referenced by dedx(), and SmirnovDeDxDiscriminator().

◆ Prob_ChargePath

TH3F* SmirnovDeDxDiscriminator::Prob_ChargePath
private

Definition at line 56 of file SmirnovDeDxDiscriminator.h.

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

◆ ProbabilityMode

std::string SmirnovDeDxDiscriminator::ProbabilityMode
private

Definition at line 55 of file SmirnovDeDxDiscriminator.h.

Referenced by beginRun(), and SmirnovDeDxDiscriminator().

◆ token_

deDxTools::ESGetTokenH3DDVariant SmirnovDeDxDiscriminator::token_
private

Definition at line 54 of file SmirnovDeDxDiscriminator.h.

Referenced by beginRun().