BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MucRecHitContainer Class Reference

#include <MucRecHitContainer.h>

Public Types

typedef std::map< MucRecHitID, int > GapHitCountMap
typedef std::map< MucRecHitID, MucRecHit * > pHitMap
typedef std::map< MucRecHitID, int > GapHitCountMap
typedef std::map< MucRecHitID, MucRecHit * > pHitMap
typedef std::map< MucRecHitID, int > GapHitCountMap
typedef std::map< MucRecHitID, MucRecHit * > pHitMap

Public Member Functions

 MucRecHitContainer ()
 MucRecHitContainer (const MucRecHitContainer &source)
MucRecHitContaineroperator= (const MucRecHitContainer &orig)
 ~MucRecHitContainer ()
void Init ()
 Points to the single instance of MucRecHitContainer.
void Destroy ()
 Destroys the single instance of MucRecHitContainer.
void SetMucRecHitCol (MucRecHitCol *p)
MucRecHitColGetMucRecHitCol ()
 Get MucRecHitCol pointer.
int GetHitCount ()
 How many hits are there in this event?
int GetGapHitCount (const MucRecHitID gapID)
 How many hits are there in this gap?
int GetGapHitCount (const int part, const int seg, const int gap)
 How many hits are there in this gap?
MucRecHitGetHit (const MucRecHitID hitID)
 Get a MucRecHit object by hit identifier.
MucRecHitGetHit (const int part, const int seg, const int gap, const int hit)
 Get a MucRecHit by part, seg, gap, and hit within the gap.
MucRecHitGetHitByIdentifier (const Identifier id)
MucRecHitGetHitByIdentifier (const int part, const int seg, const int gap, const int strip)
void AddHit (const Identifier id)
void AddHit (const int part, const int seg, const int gap, const int strip)
 Place a new hit object in the container.
void Clear ()
 Remove all hit objects from the container, and destroy them.
 MucRecHitContainer ()
 MucRecHitContainer (const MucRecHitContainer &source)
MucRecHitContaineroperator= (const MucRecHitContainer &orig)
 ~MucRecHitContainer ()
void Init ()
 Points to the single instance of MucRecHitContainer.
void Destroy ()
 Destroys the single instance of MucRecHitContainer.
void SetMucRecHitCol (MucRecHitCol *p)
MucRecHitColGetMucRecHitCol ()
 Get MucRecHitCol pointer.
int GetHitCount ()
 How many hits are there in this event?
int GetGapHitCount (const MucRecHitID gapID)
 How many hits are there in this gap?
int GetGapHitCount (const int part, const int seg, const int gap)
 How many hits are there in this gap?
MucRecHitGetHit (const MucRecHitID hitID)
 Get a MucRecHit object by hit identifier.
MucRecHitGetHit (const int part, const int seg, const int gap, const int hit)
 Get a MucRecHit by part, seg, gap, and hit within the gap.
MucRecHitGetHitByIdentifier (const Identifier id)
MucRecHitGetHitByIdentifier (const int part, const int seg, const int gap, const int strip)
void AddHit (const Identifier id)
void AddHit (const int part, const int seg, const int gap, const int strip)
 Place a new hit object in the container.
void Clear ()
 Remove all hit objects from the container, and destroy them.
 MucRecHitContainer ()
 MucRecHitContainer (const MucRecHitContainer &source)
MucRecHitContaineroperator= (const MucRecHitContainer &orig)
 ~MucRecHitContainer ()
void Init ()
 Points to the single instance of MucRecHitContainer.
void Destroy ()
 Destroys the single instance of MucRecHitContainer.
void SetMucRecHitCol (MucRecHitCol *p)
MucRecHitColGetMucRecHitCol ()
 Get MucRecHitCol pointer.
int GetHitCount ()
 How many hits are there in this event?
int GetGapHitCount (const MucRecHitID gapID)
 How many hits are there in this gap?
int GetGapHitCount (const int part, const int seg, const int gap)
 How many hits are there in this gap?
MucRecHitGetHit (const MucRecHitID hitID)
 Get a MucRecHit object by hit identifier.
