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");
57 if (!usePixel && !useStrip)
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++) {
125 (track->px() * ModuleNormal.
x() + track->py() * ModuleNormal.
y() + track->pz() * ModuleNormal.
z()) /
128 processHit(recHit, track->p(), cosine, hscpDeDxInfo,
LocalPoint(0.0, 0.0));
132 dEdxInfos[
j] = hscpDeDxInfo;
136 filler.
insert(trackCollectionHandle, dEdxInfos.begin(), dEdxInfos.end());
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()) {
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());
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Point3DBase< Scalar, LocalTag > LocalPoint
friend struct const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
LocalVector localDirection() const
LocalPoint localPosition() const
OmniClusterRef const & stereoClusterRef() const
GlobalVector normalVector() const
void insert(const H &h, I begin, I end)
const Bounds & bounds() const
std::vector< float > localPosYs
key_type key() const
Accessor for product key.
const Plane & surface() const
The nominal surface of the GeomDet.
std::vector< float > pathlengths
LocalVector localMomentum() const
HSCPDeDxInfoProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
unsigned int offsetDU(SubDetector sid) const
void produce(edm::Event &, const edm::EventSetup &) override
~HSCPDeDxInfoProducer() override
OmniClusterRef const & monoClusterRef() const
std::vector< uint32_t > detIds
std::vector< float > charges
SiStripRecHit2D stereoHit() const
T const * product() const
virtual float thickness() const =0
SiStripCluster const & stripCluster() const
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
const GeomDetUnit * detUnit() const override
const Surface * surface() const final
SiStripRecHit2D monoHit() const
virtual const GeomDetUnit * detUnit() const
std::vector< uint32_t > clusterIndices
const_iterator begin() const
first iterator over the map (read only)
std::vector< float > localPosXs
void beginRun(edm::Run const &run, const edm::EventSetup &) override
void processHit(const TrackingRecHit *recHit, float trackMomentum, float &cosine, susybsm::HSCPDeDxInfo &hscpDeDxInfo, LocalPoint HitLocalPos)