101 state[1] =
x ^ y ^ (
x >> 17) ^ (y >> 26);
107 : usePixel_(iConfig.getParameter<
bool>(
"usePixel")),
108 useStrip_(iConfig.getParameter<
bool>(
"useStrip")),
109 theMeVperADCPixel_(iConfig.getParameter<double>(
"MeVperADCPixel")),
110 theMeVperADCStrip_(iConfig.getParameter<double>(
"MeVperADCStrip")),
111 minTrackHits_(iConfig.getParameter<unsigned>(
"minTrackHits")),
112 minTrackPt_(iConfig.getParameter<double>(
"minTrackPt")),
113 minTrackPtPrescale_(iConfig.getParameter<double>(
"minTrackPtPrescale")),
114 maxTrackEta_(iConfig.getParameter<double>(
"maxTrackEta")),
115 calibrationPath_(iConfig.getParameter<
string>(
"calibrationPath")),
116 useCalibration_(iConfig.getParameter<
bool>(
"useCalibration")),
117 doShapeTest_(iConfig.getParameter<
bool>(
"shapeTest")),
119 lowPtTracksPrescalePass_(iConfig.getParameter<uint32_t>(
"lowPtTracksPrescalePass")),
120 lowPtTracksPrescaleFail_(iConfig.getParameter<uint32_t>(
"lowPtTracksPrescaleFail")),
121 lowPtTracksEstimator_(iConfig.getParameter<
edm::
ParameterSet>(
"lowPtTracksEstimatorParameters")),
122 lowPtTracksDeDxThreshold_(iConfig.getParameter<double>(
"lowPtTracksDeDxThreshold")),
123 usePixelForPrescales_(iConfig.getParameter<
bool>(
"usePixelForPrescales")),
129 produces<reco::DeDxHitInfoCollection>();
130 produces<reco::DeDxHitInfoAss>();
131 produces<edm::ValueMap<int>>(
"prescale");
134 edm::LogError(
"DeDxHitsProducer") <<
"No Pixel Hits NOR Strip Hits will be saved. Running this module is useless";
159 auto resultdedxHitColl = std::make_unique<reco::DeDxHitInfoCollection>();
168 bool passPt = (
track.pt() >=
minTrackPt_), passLowDeDx =
false, passHighDeDx =
false, pass = passPt;
176 pass = passHighDeDx || passLowDeDx;
184 auto const& trajParams =
track.extra()->trajParams();
185 auto hb =
track.recHitsBegin();
186 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
195 std::vector<DeDxHit>
hits;
197 for (
unsigned int i = 0,
n = hitDeDxInfo.
size();
i <
n; ++
i) {
231 indices.push_back(resultdedxHitColl->size());
232 resultdedxHitColl->push_back(hitDeDxInfo);
239 auto dedxMatch = std::make_unique<reco::DeDxHitInfoAss>(dedxHitCollHandle);
245 auto dedxPrescale = std::make_unique<edm::ValueMap<int>>();
261 if (usable && meas <=
int(
std::abs(pred)) + 4)
270 const auto* detUnit =
recHit.detUnit();
271 if (detUnit ==
nullptr)
288 float cosine = trackDirection.
z() / trackDirection.
mag();
291 auto const& clus = thit.firstClusterRef();
295 const auto* detUnit =
recHit->detUnit();
296 if (detUnit ==
nullptr) {
301 if (clus.isPixel()) {
314 if (
data.isComplete &&
data.isStraight &&
data.hasBigPixelsOnlyInside)
317 float chargeAbs = clus.pixelCluster().charge();
318 hitDeDxInfo.
addHit(chargeAbs, pathLen, thit.geographicalId(), hitLocalPos,
type, clus.pixelCluster());
319 }
else if (clus.isStrip() && !thit.isMatched()) {
323 processRec(hitDeDxInfo, {thit.geographicalId(), clus}, hitLocalPos, trackDirection, cosineAbs);
324 }
else if (clus.isStrip() && thit.isMatched()) {
331 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_
void processHit(const TrackingRecHit *recHit, const float trackMomentum, const LocalVector &trackDirection, reco::DeDxHitInfo &hitDeDxInfo, const LocalPoint &hitLocalPos)
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]
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 Bounds & bounds() const