MucRecHitGetHit (const int part, const int seg, const int gap, const int hit)
 Get a MucRecHit by part, seg, gap, and hit within the gap.
MucRecHitGetHitByIdentifier (const Identifier id)
MucRecHitGetHitByIdentifier (const int part, const int seg, const int gap, const int strip)
void AddHit (const Identifier id)
void AddHit (const int part, const int seg, const int gap, const int strip)
 Place a new hit object in the container.
void Clear ()
 Remove all hit objects from the container, and destroy them.

Detailed Description

MucRecHitContainer has a MucRecHitCol which contains all MucRecHit objects for a single event. Access is optimized for referencing by BesMUCRecHitID indices.

Author
Zhengyun You \URL{youzy.nosp@m.@hep.nosp@m..pku..nosp@m.cn}
See also
MucRecHit

Definition at line 29 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucRecEvent/MucRecHitContainer.h.

Member Typedef Documentation

◆ GapHitCountMap [1/3]

◆ GapHitCountMap [2/3]

◆ GapHitCountMap [3/3]

◆ pHitMap [1/3]

◆ pHitMap [2/3]

◆ pHitMap [3/3]

Constructor & Destructor Documentation

◆ MucRecHitContainer() [1/6]

MucRecHitContainer::MucRecHitContainer ( )

Definition at line 16 of file MucRecHitContainer.cxx.

16{}

Referenced by MucRecHitContainer(), and operator=().

◆ MucRecHitContainer() [2/6]

MucRecHitContainer::MucRecHitContainer ( const MucRecHitContainer & source)

◆ ~MucRecHitContainer() [1/3]

MucRecHitContainer::~MucRecHitContainer ( )

Definition at line 19 of file MucRecHitContainer.cxx.

19 {
20 // Clear();
21}

◆ MucRecHitContainer() [3/6]

MucRecHitContainer::MucRecHitContainer ( )

◆ MucRecHitContainer() [4/6]

MucRecHitContainer::MucRecHitContainer ( const MucRecHitContainer & source)

◆ ~MucRecHitContainer() [2/3]

MucRecHitContainer::~MucRecHitContainer ( )

◆ MucRecHitContainer() [5/6]

MucRecHitContainer::MucRecHitContainer ( )

◆ MucRecHitContainer() [6/6]

MucRecHitContainer::MucRecHitContainer ( const MucRecHitContainer & source)

◆ ~MucRecHitContainer() [3/3]

MucRecHitContainer::~MucRecHitContainer ( )

Member Function Documentation

◆ AddHit() [1/6]

void MucRecHitContainer::AddHit ( const Identifier id)

Definition at line 109 of file MucRecHitContainer.cxx.

109 {
110 int part = MucID::part( id );
111 int seg = MucID::seg( id );
112 int gap = MucID::gap( id );
113 int strip = MucID::strip( id );
114
115 AddHit( part, seg, gap, strip );
116}
static int part(const Identifier &id)
Definition MucID.cxx:43
static int gap(const Identifier &id)
Definition MucID.cxx:63
static int seg(const Identifier &id)
Definition MucID.cxx:53
static int strip(const Identifier &id)
Definition MucID.cxx:73
void AddHit(const Identifier id)

Referenced by AddHit().

◆ AddHit() [2/6]

void MucRecHitContainer::AddHit ( const Identifier id)

◆ AddHit() [3/6]

void MucRecHitContainer::AddHit ( const Identifier id)

◆ AddHit() [4/6]

void MucRecHitContainer::AddHit ( const int part,
const int seg,
const int gap,
const int strip )

Place a new hit object in the container.

Definition at line 119 of file MucRecHitContainer.cxx.

