31 minTrackHits(iConfig.getParameter<unsigned>(
"minTrackHits")),
32 minTrackPt(iConfig.getParameter<double>(
"minTrackPt")),
34 maxTrackEta(iConfig.getParameter<double>(
"maxTrackEta")),
35 m_calibrationPath(iConfig.getParameter<
string>(
"calibrationPath")),
37 shapetest(iConfig.getParameter<
bool>(
"shapeTest")),
40 lowPtTracksEstimator(iConfig.getParameter<
edm::
ParameterSet>(
"lowPtTracksEstimatorParameters")),
42 produces<reco::DeDxHitInfoCollection>();
43 produces<reco::DeDxHitInfoAss>();
44 produces<edm::ValueMap<int>>(
"prescale");
47 m_tkGeomToken = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>();
50 edm::LogError(
"DeDxHitsProducer") <<
"No Pixel Hits NOR Strip Hits will be saved. Running this module is useless";
71 auto resultdedxHitColl = std::make_unique<reco::DeDxHitInfoCollection>();
80 bool passPt = (
track.pt() >=
minTrackPt), passLowDeDx =
false, passHighDeDx =
false, pass = passPt;
88 pass = passHighDeDx || passLowDeDx;
96 auto const& trajParams =
track.extra()->trajParams();
98 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
103 auto trackDirection = trajParams[
h].direction();
104 float cosine = trackDirection.z() / trackDirection.mag();
110 std::vector<DeDxHit>
hits;
112 for (
unsigned int i = 0,
n = hitDeDxInfo.
size();
i <
n; ++
i) {
140 indices.push_back(resultdedxHitColl->size());
141 resultdedxHitColl->push_back(hitDeDxInfo);
148 auto dedxMatch = std::make_unique<reco::DeDxHitInfoAss>(dedxHitCollHandle);
154 auto dedxPrescale = std::make_unique<edm::ValueMap<int>>();
166 auto const& thit = static_cast<BaseTrackerRecHit const&>(*
recHit);
172 auto const& clus = thit.firstClusterRef();
176 if (clus.isPixel()) {
180 const auto* detUnit =
recHit->detUnit();
181 if (detUnit ==
nullptr)
184 float chargeAbs = clus.pixelCluster().charge();
185 hitDeDxInfo.
addHit(chargeAbs, pathLen, thit.geographicalId(), hitLocalPos, clus.pixelCluster());
186 }
else if (clus.isStrip() && !thit.isMatched()) {
190 const auto* detUnit =
recHit->detUnit();
191 if (detUnit ==
nullptr)
196 hitDeDxInfo.
addHit(chargeAbs, pathLen, thit.geographicalId(), hitLocalPos, clus.stripCluster());
197 }
else if (clus.isStrip() && thit.isMatched()) {
205 if (detUnitM ==
nullptr)
214 if (detUnitS ==
nullptr)