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

Protected Attributes

RecEmcID fClusterId
RecEmcHitMap fHitMap
RecEmcHitMap fSeedMap
vector< RecEmcIDfShowerIdVec

Detailed Description

Constructor & Destructor Documentation

◆ RecEmcCluster() [1/3]

RecEmcCluster::RecEmcCluster ( )

Definition at line 14 of file RecEmcCluster.cxx.

14{ Clear(); }

◆ ~RecEmcCluster() [1/3]

RecEmcCluster::~RecEmcCluster ( )

Definition at line 16 of file RecEmcCluster.cxx.

16{ Clear(); }

◆ RecEmcCluster() [2/3]

RecEmcCluster::RecEmcCluster ( )

◆ ~RecEmcCluster() [2/3]

RecEmcCluster::~RecEmcCluster ( )

◆ RecEmcCluster() [3/3]

RecEmcCluster::RecEmcCluster ( )

◆ ~RecEmcCluster() [3/3]

RecEmcCluster::~RecEmcCluster ( )

Member Function Documentation

◆ Begin() [1/3]

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

◆ Begin() [2/3]

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

◆ Begin() [3/3]

RecEmcHitMap::const_iterator RecEmcCluster::Begin ( ) const

◆ BeginSeed() [1/3]

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

Definition at line 151 of file RecEmcCluster.cxx.

Referenced by operator<<().

◆ BeginSeed() [2/3]

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

◆ BeginSeed() [3/3]

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed ( ) const

◆ classID() [1/3]

const CLID & RecEmcCluster::classID ( )
inlinestatic

Definition at line 24 of file Emc/EmcRecEventModel/include/EmcRecEventModel/RecEmcCluster.h.

24{ return CLID_RecEmcCluster; }
const CLID & CLID_RecEmcCluster

Referenced by clID().

◆ classID() [2/3]

const CLID & RecEmcCluster::classID ( )
inlinestatic

◆ classID() [3/3]

const CLID & RecEmcCluster::classID ( )
inlinestatic

◆ Clear() [1/3]

void RecEmcCluster::Clear ( )

◆ Clear() [2/3]

void RecEmcCluster::Clear ( )

◆ Clear() [3/3]

void RecEmcCluster::Clear ( )

◆ clID() [1/3]

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

◆ clID() [2/3]

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

◆ clID() [3/3]

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

◆ ClusterId() [1/3]

void RecEmcCluster::ClusterId ( const RecEmcID id)

Definition at line 103 of file RecEmcCluster.cxx.

103{ fClusterId = id; }

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

◆ ClusterId() [2/3]

void RecEmcCluster::ClusterId ( const RecEmcID id)

◆ ClusterId() [3/3]

void RecEmcCluster::ClusterId ( const RecEmcID id)

◆ Dump() [1/3]

void RecEmcCluster::Dump ( ) const

Definition at line 230 of file RecEmcCluster.cxx.

230 {
231 RecEmcHitMap::const_iterator pHitMap;
232
233 cout << "EMC Cluster: ";
234
235 cout << "Cluster Id= ";
236 cout << fClusterId << endl;
237
238 for ( pHitMap = fHitMap.begin(); pHitMap != fHitMap.end(); pHitMap++ )
239 { pHitMap->second.Dump(); }
240}

◆ Dump() [2/3]

void RecEmcCluster::Dump ( ) const

◆ Dump() [3/3]

void RecEmcCluster::Dump ( ) const

◆ End() [1/3]

RecEmcHitMap::const_iterator RecEmcCluster::End ( ) const

◆ End() [2/3]

RecEmcHitMap::const_iterator RecEmcCluster::End ( ) const

◆ End() [3/3]

RecEmcHitMap::const_iterator RecEmcCluster::End ( ) const

◆ EndSeed() [1/3]

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

Definition at line 153 of file RecEmcCluster.cxx.

153{ return fSeedMap.end(); }

Referenced by operator<<().

◆ EndSeed() [2/3]

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

◆ EndSeed() [3/3]

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed ( ) const

◆ Erase() [1/3]

void RecEmcCluster::Erase ( const RecEmcHit & aHit)

Definition at line 121 of file RecEmcCluster.cxx.