120 {
121 if ( ( part >= 0 ) && ( part < (int)MucID::getPartNum() ) && ( seg >= 0 ) &&
122 ( seg < (int)MucID::getSegNum( part ) ) && ( gap >= 0 ) &&
123 ( gap < (int)MucID::getGapNum( part ) ) && ( strip >= 0 ) &&
124 ( strip < (int)MucID::getStripNum( part, seg, gap ) ) )
125 {
126 MucRecHitID gapID( part, seg, gap );
127 // cout << "MucRecHitContainer::AddHit-I1 " << idGap << endl;
128
129 int hitCount = m_GapHitCount[gapID];
130 MucRecHitID id( part, seg, gap, hitCount );
131 // cout << "MucRecHitContainer::AddHit-I2 hit id = " << id << endl;
132
133 MucRecHit* pHit = new MucRecHit( part, seg, gap, strip );
134 m_pMucRecHitCol->push_back( pHit );
135
136 m_pHit[id] = pHit;
137 if ( !m_pHit[id] )
138 { cout << "MucRecHitContainer::AddHit-F1 failed to create new MucRecHit" << endl; }
139 else { m_GapHitCount[gapID]++; }
140 }
141}
static value_type getPartNum()
Definition MucID.cxx:131
static value_type getSegNum(int part)
Definition MucID.cxx:134
static value_type getStripNum(int part, int seg, int gap)
Definition MucID.cxx:148
static value_type getGapNum(int part)
Definition MucID.cxx:141

◆ AddHit() [5/6]

void MucRecHitContainer::AddHit ( const int part,
const int seg,
const int gap,
const int strip )

Place a new hit object in the container.

◆ AddHit() [6/6]

void MucRecHitContainer::AddHit ( const int part,
const int seg,
const int gap,
const int strip )

Place a new hit object in the container.

◆ Clear() [1/3]

void MucRecHitContainer::Clear ( )

Remove all hit objects from the container, and destroy them.

Definition at line 32 of file MucRecHitContainer.cxx.

32 {
33 for ( int part = 0; part < (int)MucID::getPartNum(); part++ )
34 {
35 for ( int seg = 0; seg < (int)MucID::getSegNum( part ); seg++ )
36 {
37 for ( int gap = 0; gap < (int)MucID::getGapNum( part ); gap++ )
38 {
39 MucRecHitID gapID( part, seg, gap );
40 m_GapHitCount[gapID] = 0;
41 }
42 }
43 }
44
45 // m_pMucRecHitCol->clear();
46 m_pHit.clear();
47}

Referenced by Init().

◆ Clear() [2/3]

void MucRecHitContainer::Clear ( )

Remove all hit objects from the container, and destroy them.

◆ Clear() [3/3]

void MucRecHitContainer::Clear ( )

Remove all hit objects from the container, and destroy them.

◆ Destroy() [1/3]

void MucRecHitContainer::Destroy ( )

Destroys the single instance of MucRecHitContainer.

◆ Destroy() [2/3]

void MucRecHitContainer::Destroy ( )

Destroys the single instance of MucRecHitContainer.

◆ Destroy() [3/3]

void MucRecHitContainer::Destroy ( )

Destroys the single instance of MucRecHitContainer.

◆ GetGapHitCount() [1/6]

int MucRecHitContainer::GetGapHitCount ( const int part,
const int seg,
const int gap )

How many hits are there in this gap?

Definition at line 71 of file MucRecHitContainer.cxx.

71 {
72 MucRecHitID gapID( part, seg, gap );
73 return m_GapHitCount[gapID];
74}

◆ GetGapHitCount() [2/6]

int MucRecHitContainer::GetGapHitCount ( const int part,
const int seg,
const int gap )

How many hits are there in this gap?

◆ GetGapHitCount() [3/6]

int MucRecHitContainer::GetGapHitCount ( const int part,
const int seg,
const int gap )

How many hits are there in this gap?

◆ GetGapHitCount() [4/6]

int MucRecHitContainer::GetGapHitCount ( const MucRecHitID gapID)

How many hits are there in this gap?

Definition at line 66 of file MucRecHitContainer.cxx.

66 {
67 if ( m_GapHitCount.count( gapID ) ) return m_GapHitCount[gapID];
68 return 0;
69}

Referenced by GetHitByIdentifier().

◆ GetGapHitCount() [5/6]

int MucRecHitContainer::GetGapHitCount ( const MucRecHitID gapID)

How many hits are there in this gap?

◆ GetGapHitCount() [6/6]

int MucRecHitContainer::GetGapHitCount ( const MucRecHitID gapID)

How many hits are there in this gap?

◆ GetHit() [1/6]

