#include <MucRecHitContainer.h>
Public Types | |
typedef std::map< MucRecHitID, int > | GapHitCountMap |
typedef std::map< MucRecHitID, int > | GapHitCountMap |
typedef std::map< MucRecHitID, MucRecHit * > | pHitMap |
typedef std::map< MucRecHitID, MucRecHit * > | pHitMap |
Public Member Functions | |
void | AddHit (const int part, const int seg, const int gap, const int strip) |
Place a new hit object in the container. | |
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 | AddHit (const Identifier id) |
void | Clear () |
Remove all hit objects from the container, and destroy them. | |
void | Clear () |
Remove all hit objects from the container, and destroy them. | |
void | Destroy () |
Destroys the *single* instance of MucRecHitContainer. | |
void | Destroy () |
Destroys the *single* instance of MucRecHitContainer. | |
int | GetGapHitCount (const int part, const int seg, const int gap) |
How many hits are there in this gap? | |
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? | |
int | GetGapHitCount (const MucRecHitID gapID) |
How many hits are there in this gap? | |
MucRecHit * | 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. | |
MucRecHit * | GetHit (const MucRecHitID hitID) |
Get a MucRecHit object by hit identifier. | |
MucRecHit * | 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. | |
MucRecHit * | GetHit (const MucRecHitID hitID) |
Get a MucRecHit object by hit identifier. | |
MucRecHit * | GetHitByIdentifier (const int part, const int seg, const int gap, const int strip) |
MucRecHit * | GetHitByIdentifier (const Identifier id) |
MucRecHit * | GetHitByIdentifier (const int part, const int seg, const int gap, const int strip) |
MucRecHit * | GetHitByIdentifier (const Identifier id) |
int | GetHitCount () |
How many hits are there in this event? | |
int | GetHitCount () |
How many hits are there in this event? | |
MucRecHitCol * | GetMucRecHitCol () |
Get MucRecHitCol pointer. | |
MucRecHitCol * | GetMucRecHitCol () |
Get MucRecHitCol pointer. | |
void | Init () |
Initializes the MucRecHitContainer with MucRecHitCol. | |
void | Init () |
Initializes the MucRecHitContainer with MucRecHitCol. | |
MucRecHitContainer (const MucRecHitContainer &source) | |
MucRecHitContainer () | |
MucRecHitContainer (const MucRecHitContainer &source) | |
MucRecHitContainer () | |
MucRecHitContainer & | operator= (const MucRecHitContainer &orig) |
MucRecHitContainer & | operator= (const MucRecHitContainer &orig) |
void | SetMucRecHitCol (MucRecHitCol *p) |
void | SetMucRecHitCol (MucRecHitCol *p) |
~MucRecHitContainer () | |
~MucRecHitContainer () | |
Private Attributes | |
MucRecHitContainer::GapHitCountMap | m_GapHitCount |
MucRecHitContainer::pHitMap | m_pHit |
MucRecHitCol * | m_pMucRecHitCol |
MucRecHitCol * | m_pMucRecHitCol |
|
|
|
|
|
|
|
|
|
00016 { }
|
|
|
|
00020 {
00021 //Clear();
00022 }
|
|
|
|
|
|
|
|
Place a new hit object in the container.
|
|
|
|
Place a new hit object in the container.
00146 { 00147 if ( (part >= 0) && (part < (int)MucID::getPartNum()) && 00148 (seg >= 0) && (seg < (int)MucID::getSegNum(part)) && 00149 (gap >= 0) && (gap < (int)MucID::getGapNum(part)) && 00150 (strip >= 0) && (strip < (int)MucID::getStripNum(part, seg, gap)) ) 00151 { 00152 MucRecHitID gapID(part, seg, gap); 00153 // cout << "MucRecHitContainer::AddHit-I1 " << idGap << endl; 00154 00155 int hitCount = m_GapHitCount[gapID]; 00156 MucRecHitID id(part, seg, gap, hitCount); 00157 // cout << "MucRecHitContainer::AddHit-I2 hit id = " << id << endl; 00158 00159 MucRecHit *pHit = new MucRecHit(part, seg, gap, strip); 00160 m_pMucRecHitCol->push_back(pHit); 00161 00162 m_pHit[id] = pHit; 00163 if(!m_pHit[id]) { 00164 cout << "MucRecHitContainer::AddHit-F1 failed to create new MucRecHit" << endl; 00165 } 00166 else { 00167 m_GapHitCount[gapID]++; 00168 } 00169 } 00170 }
|
|
00131 { 00132 int part = MucID::part(id); 00133 int seg = MucID::seg(id); 00134 int gap = MucID::gap(id); 00135 int strip = MucID::strip(id); 00136 00137 AddHit(part, seg, gap, strip); 00138 }
|
|
Remove all hit objects from the container, and destroy them.
|
|
Remove all hit objects from the container, and destroy them.
00037 { 00038 for (int part = 0; part < (int)MucID::getPartNum(); part++) { 00039 for (int seg = 0; seg < (int)MucID::getSegNum(part); seg++) { 00040 for (int gap = 0; gap < (int)MucID::getGapNum(part); gap++) { 00041 MucRecHitID gapID(part, seg, gap); 00042 m_GapHitCount[gapID] = 0; 00043 } 00044 } 00045 } 00046 00047 //m_pMucRecHitCol->clear(); 00048 m_pHit.clear(); 00049 }
|
|
Destroys the *single* instance of MucRecHitContainer.
|
|
Destroys the *single* instance of MucRecHitContainer.
|
|
How many hits are there in this gap?
|
|
How many hits are there in this gap?
|
|
How many hits are there in this gap?
00078 { 00079 MucRecHitID gapID(part, seg, gap); 00080 return m_GapHitCount[gapID]; 00081 }
|
|
How many hits are there in this gap?
00069 { 00070 if (m_GapHitCount.count(gapID)) return m_GapHitCount[gapID]; 00071 return 0; 00072 }
|
|
Get a MucRecHit by part, seg, gap, and hit within the gap.
|
|
Get a MucRecHit object by hit identifier.
|
|
Get a MucRecHit by part, seg, gap, and hit within the gap.
00095 { 00096 MucRecHitID id(part, seg, gap, hit); 00097 return m_pHit[id]; 00098 }
|
|
Get a MucRecHit object by hit identifier.
|
|
Get a MucRecHit by part, seg, gap, and strip. If doesnt exist, return null. |
|
Get a MucRecHit by Identifier. If doesnt exist, return null. |
|
Get a MucRecHit by part, seg, gap, and strip. If doesnt exist, return null. 00116 { 00117 Identifier id = MucID::channel_id(part, seg, gap, strip); 00118 for(int i = 0; i < GetGapHitCount(part, seg, gap); i++) { 00119 MucRecHit *hit = GetHit(part, seg, gap, i); 00120 if(id == hit->GetID()) { 00121 return hit; 00122 } 00123 } 00124 00125 return 0; 00126 }
|
|
Get a MucRecHit by Identifier. If doesnt exist, return null. 00102 { 00103 int part = MucID::part(id); 00104 int seg = MucID::seg(id); 00105 int gap = MucID::gap(id); 00106 int strip = MucID::strip(id); 00107 00108 return GetHitByIdentifier(part, seg, gap, strip); 00109 }
|
|
How many hits are there in this event?
|
|
How many hits are there in this event?
00053 { 00054 int count = 0; 00055 for (int part = 0; part < (int)MucID::getPartNum(); part++) { 00056 for (int seg = 0; seg < (int)MucID::getSegNum(part); seg++) { 00057 for (int gap = 0; gap < (int)MucID::getGapNum(part); gap++) { 00058 MucRecHitID gapID(part, seg, gap); 00059 count += m_GapHitCount[gapID]; 00060 } 00061 } 00062 } 00063 00064 return count; 00065 }
|
|
Get MucRecHitCol pointer.
00061 { return m_pMucRecHitCol; }
|
|
Get MucRecHitCol pointer.
00061 { return m_pMucRecHitCol; }
|
|
Initializes the MucRecHitContainer with MucRecHitCol.
|
|
Initializes the MucRecHitContainer with MucRecHitCol.
00027 { 00028 // cout << "MucRecHitContainer::Init-I1 hello world" << endl; 00029 00030 Clear(); 00031 00032 //cout << "*********** Hit Container Initialized! *********** " << endl; 00033 }
|
|
|
|
|
|
|
|
00174 { 00175 m_pMucRecHitCol = p; 00176 00177 MucRecHitCol::iterator imuchit; 00178 for(imuchit = p->begin(); 00179 imuchit != p->end(); 00180 imuchit++){ 00181 int part = (*imuchit)->Part(); 00182 int seg = (*imuchit)->Seg(); 00183 int gap = (*imuchit)->Gap(); 00184 int strip= (*imuchit)->Strip(); 00185 00186 MucRecHitID gapID(part, seg, gap); 00187 int hitCount = m_GapHitCount[gapID]; 00188 MucRecHitID id(part, seg, gap, hitCount); 00189 00190 m_pHit[id] = *imuchit; 00191 if(!m_pHit[id]) { 00192 cout << "MucRecHitContainer::AddHit-F1 failed to create new MucRecHit" << endl; 00193 } 00194 else { 00195 m_GapHitCount[gapID]++; 00196 } 00197 00198 00199 } 00200 00201 }
|
|
|
|
|
|
|
|
|