121 {
122 RecEmcHitMap::const_iterator pHitMap;
123 pHitMap = fHitMap.find( aHit.getCellId() );
124
125 // blank HitMap
126 if ( fHitMap.empty() ) { return; }
127
128 // not find
129 if ( pHitMap == End() ) { return; }
130
131 // find it
132 if ( pHitMap != End() )
133 {
134 fHitMap.erase( pHitMap->first );
135 // empty
136 if ( fHitMap.empty() )
137 {
138 Clear();
139 return;
140 }
141 // not empty
142 else
143 {
144 fClusterId = fHitMap.begin()->first;
145 return;
146 }
147 }
148}
RecEmcHitMap::const_iterator End() const

◆ Erase() [2/3]

void RecEmcCluster::Erase ( const RecEmcHit & aHit)

◆ Erase() [3/3]

void RecEmcCluster::Erase ( const RecEmcHit & aHit)

◆ Find() [1/3]

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

Definition at line 109 of file RecEmcCluster.cxx.

109 {
110 // If failed the return vale is End().
111 return fHitMap.find( CellId );
112}

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

◆ Find() [2/3]

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

◆ Find() [3/3]

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

◆ FindSeed() [1/3]

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

Definition at line 155 of file RecEmcCluster.cxx.

155 {
156 // If failed the return vale is End().
157 return fSeedMap.find( CellId );
158}

◆ FindSeed() [2/3]

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

◆ FindSeed() [3/3]

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

◆ getClusterId() [1/3]

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

◆ getClusterId() [2/3]

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

◆ getClusterId() [3/3]

RecEmcID RecEmcCluster::getClusterId ( ) const
inline

◆ getEnergy() [1/3]

RecEmcEnergy RecEmcCluster::getEnergy ( ) const

Definition at line 174 of file RecEmcCluster.cxx.

174 {
175 RecEmcHitMap::const_iterator pHitMap;
176 double etot = 0;
177
178 for ( pHitMap = fHitMap.begin(); pHitMap != fHitMap.end(); pHitMap++ )
179 { etot += pHitMap->second.getEnergy(); }
180 return etot;
181}
Double_t etot

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

◆ getEnergy() [2/3]

RecEmcEnergy RecEmcCluster::getEnergy ( ) const

◆ getEnergy() [3/3]

RecEmcEnergy RecEmcCluster::getEnergy ( ) const

◆ getPosition() [1/3]

HepPoint3D RecEmcCluster::getPosition ( ) const

Definition at line 184 of file RecEmcCluster.cxx.

184 {
185 IEmcRecGeoSvc* iGeoSvc;
186 ISvcLocator* svcLocator = Gaudi::svcLocator();
187 StatusCode sc = svcLocator->service( "EmcRecGeoSvc", iGeoSvc );
188 if ( sc != StatusCode::SUCCESS ) { cout << "Error: Can't get EmcRecGeoSvc" << endl; }
189
190 RecEmcHitMap::const_iterator pHitMap;
191 HepPoint3D pos( 0, 0, 0 );
192 HepPoint3D possum( 0, 0, 0 );
193 double etot = 0;
194
195 for ( pHitMap = fHitMap.begin(); pHitMap != fHitMap.end(); pHitMap++ )
196 {
197 etot += pHitMap->second.getEnergy();
198 pos = iGeoSvc->GetCFrontCenter( pHitMap->second.getCellId() );
199 possum += pos * pHitMap->second.getEnergy();
200 }
201
202 if ( etot > 0 ) { possum /= etot; }
203 return possum;
204}
HepGeom::Point3D< double > HepPoint3D
virtual HepPoint3D GetCFrontCenter(const Identifier &id) const =0

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

◆ getPosition() [2/3]

HepPoint3D RecEmcCluster::getPosition ( ) const

◆ getPosition() [3/3]

HepPoint3D RecEmcCluster::getPosition ( ) const

◆ getSecondMoment() [1/3]

double RecEmcCluster::getSecondMoment ( ) const

Definition at line 207 of file RecEmcCluster.cxx.

