82 int& NClusterSaturating);
113 using namespace reco;
119 desc.add<
string>(
"estimator",
"generic");
121 desc.add<
bool>(
"UsePixel",
false);
122 desc.add<
bool>(
"UseStrip",
true);
123 desc.add<
double>(
"MeVperADCStrip", 3.61e-06 * 265);
124 desc.add<
double>(
"MeVperADCPixel", 3.61e-06);
125 desc.add<
bool>(
"ShapeTest",
true);
126 desc.add<
bool>(
"UseCalibration",
false);
127 desc.add<
string>(
"calibrationPath",
"");
128 desc.add<
string>(
"Reccord",
"SiStripDeDxMip_3D_Rcd");
129 desc.add<
string>(
"ProbabilityMode",
"Accumulation");
130 desc.add<
double>(
"fraction", 0.4);
131 desc.add<
double>(
"exponent", -2.0);
132 desc.add<
bool>(
"convertFromGeV2MeV",
true);
133 desc.add<
bool>(
"nothick",
false);
136 descriptions.
add(
"FastTrackDeDxProducer",
desc);
141 simHit2RecHitMapToken(
144 produces<ValueMap<DeDxData>>();
146 auto cCollector = consumesCollector();
147 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
148 if (estimatorName ==
"median")
150 else if (estimatorName ==
"generic")
152 else if (estimatorName ==
"truncated")
155 else if (estimatorName ==
"productDiscrim")
157 else if (estimatorName ==
"btagDiscrim")
159 else if (estimatorName ==
"smirnovDiscrim")
161 else if (estimatorName ==
"asmirnovDiscrim")
164 throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc") <<
" estimator name does not exist";
184 throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc")
185 <<
" neither pixel hits nor strips hits will be used to compute de/dx";
202 auto trackDeDxEstimateAssociation = std::make_unique<ValueMap<DeDxData>>();
213 int NClusterSaturating = 0;
216 auto const& trajParams =
track->extra()->trajParams();
219 auto hb =
track->recHitsBegin();
220 dedxHits.reserve(
track->recHitsSize() / 2);
222 for (
unsigned int h = 0;
h <
track->recHitsSize();
h++) {
226 auto trackDirection = trajParams[
h].direction();
227 float cosine = trackDirection.z() / trackDirection.mag();
231 sort(dedxHits.begin(), dedxHits.end(), less<DeDxHit>());
232 std::pair<float, float> val_and_error =
m_estimator->dedx(dedxHits);
235 val_and_error.second = NClusterSaturating;
236 dedxEstimate[
j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size());
239 filler.insert(trackCollectionHandle, dedxEstimate.begin(), dedxEstimate.end());
249 int& NClusterSaturating) {
253 auto const& thit = static_cast<BaseTrackerRecHit const&>(
recHit);
256 if (!thit.hasPositionAndError())
263 auto& detUnit = *(
recHit.detUnit());
264 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
271 }
else if (!
recHit.isPixel()) {
274 auto& detUnit = *(
recHit.detUnit());
275 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
278 float dedxOfRecHit =
recHit.energyLoss() / pathLen;
280 dedxOfRecHit *= 1000;