RecoTracker
DeDx
interface
ASmirnovDeDxDiscriminator.h
Go to the documentation of this file.
1
#ifndef RecoTrackerDeDx_ASmirnovDeDxDiscriminator_h
2
#define RecoTrackerDeDx_ASmirnovDeDxDiscriminator_h
3
4
#include "
RecoTracker/DeDx/interface/BaseDeDxEstimator.h
"
5
#include "
RecoTracker/DeDx/interface/DeDxTools.h
"
6
#include "
DataFormats/TrackReco/interface/DeDxHit.h
"
7
8
class
ASmirnovDeDxDiscriminator
:
public
BaseDeDxEstimator
{
9
public
:
10
ASmirnovDeDxDiscriminator
(
const
edm::ParameterSet
& iConfig) {
11
meVperADCStrip
=
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
}
17
18
void
beginRun
(
edm::Run
const
&
run
,
const
edm::EventSetup
& iSetup)
override
{
19
DeDxTools::buildDiscrimMap
(
run
, iSetup,
Reccord
,
ProbabilityMode
,
Prob_ChargePath
);
20
}
21
22
std::pair<float, float>
dedx
(
const
reco::DeDxHitCollection
& Hits)
override
{
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
std::sort(vect_probs.begin(), vect_probs.end(), std::less<float>());
43
float
TotalProb = 1.0 / (12 *
size
);
44
for
(
size_t
i
= 1;
i
<=
size
;
i
++) {
45
TotalProb += vect_probs[
i
- 1] *
pow
(vect_probs[
i
- 1] - ((2.0 *
i
- 1.0) / (2.0 *
size
)), 2);
46
}
47
TotalProb *= (3.0 /
size
);
48
return
std::make_pair(TotalProb, -1);
49
}
50
51
private
:
52
float
meVperADCStrip
;
53
std::string
Reccord
;
54
std::string
ProbabilityMode
;
55
TH3F*
Prob_ChargePath
;
56
};
57
58
#endif
VtxSmearedBeamProfile_cfi.BinX
BinX
Definition:
VtxSmearedBeamProfile_cfi.py:28
mps_fire.i
i
Definition:
mps_fire.py:428
edm::Run
Definition:
Run.h:45
reco::DeDxHitCollection
std::vector< DeDxHit > DeDxHitCollection
Definition:
DeDxHit.h:41
ASmirnovDeDxDiscriminator::Reccord
std::string Reccord
Definition:
ASmirnovDeDxDiscriminator.h:53
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
DeDxHit.h
DeDxTools.h
ASmirnovDeDxDiscriminator::beginRun
void beginRun(edm::Run const &run, const edm::EventSetup &iSetup) override
Definition:
ASmirnovDeDxDiscriminator.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
ASmirnovDeDxDiscriminator::dedx
std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits) override
Definition:
ASmirnovDeDxDiscriminator.h:22
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition:
ALCARECOTkAlJpsiMuMu_cff.py:47
BaseDeDxEstimator.h
edm::ParameterSet
Definition:
ParameterSet.h:47
ASmirnovDeDxDiscriminator::ProbabilityMode
std::string ProbabilityMode
Definition:
ASmirnovDeDxDiscriminator.h:54
ASmirnovDeDxDiscriminator::Prob_ChargePath
TH3F * Prob_ChargePath
Definition:
ASmirnovDeDxDiscriminator.h:55
VtxSmearedBeamProfile_cfi.BinY
BinY
Definition:
VtxSmearedBeamProfile_cfi.py:29
edm::EventSetup
Definition:
EventSetup.h:57
ASmirnovDeDxDiscriminator::meVperADCStrip
float meVperADCStrip
Definition:
ASmirnovDeDxDiscriminator.h:52
writedatasetfile.run
run
Definition:
writedatasetfile.py:27
ASmirnovDeDxDiscriminator
Definition:
ASmirnovDeDxDiscriminator.h:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition:
ParameterSet.h:303
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition:
Power.h:29
BaseDeDxEstimator
Definition:
BaseDeDxEstimator.h:7
castor_dqm_sourceclient_file_cfg.path
path
Definition:
castor_dqm_sourceclient_file_cfg.py:37
TtFullHadEvtBuilder_cfi.prob
prob
Definition:
TtFullHadEvtBuilder_cfi.py:33
ASmirnovDeDxDiscriminator::ASmirnovDeDxDiscriminator
ASmirnovDeDxDiscriminator(const edm::ParameterSet &iConfig)
Definition:
ASmirnovDeDxDiscriminator.h:10
findQualityFiles.size
size
Write out results.
Definition:
findQualityFiles.py:443
Generated for CMSSW Reference Manual by
1.8.16