90 #include "HepPDT/ParticleID.hh" 98 #include <unordered_set> 99 #include <unordered_map> 114 using TrackingParticleRefKeyToIndex = std::unordered_map<reco::RecoToSimCollection::index_type, size_t>;
115 using TrackingVertexRefKeyToIndex = TrackingParticleRefKeyToIndex;
116 using SimHitFullKey = std::pair<TrackPSimHitRef::key_type, edm::ProductID>;
117 using SimHitRefKeyToIndex = std::map<SimHitFullKey, size_t>;
118 using TrackingParticleRefKeyToCount = TrackingParticleRefKeyToIndex;
135 return "UNKNOWN TRACKER HIT TYPE";
139 struct ProductIDSetPrinter {
140 ProductIDSetPrinter(
const std::set<edm::ProductID>&
set) : set_(set) {}
142 void print(std::ostream&
os)
const {
143 for (
const auto&
item : set_) {
148 const std::set<edm::ProductID>& set_;
150 std::ostream&
operator<<(std::ostream&
os,
const ProductIDSetPrinter&
o) {
154 template <
typename T>
155 struct ProductIDMapPrinter {
156 ProductIDMapPrinter(
const std::map<edm::ProductID, T>&
map) : map_(
map) {}
158 void print(std::ostream&
os)
const {
159 for (
const auto&
item : map_) {
164 const std::map<edm::ProductID, T>& map_;
166 template <
typename T>
167 auto make_ProductIDMapPrinter(
const std::map<edm::ProductID, T>&
map) {
168 return ProductIDMapPrinter<T>(
map);
170 template <
typename T>
171 std::ostream& operator<<(std::ostream& os, const ProductIDMapPrinter<T>&
o) {
176 template <
typename T>
177 struct VectorPrinter {
178 VectorPrinter(
const std::vector<T>& vec) : vec_(vec) {}
180 void print(std::ostream&
os)
const {
181 for (
const auto&
item : vec_) {
186 const std::vector<T>& vec_;
188 template <
typename T>
189 auto make_VectorPrinter(
const std::vector<T>& vec) {
190 return VectorPrinter<T>(vec);
192 template <
typename T>
193 std::ostream& operator<<(std::ostream& os, const VectorPrinter<T>&
o) {
198 void checkProductID(
const std::set<edm::ProductID>&
set,
const edm::ProductID&
id,
const char*
name) {
201 <<
"Got " <<
name <<
" with a hit with ProductID " <<
id 202 <<
" which does not match to the set of ProductID's for the hits: " << ProductIDSetPrinter(
set)
203 <<
". Usually this is caused by a wrong hit collection in the configuration.";
206 template <
typename SimLink,
typename Func>
209 if (link.channel() == channel) {
216 template <
typename... Args>
217 void call_nop(Args&&...
args) {}
219 template <
typename...
Types>
226 unsigned int operator[](
size_t i)
const {
return std::get<0>(content_)[
i]; }
228 template <
typename... Args>
229 void book(Args&&...
args) {
230 impl([&](
auto& vec) { vec.book(std::forward<Args>(
args)...); });
233 template <
typename... Args>
235 impl([&](
auto& vec) { vec.push_back(std::forward<Args>(
args)...); });
238 template <
typename... Args>
239 void resize(Args&&...
args) {
240 impl([&](
auto& vec) { vec.resize(std::forward<Args>(
args)...); });
243 template <
typename... Args>
244 void set(Args&&...
args) {
245 impl([&](
auto& vec) { vec.set(std::forward<Args>(
args)...); });
249 impl([&](
auto& vec) { vec.clear(); });
254 template <
typename F>
256 impl2(std::index_sequence_for<Types...>{}, std::forward<F>(
func));
264 template <std::size_t... Is,
typename F>
265 void impl2(std::index_sequence<Is...>,
F&&
func) {
266 call_nop((
func(std::get<Is>(content_)), 0)...);
272 std::map<unsigned int, double> chargeFraction(
const SiPixelCluster& cluster,
275 std::map<unsigned int, double> simTrackIdToAdc;
278 if (idetset == digiSimLink.
end())
279 return simTrackIdToAdc;
283 for (
int iPix = 0; iPix != cluster.
size(); ++iPix) {
287 forEachMatchedSimLink(*idetset, channel, [&](
const PixelDigiSimLink& simLink) {
293 for (
auto& pair : simTrackIdToAdc) {
297 pair.second /= adcSum;
300 return simTrackIdToAdc;
303 std::map<unsigned int, double> chargeFraction(
const SiStripCluster& cluster,
306 std::map<unsigned int, double> simTrackIdToAdc;
309 if (idetset == digiSimLink.
end())
310 return simTrackIdToAdc;
322 for (
const auto& pair : simTrackIdToAdc) {
323 simTrackIdToAdc[pair.first] = (adcSum != 0. ? pair.second / adcSum : 0.);
326 return simTrackIdToAdc;
332 std::map<unsigned int, double> simTrackIdToAdc;
333 throw cms::Exception(
"LogicError") <<
"Not possible to use StripDigiSimLink with Phase2TrackerCluster1D! ";
334 return simTrackIdToAdc;
342 std::map<unsigned int, double> simTrackIdToAdc;
343 return simTrackIdToAdc;
346 struct TrackTPMatch {
348 int countClusters = 0;
351 template <
typename HRange>
352 TrackTPMatch findBestMatchingTrackingParticle(
const HRange&
hits,
354 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
362 std::unordered_map<int, Count>
count;
363 for (
size_t iCluster = 0,
end =
clusters.size(); iCluster <
end; ++iCluster) {
364 const auto& clusterRef =
clusters[iCluster];
367 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
368 const auto tpKey = ip->second.key();
369 if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end())
372 auto& elem =
count[tpKey];
374 elem.innermostHit =
std::min(elem.innermostHit, iCluster);
383 for (
auto& keyCount :
count) {
384 if (keyCount.second.clusters > bestCount ||
385 (keyCount.second.clusters == bestCount && keyCount.second.innermostHit < bestInnermostHit)) {
386 best.key = keyCount.first;
387 best.countClusters = bestCount = keyCount.second.clusters;
388 bestInnermostHit = keyCount.second.innermostHit;
392 LogTrace(
"TrackingNtuple") <<
"findBestMatchingTrackingParticle key " <<
best.key;
397 template <
typename HRange>
398 TrackTPMatch findMatchingTrackingParticleFromFirstHit(
const HRange&
hits,
400 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
408 auto operateCluster = [&](
const auto& clusterRef,
const auto&
func) {
410 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
411 const auto tpKey = ip->second.key();
412 if (tpKeyToIndex.find(tpKey) == tpKeyToIndex.end())
418 std::vector<unsigned int>
421 operateCluster(*iCluster, [&](
unsigned int tpKey) { validTPs.push_back(tpKey); });
422 if (validTPs.empty()) {
426 ++
best.countClusters;
428 std::vector<bool> foundTPs(validTPs.size(),
false);
429 for (
auto iEnd =
clusters.end(); iCluster != iEnd; ++iCluster) {
430 const auto& clusterRef = *iCluster;
433 operateCluster(clusterRef, [&](
unsigned int tpKey) {
435 if (
found != cend(validTPs)) {
441 auto iTP = validTPs.size();
445 if (!foundTPs[iTP]) {
446 validTPs.erase(validTPs.begin() + iTP);
447 foundTPs.erase(foundTPs.begin() + iTP);
450 if (!validTPs.empty()) {
454 best.key = validTPs[0];
460 ++
best.countClusters;
464 return best.countClusters >= 3 ?
best : TrackTPMatch();
509 if (
i.tpKey ==
j.tpKey) {
511 return i.detId <
j.detId;
513 return i.tof <
j.tof;
515 return i.tpKey <
j.tpKey;
522 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
526 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
527 std::set<edm::ProductID>& hitProductIds);
532 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
536 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
537 std::set<edm::ProductID>& hitProductIds);
542 std::vector<std::pair<int, int>>& monoStereoClusterList);
547 const std::vector<std::pair<uint64_t, StripMaskContainer const*>>& stripMasks,
548 std::vector<std::pair<int, int>>& monoStereoClusterList);
553 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
557 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
558 std::set<edm::ProductID>& hitProductIds);
562 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
569 std::vector<std::pair<int, int>>& monoStereoClusterList,
570 const std::set<edm::ProductID>& hitProductIds,
571 std::map<edm::ProductID, size_t>& seedToCollIndex);
576 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
577 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
584 const std::set<edm::ProductID>& hitProductIds,
585 const std::map<edm::ProductID, size_t>& seedToCollIndex,
586 const std::vector<const MVACollection*>& mvaColls,
587 const std::vector<const QualityMaskCollection*>& qualColls);
592 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
593 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
601 const std::set<edm::ProductID>& hitProductIds,
602 const std::map<edm::ProductID, size_t>& seedToCollIndex);
605 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
608 SimHitRefKeyToIndex& simHitRefKeyToIndex,
609 std::vector<TPHitIndex>& tpHitList);
616 const TrackingVertexRefKeyToIndex& tvKeyToIndex,
618 const std::vector<TPHitIndex>& tpHitList,
619 const TrackingParticleRefKeyToCount& tpKeyToClusterCount);
623 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
624 const unsigned int seedOffset);
629 const TrackingParticleRefKeyToIndex& tpKeyToIndex);
640 template <
typename SimLink>
646 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
649 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
657 std::vector<edm::EDGetTokenT<edm::View<reco::Track>>>
seedTokens_;
708 #define BOOK(name) tree->Branch((prefix + "_" + #name).c_str(), &name); 726 subdet.push_back(
id.subdetId());
731 unsigned short s = 0;
732 switch (
id.subdetId()) {
776 std::vector<unsigned short>
side;
821 const auto parsed =
parse(tTopo,
id);
822 order.push_back(parsed.order);
823 ring.push_back(parsed.ring);
824 rod.push_back(parsed.rod);
834 const auto parsed =
parse(tTopo,
id);
855 switch (
id.subdetId()) {
870 std::vector<unsigned short>
ring;
871 std::vector<unsigned short>
rod;
887 const auto parsed =
parse(tTopo,
id);
888 string.push_back(parsed.string);
892 isGlued.push_back(parsed.glued);
904 const auto parsed =
parse(tTopo,
id);
905 string[
index] = parsed.string;
924 unsigned int string = 0;
929 switch (
id.subdetId()) {
980 using DetIdPixel = CombineDetId<DetIdCommon, DetIdPixelOnly>;
981 using DetIdStrip = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdStripOnly>;
982 using DetIdPhase2OT = CombineDetId<DetIdCommon, DetIdOTCommon, DetIdPhase2OTOnly>;
983 using DetIdAll = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdStripOnly>;
984 using DetIdAllPhase2 = CombineDetId<DetIdCommon, DetIdPixelOnly, DetIdOTCommon, DetIdPhase2OTOnly>;
1424 iConfig.getUntrackedParameter<
edm::
InputTag>(
"simHitTPMap"))),
1426 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackAssociator"))),
1428 iConfig.getUntrackedParameter<
edm::
InputTag>(
"pixelDigiSimLink"))),
1430 iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripDigiSimLink"))),
1432 iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTSimLink"))),
1433 includeStripHits_(!iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripDigiSimLink").
label().
empty()),
1434 includePhase2OTHits_(!iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTSimLink").
label().
empty()),
1438 stripRphiRecHitToken_(
1440 stripStereoRecHitToken_(
1443 iConfig.getUntrackedParameter<
edm::
InputTag>(
"stripMatchedRecHits"))),
1445 iConfig.getUntrackedParameter<
edm::
InputTag>(
"phase2OTRecHits"))),
1447 trackingVertexToken_(
1449 tpNLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1450 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNlayers"))),
1451 tpNPixelLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1452 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNpixellayers"))),
1453 tpNStripStereoLayersToken_(consumes<
edm::ValueMap<unsigned
int>>(
1454 iConfig.getUntrackedParameter<
edm::
InputTag>(
"trackingParticleNstripstereolayers"))),
1455 includeSeeds_(iConfig.getUntrackedParameter<
bool>(
"includeSeeds")),
1456 includeTrackCandidates_(iConfig.getUntrackedParameter<
bool>(
"includeTrackCandidates")),
1457 addSeedCurvCov_(iConfig.getUntrackedParameter<
bool>(
"addSeedCurvCov")),
1458 includeAllHits_(iConfig.getUntrackedParameter<
bool>(
"includeAllHits")),
1459 includeOnTrackHitData_(iConfig.getUntrackedParameter<
bool>(
"includeOnTrackHitData")),
1460 includeMVA_(iConfig.getUntrackedParameter<
bool>(
"includeMVA")),
1461 includeTrackingParticles_(iConfig.getUntrackedParameter<
bool>(
"includeTrackingParticles")),
1462 includeOOT_(iConfig.getUntrackedParameter<
bool>(
"includeOOT")),
1463 keepEleSimHits_(iConfig.getUntrackedParameter<
bool>(
"keepEleSimHits")),
1464 saveSimHitsP3_(iConfig.getUntrackedParameter<
bool>(
"saveSimHitsP3")),
1465 simHitBySignificance_(iConfig.getUntrackedParameter<
bool>(
"simHitBySignificance")),
1466 parametersDefiner_(iConfig.getUntrackedParameter<
edm::
InputTag>(
"beamSpot"), consumesCollector()) {
1470 [&](
const edm::InputTag&
tag) { return consumes<edm::View<reco::Track>>(tag); });
1473 [&](
const edm::InputTag&
tag) { return consumes<std::vector<SeedStopInfo>>(tag); });
1482 [&](
const edm::InputTag&
tag) { return consumes<TrackCandidateCollection>(tag); });
1487 <<
"Both stripDigiSimLink and phase2OTSimLink are set, please set only either one (this information is used " 1488 "to infer if you're running phase0/1 or phase2 detector)";
1492 <<
"Neither stripDigiSimLink or phase2OTSimLink are set, please set either one.";
1499 for (
auto const&
mask : maskVPset) {
1500 auto index =
mask.getUntrackedParameter<
unsigned int>(
"index");
1503 consumes<PixelMaskContainer>(
mask.getUntrackedParameter<
edm::InputTag>(
"src")));
1526 return std::make_tuple(consumes<MVACollection>(edm::InputTag(tag,
"MVAValues")),
1527 consumes<QualityMaskCollection>(edm::InputTag(tag,
"QualityMasks")));
1533 t =
fs->make<TTree>(
"tree",
"tree");
1586 t->Branch(
"trk_q", &
trk_q);
1686 t->Branch(
"tcand_bestFromFirstHitSimTrkShareFracSimClusterDenom",
1714 t->Branch(
"sim_q", &
sim_q);
1763 t->Branch(
"pix_x", &
pix_x);
1764 t->Branch(
"pix_y", &
pix_y);
1765 t->Branch(
"pix_z", &
pix_z);
1806 t->Branch(
"str_x", &
str_x);
1807 t->Branch(
"str_y", &
str_y);
1808 t->Branch(
"str_z", &
str_z);
1828 t->Branch(
"glu_x", &
glu_x);
1829 t->Branch(
"glu_y", &
glu_y);
1830 t->Branch(
"glu_z", &
glu_z);
1873 t->Branch(
"ph2_x", &
ph2_x);
1874 t->Branch(
"ph2_y", &
ph2_y);
1875 t->Branch(
"ph2_z", &
ph2_z);
1917 t->Branch(
"bsp_x", &
bsp_x,
"bsp_x/F");
1918 t->Branch(
"bsp_y", &
bsp_y,
"bsp_y/F");
1919 t->Branch(
"bsp_z", &
bsp_z,
"bsp_z/F");
1920 t->Branch(
"bsp_sigmax", &
bsp_sigmax,
"bsp_sigmax/F");
1921 t->Branch(
"bsp_sigmay", &
bsp_sigmay,
"bsp_sigmay/F");
1922 t->Branch(
"bsp_sigmaz", &
bsp_sigmaz,
"bsp_sigmaz/F");
1955 t->Branch(
"see_q", &
see_q);
1987 t->Branch(
"vtx_x", &
vtx_x);
1988 t->Branch(
"vtx_y", &
vtx_y);
1989 t->Branch(
"vtx_z", &
vtx_z);
2421 using namespace edm;
2422 using namespace reco;
2423 using namespace std;
2433 LogDebug(
"TrackingNtuple") <<
"Analyzing new event";
2448 for (
size_t i = 0,
size = TPCollectionH->size();
i <
size; ++
i) {
2454 tmpTPptr = TPCollectionHRefVector.
product();
2459 TrackingParticleRefKeyToIndex tpKeyToIndex;
2460 for (
size_t i = 0;
i < tpCollection.
size(); ++
i) {
2461 tpKeyToIndex[tpCollection[
i].key()] =
i;
2471 TrackingVertexRefKeyToIndex tvKeyToIndex;
2472 for (
size_t i = 0;
i < tvs.size(); ++
i) {
2476 tvKeyToIndex[
i] = tvRefs.
size();
2488 TrackingParticleRefKeyToCount tpKeyToClusterCount;
2489 for (
const auto& clusterTP : clusterToTPMap) {
2490 tpKeyToClusterCount[clusterTP.second.key()] += 1;
2494 SimHitRefKeyToIndex simHitRefKeyToIndex;
2497 std::vector<TPHitIndex> tpHitList;
2501 std::set<edm::ProductID> hitProductIds;
2502 std::map<edm::ProductID, size_t> seedCollToOffset;
2511 const auto& pixelDigiSimLinks = *pixelDigiSimLinksHandle;
2527 vector<pair<int, int>> monoStereoClusterList;
2531 fillSimHits(
tracker, tpKeyToIndex, *simHitsTPAssoc, tTopo, simHitRefKeyToIndex, tpHitList);
2542 simHitRefKeyToIndex,
2547 LogDebug(
"TrackingNtuple") <<
"foundStripSimLink";
2548 const auto& stripDigiSimLinks = *stripDigiSimLinksHandle;
2556 simHitRefKeyToIndex,
2564 LogDebug(
"TrackingNtuple") <<
"foundPhase2OTSimLinks";
2565 const auto& phase2OTSimLinks = *siphase2OTSimLinksHandle;
2573 simHitRefKeyToIndex,
2589 monoStereoClusterList,
2603 std::vector<const MVACollection*> mvaColls;
2604 std::vector<const QualityMaskCollection*> qualColls;
2610 iEvent.getByToken(std::get<0>(tokenTpl), hmva);
2611 iEvent.getByToken(std::get<1>(tokenTpl), hqual);
2613 mvaColls.push_back(hmva.
product());
2614 qualColls.push_back(hqual.
product());
2615 if (mvaColls.back()->size() !=
tracks.size()) {
2617 <<
"Inconsistency in track collection and MVA sizes. Track collection has " <<
tracks.size()
2618 <<
" tracks, whereas the MVA " << (mvaColls.size() - 1) <<
" has " << mvaColls.back()->size()
2619 <<
" entries. Double-check your configuration.";
2621 if (qualColls.back()->size() !=
tracks.size()) {
2623 <<
"Inconsistency in track collection and quality mask sizes. Track collection has " <<
tracks.size()
2624 <<
" tracks, whereas the quality mask " << (qualColls.size() - 1) <<
" has " << qualColls.back()->size()
2625 <<
" entries. Double-check your configuration.";
2637 tpKeyToClusterCount,
2652 auto const tCandsHandle =
iEvent.getHandle(
token);
2657 label.ReplaceAll(
"TrackCandidates",
"");
2658 label.ReplaceAll(
"muonSeeded",
"muonSeededStep");
2665 tpKeyToClusterCount,
2682 iEvent, iSetup, trackRefs,
bs, tpCollection, tvKeyToIndex, associatorByHits, tpHitList, tpKeyToClusterCount);
2703 template <
typename SimLink>
2715 template <
typename SimLink>
2722 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2725 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
2729 std::map<unsigned int, double> simTrackIdToChargeFraction;
2733 simTrackIdToChargeFraction = chargeFraction(GetCluster<SimLink>::call(cluster), hitId,
digiSimLinks);
2735 float h_x = 0, h_y = 0;
2736 float h_xx = 0, h_xy = 0, h_yy = 0;
2738 h_x =
hit.localPosition().
x();
2739 h_y =
hit.localPosition().
y();
2740 h_xx =
hit.localPositionError().xx();
2741 h_xy =
hit.localPositionError().xy();
2742 h_yy =
hit.localPositionError().yy();
2748 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2752 const auto event = trackingParticle->eventId().event();
2753 const auto bx = trackingParticle->eventId().bunchCrossing();
2762 auto tpIndex = tpKeyToIndex.find(trackingParticle.
key());
2763 if (tpIndex == tpKeyToIndex.end())
2767 std::pair<TrackingParticleRef, TrackPSimHitRef> simHitTPpairWithDummyTP(trackingParticle,
TrackPSimHitRef());
2769 auto range = std::equal_range(simHitsTPAssoc.begin(),
2770 simHitsTPAssoc.end(),
2771 simHitTPpairWithDummyTP,
2773 bool foundSimHit =
false;
2774 bool foundElectron =
false;
2775 int foundNonElectrons = 0;
2776 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2781 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2784 foundNonElectrons++;
2794 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2799 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2800 foundElectron =
true;
2805 float sx = TPhit->localPosition().x();
2806 float sy = TPhit->localPosition().y();
2807 float dx =
sx - h_x;
2808 float dy =
sy - h_y;
2809 float sig = (
dx *
dx * h_yy - 2 *
dx *
dy * h_xy +
dy *
dy * h_xx) / (h_xx * h_yy - h_xy * h_xy);
2814 simHitKey = TPhit.
key();
2815 simHitID = TPhit.
id();
2820 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2821 ret.matchingSimHit.push_back(simHitIndex);
2823 double chargeFraction = 0.;
2824 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2825 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2826 if (
found != simTrackIdToChargeFraction.end()) {
2827 chargeFraction +=
found->second;
2831 ret.chargeFraction.push_back(chargeFraction);
2834 ret.bunchCrossing.push_back(
bx);
2838 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2841 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2846 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2847 foundElectron =
true;
2850 if (foundNonElectrons > 0)
2855 auto simHitKey = TPhit.
key();
2856 auto simHitID = TPhit.
id();
2858 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2859 ret.matchingSimHit.push_back(simHitIndex);
2861 double chargeFraction = 0.;
2862 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2863 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2864 if (
found != simTrackIdToChargeFraction.end()) {
2865 chargeFraction +=
found->second;
2869 ret.chargeFraction.push_back(chargeFraction);
2872 ret.bunchCrossing.push_back(
bx);
2876 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2887 <<
"Did not find SimHit for reco hit DetId " << hitId.
rawId() <<
" for TP " << trackingParticle.
key()
2888 <<
" bx:event " <<
bx <<
":" <<
event <<
" PDGid " << trackingParticle->pdgId() <<
" q " 2889 << trackingParticle->charge() <<
" p4 " << trackingParticle->p4() <<
" nG4 " 2890 << trackingParticle->g4Tracks().size() <<
".\nFound SimHits from detectors ";
2891 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2894 ex << dId.
rawId() <<
" ";
2896 if (trackingParticle->eventId().event() != 0) {
2897 ex <<
"\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in " 2909 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2912 SimHitRefKeyToIndex& simHitRefKeyToIndex,
2913 std::vector<TPHitIndex>& tpHitList) {
2914 for (
const auto&
assoc : simHitsTPAssoc) {
2915 auto tpKey =
assoc.first.key();
2919 auto found = tpKeyToIndex.find(tpKey);
2920 if (
found == tpKeyToIndex.end())
2922 const auto tpIndex =
found->second;
2925 const auto& simhit = *(
assoc.second);
2938 auto simHitKey = std::make_pair(
assoc.second.key(),
assoc.second.id());
2940 if (simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) {
2941 for (
const auto& assoc2 : simHitsTPAssoc) {
2942 if (std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) {
2944 auto range1 = std::equal_range(simHitsTPAssoc.begin(),
2945 simHitsTPAssoc.end(),
2948 auto range2 = std::equal_range(simHitsTPAssoc.begin(),
2949 simHitsTPAssoc.end(),
2953 LogTrace(
"TrackingNtuple") <<
"Earlier TP " << assoc2.first.key() <<
" SimTrack Ids";
2954 for (
const auto&
simTrack : assoc2.first->g4Tracks()) {
2956 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2958 for (
auto iHit = range2.first; iHit != range2.second; ++iHit) {
2959 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2960 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2961 << iHit->second->eventId().bunchCrossing() <<
":" 2962 << iHit->second->eventId().event();
2964 LogTrace(
"TrackingNtuple") <<
"Current TP " <<
assoc.first.key() <<
" SimTrack Ids";
2967 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2969 for (
auto iHit = range1.first; iHit != range1.second; ++iHit) {
2970 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2971 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2972 << iHit->second->eventId().bunchCrossing() <<
":" 2973 << iHit->second->eventId().event();
2978 <<
"Got second time the SimHit " << simHitKey.first <<
" of " << simHitKey.second
2979 <<
", first time with TrackingParticle " << assoc2.first.key() <<
", now with " << tpKey;
2982 throw cms::Exception(
"LogicError") <<
"Got second time the SimHit " << simHitKey.first <<
" of " 2983 << simHitKey.second <<
", now with TrackingParticle " << tpKey
2984 <<
", but I didn't find the first occurrance!";
2989 throw cms::Exception(
"LogicError") <<
"Did not find a det unit for DetId " << simhit.detUnitId()
2990 <<
" from tracker geometry";
2992 const auto pos = det->surface().toGlobal(simhit.localPosition());
2993 const float tof = simhit.timeOfFlight();
2995 const auto simHitIndex =
simhit_x.size();
2996 simHitRefKeyToIndex[simHitKey] = simHitIndex;
3006 const auto mom = det->surface().toGlobal(simhit.momentumAtEntry());
3022 tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId());
3029 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3033 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3034 std::set<edm::ProductID>& hitProductIds) {
3035 std::vector<std::pair<uint64_t, PixelMaskContainer const*>> pixelMasks;
3039 iEvent.getByToken(itoken.second, aH);
3040 pixelMasks.emplace_back(1 << itoken.first, aH.
product());
3042 auto pixUsedMask = [&pixelMasks](
size_t key) {
3044 for (
auto const&
m : pixelMasks) {
3045 if (
m.second->mask(
key))
3054 const DetId hitId =
it->detId();
3056 hitProductIds.insert(
hit->cluster().
id());
3058 const int key =
hit->cluster().key();
3059 const int lay = tTopo.
layer(hitId);
3075 pix_x.push_back(
hit->globalPosition().
x());
3076 pix_y.push_back(
hit->globalPosition().
y());
3077 pix_z.push_back(
hit->globalPosition().
z());
3078 pix_xx.push_back(
hit->globalPositionError().cxx());
3079 pix_xy.push_back(
hit->globalPositionError().cyx());
3080 pix_yy.push_back(
hit->globalPositionError().cyy());
3081 pix_yz.push_back(
hit->globalPositionError().czy());
3082 pix_zz.push_back(
hit->globalPositionError().czz());
3083 pix_zx.push_back(
hit->globalPositionError().czx());
3084 pix_radL.push_back(
hit->surface()->mediumProperties().radLen());
3085 pix_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3090 LogTrace(
"TrackingNtuple") <<
"pixHit cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3091 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3101 simHitRefKeyToIndex,
3110 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3116 <<
" event=" << simHitData.
event[0];
3126 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3130 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3131 std::set<edm::ProductID>& hitProductIds) {
3132 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3136 iEvent.getByToken(itoken.second, aH);
3137 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3139 auto strUsedMask = [&stripMasks](
size_t key) {
3141 for (
auto const&
m : stripMasks) {
3142 if (
m.second->mask(
key))
3171 str_x.resize(totalStripHits);
3172 str_y.resize(totalStripHits);
3173 str_z.resize(totalStripHits);
3174 str_xx.resize(totalStripHits);
3175 str_xy.resize(totalStripHits);
3176 str_yy.resize(totalStripHits);
3177 str_yz.resize(totalStripHits);
3178 str_zz.resize(totalStripHits);
3179 str_zx.resize(totalStripHits);
3189 for (
const auto& detset :
hits) {
3190 const DetId hitId = detset.detId();
3191 for (
const auto&
hit : detset) {
3192 hitProductIds.insert(
hit.cluster().
id());
3194 const int key =
hit.cluster().key();
3195 const int lay = tTopo.
layer(hitId);
3213 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit.globalPosition();
3224 simHitRefKeyToIndex,
3233 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3241 <<
" event=" << simHitData.
event[0];
3248 fill(*rphiHits,
"stripRPhiHit");
3249 fill(*stereoHits,
"stripStereoHit");
3255 const std::vector<std::pair<uint64_t, StripMaskContainer const*>>& stripMasks,
3256 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3257 auto strUsedMask = [&stripMasks](
size_t key) {
3259 for (
auto const&
m : stripMasks) {
3260 if (
m.second->mask(
key))
3266 const auto hitId =
hit.geographicalId();
3267 const int lay = tTopo.
layer(hitId);
3268 monoStereoClusterList.emplace_back(
hit.monoHit().cluster().key(),
hit.stereoHit().cluster().key());
3274 glu_x.push_back(
hit.globalPosition().
x());
3275 glu_y.push_back(
hit.globalPosition().
y());
3276 glu_z.push_back(
hit.globalPosition().
z());
3277 glu_xx.push_back(
hit.globalPositionError().cxx());
3278 glu_xy.push_back(
hit.globalPositionError().cyx());
3279 glu_yy.push_back(
hit.globalPositionError().cyy());
3280 glu_yz.push_back(
hit.globalPositionError().czy());
3281 glu_zz.push_back(
hit.globalPositionError().czz());
3282 glu_zx.push_back(
hit.globalPositionError().czx());
3283 glu_radL.push_back(
hit.surface()->mediumProperties().radLen());
3284 glu_bbxi.push_back(
hit.surface()->mediumProperties().xi());
3290 LogTrace(
"TrackingNtuple") <<
"stripMatchedHit" 3291 <<
" cluster0=" <<
hit.stereoHit().cluster().key()
3292 <<
" cluster1=" <<
hit.monoHit().cluster().key() <<
" subdId=" << hitId.subdetId()
3293 <<
" lay=" << lay <<
" rawId=" << hitId.rawId() <<
" pos =" <<
hit.globalPosition();
3300 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3301 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3305 iEvent.getByToken(itoken.second, aH);
3306 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3311 for (
auto it = matchedHits->
begin();
it != matchedHits->
end();
it++) {
3321 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3325 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3326 std::set<edm::ProductID>& hitProductIds) {
3327 std::vector<std::pair<uint64_t, Phase2OTMaskContainer const*>> phase2OTMasks;
3331 iEvent.getByToken(itoken.second, aH);
3332 phase2OTMasks.emplace_back(1 << itoken.first, aH.
product());
3334 auto ph2OTUsedMask = [&phase2OTMasks](
size_t key) {
3336 for (
auto const&
m : phase2OTMasks) {
3337 if (
m.second->mask(
key))
3345 for (
auto it = phase2OTHits->
begin();
it != phase2OTHits->
end();
it++) {
3346 const DetId hitId =
it->detId();
3348 hitProductIds.insert(
hit->cluster().
id());
3350 const int key =
hit->cluster().key();
3351 const int lay = tTopo.
layer(hitId);
3367 ph2_x.push_back(
hit->globalPosition().
x());
3368 ph2_y.push_back(
hit->globalPosition().
y());
3369 ph2_z.push_back(
hit->globalPosition().
z());
3370 ph2_xx.push_back(
hit->globalPositionError().cxx());
3371 ph2_xy.push_back(
hit->globalPositionError().cyx());
3372 ph2_yy.push_back(
hit->globalPositionError().cyy());
3373 ph2_yz.push_back(
hit->globalPositionError().czy());
3374 ph2_zz.push_back(
hit->globalPositionError().czz());
3375 ph2_zx.push_back(
hit->globalPositionError().czx());
3376 ph2_radL.push_back(
hit->surface()->mediumProperties().radLen());
3377 ph2_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3380 LogTrace(
"TrackingNtuple") <<
"phase2 OT cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3381 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3392 simHitRefKeyToIndex,
3400 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3406 <<
" event=" << simHitData.
event[0];
3415 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3422 std::vector<std::pair<int, int>>& monoStereoClusterList,
3423 const std::set<edm::ProductID>& hitProductIds,
3424 std::map<edm::ProductID, size_t>& seedCollToOffset) {
3426 for (
size_t iColl = 0; iColl <
seedTokens_.size(); ++iColl) {
3430 iEvent.getByToken(seedToken, seedTracksHandle);
3441 iEvent.getByToken(seedStopInfoToken, seedStopInfoHandle);
3442 const auto& seedStopInfos = *seedStopInfoHandle;
3443 if (
seedTracks.size() != seedStopInfos.size()) {
3448 <<
" seed stopping infos for collections " <<
labels.module <<
", " 3452 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3456 iEvent.getByToken(itoken.second, aH);
3457 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3470 label.ReplaceAll(
"seedTracks",
"");
3471 label.ReplaceAll(
"Seeds",
"");
3472 label.ReplaceAll(
"muonSeeded",
"muonSeededStep");
3474 label.ReplaceAll(
"FromPixelTracks",
"");
3475 label.ReplaceAll(
"PFLowPixel",
"");
3476 label.ReplaceAll(
"hltDoubletRecovery",
"pixelPairStep");
3481 auto inserted = seedCollToOffset.emplace(
id,
offset);
3482 if (!inserted.second)
3484 <<
"Trying to add seeds with ProductID " <<
id <<
" for a second time from collection " <<
labels.module
3485 <<
", seed algo " <<
label <<
". Typically this is caused by a configuration problem.";
3489 <<
" ProductID " <<
id;
3491 for (
size_t iSeed = 0; iSeed < seedTrackRefs.
size(); ++iSeed) {
3492 const auto& seedTrackRef = seedTrackRefs[iSeed];
3493 const auto& seedTrack = *seedTrackRef;
3494 const auto& seedRef = seedTrack.seedRef();
3495 const auto&
seed = *seedRef;
3497 const auto seedStopInfo = seedStopInfos[iSeed];
3499 if (seedRef.id() !=
id)
3501 <<
"All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the " 3502 "element 0 had ProductID " 3503 <<
id <<
" while the element " << seedTrackRef.key() <<
" had " << seedTrackRef.id()
3504 <<
". The source collection is " <<
labels.module <<
".";
3506 std::vector<int> tpIdx;
3507 std::vector<float> sharedFraction;
3508 auto foundTPs = recSimColl.
find(seedTrackRef);
3509 if (foundTPs != recSimColl.
end()) {
3510 for (
const auto& tpQuality : foundTPs->val) {
3511 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3512 sharedFraction.push_back(tpQuality.second);
3517 const int nHits = seedTrack.numberOfValidHits();
3519 seedTrack.recHitsBegin(),
3520 seedTrack.recHitsEnd());
3522 const auto bestKeyCount = findBestMatchingTrackingParticle(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3523 const float bestShareFrac =
3524 nClusters > 0 ?
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3526 const auto bestFirstHitKeyCount =
3527 findMatchingTrackingParticleFromFirstHit(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3528 const float bestFirstHitShareFrac =
3529 nClusters > 0 ?
static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3532 const int charge = seedTrack.charge();
3533 const float pt = seedFitOk ? seedTrack.pt() : 0;
3534 const float eta = seedFitOk ? seedTrack.eta() : 0;
3535 const float phi = seedFitOk ? seedTrack.phi() : 0;
3537 const auto seedIndex =
see_fitok.size();
3541 see_px.push_back(seedFitOk ? seedTrack.px() : 0);
3542 see_py.push_back(seedFitOk ? seedTrack.py() : 0);
3543 see_pz.push_back(seedFitOk ? seedTrack.pz() : 0);
3550 see_dxy.push_back(seedFitOk ? seedTrack.dxy(
bs.position()) : 0);
3551 see_dz.push_back(seedFitOk ? seedTrack.dz(
bs.position()) : 0);
3552 see_ptErr.push_back(seedFitOk ? seedTrack.ptError() : 0);
3553 see_etaErr.push_back(seedFitOk ? seedTrack.etaError() : 0);
3554 see_phiErr.push_back(seedFitOk ? seedTrack.phiError() : 0);
3555 see_dxyErr.push_back(seedFitOk ? seedTrack.dxyError() : 0);
3556 see_dzErr.push_back(seedFitOk ? seedTrack.dzError() : 0);
3559 see_nCands.push_back(seedStopInfo.candidatesPerSeed());
3561 const auto&
state = seedTrack.seedRef()->startingState();
3562 const auto&
pos =
state.parameters().position();
3563 const auto& mom =
state.parameters().momentum();
3584 std::vector<float> cov(15);
3585 auto covP = cov.begin();
3586 for (
auto const val : stateCcov)
3596 see_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3598 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
3617 std::vector<int> hitIdx;
3618 std::vector<int> hitType;
3620 for (
auto const&
hit :
seed.recHits()) {
3621 int subid =
hit.geographicalId().subdetId();
3627 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3630 hitIdx.push_back(clusterKey);
3643 std::vector<std::pair<int, int>>::iterator
pos =
3644 find(monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx, stereoIdx));
3645 size_t gluedIndex = -1;
3646 if (
pos != monoStereoClusterList.end()) {
3658 hitIdx.push_back(gluedIndex);
3663 unsigned int clusterKey;
3664 if (clusterRef.isPhase2()) {
3667 clusterKey = clusterRef.cluster_strip().key();
3671 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3672 if (clusterRef.isPhase2()) {
3679 hitIdx.push_back(clusterKey);
3680 if (clusterRef.isPhase2()) {
3687 LogTrace(
"TrackingNtuple") <<
" not pixel and not Strip detector";
3700 auto const recHit0 =
seed.recHits().begin();
3701 auto const recHit1 =
seed.recHits().begin() + 1;
3702 std::vector<GlobalPoint>
gp(2);
3703 std::vector<GlobalError> ge(2);
3704 gp[0] = recHit0->globalPosition();
3705 ge[0] = recHit0->globalPositionError();
3706 gp[1] = recHit1->globalPosition();
3707 ge[1] = recHit1->globalPositionError();
3709 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3710 <<
" - PAIR - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3711 <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" trans0: " 3712 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3715 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3718 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3721 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3723 <<
" eta,phi: " <<
gp[0].
eta() <<
"," <<
gp[0].phi();
3724 }
else if (
nHits == 3) {
3725 auto const recHit0 =
seed.recHits().begin();
3726 auto const recHit1 =
seed.recHits().begin() + 1;
3727 auto const recHit2 =
seed.recHits().begin() + 2;
3731 gp[0] = recHit0->globalPosition();
3732 ge[0] = recHit0->globalPositionError();
3733 int subid0 = recHit0->geographicalId().subdetId();
3736 gp[1] = recHit1->globalPosition();
3737 ge[1] = recHit1->globalPositionError();
3738 int subid1 = recHit1->geographicalId().subdetId();
3741 gp[2] = recHit2->globalPosition();
3742 ge[2] = recHit2->globalPositionError();
3743 int subid2 = recHit2->geographicalId().subdetId();
3747 float seed_chi2 = rzLine.
chi2();
3751 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3752 <<
" - TRIPLET - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3753 <<
" " << recHit2->geographicalId().rawId() <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" " <<
gp[2]
3755 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3758 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3761 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3764 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3767 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[0]->globalPosition()
3770 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[1]->globalPosition()
3773 << recHit2->localPosition()
3775 <<
" eta,phi: " <<
gp[0].eta() <<
"," <<
gp[0].phi() <<
" pt,chi2: " << seed_pt <<
"," << seed_chi2;
3788 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3789 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
3796 const std::set<edm::ProductID>& hitProductIds,
3797 const std::map<edm::ProductID, size_t>& seedCollToOffset,
3798 const std::vector<const MVACollection*>& mvaColls,
3799 const std::vector<const QualityMaskCollection*>& qualColls) {
3803 LogTrace(
"TrackingNtuple") <<
"NEW TRACK LABEL: " <<
labels.module;
3805 auto pvPosition =
vertices[0].position();
3807 for (
size_t iTrack = 0; iTrack <
tracks.size(); ++iTrack) {
3808 const auto& itTrack =
tracks[iTrack];
3809 int charge = itTrack->charge();
3810 float pt = itTrack->pt();
3811 float eta = itTrack->eta();
3812 const double lambda = itTrack->lambda();
3813 float chi2 = itTrack->normalizedChi2();
3814 float ndof = itTrack->ndof();
3815 float phi = itTrack->phi();
3816 int nHits = itTrack->numberOfValidHits();
3819 const auto& tkParam = itTrack->parameters();
3820 auto tkCov = itTrack->covariance();
3825 bool isSimMatched =
false;
3826 std::vector<int> tpIdx;
3827 std::vector<float> sharedFraction;
3828 std::vector<float> tpChi2;
3829 auto foundTPs = recSimColl.
find(itTrack);
3830 if (foundTPs != recSimColl.
end()) {
3831 if (!foundTPs->val.empty()) {
3832 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
3833 isSimMatched =
true;
3835 for (
const auto& tpQuality : foundTPs->val) {
3836 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3837 sharedFraction.push_back(tpQuality.second);
3844 itTrack->recHitsBegin(),
3845 itTrack->recHitsEnd());
3848 const auto bestKeyCount = findBestMatchingTrackingParticle(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3849 const float bestShareFrac =
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters);
3850 float bestShareFracSimDenom = 0;
3851 float bestShareFracSimClusterDenom = 0;
3852 float bestChi2 = -1;
3853 if (bestKeyCount.key >= 0) {
3854 bestShareFracSimDenom =
3855 static_cast<float>(bestKeyCount.countClusters) /
3856 static_cast<float>(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits());
3857 bestShareFracSimClusterDenom =
3858 static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(tpKeyToClusterCount.at(bestKeyCount.key));
3860 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
3863 const auto bestFirstHitKeyCount =
3864 findMatchingTrackingParticleFromFirstHit(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3865 const float bestFirstHitShareFrac =
3866 static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters);
3867 float bestFirstHitShareFracSimDenom = 0;
3868 float bestFirstHitShareFracSimClusterDenom = 0;
3869 float bestFirstHitChi2 = -1;
3870 if (bestFirstHitKeyCount.key >= 0) {
3871 bestFirstHitShareFracSimDenom =
3872 static_cast<float>(bestFirstHitKeyCount.countClusters) /
3873 static_cast<float>(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits());
3874 bestFirstHitShareFracSimClusterDenom =
static_cast<float>(bestFirstHitKeyCount.countClusters) /
3875 static_cast<float>(tpKeyToClusterCount.at(bestFirstHitKeyCount.key));
3877 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
3880 float chi2_1Dmod =
chi2;
3881 int count1dhits = 0;
3882 for (
auto iHit = itTrack->recHitsBegin(), iEnd = itTrack->recHitsEnd(); iHit != iEnd; ++iHit) {
3887 if (count1dhits > 0) {
3888 chi2_1Dmod = (
chi2 + count1dhits) / (
ndof + count1dhits);
3893 trk_px.push_back(itTrack->px());
3894 trk_py.push_back(itTrack->py());
3895 trk_pz.push_back(itTrack->pz());
3900 trk_inner_pt.push_back(itTrack->innerMomentum().rho());
3904 trk_outer_pt.push_back(itTrack->outerMomentum().rho());
3909 trk_dxy.push_back(itTrack->dxy(
bs.position()));
3910 trk_dz.push_back(itTrack->dz(
bs.position()));
3911 trk_dxyPV.push_back(itTrack->dxy(pvPosition));
3912 trk_dzPV.push_back(itTrack->dz(pvPosition));
3915 trk_ptErr.push_back(itTrack->ptError());
3920 trk_dzErr.push_back(itTrack->dzError());
3939 trk_n3DLay.push_back(
hp.numberOfValidStripLayersWithMonoAndStereo() +
hp.pixelLayersWithMeasurement());
3942 trk_algo.push_back(itTrack->algo());
3949 trk_mvas[
i].push_back((*(mvaColls[
i]))[iTrack]);
3954 auto offset = seedCollToOffset.find(itTrack->seedRef().id());
3955 if (
offset == seedCollToOffset.end()) {
3959 << itTrack->seedRef().id()
3960 <<
", but that seed collection is not given as an input. The following collections were given as an input " 3961 << make_ProductIDMapPrinter(seedCollToOffset);
3964 const auto seedIndex =
offset->second + itTrack->seedRef().key();
3967 throw cms::Exception(
"LogicError") <<
"Track index has already been set for seed " << seedIndex <<
" to " 3968 <<
see_trkIdx[seedIndex] <<
"; was trying to set it to " << iTrack;
3977 trk_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3992 LogTrace(
"TrackingNtuple") <<
"Track #" << itTrack.key() <<
" with q=" <<
charge <<
", pT=" <<
pt 3993 <<
" GeV, eta: " <<
eta <<
", phi: " <<
phi <<
", chi2=" <<
chi2 <<
", Nhits=" <<
nHits 3994 <<
", algo=" << itTrack->algoName(itTrack->algo()).c_str()
3996 <<
" seed#=" << itTrack->seedRef().key() <<
" simMatch=" << isSimMatched
3997 <<
" nSimHits=" << nSimHits
3998 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
3999 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
4000 std::vector<int> hitIdx;
4001 std::vector<int> hitType;
4003 for (
auto i = itTrack->recHitsBegin();
i != itTrack->recHitsEnd();
i++) {
4005 DetId hitId =
hit->geographicalId();
4013 if (
hit->isValid()) {
4017 unsigned int clusterKey;
4018 if (clusterRef.isPixel()) {
4020 }
else if (clusterRef.isPhase2()) {
4021 clusterKey = clusterRef.cluster_phase2OT().key();
4023 clusterKey = clusterRef.cluster_strip().key();
4026 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4027 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4028 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4030 checkProductID(hitProductIds, clusterRef.id(),
"track");
4031 if (clusterRef.isPixel()) {
4042 }
else if (clusterRef.isPhase2()) {
4067 hitIdx.push_back(clusterKey);
4068 if (clusterRef.isPixel()) {
4070 }
else if (clusterRef.isPhase2()) {
4076 LogTrace(
"TrackingNtuple") <<
" - invalid hit";
4098 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4099 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
4107 const std::set<edm::ProductID>& hitProductIds,
4108 const std::map<edm::ProductID, size_t>& seedCollToOffset) {
4113 auto const&
cands = *candsHandle;
4114 for (
size_t iCand = 0; iCand <
cands.size(); ++iCand) {
4115 const auto& aCand =
cands[iCand];
4119 auto const& pState = aCand.trajectoryStateOnDet();
4123 if (!tbStateAtPCA.
isValid()) {
4124 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
4128 auto v0 = stateAtPCA.position();
4129 auto p = stateAtPCA.momentum();
4136 0, 0,
pos, mom, stateAtPCA.charge(), tbStateAtPCA.
isValid() ? stateAtPCA.curvilinearError().matrix() : dummyCov);
4139 auto tkCov = trk.covariance();
4144 bool isSimMatched =
false;
4145 std::vector<int> tpIdx;
4146 std::vector<float> sharedFraction;
4147 std::vector<float> tpChi2;
4148 auto foundTPs = recSimColl.
find(aCandRef);
4149 if (foundTPs != recSimColl.
end()) {
4150 if (!foundTPs->val.empty()) {
4151 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
4152 isSimMatched =
true;
4154 for (
const auto& tpQuality : foundTPs->val) {
4155 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
4156 sharedFraction.push_back(tpQuality.second);
4165 const auto bestKeyCount = findBestMatchingTrackingParticle(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4166 const float bestCountF = bestKeyCount.countClusters;
4167 const float bestShareFrac = bestCountF /
nClusters;
4168 float bestShareFracSimDenom = 0;
4169 float bestShareFracSimClusterDenom = 0;
4170 float bestChi2 = -1;
4171 if (bestKeyCount.key >= 0) {
4172 bestShareFracSimDenom = bestCountF / tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits();
4173 bestShareFracSimClusterDenom = bestCountF / tpKeyToClusterCount.
at(bestKeyCount.key);
4175 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
4178 const auto bestFirstHitKeyCount =
4179 findMatchingTrackingParticleFromFirstHit(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4180 const float bestFirstCountF = bestFirstHitKeyCount.countClusters;
4181 const float bestFirstHitShareFrac = bestFirstCountF /
nClusters;
4182 float bestFirstHitShareFracSimDenom = 0;
4183 float bestFirstHitShareFracSimClusterDenom = 0;
4184 float bestFirstHitChi2 = -1;
4185 if (bestFirstHitKeyCount.key >= 0) {
4186 bestFirstHitShareFracSimDenom =
4187 bestFirstCountF / tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits();
4188 bestFirstHitShareFracSimClusterDenom = bestFirstCountF / tpKeyToClusterCount.
at(bestFirstHitKeyCount.key);
4190 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
4217 auto const& pStateCov =
state.curvilinearError().matrix();
4228 for (
auto const&
hit : aCand.recHits()) {
4229 if (
hit.isValid()) {
4233 auto const subdet =
hit.geographicalId().subdetId();
4241 tcand_q.push_back(trk.charge());
4249 auto offset = seedCollToOffset.find(aCand.seedRef().id());
4250 if (
offset == seedCollToOffset.end()) {
4252 <<
"Track candidate refers to seed collection " << aCand.seedRef().id()
4253 <<
", but that seed collection is not given as an input. The following collections were given as an input " 4254 << make_ProductIDMapPrinter(seedCollToOffset);
4257 const auto seedIndex =
offset->second + aCand.seedRef().key();
4261 <<
"Track cand index has already been set for seed " << seedIndex <<
" to " <<
see_tcandIdx[seedIndex]
4262 <<
"; was trying to set it to " << iglobCand <<
" current " << iCand;
4271 tcand_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
4273 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
4286 LogTrace(
"TrackingNtuple") <<
"Track cand #" << iCand <<
" glob " << iglobCand <<
" with q=" << trk.charge()
4287 <<
", pT=" << trk.pt() <<
" GeV, eta: " << trk.eta() <<
", phi: " << trk.phi()
4288 <<
", nValid=" << nValid <<
" seed#=" << aCand.seedRef().key()
4289 <<
" simMatch=" << isSimMatched <<
" nSimHits=" << nSimHits
4290 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
4291 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
4292 std::vector<int> hitIdx;
4293 std::vector<int> hitType;
4295 for (
auto i = aCand.recHits().begin();
i != aCand.recHits().end();
i++) {
4297 DetId hitId =
hit->geographicalId();
4305 if (
hit->isValid()) {
4309 unsigned int clusterKey;
4310 if (clusterRef.isPixel()) {
4312 }
else if (clusterRef.isPhase2()) {
4313 clusterKey = clusterRef.cluster_phase2OT().key();
4315 clusterKey = clusterRef.cluster_strip().key();
4318 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4319 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4320 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4322 checkProductID(hitProductIds, clusterRef.id(),
"track");
4323 if (clusterRef.isPixel()) {
4325 }
else if (clusterRef.isPhase2()) {
4332 hitIdx.push_back(clusterKey);
4333 if (clusterRef.isPixel()) {
4335 }
else if (clusterRef.isPhase2()) {
4353 const TrackingVertexRefKeyToIndex& tvKeyToIndex,
4355 const std::vector<TPHitIndex>& tpHitList,
4356 const TrackingParticleRefKeyToCount& tpKeyToClusterCount) {
4360 const auto& nLayers_tPCeff = *tpNLayersH;
4363 const auto& nPixelLayers_tPCeff = *tpNLayersH;
4366 const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
4371 LogTrace(
"TrackingNtuple") <<
"tracking particle pt=" <<
tp->pt() <<
" eta=" <<
tp->eta() <<
" phi=" <<
tp->phi();
4372 bool isRecoMatched =
false;
4373 std::vector<int> tkIdx;
4374 std::vector<float> sharedFraction;
4375 auto foundTracks = simRecColl.
find(
tp);
4376 if (foundTracks != simRecColl.
end()) {
4377 isRecoMatched =
true;
4385 for (
const auto& genRef :
tp->genParticles()) {
4386 if (genRef.isNonnull())
4390 bool isFromBHadron =
false;
4395 for (
const auto& particle : recoGenParticleTrail) {
4398 isFromBHadron =
true;
4404 LogTrace(
"TrackingNtuple") <<
"matched to tracks = " << make_VectorPrinter(tkIdx)
4405 <<
" isRecoMatched=" << isRecoMatched;
4416 sim_q.push_back(
tp->charge());
4420 std::vector<int> decayIdx;
4421 for (
const auto&
v :
tp->decayVertices())
4422 decayIdx.push_back(tvKeyToIndex.at(
v.key()));
4430 const double lambdaSim =
M_PI / 2 - momentum.theta();
4439 std::vector<int> hitIdx;
4440 int nPixel = 0, nStrip = 0;
4442 for (
auto ip = rangeHit.first; ip != rangeHit.second; ++ip) {
4446 LogTrace(
"TrackingNtuple") <<
"simhit=" << ip->simHitIdx <<
" type=" <<
static_cast<int>(
type);
4447 hitIdx.push_back(ip->simHitIdx);
4450 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4451 << detid.rawId() <<
" whose det() is not Tracker but " << detid.det();
4453 const auto subdet = detid.subdetId();
4466 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4467 << detid.rawId() <<
" whose subdet is not recognized, is " << subdet;
4474 const auto nSimLayers = nLayers_tPCeff[
tp];
4475 const auto nSimPixelLayers = nPixelLayers_tPCeff[
tp];
4476 const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[
tp];
4479 sim_n3DLay.push_back(nSimPixelLayers + nSimStripMonoAndStereoLayers);
4482 auto found = tpKeyToClusterCount.find(
tp.key());
4492 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4493 const unsigned int seedOffset) {
4497 for (
const auto& keyVal : simRecColl) {
4498 const auto& tpRef = keyVal.key;
4499 auto found = tpKeyToIndex.find(tpRef.key());
4500 if (
found == tpKeyToIndex.end())
4501 throw cms::Exception(
"Assert") << __FILE__ <<
":" << __LINE__ <<
" fillTrackingParticlesForSeeds: tpRef.key() " 4502 << tpRef.key() <<
" not found from tpKeyToIndex. tpKeyToIndex size " 4503 << tpKeyToIndex.size();
4504 const auto tpIndex =
found->second;
4505 for (
const auto& pair : keyVal.val) {
4506 const auto& seedRef = pair.first->seedRef();
4507 sim_seedIdx[tpIndex].push_back(seedOffset + seedRef.key());
4514 for (
size_t iVertex = 0,
size =
vertices.size(); iVertex <
size; ++iVertex) {
4527 std::vector<int> trkIdx;
4528 for (
auto iTrack =
vertex.tracks_begin(); iTrack !=
vertex.tracks_end(); ++iTrack) {
4530 if (iTrack->id() !=
tracks.id())
4533 trkIdx.push_back(iTrack->key());
4536 throw cms::Exception(
"LogicError") <<
"Vertex index has already been set for track " << iTrack->key() <<
" to " 4537 <<
trk_vtxIdx[iTrack->key()] <<
"; was trying to set it to " << iVertex;
4546 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
4547 int current_event = -1;
4548 for (
const auto& ref : trackingVertices) {
4550 if (
v.eventId().event() != current_event) {
4552 current_event =
v.eventId().event();
4557 if (!
v.g4Vertices().empty()) {
4558 processType =
v.g4Vertices()[0].processType();
4570 for (
const auto& tpRef : tps) {
4571 auto found = tpKeyToIndex.find(tpRef.key());
4572 if (
found != tpKeyToIndex.end()) {
4578 std::vector<int> sourceIdx;
4579 std::vector<int> daughterIdx;
4580 fill(
v.sourceTracks(), sourceIdx);
4581 fill(
v.daughterTracks(), daughterIdx);
4593 desc.addUntracked<std::vector<edm::InputTag>>(
4595 std::vector<edm::InputTag>{
edm::InputTag(
"seedTracksinitialStepSeeds"),
4605 desc.addUntracked<std::vector<edm::InputTag>>(
4607 std::vector<edm::InputTag>{
edm::InputTag(
"initialStepTrackCandidates"),
4618 desc.addUntracked<std::vector<std::string>>(
"trackMVAs", std::vector<std::string>{{
"generalTracks"}});
4623 std::vector<edm::ParameterSet> cMasks;
4628 cMasks.push_back(ps);
4639 desc.addVPSetUntracked(
"clusterMasks", cMaskDesc, cMasks);
4642 desc.addUntracked<
bool>(
"trackingParticlesRef",
false);
4658 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"trackerLayers"));
4660 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"pixelLayers"));
4662 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"stripStereoLayers"));
4664 ->setComment(
"currently not used: keep for possible future use");
4665 desc.addUntracked<
bool>(
"includeSeeds",
false);
4666 desc.addUntracked<
bool>(
"includeTrackCandidates",
false);
4667 desc.addUntracked<
bool>(
"addSeedCurvCov",
false);
4668 desc.addUntracked<
bool>(
"includeAllHits",
false);
4669 desc.addUntracked<
bool>(
"includeOnTrackHitData",
false);
4670 desc.addUntracked<
bool>(
"includeMVA",
true);
4671 desc.addUntracked<
bool>(
"includeTrackingParticles",
true);
4672 desc.addUntracked<
bool>(
"includeOOT",
false);
4673 desc.addUntracked<
bool>(
"keepEleSimHits",
false);
4674 desc.addUntracked<
bool>(
"saveSimHitsP3",
false);
4675 desc.addUntracked<
bool>(
"simHitBySignificance",
false);
4676 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< std::pair< unsigned int, edm::EDGetTokenT< Phase2OTMaskContainer > > > ph2OTUseMaskTokens_
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
key
prepare the HTCondor submission files and eventually submit them
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< uint64_t > ph2_usedMask
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