Skip to content
Snippets Groups Projects
Commit f927cec1 authored by Nora Emilia Pettersson's avatar Nora Emilia Pettersson Committed by Graeme Stewart
Browse files

Tag for ITk-use (TrkTrackSummary-00-23-15-04)

	* Added functionality for ITk (Only for ITk!)
	* Tagged as TrkTrackSummary-00-23-15-04
parent e17a25bf
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ public:
std::bitset<numberOfDetectorTypes>& hitPattern,
float dedx=-1,
int nhitsuseddedx=-1,
int nhitsoverflowdedx=-1
int nhitsoverflowdedx=-1
);
//ITK Constructor
......@@ -236,9 +236,15 @@ public:
Track, or (more likely) Trk::TrkTrackSummaryTool is not filling it yet)*/
int get(const SummaryType& type) const;
//ITk Methods
int get(const std::string& type) const;
bool isITk() const;
bool isITkInclined() const;
std::bitset<200> getHitPatternITk() const;
std::map<std::string, int> getDetectorTypesITk() const;
bool isHit(const std::string& type) const;
//void dumpHitPattern() const;
/** returns the probability information for the passed ProbabilityType.
@param type Use the provided enums to access it, i.e. by summary.getPID(eProbabilityComb)
@return returns -1 if the enum is undefined (i.e. the information was not available in the
......@@ -315,31 +321,49 @@ private: // data members
/** pointer to the MuonTrackSummary */
const MuonTrackSummary* m_muonTrackSummary;
/** ITk information. */
std::map<std::string, int> m_ITkInformation; //Counters for ITk
std::map<std::string, int> m_ITkDetectorTypes; //Counters for ITk
std::bitset<200> m_hitPatternITk; //HitPattern for ITk
bool m_isITkLayout; //tmp variable for internal memory?
bool m_isITkInclined; //tmp for Inclined Barrel 4.0
std::bitset<200> m_hitPatternITk; //HitPattern for ITk
};
//ITk Methods
inline bool Trk::TrackSummary::isITk() const
{
return m_isITkLayout;
}
inline bool Trk::TrackSummary::isITkInclined() const
{
return m_isITkInclined;
}
inline std::bitset<200> Trk::TrackSummary::getHitPatternITk() const
{
return m_hitPatternITk;
}
inline std::map<std::string, int> Trk::TrackSummary::getDetectorTypesITk() const
{
return m_ITkDetectorTypes;
}
inline bool Trk::TrackSummary::isHit(const std::string& type) const
{
std::map<std::string, int>::const_iterator it = m_ITkDetectorTypes.find(type);
if ( it->second > 199 ) return false;
return m_hitPatternITk.test(it->second);
}
inline int Trk::TrackSummary::get(const std::string& type) const
{
std::map<std::string, int>::const_iterator it = m_ITkInformation.find(type);
if ( it != m_ITkInformation.end() ) return it->second;
else { return -1; }
}
//ITk Methods
inline int Trk::TrackSummary::get(const Trk::SummaryType& type) const
{
return m_information.at(type);
......
......@@ -45,20 +45,20 @@ Trk::TrackSummary::TrackSummary( const std::vector<int>& information, const std:
Trk::TrackSummary::TrackSummary( const std::vector<int>& information, const std::vector<float>& eProbability, std::bitset<numberOfDetectorTypes>& hitPattern, const std::map<std::string, int>& informationITk, const std::map<std::string, int>& dettypes, std::bitset<200>& hitPatternITk, float dedx, int nhitsdedx, int noverflowdedx)
:
m_information( information ),
m_ITkInformation( informationITk ),
m_ITkDetectorTypes( dettypes ),
m_eProbability( eProbability ),
m_dedx(dedx),
m_nhitsdedx(nhitsdedx),
m_idHitPattern( hitPattern.to_ulong() ),
m_nhitsoverflowdedx(noverflowdedx),
m_hitPatternITk( hitPatternITk ),m_indetTrackSummary(0),m_muonTrackSummary(0)
m_idHitPattern( hitPattern.to_ulong() ),
m_indetTrackSummary(0),m_muonTrackSummary(0),
m_ITkInformation( informationITk ),
m_ITkDetectorTypes( dettypes ),
m_hitPatternITk( hitPatternITk ),
m_isITkLayout(true),m_isITkInclined(false)
{
m_isITkLayout = true; //tmp variable for internal memory?
if(m_ITkDetectorTypes.find("itkPixelIncl0Start") != m_ITkDetectorTypes.end()) {
m_isITkInclined = true; //tmp for Inclined Barrel 4.0
}
//std::cout << m_isITkLayout << " " << m_isITkInclined << std::endl;
#ifndef NDEBUG
s_numberOfInstantiations++; // new TrackSummary, so increment total count
#endif
......@@ -235,16 +235,56 @@ T_out& dumpTrackSummary( T_out& out, const TrackSummary& trackSum )
out << " number of overflow hits used for dE/dx : " << trackSum.numberOfOverflowHitsdEdx() << "\n";
bool m_isITkLayout = trackSum.isITk();
bool m_isITkInclined = trackSum.isITkInclined();
if(m_isITkLayout){
out << "============================================" << "\n";
out << "ITk Information:" << "\n";
out << " ITk Information:" << "\n";
out << "============================================" << "\n";
out << "Number Of Pixel Hits: " << trackSum.get(std::string("numberOfPixelHits")) << std::endl;
out << "Number Of Pixel Holes: " << trackSum.get(std::string("numberOfPixelHoles")) << std::endl;
out << "Number Of Shared Pixel Hits: " << trackSum.get(std::string("numberOfPixelShared")) << std::endl;
out << " * Number Of Pixel Hits : " << trackSum.get(std::string("numberOfPixelHits")) << "\n";
out << " * Number Of Spoilt Pixel Hits : " << trackSum.get(std::string("numberOfPixelSpoilt")) << "\n";
out << " * Number Of Pixel Outliers : " << trackSum.get(std::string("numberOfPixelOutliers")) << "\n";
out << " * Number Of Pixel Holes : " << trackSum.get(std::string("numberOfPixelHoles")) << "\n";
out << " * Number Of Pixel Barrel Holes : " << trackSum.get(std::string("numberOfPixelBarrelHoles")) << "\n";
out << " * Number Of Pixel Ring Holes : " << trackSum.get(std::string("numberOfPixelRingHoles")) << "\n";
if(m_isITkInclined){
out << " * Number Of Pixel Incl Module Holes : " << trackSum.get(std::string("numberOfPixelInclHoles")) << "\n";
}
out << " * Number Of Shared Pixel Hits : " << trackSum.get(std::string("numberOfPixelShared")) << "\n";
out << " * Number Of Contributing Pixel Layers : " << trackSum.get(std::string("numberOfContribPixelLayers")) << "\n";
out << " * Number Of Contributing Pixel Barrel : " << trackSum.get(std::string("numberOfContribPixelBarrel")) << "\n";
out << " * Number Of Contributing Pixel Rings : " << trackSum.get(std::string("numberOfContribPixelRings")) << "\n";
if(m_isITkInclined) {
out << " * Number Of Contributing Pixel Incl : " << trackSum.get(std::string("numberOfContribPixelInclined")) << "\n";
out << " * Number Of Contributing Pixel Central : " << trackSum.get(std::string("numberOfContribPixelCentral")) << "\n";
}
out << " * Number Of Strip Hits : " << trackSum.get(std::string("numberOfStripHits")) << "\n";
out << " * Number Of Spoilt Strip Hits : " << trackSum.get(std::string("numberOfStripSpoilt")) << "\n";
out << " * Number Of Strip Outliers : " << trackSum.get(std::string("numberOfStripOutliers")) << "\n";
out << " * Number Of Strip Holes : " << trackSum.get(std::string("numberOfStripHoles")) << "\n";
out << " * Number Of Shared Strip Hits : " << trackSum.get(std::string("numberOfStripShared")) << "\n";
out << " * Number Of Strip Space Points : " << trackSum.get(std::string("numberOfStripSpacePoints")) << "\n";
out << " * Number Of Contributing Strip Layers : " << trackSum.get(std::string("numberOfContribStripLayers")) << "\n";
out << " * Number Of Contributing Strip Barrel : " << trackSum.get(std::string("numberOfContribStripBarrel")) << "\n";
out << " * Number Of Contributing Strip EC Disk : " << trackSum.get(std::string("numberOfContribStripECDisk")) << "\n";
out << "============================================" << "\n";
out << "ITk Information:" << "\n";
out << " ITk Hit Pattern:" << "\n";
out << "============================================" << "\n";
std::map<std::string, int> detectorTypes = trackSum.getDetectorTypesITk();
std::bitset<200> hitPatternITk = trackSum.getHitPatternITk();
//NP: DEBUGGING output, comment out...or...something
std::map<std::string, int>::const_iterator it = detectorTypes.begin();
std::map<std::string, int>::const_iterator itEd = detectorTypes.end();
std::string hitPattern;
for(; it != itEd; it++) {
if ( it->first.find("Start") != std::string::npos ) continue;
//out << it->first << ": " << hitPatternITk.test(it->second) << " ";
out << " " << it->first << " (" << it->second << "): " << hitPatternITk.test(it->second) << " " << "\n";
hitPattern+=std::to_string(hitPatternITk.test(it->second));
}
out << hitPattern << "\n";
}
//this is a bit nasty, but I don't have access to internal data members
if(!m_isITkLayout){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment