SND@LHC Software
Loading...
Searching...
No Matches
ecalCell.cxx
Go to the documentation of this file.
1
7#include "ecalCell.h"
8
9#include <algorithm>
10#include <iostream>
11
12using std::cout;
13using std::endl;
14using std::map;
15using std::list;
16
17//-----------------------------------------------------------------------------
18Int_t ecalCell::CountNeighbors(const std::list<ecalCell*>& lst) const
19{
20 Int_t c=0;
21 list<ecalCell*>::const_iterator p=lst.begin();
22 for(;p!=lst.end();++p)
23 if (find(fNeighbors.begin(), fNeighbors.end(), *p)!=fNeighbors.end())
24 ++c;
25
26 return c;
27}
28
29//-----------------------------------------------------------------------------
30void ecalCell::GetClusterEnergy(Float_t& EcalEnergy)
31{
32 EcalEnergy=-1;
33 EcalEnergy=GetEnergy();
34 list<ecalCell*>::const_iterator p;
35 for(p=fNeighbors.begin();p!=fNeighbors.end();++p)
36 {
37 EcalEnergy+=(*p)->GetEnergy();
38 }
39}
40
41//-----------------------------------------------------------------------------
42// Get list of 8 neighbors
44{
45 list<ecalCell*> c3;
46 list<ecalCell*> c;
47 list<ecalCell*>::const_iterator p;
48 list<ecalCell*>::const_iterator p2;
49
51 for(p=c3.begin();p!=c3.end();++p)
52 {
53 (*p)->GetNeighborsList(c);
54 for(p2=c.begin();p2!=c.end();++p2)
55 if (find(f5x5Cluster.begin(), f5x5Cluster.end(), *p2)==f5x5Cluster.end())
56 f5x5Cluster.push_back(*p2);
57 }
58}
59
void Create5x5Cluster()
Definition ecalCell.cxx:43
void GetNeighborsList(std::list< ecalCell * > &neib) const
Definition ecalCell.h:48
void GetClusterEnergy(Float_t &EcalEnergy)
Definition ecalCell.cxx:30
Int_t CountNeighbors(const std::list< ecalCell * > &lst) const
Definition ecalCell.cxx:18
std::list< ecalCell * > fNeighbors
Definition ecalCell.h:98
Float_t GetEnergy() const
Definition ecalCell.h:42
std::list< ecalCell * > f5x5Cluster
Definition ecalCell.h:100