SND@LHC Software
Loading...
Searching...
No Matches
ecalClusterFinder Class Reference

#include <ecalClusterFinder.h>

Inheritance diagram for ecalClusterFinder:
Collaboration diagram for ecalClusterFinder:

Public Member Functions

 ecalClusterFinder (const char *name, const Int_t verbose)
 
 ecalClusterFinder ()
 
virtual ~ecalClusterFinder ()
 
virtual void Finish ()
 
virtual void Exec (Option_t *option)
 
virtual InitStatus Init ()
 
TClonesArray * InitPython (ecalStructure *structure, TClonesArray *maximums, ecalClusterCalibration *calib)
 
Double_t MinMaxE () const
 
Double_t MinClusterE () const
 
void SetMinMaxE (Double_t minmaxe=0.015)
 
void SetMinClusterE (Double_t minmaxe=0.03)
 

Private Member Functions

void FormClusters ()
 
void FormPreClusters ()
 
void ClearPreClusters ()
 
 ecalClusterFinder (const ecalClusterFinder &)
 
ecalClusterFinderoperator= (const ecalClusterFinder &)
 

Private Attributes

Int_t fEv
 
TClonesArray * fMaximums
 
TClonesArray * fClusters
 
ecalStructurefStr
 
ecalClusterCalibrationfCalib
 
ecalInffInf
 
std::list< ecalPreCluster * > fPreClusters
 
Double_t fMinClusterE
 
Double_t fMinMaxE
 

Detailed Description

Definition at line 18 of file ecalClusterFinder.h.

Constructor & Destructor Documentation

◆ ecalClusterFinder() [1/3]

ecalClusterFinder::ecalClusterFinder ( const char *  name,
const Int_t  verbose 
)

Standard constructor

Definition at line 222 of file ecalClusterFinder.cxx.

223 : FairTask(name, verbose),
224 fEv(0),
225 fMaximums(NULL),
226 fClusters(NULL),
227 fStr(NULL),
228 fInf(NULL),
229 fPreClusters(),
230 fMinClusterE(0.03),
231 fMinMaxE(0.015)
232{
233 ;
234}
std::list< ecalPreCluster * > fPreClusters
ecalStructure * fStr
TClonesArray * fClusters
TClonesArray * fMaximums

◆ ecalClusterFinder() [2/3]

ecalClusterFinder::ecalClusterFinder ( )

Only to comply with frame work.

Definition at line 238 of file ecalClusterFinder.cxx.

239 : FairTask(),
240 fEv(0),
241 fMaximums(NULL),
242 fClusters(NULL),
243 fStr(NULL),
244 fInf(NULL),
245 fPreClusters(),
246 fMinClusterE(0.03),
247 fMinMaxE(0.015)
248{
249 ;
250}

◆ ~ecalClusterFinder()

ecalClusterFinder::~ecalClusterFinder ( )
virtual

Destructor

Definition at line 81 of file ecalClusterFinder.cxx.

82{
83 if (fClusters)
84 {
85 fClusters->Delete();
86 delete fClusters;
87 }
88}

◆ ecalClusterFinder() [3/3]

ecalClusterFinder::ecalClusterFinder ( const ecalClusterFinder )
private

Member Function Documentation

◆ ClearPreClusters()

void ecalClusterFinder::ClearPreClusters ( )
private

Clear a preclusters list

Definition at line 213 of file ecalClusterFinder.cxx.

214{
215 list<ecalPreCluster*>::const_iterator p=fPreClusters.begin();
216 for(;p!=fPreClusters.end();++p)
217 delete (*p);
218 fPreClusters.clear();
219}

◆ Exec()

void ecalClusterFinder::Exec ( Option_t *  option)
virtual

Exec a task

Definition at line 22 of file ecalClusterFinder.cxx.

◆ Finish()

void ecalClusterFinder::Finish ( )
virtual

Finish a task

Definition at line 75 of file ecalClusterFinder.cxx.

76{
77 ;
78}

◆ FormClusters()

void ecalClusterFinder::FormClusters ( )
private

Form clusters from precluster

