62 std::vector<float>& hitMomentum,
103 state[1] =
x ^ y ^ (
x >> 17) ^ (y >> 26);
109 : usePixel_(iConfig.getParameter<
bool>(
"usePixel")),
110 useStrip_(iConfig.getParameter<
bool>(
"useStrip")),
111 theMeVperADCPixel_(iConfig.getParameter<double>(
"MeVperADCPixel")),
112 theMeVperADCStrip_(iConfig.getParameter<double>(
"MeVperADCStrip")),
113 minTrackHits_(iConfig.getParameter<unsigned>(
"minTrackHits")),
114 minTrackPt_(iConfig.getParameter<double>(
"minTrackPt")),
115 minTrackPtPrescale_(iConfig.getParameter<double>(
"minTrackPtPrescale")),
116 maxTrackEta_(iConfig.getParameter<double>(
"maxTrackEta")),
117 calibrationPath_(iConfig.getParameter<
string>(
"calibrationPath")),
118 useCalibration_(iConfig.getParameter<
bool>(
"useCalibration")),
119 doShapeTest_(iConfig.getParameter<
bool>(
"shapeTest")),
121 storeMomentumAtHit_(iConfig.getParameter<
bool>(
"storeMomentumAtHit")),
122 lowPtTracksPrescalePass_(iConfig.getParameter<uint32_t>(
"lowPtTracksPrescalePass")),
123 lowPtTracksPrescaleFail_(iConfig.getParameter<uint32_t>(
"lowPtTracksPrescaleFail")),
124 lowPtTracksEstimator_(iConfig.getParameter<
edm::
ParameterSet>(
"lowPtTracksEstimatorParameters")),
125 lowPtTracksDeDxThreshold_(iConfig.getParameter<double>(
"lowPtTracksDeDxThreshold")),
126 usePixelForPrescales_(iConfig.getParameter<
bool>(
"usePixelForPrescales")),
132 produces<reco::DeDxHitInfoCollection>();
133 produces<reco::DeDxHitInfoAss>();
134 produces<edm::ValueMap<int>>(
"prescale");
136 produces<edm::ValueMap<std::vector<float>>>(
"momentumAtHit");
139 edm::LogError(
"DeDxHitsProducer") <<
"No Pixel Hits NOR Strip Hits will be saved. Running this module is useless";
164 auto resultdedxHitColl = std::make_unique<reco::DeDxHitInfoCollection>();
168 std::vector<std::vector<float>> hitMomenta;
174 bool passPt = (
track.pt() >=
minTrackPt_), passLowDeDx =
false, passHighDeDx =
false, pass = passPt;
182 pass = passHighDeDx || passLowDeDx;
190 std::vector<float> hitMomentum;
191 auto const& trajParams =
track.extra()->trajParams();
192 auto hb =
track.recHitsBegin();
193 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
198 const auto& traj = trajParams[
h];
199 processHit(
recHit, traj.momentum().mag(), traj.direction(), hitDeDxInfo, hitMomentum, traj.position());
204 std::vector<DeDxHit>
hits;
206 for (
unsigned int i = 0,
n = hitDeDxInfo.
size();
i <
n; ++
i) {
240 indices.push_back(resultdedxHitColl->size());
241 resultdedxHitColl->push_back(hitDeDxInfo);
243 hitMomenta.push_back(hitMomentum);
250 auto dedxMatch = std::make_unique<reco::DeDxHitInfoAss>(dedxHitCollHandle);
256 auto dedxPrescale = std::make_unique<edm::ValueMap<int>>();
263 auto dedxMomenta = std::make_unique<edm::ValueMap<std::vector<float>>>();
265 mfiller.insert(dedxHitCollHandle, hitMomenta.begin(), hitMomenta.end());
280 if (usable && meas <=
int(
std::abs(pred)) + 4)
289 const auto* detUnit =
recHit.detUnit();
290 if (detUnit ==
nullptr)
301 std::vector<float>& hitMomentum,
308 float cosine = trackDirection.
z() / trackDirection.
mag();
311 auto const& clus = thit.firstClusterRef();
315 const auto* detUnit =
recHit->detUnit();
316 if (detUnit ==
nullptr) {
321 if (clus.isPixel()) {
334 if (
data.isComplete &&
data.isStraight &&
data.hasBigPixelsOnlyInside)
337 float chargeAbs = clus.pixelCluster().charge();
338 hitDeDxInfo.
addHit(chargeAbs, pathLen, thit.geographicalId(), hitLocalPos,
type, clus.pixelCluster());
339 }
else if (clus.isStrip() && !thit.isMatched()) {
343 processRec(hitDeDxInfo, {thit.geographicalId(), clus}, hitLocalPos, trackDirection, cosineAbs);
344 }
else if (clus.isStrip() && thit.isMatched()) {
353 processRec(hitDeDxInfo, matchedHit->
monoHit(), hitLocalPos, trackDirection, cosineAbs);
float pathlength(size_t i) const
const unsigned int minTrackHits_
const std::string calibrationPath_
const edm::EDGetTokenT< SiPixelClusterShapeCache > pixShapeCacheToken_
SiStripRecHit2D stereoHit() const
bool isFromDet(TrackingRecHit const &hit)
void processRec(reco::DeDxHitInfo &, const SiStripRecHit2D &, const LocalPoint &, const LocalVector &, const float &)
unsigned int offsetDU(SubDetector sid) const
T const * product() const
const unsigned int lowPtTracksPrescaleFail_
std::vector< Track > TrackCollection
collection of Tracks
edm::ESHandle< ClusterShapeHitFilter > clShape_
static constexpr int Compatible
void produce(edm::Event &, const edm::EventSetup &) override
Log< level::Error, false > LogError
const bool usePixelForPrescales_
bool isCompatible(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, PixelData const *pd=nullptr) const
const edm::EDGetTokenT< reco::TrackCollection > tracksToken_
const bool usePixelShape_
virtual float thickness() const =0
const unsigned int lowPtTracksPrescalePass_
DeDxHitInfoProducer(const edm::ParameterSet &)
const float theMeVperADCStrip_
void addHit(const float charge, const float pathlength, const DetId &detId, const LocalPoint &pos, const uint8_t &type, const SiStripCluster &stripCluster)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
const SiStripCluster * stripCluster(size_t i) const
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::ESHandle< TrackerGeometry > tkGeom_
static constexpr int Calibration
DetId detId(size_t i) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const bool useCalibration_
const TrackerGeomDet * idToDet(DetId) const override
const float theMeVperADCPixel_
uint64_t xorshift128p(uint64_t state[2])
const Plane & surface() const
The nominal surface of the GeomDet.
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=nullptr) const
unsigned long long uint64_t
const edm::ESGetToken< ClusterShapeHitFilter, CkfComponentsRecord > clShapeToken_
const float minTrackPtPrescale_
~DeDxHitInfoProducer() override
static constexpr int Complete
char data[epos_bytes_allocation]
void processHit(const TrackingRecHit *recHit, const float trackMomentum, const LocalVector &trackDirection, reco::DeDxHitInfo &hitDeDxInfo, std::vector< float > &hitMomentum, const LocalPoint &hitLocalPos)
GenericTruncatedAverageDeDxEstimator lowPtTracksEstimator_
edm::Handle< SiPixelClusterShapeCache > pixShapeCache_
SiStripRecHit2D monoHit() const
std::pair< float, float > dedx(const reco::DeDxHitCollection &Hits) override
float charge(size_t i) const
std::vector< std::vector< float > > calibGains_
void beginRun(edm::Run const &run, const edm::EventSetup &) override
const float lowPtTracksDeDxThreshold_
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
const bool storeMomentumAtHit_
const Bounds & bounds() const