BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
RecEmcCluster Class Reference

#include <RecEmcCluster.h>

+ Inheritance diagram for RecEmcCluster:

Public Member Functions

virtual const CLID & clID () const
 
 RecEmcCluster ()
 
 ~RecEmcCluster ()
 
void Clear ()
 
RecEmcID getClusterId () const
 
void ClusterId (const RecEmcID id)
 
RecEmcEnergy getEnergy () const
 
HepPoint3D getPosition () const
 
double getSecondMoment () const
 
RecEmcHitMap::const_iterator Begin () const
 
RecEmcHitMap::const_iterator End () const
 
RecEmcHitMap::const_iterator Find (const RecEmcID &CellId) const
 
void Insert (const RecEmcHit &aHit)
 
void Erase (const RecEmcHit &aHit)
 
RecEmcHitMap::const_iterator BeginSeed () const
 
RecEmcHitMap::const_iterator EndSeed () const
 
RecEmcHitMap::const_iterator FindSeed (const RecEmcID &CellId) const
 
int getSeedSize () const
 
void InsertSeed (const RecEmcHit &aSeed)
 
int getShowerSize () const
 
void InsertShowerId (const RecEmcID id)
 
vector< RecEmcIDgetShowerIdVec () const
 
void ShowerIdVec (const vector< RecEmcID > &showerIdVec)
 
void Dump () const
 

Static Public Member Functions

static const CLID & classID ()
 

Protected Attributes

RecEmcID fClusterId
 
RecEmcHitMap fHitMap
 
RecEmcHitMap fSeedMap
 
vector< RecEmcIDfShowerIdVec
 

Detailed Description

Definition at line 21 of file RecEmcCluster.h.

Constructor & Destructor Documentation

◆ RecEmcCluster()

RecEmcCluster::RecEmcCluster ( )

Definition at line 14 of file RecEmcCluster.cxx.

15{
16 Clear();
17}

◆ ~RecEmcCluster()

RecEmcCluster::~RecEmcCluster ( )

Definition at line 19 of file RecEmcCluster.cxx.

20{
21 Clear();
22}

Member Function Documentation

◆ Begin()

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

Definition at line 115 of file RecEmcCluster.cxx.

116{
117 return fHitMap.begin();
118}
RecEmcHitMap fHitMap
Definition: RecEmcCluster.h:82

Referenced by operator<<(), EmcRecSeedEThreshold::Seed(), EmcRecSeedLocalMax::Seed(), and EmcRecSplitWeighted::Split().

◆ BeginSeed()

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

Definition at line 176 of file RecEmcCluster.cxx.

177{
178 return fSeedMap.begin();
179}
RecEmcHitMap fSeedMap
Definition: RecEmcCluster.h:84

Referenced by operator<<().

◆ classID()

static const CLID & RecEmcCluster::classID ( )
inlinestatic

Definition at line 26 of file RecEmcCluster.h.

26{ return CLID_RecEmcCluster; }
const CLID & CLID_RecEmcCluster
Definition: EventModel.cxx:323

Referenced by clID().

◆ Clear()

void RecEmcCluster::Clear ( )

Definition at line 96 of file RecEmcCluster.cxx.

97{
99 fHitMap.clear();
100 fSeedMap.clear();
101 fShowerIdVec.clear();
102}
void clear()
Reset to invalid state.
Definition: Identifier.h:152
RecEmcID fClusterId
Definition: RecEmcCluster.h:80
vector< RecEmcID > fShowerIdVec
Definition: RecEmcCluster.h:87

Referenced by EmcRecHit2Cluster::Convert(), Erase(), RecEmcCluster(), and ~RecEmcCluster().

◆ clID()

virtual const CLID & RecEmcCluster::clID ( ) const
inlinevirtual

Definition at line 25 of file RecEmcCluster.h.

25{ return RecEmcCluster::classID();}
static const CLID & classID()
Definition: RecEmcCluster.h:26

◆ ClusterId()

void RecEmcCluster::ClusterId ( const RecEmcID  id)

Definition at line 110 of file RecEmcCluster.cxx.

111{
112 fClusterId=id;
113}

Referenced by EmcRecHit2Cluster::Convert(), and RecEmcClusterCnv::TObjectToDataObject().

◆ Dump()

void RecEmcCluster::Dump ( ) const

Definition at line 288 of file RecEmcCluster.cxx.

