ATLAS Offline Software
Loading...
Searching...
No Matches
TrigIDHitStats.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5/*
6* TrigInDetTrackTruth Helper class to keep numbers of hits in ID sub-detectors
7*
8* Copied from Tracking/TrkEvent/TrkTruthData/TrkTruthData/SubDetHitStatistics.h
9*/
10
11#ifndef TRIGIDHITSTATS_TRUTH_H
12#define TRIGIDHITSTATS_TRUTH_H
13
14#include <cstring>
16
17
19
20 public:
21
23
26 memset(m_numHits, 0, NUM_SUBDETECTORS);
27 }
28
29 virtual ~TrigIDHitStats() { }
30
31 unsigned char& operator[](IDSubDetType i) { return m_numHits[i]; }
32
33 const unsigned char& operator[](IDSubDetType i) const { return m_numHits[i]; }
34
35 unsigned int total() const {
36 unsigned char tot=0;
37 for(unsigned i=0; i<NUM_SUBDETECTORS; i++) {
38 tot += m_numHits[i];
39 }
40 return (unsigned int)tot;
41 }
42
43 unsigned int pixhits() const { return (unsigned int)m_numHits[PIX];}
44 unsigned int scthits() const { return (unsigned int)m_numHits[SCT];}
45 unsigned int trthits() const { return (unsigned int)m_numHits[TRT];}
46
47
49 for(unsigned i=0; i<NUM_SUBDETECTORS; i++) {
50 m_numHits[i] += b.m_numHits[i];
51 }
52 return *this;
53 }
54
55private:
56
57 // For InDet, the largest typical number of measurements per track is 36 in
58 // the TRT. One byte is enough to keep any of the numbers.
60
61};
62
63template<class Ostream> Ostream& operator<<(Ostream& os, const TrigIDHitStats& m) {
64 os<<"IDSubDetStat(";
65 for(unsigned i=0; i<TrigIDHitStats::NUM_SUBDETECTORS; i++) {
66 os<<unsigned(m[TrigIDHitStats::IDSubDetType(i)]);
68 }
69 return os<<")";
70}
71
72CLASS_DEF( TrigIDHitStats , 212921831 , 1 )
73#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Ostream & operator<<(Ostream &os, const TrigIDHitStats &m)
TrigIDHitStats & operator+=(const TrigIDHitStats &b)
const unsigned char & operator[](IDSubDetType i) const
unsigned char & operator[](IDSubDetType i)
unsigned int trthits() const
unsigned int total() const
unsigned char m_numHits[NUM_SUBDETECTORS]
unsigned int scthits() const
virtual ~TrigIDHitStats()
unsigned int pixhits() const
TrigIDHitStats()
Constructors: POOL needs default constructor.
Definition HitInfo.h:33