8 bool trackIdHitPairLess(
const std::pair<unsigned int, const PSimHit *> &
a,
9 const std::pair<unsigned int, const PSimHit *> &
b) {
10 return a.first <
b.first;
13 bool trackIdHitPairLessSort(
const std::pair<unsigned int, const PSimHit *> &
a,
14 const std::pair<unsigned int, const PSimHit *> &
b) {
15 if (
a.first ==
b.first) {
17 ?
a.second->timeOfFlight()
18 : std::numeric_limits<decltype(
a.second->timeOfFlight())>::
max();
20 ?
b.second->timeOfFlight()
21 : std::numeric_limits<decltype(
b.second->timeOfFlight())>::
max();
24 return a.first <
b.first;
36 for (
const auto &
simHit : *hsimhits) {
43 std::tuple<std::unique_ptr<edm::ValueMap<unsigned int>>,
44 std::unique_ptr<edm::ValueMap<unsigned int>>,
45 std::unique_ptr<edm::ValueMap<unsigned int>>>
49 std::vector<unsigned int> valuesLayers(tps.size(), 0);
50 std::vector<unsigned int> valuesPixelLayers(tps.size(), 0);
51 std::vector<unsigned int> valuesStripMonoAndStereoLayers(tps.size(), 0);
52 for (
size_t iTP = 0; iTP < tps.size(); ++iTP) {
58 constexpr
unsigned int maxLayer = 0xF + 1;
59 bool hasHit[maxSubdet][maxLayer];
60 bool hasPixel[maxSubdet][maxLayer];
61 bool hasMono[maxSubdet][maxLayer];
62 bool hasStereo[maxSubdet][maxLayer];
63 memset(hasHit, 0,
sizeof(hasHit));
64 memset(hasPixel, 0,
sizeof(hasPixel));
65 memset(hasMono, 0,
sizeof(hasMono));
66 memset(hasStereo, 0,
sizeof(hasStereo));
72 std::pair<unsigned int, const PSimHit *>(
simTrack.trackId(),
nullptr),
77 auto iHitPtr =
range.first;
78 for (; iHitPtr !=
range.second; ++iHitPtr) {
80 if (iHitPtr->second->particleType() ==
pdgId)
83 if (iHitPtr ==
range.second)
85 int processType = iHitPtr->second->processType();
88 for (; iHitPtr !=
range.second; ++iHitPtr) {
90 if (
simHit.eventId() !=
tp.eventId())
99 bool isStripStereo =
false;
100 bool isStripMono =
false;
108 isStripMono = tTopo.
tibIsRPhi(newDetector);
112 isStripMono = tTopo.
tidIsRPhi(newDetector);
116 isStripMono = tTopo.
tobIsRPhi(newDetector);
120 isStripMono = tTopo.
tecIsRPhi(newDetector);
125 const auto subdet = newDetector.
subdetId();
128 hasHit[subdet][
layer] =
true;
131 else if (isStripMono)
132 hasMono[subdet][
layer] = isStripMono;
133 else if (isStripStereo)
134 hasStereo[subdet][
layer] = isStripStereo;
142 for (
unsigned int i = 0;
i < maxSubdet; ++
i) {
143 for (
unsigned int j = 0;
j < maxLayer; ++
j) {
155 auto ret0 = std::make_unique<edm::ValueMap<unsigned int>>();
158 filler.insert(htps, valuesLayers.begin(), valuesLayers.end());
161 auto ret1 = std::make_unique<edm::ValueMap<unsigned int>>();
164 filler.insert(htps, valuesPixelLayers.begin(), valuesPixelLayers.end());
167 auto ret2 = std::make_unique<edm::ValueMap<unsigned int>>();
170 filler.insert(htps, valuesStripMonoAndStereoLayers.begin(), valuesStripMonoAndStereoLayers.end());
static constexpr auto TEC
TrackingParticleNumberOfLayers(const edm::Event &iEvent, const std::vector< edm::EDGetTokenT< std::vector< PSimHit >>> &simHitTokens)
constexpr bool isFinite(T x)
bool tibIsStereo(const DetId &id) const
unsigned int layer(const DetId &id) const
bool tobIsStereo(const DetId &id) const
bool tibIsRPhi(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
std::vector< std::pair< unsigned int, const PSimHit * > > trackIdToHitPtr_
bool tobIsRPhi(const DetId &id) const
bool tidIsRPhi(const DetId &id) const
bool tecIsRPhi(const DetId &id) const
static constexpr auto TIB
bool tecIsStereo(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool isPixel(HitType hitType)
Monte Carlo truth information used for tracking validation.
std::vector< TrackingParticle > TrackingParticleCollection
static constexpr auto TID
std::tuple< std::unique_ptr< edm::ValueMap< unsigned int > >, std::unique_ptr< edm::ValueMap< unsigned int > >, std::unique_ptr< edm::ValueMap< unsigned int > > > calculate(const edm::Handle< TrackingParticleCollection > &tps, const TrackerTopology &tTopo) const