RecEmcCluster Class Reference

#include <RecEmcCluster.h>

Inheritance diagram for RecEmcCluster:

ContainedObject List of all members.

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

Definition at line 14 of file RecEmcCluster.cxx.

References Clear().

00015 {
00016   Clear();
00017 }

RecEmcCluster::~RecEmcCluster (  ) 

Definition at line 19 of file RecEmcCluster.cxx.

References Clear().

00020 {
00021   Clear();
00022 }


Member Function Documentation

RecEmcHitMap::const_iterator RecEmcCluster::Begin (  )  const

Definition at line 115 of file RecEmcCluster.cxx.

References fHitMap.

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

00116 {
00117   return fHitMap.begin();
00118 }

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed (  )  const

Definition at line 176 of file RecEmcCluster.cxx.

References fSeedMap.

Referenced by operator<<().

00177 {
00178   return fSeedMap.begin();
00179 }

static const CLID& RecEmcCluster::classID (  )  [inline, static]

Definition at line 26 of file RecEmcCluster.h.

References CLID_RecEmcCluster.

Referenced by clID().

00026 { return CLID_RecEmcCluster; }

void RecEmcCluster::Clear (  ) 

Definition at line 96 of file RecEmcCluster.cxx.

References Identifier::clear(), fClusterId, fHitMap, fSeedMap, and fShowerIdVec.

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

00097 {
00098   fClusterId.clear();
00099   fHitMap.clear();
00100   fSeedMap.clear();
00101   fShowerIdVec.clear();
00102 }

virtual const CLID& RecEmcCluster::clID (  )  const [inline, virtual]

Definition at line 25 of file RecEmcCluster.h.

References classID().

00025 { return  RecEmcCluster::classID();}

void RecEmcCluster::ClusterId ( const RecEmcID  id  ) 

Definition at line 110 of file RecEmcCluster.cxx.

References fClusterId.

Referenced by EmcRecHit2Cluster::Convert().

00111 {
00112   fClusterId=id;
00113 }

void RecEmcCluster::Dump (  )  const

Definition at line 288 of file RecEmcCluster.cxx.

References fClusterId, and fHitMap.

00289 {
00290   RecEmcHitMap::const_iterator pHitMap;
00291 
00292   cout<<"EMC Cluster: ";
00293 
00294   cout<<"Cluster Id= ";
00295   cout<<fClusterId<<endl;
00296 
00297   for(pHitMap=fHitMap.begin();
00298       pHitMap!=fHitMap.end();
00299       pHitMap++)
00300   {
00301     pHitMap->second.Dump();
00302   }
00303 }

RecEmcHitMap::const_iterator RecEmcCluster::End (  )  const

Definition at line 120 of file RecEmcCluster.cxx.

References fHitMap.

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

00121 {
00122   return fHitMap.end();
00123 }

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed (  )  const

Definition at line 181 of file RecEmcCluster.cxx.

References fSeedMap.

Referenced by operator<<().

00182 {
00183   return fSeedMap.end();
00184 }

void RecEmcCluster::Erase ( const RecEmcHit aHit  ) 

Definition at line 139 of file RecEmcCluster.cxx.

References Clear(), End(), fClusterId, fHitMap, and RecEmcHit::getCellId().

00140 {      
00141   RecEmcHitMap::const_iterator pHitMap;
00142   pHitMap=fHitMap.find(aHit.getCellId());
00143 
00144   //blank HitMap
00145   if(fHitMap.empty()) 
00146   {
00147     return;
00148   }
00149 
00150   //not find 
00151   if(pHitMap==End()) 
00152   {
00153     return;
00154   }
00155 
00156   //find it
00157   if(pHitMap!=End())
00158   {
00159     fHitMap.erase(pHitMap->first);
00160     //empty
00161     if(fHitMap.empty())
00162     {
00163       Clear();
00164       return;
00165     }
00166     //not empty
00167     else
00168     {
00169       fClusterId=fHitMap.begin()->first;
00170       return;
00171     }
00172   }
00173 }

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

Definition at line 125 of file RecEmcCluster.cxx.

References fHitMap.

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

00126 {   
00127   // If failed the return vale is End().
00128   return fHitMap.find(CellId);
00129 }

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

Definition at line 186 of file RecEmcCluster.cxx.

References fSeedMap.

00187 {   
00188   // If failed the return vale is End().
00189   return fSeedMap.find(CellId);
00190 }

RecEmcID RecEmcCluster::getClusterId (  )  const [inline]

Definition at line 41 of file RecEmcCluster.h.

References fClusterId.

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

00041 { return fClusterId; }

RecEmcEnergy RecEmcCluster::getEnergy (  )  const

Definition at line 216 of file RecEmcCluster.cxx.

References fHitMap.

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

00217 {
00218   RecEmcHitMap::const_iterator pHitMap;
00219   double etot=0;
00220 
00221   for(pHitMap=fHitMap.begin();
00222       pHitMap!=fHitMap.end();
00223       pHitMap++) {
00224     etot+=pHitMap->second.getEnergy();
00225   }
00226   return etot;
00227 }