ecalCluster needs a destructor call :-(

Definition at line 144 of file ecalClusterFinder.cxx.

145{
147 fClusters->Delete();
148 Int_t fN=0;
149 list<ecalPreCluster*>::const_iterator p1=fPreClusters.begin();
150 list<ecalPreCluster*>::const_iterator p2;
151 list<ecalCell*> cluster;
152 list<ecalMaximum*> maxs;
153 list<ecalCell*>::const_iterator pc;
154 list<ecalCell*>::const_iterator pc1;
155 UInt_t oldsize;
156 Int_t MaxSize=0;
157 Int_t Maximums=0;
158 Int_t max;
159 Int_t type;
160
161 if (fVerbose>9)
162 {
163 Info("FormClusters", "Total %d preclusters found.", (Int_t)fPreClusters.size());
164 }
165 for(;p1!=fPreClusters.end();++p1)
166 if ((*p1)->fMark==0)
167 {
168 cluster.clear(); oldsize=0; maxs.clear();
169 cluster=(*p1)->fCells; maxs.push_back((*p1)->fMax); type=(*p1)->fMaximum->GetType();
170 max=1;
171 while(cluster.size()!=oldsize)
172 {
173 oldsize=cluster.size();
174 p2=p1;
175 for(++p2;p2!=fPreClusters.end();++p2)
176 if ((*p2)->fMark==0)
177 {
178 pc=cluster.begin();
179 for(;pc!=cluster.end();++pc)
180 {
181 pc1=find((*p2)->fCells.begin(), (*p2)->fCells.end(), (*pc));
182 if (pc1==(*p2)->fCells.end()) continue;
183 break;
184 }
185 if (pc!=cluster.end())
186 {
187 (*p2)->fMark=1;
188 pc=(*p2)->fCells.begin();
189 for(;pc!=(*p2)->fCells.end();++pc)
190 if (find(cluster.begin(), cluster.end(), (*pc))==cluster.end())
191 cluster.push_back(*pc);
192 maxs.push_back((*p2)->fMax);
193 max++;
194 }
195 }
196 }
197 (*p1)->fMark=1;
198 if ((Int_t)cluster.size()>MaxSize)
199 MaxSize=cluster.size();
200 if (max>Maximums) Maximums=max;
201 ecalCluster* cls=new ((*fClusters)[fN]) ecalCluster(fN, cluster, maxs); fN++;
202 cls->fPreCalibrated=fCalib->Calibrate(type, cls->fEnergy);
203 }
204 if (fVerbose>0)
205 {
206 Info("FormClusters", "Total %d clusters formed.", fN);
207 Info("FormClusters", "Maximum size of cluster is %d cells.", MaxSize);
208 Info("FormClusters", "Maximum number of photons per cluster is %d.", Maximums);
209 }
210}
Double_t Calibrate(Int_t celltype, Double_t energy)
ecalClusterCalibration * fCalib
Double_t fEnergy
Definition ecalCluster.h:73
Double_t fPreCalibrated
Definition ecalCluster.h:75
float pc
Definition hepunit.py:64

◆ FormPreClusters()

void ecalClusterFinder::FormPreClusters ( )
private

Form a preclusters

Form a preclusters. A precluster — a group of cells neighbor to maximum cell. A cluster is a group of preclusters with common cells.

Remove maximums matched with charged tracks

Remove low energy maximums

Remove low energy clusters

Definition at line 93 of file ecalClusterFinder.cxx.

94{
95 Int_t nm=fMaximums->GetEntriesFast();
96 Int_t i=0;
98 list<ecalCell*> all;
99 list<ecalCell*>::const_iterator p;
100 list<ecalCell*>::const_iterator p2;
101 list<ecalCell*> cls;
102 list<ecalCell*> cls2;
103 ecalCell* cell;
104 ecalCell* min;
105 Double_t e;
106 Double_t ecls;
107 ecalPreCluster* precluster;
108
109
110 for(;i<nm;i++)
111 {
112 max=(ecalMaximum*)fMaximums->At(i);
113 if (max==NULL) continue;
115 if (max->Mark()!=0) continue;
116 cell=max->Cell();
117 ecls=cell->GetEnergy();
118// cout << ecls << endl;
120 if (ecls<fMinMaxE) continue;
121/*
122 cell->GetNeighborsList(all);
123 cls.clear();
124 for(p=all.begin();p!=all.end();++p)
125 {
126 (*p)->GetNeighborsList(cls2);
127 for(p2=cls2.begin();p2!=cls2.end();++p2)
128 if (find(cls.begin(), cls.end(), *p2)==cls.end()) cls.push_back(*p2);
129 }
130*/
131 cell->Get5x5Cluster(cls);
132 ecls=0.0;
133 for(p=cls.begin();p!=cls.end();++p)
134 ecls+=(*p)->GetEnergy();
135// cout << ":" << ecls << endl;
137 if (ecls<fMinClusterE) continue;
138 precluster=new ecalPreCluster(cls, max);
139 fPreClusters.push_back(precluster);
140 }
141}
void Get5x5Cluster(std::list< ecalCell * > &cls)
Definition ecalCell.h:58
Float_t GetEnergy() const
Definition ecalCell.h:42
int i
Definition ShipAna.py:86

◆ Init()

InitStatus ecalClusterFinder::Init ( )
virtual

Initialization

Definition at line 31 of file ecalClusterFinder.cxx.

32{
33 FairRootManager* io=FairRootManager::Instance();
34 if (!io)
35 {
36 Fatal("Init", "Can't find IOManager.");
37 return kFATAL;
38 }
39 fStr=(ecalStructure*)io->GetObject("EcalStructure");
40 if (!fStr)
41 {
42 Fatal("Init()", "Can't find calorimeter structure in the system.");
43 return kFATAL;
44 }
46 fMaximums=(TClonesArray*)io->GetObject("EcalMaximums");
47 if (!fMaximums)
48 {
49 Fatal("Init", "Can't find array of calorimeter maximums in the system.");
50 return kFATAL;
51 }
52 fCalib=(ecalClusterCalibration*)io->GetObject("ecalClusterCalibration");
53 if (!fCalib)
54 {
55 Fatal("Init", "Can't find ecalClusterCalibration in the system.");
56 return kFATAL;
57 }
58
59 fClusters=new TClonesArray("ecalCluster", 2000);
60 io->Register("EcalClusters", "ECAL", fClusters, kTRUE);
61 fEv=0;
62 return kSUCCESS;
63}
ecalInf * GetEcalInf() const

◆ InitPython()

TClonesArray * ecalClusterFinder::InitPython ( ecalStructure structure,
TClonesArray *  maximums,
ecalClusterCalibration calib 
)

Definition at line 65 of file ecalClusterFinder.cxx.

66{
67 fMaximums=maximums;
68 fStr=structure;
69 fCalib=calib;
70 fClusters=new TClonesArray("ecalCluster", 2000);
71 return fClusters;
72}

◆ MinClusterE()

Double_t ecalClusterFinder::MinClusterE ( ) const
inline

Definition at line 40 of file ecalClusterFinder.h.

40{return fMinClusterE;}

◆ MinMaxE()

Double_t ecalClusterFinder::MinMaxE ( ) const
inline

Definition at line 39 of file ecalClusterFinder.h.

39{return fMinMaxE;}

◆ operator=()

ecalClusterFinder & ecalClusterFinder::operator= ( const ecalClusterFinder )
private

◆ SetMinClusterE()

void ecalClusterFinder::SetMinClusterE ( Double_t  minmaxe = 0.03)
inline

Minimum uncalibrated energy of precluster maximum for consideration

Definition at line 45 of file ecalClusterFinder.h.

45{fMinClusterE=minmaxe;}

◆ SetMinMaxE()

void ecalClusterFinder::SetMinMaxE ( Double_t  minmaxe = 0.015)
inline

Minimum precluster uncalibrated energy

Definition at line 43 of file ecalClusterFinder.h.

43{fMinMaxE=minmaxe;}

Member Data Documentation

◆ fCalib

ecalClusterCalibration* ecalClusterFinder::fCalib
private

Cluster calibration object for photons

Definition at line 64 of file ecalClusterFinder.h.

◆ fClusters

TClonesArray* ecalClusterFinder::fClusters
private

An array of clusters

Definition at line 60 of file ecalClusterFinder.h.

◆ fEv

Int_t ecalClusterFinder::fEv
private

Current event

Definition at line 54 of file ecalClusterFinder.h.

◆ fInf

ecalInf* ecalClusterFinder::fInf
private

An information about calorimeter

Definition at line 66 of file ecalClusterFinder.h.

◆ fMaximums

TClonesArray* ecalClusterFinder::fMaximums
private

Array of maximums in calorimeter. Maximums belong to charged tracks excluded.

Definition at line 58 of file ecalClusterFinder.h.

◆ fMinClusterE

Double_t ecalClusterFinder::fMinClusterE
private

Minimum precluster uncalibrated energy

Definition at line 73 of file ecalClusterFinder.h.

◆ fMinMaxE

Double_t ecalClusterFinder::fMinMaxE
private

Minimum uncalibrated energy of precluster maximum for consideration

Definition at line 75 of file ecalClusterFinder.h.

◆ fPreClusters

std::list<ecalPreCluster*> ecalClusterFinder::fPreClusters
private

A list of preclusters May be better use TClonesArray?

Definition at line 70 of file ecalClusterFinder.h.

◆ fStr

ecalStructure* ecalClusterFinder::fStr
private

A calorimeter structure

Definition at line 62 of file ecalClusterFinder.h.


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