12 Suffix(iConfig.getParameter<
std::
string>(
"Suffix")),
14 produces<std::vector<int>>(
Prefix +
"trackindex" +
Suffix);
15 produces<std::vector<unsigned int>>(
Prefix +
"rawid" +
Suffix);
16 produces<std::vector<double>>(
Prefix +
"localdirx" +
Suffix);
17 produces<std::vector<double>>(
Prefix +
"localdiry" +
Suffix);
18 produces<std::vector<double>>(
Prefix +
"localdirz" +
Suffix);
19 produces<std::vector<unsigned short>>(
Prefix +
"firststrip" +
Suffix);
20 produces<std::vector<unsigned short>>(
Prefix +
"nstrips" +
Suffix);
21 produces<std::vector<bool>>(
Prefix +
"saturation" +
Suffix);
22 produces<std::vector<bool>>(
Prefix +
"overlapping" +
Suffix);
23 produces<std::vector<bool>>(
Prefix +
"farfromedge" +
Suffix);
24 produces<std::vector<unsigned int>>(
Prefix +
"charge" +
Suffix);
26 #ifdef ExtendedCALIBTree
27 produces<std::vector<double>>(
Prefix +
"chargeoverpath" +
Suffix);
29 produces<std::vector<unsigned char>>(
Prefix +
"amplitude" +
Suffix);
30 produces<std::vector<double>>(
Prefix +
"gainused" +
Suffix);
31 produces<std::vector<double>>(
Prefix +
"gainusedTick" +
Suffix);
35 auto trackindex = std::make_unique<std::vector<int>>();
36 auto rawid = std::make_unique<std::vector<unsigned int>>();
37 auto localdirx = std::make_unique<std::vector<double>>();
38 auto localdiry = std::make_unique<std::vector<double>>();
39 auto localdirz = std::make_unique<std::vector<double>>();
40 auto firststrip = std::make_unique<std::vector<unsigned short>>();
41 auto nstrips = std::make_unique<std::vector<unsigned short>>();
42 auto saturation = std::make_unique<std::vector<bool>>();
43 auto overlapping = std::make_unique<std::vector<bool>>();
44 auto farfromedge = std::make_unique<std::vector<bool>>();
45 auto charge = std::make_unique<std::vector<unsigned int>>();
46 auto path = std::make_unique<std::vector<double>>();
47 #ifdef ExtendedCALIBTree
48 auto chargeoverpath = std::make_unique<std::vector<double>>();
50 auto amplitude = std::make_unique<std::vector<unsigned char>>();
51 auto gainused = std::make_unique<std::vector<double>>();
52 auto gainusedTick = std::make_unique<std::vector<double>>();
70 vector<TrajectoryMeasurement> measurements = traj->
measurements();
71 for (vector<TrajectoryMeasurement>::const_iterator measurement_it = measurements.begin();
72 measurement_it != measurements.end();
88 for (
unsigned int h = 0;
h < 2;
h++) {
89 if (!sistripmatchedhit &&
h == 1) {
91 }
else if (sistripmatchedhit &&
h == 0) {
94 }
else if (sistripmatchedhit &&
h == 1) {
98 }
else if (sistripsimplehit) {
99 StripCluster = (sistripsimplehit->
cluster()).
get();
101 }
else if (sistripsimple1dhit) {
102 StripCluster = (sistripsimple1dhit->
cluster()).
get();
104 }
else if (sipixelhit) {
112 double cosine = trackDirection.
z() / trackDirection.
mag();
113 bool Saturation =
false;
117 double PrevGain = -1;
118 double PrevGainTick = -1;
123 const auto& Ampls = StripCluster->
amplitudes();
125 NStrips = Ampls.size();
126 int APVId = FirstStrip / 128;
133 for (
unsigned int a = 0;
a < Ampls.size();
a++) {
142 if (FirstStrip == 128)
144 if (FirstStrip == 256)
146 if (FirstStrip == 384)
148 if (FirstStrip == 512)
150 if (FirstStrip == 640)
153 if (FirstStrip <= 127 && FirstStrip + Ampls.size() > 127)
155 if (FirstStrip <= 255 && FirstStrip + Ampls.size() > 255)
157 if (FirstStrip <= 383 && FirstStrip + Ampls.size() > 383)
159 if (FirstStrip <= 511 && FirstStrip + Ampls.size() > 511)
161 if (FirstStrip <= 639 && FirstStrip + Ampls.size() > 639)
164 if (FirstStrip + Ampls.size() == 127)
166 if (FirstStrip + Ampls.size() == 255)
168 if (FirstStrip + Ampls.size() == 383)
170 if (FirstStrip + Ampls.size() == 511)
172 if (FirstStrip + Ampls.size() == 639)
174 if (FirstStrip + Ampls.size() == 767)
176 }
else if (PixelCluster) {
177 const auto& Ampls = PixelCluster->
pixelADC();
180 FirstStrip = ((FirstRow / 80) << 3 | (FirstCol / 52)) * 128;
185 for (
unsigned int a = 0;
a < Ampls.size();
a++) {
191 #ifdef ExtendedCALIBTree
192 double ChargeOverPath = (double)
Charge /
Path;
196 rawid->push_back(
DetId);
197 localdirx->push_back(trackDirection.
x());
198 localdiry->push_back(trackDirection.
y());
199 localdirz->push_back(trackDirection.
z());
200 firststrip->push_back(FirstStrip);
201 nstrips->push_back(NStrips);
202 saturation->push_back(Saturation);
207 #ifdef ExtendedCALIBTree
208 chargeoverpath->push_back(ChargeOverPath);
210 gainused->push_back(PrevGain);
211 gainusedTick->push_back(PrevGainTick);
228 #ifdef ExtendedCALIBTree
292 const uint32_t detid,
301 if (dynamic_cast<const StripGeomDetUnit*>(it) ==
nullptr && dynamic_cast<const PixelGeomDetUnit*>(it) ==
nullptr) {
302 std::cout <<
"this detID doesn't seem to belong to the Tracker" << std::endl;
307 const TrapezoidalPlaneBounds* trapezoidalBounds(dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
308 const RectangularPlaneBounds* rectangularBounds(dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
310 double DistFromBorder = 1.0;
313 if (trapezoidalBounds) {
314 std::array<const float, 4>
const&
parameters = (*trapezoidalBounds).parameters();
316 }
else if (rectangularBounds) {
322 if (fabs(HitLocalPos.
y()) + HitLocalError.
yy() >= (
HalfLength - DistFromBorder))
333 double detThickness = 1.;
336 bool isPixel = dynamic_cast<const PixelGeomDetUnit*>(it) !=
nullptr;
337 bool isStrip = dynamic_cast<const StripGeomDetUnit*>(it) !=
nullptr;
340 edm::LogWarning(
"DeDxHitsProducer") <<
"\t\t this detID doesn't seem to belong to the Tracker";
343 detThickness = it->surface().bounds().thickness();