|
ATLAS Offline Software
|
Go to the documentation of this file.
23 #include "CLHEP/Geometry/Point3D.h"
43 static void extract(std::vector<const RIO_OnTrack*>& rots,
const std::vector<const MeasurementBase*>& measurements);
82 std::stringstream
out;
83 for (
unsigned int stype_i=0; stype_i <
kNSummaryTypes; ++stype_i ) {
104 m_TrackCollectionKey (std::move(TrackCollectionKey)),
105 m_TrackTruthCollectionKey (std::move(TrackTruthCollectionKey)),
106 m_truthMissing (false),
107 m_careAboutTruth (careAboutTruth)
120 std::vector <const Trk::Track *> & rec,
121 const std::vector <std::pair<HepMC::ConstGenParticlePtr,int> > &
gen,
127 bool useTrackSummary,
128 const unsigned int * inTimeStart,
129 const unsigned int * inTimeEnd)
const
134 recoToTruthMap::const_iterator imap;
141 int recoClassification = 0;
142 bool truth_missing=
false;
148 std::bitset<Trk::TrackInfo::NumberOfTrackRecoInfo> reco_info;
149 std::bitset<Trk::TrackInfo::NumberOfTrackProperties> pattern_properties;
156 recoClassification = -999;
157 int thisEventIndex = -999;
161 author_found[
Author] =
true;
162 reco_info |=
track->info().patternRecognition();
163 pattern_properties |=
track->info().properties();
172 Eta = std::abs(para->
eta());
185 TrackTruthCollection::const_iterator
found;
199 found = truthMap->find(tracklink2);
200 if(!(
found == truthMap->end())){
201 trtruth=
found->second;
204 rttMap.insert(std::pair<HepMcParticleLink,float>(hmpl,trtruth.
probability()));
217 if (thisEventIndex==0)
225 std::unique_ptr<Trk::TrackSummary> cleanup;
228 if (useTrackSummary) {
229 if (!
track->trackSummary()) {
246 if (
found == truthMap->end()) {
275 if (thisEventIndex==0)
285 if (thisEventIndex==0)
316 rio = &comprot->
rioOnTrack(comprot->indexOfMaxAssignProb());
336 bool part_type_for_all=
true;
337 if (idHelper->
is_trt(
id)){
340 else if (idHelper->
is_sct(
id)){
348 case 4:
case 5:
case 6:
case 7:
case 8: HitLayer =
HIT_SCT5TO9;
break;
354 part_type_for_all=
false;
377 hits.m_counter[part_type][HitLayer][
Region]++;
391 int classification=-999;
392 for (
auto truth =
gen.begin(); truth !=
gen.end(); ++truth) {
394 bool inTimePileup = truth->second == 0 || (truth->second >= (
int)*inTimeStart && truth->second <= (
int)*inTimeEnd);
399 Eta = std::abs(
particle->momentum().pseudoRapidity());
432 if(rttIter != rttMap.end()){
433 for(imap = rttMap.lower_bound(hmpl2); imap !=rttMap.upper_bound(hmpl2); ++imap){
478 for (
auto truth =
gen.begin(); truth !=
gen.end(); ++truth)
480 if (truth->second != 0)
488 Eta = std::abs(
particle->momentum().pseudoRapidity());
519 if(rttIter != rttMap.end()){
520 for(imap = rttMap.lower_bound(hmpl2); imap !=rttMap.upper_bound(hmpl2); ++imap){
558 m_trackSummarySum += trackSummarySum;
560 if (author_found[
i]) {
566 m_recoInfo |= reco_info;
567 m_patternProperties |= pattern_properties;
575 m_trackSummarySum.reset();
586 out <<
" Printing Statistics for " <<
key();
588 out <<
"TrackCollection \"" <<
key() <<
"\" " <<
"\n" ;
591 out <<
"(TrackAuthors:";
592 std::vector<std::string> author_string;
598 m_recoInfo).dumpInfo() );
602 out <<
" " << author_string[
i];
605 out <<
" )" << std::endl
606 <<
"TrackTruthCollection \"" <<
Truthkey() <<
"\"" << std::endl;
611 out <<
" WARNING: TrackTruth missing for part of this TrackCollection, no efficiencies or fakerates included.!" << std::endl;
613 out <<
" INFO: Intentionally no TrackTruth for this TrackCollection, no efficiencies or fakerates included." << std::endl;
617 out <<
" \t\t\t ................................tracks................................" << std::endl;
618 out <<
" \t\t\tn/event\tSEff.pr\tSEff.sd\tSLowP1\tSLowP2\tLowP1\tLowP2\tnoLink\tmultM\t" << std::endl;
628 out <<
"\t" <<
"tracks, n/event:" << std::endl;
629 out <<
"\t\t" <<
"total" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
631 out <<
"\t\t" <<
"in barrel" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
633 out <<
"\t\t" <<
"in trans." << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
635 out <<
"\t\t" <<
"in endcap" << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
637 out <<
"\t\t" <<
"in forwa." << std::setiosflags(std::ios::fixed | std::ios::showpoint) <<
640 out <<
" \t\t\t ....................................hits/track............................" << std::endl;
641 out <<
" \t\t\t\ttotal\tPIX1\tPIX2\tPIX3\tSCT1\tSCT2\tSCT3\tSCT4\tSCT5to9\tStraws" << std::endl;
650 out <<
": NO EVENTS PROCESSED! " << std::endl;
654 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2)
658 out <<
"\t" << std::setprecision(4)
660 << std::setprecision(2);
663 out <<
"\t" <<
"n/a" ;
666 out <<
"\t" << std::setprecision(4)
668 << std::setprecision(2);
671 out <<
"\t" <<
"n/a" ;
679 out <<
"\t" <<
"n/a\tn/a" ;
690 out <<
"\tn/a\tn/a\tn/a";
692 out << std::endl << std::setprecision(-1);
696 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2);
698 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(4) << std::setprecision(1)
709 << std::endl << std::setprecision(-1);
712 out <<
" Unable to calculate: Denominator=0." << std::endl << std::setprecision(-1);
724 out << std::setiosflags(std::ios::fixed | std::ios::showpoint)
725 << std::setw(8) << track_types_string[track_type]
726 << std::setw(25) <<
key();
731 out << std::setw(6) <<
"n/a";
732 for (
unsigned int stype_i=0; stype_i<
kNSummaryTypes; ++stype_i) {
733 out << std::setw(std::max(6,static_cast<int>(strlen(
s_summaryTypeName[stype_i])+1)))
736 out << std::endl << std::setprecision(-1);
746 int summary_type )
const
761 out <<
"TrackCollection \"" <<
key() <<
"\" " << std::endl;
763 out <<
"(TrackAuthors:";
764 std::vector<std::string> author_string;
770 m_recoInfo).dumpInfo() );
774 out <<
" " << author_string[
i];
777 out <<
" )" << std::endl
778 <<
"TrackTruthCollection \"" <<
Truthkey() <<
"\"" << std::endl;
783 out <<
" WARNING: TrackTruth missing for part of this TrackCollection --> No secondaries information printed!" << std::endl;
785 out <<
" INFO: Intentionally no TrackTruth for this TrackCollection. (No secondaries information printed.)" << std::endl;
789 out <<
" \t\t\t\t ......................truth mached tracks statistics....................." << std::endl;
790 out <<
" \t\t\t\tn/event\teff.\ttotal\tPIX1\tPIX2\tPIX3\tSCT1\tSCT2\tSCT3\tSCT4\tSCT5to9\tStraws" << std::endl;
793 out <<
" total secondaries ";
795 out <<
" secondaries in barrel ";
797 out <<
" secondaries in trans. ";
799 out <<
" secondaries in endcap ";
801 out <<
" secondaries in forwa. ";
805 else out <<
": NO EVENTS PROCESSED! " << std::endl;
811 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(7) << std::setprecision(2)
817 out <<
"\t" <<
"n/a" ;
821 out << std::setiosflags(std::ios::fixed | std::ios::showpoint) << std::setw(4) << std::setprecision(1)
832 << std::endl << std::setprecision(-1);
835 out <<
" Unable to calculate: Denominator=0." << std::endl << std::setprecision(-1);
859 bool secondary=
false;
860 bool truncated=
false;
865 HepGeom::Point3D<double> startVertex(
particle->production_vertex()->position().x(),
866 particle->production_vertex()->position().y(),
867 particle->production_vertex()->position().z());
870 if (
particle->end_vertex() ==
nullptr) {
874 HepGeom::Point3D<double> endVertex(
particle->end_vertex()->position().x(),
875 particle->end_vertex()->position().y(),
876 particle->end_vertex()->position().z());
888 if (
particle->end_vertex() ==
nullptr) {
892 HepGeom::Point3D<double> endVertex(
particle->end_vertex()->position().x(),
893 particle->end_vertex()->position().y(),
894 particle->end_vertex()->position().z());
JetConstituentVector::iterator iterator
HepMC::ConstGenParticlePtr scptr() const
Dereference/smart pointer.
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
bool is_pixel(Identifier id) const
@ numberOfPixelHits
number of pixel layers on track with absence of hits
static const char *const s_summaryTypeName[kNSummaryTypes]
table column labels for summary
@ TRACK_LOWTRUTHPROB2_SIGNAL
Contains information about the 'fitter' of this track.
@ TRACK_LOWTRUTHPROB_SIGNAL
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
@ numberOfTRTHighThresholdHits
total number of TRT hits which pass the high threshold
static std::string getSummaryTypeHeader()
@ numberOfTRTHighThresholdOutliers
number of dead TRT straws crossed
@ numberOfInnermostPixelLayerHits
these are the hits in the 1st pixel layer
const std::string & key() const
Returns TrackCollection Key.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
@ TRACK_NOHEPMCPARTICLELINK
@ kTracks_rec
number of reconstructed tracks for a given type and eta region
bool is_sct(Identifier id) const
void printRegion2(MsgStream &out, enum eta_region, float denominator) const
void printSecondary(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
@ TRACK_MATCHED_SECONDARY
float matchTrackCut
Truth probability has to be greater than this for track to be considered matched
@ numberOfOutliersOnTrack
100 times the standard deviation of the chi2 from the surfaces
void printRegion1(MsgStream &out, enum eta_region) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
bool is_trt(Identifier id) const
void setSummaryStat(track_types track_i, eta_region region_i, const Trk::TrackSummary *summary, TrackSummaryCounter &trackSummarySum) const
bool printTrackSummaryRegion(MsgStream &out, enum track_types, enum eta_region) const
Sets up detailed statistics part of table, calls printTrackSummaryRegion.
@ numberOfSCTHoles
number of Holes in both sides of a SCT module
std::atomic< bool > m_author_found[Trk::TrackInfo::NumberOfTrackFitters]
Number of tracking authors found.
@ kTracks_gen
number of generated tracks for a given type and eta region, looping over genevents to include possibl...
HepMC::ConstGenParticlePtr cptr() const
Dereference.
void SetCuts(const struct cuts &)
Sets the cuts such as the eta regions (barrel, transition,endcap) and the hit fraction fake cuts and ...
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
virtual const RIO_OnTrack & rioOnTrack(unsigned int) const =0
returns the RIO_OnTrack (also known as ROT) objects depending on the integer.
a link optimized in size for a GenParticle in a McEventCollection
std::atomic< long > m_events
Number of events.
@ kHits_pri
number of hits from primary tracks for a given type and eta region
TrackFitter
enums to identify who created this track and what propertis does it have.
@ numberOfTRTOutliers
number of TRT holes
@ numberOfSCTHits
number of SCT holes
@ kTrackSummarySum
Track Summary Values for each track type, region and summary type.
Base class for all CompetingRIOsOnTack implementations, extends the common MeasurementBase.
void print(MsgStream &out) const
Prints all of the statistics information, calls printRegion, printTrackSummaryRegion,...
virtual bool type(MeasurementBaseType::Type type) const =0
Interface method checking the type.
void printRegionSecondary(MsgStream &out, enum eta_region, float denominator) const
Prints ntracks per event,efficiencies,fake rates, and general hit information for given eta region.
bool isValid() const
Validity check.
@ kNTrackSummaryBAD
Number of tracks with track summary bad for given type,eta,summary type.
@ kNTrackSummaryOK
Number of tracks with track summary OK for given type,eta,summary type.
const HepMcParticleLink & particleLink() const
std::atomic< bool > m_truthMissing
Flag for if track truth is missing.
@ numberOfPixelHoles
number of pixels which have a ganged ambiguity.
@ numberOfGangedPixels
number of Ganged Pixels flagged as fakes
int layer_disk(const Identifier &id) const
bool setElement(ElementType element)
Set to point to an element.
index_type eventIndex() const
Return the event number of the referenced GenEvent.
@ numberOfTRTHits
number of TRT outliers
const GenParticle * ConstGenParticlePtr
Ensure that the ATLAS eigen extensions are properly loaded.
double pT() const
Access method for transverse momentum.
represents the track state (measurement, material, fit parameters and quality) at a surface.
bool setStorableObject(BaseConstReference data, bool replace=false, IProxyDict *sg=0)
Set link to point to a new container (storable).
const std::string & Truthkey() const
Returns Truth TrackCollection Key.
A summary of the information contained by a track.
static const Trk::SummaryType s_summaryTypes[kNSummaryTypes]
summary types for which statistics are gathered
int layer_disk(const Identifier &id) const
@ kTracks_gen_signal
number of generated tracks for a given type and eta region, just from first genevent
int ClassifyParticle(const HepMC::ConstGenParticlePtr &particle, const double prob) const
classifies gen particle as primary, secondary or truncated
std::multimap< HepMcParticleLink, float > recoToTruthMap
map containing reco track and matched truth track barcode
bool PassTrackCuts(const Trk::TrackParameters *para) const
defines 'good' reco tracks
T_Int m_counter[N_Categories][N_Types][N_Regions]
float maxEtaTransition
Maxiumu eta for transition region.
float fakeTrackCut
fraction of hits per track that come from single matched truth track.
@ kHits_sec
number of hits from secondary tracks for a given type and eta region
MC particle associated with a reco track + the quality of match.
TrackStatHelper(const std::string &, const std::string &, bool careAboutTruth=true)
Constructor.
@ kHits_rec
number of reconstructed hits for a given type and eta region
float probability() const
@ TRACK_MULTMATCH_SECONDARY
void addEvent(const TrackCollection *, std::vector< const Trk::Track * > &, const std::vector< std::pair< HepMC::ConstGenParticlePtr, int > > &, const TrackTruthCollection *, const AtlasDetectorID *const, const PixelID *, const SCT_ID *, const Trk::IExtendedTrackSummaryTool *, bool, const unsigned int *, const unsigned int *) const
Adds hit, track and matching information for each event.
void reset()
Resets the track collection information, called in the constructor.
float maxEtaEndcap
Maximum eta for endcap.
double eta() const
Access method for pseudorapidity - from momentum.
float fakeTrackCut2
2nd value for fraction of hits per track that come from single matched truth track.
SummaryType
enumerates the different types of information stored in Summary.
@ NumberOfTrackFitters
maximum number of enums
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
void printTrackSummaryAverage(MsgStream &out, enum track_types, enum eta_region, int summary_type) const
Prints information from TrackSummaryTool.
@ TRACK_MULTMATCH_PRIMARY