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;
275 auto idetset = digiSimLink.
find(detId);
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;
306 auto idetset = digiSimLink.
find(detId);
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); 721 detId.push_back(
id.rawId());
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 foundElectrons = 0;
2766 int foundNonElectrons = 0;
2767 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2772 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2775 foundNonElectrons++;
2785 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2790 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2791 foundElectron =
true;
2796 float sx = TPhit->localPosition().x();
2797 float sy = TPhit->localPosition().y();
2798 float dx =
sx - h_x;
2799 float dy =
sy - h_y;
2800 float sig = (
dx *
dx * h_yy - 2 *
dx *
dy * h_xy +
dy *
dy * h_xx) / (h_xx * h_yy - h_xy * h_xy);
2805 simHitKey = TPhit.
key();
2806 simHitID = TPhit.
id();
2811 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2812 ret.matchingSimHit.push_back(simHitIndex);
2814 double chargeFraction = 0.;
2815 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2816 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2817 if (
found != simTrackIdToChargeFraction.end()) {
2818 chargeFraction +=
found->second;
2822 ret.chargeFraction.push_back(chargeFraction);
2825 ret.bunchCrossing.push_back(
bx);
2829 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2832 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2837 if (
std::abs(TPhit->particleType()) == 11 &&
std::abs(trackingParticle->pdgId()) != 11) {
2838 foundElectron =
true;
2841 if (foundNonElectrons > 0)
2846 auto simHitKey = TPhit.
key();
2847 auto simHitID = TPhit.
id();
2849 auto simHitIndex = simHitRefKeyToIndex.at(std::make_pair(simHitKey, simHitID));
2850 ret.matchingSimHit.push_back(simHitIndex);
2852 double chargeFraction = 0.;
2853 for (
const SimTrack& simtrk : trackingParticle->g4Tracks()) {
2854 auto found = simTrackIdToChargeFraction.find(simtrk.trackId());
2855 if (
found != simTrackIdToChargeFraction.end()) {
2856 chargeFraction +=
found->second;
2860 ret.chargeFraction.push_back(chargeFraction);
2863 ret.bunchCrossing.push_back(
bx);
2867 simhit_hitType[simHitIndex].push_back(static_cast<int>(hitType));
2878 <<
"Did not find SimHit for reco hit DetId " << hitId.
rawId() <<
" for TP " << trackingParticle.
key()
2879 <<
" bx:event " <<
bx <<
":" <<
event <<
" PDGid " << trackingParticle->pdgId() <<
" q " 2880 << trackingParticle->charge() <<
" p4 " << trackingParticle->p4() <<
" nG4 " 2881 << trackingParticle->g4Tracks().size() <<
".\nFound SimHits from detectors ";
2882 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
2885 ex << dId.
rawId() <<
" ";
2887 if (trackingParticle->eventId().event() != 0) {
2888 ex <<
"\nSince this is a TrackingParticle from pileup, check that you're running the pileup mixing in " 2900 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
2903 SimHitRefKeyToIndex& simHitRefKeyToIndex,
2904 std::vector<TPHitIndex>& tpHitList) {
2905 for (
const auto&
assoc : simHitsTPAssoc) {
2906 auto tpKey =
assoc.first.key();
2910 auto found = tpKeyToIndex.find(tpKey);
2911 if (
found == tpKeyToIndex.end())
2913 const auto tpIndex =
found->second;
2916 const auto& simhit = *(
assoc.second);
2917 auto detId =
DetId(simhit.detUnitId());
2929 auto simHitKey = std::make_pair(
assoc.second.key(),
assoc.second.id());
2931 if (simHitRefKeyToIndex.find(simHitKey) != simHitRefKeyToIndex.end()) {
2932 for (
const auto& assoc2 : simHitsTPAssoc) {
2933 if (std::make_pair(assoc2.second.key(), assoc2.second.id()) == simHitKey) {
2935 auto range1 = std::equal_range(simHitsTPAssoc.begin(),
2936 simHitsTPAssoc.end(),
2939 auto range2 = std::equal_range(simHitsTPAssoc.begin(),
2940 simHitsTPAssoc.end(),
2944 LogTrace(
"TrackingNtuple") <<
"Earlier TP " << assoc2.first.key() <<
" SimTrack Ids";
2945 for (
const auto&
simTrack : assoc2.first->g4Tracks()) {
2947 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2949 for (
auto iHit = range2.first; iHit != range2.second; ++iHit) {
2950 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2951 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2952 << iHit->second->eventId().bunchCrossing() <<
":" 2953 << iHit->second->eventId().event();
2955 LogTrace(
"TrackingNtuple") <<
"Current TP " <<
assoc.first.key() <<
" SimTrack Ids";
2958 <<
simTrack.eventId().bunchCrossing() <<
":" <<
simTrack.eventId().event();
2960 for (
auto iHit = range1.first; iHit != range1.second; ++iHit) {
2961 LogTrace(
"TrackingNtuple") <<
" SimHit " << iHit->second.key() <<
" " << iHit->second.id() <<
" tof " 2962 << iHit->second->tof() <<
" trackId " << iHit->second->trackId() <<
" BX:event " 2963 << iHit->second->eventId().bunchCrossing() <<
":" 2964 << iHit->second->eventId().event();
2969 <<
"Got second time the SimHit " << simHitKey.first <<
" of " << simHitKey.second
2970 <<
", first time with TrackingParticle " << assoc2.first.key() <<
", now with " << tpKey;
2973 throw cms::Exception(
"LogicError") <<
"Got second time the SimHit " << simHitKey.first <<
" of " 2974 << simHitKey.second <<
", now with TrackingParticle " << tpKey
2975 <<
", but I didn't find the first occurrance!";
2978 auto det =
tracker.idToDetUnit(detId);
2980 throw cms::Exception(
"LogicError") <<
"Did not find a det unit for DetId " << simhit.detUnitId()
2981 <<
" from tracker geometry";
2983 const auto pos = det->surface().toGlobal(simhit.localPosition());
2984 const float tof = simhit.timeOfFlight();
2986 const auto simHitIndex =
simhit_x.size();
2987 simHitRefKeyToIndex[simHitKey] = simHitIndex;
2997 const auto mom = det->surface().toGlobal(simhit.momentumAtEntry());
3013 tpHitList.emplace_back(tpKey, simHitIndex, tof, simhit.detUnitId());
3020 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3024 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3025 std::set<edm::ProductID>& hitProductIds) {
3026 std::vector<std::pair<uint64_t, PixelMaskContainer const*>> pixelMasks;
3030 iEvent.getByToken(itoken.second, aH);
3031 pixelMasks.emplace_back(1 << itoken.first, aH.
product());
3033 auto pixUsedMask = [&pixelMasks](
size_t key) {
3035 for (
auto const&
m : pixelMasks) {
3036 if (
m.second->mask(
key))
3045 const DetId hitId = it->detId();
3046 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3047 hitProductIds.insert(
hit->cluster().
id());
3049 const int key =
hit->cluster().key();
3050 const int lay = tTopo.
layer(hitId);
3066 pix_x.push_back(
hit->globalPosition().
x());
3067 pix_y.push_back(
hit->globalPosition().
y());
3068 pix_z.push_back(
hit->globalPosition().
z());
3069 pix_xx.push_back(
hit->globalPositionError().cxx());
3070 pix_xy.push_back(
hit->globalPositionError().cyx());
3071 pix_yy.push_back(
hit->globalPositionError().cyy());
3072 pix_yz.push_back(
hit->globalPositionError().czy());
3073 pix_zz.push_back(
hit->globalPositionError().czz());
3074 pix_zx.push_back(
hit->globalPositionError().czx());
3075 pix_radL.push_back(
hit->surface()->mediumProperties().radLen());
3076 pix_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3081 LogTrace(
"TrackingNtuple") <<
"pixHit cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3082 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3092 simHitRefKeyToIndex,
3101 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3107 <<
" event=" << simHitData.
event[0];
3117 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3121 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3122 std::set<edm::ProductID>& hitProductIds) {
3123 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3127 iEvent.getByToken(itoken.second, aH);
3128 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3130 auto strUsedMask = [&stripMasks](
size_t key) {
3132 for (
auto const&
m : stripMasks) {
3133 if (
m.second->mask(
key))
3162 str_x.resize(totalStripHits);
3163 str_y.resize(totalStripHits);
3164 str_z.resize(totalStripHits);
3165 str_xx.resize(totalStripHits);
3166 str_xy.resize(totalStripHits);
3167 str_yy.resize(totalStripHits);
3168 str_yz.resize(totalStripHits);
3169 str_zz.resize(totalStripHits);
3170 str_zx.resize(totalStripHits);
3180 for (
const auto& detset :
hits) {
3181 const DetId hitId = detset.detId();
3182 for (
const auto&
hit : detset) {
3183 hitProductIds.insert(
hit.cluster().
id());
3185 const int key =
hit.cluster().key();
3186 const int lay = tTopo.
layer(hitId);
3204 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit.globalPosition();
3215 simHitRefKeyToIndex,
3224 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3232 <<
" event=" << simHitData.
event[0];
3239 fill(*rphiHits,
"stripRPhiHit");
3240 fill(*stereoHits,
"stripStereoHit");
3246 const std::vector<std::pair<uint64_t, StripMaskContainer const*>>& stripMasks,
3247 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3248 auto strUsedMask = [&stripMasks](
size_t key) {
3250 for (
auto const&
m : stripMasks) {
3251 if (
m.second->mask(
key))
3257 const auto hitId =
hit.geographicalId();
3258 const int lay = tTopo.
layer(hitId);
3259 monoStereoClusterList.emplace_back(
hit.monoHit().cluster().key(),
hit.stereoHit().cluster().key());
3265 glu_x.push_back(
hit.globalPosition().
x());
3266 glu_y.push_back(
hit.globalPosition().
y());
3267 glu_z.push_back(
hit.globalPosition().
z());
3268 glu_xx.push_back(
hit.globalPositionError().cxx());
3269 glu_xy.push_back(
hit.globalPositionError().cyx());
3270 glu_yy.push_back(
hit.globalPositionError().cyy());
3271 glu_yz.push_back(
hit.globalPositionError().czy());
3272 glu_zz.push_back(
hit.globalPositionError().czz());
3273 glu_zx.push_back(
hit.globalPositionError().czx());
3274 glu_radL.push_back(
hit.surface()->mediumProperties().radLen());
3275 glu_bbxi.push_back(
hit.surface()->mediumProperties().xi());
3281 LogTrace(
"TrackingNtuple") <<
"stripMatchedHit" 3282 <<
" cluster0=" <<
hit.stereoHit().cluster().key()
3283 <<
" cluster1=" <<
hit.monoHit().cluster().key() <<
" subdId=" << hitId.subdetId()
3284 <<
" lay=" << lay <<
" rawId=" << hitId.rawId() <<
" pos =" <<
hit.globalPosition();
3291 std::vector<std::pair<int, int>>& monoStereoClusterList) {
3292 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3296 iEvent.getByToken(itoken.second, aH);
3297 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3302 for (
auto it = matchedHits->
begin(); it != matchedHits->
end(); it++) {
3303 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3312 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3316 const SimHitRefKeyToIndex& simHitRefKeyToIndex,
3317 std::set<edm::ProductID>& hitProductIds) {
3320 for (
auto it = phase2OTHits->
begin(); it != phase2OTHits->
end(); it++) {
3321 const DetId hitId = it->detId();
3322 for (
auto hit = it->begin();
hit != it->end();
hit++) {
3323 hitProductIds.insert(
hit->cluster().
id());
3325 const int key =
hit->cluster().key();
3326 const int lay = tTopo.
layer(hitId);
3342 ph2_x.push_back(
hit->globalPosition().
x());
3343 ph2_y.push_back(
hit->globalPosition().
y());
3344 ph2_z.push_back(
hit->globalPosition().
z());
3345 ph2_xx.push_back(
hit->globalPositionError().cxx());
3346 ph2_xy.push_back(
hit->globalPositionError().cyx());
3347 ph2_yy.push_back(
hit->globalPositionError().cyy());
3348 ph2_yz.push_back(
hit->globalPositionError().czy());
3349 ph2_zz.push_back(
hit->globalPositionError().czz());
3350 ph2_zx.push_back(
hit->globalPositionError().czx());
3351 ph2_radL.push_back(
hit->surface()->mediumProperties().radLen());
3352 ph2_bbxi.push_back(
hit->surface()->mediumProperties().xi());
3354 LogTrace(
"TrackingNtuple") <<
"phase2 OT cluster=" <<
key <<
" subdId=" << hitId.
subdetId() <<
" lay=" << lay
3355 <<
" rawId=" << hitId.
rawId() <<
" pos =" <<
hit->globalPosition();
3366 simHitRefKeyToIndex,
3374 LogTrace(
"TrackingNtuple") <<
" firstMatchingSimHit=" << simHitIdx <<
" simHitPos=" 3380 <<
" event=" << simHitData.
event[0];
3389 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3396 std::vector<std::pair<int, int>>& monoStereoClusterList,
3397 const std::set<edm::ProductID>& hitProductIds,
3398 std::map<edm::ProductID, size_t>& seedCollToOffset) {
3400 for (
size_t iColl = 0; iColl <
seedTokens_.size(); ++iColl) {
3404 iEvent.getByToken(seedToken, seedTracksHandle);
3415 iEvent.getByToken(seedStopInfoToken, seedStopInfoHandle);
3416 const auto& seedStopInfos = *seedStopInfoHandle;
3417 if (
seedTracks.size() != seedStopInfos.size()) {
3422 <<
" seed stopping infos for collections " <<
labels.module <<
", " 3426 std::vector<std::pair<uint64_t, StripMaskContainer const*>> stripMasks;
3430 iEvent.getByToken(itoken.second, aH);
3431 stripMasks.emplace_back(1 << itoken.first, aH.
product());
3444 label.ReplaceAll(
"seedTracks",
"");
3445 label.ReplaceAll(
"Seeds",
"");
3446 label.ReplaceAll(
"muonSeeded",
"muonSeededStep");
3448 label.ReplaceAll(
"FromPixelTracks",
"");
3449 label.ReplaceAll(
"PFLowPixel",
"");
3450 label.ReplaceAll(
"hltDoubletRecovery",
"pixelPairStep");
3455 auto inserted = seedCollToOffset.emplace(
id,
offset);
3456 if (!inserted.second)
3458 <<
"Trying to add seeds with ProductID " <<
id <<
" for a second time from collection " <<
labels.module
3459 <<
", seed algo " <<
label <<
". Typically this is caused by a configuration problem.";
3463 <<
" ProductID " <<
id;
3465 for (
size_t iSeed = 0; iSeed < seedTrackRefs.
size(); ++iSeed) {
3466 const auto& seedTrackRef = seedTrackRefs[iSeed];
3467 const auto& seedTrack = *seedTrackRef;
3468 const auto& seedRef = seedTrack.seedRef();
3469 const auto&
seed = *seedRef;
3471 const auto seedStopInfo = seedStopInfos[iSeed];
3473 if (seedRef.id() !=
id)
3475 <<
"All tracks in 'TracksFromSeeds' collection should point to seeds in the same collection. Now the " 3476 "element 0 had ProductID " 3477 <<
id <<
" while the element " << seedTrackRef.key() <<
" had " << seedTrackRef.id()
3478 <<
". The source collection is " <<
labels.module <<
".";
3480 std::vector<int> tpIdx;
3481 std::vector<float> sharedFraction;
3482 auto foundTPs = recSimColl.
find(seedTrackRef);
3483 if (foundTPs != recSimColl.
end()) {
3484 for (
const auto& tpQuality : foundTPs->val) {
3485 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3486 sharedFraction.push_back(tpQuality.second);
3491 const int nHits = seedTrack.numberOfValidHits();
3493 seedTrack.recHitsBegin(),
3494 seedTrack.recHitsEnd());
3496 const auto bestKeyCount = findBestMatchingTrackingParticle(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3497 const float bestShareFrac =
3498 nClusters > 0 ?
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3500 const auto bestFirstHitKeyCount =
3501 findMatchingTrackingParticleFromFirstHit(seedTrack.recHits(), clusterToTPMap, tpKeyToIndex);
3502 const float bestFirstHitShareFrac =
3503 nClusters > 0 ?
static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters) : 0;
3506 const int charge = seedTrack.charge();
3507 const float pt = seedFitOk ? seedTrack.pt() : 0;
3508 const float eta = seedFitOk ? seedTrack.eta() : 0;
3509 const float phi = seedFitOk ? seedTrack.phi() : 0;
3511 const auto seedIndex =
see_fitok.size();
3515 see_px.push_back(seedFitOk ? seedTrack.px() : 0);
3516 see_py.push_back(seedFitOk ? seedTrack.py() : 0);
3517 see_pz.push_back(seedFitOk ? seedTrack.pz() : 0);
3524 see_dxy.push_back(seedFitOk ? seedTrack.dxy(
bs.position()) : 0);
3525 see_dz.push_back(seedFitOk ? seedTrack.dz(
bs.position()) : 0);
3526 see_ptErr.push_back(seedFitOk ? seedTrack.ptError() : 0);
3527 see_etaErr.push_back(seedFitOk ? seedTrack.etaError() : 0);
3528 see_phiErr.push_back(seedFitOk ? seedTrack.phiError() : 0);
3529 see_dxyErr.push_back(seedFitOk ? seedTrack.dxyError() : 0);
3530 see_dzErr.push_back(seedFitOk ? seedTrack.dzError() : 0);
3533 see_nCands.push_back(seedStopInfo.candidatesPerSeed());
3535 const auto&
state = seedTrack.seedRef()->startingState();
3536 const auto&
pos =
state.parameters().position();
3537 const auto& mom =
state.parameters().momentum();
3558 std::vector<float> cov(15);
3559 auto covP = cov.begin();
3560 for (
auto const val : stateCcov)
3570 see_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3572 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
3591 std::vector<int> hitIdx;
3592 std::vector<int> hitType;
3594 for (
auto const&
hit :
seed.recHits()) {
3595 int subid =
hit.geographicalId().subdetId();
3601 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3604 hitIdx.push_back(clusterKey);
3617 std::vector<std::pair<int, int>>::iterator
pos =
3618 find(monoStereoClusterList.begin(), monoStereoClusterList.end(), std::make_pair(monoIdx, stereoIdx));
3619 size_t gluedIndex = -1;
3620 if (
pos != monoStereoClusterList.end()) {
3632 hitIdx.push_back(gluedIndex);
3637 unsigned int clusterKey;
3638 if (clusterRef.isPhase2()) {
3641 clusterKey = clusterRef.cluster_strip().key();
3645 checkProductID(hitProductIds, clusterRef.id(),
"seed");
3646 if (clusterRef.isPhase2()) {
3653 hitIdx.push_back(clusterKey);
3654 if (clusterRef.isPhase2()) {
3661 LogTrace(
"TrackingNtuple") <<
" not pixel and not Strip detector";
3674 auto const recHit0 =
seed.recHits().begin();
3675 auto const recHit1 =
seed.recHits().begin() + 1;
3676 std::vector<GlobalPoint>
gp(2);
3677 std::vector<GlobalError> ge(2);
3678 gp[0] = recHit0->globalPosition();
3679 ge[0] = recHit0->globalPositionError();
3680 gp[1] = recHit1->globalPosition();
3681 ge[1] = recHit1->globalPositionError();
3683 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3684 <<
" - PAIR - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3685 <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" trans0: " 3686 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3689 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3692 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3695 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3697 <<
" eta,phi: " <<
gp[0].
eta() <<
"," <<
gp[0].phi();
3698 }
else if (
nHits == 3) {
3699 auto const recHit0 =
seed.recHits().begin();
3700 auto const recHit1 =
seed.recHits().begin() + 1;
3701 auto const recHit2 =
seed.recHits().begin() + 2;
3705 gp[0] = recHit0->globalPosition();
3706 ge[0] = recHit0->globalPositionError();
3707 int subid0 = recHit0->geographicalId().subdetId();
3710 gp[1] = recHit1->globalPosition();
3711 ge[1] = recHit1->globalPositionError();
3712 int subid1 = recHit1->geographicalId().subdetId();
3715 gp[2] = recHit2->globalPosition();
3716 ge[2] = recHit2->globalPositionError();
3717 int subid2 = recHit2->geographicalId().subdetId();
3721 float seed_chi2 = rzLine.
chi2();
3725 <<
"seed " << seedTrackRef.key() <<
" pt=" <<
pt <<
" eta=" <<
eta <<
" phi=" <<
phi <<
" q=" <<
charge 3726 <<
" - TRIPLET - ids: " << recHit0->geographicalId().rawId() <<
" " << recHit1->geographicalId().rawId()
3727 <<
" " << recHit2->geographicalId().rawId() <<
" hitpos: " <<
gp[0] <<
" " <<
gp[1] <<
" " <<
gp[2]
3729 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[0]->globalPosition()
3732 << (recHit0->transientHits().size() > 1 ? recHit0->transientHits()[1]->globalPosition()
3735 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[0]->globalPosition()
3738 << (recHit1->transientHits().size() > 1 ? recHit1->transientHits()[1]->globalPosition()
3741 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[0]->globalPosition()
3744 << (recHit2->transientHits().size() > 1 ? recHit2->transientHits()[1]->globalPosition()
3747 << recHit2->localPosition()
3749 <<
" eta,phi: " <<
gp[0].eta() <<
"," <<
gp[0].phi() <<
" pt,chi2: " << seed_pt <<
"," << seed_chi2;
3762 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
3763 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
3770 const std::set<edm::ProductID>& hitProductIds,
3771 const std::map<edm::ProductID, size_t>& seedCollToOffset,
3772 const std::vector<const MVACollection*>& mvaColls,
3773 const std::vector<const QualityMaskCollection*>& qualColls) {
3777 LogTrace(
"TrackingNtuple") <<
"NEW TRACK LABEL: " <<
labels.module;
3779 auto pvPosition =
vertices[0].position();
3781 for (
size_t iTrack = 0; iTrack <
tracks.size(); ++iTrack) {
3782 const auto& itTrack =
tracks[iTrack];
3783 int charge = itTrack->charge();
3784 float pt = itTrack->pt();
3785 float eta = itTrack->eta();
3786 const double lambda = itTrack->lambda();
3787 float chi2 = itTrack->normalizedChi2();
3788 float ndof = itTrack->ndof();
3789 float phi = itTrack->phi();
3790 int nHits = itTrack->numberOfValidHits();
3793 const auto& tkParam = itTrack->parameters();
3794 auto tkCov = itTrack->covariance();
3799 bool isSimMatched =
false;
3800 std::vector<int> tpIdx;
3801 std::vector<float> sharedFraction;
3802 std::vector<float> tpChi2;
3803 auto foundTPs = recSimColl.
find(itTrack);
3804 if (foundTPs != recSimColl.
end()) {
3805 if (!foundTPs->val.empty()) {
3806 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
3807 isSimMatched =
true;
3809 for (
const auto& tpQuality : foundTPs->val) {
3810 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
3811 sharedFraction.push_back(tpQuality.second);
3818 itTrack->recHitsBegin(),
3819 itTrack->recHitsEnd());
3822 const auto bestKeyCount = findBestMatchingTrackingParticle(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3823 const float bestShareFrac =
static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(
nClusters);
3824 float bestShareFracSimDenom = 0;
3825 float bestShareFracSimClusterDenom = 0;
3826 float bestChi2 = -1;
3827 if (bestKeyCount.key >= 0) {
3828 bestShareFracSimDenom =
3829 static_cast<float>(bestKeyCount.countClusters) /
3830 static_cast<float>(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits());
3831 bestShareFracSimClusterDenom =
3832 static_cast<float>(bestKeyCount.countClusters) / static_cast<float>(tpKeyToClusterCount.at(bestKeyCount.key));
3834 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
3837 const auto bestFirstHitKeyCount =
3838 findMatchingTrackingParticleFromFirstHit(itTrack->recHits(), clusterToTPMap, tpKeyToIndex);
3839 const float bestFirstHitShareFrac =
3840 static_cast<float>(bestFirstHitKeyCount.countClusters) / static_cast<float>(
nClusters);
3841 float bestFirstHitShareFracSimDenom = 0;
3842 float bestFirstHitShareFracSimClusterDenom = 0;
3843 float bestFirstHitChi2 = -1;
3844 if (bestFirstHitKeyCount.key >= 0) {
3845 bestFirstHitShareFracSimDenom =
3846 static_cast<float>(bestFirstHitKeyCount.countClusters) /
3847 static_cast<float>(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits());
3848 bestFirstHitShareFracSimClusterDenom =
static_cast<float>(bestFirstHitKeyCount.countClusters) /
3849 static_cast<float>(tpKeyToClusterCount.at(bestFirstHitKeyCount.key));
3851 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
3854 float chi2_1Dmod =
chi2;
3855 int count1dhits = 0;
3856 for (
auto iHit = itTrack->recHitsBegin(), iEnd = itTrack->recHitsEnd(); iHit != iEnd; ++iHit) {
3861 if (count1dhits > 0) {
3862 chi2_1Dmod = (
chi2 + count1dhits) / (
ndof + count1dhits);
3867 trk_px.push_back(itTrack->px());
3868 trk_py.push_back(itTrack->py());
3869 trk_pz.push_back(itTrack->pz());
3874 trk_inner_pt.push_back(itTrack->innerMomentum().rho());
3878 trk_outer_pt.push_back(itTrack->outerMomentum().rho());
3883 trk_dxy.push_back(itTrack->dxy(
bs.position()));
3884 trk_dz.push_back(itTrack->dz(
bs.position()));
3885 trk_dxyPV.push_back(itTrack->dxy(pvPosition));
3886 trk_dzPV.push_back(itTrack->dz(pvPosition));
3889 trk_ptErr.push_back(itTrack->ptError());
3894 trk_dzErr.push_back(itTrack->dzError());
3913 trk_n3DLay.push_back(
hp.numberOfValidStripLayersWithMonoAndStereo() +
hp.pixelLayersWithMeasurement());
3916 trk_algo.push_back(itTrack->algo());
3923 trk_mvas[
i].push_back((*(mvaColls[
i]))[iTrack]);
3928 auto offset = seedCollToOffset.find(itTrack->seedRef().id());
3929 if (
offset == seedCollToOffset.end()) {
3933 << itTrack->seedRef().id()
3934 <<
", but that seed collection is not given as an input. The following collections were given as an input " 3935 << make_ProductIDMapPrinter(seedCollToOffset);
3938 const auto seedIndex =
offset->second + itTrack->seedRef().key();
3941 throw cms::Exception(
"LogicError") <<
"Track index has already been set for seed " << seedIndex <<
" to " 3942 <<
see_trkIdx[seedIndex] <<
"; was trying to set it to " << iTrack;
3951 trk_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
3966 LogTrace(
"TrackingNtuple") <<
"Track #" << itTrack.key() <<
" with q=" <<
charge <<
", pT=" <<
pt 3967 <<
" GeV, eta: " <<
eta <<
", phi: " <<
phi <<
", chi2=" <<
chi2 <<
", Nhits=" <<
nHits 3968 <<
", algo=" << itTrack->algoName(itTrack->algo()).c_str()
3970 <<
" seed#=" << itTrack->seedRef().key() <<
" simMatch=" << isSimMatched
3971 <<
" nSimHits=" << nSimHits
3972 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
3973 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
3974 std::vector<int> hitIdx;
3975 std::vector<int> hitType;
3977 for (
auto i = itTrack->recHitsBegin();
i != itTrack->recHitsEnd();
i++) {
3979 DetId hitId =
hit->geographicalId();
3987 if (
hit->isValid()) {
3991 unsigned int clusterKey;
3992 if (clusterRef.isPixel()) {
3994 }
else if (clusterRef.isPhase2()) {
3995 clusterKey = clusterRef.cluster_phase2OT().key();
3997 clusterKey = clusterRef.cluster_strip().key();
4000 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4001 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4002 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4004 checkProductID(hitProductIds, clusterRef.id(),
"track");
4005 if (clusterRef.isPixel()) {
4016 }
else if (clusterRef.isPhase2()) {
4041 hitIdx.push_back(clusterKey);
4042 if (clusterRef.isPixel()) {
4044 }
else if (clusterRef.isPhase2()) {
4050 LogTrace(
"TrackingNtuple") <<
" - invalid hit";
4072 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4073 const TrackingParticleRefKeyToCount& tpKeyToClusterCount,
4081 const std::set<edm::ProductID>& hitProductIds,
4082 const std::map<edm::ProductID, size_t>& seedCollToOffset) {
4087 auto const&
cands = *candsHandle;
4088 for (
size_t iCand = 0; iCand <
cands.size(); ++iCand) {
4089 const auto& aCand =
cands[iCand];
4093 auto const& pState = aCand.trajectoryStateOnDet();
4097 if (!tbStateAtPCA.
isValid()) {
4098 edm::LogVerbatim(
"TrackBuilding") <<
"TrajectoryStateClosestToBeamLine not valid";
4102 auto v0 = stateAtPCA.position();
4103 auto p = stateAtPCA.momentum();
4110 0, 0,
pos, mom, stateAtPCA.charge(), tbStateAtPCA.
isValid() ? stateAtPCA.curvilinearError().matrix() : dummyCov);
4113 auto tkCov = trk.covariance();
4118 bool isSimMatched =
false;
4119 std::vector<int> tpIdx;
4120 std::vector<float> sharedFraction;
4121 std::vector<float> tpChi2;
4122 auto foundTPs = recSimColl.
find(aCandRef);
4123 if (foundTPs != recSimColl.
end()) {
4124 if (!foundTPs->val.empty()) {
4125 nSimHits = foundTPs->
val[0].first->numberOfTrackerHits();
4126 isSimMatched =
true;
4128 for (
const auto& tpQuality : foundTPs->val) {
4129 tpIdx.push_back(tpKeyToIndex.at(tpQuality.first.key()));
4130 sharedFraction.push_back(tpQuality.second);
4139 const auto bestKeyCount = findBestMatchingTrackingParticle(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4140 const float bestCountF = bestKeyCount.countClusters;
4141 const float bestShareFrac = bestCountF /
nClusters;
4142 float bestShareFracSimDenom = 0;
4143 float bestShareFracSimClusterDenom = 0;
4144 float bestChi2 = -1;
4145 if (bestKeyCount.key >= 0) {
4146 bestShareFracSimDenom = bestCountF / tpCollection[tpKeyToIndex.at(bestKeyCount.key)]->numberOfTrackerHits();
4147 bestShareFracSimClusterDenom = bestCountF / tpKeyToClusterCount.
at(bestKeyCount.key);
4149 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestKeyCount.key)]), mf,
bs);
4152 const auto bestFirstHitKeyCount =
4153 findMatchingTrackingParticleFromFirstHit(aCand.recHits(), clusterToTPMap, tpKeyToIndex);
4154 const float bestFirstCountF = bestFirstHitKeyCount.countClusters;
4155 const float bestFirstHitShareFrac = bestFirstCountF /
nClusters;
4156 float bestFirstHitShareFracSimDenom = 0;
4157 float bestFirstHitShareFracSimClusterDenom = 0;
4158 float bestFirstHitChi2 = -1;
4159 if (bestFirstHitKeyCount.key >= 0) {
4160 bestFirstHitShareFracSimDenom =
4161 bestFirstCountF / tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]->numberOfTrackerHits();
4162 bestFirstHitShareFracSimClusterDenom = bestFirstCountF / tpKeyToClusterCount.
at(bestFirstHitKeyCount.key);
4164 tkParam, tkCov, *(tpCollection[tpKeyToIndex.at(bestFirstHitKeyCount.key)]), mf,
bs);
4191 auto const& pStateCov =
state.curvilinearError().matrix();
4202 for (
auto const&
hit : aCand.recHits()) {
4203 if (
hit.isValid()) {
4207 auto const subdet =
hit.geographicalId().subdetId();
4215 tcand_q.push_back(trk.charge());
4223 auto offset = seedCollToOffset.find(aCand.seedRef().id());
4224 if (
offset == seedCollToOffset.end()) {
4226 <<
"Track candidate refers to seed collection " << aCand.seedRef().id()
4227 <<
", but that seed collection is not given as an input. The following collections were given as an input " 4228 << make_ProductIDMapPrinter(seedCollToOffset);
4231 const auto seedIndex =
offset->second + aCand.seedRef().key();
4235 <<
"Track cand index has already been set for seed " << seedIndex <<
" to " <<
see_tcandIdx[seedIndex]
4236 <<
"; was trying to set it to " << iglobCand <<
" current " << iCand;
4245 tcand_bestSimTrkIdx.push_back(bestKeyCount.key >= 0 ? tpKeyToIndex.at(bestKeyCount.key) : -1);
4247 bestFirstHitKeyCount.key >= 0 ? tpKeyToIndex.at(bestFirstHitKeyCount.key) : -1);
4260 LogTrace(
"TrackingNtuple") <<
"Track cand #" << iCand <<
" glob " << iglobCand <<
" with q=" << trk.charge()
4261 <<
", pT=" << trk.pt() <<
" GeV, eta: " << trk.eta() <<
", phi: " << trk.phi()
4262 <<
", nValid=" << nValid <<
" seed#=" << aCand.seedRef().key()
4263 <<
" simMatch=" << isSimMatched <<
" nSimHits=" << nSimHits
4264 <<
" sharedFraction=" << (sharedFraction.empty() ? -1 : sharedFraction[0])
4265 <<
" tpIdx=" << (tpIdx.empty() ? -1 : tpIdx[0]);
4266 std::vector<int> hitIdx;
4267 std::vector<int> hitType;
4269 for (
auto i = aCand.recHits().begin();
i != aCand.recHits().end();
i++) {
4271 DetId hitId =
hit->geographicalId();
4279 if (
hit->isValid()) {
4283 unsigned int clusterKey;
4284 if (clusterRef.isPixel()) {
4286 }
else if (clusterRef.isPhase2()) {
4287 clusterKey = clusterRef.cluster_phase2OT().key();
4289 clusterKey = clusterRef.cluster_strip().key();
4292 LogTrace(
"TrackingNtuple") <<
" id: " << hitId.
rawId() <<
" - globalPos =" <<
hit->globalPosition()
4293 <<
" cluster=" << clusterKey <<
" clusterRef ID=" << clusterRef.
id()
4294 <<
" eta,phi: " <<
hit->globalPosition().eta() <<
"," <<
hit->globalPosition().phi();
4296 checkProductID(hitProductIds, clusterRef.id(),
"track");
4297 if (clusterRef.isPixel()) {
4299 }
else if (clusterRef.isPhase2()) {
4306 hitIdx.push_back(clusterKey);
4307 if (clusterRef.isPixel()) {
4309 }
else if (clusterRef.isPhase2()) {
4327 const TrackingVertexRefKeyToIndex& tvKeyToIndex,
4329 const std::vector<TPHitIndex>& tpHitList,
4330 const TrackingParticleRefKeyToCount& tpKeyToClusterCount) {
4334 const auto& nLayers_tPCeff = *tpNLayersH;
4337 const auto& nPixelLayers_tPCeff = *tpNLayersH;
4340 const auto& nStripMonoAndStereoLayers_tPCeff = *tpNLayersH;
4345 LogTrace(
"TrackingNtuple") <<
"tracking particle pt=" <<
tp->pt() <<
" eta=" <<
tp->eta() <<
" phi=" <<
tp->phi();
4346 bool isRecoMatched =
false;
4347 std::vector<int> tkIdx;
4348 std::vector<float> sharedFraction;
4349 auto foundTracks = simRecColl.
find(
tp);
4350 if (foundTracks != simRecColl.
end()) {
4351 isRecoMatched =
true;
4359 for (
const auto& genRef :
tp->genParticles()) {
4360 if (genRef.isNonnull())
4364 bool isFromBHadron =
false;
4369 for (
const auto& particle : recoGenParticleTrail) {
4372 isFromBHadron =
true;
4378 LogTrace(
"TrackingNtuple") <<
"matched to tracks = " << make_VectorPrinter(tkIdx)
4379 <<
" isRecoMatched=" << isRecoMatched;
4390 sim_q.push_back(
tp->charge());
4394 std::vector<int> decayIdx;
4395 for (
const auto&
v :
tp->decayVertices())
4396 decayIdx.push_back(tvKeyToIndex.at(
v.key()));
4404 const double lambdaSim =
M_PI / 2 - momentum.theta();
4413 std::vector<int> hitIdx;
4414 int nPixel = 0, nStrip = 0;
4416 for (
auto ip = rangeHit.first; ip != rangeHit.second; ++ip) {
4420 LogTrace(
"TrackingNtuple") <<
"simhit=" << ip->simHitIdx <<
" type=" <<
static_cast<int>(
type);
4421 hitIdx.push_back(ip->simHitIdx);
4424 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4425 << detid.rawId() <<
" whose det() is not Tracker but " << detid.det();
4427 const auto subdet = detid.subdetId();
4440 throw cms::Exception(
"LogicError") <<
"Encountered SimHit for TP " <<
tp.key() <<
" with DetId " 4441 << detid.rawId() <<
" whose subdet is not recognized, is " << subdet;
4448 const auto nSimLayers = nLayers_tPCeff[
tp];
4449 const auto nSimPixelLayers = nPixelLayers_tPCeff[
tp];
4450 const auto nSimStripMonoAndStereoLayers = nStripMonoAndStereoLayers_tPCeff[
tp];
4453 sim_n3DLay.push_back(nSimPixelLayers + nSimStripMonoAndStereoLayers);
4456 auto found = tpKeyToClusterCount.find(
tp.key());
4466 const TrackingParticleRefKeyToIndex& tpKeyToIndex,
4467 const unsigned int seedOffset) {
4471 for (
const auto& keyVal : simRecColl) {
4472 const auto& tpRef = keyVal.key;
4473 auto found = tpKeyToIndex.find(tpRef.key());
4474 if (
found == tpKeyToIndex.end())
4475 throw cms::Exception(
"Assert") << __FILE__ <<
":" << __LINE__ <<
" fillTrackingParticlesForSeeds: tpRef.key() " 4476 << tpRef.key() <<
" not found from tpKeyToIndex. tpKeyToIndex size " 4477 << tpKeyToIndex.size();
4478 const auto tpIndex =
found->second;
4479 for (
const auto& pair : keyVal.val) {
4480 const auto& seedRef = pair.first->seedRef();
4481 sim_seedIdx[tpIndex].push_back(seedOffset + seedRef.key());
4488 for (
size_t iVertex = 0,
size =
vertices.size(); iVertex <
size; ++iVertex) {
4501 std::vector<int> trkIdx;
4502 for (
auto iTrack =
vertex.tracks_begin(); iTrack !=
vertex.tracks_end(); ++iTrack) {
4504 if (iTrack->id() !=
tracks.id())
4507 trkIdx.push_back(iTrack->key());
4510 throw cms::Exception(
"LogicError") <<
"Vertex index has already been set for track " << iTrack->key() <<
" to " 4511 <<
trk_vtxIdx[iTrack->key()] <<
"; was trying to set it to " << iVertex;
4520 const TrackingParticleRefKeyToIndex& tpKeyToIndex) {
4521 int current_event = -1;
4522 for (
const auto& ref : trackingVertices) {
4524 if (
v.eventId().event() != current_event) {
4526 current_event =
v.eventId().event();
4531 if (!
v.g4Vertices().empty()) {
4532 processType =
v.g4Vertices()[0].processType();
4544 for (
const auto& tpRef : tps) {
4545 auto found = tpKeyToIndex.find(tpRef.key());
4546 if (
found != tpKeyToIndex.end()) {
4552 std::vector<int> sourceIdx;
4553 std::vector<int> daughterIdx;
4554 fill(
v.sourceTracks(), sourceIdx);
4555 fill(
v.daughterTracks(), daughterIdx);
4567 desc.addUntracked<std::vector<edm::InputTag>>(
4569 std::vector<edm::InputTag>{
edm::InputTag(
"seedTracksinitialStepSeeds"),
4579 desc.addUntracked<std::vector<edm::InputTag>>(
4581 std::vector<edm::InputTag>{
edm::InputTag(
"initialStepTrackCandidates"),
4592 desc.addUntracked<std::vector<std::string>>(
"trackMVAs", std::vector<std::string>{{
"generalTracks"}});
4597 std::vector<edm::ParameterSet> cMasks;
4602 cMasks.push_back(ps);
4613 desc.addVPSetUntracked(
"clusterMasks", cMaskDesc, cMasks);
4616 desc.addUntracked<
bool>(
"trackingParticlesRef",
false);
4632 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"trackerLayers"));
4634 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"pixelLayers"));
4636 edm::InputTag(
"trackingParticleNumberOfLayersProducer",
"stripStereoLayers"));
4638 ->setComment(
"currently not used: keep for possible future use");
4639 desc.addUntracked<
bool>(
"includeSeeds",
false);
4640 desc.addUntracked<
bool>(
"includeTrackCandidates",
false);
4641 desc.addUntracked<
bool>(
"addSeedCurvCov",
false);
4642 desc.addUntracked<
bool>(
"includeAllHits",
false);
4643 desc.addUntracked<
bool>(
"includeOnTrackHitData",
false);
4644 desc.addUntracked<
bool>(
"includeMVA",
true);
4645 desc.addUntracked<
bool>(
"includeTrackingParticles",
true);
4646 desc.addUntracked<
bool>(
"includeOOT",
false);
4647 desc.addUntracked<
bool>(
"keepEleSimHits",
false);
4648 desc.addUntracked<
bool>(
"saveSimHitsP3",
false);
4649 desc.addUntracked<
bool>(
"simHitBySignificance",
false);
4650 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
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
std::string to_string(const V &value)
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
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
bool getData(T &iHolder) const
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
auto const & tracks
cannot be loose
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
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ uint32_t const *__restrict__ gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell const int32_t nHits
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
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