289{
290 RecEmcHitMap::const_iterator pHitMap;
291
292 cout<<"EMC Cluster: ";
293
294 cout<<"Cluster Id= ";
295 cout<<fClusterId<<endl;
296
297 for(pHitMap=fHitMap.begin();
298 pHitMap!=fHitMap.end();
299 pHitMap++)
300 {
301 pHitMap->second.Dump();
302 }
303}

◆ End()

RecEmcHitMap::const_iterator RecEmcCluster::End ( ) const

Definition at line 120 of file RecEmcCluster.cxx.

121{
122 return fHitMap.end();
123}

Referenced by Erase(), operator<<(), EmcRecSeedEThreshold::Seed(), EmcRecSeedLocalMax::Seed(), and EmcRecSplitWeighted::Split().

◆ EndSeed()

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

Definition at line 181 of file RecEmcCluster.cxx.

182{
183 return fSeedMap.end();
184}

Referenced by operator<<().

◆ Erase()

void RecEmcCluster::Erase ( const RecEmcHit aHit)

Definition at line 139 of file RecEmcCluster.cxx.

140{
141 RecEmcHitMap::const_iterator pHitMap;
142 pHitMap=fHitMap.find(aHit.getCellId());
143
144 //blank HitMap
145 if(fHitMap.empty())
146 {
147 return;
148 }
149
150 //not find
151 if(pHitMap==End())
152 {
153 return;
154 }
155
156 //find it
157 if(pHitMap!=End())
158 {
159 fHitMap.erase(pHitMap->first);
160 //empty
161 if(fHitMap.empty())
162 {
163 Clear();
164 return;
165 }
166 //not empty
167 else
168 {
169 fClusterId=fHitMap.begin()->first;
170 return;
171 }
172 }
173}
RecEmcHitMap::const_iterator End() const
RecEmcID getCellId() const
Definition: RecEmcHit.h:47

◆ Find()

RecEmcHitMap::const_iterator RecEmcCluster::Find ( const RecEmcID CellId) const

Definition at line 125 of file RecEmcCluster.cxx.

126{
127 // If failed the return vale is End().
128 return fHitMap.find(CellId);
129}

Referenced by EmcRecSeedEThreshold::Seed(), EmcRecSeedLocalMax::Seed(), and EmcRecSplitWeighted::Split().

◆ FindSeed()

RecEmcHitMap::const_iterator RecEmcCluster::FindSeed ( const RecEmcID CellId) const

Definition at line 186 of file RecEmcCluster.cxx.

187{
188 // If failed the return vale is End().
189 return fSeedMap.find(CellId);
190}

◆ getClusterId()

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

Definition at line 41 of file RecEmcCluster.h.

41{ return fClusterId; }

Referenced by EmcRecFastCluster2Shower::Convert(), operator<<(), and EmcRecSplitWeighted::Split().

◆ getEnergy()

RecEmcEnergy RecEmcCluster::getEnergy ( ) const

Definition at line 216 of file RecEmcCluster.cxx.

217{
218 RecEmcHitMap::const_iterator pHitMap;
219 double etot=0;
220
221 for(pHitMap=fHitMap.begin();
222 pHitMap!=fHitMap.end();
223 pHitMap++) {
224 etot+=pHitMap->second.getEnergy();
225 }
226 return etot;
227}

Referenced by EmcRecFastCluster2Shower::Convert(), and EmcRecSplitWeighted::Split().

◆ getPosition()

HepPoint3D RecEmcCluster::getPosition ( ) const

Definition at line 230 of file RecEmcCluster.cxx.

231{
232 IEmcRecGeoSvc* iGeoSvc;
233 ISvcLocator* svcLocator = Gaudi::svcLocator();
234 StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
235 if(sc!=StatusCode::SUCCESS) {
236 cout<<"Error: Can't get EmcRecGeoSvc"<<endl;
237 }
238
239 RecEmcHitMap::const_iterator pHitMap;
240 HepPoint3D pos(0,0,0);
241 HepPoint3D possum(0,0,0);
242 double etot=0;
243
244 for(pHitMap=fHitMap.begin();
245 pHitMap!=fHitMap.end();
246 pHitMap++) {
247 etot+=pHitMap->second.getEnergy();
248 pos=iGeoSvc->GetCFrontCenter(pHitMap->second.getCellId());
249 possum+=pos*pHitMap->second.getEnergy();
250 }
251
252 if(etot>0) {
253 possum/=etot;
254 }
255 return possum;
256}
virtual HepPoint3D GetCFrontCenter(const Identifier &id) const =0

Referenced by EmcRecFastCluster2Shower::Convert(), and getSecondMoment().

◆ getSecondMoment()

double RecEmcCluster::getSecondMoment ( ) const

Definition at line 259 of file RecEmcCluster.cxx.

260{
261 IEmcRecGeoSvc* iGeoSvc;
262 ISvcLocator* svcLocator = Gaudi::svcLocator();
263 StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
264 if(sc!=StatusCode::SUCCESS) {
265 cout<<"Error: Can't get EmcRecGeoSvc"<<endl;
266 }
267
268 double etot=0;
269 double sum=0;
270 HepPoint3D center(getPosition());
271 RecEmcHitMap::const_iterator pHitMap;
272
273 for(pHitMap=fHitMap.begin();
274 pHitMap!=fHitMap.end();
275 pHitMap++) {
276 HepPoint3D pos(pHitMap->second.getFrontCenter());
277 etot+=pHitMap->second.getEnergy();
278 sum+=pHitMap->second.getEnergy()*pos.distance2(center);
279 }
280
281 if(etot>0) {
282 sum/=etot;
283 }
284 return sum;
285}
HepPoint3D getPosition() const

Referenced by EmcRec::execute(), and EmcRecSplitWeighted::Split().

◆ getSeedSize()

int RecEmcCluster::getSeedSize ( ) const

Definition at line 199 of file RecEmcCluster.cxx.

200{
201 return fSeedMap.size();
202}

Referenced by operator<<().

◆ getShowerIdVec()

vector< RecEmcID > RecEmcCluster::getShowerIdVec ( ) const
inline

Definition at line 72 of file RecEmcCluster.h.

72{ return fShowerIdVec; }

Referenced by operator<<().

◆ getShowerSize()

int RecEmcCluster::getShowerSize ( ) const

Definition at line 204 of file RecEmcCluster.cxx.

205{
206 return fShowerIdVec.size();
207}

Referenced by operator<<().

◆ Insert()

void RecEmcCluster::Insert ( const RecEmcHit aHit)

Definition at line 132 of file RecEmcCluster.cxx.

133{
134 fHitMap[aHit.getCellId()]=aHit;
135 //fClusterId=fHitMap.begin()->first;
136 return;
137}

Referenced by EmcRecHit2Cluster::Convert(), and RecEmcClusterCnv::TObjectToDataObject().

◆ InsertSeed()

void RecEmcCluster::InsertSeed ( const RecEmcHit aSeed)

Definition at line 193 of file RecEmcCluster.cxx.

194{
195 fSeedMap[aSeed.getCellId()]=aSeed;
196 return;
197}

Referenced by RecEmcClusterCnv::TObjectToDataObject().

◆ InsertShowerId()

void RecEmcCluster::InsertShowerId ( const RecEmcID  id)

Definition at line 210 of file RecEmcCluster.cxx.

211{
212 fShowerIdVec.push_back(id);
213}

Referenced by EmcRecSplitWeighted::Split().

◆ ShowerIdVec()

void RecEmcCluster::ShowerIdVec ( const vector< RecEmcID > &  showerIdVec)
inline

Definition at line 73 of file RecEmcCluster.h.

73{ fShowerIdVec=showerIdVec; }

Referenced by RecEmcClusterCnv::TObjectToDataObject().

Member Data Documentation

◆ fClusterId

RecEmcID RecEmcCluster::fClusterId
protected

Definition at line 80 of file RecEmcCluster.h.

Referenced by Clear(), ClusterId(), Dump(), Erase(), and getClusterId().

◆ fHitMap

RecEmcHitMap RecEmcCluster::fHitMap
protected

◆ fSeedMap

RecEmcHitMap RecEmcCluster::fSeedMap
protected

Definition at line 84 of file RecEmcCluster.h.

Referenced by BeginSeed(), Clear(), EndSeed(), FindSeed(), getSeedSize(), and InsertSeed().

◆ fShowerIdVec

vector<RecEmcID> RecEmcCluster::fShowerIdVec
protected

Definition at line 87 of file RecEmcCluster.h.

Referenced by Clear(), getShowerIdVec(), getShowerSize(), InsertShowerId(), and ShowerIdVec().


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