88 #include "HepPDT/ParticleID.hh" 96 #include <unordered_set> 97 #include <unordered_map> 112 using TrackingParticleRefKeyToIndex = std::unordered_map<reco::RecoToSimCollection::index_type, size_t>;
113 using TrackingVertexRefKeyToIndex = TrackingParticleRefKeyToIndex;
114 using SimHitFullKey = std::pair<TrackPSimHitRef::key_type, edm::ProductID>;
115 using SimHitRefKeyToIndex = std::map<SimHitFullKey, size_t>;
116 using TrackingParticleRefKeyToCount = TrackingParticleRefKeyToIndex;
133 return "UNKNOWN TRACKER HIT TYPE";
137 struct ProductIDSetPrinter {
138 ProductIDSetPrinter(
const std::set<edm::ProductID>&
set) : set_(set) {}
140 void print(std::ostream& os)
const {
141 for (
const auto&
item : set_) {
146 const std::set<edm::ProductID>& set_;
148 std::ostream&
operator<<(std::ostream& os,
const ProductIDSetPrinter&
o) {
152 template <
typename T>
153 struct ProductIDMapPrinter {
154 ProductIDMapPrinter(
const std::map<edm::ProductID, T>&
map) : map_(
map) {}
156 void print(std::ostream& os)
const {
157 for (
const auto&
item : map_) {
158 os <<
item.first <<
" ";
162 const std::map<edm::ProductID, T>& map_;
164 template <
typename T>
165 auto make_ProductIDMapPrinter(
const std::map<edm::ProductID, T>&
map) {
166 return ProductIDMapPrinter<T>(
map);
168 template <
typename T>
169 std::ostream& operator<<(std::ostream& os, const ProductIDMapPrinter<T>&
o) {
174 template <
typename T>
175 struct VectorPrinter {
176 VectorPrinter(
const std::vector<T>& vec) : vec_(vec) {}
178 void print(std::ostream& os)
const {
179 for (
const auto&
item : vec_) {
184 const std::vector<T>& vec_;
186 template <
typename T>
187 auto make_VectorPrinter(
const std::vector<T>& vec) {
188 return VectorPrinter<T>(vec);
190 template <
typename T>
191 std::ostream& operator<<(std::ostream& os, const VectorPrinter<T>&
o) {
196 void checkProductID(
const std::set<edm::ProductID>&
set,
const edm::ProductID&
id,
const char*
name) {
199 <<
"Got " <<
name <<
" with a hit with ProductID " <<
id 200 <<
" which does not match to the set of ProductID's for the hits: " << ProductIDSetPrinter(
set)
201 <<
". Usually this is caused by a wrong hit collection in the configuration.";
204 template <
typename SimLink,
typename Func>
207 if (link.channel() == channel) {
214 template <
typename... Args>
215 void call_nop(Args&&...
args) {}
217 template <
typename...
Types>
224 unsigned int operator[](
size_t i)
const {
return std::get<0>(content_)[
i]; }
226 template <
typename... Args>
227 void book(Args&&...
args) {
228 impl([&](
auto& vec) { vec.book(std::forward<Args>(
args)...); });
231 template <
typename... Args>
233 impl([&](
auto& vec) { vec.push_back(std::forward<Args>(
args)...); });
236 template <
typename... Args>
237 void resize(Args&&...
args) {
238 impl([&](
auto& vec) { vec.resize(std::forward<Args>(
args)...); });
241 template <
typename... Args>
242 void set(Args&&...
args) {
243 impl([&](
auto& vec) { vec.set(std::forward<Args>(
args)...); });
247 impl([&](
auto& vec) { vec.clear(); });
252 template <
typename F>
254 impl2(std::index_sequence_for<Types...>{}, std::forward<F>(
func));
262 template <std::size_t... Is,
typename F>
263 void impl2(std::index_sequence<Is...>,
F&&
func) {
264 call_nop((
func(std::get<Is>(content_)), 0)...);
270 std::map<unsigned int, double> chargeFraction(
const SiPixelCluster& cluster,
273 std::map<unsigned int, double> simTrackIdToAdc;
276 if (idetset == digiSimLink.
end())
277 return simTrackIdToAdc;
281 for (
int iPix = 0; iPix != cluster.
size(); ++iPix) {
285 forEachMatchedSimLink(*idetset, channel, [&](
const PixelDigiSimLink& simLink) {
291 for (
auto& pair : simTrackIdToAdc) {
295 pair.second /= adcSum;
298 return simTrackIdToAdc;
301 std::map<unsigned int, double> chargeFraction(
const SiStripCluster& cluster,
304 std::map<unsigned int, double> simTrackIdToAdc;
307 if (idetset == digiSimLink.
end())
308 return simTrackIdToAdc;
320 for (
const auto& pair : simTrackIdToAdc) {
321 simTrackIdToAdc[pair.first] = (adcSum != 0. ? pair.second / adcSum : 0.);
324 return simTrackIdToAdc;
330 std::map<unsigned int, double> simTrackIdToAdc;
331 throw cms::Exception(
"LogicError") <<
"Not possible to use StripDigiSimLink with Phase2TrackerCluster1D! ";
332 return simTrackIdToAdc;
340 std::map<unsigned int, double> simTrackIdToAdc;
341 return simTrackIdToAdc;
344 struct TrackTPMatch {
346 int countClusters = 0;
349 template <
typename HRange>
350 TrackTPMatch findBestMatchingTrackingParticle(
const HRange&
hits,
352 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
360 std::unordered_map<int, Count>
count;
361 for (
size_t iCluster = 0,
end =
clusters.size(); iCluster <
end; ++iCluster) {
362 const auto& clusterRef =
clusters[iCluster];
365 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
366 const auto tpKey = ip->second.key();
367 if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end())
370 auto& elem =
count[tpKey];
372 elem.innermostHit =
std::min(elem.innermostHit, iCluster);
381 for (
auto& keyCount :
count) {
382 if (keyCount.second.clusters > bestCount ||
383 (keyCount.second.clusters == bestCount && keyCount.second.innermostHit < bestInnermostHit)) {
384 best.key = keyCount.first;
385 best.countClusters = bestCount = keyCount.second.clusters;
386 bestInnermostHit = keyCount.second.innermostHit;
390 LogTrace(
"TrackingNtuple") <<
"findBestMatchingTrackingParticle key " <<
best.key;
395 template <
typename HRange>
396 TrackTPMatch findMatchingTrackingParticleFromFirstHit(
const HRange&
hits,
398 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
406 auto operateCluster = [&](
const auto& clusterRef,
const auto&
func) {
408 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
409 const auto tpKey = ip->second.key();
410 if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end())
416 std::vector<unsigned int>
419 operateCluster(*iCluster, [&](
unsigned int tpKey) { validTPs.push_back(tpKey); });
420 if (validTPs.empty()) {
424 ++
best.countClusters;
426 std::vector<bool> foundTPs(validTPs.size(),
false);
427 for (
auto iEnd =
clusters.end(); iCluster != iEnd; ++iCluster) {
428 const auto& clusterRef = *iCluster;
431 operateCluster(clusterRef, [&](
unsigned int tpKey) {
433 if (
found != cend(validTPs)) {
439 auto iTP = validTPs.size();
443 if (!foundTPs[iTP]) {
444 validTPs.erase(validTPs.begin() + iTP);
445 foundTPs.erase(foundTPs.begin() + iTP);
448 if (!validTPs.empty()) {
452 best.key = validTPs[0];
458 ++
best.countClusters;
462 return best.countClusters >= 3 ?
best : TrackTPMatch();
506 if (
i.tpKey ==
j.tpKey) {
508 return i.detId <
j.detId;
510 return i.tof <
j.tof;
512 return i.tpKey <
j.tpKey;
519 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
523 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
524 std::set<edm::ProductID>& hitProductIds);
529 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
533 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
534 std::set<edm::ProductID>& hitProductIds);
539 std::vector<std::pair<int, int>>& monoStereoClusterList);
544 const std::vector<std::pair<uint64_t, StripMaskContainer const*>>& stripMasks,
545 std::vector<std::pair<int, int>>& monoStereoClusterList);
550 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
554 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
555 std::set<edm::ProductID>& hitProductIds);
559 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
566 std::vector<std::pair<int, int>>& monoStereoClusterList,
567 const std::set<edm::ProductID>& hitProductIds,
568 std::map<edm::ProductID, size_t>& seedToCollIndex);
573 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
574 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
581 const std::set<edm::ProductID>& hitProductIds,
582 const std::map<edm::ProductID, size_t>& seedToCollIndex,
583 const std::vector<const MVACollection*>& mvaColls,
584 const std::vector<const QualityMaskCollection*>& qualColls);
589 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
590 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
598 const std::set<edm::ProductID>& hitProductIds,
599 const std::map<edm::ProductID, size_t>& seedToCollIndex);
602 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
605 SimHitRefKeyToIndex& simHitRefKeyToIndex,
606 std::vector<TPHitIndex>& tpHitList);
613 const TrackingVertexRefKeyToIndex& tvKeyToIndex,
615 const std::vector<TPHitIndex>& tpHitList,
616 const TrackingParticleRefKeyToCount& tpKeyToClusterCount);
620 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
621 const unsigned int seedOffset);
626 const TrackingParticleRefKeyToIndex& tpKeyToIndex);
637 template <
typename SimLink>
643 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
646 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
654 std::vector<edm::EDGetTokenT<edm::View<reco::Track>>>
seedTokens_;
704 #define BOOK(name) tree->Branch((prefix + "_" + #name).c_str(), &name); 722 subdet.push_back(
id.subdetId());
727 unsigned short s = 0;
728 switch (
id.subdetId()) {
772 std::vector<unsigned short>
side;
817 const auto parsed =
parse(tTopo,
id);
818 order.push_back(parsed.order);
819 ring.push_back(parsed.ring);
820 rod.push_back(parsed.rod);
830 const auto parsed =
parse(tTopo,
id);
851 switch (
id.subdetId()) {
866 std::vector<unsigned short>
ring;
867 std::vector<unsigned short>
rod;
883 const auto parsed =
parse(tTopo,
id);
884 string.push_back(parsed.string);
888 isGlued.push_back(parsed.glued);
900 const auto parsed =
parse(tTopo,
id);
901 string[
index] = parsed.string;
920 unsigned int string = 0;
925 switch (
id.subdetId()) {
976 using DetIdPixel = CombineDetId<DetIdCommon, DetIdPixelOnly>;
977 using DetIdStrip = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdStripOnly>;
978 using DetIdPhase2OT = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdPhase2OTOnly>;
979 using DetIdAll = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdStripOnly>;
980 using DetIdAllPhase2 = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdPhase2OTOnly>;
1419 iConfig.getUntrackedParameter<
edm::
InputTag>(
"simHitTPMap"))),
1421 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackAssociator"))),
1423 iConfig.getUntrackedParameter<
edm::
InputTag>(
"pixelDigiSimLink"))),
1425 iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripDigiSimLink"))),
1427 iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTSimLink"))),
1428 includeStripHits_(!iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripDigiSimLink").
label().
empty()),
1429 includePhase2OTHits_(!iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTSimLink").
label().
empty()),
1433 stripRphiRecHitToken_(
1435 stripStereoRecHitToken_(
1438 iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripMatchedRecHits"))),
1440 iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTRecHits"))),
1442 trackingVertexToken_(
1444 tpNLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1445 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNlayers"))),
1446 tpNPixelLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1447 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNpixellayers"))),
1448 tpNStripStereoLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1449 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNstripstereolayers"))),
1450 includeSeeds_(iConfig.getUntrackedParameter<
bool>(
"includeSeeds")),
1451 includeTrackCandidates_(iConfig.getUntrackedParameter<
bool>(
"includeTrackCandidates")),
1452 addSeedCurvCov_(iConfig.getUntrackedParameter<
bool>(
"addSeedCurvCov")),
1453 includeAllHits_(iConfig.getUntrackedParameter<
bool>(
"includeAllHits")),
1454 includeOnTrackHitData_(iConfig.getUntrackedParameter<
bool>(
"includeOnTrackHitData")),
1455 includeMVA_(iConfig.getUntrackedParameter<
bool>(
"includeMVA")),
1456 includeTrackingParticles_(iConfig.getUntrackedParameter<
bool>(
"includeTrackingParticles")),
1457 includeOOT_(iConfig.getUntrackedParameter<
bool>(
"includeOOT")),
1458 keepEleSimHits_(iConfig.getUntrackedParameter<
bool>(
"keepEleSimHits")),
1459 saveSimHitsP3_(iConfig.getUntrackedParameter<
bool>(
"saveSimHitsP3")),
1460 simHitBySignificance_(iConfig.getUntrackedParameter<
bool>(
"simHitBySignificance")),
1461 parametersDefiner_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"beamSpot"), consumesCollector()) {
1465 [&](
const edm::InputTag&
tag) { return consumes<edm::View<reco::Track>>(tag); });
1468 [&](
const edm::InputTag&
tag) { return consumes<std::vector<SeedStopInfo>>(tag); });
1477 [&](
const edm::InputTag&
tag) { return consumes<TrackCandidateCollection>(tag); });
1482 <<
"Both stripDigiSimLink and phase2OTSimLink are set, please set only either one (this information is used " 1483 "to infer if you're running phase0/1 or phase2 detector)";
1487 <<
"Neither stripDigiSimLink or phase2OTSimLink are set, please set either one.";
1493 for (
auto const&
mask : maskVPset) {
1494 auto index =
mask.getUntrackedParameter<
unsigned int>(
"index");
1497 consumes<PixelMaskContainer>(
mask.getUntrackedParameter<
edm::InputTag>(
"src")));
1517 return std::make_tuple(consumes<MVACollection>(edm::InputTag(tag,
"MVAValues")),
1518 consumes<QualityMaskCollection>(edm::InputTag(tag,
"QualityMasks")));
1524 t =
fs->make<TTree>(
"tree",
"tree");
1577 t->Branch(
"trk_q", &
trk_q);
1677 t->Branch(
"tcand_bestFromFirstHitSimTrkShareFracSimClusterDenom",
1705 t->Branch(
"sim_q", &
sim_q);
1754 t->Branch(
"pix_x", &
pix_x);
1755 t->Branch(
"pix_y", &
pix_y);
1756 t->Branch(
"pix_z", &
pix_z);
1797 t->Branch(
"str_x", &
str_x);
1798 t->Branch(
"str_y", &
str_y);
1799 t->Branch(
"str_z", &
str_z);
1819 t->Branch(
"glu_x", &
glu_x);
1820 t->Branch(
"glu_y", &
glu_y);
1821 t->Branch(
"glu_z", &
glu_z);
1864 t->Branch(
"ph2_x", &
ph2_x);
1865 t->Branch(
"ph2_y", &
ph2_y);
1866 t->Branch(
"ph2_z", &
ph2_z);
1908 t->Branch(
"bsp_x", &
bsp_x,
"bsp_x/F");
1909 t->Branch(
"bsp_y", &
bsp_y,
"bsp_y/F");
1910 t->Branch(
"bsp_z", &
bsp_z,
"bsp_z/F");
1911 t->Branch(
"bsp_sigmax", &
bsp_sigmax,
"bsp_sigmax/F");
1912 t->Branch(
"bsp_sigmay", &
bsp_sigmay,
"bsp_sigmay/F");
1913 t->Branch(
"bsp_sigmaz", &
bsp_sigmaz,
"bsp_sigmaz/F");
1946 t->Branch(
"see_q", &
see_q);
1978 t->Branch(
"vtx_x", &
vtx_x);
1979 t->Branch(
"vtx_y", &
vtx_y);
1980 t->Branch(
"vtx_z", &
vtx_z);
2411 using namespace edm;
2412 using namespace reco;
2413 using namespace std;
2423 LogDebug(
"TrackingNtuple") <<
"Analyzing new event";
2438 for (
size_t i = 0,
size = TPCollectionH->size();
i <
size; ++
i) {
2444 tmpTPptr = TPCollectionHRefVector.
product();
2449 TrackingParticleRefKeyToIndex tpKeyToIndex;
2450 for (
size_t i = 0;
i < tpCollection.
size(); ++
i) {
2451 tpKeyToIndex[tpCollection[
i].key()] =
i;
2461 TrackingVertexRefKeyToIndex tvKeyToIndex;
2462 for (
size_t i = 0;
i < tvs.size(); ++
i) {
2466 tvKeyToIndex[
i] = tvRefs.
size();
2478 TrackingParticleRefKeyToCount tpKeyToClusterCount;
2479 for (
const auto& clusterTP : clusterToTPMap) {
2480 tpKeyToClusterCount[clusterTP.second.key()] += 1;
2484 SimHitRefKeyToIndex simHitRefKeyToIndex;
2487 std::vector<TPHitIndex> tpHitList;
2491 std::set<edm::ProductID> hitProductIds;
2492 std::map<edm::ProductID, size_t> seedCollToOffset;
2501 const auto& pixelDigiSimLinks = *pixelDigiSimLinksHandle;
2517 vector<pair<int, int>> monoStereoClusterList;
2521 fillSimHits(
tracker, tpKeyToIndex, *simHitsTPAssoc, tTopo, simHitRefKeyToIndex, tpHitList);
2532 simHitRefKeyToIndex,
2537 LogDebug(
"TrackingNtuple") <<
"foundStripSimLink";
2538 const auto& stripDigiSimLinks = *stripDigiSimLinksHandle;
2546 simHitRefKeyToIndex,
2554 LogDebug(
"TrackingNtuple") <<
"foundPhase2OTSimLinks";
2555 const auto& phase2OTSimLinks = *siphase2OTSimLinksHandle;
2563 simHitRefKeyToIndex,
2579 monoStereoClusterList,
2593 std::vector<const MVACollection*> mvaColls;
2594 std::vector<const QualityMaskCollection*> qualColls;
2600 iEvent.getByToken(std::get<0>(tokenTpl), hmva);
2601 iEvent.getByToken(std::get<1>(tokenTpl), hqual);
2603 mvaColls.push_back(hmva.
product());
2604 qualColls.push_back(hqual.
product());
2605 if (mvaColls.back()->size() !=
tracks.size()) {
2607 <<
"Inconsistency in track collection and MVA sizes. Track collection has " <<
tracks.size()
2608 <<
" tracks, whereas the MVA " << (mvaColls.size() - 1) <<
" has " << mvaColls.back()->size()
2609 <<
" entries. Double-check your configuration.";
2611 if (qualColls.back()->size() !=
tracks.size()) {
2613 <<
"Inconsistency in track collection and quality mask sizes. Track collection has " <<
tracks.size()
2614 <<
" tracks, whereas the quality mask " << (qualColls.size() - 1) <<
" has " << qualColls.back()->size()
2615 <<
" entries. Double-check your configuration.";
2627 tpKeyToClusterCount,
2642 auto const tCandsHandle =
iEvent.getHandle(
token);
2647 label.ReplaceAll(
"TrackCandidates",
"");
2648 label.ReplaceAll(
"muonSeeded",
"muonSeededStep");
2655 tpKeyToClusterCount,
2672 iEvent, iSetup, trackRefs,
bs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList, tpKeyToClusterCount);
2693 template <
typename SimLink>
2705 template <
typename SimLink>
2712 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2715 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2719 std::map<unsigned int, double> simTrackIdToChargeFraction;
2723 simTrackIdToChargeFraction = chargeFraction(GetCluster<SimLink>::call(cluster), hitId,
digiSimLinks);
2725 float h_x = 0, h_y = 0;
2726 float h_xx = 0, h_xy = 0, h_yy = 0;
2728 h_x =
hit.localPosition().
x();
2729 h_y =
hit.localPosition().
y();
2730 h_xx =
hit.localPositionError().xx();
2731 h_xy =
hit.localPositionError().xy();
2732 h_yy =
hit.localPositionError().yy();
2738 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2742 const auto event = trackingParticle->eventId().event();
2743 const auto bx = trackingParticle->eventId().bunchCrossing();
2752 auto tpIndex = tpKeyToIndex.find(trackingParticle.
key());
2753 if (tpIndex == tpKeyToIndex.end())
2757 std::pair<TrackingParticleRef, TrackPSimHitRef> simHitTPpairWithDummyTP(trackingParticle,
TrackPSimHitRef());
2759 auto range = std::equal_range(simHitsTPAssoc.begin(),
2760 simHitsTPAssoc.end(),
2761 simHitTPpairWithDummyTP,
2763 bool foundSimHit =
false;
2764 bool foundElectron =
false;
2765 int foundNonElectrons = 0;
2766 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2771 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2774 foundNonElectrons++;
2784 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2789 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2790 foundElectron =
true;
2795 float sx = TPhit->localPosition().x();
2796 float sy = TPhit->localPosition().y();
2797 float dx =
sx - h_x;
2798 float dy =
sy - h_y;
2799 float sig = (
dx *
dx * h_yy - 2 *
dx *
dy * h_xy +
dy *
dy * h_xx) / (h_xx * h_yy - h_xy * h_xy);
2804 simHitKey = TPhit.
key();
2805 simHitID = TPhit.
id();
2810 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2811 ret.matchingSimHit.push_back(simHitIndex);
2813 double chargeFraction = 0.;
2814 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2815 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2816 if (
found != simTrackIdToChargeFraction.end()) {
2817 chargeFraction +=
found->second;
2821 ret.chargeFraction.push_back(chargeFraction);
2824 ret.bunchCrossing.push_back(
bx);
2828 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2831 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2836 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2837 foundElectron =
true;
2840 if (foundNonElectrons > 0)
2845 auto simHitKey = TPhit.
key();
2846 auto simHitID = TPhit.
id();
2848 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2849 ret.matchingSimHit.push_back(simHitIndex);
2851 double chargeFraction = 0.;
2852 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2853 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2854 if (
found != simTrackIdToChargeFraction.end()) {
2855 chargeFraction +=
found->second;
2859 ret.chargeFraction.push_back(chargeFraction);
2862 ret.bunchCrossing.push_back(
bx);
2866 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2877 <<
"Did not find SimHit for reco hit DetId " << hitId.
rawId() <<
" for TP " << trackingParticle.
key()
2878 <<
" bx:event " <<
bx <<
":" <<
event <<
" PDGid " << trackingParticle->pdgId() <<
" q " 2879 << trackingParticle->charge() <<
" p4 " << trackingParticle->p4() <<
" nG4 " 2880 << trackingParticle->g4Tracks().size() <<
".\nFound SimHits from detectors ";
2881 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2884 ex << dId.
rawId() <<
" ";
2886 if (trackingParticle->eventId().event() != 0) {
2887 ex <<
"\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in " 2899 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2902 SimHitRefKeyToIndex& simHitRefKeyToIndex,
2903 std::vector<TPHitIndex>& tpHitList) {
2904 for (
const auto&
assoc : simHitsTPAssoc) {
2905 auto tpKey =
assoc.first.key();
2909 auto found = tpKeyToIndex.find(tpKey);
2910 if (
found == tpKeyToIndex.end())
2912 const auto tpIndex =
found->second;
2915 const auto& simhit = *(
assoc.second);
2928 auto simHitKey = std::make_pair(
assoc.second.key(),
assoc.second.id());
2930 if (simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) {
2931 for (
const auto& assoc2 : simHitsTPAssoc) {
2932 if (std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) {
2934 auto range1 = std::equal_range(simHitsTPAssoc.begin(),
2935 simHitsTPAssoc.end(),
2938 auto range2 = std::equal_range(simHitsTPAssoc.begin(),
2939 simHitsTPAssoc.end(),
2943 LogTrace(
"TrackingNtuple") <<
"Earlier TP " << assoc2.first.key() <<
" SimTrack Ids";
2944 for (
const auto&
simTrack : assoc2.first->g4Tracks()) {
2946 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2948 for (
auto iHit = range2.first; iHit != range2.second; ++iHit) {
2949 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2950 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2951 << iHit->second->eventId().bunchCrossing() <<
":" 2952 << iHit->second->eventId().event();
2954 LogTrace(
"TrackingNtuple") <<
"Current TP " <<
assoc.first.key() <<
" SimTrack Ids";
2957 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2959 for (
auto iHit = range1.first; iHit != range1.second; ++iHit) {
2960 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2961 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2962 << iHit->second->eventId().bunchCrossing() <<
":" 2963 << iHit->second->eventId().event();
2968 <<
"Got second time the SimHit " << simHitKey.first <<
" of " << simHitKey.second
2969 <<
", first time with TrackingParticle " << assoc2.first.key() <<
", now with " << tpKey;
2972 throw cms::Exception(
"LogicError") <<
"Got second time the SimHit " << simHitKey.first <<
" of " 2973 << simHitKey.second <<
", now with TrackingParticle " << tpKey
2974 <<
", but I didn't find the first occurrance!";
2979 throw cms::Exception(
"LogicError") <<
"Did not find a det unit for DetId " << simhit.detUnitId()
2980 <<
" from tracker geometry";
2982 const auto pos = det->surface().toGlobal(simhit.localPosition());
2983 const float tof = simhit.timeOfFlight();
2985 const auto simHitIndex =
simhit_x.size();
2986 simHitRefKeyToIndex[simHitKey] = simHitIndex;
2996 const auto mom = det->surface().toGlobal(simhit.momentumAtEntry());
3012 tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId());
3019 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3023 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3024 std::set<edm::ProductID>& hitProductIds) {
3025 std::vector<std::pair<uint64_t, PixelMaskContainer const*>> pixelMasks;
3029 iEvent.getByToken(itoken.second, aH);
3030 pixelMasks.emplace_back(1 << itoken.first, aH.
product());
3032 auto pixUsedMask = [&pixelMasks](
size_t key) {
3034 for (
auto const&
m : pixelMasks) {
3035 if (
m.second->mask(
key))
3044 const DetId hitId = it->detId();
3045 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3046 hitProductIds.insert(
hit->cluster().
id());
3048 const int key =
hit->cluster().key();
3049 const int lay = tTopo.
layer(hitId);
3065 pix_x.push_back(
hit->globalPosition().
x());
3066 pix_y.push_back(
hit->globalPosition().
y());
3067 pix_z.push_back(
hit->globalPosition().
z());
3068 pix_xx.push_back(
hit->globalPositionError().cxx());
3069 pix_xy.push_back(
hit->globalPositionError().cyx());
3070 pix_yy.push_back(
hit->globalPositionError().cyy());
3071 pix_yz.push_back(
hit->globalPositionError().czy());
3072 pix_zz.push_back(
hit->globalPositionError().czz());
3073 pix_zx.push_back(
hit->globalPositionError().czx());
3074 pix_radL.push_back(
hit->surface()->mediumProperties().radLen());
3075 pix_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3080 LogTrace(
"TrackingNtuple") <<
"pixHit cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3081 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3091 simHitRefKeyToIndex,
3100 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3106 <<
" event=" << simHitData.
event[0];
3116 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3120 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3121 std::set<edm::ProductID>& hitProductIds) {
3122 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3126 iEvent.getByToken(itoken.second, aH);
3127 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3129 auto strUsedMask = [&stripMasks](
size_t key) {
3131 for (
auto const&
m : stripMasks) {
3132 if (
m.second->mask(
key))
3161 str_x.resize(totalStripHits);
3162 str_y.resize(totalStripHits);
3163 str_z.resize(totalStripHits);
3164 str_xx.resize(totalStripHits);
3165 str_xy.resize(totalStripHits);
3166 str_yy.resize(totalStripHits);
3167 str_yz.resize(totalStripHits);
3168 str_zz.resize(totalStripHits);
3169 str_zx.resize(totalStripHits);
3179 for (
const auto& detset :
hits) {
3180 const DetId hitId = detset.detId();
3181 for (
const auto&
hit : detset) {
3182 hitProductIds.insert(
hit.cluster().
id());
3184 const int key =
hit.cluster().key();
3185 const int lay = tTopo.
layer(hitId);
3203 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit.globalPosition();
3214 simHitRefKeyToIndex,
3223 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3231 <<
" event=" << simHitData.
event[0];
3238 fill(*rphiHits,
"stripRPhiHit");
3239 fill(*stereoHits,
"stripStereoHit");
3245 const std::vector<std::pair<uint64_t, StripMaskContainer const*>>& stripMasks,
3246 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3247 auto strUsedMask = [&stripMasks](
size_t key) {
3249 for (
auto const&
m : stripMasks) {
3250 if (
m.second->mask(
key))
3256 const auto hitId =
hit.geographicalId();
3257 const int lay = tTopo.
layer(hitId);
3258 monoStereoClusterList.emplace_back(
hit.monoHit().cluster().key(),
hit.stereoHit().cluster().key());
3264 glu_x.push_back(
hit.globalPosition().
x());
3265 glu_y.push_back(
hit.globalPosition().
y());
3266 glu_z.push_back(
hit.globalPosition().
z());
3267 glu_xx.push_back(
hit.globalPositionError().cxx());
3268 glu_xy.push_back(
hit.globalPositionError().cyx());
3269 glu_yy.push_back(
hit.globalPositionError().cyy());
3270 glu_yz.push_back(
hit.globalPositionError().czy());
3271 glu_zz.push_back(
hit.globalPositionError().czz());
3272 glu_zx.push_back(
hit.globalPositionError().czx());
3273 glu_radL.push_back(
hit.surface()->mediumProperties().radLen());
3274 glu_bbxi.push_back(
hit.surface()->mediumProperties().xi());
3280 LogTrace(
"TrackingNtuple") <<
"stripMatchedHit" 3281 <<
" cluster0=" <<
hit.stereoHit().cluster().key()
3282 <<
" cluster1=" <<
hit.monoHit().cluster().key() <<
" subdId=" << hitId.subdetId()
3283 <<
" lay=" << lay <<
" rawId=" << hitId.rawId() <<
" pos =" <<
hit.globalPosition();
3290 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3291 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3295 iEvent.getByToken(itoken.second, aH);
3296 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3301 for (
auto it = matchedHits->
begin(); it != matchedHits->
end(); it++) {
3302 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3311 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3315 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3316 std::set<edm::ProductID>& hitProductIds) {
3319 for (
auto it = phase2OTHits->
begin(); it != phase2OTHits->
end(); it++) {
3320 const DetId hitId = it->detId();
3321 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3322 hitProductIds.insert(
hit->cluster().
id());
3324 const int key =
hit->cluster().key();
3325 const int lay = tTopo.
layer(hitId);
3341 ph2_x.push_back(
hit->globalPosition().
x());
3342 ph2_y.push_back(
hit->globalPosition().
y());
3343 ph2_z.push_back(
hit->globalPosition().
z());
3344 ph2_xx.push_back(
hit->globalPositionError().cxx());
3345 ph2_xy.push_back(
hit->globalPositionError().cyx());
3346 ph2_yy.push_back(
hit->globalPositionError().cyy());
3347 ph2_yz.push_back(
hit->globalPositionError().czy());
3348 ph2_zz.push_back(
hit->globalPositionError().czz());
3349 ph2_zx.push_back(
hit->globalPositionError().czx());
3350 ph2_radL.push_back(
hit->surface()->mediumProperties().radLen());
3351 ph2_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3353 LogTrace(
"TrackingNtuple") <<
"phase2 OT cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3354 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3365 simHitRefKeyToIndex,
3373 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3379 <<
" event=" << simHitData.
event[0];
3388 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3395 std::vector<std::pair<int, int>>& monoStereoClusterList,
3396 const std::set<edm::ProductID>& hitProductIds,
3397 std::map<edm::ProductID, size_t>& seedCollToOffset) {
3399 for (
size_t iColl = 0; iColl <
seedTokens_.size(); ++iColl) {
3403 iEvent.getByToken(seedToken, seedTracksHandle);
3414 iEvent.getByToken(seedStopInfoToken, seedStopInfoHandle);
3415 const auto& seedStopInfos = *seedStopInfoHandle;
3416 if (
seedTracks.size() != seedStopInfos.size()) {
3421 <<
" seed stopping infos for collections " <<
labels.module <<
", " 3425 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3429 iEvent.getByToken(itoken.second, aH);
3430 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3443 label.ReplaceAll(
"seedTracks",
"");
3444 label.ReplaceAll(
"Seeds",
"");
3445 label.ReplaceAll(
"muonSeeded",
"muonSeededStep");
3447 label.ReplaceAll(
"FromPixelTracks",
"");
3448 label.ReplaceAll(
"PFLowPixel",
"");
3449 label.ReplaceAll(
"hltDoubletRecovery",
"pixelPairStep");
3454 auto inserted = seedCollToOffset.emplace(
id,
offset);
3455 if (!inserted.second)
3457 <<
"Trying to add seeds with ProductID " <<
id <<
" for a second time from collection " <<
labels.module
3458 <<
", seed algo " <<
label <<
". Typically this is caused by a configuration problem.";
3462 <<
" ProductID " <<
id;
3464 for (
size_t iSeed = 0; iSeed < seedTrackRefs.
size(); ++iSeed) {
3465 const auto& seedTrackRef = seedTrackRefs[iSeed];
3466 const auto& seedTrack = *seedTrackRef;
3467 const auto& seedRef = seedTrack.seedRef();
3468 const auto&
seed = *seedRef;
3470 const auto seedStopInfo = seedStopInfos[iSeed];
3472 if (seedRef.id() !=
id)
3474 <<
"All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the " 3475 "element 0 had ProductID " 3476 <<
id <<
" while the element " << seedTrackRef.key() <<
" had " << seedTrackRef.id()
3477 <<
". The source collection is " <<
labels.module <<
".";
3479 std::vector<int> tpIdx;
3480 std::vector<float> sharedFraction;
3481 auto foundTPs = recSimColl.
find(seedTrackRef);
3482 if (foundTPs != recSimColl.
end()) {
3483 for (
const auto& tpQuality : foundTPs->val) {
3484 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3485 sharedFraction.push_back(tpQuality.second);
3490 const int nHits = seedTrack.numberOfValidHits();
3492 seedTrack.recHitsBegin(),
3493 seedTrack.recHitsEnd());
3495 const auto bestKeyCount = findBestMatchingTrackingParticle(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3496 const float bestShareFrac =
3497 nClusters > 0 ?
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3499 const auto bestFirstHitKeyCount =
3500 findMatchingTrackingParticleFromFirstHit(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3501 const float bestFirstHitShareFrac =
3502 nClusters > 0 ?
static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3505 const int charge = seedTrack.charge();
3506 const float pt = seedFitOk ? seedTrack.pt() : 0;
3507 const float eta = seedFitOk ? seedTrack.eta() : 0;
3508 const float phi = seedFitOk ? seedTrack.phi() : 0;
3510 const auto seedIndex =
see_fitok.size();
3514 see_px.push_back(seedFitOk ? seedTrack.px() : 0);
3515 see_py.push_back(seedFitOk ? seedTrack.py() : 0);
3516 see_pz.push_back(seedFitOk ? seedTrack.pz() : 0);
3523 see_dxy.push_back(seedFitOk ? seedTrack.dxy(
bs.position()) : 0);
3524 see_dz.push_back(seedFitOk ? seedTrack.dz(
bs.position()) : 0);
3525 see_ptErr.push_back(seedFitOk ? seedTrack.ptError() : 0);
3526 see_etaErr.push_back(seedFitOk ? seedTrack.etaError() : 0);
3527 see_phiErr.push_back(seedFitOk ? seedTrack.phiError() : 0);
3528 see_dxyErr.push_back(seedFitOk ? seedTrack.dxyError() : 0);
3529 see_dzErr.push_back(seedFitOk ? seedTrack.dzError() : 0);
3532 see_nCands.push_back(seedStopInfo.candidatesPerSeed());
3534 const auto&
state = seedTrack.seedRef()->startingState();
3535 const auto&
pos =
state.parameters().position();
3536 const auto& mom =
state.parameters().momentum();
3557 std::vector<float> cov(15);
3558 auto covP = cov.begin();
3559 for (
auto const val : stateCcov)
3569 see_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3571 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
3590 std::vector<int> hitIdx;
3591 std::vector<int> hitType;
3593 for (
auto const&
hit :
seed.recHits()) {
3594 int subid =
hit.geographicalId().subdetId();
3600 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3603 hitIdx.push_back(clusterKey);
3616 std::vector<std::pair<int, int>>::iterator
pos =
3617 find(monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx, stereoIdx));
3618 size_t gluedIndex = -1;
3619 if (
pos != monoStereoClusterList.end()) {
3631 hitIdx.push_back(gluedIndex);
3636 unsigned int clusterKey;
3637 if (clusterRef.isPhase2()) {
3640 clusterKey = clusterRef.cluster_strip().key();
3644 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3645 if (clusterRef.isPhase2()) {
3652 hitIdx.push_back(clusterKey);
3653 if (clusterRef.isPhase2()) {
3660 LogTrace(
"TrackingNtuple") <<
" not pixel and not Strip detector";
3673 auto const recHit0 =
seed.recHits().begin();
3674 auto const recHit1 =
seed.recHits().begin() + 1;
3675 std::vector<GlobalPoint>
gp(2);
3676 std::vector<GlobalError> ge(2);
3677 gp[0] = recHit0->globalPosition();
3678 ge[0] = recHit0->globalPositionError();
3679 gp[1] = recHit1->globalPosition();
3680 ge[1] = recHit1->globalPositionError();
3682 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3683 <<
" - PAIR - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3684 <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" trans0: " 3685 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3688 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3691 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3694 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3696 <<
" eta,phi: " <<
gp[0].
eta() <<
"," <<
gp[0].phi();
3697 }
else if (
nHits == 3) {
3698 auto const recHit0 =
seed.recHits().begin();
3699 auto const recHit1 =
seed.recHits().begin() + 1;
3700 auto const recHit2 =
seed.recHits().begin() + 2;
3704 gp[0] = recHit0->globalPosition();
3705 ge[0] = recHit0->globalPositionError();
3706 int subid0 = recHit0->geographicalId().subdetId();
3709 gp[1] = recHit1->globalPosition();
3710 ge[1] = recHit1->globalPositionError();
3711 int subid1 = recHit1->geographicalId().subdetId();
3714 gp[2] = recHit2->globalPosition();
3715 ge[2] = recHit2->globalPositionError();
3716 int subid2 = recHit2->geographicalId().subdetId();
3720 float seed_chi2 = rzLine.
chi2();
3724 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3725 <<
" - TRIPLET - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3726 <<
" " << recHit2->geographicalId().rawId() <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" " <<
gp[2]
3728 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3731 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3734 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3737 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3740 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[0]->globalPosition()
3743 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[1]->globalPosition()
3746 << recHit2->localPosition()
3748 <<
" eta,phi: " <<
gp[0].eta() <<
"," <<
gp[0].phi() <<
" pt,chi2: " << seed_pt <<
"," << seed_chi2;
3761 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3762 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
3769 const std::set<edm::ProductID>& hitProductIds,
3770 const std::map<edm::ProductID, size_t>& seedCollToOffset,
3771 const std::vector<const MVACollection*>& mvaColls,
3772 const std::vector<const QualityMaskCollection*>& qualColls) {
3776 LogTrace(
"TrackingNtuple") <<
"NEW TRACK LABEL: " <<
labels.module;
3778 auto pvPosition =
vertices[0].position();
3780 for (
size_t iTrack = 0; iTrack <
tracks.size(); ++iTrack) {
3781 const auto& itTrack =
tracks[iTrack];
3782 int charge = itTrack->charge();
3783 float pt = itTrack->pt();
3784 float eta = itTrack->eta();
3785 const double lambda = itTrack->lambda();
3786 float chi2 = itTrack->normalizedChi2();
3787 float ndof = itTrack->ndof();
3788 float phi = itTrack->phi();
3789 int nHits = itTrack->numberOfValidHits();
3792 const auto& tkParam = itTrack->parameters();
3793 auto tkCov = itTrack->covariance();
3798 bool isSimMatched =
false;
3799 std::vector<int> tpIdx;
3800 std::vector<float> sharedFraction;
3801 std::vector<float> tpChi2;
3802 auto foundTPs = recSimColl.
find(itTrack);
3803 if (foundTPs != recSimColl.
end()) {
3804 if (!foundTPs->val.empty()) {
3805 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
3806 isSimMatched =
true;
3808 for (
const auto& tpQuality : foundTPs->val) {
3809 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3810 sharedFraction.push_back(tpQuality.second);
3817 itTrack->recHitsBegin(),
3818 itTrack->recHitsEnd());
3821 const auto bestKeyCount = findBestMatchingTrackingParticle(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3822 const float bestShareFrac =
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters);
3823 float bestShareFracSimDenom = 0;
3824 float bestShareFracSimClusterDenom = 0;
3825 float bestChi2 = -1;
3826 if (bestKeyCount.key >= 0) {
3827 bestShareFracSimDenom =
3828 static_cast<float>(bestKeyCount.countClusters) /
3829 static_cast<float>(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits());
3830 bestShareFracSimClusterDenom =
3831 static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(tpKeyToClusterCount.at(bestKeyCount.key));
3833 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
3836 const auto bestFirstHitKeyCount =
3837 findMatchingTrackingParticleFromFirstHit(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3838 const float bestFirstHitShareFrac =
3839 static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters);
3840 float bestFirstHitShareFracSimDenom = 0;
3841 float bestFirstHitShareFracSimClusterDenom = 0;
3842 float bestFirstHitChi2 = -1;
3843 if (bestFirstHitKeyCount.key >= 0) {
3844 bestFirstHitShareFracSimDenom =
3845 static_cast<float>(bestFirstHitKeyCount.countClusters) /
3846 static_cast<float>(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits());
3847 bestFirstHitShareFracSimClusterDenom =
static_cast<float>(bestFirstHitKeyCount.countClusters) /
3848 static_cast<float>(tpKeyToClusterCount.at(bestFirstHitKeyCount.key));
3850 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
3853 float chi2_1Dmod =
chi2;
3854 int count1dhits = 0;
3855 for (
auto iHit = itTrack->recHitsBegin(), iEnd = itTrack->recHitsEnd(); iHit != iEnd; ++iHit) {
3860 if (count1dhits > 0) {
3861 chi2_1Dmod = (
chi2 + count1dhits) / (
ndof + count1dhits);
3866 trk_px.push_back(itTrack->px());
3867 trk_py.push_back(itTrack->py());
3868 trk_pz.push_back(itTrack->pz());
3873 trk_inner_pt.push_back(itTrack->innerMomentum().rho());
3877 trk_outer_pt.push_back(itTrack->outerMomentum().rho());
3882 trk_dxy.push_back(itTrack->dxy(
bs.position()));
3883 trk_dz.push_back(itTrack->dz(
bs.position()));
3884 trk_dxyPV.push_back(itTrack->dxy(pvPosition));
3885 trk_dzPV.push_back(itTrack->dz(pvPosition));
3888 trk_ptErr.push_back(itTrack->ptError());
3893 trk_dzErr.push_back(itTrack->dzError());
3912 trk_n3DLay.push_back(
hp.numberOfValidStripLayersWithMonoAndStereo() +
hp.pixelLayersWithMeasurement());
3915 trk_algo.push_back(itTrack->algo());
3922 trk_mvas[
i].push_back((*(mvaColls[
i]))[iTrack]);
3927 auto offset = seedCollToOffset.find(itTrack->seedRef().id());
3928 if (
offset == seedCollToOffset.end()) {
3932 << itTrack->seedRef().id()
3933 <<
", but that seed collection is not given as an input. The following collections were given as an input " 3934 << make_ProductIDMapPrinter(seedCollToOffset);
3937 const auto seedIndex =
offset->second + itTrack->seedRef().key();
3940 throw cms::Exception(
"LogicError") <<
"Track index has already been set for seed " << seedIndex <<
" to " 3941 <<
see_trkIdx[seedIndex] <<
"; was trying to set it to " << iTrack;
3950 trk_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3965 LogTrace(
"TrackingNtuple") <<
"Track #" << itTrack.key() <<
" with q=" <<
charge <<
", pT=" <<
pt 3966 <<
" GeV, eta: " <<
eta <<
", phi: " <<
phi <<
", chi2=" <<
chi2 <<
", Nhits=" <<
nHits 3967 <<
", algo=" << itTrack->algoName(itTrack->algo()).c_str()
3969 <<
" seed#=" << itTrack->seedRef().key() <<
" simMatch=" << isSimMatched
3970 <<
" nSimHits=" << nSimHits
3971 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
3972 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
3973 std::vector<int> hitIdx;
3974 std::vector<int> hitType;
3976 for (
auto i = itTrack->recHitsBegin();
i != itTrack->recHitsEnd();
i++) {
3978 DetId hitId =
hit->geographicalId();
3986 if (
hit->isValid()) {
3990 unsigned int clusterKey;
3991 if (clusterRef.isPixel()) {
3993 }
else if (clusterRef.isPhase2()) {
3994 clusterKey = clusterRef.cluster_phase2OT().key();
3996 clusterKey = clusterRef.cluster_strip().key();
3999 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4000 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4001 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4003 checkProductID(hitProductIds, clusterRef.id(),
"track");
4004 if (clusterRef.isPixel()) {
4015 }
else if (clusterRef.isPhase2()) {
4040 hitIdx.push_back(clusterKey);
4041 if (clusterRef.isPixel()) {
4043 }
else if (clusterRef.isPhase2()) {
4049 LogTrace(
"TrackingNtuple") <<
" - invalid hit";
4071 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4072 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
4080 const std::set<edm::ProductID>& hitProductIds,
4081 const std::map<edm::ProductID, size_t>& seedCollToOffset) {
4086 auto const&
cands = *candsHandle;
4087 for (
size_t iCand = 0; iCand <
cands.size(); ++iCand) {
4088 const auto& aCand =
cands[iCand];
4092 auto const& pState = aCand.trajectoryStateOnDet();
4096 if (!tbStateAtPCA.
isValid()) {
4097 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
4101 auto v0 = stateAtPCA.position();
4102 auto p = stateAtPCA.momentum();
4109 0, 0,
pos, mom, stateAtPCA.charge(), tbStateAtPCA.
isValid() ? stateAtPCA.curvilinearError().matrix() : dummyCov);
4112 auto tkCov = trk.covariance();
4117 bool isSimMatched =
false;
4118 std::vector<int> tpIdx;
4119 std::vector<float> sharedFraction;
4120 std::vector<float> tpChi2;
4121 auto foundTPs = recSimColl.
find(aCandRef);
4122 if (foundTPs != recSimColl.
end()) {
4123 if (!foundTPs->val.empty()) {
4124 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
4125 isSimMatched =
true;
4127 for (
const auto& tpQuality : foundTPs->val) {
4128 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
4129 sharedFraction.push_back(tpQuality.second);
4138 const auto bestKeyCount = findBestMatchingTrackingParticle(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4139 const float bestCountF = bestKeyCount.countClusters;
4140 const float bestShareFrac = bestCountF /
nClusters;
4141 float bestShareFracSimDenom = 0;
4142 float bestShareFracSimClusterDenom = 0;
4143 float bestChi2 = -1;
4144 if (bestKeyCount.key >= 0) {
4145 bestShareFracSimDenom = bestCountF / tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits();
4146 bestShareFracSimClusterDenom = bestCountF / tpKeyToClusterCount.
at(bestKeyCount.key);
4148 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
4151 const auto bestFirstHitKeyCount =
4152 findMatchingTrackingParticleFromFirstHit(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4153 const float bestFirstCountF = bestFirstHitKeyCount.countClusters;
4154 const float bestFirstHitShareFrac = bestFirstCountF /
nClusters;
4155 float bestFirstHitShareFracSimDenom = 0;
4156 float bestFirstHitShareFracSimClusterDenom = 0;
4157 float bestFirstHitChi2 = -1;
4158 if (bestFirstHitKeyCount.key >= 0) {
4159 bestFirstHitShareFracSimDenom =
4160 bestFirstCountF / tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits();
4161 bestFirstHitShareFracSimClusterDenom = bestFirstCountF / tpKeyToClusterCount.
at(bestFirstHitKeyCount.key);
4163 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
4190 auto const& pStateCov =
state.curvilinearError().matrix();
4201 for (
auto const&
hit : aCand.recHits()) {
4202 if (
hit.isValid()) {
4206 auto const subdet =
hit.geographicalId().subdetId();
4214 tcand_q.push_back(trk.charge());
4222 auto offset = seedCollToOffset.find(aCand.seedRef().id());
4223 if (
offset == seedCollToOffset.end()) {
4225 <<
"Track candidate refers to seed collection " << aCand.seedRef().id()
4226 <<
", but that seed collection is not given as an input. The following collections were given as an input " 4227 << make_ProductIDMapPrinter(seedCollToOffset);
4230 const auto seedIndex =
offset->second + aCand.seedRef().key();
4234 <<
"Track cand index has already been set for seed " << seedIndex <<
" to " <<
see_tcandIdx[seedIndex]
4235 <<
"; was trying to set it to " << iglobCand <<
" current " << iCand;
4244 tcand_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
4246 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
4259 LogTrace(
"TrackingNtuple") <<
"Track cand #" << iCand <<
" glob " << iglobCand <<
" with q=" << trk.charge()
4260 <<
", pT=" << trk.pt() <<
" GeV, eta: " << trk.eta() <<
", phi: " << trk.phi()
4261 <<
", nValid=" << nValid <<
" seed#=" << aCand.seedRef().key()
4262 <<
" simMatch=" << isSimMatched <<
" nSimHits=" << nSimHits
4263 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
4264 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
4265 std::vector<int> hitIdx;
4266 std::vector<int> hitType;
4268 for (
auto i = aCand.recHits().begin();
i != aCand.recHits().end();
i++) {
4270 DetId hitId =
hit->geographicalId();
4278 if (
hit->isValid()) {
4282 unsigned int clusterKey;
4283 if (clusterRef.isPixel()) {
4285 }
else if (clusterRef.isPhase2()) {
4286 clusterKey = clusterRef.cluster_phase2OT().key();
4288 clusterKey = clusterRef.cluster_strip().key();
4291 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4292 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4293 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4295 checkProductID(hitProductIds, clusterRef.id(),
"track");
4296 if (clusterRef.isPixel()) {
4298 }
else if (clusterRef.isPhase2()) {
4305 hitIdx.push_back(clusterKey);
4306 if (clusterRef.isPixel()) {
4308 }
else if (clusterRef.isPhase2()) {
4326 const TrackingVertexRefKeyToIndex& tvKeyToIndex,
4328 const std::vector<TPHitIndex>& tpHitList,
4329 const TrackingParticleRefKeyToCount& tpKeyToClusterCount) {
4333 const auto& nLayers_tPCeff = *tpNLayersH;
4336 const auto& nPixelLayers_tPCeff = *tpNLayersH;
4339 const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
4344 LogTrace(
"TrackingNtuple") <<
"tracking particle pt=" <<
tp->pt() <<
" eta=" <<
tp->eta() <<
" phi=" <<
tp->phi();
4345 bool isRecoMatched =
false;
4346 std::vector<int> tkIdx;
4347 std::vector<float> sharedFraction;
4348 auto foundTracks = simRecColl.
find(
tp);
4349 if (foundTracks != simRecColl.
end()) {
4350 isRecoMatched =
true;
4358 for (
const auto& genRef :
tp->genParticles()) {
4359 if (genRef.isNonnull())
4363 bool isFromBHadron =
false;
4368 for (
const auto& particle : recoGenParticleTrail) {
4371 isFromBHadron =
true;
4377 LogTrace(
"TrackingNtuple") <<
"matched to tracks = " << make_VectorPrinter(tkIdx)
4378 <<
" isRecoMatched=" << isRecoMatched;
4389 sim_q.push_back(
tp->charge());
4393 std::vector<int> decayIdx;
4394 for (
const auto&
v :
tp->decayVertices())
4395 decayIdx.push_back(tvKeyToIndex.at(
v.key()));
4403 const double lambdaSim =
M_PI / 2 - momentum.theta();
4412 std::vector<int> hitIdx;
4413 int nPixel = 0, nStrip = 0;
4415 for (
auto ip = rangeHit.first; ip != rangeHit.second; ++ip) {
4419 LogTrace(
"TrackingNtuple") <<
"simhit=" << ip->simHitIdx <<
" type=" <<
static_cast<int>(
type);
4420 hitIdx.push_back(ip->simHitIdx);
4423 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4424 << detid.rawId() <<
" whose det() is not Tracker but " << detid.det();
4426 const auto subdet = detid.subdetId();
4439 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4440 << detid.rawId() <<
" whose subdet is not recognized, is " << subdet;
4447 const auto nSimLayers = nLayers_tPCeff[
tp];
4448 const auto nSimPixelLayers = nPixelLayers_tPCeff[
tp];
4449 const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[
tp];
4452 sim_n3DLay.push_back(nSimPixelLayers + nSimStripMonoAndStereoLayers);
4455 auto found = tpKeyToClusterCount.find(
tp.key());
4465 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4466 const unsigned int seedOffset) {
4470 for (
const auto& keyVal : simRecColl) {
4471 const auto& tpRef = keyVal.key;
4472 auto found = tpKeyToIndex.find(tpRef.key());
4473 if (
found == tpKeyToIndex.end())
4474 throw cms::Exception(
"Assert") << __FILE__ <<
":" << __LINE__ <<
" fillTrackingParticlesForSeeds: tpRef.key() " 4475 << tpRef.key() <<
" not found from tpKeyToIndex. tpKeyToIndex size " 4476 << tpKeyToIndex.size();
4477 const auto tpIndex =
found->second;
4478 for (
const auto& pair : keyVal.val) {
4479 const auto& seedRef = pair.first->seedRef();
4480 sim_seedIdx[tpIndex].push_back(seedOffset + seedRef.key());
4487 for (
size_t iVertex = 0,
size =
vertices.size(); iVertex <
size; ++iVertex) {
4500 std::vector<int> trkIdx;
4501 for (
auto iTrack =
vertex.tracks_begin(); iTrack !=
vertex.tracks_end(); ++iTrack) {
4503 if (iTrack->id() !=
tracks.id())
4506 trkIdx.push_back(iTrack->key());
4509 throw cms::Exception(
"LogicError") <<
"Vertex index has already been set for track " << iTrack->key() <<
" to " 4510 <<
trk_vtxIdx[iTrack->key()] <<
"; was trying to set it to " << iVertex;
4519 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
4520 int current_event = -1;
4521 for (
const auto& ref : trackingVertices) {
4523 if (
v.eventId().event() != current_event) {
4525 current_event =
v.eventId().event();
4530 if (!
v.g4Vertices().empty()) {
4531 processType =
v.g4Vertices()[0].processType();
4543 for (
const auto& tpRef : tps) {
4544 auto found = tpKeyToIndex.find(tpRef.key());
4545 if (
found != tpKeyToIndex.end()) {
4551 std::vector<int> sourceIdx;
4552 std::vector<int> daughterIdx;
4553 fill(
v.sourceTracks(), sourceIdx);
4554 fill(
v.daughterTracks(), daughterIdx);
4566 desc.addUntracked<std::vector<edm::InputTag>>(
4568 std::vector<edm::InputTag>{
edm::InputTag(
"seedTracksinitialStepSeeds"),
4578 desc.addUntracked<std::vector<edm::InputTag>>(
4580 std::vector<edm::InputTag>{
edm::InputTag(
"initialStepTrackCandidates"),
4591 desc.addUntracked<std::vector<std::string>>(
"trackMVAs", std::vector<std::string>{{
"generalTracks"}});
4596 std::vector<edm::ParameterSet> cMasks;
4601 cMasks.push_back(ps);
4612 desc.addVPSetUntracked(
"clusterMasks", cMaskDesc, cMasks);
4615 desc.addUntracked<
bool>(
"trackingParticlesRef",
false);
4631 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"trackerLayers"));
4633 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"pixelLayers"));
4635 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"stripStereoLayers"));
4637 ->setComment(
"currently not used: keep for possible future use");
4638 desc.addUntracked<
bool>(
"includeSeeds",
false);
4639 desc.addUntracked<
bool>(
"includeTrackCandidates",
false);
4640 desc.addUntracked<
bool>(
"addSeedCurvCov",
false);
4641 desc.addUntracked<
bool>(
"includeAllHits",
false);
4642 desc.addUntracked<
bool>(
"includeOnTrackHitData",
false);
4643 desc.addUntracked<
bool>(
"includeMVA",
true);
4644 desc.addUntracked<
bool>(
"includeTrackingParticles",
true);
4645 desc.addUntracked<
bool>(
"includeOOT",
false);
4646 desc.addUntracked<
bool>(
"keepEleSimHits",
false);
4647 desc.addUntracked<
bool>(
"saveSimHitsP3",
false);
4648 desc.addUntracked<
bool>(
"simHitBySignificance",
false);
4649 descriptions.
add(
"trackingNtuple",
desc);
std::vector< unsigned int > sim_nTrackerHits
std::vector< int > trk_bestSimTrkIdx
std::vector< std::vector< float > > ph2_onTrk_yz
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
unsigned int tecPetalNumber(const DetId &id) const
std::vector< float > sim_pca_dz
edm::LuminosityBlockNumber_t ev_lumi
std::vector< float > trk_nChi2_1Dmod
static const std::string kSharedResource
std::vector< unsigned int > simvtx_processType
edm::EDGetTokenT< TrackingParticleRefVector > trackingParticleRefToken_
std::vector< unsigned int > sim_nLay
Log< level::Info, true > LogVerbatim
std::vector< float > ph2_radL
bool isUpper(const DetId &id) const
std::vector< float > tcand_pca_phiErr
std::vector< float > trk_dxyPV
static constexpr auto TEC
void fillTrackingVertices(const TrackingVertexRefVector &trackingVertices, const TrackingParticleRefKeyToIndex &tpKeyToIndex)
std::vector< float > see_bestSimTrkShareFrac
bool tibIsDoubleSide(const DetId &id) const
std::vector< std::vector< float > > see_simTrkShareFrac
edm::EDGetTokenT< SiStripMatchedRecHit2DCollection > stripMatchedRecHitToken_
std::vector< short > see_fitok
std::vector< short > vtx_fake
std::vector< float > simvtx_z
std::vector< std::vector< float > > trk_simTrkNChi2
bool tecIsDoubleSide(const DetId &id) const
std::vector< std::vector< int > > see_hitType
size_type dataSize() const
std::vector< float > trk_dzClosestPV
bool tidIsDoubleSide(const DetId &id) const
edm::EDGetTokenT< SiStripRecHit2DCollection > stripRphiRecHitToken_
std::vector< short > ph2_isBarrel
TrackAssociatorByHitsImpl::SimHitTPAssociationList SimHitTPAssociationList
std::vector< std::vector< float > > pix_onTrk_x
std::vector< float > trk_phi
void push_back(const TrackerGeometry &tracker, const TrackerTopology &tTopo, const DetId &id)
std::vector< float > sim_pca_cotTheta
unsigned int tibSide(const DetId &id) const
const bool simHitBySignificance_
std::vector< float > sim_pca_dxy
uint16_t firstStrip() const
void book(const std::string &prefix, TTree *tree)
std::vector< float > see_stateTrajX
std::vector< unsigned int > trk_nOuterLost
std::vector< float > glu_xy
std::vector< short > trk_isTrue
std::vector< std::vector< int > > ph2_seeIdx
std::vector< float > glu_radL
std::vector< float > trk_inner_pz
std::vector< float > see_stateTrajPy
std::vector< float > pix_y
std::vector< int > trk_vtxIdx
std::vector< std::vector< int > > str_trkIdx
std::vector< unsigned int > see_nValid
std::vector< float > str_yy
unsigned int tobSide(const DetId &id) const
iterator find(det_id_type id)
ProductID id() const
Accessor for product ID.
bool trackFromSeedFitFailed(const reco::Track &track)
std::vector< float > trk_outer_py
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
std::vector< float > glu_chargePerCM
std::vector< float > pix_zz
std::vector< unsigned short > layer
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< float > ph2_bbxi
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
std::vector< float > tcand_ytErr
void fillPixelHits(const edm::Event &iEvent, const TrackerGeometry &tracker, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
std::vector< uint64_t > str_usedMask
std::vector< int > glu_monoIdx
std::vector< float > trk_eta
std::vector< short > glu_isBarrel
std::vector< unsigned short > order
std::vector< std::vector< float > > ph2_onTrk_y
std::vector< std::vector< float > > str_onTrk_yz
std::vector< int > sim_bunchCrossing
std::vector< float > see_phiErr
std::vector< int > trk_bestFromFirstHitSimTrkIdx
std::vector< std::vector< int > > simhit_hitIdx
unsigned int pxfBlade(const DetId &id) const
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
std::vector< float > tcand_pca_pz
std::vector< float > str_x
std::vector< float > see_dzErr
std::vector< unsigned int > sim_n3DLay
unsigned int tibOrder(const DetId &id) const
std::vector< float > trk_cotTheta
std::vector< unsigned int > moduleType
std::vector< float > trk_bestSimTrkNChi2
CombineDetId< DetIdCommon, DetIdOTCommon, DetIdStripOnly > DetIdStrip
void push_back(const TrackerGeometry &tracker, const TrackerTopology &tTopo, const DetId &id)
std::vector< unsigned int > see_nStrip
std::vector< float > trk_px
constexpr bool isNotFinite(T x)
range equal_range(const OmniClusterRef &key) const
std::vector< unsigned short > pix_simType
void push_back(const TrackerGeometry &tracker, const TrackerTopology &tTopo, const DetId &id)
std::vector< unsigned short > inv_type
std::vector< float > see_stateTrajPz
SiPixelCluster const & pixelCluster() const
std::vector< float > pix_zx
std::vector< std::vector< float > > ph2_onTrk_zx
SimHitData matchCluster(const OmniClusterRef &cluster, DetId hitId, int clusterKey, const TrackingRecHit &hit, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< SimLink > &digiSimLinks, const SimHitRefKeyToIndex &simHitRefKeyToIndex, HitType hitType)
ret
prodAgent to be discontinued
TPHitIndex(unsigned int tp=0, unsigned int simHit=0, float to=0, unsigned int id=0)
std::vector< float > sim_phi
std::vector< unsigned int > tcand_algo
std::vector< std::vector< int > > trk_simTrkIdx
std::vector< float > trk_dzPV
ROOT::Math::SMatrixIdentity AlgebraicMatrixID
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > trackAssociatorToken_
edm::EDGetTokenT< SiStripRecHit2DCollection > stripStereoRecHitToken_
std::vector< float > trk_dxyErr
std::vector< float > str_yz
std::vector< float > trk_pt
std::vector< float > glu_x
std::vector< float > tcand_bestFromFirstHitSimTrkShareFracSimDenom
std::vector< float > trk_inner_py
std::vector< float > see_px
std::vector< float > see_chi2
void fillStripRphiStereoHits(const edm::Event &iEvent, const TrackerGeometry &tracker, const ClusterTPAssociation &clusterToTPMap, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< StripDigiSimLink > &digiSimLink, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
T const * product() const
std::vector< float > simhit_px
std::vector< float > glu_z
std::vector< float > see_stateTrajY
edm::EDGetTokenT< edm::View< reco::Track > > trackToken_
const GlobalTrajectoryParameters & globalParameters() const
constexpr bool isUninitialized() const noexcept
const bool includeOnTrackHitData_
CombineDetId< DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdPhase2OTOnly > DetIdAllPhase2
CombineDetId< DetIdCommon, DetIdPixelOnly > DetIdPixel
Global3DPoint GlobalPoint
void fillCandidates(const edm::Handle< TrackCandidateCollection > &candsHandle, int algo, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const TrackingParticleRefKeyToCount &tpKeyToClusterCount, const MagneticField &mf, const reco::BeamSpot &bs, const reco::VertexCollection &vertices, const reco::TrackToTrackingParticleAssociator &associatorByHits, const ClusterTPAssociation &clusterToTPMap, const TrackerGeometry &tracker, const TrackerTopology &tTopo, const std::set< edm::ProductID > &hitProductIds, const std::map< edm::ProductID, size_t > &seedToCollIndex)
void fillBeamSpot(const reco::BeamSpot &bs)
std::vector< unsigned short > see_stopReason
std::vector< float > tcand_pca_ptErr
std::vector< float > trk_outer_px
std::vector< std::vector< int > > trk_hitType
OmniClusterRef const & stereoClusterRef() const
void fillTracks(const edm::RefToBaseVector< reco::Track > &tracks, const TrackerGeometry &tracker, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const TrackingParticleRefKeyToCount &tpKeyToClusterCount, const MagneticField &mf, const reco::BeamSpot &bs, const reco::VertexCollection &vertices, const reco::TrackToTrackingParticleAssociator &associatorByHits, const ClusterTPAssociation &clusterToTPMap, const TrackerTopology &tTopo, const std::set< edm::ProductID > &hitProductIds, const std::map< edm::ProductID, size_t > &seedToCollIndex, const std::vector< const MVACollection *> &mvaColls, const std::vector< const QualityMaskCollection *> &qualColls)
std::vector< unsigned int > trk_nCluster
std::vector< float > ph2_xx
unsigned int tibString(const DetId &id) const
std::vector< std::vector< float > > pix_onTrk_z
unsigned long long EventNumber_t
std::vector< std::vector< int > > ph2_trkIdx
edm::EDGetTokenT< Phase2TrackerRecHit1DCollectionNew > phase2OTRecHitToken_
void push_back(const TrackerGeometry &tracker, const TrackerTopology &tTopo, const DetId &id)
std::vector< OmniClusterRef > hitsToClusterRefs(iter begin, iter end)
std::vector< unsigned int > see_algo
std::vector< unsigned int > tcand_nStrip
const bool addSeedCurvCov_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< float > tcand_bestSimTrkShareFrac
std::vector< float > trk_inner_pt
std::vector< short > simhit_process
std::vector< unsigned short > module
std::vector< float > trk_bestSimTrkShareFracSimClusterDenom
CombineDetId< DetIdCommon, DetIdOTCommon, DetIdPhase2OTOnly > DetIdPhase2OT
std::vector< std::vector< float > > str_onTrk_xx
std::vector< float > tcand_pca_dxy
std::vector< std::vector< int > > str_seeIdx
std::vector< std::vector< int > > see_simTrkIdx
std::vector< int > simvtx_event
std::vector< float > str_radL
void fillSeeds(const edm::Event &iEvent, const TrackingParticleRefVector &tpCollection, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const reco::BeamSpot &bs, const TrackerGeometry &tracker, const reco::TrackToTrackingParticleAssociator &associatorByHits, const ClusterTPAssociation &clusterToTPMap, const MagneticField &theMF, const TrackerTopology &tTopo, std::vector< std::pair< int, int >> &monoStereoClusterList, const std::set< edm::ProductID > &hitProductIds, std::map< edm::ProductID, size_t > &seedToCollIndex)
unsigned int SimTrackId() const
bool isStereo(const DetId &id) const
std::vector< int > simhit_simTrkIdx
bool isRPhi(const DetId &id) const
std::vector< unsigned short > trk_stopReason
value_type const at(size_type idx) const
Retrieve an element of the RefVector.
std::vector< uint64_t > glu_usedMaskStereo
unsigned int pxbLadder(const DetId &id) const
std::vector< unsigned short > ladder
static bool tpHitIndexListLess(const TPHitIndex &i, const TPHitIndex &j)
TrackingNtuple(const edm::ParameterSet &)
std::vector< float > tcand_pca_eta
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
std::ostream & operator<<(std::ostream &out, const ALILine &li)
std::vector< float > sim_py
unsigned int side(const DetId &id) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< Vertex > VertexCollection
std::vector< float > sim_px
constexpr Detector det() const
get the detector field from this detid
unsigned int LuminosityBlockNumber_t
std::vector< float > pix_xx
unsigned int tecRing(const DetId &id) const
ring id
std::vector< std::vector< int > > sim_decayVtxIdx
std::vector< float > trk_refpoint_x
std::vector< float > pix_radL
std::vector< float > xySignificance
std::vector< float > pix_bbxi
std::vector< std::vector< float > > sim_trkShareFrac
OmniClusterRef const & monoClusterRef() const
std::vector< std::vector< float > > trk_mvas
key_type key() const
Accessor for product key.
bool tobIsDoubleSide(const DetId &id) const
std::vector< float > ph2_zx
std::vector< float > tcand_pca_dzErr
std::vector< int > simpv_idx
std::vector< unsigned char > QualityMaskCollection
const_iterator find(const key_type &k) const
find element with specified reference key
static std::string to_string(const XMLCh *ch)
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > pixelSimLinkToken_
unsigned int layer(const DetId &id) const
TrackAlgorithm
track algorithm
edm::ProductID id() const
CombineDetId< DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdStripOnly > DetIdAll
std::vector< std::vector< float > > str_xySignificance
Parsed parse(const TrackerTopology &tTopo, const DetId &id) const
const_iterator end(bool update=false) const
std::vector< std::vector< int > > pix_seeIdx
std::vector< unsigned short > str_simType
std::vector< short > see_isTrue
const_iterator end() const
last iterator over the map (read only)
std::vector< short > inv_isBarrel
T getUntrackedParameter(std::string const &, T const &) const
std::vector< SimHitTPPair > SimHitTPAssociationList
std::vector< float > trk_bestSimTrkShareFracSimDenom
std::vector< unsigned short > ring
std::vector< float > trk_bestFromFirstHitSimTrkNChi2
math::XYZPointD Point
point in the space
std::vector< float > see_etaErr
std::vector< std::vector< float > > trk_simTrkShareFrac
ClusterPixelRef cluster_pixel() const
unsigned int module(const DetId &id) const
std::vector< float > simhit_z
std::vector< float > tcand_qbpErr
std::vector< float > ph2_z
std::vector< float > ph2_yy
std::vector< float > tcand_pz
std::vector< float > tcand_phiErr
std::vector< unsigned int > tcand_nPixel
std::vector< float > tcand_pca_etaErr
std::vector< float > trk_refpoint_y
std::vector< unsigned int > trk_nLostLay
std::vector< float > MVACollection
std::vector< int > sim_event
std::vector< unsigned int > trk_nStrip
std::vector< unsigned int > tcand_nCluster
std::vector< const reco::GenParticle * > RecoGenParticleTrail
reco::GenParticle trail type.
std::vector< int > see_bestSimTrkIdx
std::vector< float > chargeFraction
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNStripStereoLayersToken_
std::vector< float > see_stateTrajGlbPz
std::vector< unsigned int > trk_nPixel
std::vector< float > glu_y
VParameterSet getUntrackedParameterSetVector(std::string const &name, VParameterSet const &defaultValue) const
std::vector< std::vector< float > > pix_xySignificance
std::vector< unsigned short > panel
std::vector< float > trk_pz
std::vector< std::vector< float > > pix_onTrk_yz
std::vector< float > tcand_z
std::vector< float > trk_dzErr
std::vector< unsigned short > isStereo
std::vector< unsigned short > tcand_stopReason
std::vector< float > tcand_pca_pt
std::vector< float > trk_lambdaErr
std::vector< unsigned short > isUpper
std::vector< std::vector< float > > pix_onTrk_zz
void push_back(const TrackerGeometry &tracker, const TrackerTopology &tTopo, const DetId &id)
std::vector< std::vector< float > > see_stateCurvCov
std::vector< unsigned int > see_nCluster
edm::EDGetTokenT< SiPixelRecHitCollection > pixelRecHitToken_
std::vector< float > ph2_y
std::vector< std::tuple< edm::EDGetTokenT< MVACollection >, edm::EDGetTokenT< QualityMaskCollection > > > mvaQualityCollectionTokens_
unsigned int tidOrder(const DetId &id) const
std::vector< std::vector< int > > simvtx_sourceSimIdx
std::vector< int > tcand_vtxIdx
std::vector< float > trk_bestFromFirstHitSimTrkShareFracSimDenom
std::vector< float > trk_etaErr
void fillPhase2OTHits(const edm::Event &iEvent, const ClusterTPAssociation &clusterToTPMap, const TrackerGeometry &tracker, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const edm::DetSetVector< PixelDigiSimLink > &digiSimLink, const TrackerTopology &tTopo, const SimHitRefKeyToIndex &simHitRefKeyToIndex, std::set< edm::ProductID > &hitProductIds)
std::vector< short > pix_isBarrel
std::vector< std::vector< float > > str_onTrk_z
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > siphase2OTSimLinksToken_
std::vector< float > tcand_xtErr
std::vector< float > glu_yz
std::vector< float > sim_pca_phi
virtual const Surface * surface() const
std::vector< int > pix_clustSizeCol
auto dz(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
SiStripCluster const & amplitudes() const
std::vector< unsigned int > trk_algo
std::vector< unsigned int > sim_nRecoClusters
std::vector< int > see_tcandIdx
std::vector< float > tcand_y
void fillTrackingParticlesForSeeds(const TrackingParticleRefVector &tpCollection, const reco::SimToRecoCollection &simRecColl, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const unsigned int seedOffset)
std::vector< float > ph2_xy
std::vector< float > trk_bestFromFirstHitSimTrkShareFracSimClusterDenom
std::vector< float > vtx_y
std::vector< float > pix_z
std::vector< int > see_bestFromFirstHitSimTrkIdx
std::vector< int > bunchCrossing
std::vector< float > sim_eta
std::vector< unsigned short > blade
std::vector< unsigned int > trk_originalAlgo
std::vector< unsigned int > trk_nInnerLost
std::vector< float > str_y
std::vector< int > sim_pdgId
std::vector< std::vector< float > > pix_onTrk_zx
std::vector< std::vector< int > > simhit_hitType
std::vector< float > trk_refpoint_z
std::vector< unsigned int > trk_nInactive
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > seedTokens_
edm::EDGetTokenT< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitTPMapToken_
std::vector< unsigned int > trk_nOuterInactive
std::vector< float > pix_yz
std::vector< std::vector< int > > sim_genPdgIds
std::vector< int > trk_seedIdx
std::vector< std::vector< float > > pix_chargeFraction
std::vector< std::vector< int > > tcand_hitType
std::vector< float > vtx_yErr
std::vector< std::vector< int > > pix_trkIdx
Phase2TrackerCluster1D const & phase2OTCluster() const
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
std::vector< unsigned int > sim_nValid
std::vector< float > glu_yy
std::vector< float > vtx_ndof
std::vector< std::vector< int > > ph2_simHitIdx
std::vector< float > simvtx_x
std::vector< std::vector< float > > ph2_onTrk_x
unsigned int operator[](size_t i) const
std::vector< float > str_zz
std::vector< std::vector< int > > tcand_simTrkIdx
DetIdAllPhase2 inv_detId_phase2
std::vector< float > tcand_pca_lambdaErr
std::vector< std::vector< float > > str_onTrk_y
std::vector< std::vector< float > > pix_onTrk_xx
std::vector< float > sim_pca_pt
std::vector< float > see_dxyErr
std::vector< float > tcand_bestFromFirstHitSimTrkShareFrac
bool isMatched(TrackingRecHit const &hit)
std::vector< float > trk_bestFromFirstHitSimTrkShareFrac
std::vector< short > tcand_pca_valid
uint32_t stack(const DetId &id) const
#define DEFINE_FWK_MODULE(type)
std::vector< float > see_pt
std::vector< unsigned int > see_nPhase2OT
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexToken_
std::vector< float > see_dxy
std::vector< std::vector< int > > glu_seeIdx
std::vector< unsigned int > trk_n3DLay
std::vector< std::vector< int > > sim_trkIdx
FTS const & trackStateAtPCA() const
std::vector< float > trk_outer_pt
void fillStripMatchedHits(const edm::Event &iEvent, const TrackerGeometry &tracker, const TrackerTopology &tTopo, std::vector< std::pair< int, int >> &monoStereoClusterList)
static bool tpHitIndexListLessSort(const TPHitIndex &i, const TPHitIndex &j)
std::vector< int > matchingSimHit
unsigned int tecOrder(const DetId &id) const
std::vector< float > str_chargePerCM
const bool includeTrackingParticles_
std::vector< float > trk_dz
static constexpr auto TOB
size_t addStripMatchedHit(const SiStripMatchedRecHit2D &hit, const TrackerGeometry &tracker, const TrackerTopology &tTopo, const std::vector< std::pair< uint64_t, StripMaskContainer const *>> &stripMasks, std::vector< std::pair< int, int >> &monoStereoClusterList)
std::vector< float > trk_ptErr
std::vector< unsigned int > trk_nStripLay
void fillSimHits(const TrackerGeometry &tracker, const TrackingParticleRefKeyToIndex &tpKeyToIndex, const SimHitTPAssociationProducer::SimHitTPAssociationList &simHitsTPAssoc, const TrackerTopology &tTopo, SimHitRefKeyToIndex &simHitRefKeyToIndex, std::vector< TPHitIndex > &tpHitList)
std::vector< float > see_phi
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tGeomToken_
std::vector< float > vtx_z
Log< level::Warning, true > LogPrint
std::vector< float > see_pz
void fillTrackingParticles(const edm::Event &iEvent, const edm::EventSetup &iSetup, const edm::RefToBaseVector< reco::Track > &tracks, const reco::BeamSpot &bs, const TrackingParticleRefVector &tpCollection, const TrackingVertexRefKeyToIndex &tvKeyToIndex, const reco::TrackToTrackingParticleAssociator &associatorByHits, const std::vector< TPHitIndex > &tpHitList, const TrackingParticleRefKeyToCount &tpKeyToClusterCount)
void book(const std::string &prefix, TTree *tree)
std::vector< float > trk_phiErr
std::vector< unsigned int > sim_nPixelLay
std::vector< float > trk_lambda
std::vector< edm::EDGetTokenT< std::vector< SeedStopInfo > > > seedStopInfoTokens_
iterator end()
Return the off-the-end iterator.
std::vector< float > glu_zz
std::vector< float > tcand_bestSimTrkNChi2
std::vector< float > sim_pca_lambda
virtual TrackingParticle::Vector momentum(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< float > see_stateTrajPx
unsigned int SimTrackId() const
std::vector< float > glu_zx
std::vector< std::vector< float > > str_onTrk_zx
std::string algoName() const
std::vector< int > tcand_seedIdx
const bool saveSimHitsP3_
std::vector< std::vector< float > > str_onTrk_x
std::vector< float > vtx_xErr
std::vector< float > tcand_bestSimTrkShareFracSimDenom
std::vector< std::vector< float > > tcand_simTrkShareFrac
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< float > tcand_pt
std::vector< float > sim_pz
std::vector< float > see_stateTrajGlbY
std::vector< std::vector< int > > sim_simHitIdx
unsigned int pxfPanel(const DetId &id) const
edm::Ref< TrackingVertexCollection > TrackingVertexRef
std::vector< unsigned short > isGlued
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
edm::EventNumber_t ev_event
std::vector< float > tcand_bestFromFirstHitSimTrkShareFracSimClusterDenom
std::vector< unsigned short > isRPhi
std::vector< float > ph2_x
edm::EDGetTokenT< reco::VertexCollection > vertexToken_
edm::EDGetTokenT< TrackingParticleCollection > trackingParticleToken_
std::vector< uint64_t > pix_usedMask
bool isLower(const DetId &id) const
std::vector< uint64_t > glu_usedMaskMono
std::vector< int > glu_stereoIdx
Phase2Cluster1DRef cluster_phase2OT() const
std::vector< float > trk_py
static constexpr auto TIB
const_iterator begin(bool update=false) const
std::vector< std::vector< int > > pix_simHitIdx
size_type size() const
Size of the RefVector.
std::vector< float > trk_nChi2
const CurvilinearTrajectoryError & curvilinearError() const
std::vector< std::vector< unsigned short > > trk_qualityMasks
void book(const std::string &prefix, TTree *tree)
unsigned long long uint64_t
std::vector< unsigned int > see_nGlued
std::vector< float > see_py
std::vector< float > pix_x
std::vector< unsigned int > detId
std::vector< int > sim_parentVtxIdx
std::vector< float > see_ptErr
std::vector< float > str_z
std::vector< unsigned short > isStack
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void addUntrackedParameter(std::string const &name, T const &value)
std::vector< short > tcand_isTrue
std::vector< float > str_zx
const bool includeTrackCandidates_
std::vector< std::vector< int > > tcand_hitIdx
constexpr uint32_t rawId() const
get the raw id
XYZPointD XYZPoint
point in space with cartesian internal representation
virtual OmniClusterRef const & firstClusterRef() const =0
std::vector< float > tcand_pca_dz
const AlgebraicSymMatrix55 & matrix() const
std::vector< TrackingVertex > TrackingVertexCollection
std::vector< int > glu_clustSizeStereo
std::vector< float > tcand_bestSimTrkShareFracSimClusterDenom
std::vector< short > trk_isHP
std::vector< float > str_xy
virtual TrackingParticle::Point vertex(const edm::Event &iEvent, const edm::EventSetup &iSetup, const Charge ch, const Point &vtx, const LorentzVector &lv) const
std::vector< std::vector< float > > str_chargeFraction
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~TrackingNtuple() override
std::vector< unsigned int > trk_nInnerInactive
std::vector< float > tcand_pca_py
std::vector< float > tcand_pca_dxyErr
std::vector< unsigned short > isLower
std::vector< std::pair< unsigned int, edm::EDGetTokenT< StripMaskContainer > > > stripUseMaskTokens_
unsigned int tobRod(const DetId &id) const
Base class to all the history types.
std::vector< std::vector< float > > ph2_xySignificance
std::vector< std::vector< int > > trk_hitIdx
bool includePhase2OTHits_
deadvectors [0] push_back({0.0175431, 0.538005, 6.80997, 13.29})
std::vector< std::vector< int > > str_tcandIdx
std::vector< unsigned int > sim_nPixel
std::vector< std::vector< float > > pix_onTrk_xy
const bool includeAllHits_
std::vector< short > vtx_valid
std::vector< float > see_stateTrajGlbX
bool evaluate(TrackingParticleRef tpr)
Evaluate track history using a TrackingParticleRef.
edm::EDGetTokenT< ClusterTPAssociation > clusterTPMapToken_
std::vector< std::vector< float > > ph2_onTrk_xy
Pixel cluster – collection of neighboring pixels above threshold.
std::vector< unsigned int > tcand_nValid
std::vector< int > tcand_q
std::vector< std::vector< int > > vtx_trkIdx
std::vector< short > str_isBarrel
auto dxy(const T_Vertex &vertex, const T_Momentum &momentum, const T_Point &point)
void analyze(const edm::Event &, const edm::EventSetup &) override
void depth(int d)
Set the depth of the history.
Structure Point Contains parameters of Gaussian fits to DMRs.
std::vector< int > str_clustSize
std::vector< float > glu_bbxi
std::vector< int > simhit_particle
std::vector< float > tcand_ndof
SiStripCluster const & stripCluster() const
std::vector< float > trk_outer_pz
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNLayersToken_
std::vector< unsigned short > ph2_simType
std::vector< std::pair< unsigned int, edm::EDGetTokenT< PixelMaskContainer > > > pixelUseMaskTokens_
std::vector< std::vector< float > > ph2_onTrk_z
std::vector< float > sim_pca_eta
void push_back(const RefToBase< T > &)
std::vector< float > ph2_yz
std::vector< unsigned short > string
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)
std::vector< int > glu_clustSizeMono
static int pixelToChannel(int row, int col)
ParametersDefinerForTP parametersDefiner_
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
std::vector< unsigned short > rod
static TrackAlgorithm algoByName(const std::string &name)
std::vector< float > simhit_y
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
std::vector< float > trk_dxyClosestPV
std::vector< float > see_stateTrajGlbPx
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
std::vector< std::vector< int > > str_simHitIdx
unsigned int tidRing(const DetId &id) const
std::vector< float > see_statePt
std::vector< float > tcand_lambdaErr
std::vector< float > trk_ndof
std::vector< float > glu_xx
Monte Carlo truth information used for tracking validation.
const bool keepEleSimHits_
edm::EDGetTokenT< edm::ValueMap< unsigned int > > tpNPixelLayersToken_
std::vector< std::vector< float > > pix_onTrk_yy
std::vector< std::vector< int > > ph2_tcandIdx
ParameterVector parameters() const
Track parameters with one-to-one correspondence to the covariance matrix.
std::vector< unsigned int > trk_nPixelLay
std::vector< float > see_stateTrajGlbZ
std::vector< std::vector< float > > str_onTrk_xy
std::vector< float > simhit_x
std::vector< float > tcand_pca_px
std::vector< int > tcand_bestFromFirstHitSimTrkIdx
std::vector< float > simvtx_y
std::vector< unsigned short > see_nCands
std::vector< std::vector< int > > simvtx_daughterSimIdx
std::vector< float > str_xx
#define declareDynArray(T, n, x)
std::vector< float > trk_bestSimTrkShareFrac
std::vector< float > simhit_py
std::vector< unsigned int > see_offset
RecoGenParticleTrail const & recoGenParticleTrail() const
Return all reco::GenParticle in the history.
std::vector< std::vector< float > > pix_onTrk_y
std::vector< float > ph2_zz
void book(const std::string &prefix, TTree *tree)
std::vector< float > tcand_bestFromFirstHitSimTrkNChi2
Parsed parse(const TrackerTopology &tTopo, const DetId &id) const
std::vector< int > see_trkIdx
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
math::XYZVectorD Vector
point in the space
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
std::vector< int > tcand_bestSimTrkIdx
std::vector< float > tcand_x
std::vector< unsigned short > side
std::vector< std::vector< float > > ph2_onTrk_zz
std::vector< std::vector< int > > pix_tcandIdx
std::vector< float > simhit_tof
std::vector< std::vector< int > > sim_seedIdx
void fillVertices(const reco::VertexCollection &vertices, const edm::RefToBaseVector< reco::Track > &tracks)
T operator[](int i) const
std::vector< float > see_stateTrajGlbPy
std::vector< float > pix_xy
std::vector< unsigned short > subdet
std::vector< float > trk_dxy
void book(const std::string &prefix, TTree *tree)
std::vector< float > sim_pt
std::vector< float > pix_yy
double trackAssociationChi2(const reco::TrackBase::ParameterVector &rParameters, const reco::TrackBase::CovarianceMatrix &recoTrackCovMatrix, const reco::TrackBase::ParameterVector &sParameters)
basic method where chi2 is computed
std::vector< float > tcand_pca_phi
static constexpr auto TID
std::vector< decltype(reco::TrackBase().algoMaskUL())> trk_algoMask
std::vector< std::vector< int > > see_hitIdx
std::vector< std::vector< float > > str_onTrk_zz
std::vector< float > tcand_px
std::vector< float > vtx_x
std::vector< std::vector< float > > str_onTrk_yy
std::vector< float > simhit_pz
std::vector< std::vector< float > > tcand_simTrkNChi2
std::vector< unsigned int > see_nPixel
edm::Ref< TrackingParticleCollection > TrackingParticleRef
std::vector< unsigned short > petalNumber
std::vector< float > see_eta
DetIdAllPhase2 simhit_detId_phase2
std::vector< unsigned int > trk_nValid
std::vector< unsigned int > trk_nLost
std::vector< float > trk_inner_px
std::vector< float > vtx_zErr
std::vector< float > simhit_eloss
std::vector< float > see_bestFromFirstHitSimTrkShareFrac
std::vector< std::vector< float > > ph2_onTrk_yy
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
std::vector< int > sim_isFromBHadron
std::vector< std::vector< float > > ph2_onTrk_xx
edm::EDGetTokenT< edm::DetSetVector< StripDigiSimLink > > stripSimLinkToken_
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
uint16_t *__restrict__ uint16_t const *__restrict__ adc
std::vector< float > tcand_py
std::vector< int > pix_clustSizeRow
std::vector< edm::EDGetTokenT< TrackCandidateCollection > > candidateTokens_
std::vector< float > vtx_chi2
std::vector< int > simvtx_bunchCrossing
std::vector< float > str_bbxi
std::vector< float > see_dz
std::vector< unsigned int > sim_nStrip