BOSS 7.0.2
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
 
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 ()
 
static const CLID & classID ()
 

Protected Attributes

RecEmcID fClusterId
 
RecEmcHitMap fHitMap
 
RecEmcHitMap fSeedMap
 
vector< RecEmcIDfShowerIdVec
 

Detailed Description

Constructor & Destructor Documentation

◆ RecEmcCluster() [1/2]

RecEmcCluster::RecEmcCluster ( )

Definition at line 14 of file RecEmcCluster.cxx.

15{
16 Clear();
17}

◆ ~RecEmcCluster() [1/2]

RecEmcCluster::~RecEmcCluster ( )

Definition at line 19 of file RecEmcCluster.cxx.

20{
21 Clear();
22}

◆ RecEmcCluster() [2/2]

RecEmcCluster::RecEmcCluster ( )

◆ ~RecEmcCluster() [2/2]

RecEmcCluster::~RecEmcCluster ( )

Member Function Documentation

◆ Begin() [1/2]

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

◆ Begin() [2/2]

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

◆ BeginSeed() [1/2]

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

Definition at line 176 of file RecEmcCluster.cxx.

Referenced by operator<<().

◆ BeginSeed() [2/2]

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

◆ classID() [1/2]

static const CLID & RecEmcCluster::classID ( )
inlinestatic

Definition at line 26 of file Emc/EmcRecEventModel/EmcRecEventModel-01-01-18/EmcRecEventModel/RecEmcCluster.h.

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

Referenced by clID().

◆ classID() [2/2]

static const CLID & RecEmcCluster::classID ( )
inlinestatic

◆ Clear() [1/2]

◆ Clear() [2/2]

void RecEmcCluster::Clear ( )

◆ clID() [1/2]

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

◆ clID() [2/2]

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

◆ ClusterId() [1/2]

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().

◆ ClusterId() [2/2]

void RecEmcCluster::ClusterId ( const RecEmcID  id)

◆ Dump() [1/2]

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}

◆ Dump() [2/2]

void RecEmcCluster::Dump ( ) const

◆ End() [1/2]

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().

◆ End() [2/2]

RecEmcHitMap::const_iterator RecEmcCluster::End ( ) const

◆ EndSeed() [1/2]

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

Definition at line 181 of file RecEmcCluster.cxx.

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

Referenced by operator<<().

◆ EndSeed() [2/2]

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

◆ Erase() [1/2]

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

◆ Erase() [2/2]

void RecEmcCluster::Erase ( const RecEmcHit aHit)

◆ Find() [1/2]

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().

◆ Find() [2/2]

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

◆ FindSeed() [1/2]

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}

◆ FindSeed() [2/2]

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

◆ getClusterId() [1/2]

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

◆ getClusterId() [2/2]

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

◆ getEnergy() [1/2]

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}
Double_t etot

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

◆ getEnergy() [2/2]

RecEmcEnergy RecEmcCluster::getEnergy ( ) const

◆ getPosition() [1/2]

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().

◆ getPosition() [2/2]

HepPoint3D RecEmcCluster::getPosition ( ) const

◆ getSecondMoment() [1/2]

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().

◆ getSecondMoment() [2/2]

double RecEmcCluster::getSecondMoment ( ) const

◆ getSeedSize() [1/2]

int RecEmcCluster::getSeedSize ( ) const

Definition at line 199 of file RecEmcCluster.cxx.

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

Referenced by operator<<().

◆ getSeedSize() [2/2]

int RecEmcCluster::getSeedSize ( ) const

◆ getShowerIdVec() [1/2]

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

◆ getShowerIdVec() [2/2]

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

◆ getShowerSize() [1/2]

int RecEmcCluster::getShowerSize ( ) const

Definition at line 204 of file RecEmcCluster.cxx.

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

Referenced by operator<<().

◆ getShowerSize() [2/2]

int RecEmcCluster::getShowerSize ( ) const

◆ Insert() [1/2]

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().

◆ Insert() [2/2]

void RecEmcCluster::Insert ( const RecEmcHit aHit)

◆ InsertSeed() [1/2]

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().

◆ InsertSeed() [2/2]

void RecEmcCluster::InsertSeed ( const RecEmcHit aSeed)

◆ InsertShowerId() [1/2]

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().

◆ InsertShowerId() [2/2]

void RecEmcCluster::InsertShowerId ( const RecEmcID  id)

◆ ShowerIdVec() [1/2]

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

◆ ShowerIdVec() [2/2]

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

Member Data Documentation

◆ fClusterId

RecEmcID RecEmcCluster::fClusterId
protected

◆ fHitMap

◆ fSeedMap

◆ fShowerIdVec

vector< RecEmcID > RecEmcCluster::fShowerIdVec
protected

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