81 int& NClusterSaturating);
111 using namespace reco;
117 desc.add<
string>(
"estimator",
"generic");
119 desc.add<
bool>(
"UsePixel",
false);
120 desc.add<
bool>(
"UseStrip",
true);
121 desc.add<
double>(
"MeVperADCStrip", 3.61e-06 * 265);
122 desc.add<
double>(
"MeVperADCPixel", 3.61e-06);
123 desc.add<
bool>(
"ShapeTest",
true);
124 desc.add<
bool>(
"UseCalibration",
false);
125 desc.add<
string>(
"calibrationPath",
"");
126 desc.add<
string>(
"Reccord",
"SiStripDeDxMip_3D_Rcd");
127 desc.add<
string>(
"ProbabilityMode",
"Accumulation");
128 desc.add<
double>(
"fraction", 0.4);
129 desc.add<
double>(
"exponent", -2.0);
130 desc.add<
bool>(
"convertFromGeV2MeV",
true);
131 desc.add<
bool>(
"nothick",
false);
134 descriptions.
add(
"FastTrackDeDxProducer",
desc);
139 simHit2RecHitMapToken(
141 produces<ValueMap<DeDxData>>();
143 string estimatorName = iConfig.
getParameter<
string>(
"estimator");
144 if (estimatorName ==
"median")
146 else if (estimatorName ==
"generic")
148 else if (estimatorName ==
"truncated")
151 else if (estimatorName ==
"productDiscrim")
153 else if (estimatorName ==
"btagDiscrim")
155 else if (estimatorName ==
"smirnovDiscrim")
157 else if (estimatorName ==
"asmirnovDiscrim")
160 throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc") <<
" estimator name does not exist";
180 throw cms::Exception(
"fastsim::SimplifiedGeometry::FastTrackDeDxProducer.cc")
181 <<
" neither pixel hits nor strips hits will be used to compute de/dx";
198 auto trackDeDxEstimateAssociation = std::make_unique<ValueMap<DeDxData>>();
209 int NClusterSaturating = 0;
212 auto const& trajParams =
track->extra()->trajParams();
215 auto hb =
track->recHitsBegin();
216 dedxHits.reserve(
track->recHitsSize() / 2);
218 for (
unsigned int h = 0;
h <
track->recHitsSize();
h++) {
222 auto trackDirection = trajParams[
h].direction();
223 float cosine = trackDirection.z() / trackDirection.mag();
227 sort(dedxHits.begin(), dedxHits.end(), less<DeDxHit>());
228 std::pair<float, float> val_and_error =
m_estimator->dedx(dedxHits);
231 val_and_error.second = NClusterSaturating;
232 dedxEstimate[
j] =
DeDxData(val_and_error.first, val_and_error.second, dedxHits.size());
235 filler.insert(trackCollectionHandle, dedxEstimate.begin(), dedxEstimate.end());
245 int& NClusterSaturating) {
249 auto const& thit = static_cast<BaseTrackerRecHit const&>(
recHit);
252 if (!thit.hasPositionAndError())
259 auto& detUnit = *(
recHit.detUnit());
260 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
267 }
else if (!
recHit.isPixel()) {
270 auto& detUnit = *(
recHit.detUnit());
271 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
274 float dedxOfRecHit =
recHit.energyLoss() / pathLen;
276 dedxOfRecHit *= 1000;