SimPPS
PPSPixelDigiProducer
src
RPixLinearChargeCollectionDrifter.cc
Go to the documentation of this file.
1
#include "
SimPPS/PPSPixelDigiProducer/interface/RPixLinearChargeCollectionDrifter.h
"
2
#include "
Geometry/VeryForwardGeometry/interface/CTPPSPixelTopology.h
"
3
#include <iostream>
4
#include <vector>
5
6
RPixLinearChargeCollectionDrifter::RPixLinearChargeCollectionDrifter
(
const
edm::ParameterSet
&
params
, uint32_t det_id) {
7
verbosity_
=
params
.getParameter<
int
>(
"RPixVerbosity"
);
8
9
GeV_per_electron_
=
params
.getParameter<
double
>(
"RPixGeVPerElectron"
);
10
charge_cloud_sigmas_vect_
=
params
.getParameter<std::vector<double> >(
"RPixInterSmearing"
);
11
det_thickness_
=
CTPPSPixelTopology
().
detThickness
();
12
det_id_
= det_id;
13
}
14
15
std::vector<RPixSignalPoint>
RPixLinearChargeCollectionDrifter::Drift
(
16
const
std::vector<RPixEnergyDepositUnit> &energy_deposition) {
17
// convert an energy deposit in a point and in a charge of electrons n=E/3.61 (eV)
18
temp_
.resize(energy_deposition.size());
19
for
(
unsigned
int
i
= 0;
i
< energy_deposition.size();
i
++) {
20
temp_
[
i
].setPosition(
LocalPoint
(energy_deposition[
i
].
Position
().
x
(), energy_deposition[
i
].
Position
().
y
()));
21
temp_
[
i
].setSigma(
getSigma_
(energy_deposition[
i
].
Position
().
z
()));
22
temp_
[
i
].setCharge(energy_deposition[
i
].
Energy
() /
GeV_per_electron_
);
23
if
(
verbosity_
> 1) {
24
edm::LogInfo
(
"RPixLinearChargeCollectionDrifter"
)
25
<<
det_id_
<<
" :"
<<
temp_
[
i
].Position() <<
" "
<<
temp_
[
i
].Sigma() <<
" "
<<
temp_
[
i
].Charge();
26
}
27
}
28
return
temp_
;
29
}
30
double
RPixLinearChargeCollectionDrifter::getSigma_
(
double
z
) {
31
if
(
charge_cloud_sigmas_vect_
.size() == 1)
32
return
charge_cloud_sigmas_vect_
[0];
33
34
double
factor
= (
z
/
det_thickness_
) * (
charge_cloud_sigmas_vect_
.size() - 1);
35
double
lo_i = floor(
factor
);
36
double
hi_i =
ceil
(
factor
);
37
if
(lo_i == hi_i) {
38
return
charge_cloud_sigmas_vect_
[(
int
)
factor
];
39
}
else
{
40
double
lo_weight = hi_i -
factor
;
41
double
hi_weight =
factor
- lo_i;
42
43
return
charge_cloud_sigmas_vect_
[(
int
)lo_i] * lo_weight +
charge_cloud_sigmas_vect_
[(
int
)hi_i] * hi_weight;
44
}
45
}
DDAxes::y
mps_fire.i
i
Definition:
mps_fire.py:428
EcalCondDBWriter_cfi.Energy
Energy
Definition:
EcalCondDBWriter_cfi.py:152
detailsBasic3DVector::z
float float float z
Definition:
extBasic3DVector.h:14
RPixLinearChargeCollectionDrifter::RPixLinearChargeCollectionDrifter
RPixLinearChargeCollectionDrifter(const edm::ParameterSet ¶ms, uint32_t det_id)
Definition:
RPixLinearChargeCollectionDrifter.cc:6
CalibrationSummaryClient_cfi.params
params
Definition:
CalibrationSummaryClient_cfi.py:14
CTPPSPixelTopology
Geometrical and topological information on RPix silicon detector. Uses coordinate a frame with origin...
Definition:
CTPPSPixelTopology.h:10
DDAxes::x
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition:
Definitions.h:30
RPixLinearChargeCollectionDrifter::GeV_per_electron_
double GeV_per_electron_
Definition:
RPixLinearChargeCollectionDrifter.h:17
CTPPSPixelTopology.h
CTPPSPixelTopology::detThickness
double detThickness() const
Definition:
CTPPSPixelTopology.h:29
reco::ceil
constexpr int32_t ceil(float num)
Definition:
constexpr_cmath.h:7
DDAxes::z
DQMScaleToClient_cfi.factor
factor
Definition:
DQMScaleToClient_cfi.py:8
RPixLinearChargeCollectionDrifter::charge_cloud_sigmas_vect_
std::vector< double > charge_cloud_sigmas_vect_
Definition:
RPixLinearChargeCollectionDrifter.h:16
PixelTestBeamValidation_cfi.Position
Position
Definition:
PixelTestBeamValidation_cfi.py:75
edm::ParameterSet
Definition:
ParameterSet.h:47
RPixLinearChargeCollectionDrifter.h
RPixLinearChargeCollectionDrifter::det_id_
uint32_t det_id_
Definition:
RPixLinearChargeCollectionDrifter.h:20
createfilelist.int
int
Definition:
createfilelist.py:10
RPixLinearChargeCollectionDrifter::det_thickness_
double det_thickness_
Definition:
RPixLinearChargeCollectionDrifter.h:19
RPixLinearChargeCollectionDrifter::verbosity_
int verbosity_
Definition:
RPixLinearChargeCollectionDrifter.h:18
RPixLinearChargeCollectionDrifter::getSigma_
double getSigma_(double z)
Definition:
RPixLinearChargeCollectionDrifter.cc:30
RPixLinearChargeCollectionDrifter::temp_
std::vector< RPixSignalPoint > temp_
Definition:
RPixLinearChargeCollectionDrifter.h:14
RPixLinearChargeCollectionDrifter::Drift
std::vector< RPixSignalPoint > Drift(const std::vector< RPixEnergyDepositUnit > &energy_deposition)
Definition:
RPixLinearChargeCollectionDrifter.cc:15
Generated for CMSSW Reference Manual by
1.8.16