Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RecEmcCluster Class Reference

#include <RecEmcCluster.h>

Inheritance diagram for RecEmcCluster:

ContainedObject ContainedObject List of all members.

Public Member Functions

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

Static Public Member Functions

const CLID & classID ()
const CLID & classID ()

Protected Attributes

RecEmcID fClusterId
RecEmcHitMap fHitMap
RecEmcHitMap fSeedMap
vector< RecEmcIDfShowerIdVec
vector< RecEmcIDfShowerIdVec

Constructor & Destructor Documentation

RecEmcCluster::RecEmcCluster  ) 
 

00015 {
00016   Clear();
00017 }

RecEmcCluster::~RecEmcCluster  ) 
 

00020 {
00021   Clear();
00022 }

RecEmcCluster::RecEmcCluster  ) 
 

RecEmcCluster::~RecEmcCluster  ) 
 


Member Function Documentation

RecEmcHitMap::const_iterator RecEmcCluster::Begin  )  const
 

RecEmcHitMap::const_iterator RecEmcCluster::Begin  )  const
 

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

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed  )  const
 

RecEmcHitMap::const_iterator RecEmcCluster::BeginSeed  )  const
 

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

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

00026 { return CLID_RecEmcCluster; }

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

00026 { return CLID_RecEmcCluster; }

void RecEmcCluster::Clear  ) 
 

void RecEmcCluster::Clear  ) 
 

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

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

00025 { return  RecEmcCluster::classID();}

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

00025 { return  RecEmcCluster::classID();}

void RecEmcCluster::ClusterId const RecEmcID  id  ) 
 

void RecEmcCluster::ClusterId const RecEmcID  id  ) 
 

00111 {
00112   fClusterId=id;
00113 }

void RecEmcCluster::Dump  )  const
 

void RecEmcCluster::Dump  )  const
 

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
 

RecEmcHitMap::const_iterator RecEmcCluster::End  )  const
 

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

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed  )  const
 

RecEmcHitMap::const_iterator RecEmcCluster::EndSeed  )  const
 

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

void RecEmcCluster::Erase const RecEmcHit aHit  ) 
 

void RecEmcCluster::Erase const RecEmcHit aHit  ) 
 

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
 

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

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

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

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

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

RecEmcID RecEmcCluster::getClusterId  )  const [inline]
 

00041 { return fClusterId; }

RecEmcID RecEmcCluster::getClusterId  )  const [inline]
 

00041 { return fClusterId; }

RecEmcEnergy RecEmcCluster::getEnergy  )  const
 

RecEmcEnergy RecEmcCluster::getEnergy  )  const
 

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
 

HepPoint3D RecEmcCluster::getPosition  )  const
 

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
 

double RecEmcCluster::getSecondMoment  )  const
 

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
 

int RecEmcCluster::getSeedSize  )  const
 

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

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

00072 { return fShowerIdVec; }

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

00072 { return fShowerIdVec; }

int RecEmcCluster::getShowerSize  )  const
 

int RecEmcCluster::getShowerSize  )  const
 

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

void RecEmcCluster::Insert const RecEmcHit aHit  ) 
 

void RecEmcCluster::Insert const RecEmcHit aHit  ) 
 

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

void RecEmcCluster::InsertSeed const RecEmcHit aSeed  ) 
 

void RecEmcCluster::InsertSeed const RecEmcHit aSeed  ) 
 

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

void RecEmcCluster::InsertShowerId const RecEmcID  id  ) 
 

void RecEmcCluster::InsertShowerId const RecEmcID  id  ) 
 

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

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

00073 { fShowerIdVec=showerIdVec; }

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

00073 { fShowerIdVec=showerIdVec; }


Member Data Documentation

RecEmcID RecEmcCluster::fClusterId [protected]
 

RecEmcHitMap RecEmcCluster::fHitMap [protected]
 

RecEmcHitMap RecEmcCluster::fSeedMap [protected]
 

vector<RecEmcID> RecEmcCluster::fShowerIdVec [protected]
 

vector<RecEmcID> RecEmcCluster::fShowerIdVec [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:44:11 2011 for BOSS6.5.5 by  doxygen 1.3.9.1