MucRecHit * MucRecHitContainer::GetHit ( const int part,
const int seg,
const int gap,
const int hit )

Get a MucRecHit by part, seg, gap, and hit within the gap.

Definition at line 81 of file MucRecHitContainer.cxx.

82 {
83 MucRecHitID id( part, seg, gap, hit );
84 return m_pHit[id];
85}

◆ GetHit() [2/6]

MucRecHit * MucRecHitContainer::GetHit ( const int part,
const int seg,
const int gap,
const int hit )

Get a MucRecHit by part, seg, gap, and hit within the gap.

◆ GetHit() [3/6]

MucRecHit * MucRecHitContainer::GetHit ( const int part,
const int seg,
const int gap,
const int hit )

Get a MucRecHit by part, seg, gap, and hit within the gap.

◆ GetHit() [4/6]

MucRecHit * MucRecHitContainer::GetHit ( const MucRecHitID hitID)

Get a MucRecHit object by hit identifier.

Definition at line 76 of file MucRecHitContainer.cxx.

76 {
77 if ( m_pHit.count( id ) ) return m_pHit[id];
78 else return 0;
79}

Referenced by GetHitByIdentifier().

◆ GetHit() [5/6]

MucRecHit * MucRecHitContainer::GetHit ( const MucRecHitID hitID)

Get a MucRecHit object by hit identifier.

◆ GetHit() [6/6]

MucRecHit * MucRecHitContainer::GetHit ( const MucRecHitID hitID)

Get a MucRecHit object by hit identifier.

◆ GetHitByIdentifier() [1/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const Identifier id)

Get a MucRecHit by Identifier. If doesnt exist, return null.

Definition at line 87 of file MucRecHitContainer.cxx.

87 {
88 int part = MucID::part( id );
89 int seg = MucID::seg( id );
90 int gap = MucID::gap( id );
91 int strip = MucID::strip( id );
92
93 return GetHitByIdentifier( part, seg, gap, strip );
94}
MucRecHit * GetHitByIdentifier(const Identifier id)

Referenced by GetHitByIdentifier().

◆ GetHitByIdentifier() [2/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const Identifier id)

Get a MucRecHit by Identifier. If doesnt exist, return null.

◆ GetHitByIdentifier() [3/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const Identifier id)

Get a MucRecHit by Identifier. If doesnt exist, return null.

◆ GetHitByIdentifier() [4/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const int part,
const int seg,
const int gap,
const int strip )

Get a MucRecHit by part, seg, gap, and strip. If doesnt exist, return null.

Definition at line 96 of file MucRecHitContainer.cxx.

97 {
98 Identifier id = MucID::channel_id( part, seg, gap, strip );
99 for ( int i = 0; i < GetGapHitCount( part, seg, gap ); i++ )
100 {
101 MucRecHit* hit = GetHit( part, seg, gap, i );
102 if ( id == hit->GetID() ) { return hit; }
103 }
104
105 return 0;
106}
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Definition MucID.cxx:114
MucRecHit * GetHit(const MucRecHitID hitID)
Get a MucRecHit object by hit identifier.
int GetGapHitCount(const MucRecHitID gapID)
How many hits are there in this gap?
Identifier GetID() const
Get soft identifier of this hit.

◆ GetHitByIdentifier() [5/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const int part,
const int seg,
const int gap,
const int strip )

Get a MucRecHit by part, seg, gap, and strip. If doesnt exist, return null.

◆ GetHitByIdentifier() [6/6]

MucRecHit * MucRecHitContainer::GetHitByIdentifier ( const int part,
const int seg,
const int gap,
const int strip )

Get a MucRecHit by part, seg, gap, and strip. If doesnt exist, return null.

◆ GetHitCount() [1/3]

int MucRecHitContainer::GetHitCount ( )

How many hits are there in this event?

Definition at line 49 of file MucRecHitContainer.cxx.

49 {
50 int count = 0;
51 for ( int part = 0; part < (int)MucID::getPartNum(); part++ )
52 {
53 for ( int seg = 0; seg < (int)MucID::getSegNum( part ); seg++ )
54 {
55 for ( int gap = 0; gap < (int)MucID::getGapNum( part ); gap++ )
56 {
57 MucRecHitID gapID( part, seg, gap );
58 count += m_GapHitCount[gapID];
59 }
60 }
61 }
62
63 return count;
64}
DOUBLE_PRECISION count[3]

