10 bool trackIdHitPairLess(
const std::pair<unsigned int, const PSimHit*>&
a,
const std::pair<unsigned int, const PSimHit*>&
b) {
11 return a.first < b.first;
14 bool trackIdHitPairLessSort(
const std::pair<unsigned int, const PSimHit*>&
a,
const std::pair<unsigned int, const PSimHit*>&
b) {
15 if(a.first == b.first) {
16 const auto atof =
edm::isFinite(a.second->timeOfFlight()) ? a.second->timeOfFlight() : std::numeric_limits<decltype(a.second->timeOfFlight())>::
max();
17 const auto btof =
edm::isFinite(b.second->timeOfFlight()) ? b.second->timeOfFlight() : std::numeric_limits<decltype(b.second->timeOfFlight())>::
max();
20 return a.first < b.first;
32 for(
const auto&
simHit: *hsimhits) {
39 std::tuple<std::unique_ptr<edm::ValueMap<unsigned int>>,
40 std::unique_ptr<edm::ValueMap<unsigned int>>,
41 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) {
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));
71 if(range.first == range.second)
continue;
73 auto iHitPtr = range.first;
74 for(; iHitPtr != range.second; ++iHitPtr) {
76 if(iHitPtr->second->particleType() ==
pdgId)
79 if(iHitPtr == range.second)
81 int processType = iHitPtr->second->processType();
84 for(; iHitPtr != range.second; ++iHitPtr) {
94 bool isStripStereo =
false;
95 bool isStripMono =
false;
103 isStripMono = tTopo.
tibIsRPhi(newDetector);
107 isStripMono = tTopo.
tidIsRPhi(newDetector);
111 isStripMono = tTopo.
tobIsRPhi(newDetector);
115 isStripMono = tTopo.
tecIsRPhi(newDetector);
120 const auto subdet = newDetector.
subdetId();
121 const auto layer = tTopo.
layer( newDetector );
123 hasHit[subdet][layer] =
true;
124 if(isPixel) hasPixel[subdet][layer] =
isPixel;
125 else if(isStripMono) hasMono[subdet][layer] = isStripMono;
126 else if(isStripStereo) hasStereo[subdet][layer] = isStripStereo;
135 for(
unsigned int i=0;
i<maxSubdet; ++
i) {
136 for(
unsigned int j=0; j<maxLayer; ++j) {
137 nLayers += hasHit[
i][j];
138 nPixelLayers += hasPixel[
i][j];
139 nStripMonoAndStereoLayers += (hasMono[
i][j] && hasStereo[
i][j]);
148 auto ret0 = std::make_unique<edm::ValueMap<unsigned int>>();
151 filler.
insert(htps, valuesLayers.begin(), valuesLayers.end());
154 auto ret1 = std::make_unique<edm::ValueMap<unsigned int>>();
157 filler.
insert(htps, valuesPixelLayers.begin(), valuesPixelLayers.end());
160 auto ret2 = std::make_unique<edm::ValueMap<unsigned int>>();
163 filler.
insert(htps, valuesStripMonoAndStereoLayers.begin(), valuesStripMonoAndStereoLayers.end());
const std::vector< SimTrack > & g4Tracks() const
std::vector< TrackingParticle > TrackingParticleCollection
bool tobIsStereo(const DetId &id) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int pdgId() const
PDG ID.
void insert(const H &h, I begin, I end)
bool tobIsRPhi(const DetId &id) const
bool tidIsStereo(const DetId &id) const
bool tecIsStereo(const DetId &id) const
bool tibIsRPhi(const DetId &id) const
simTrack
per collection params
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
EncodedEventId eventId() const
bool tecIsRPhi(const DetId &id) const
std::vector< std::pair< unsigned int, const PSimHit * > > trackIdToHitPtr_
bool tidIsRPhi(const DetId &id) const
TrackingParticleNumberOfLayers(const edm::Event &iEvent, const std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > &simHitTokens)
bool tibIsStereo(const DetId &id) const
unsigned short processType() const
unsigned int layer(const DetId &id) const
EncodedEventId eventId() const
Signal source, crossing number.
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 edm::EventSetup &iSetup) const
bool isPixel(HitType hitType)
Monte Carlo truth information used for tracking validation.
unsigned int detUnitId() const