11 bool trackIdHitPairLess(
const std::pair<unsigned int, const PSimHit *> &
a,
12 const std::pair<unsigned int, const PSimHit *> &
b) {
13 return a.first <
b.first;
16 bool trackIdHitPairLessSort(
const std::pair<unsigned int, const PSimHit *> &
a,
17 const std::pair<unsigned int, const PSimHit *> &
b) {
18 if (
a.first ==
b.first) {
20 ?
a.second->timeOfFlight()
21 : std::numeric_limits<decltype(
a.second->timeOfFlight())>::
max();
23 ?
b.second->timeOfFlight()
24 : std::numeric_limits<decltype(
b.second->timeOfFlight())>::
max();
27 return a.first <
b.first;
39 for (
const auto &
simHit : *hsimhits) {
46 std::tuple<std::unique_ptr<edm::ValueMap<unsigned int>>,
47 std::unique_ptr<edm::ValueMap<unsigned int>>,
48 std::unique_ptr<edm::ValueMap<unsigned int>>>
57 std::vector<unsigned int> valuesLayers(tps.size(), 0);
58 std::vector<unsigned int> valuesPixelLayers(tps.size(), 0);
59 std::vector<unsigned int> valuesStripMonoAndStereoLayers(tps.size(), 0);
60 for (
size_t iTP = 0; iTP < tps.size(); ++iTP) {
66 constexpr
unsigned int maxLayer = 0xF + 1;
67 bool hasHit[maxSubdet][maxLayer];
68 bool hasPixel[maxSubdet][maxLayer];
69 bool hasMono[maxSubdet][maxLayer];
70 bool hasStereo[maxSubdet][maxLayer];
71 memset(hasHit, 0,
sizeof(hasHit));
72 memset(hasPixel, 0,
sizeof(hasPixel));
73 memset(hasMono, 0,
sizeof(hasMono));
74 memset(hasStereo, 0,
sizeof(hasStereo));
80 std::pair<unsigned int, const PSimHit *>(
simTrack.trackId(),
nullptr),
85 auto iHitPtr =
range.first;
86 for (; iHitPtr !=
range.second; ++iHitPtr) {
88 if (iHitPtr->second->particleType() ==
pdgId)
91 if (iHitPtr ==
range.second)
93 int processType = iHitPtr->second->processType();
96 for (; iHitPtr !=
range.second; ++iHitPtr) {
98 if (
simHit.eventId() !=
tp.eventId())
107 bool isStripStereo =
false;
108 bool isStripMono =
false;
116 isStripMono = tTopo.
tibIsRPhi(newDetector);
120 isStripMono = tTopo.
tidIsRPhi(newDetector);
124 isStripMono = tTopo.
tobIsRPhi(newDetector);
128 isStripMono = tTopo.
tecIsRPhi(newDetector);
133 const auto subdet = newDetector.
subdetId();
134 const auto layer = tTopo.
layer(newDetector);
136 hasHit[subdet][layer] =
true;
138 hasPixel[subdet][layer] =
isPixel;
139 else if (isStripMono)
140 hasMono[subdet][layer] = isStripMono;
141 else if (isStripStereo)
142 hasStereo[subdet][layer] = isStripStereo;
150 for (
unsigned int i = 0;
i < maxSubdet; ++
i) {
151 for (
unsigned int j = 0;
j < maxLayer; ++
j) {
163 auto ret0 = std::make_unique<edm::ValueMap<unsigned int>>();
166 filler.insert(htps, valuesLayers.begin(), valuesLayers.end());
169 auto ret1 = std::make_unique<edm::ValueMap<unsigned int>>();
172 filler.insert(htps, valuesPixelLayers.begin(), valuesPixelLayers.end());
175 auto ret2 = std::make_unique<edm::ValueMap<unsigned int>>();
178 filler.insert(htps, valuesStripMonoAndStereoLayers.begin(), valuesStripMonoAndStereoLayers.end());