30 produces<ValueMap<susybsm::HSCPDeDxInfo> >();
40 m_trajTrackAssociationTag =
46 meVperADCPixel = iConfig.
getParameter<
double>(
"MeVperADCPixel");
47 meVperADCStrip = iConfig.
getParameter<
double>(
"MeVperADCStrip");
51 m_calibrationPath = iConfig.
getParameter<
string>(
"calibrationPath");
59 <<
"Pixel Hits AND Strip Hits will not be used to estimate dEdx --> BUG, Please Update the config file";
82 iEvent.getByToken(m_tracksTag, trackCollectionHandle);
86 iEvent.getByToken(m_trajTrackAssociationTag, trajTrackAssociationHandle);
88 std::vector<susybsm::HSCPDeDxInfo> dEdxInfos(trackCollectionHandle->size());
92 cit = trajTrackAssociationHandle->
begin();
93 for (
unsigned int j = 0;
j < trackCollectionHandle->size();
j++) {
101 const vector<TrajectoryMeasurement>& measurements = traj->measurements();
102 for (vector<TrajectoryMeasurement>::const_iterator it = measurements.begin(); it != measurements.end(); it++) {
111 float cosine = trackDirection.
z() / trackDirection.
mag();
117 for (
unsigned int h = 0;
h <
track->recHitsSize();
h++) {
119 auto const& thit = static_cast<BaseTrackerRecHit const&>(*
recHit);
125 (
track->px() * ModuleNormal.
x() +
track->py() * ModuleNormal.
y() +
track->pz() * ModuleNormal.
z()) /
132 dEdxInfos[
j] = hscpDeDxInfo;
136 filler.insert(trackCollectionHandle, dEdxInfos.begin(), dEdxInfos.end());
146 auto const& thit = static_cast<BaseTrackerRecHit const&>(*
recHit);
150 auto const& clus = thit.firstClusterRef();
154 if (clus.isPixel()) {
158 auto& detUnit = *(
recHit->detUnit());
159 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
160 float chargeAbs = clus.pixelCluster().charge();
161 hscpDeDxInfo.
charges.push_back(chargeAbs);
163 hscpDeDxInfo.
detIds.push_back(thit.geographicalId());
164 hscpDeDxInfo.
localPosXs.push_back(HitLocalPos.
x());
165 hscpDeDxInfo.
localPosYs.push_back(HitLocalPos.
y());
167 }
else if (clus.isStrip() && !thit.isMatched()) {
171 auto& detUnit = *(
recHit->detUnit());
173 float pathLen = detUnit.surface().bounds().thickness() / fabs(cosine);
174 float chargeAbs =
DeDxTools::getCharge(&(clus.stripCluster()), NSaturating, detUnit, calibGains, m_off);
175 hscpDeDxInfo.
charges.push_back(chargeAbs);
177 hscpDeDxInfo.
detIds.push_back(thit.geographicalId());
178 hscpDeDxInfo.
localPosXs.push_back(HitLocalPos.
x());
179 hscpDeDxInfo.
localPosYs.push_back(HitLocalPos.
y());
181 }
else if (clus.isStrip() && thit.isMatched()) {
190 float pathLen = detUnitM.surface().bounds().thickness() / fabs(cosine);
193 hscpDeDxInfo.
charges.push_back(chargeAbs);
195 hscpDeDxInfo.
detIds.push_back(thit.geographicalId());
196 hscpDeDxInfo.
localPosXs.push_back(HitLocalPos.
x());
197 hscpDeDxInfo.
localPosYs.push_back(HitLocalPos.
y());
203 pathLen = detUnitS.surface().bounds().thickness() / fabs(cosine);
206 hscpDeDxInfo.
charges.push_back(chargeAbs);
208 hscpDeDxInfo.
detIds.push_back(thit.geographicalId());
209 hscpDeDxInfo.
localPosXs.push_back(HitLocalPos.
x());
210 hscpDeDxInfo.
localPosYs.push_back(HitLocalPos.
y());