◆ GetHitCount() [2/3]

int MucRecHitContainer::GetHitCount ( )

How many hits are there in this event?

◆ GetHitCount() [3/3]

int MucRecHitContainer::GetHitCount ( )

How many hits are there in this event?

◆ GetMucRecHitCol() [1/3]

MucRecHitCol * MucRecHitContainer::GetMucRecHitCol ( )
inline

Get MucRecHitCol pointer.

Definition at line 59 of file InstallArea/x86_64-el9-gcc13-dbg/include/MucRecEvent/MucRecHitContainer.h.

59{ return m_pMucRecHitCol; }

◆ GetMucRecHitCol() [2/3]

MucRecHitCol * MucRecHitContainer::GetMucRecHitCol ( )
inline

Get MucRecHitCol pointer.

Definition at line 59 of file InstallArea/x86_64-el9-gcc13-opt/include/MucRecEvent/MucRecHitContainer.h.

59{ return m_pMucRecHitCol; }

◆ GetMucRecHitCol() [3/3]

MucRecHitCol * MucRecHitContainer::GetMucRecHitCol ( )
inline

Get MucRecHitCol pointer.

Definition at line 59 of file Muc/MucRecEvent/include/MucRecEvent/MucRecHitContainer.h.

59{ return m_pMucRecHitCol; }

◆ Init() [1/3]

void MucRecHitContainer::Init ( )

Points to the single instance of MucRecHitContainer.

Initializes the MucRecHitContainer with MucRecHitCol.

Definition at line 24 of file MucRecHitContainer.cxx.

24 {
25 // cout << "MucRecHitContainer::Init-I1 hello world" << endl;
26
27 Clear();
28
29 // cout << "*********** Hit Container Initialized! *********** " << endl;
30}
void Clear()
Remove all hit objects from the container, and destroy them.

◆ Init() [2/3]

void MucRecHitContainer::Init ( )

Points to the single instance of MucRecHitContainer.

Initializes the MucRecHitContainer with MucRecHitCol.

◆ Init() [3/3]

void MucRecHitContainer::Init ( )

Points to the single instance of MucRecHitContainer.

Initializes the MucRecHitContainer with MucRecHitCol.

◆ operator=() [1/3]

MucRecHitContainer & MucRecHitContainer::operator= ( const MucRecHitContainer & orig)

◆ operator=() [2/3]

MucRecHitContainer & MucRecHitContainer::operator= ( const MucRecHitContainer & orig)

◆ operator=() [3/3]

MucRecHitContainer & MucRecHitContainer::operator= ( const MucRecHitContainer & orig)

◆ SetMucRecHitCol() [1/3]

void MucRecHitContainer::SetMucRecHitCol ( MucRecHitCol * p)

Definition at line 143 of file MucRecHitContainer.cxx.

143 {
144 m_pMucRecHitCol = p;
145
146 MucRecHitCol::iterator imuchit;
147 for ( imuchit = p->begin(); imuchit != p->end(); imuchit++ )
148 {
149 int part = ( *imuchit )->Part();
150 int seg = ( *imuchit )->Seg();
151 int gap = ( *imuchit )->Gap();
152 int strip = ( *imuchit )->Strip();
153
154 MucRecHitID gapID( part, seg, gap );
155 int hitCount = m_GapHitCount[gapID];
156 MucRecHitID id( part, seg, gap, hitCount );
157
158 m_pHit[id] = *imuchit;
159 if ( !m_pHit[id] )
160 { cout << "MucRecHitContainer::AddHit-F1 failed to create new MucRecHit" << endl; }
161 else { m_GapHitCount[gapID]++; }
162 }
163}

◆ SetMucRecHitCol() [2/3]

void MucRecHitContainer::SetMucRecHitCol ( MucRecHitCol * p)

◆ SetMucRecHitCol() [3/3]

void MucRecHitContainer::SetMucRecHitCol ( MucRecHitCol * p)

The documentation for this class was generated from the following files: