22 class TrackAssociatorByHits;
25 bool trackIdHitPairLess(
const std::pair<unsigned int, const PSimHit *> &
a,
26 const std::pair<unsigned int, const PSimHit *> &
b) {
27 return a.first <
b.first;
30 bool trackIdHitPairLessSort(
const std::pair<unsigned int, const PSimHit *> &
a,
31 const std::pair<unsigned int, const PSimHit *> &
b) {
32 if (
a.first ==
b.first) {
34 ?
a.second->timeOfFlight()
35 : std::numeric_limits<decltype(
a.second->timeOfFlight())>::
max();
37 ?
b.second->timeOfFlight()
38 : std::numeric_limits<decltype(
b.second->timeOfFlight())>::
max();
41 return a.first <
b.first;
48 for (
const auto &
tag : iConfig.
getParameter<std::vector<edm::InputTag>>(
"simHitToken")) {
57 std::vector<std::pair<unsigned int, const PSimHit *>> trackIdToHitPtr;
64 trackIdToHitPtr.reserve(trackIdToHitPtr.size() + hsimhits->size());
65 for (
const auto &
simHit : *hsimhits) {
69 std::stable_sort(trackIdToHitPtr.begin(), trackIdToHitPtr.end(), trackIdHitPairLessSort);
72 for (TrackingParticleCollection::const_iterator
t = tPC->begin();
t != tPC->end(); ++
t) {
75 bool isBpixtrack =
false, isFpixtrack =
false;
80 auto range = std::equal_range(trackIdToHitPtr.begin(),
81 trackIdToHitPtr.end(),
82 std::pair<unsigned int, const PSimHit *>(
simTrack.trackId(),
nullptr),
87 auto iHitPtr =
range.first;
88 for (; iHitPtr !=
range.second; ++iHitPtr) {
90 if (
simHit.eventId() !=
t->eventId())
95 uint32_t subdetid = (
id.subdetId());
105 if (isBpixtrack || isFpixtrack) {
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
T const * product() const
constexpr bool isFinite(T x)
edm::EDGetTokenT< TrackingParticleCollection > vec_TrackingParticle_Token_
std::vector< HistogramManager > histo
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< TrackingParticle > TrackingParticleCollection
SiPixelPhase1TrackingParticleV(const edm::ParameterSet &conf)
std::vector< edm::EDGetTokenT< std::vector< PSimHit > > > simHitTokens_