HepPoint3D RecEmcCluster::getPosition (  )  const

Definition at line 230 of file RecEmcCluster.cxx.

References fHitMap, IEmcRecGeoSvc::GetCFrontCenter(), and boss::pos.

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

00231 {
00232   IEmcRecGeoSvc* iGeoSvc;
00233   ISvcLocator* svcLocator = Gaudi::svcLocator();
00234   StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
00235   if(sc!=StatusCode::SUCCESS) {
00236     cout<<"Error: Can't get EmcRecGeoSvc"<<endl;
00237   }
00238 
00239   RecEmcHitMap::const_iterator pHitMap;
00240   HepPoint3D pos(0,0,0);
00241   HepPoint3D possum(0,0,0);
00242   double etot=0;
00243 
00244   for(pHitMap=fHitMap.begin();
00245       pHitMap!=fHitMap.end();
00246       pHitMap++) {
00247     etot+=pHitMap->second.getEnergy();
00248     pos=iGeoSvc->GetCFrontCenter(pHitMap->second.getCellId());
00249     possum+=pos*pHitMap->second.getEnergy();
00250   }
00251 
00252   if(etot>0) {
00253     possum/=etot;
00254   }
00255   return possum;
00256 }

double RecEmcCluster::getSecondMoment (  )  const

Definition at line 259 of file RecEmcCluster.cxx.

References fHitMap, getPosition(), and boss::pos.

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

00260 {
00261   IEmcRecGeoSvc* iGeoSvc;
00262   ISvcLocator* svcLocator = Gaudi::svcLocator();
00263   StatusCode sc = svcLocator->service("EmcRecGeoSvc",iGeoSvc);
00264   if(sc!=StatusCode::SUCCESS) {
00265     cout<<"Error: Can't get EmcRecGeoSvc"<<endl;
00266   }
00267 
00268   double etot=0;
00269   double sum=0;
00270   HepPoint3D center(getPosition());
00271   RecEmcHitMap::const_iterator pHitMap;
00272 
00273   for(pHitMap=fHitMap.begin();
00274       pHitMap!=fHitMap.end();
00275       pHitMap++) {
00276     HepPoint3D pos(pHitMap->second.getFrontCenter());
00277     etot+=pHitMap->second.getEnergy();
00278     sum+=pHitMap->second.getEnergy()*pos.distance2(center);
00279   }
00280 
00281   if(etot>0) {
00282     sum/=etot;
00283   }
00284   return sum;
00285 }

int RecEmcCluster::getSeedSize (  )  const

Definition at line 199 of file RecEmcCluster.cxx.

References fSeedMap.

Referenced by operator<<().

00200 {
00201   return fSeedMap.size();
00202 }

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

Definition at line 72 of file RecEmcCluster.h.

References fShowerIdVec.

Referenced by operator<<().

00072 { return fShowerIdVec; }

int RecEmcCluster::getShowerSize (  )  const

Definition at line 204 of file RecEmcCluster.cxx.

References fShowerIdVec.

Referenced by operator<<().

00205 {
00206   return fShowerIdVec.size();
00207 }

void RecEmcCluster::Insert ( const RecEmcHit aHit  ) 

Definition at line 132 of file RecEmcCluster.cxx.

References fHitMap, and RecEmcHit::getCellId().

Referenced by EmcRecHit2Cluster::Convert().

00133 {
00134   fHitMap[aHit.getCellId()]=aHit;
00135   //fClusterId=fHitMap.begin()->first;
00136   return;
00137 }

void RecEmcCluster::InsertSeed ( const RecEmcHit aSeed  ) 

Definition at line 193 of file RecEmcCluster.cxx.

References fSeedMap, and RecEmcHit::getCellId().

00194 {
00195   fSeedMap[aSeed.getCellId()]=aSeed;
00196   return;
00197 }

void RecEmcCluster::InsertShowerId ( const RecEmcID  id  ) 

Definition at line 210 of file RecEmcCluster.cxx.

References fShowerIdVec.

Referenced by EmcRecSplitWeighted::Split().

00211 {
00212   fShowerIdVec.push_back(id);
00213 }

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

Definition at line 73 of file RecEmcCluster.h.

References fShowerIdVec.

00073 { fShowerIdVec=showerIdVec; }


Member Data Documentation

RecEmcID RecEmcCluster::fClusterId [protected]

Definition at line 80 of file RecEmcCluster.h.

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

RecEmcHitMap RecEmcCluster::fHitMap [protected]

Definition at line 82 of file RecEmcCluster.h.

Referenced by Begin(), Clear(), Dump(), End(), Erase(), Find(), getEnergy(), getPosition(), getSecondMoment(), and Insert().

RecEmcHitMap RecEmcCluster::fSeedMap [protected]

Definition at line 84 of file RecEmcCluster.h.

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

vector<RecEmcID> RecEmcCluster::fShowerIdVec [protected]

Definition at line 87 of file RecEmcCluster.h.

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


Generated on Tue Nov 29 23:20:48 2016 for BOSS_7.0.2 by  doxygen 1.4.7