207 {
208 IEmcRecGeoSvc* iGeoSvc;
209 ISvcLocator* svcLocator = Gaudi::svcLocator();
210 StatusCode sc = svcLocator->service( "EmcRecGeoSvc", iGeoSvc );
211 if ( sc != StatusCode::SUCCESS ) { cout << "Error: Can't get EmcRecGeoSvc" << endl; }
212
213 double etot = 0;
214 double sum = 0;
215 HepPoint3D center( getPosition() );
216 RecEmcHitMap::const_iterator pHitMap;
217
218 for ( pHitMap = fHitMap.begin(); pHitMap != fHitMap.end(); pHitMap++ )
219 {
220 HepPoint3D pos( pHitMap->second.getFrontCenter() );
221 etot += pHitMap->second.getEnergy();
222 sum += pHitMap->second.getEnergy() * pos.distance2( center );
223 }
224
225 if ( etot > 0 ) { sum /= etot; }
226 return sum;
227}
HepPoint3D getPosition() const

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

◆ getSecondMoment() [2/3]

double RecEmcCluster::getSecondMoment ( ) const

◆ getSecondMoment() [3/3]

double RecEmcCluster::getSecondMoment ( ) const

◆ getSeedSize() [1/3]

int RecEmcCluster::getSeedSize ( ) const

Definition at line 166 of file RecEmcCluster.cxx.

166{ return fSeedMap.size(); }

Referenced by operator<<().

◆ getSeedSize() [2/3]

int RecEmcCluster::getSeedSize ( ) const

◆ getSeedSize() [3/3]

int RecEmcCluster::getSeedSize ( ) const

◆ getShowerIdVec() [1/3]

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

Definition at line 70 of file Emc/EmcRecEventModel/include/EmcRecEventModel/RecEmcCluster.h.

70{ return fShowerIdVec; }

Referenced by operator<<().

◆ getShowerIdVec() [2/3]

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

◆ getShowerIdVec() [3/3]

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

◆ getShowerSize() [1/3]

int RecEmcCluster::getShowerSize ( ) const

Definition at line 168 of file RecEmcCluster.cxx.

168{ return fShowerIdVec.size(); }

Referenced by operator<<().

◆ getShowerSize() [2/3]

int RecEmcCluster::getShowerSize ( ) const

◆ getShowerSize() [3/3]

int RecEmcCluster::getShowerSize ( ) const

◆ Insert() [1/3]

void RecEmcCluster::Insert ( const RecEmcHit & aHit)

Definition at line 115 of file RecEmcCluster.cxx.

115 {
116 fHitMap[aHit.getCellId()] = aHit;
117 // fClusterId=fHitMap.begin()->first;
118 return;
119}

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

◆ Insert() [2/3]

void RecEmcCluster::Insert ( const RecEmcHit & aHit)

◆ Insert() [3/3]

void RecEmcCluster::Insert ( const RecEmcHit & aHit)

◆ InsertSeed() [1/3]

void RecEmcCluster::InsertSeed ( const RecEmcHit & aSeed)

Definition at line 161 of file RecEmcCluster.cxx.

161 {
162 fSeedMap[aSeed.getCellId()] = aSeed;
163 return;
164}

Referenced by RecEmcClusterCnv::TObjectToDataObject().

◆ InsertSeed() [2/3]

void RecEmcCluster::InsertSeed ( const RecEmcHit & aSeed)

◆ InsertSeed() [3/3]

void RecEmcCluster::InsertSeed ( const RecEmcHit & aSeed)

◆ InsertShowerId() [1/3]

void RecEmcCluster::InsertShowerId ( const RecEmcID id)

Definition at line 171 of file RecEmcCluster.cxx.

171{ fShowerIdVec.push_back( id ); }

Referenced by EmcRecSplitWeighted::Split().

◆ InsertShowerId() [2/3]

void RecEmcCluster::InsertShowerId ( const RecEmcID id)

◆ InsertShowerId() [3/3]

void RecEmcCluster::InsertShowerId ( const RecEmcID id)

◆ ShowerIdVec() [1/3]

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

◆ ShowerIdVec() [2/3]

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

◆ ShowerIdVec() [3/3]

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

Member Data Documentation

◆ fClusterId

RecEmcID RecEmcCluster::fClusterId
protected

◆ fHitMap

◆ fSeedMap

RecEmcHitMap RecEmcCluster::fSeedMap
protected

◆ fShowerIdVec

vector< RecEmcID > RecEmcCluster::fShowerIdVec
protected

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