SND@LHC Software
Loading...
Searching...
No Matches
hcalModule.cxx
Go to the documentation of this file.
1
7#include "hcalModule.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 hcalModule::CountNeighbors(const std::list<hcalModule*>& lst) const
19{
20 Int_t c=0;
21 list<hcalModule*>::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 hcalModule::GetClusterEnergy(Float_t& EcalEnergy)
31{
32 EcalEnergy=-1;
33 EcalEnergy=GetEnergy();
34 list<hcalModule*>::const_iterator p;
35 for(p=fNeighbors.begin();p!=fNeighbors.end();++p)
36 {
37 EcalEnergy+=(*p)->GetEnergy();
38 }
39}
40
Float_t GetEnergy() const
Definition hcalModule.h:41
void GetClusterEnergy(Float_t &EcalEnergy)
Int_t CountNeighbors(const std::list< hcalModule * > &lst) const
std::list< hcalModule * > fNeighbors
Definition hcalModule.h:87