1 <!DOCTYPE HTML PUBLIC "-// IETF/DTD HTML 2.0// EN">
4 <!-- Author: ROOT team (rootdev@hpsalo.cern.ch) -->
6 <!-- Date: Thu Mar 9 00:11:48 2000 -->
9 <title>AliPHOSClusterizerv1 - source file</title>
10 <link rev=made href="mailto:rootdev@root.cern.ch">
11 <meta name="rating" content="General">
12 <meta name="objecttype" content="Manual">
13 <meta name="keywords" content="software development, oo, object oriented, unix, x11, motif, windows nt, c++, html, rene brun, fons rademakers">
14 <meta name="description" content="ROOT - An Object Oriented Framework For Large Scale Data Analysis.">
16 <body BGCOLOR="#ffffff" LINK="#0000ff" VLINK="#551a8b" ALINK="#ff0000" TEXT="#000000">
17 <a name="TopOfPage"></a>
19 /**************************************************************************
20 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
22 * Author: The ALICE Off-line Project. *
23 * Contributors are mentioned in the code where appropriate. *
25 * Permission to use, copy, modify and distribute this software and its *
26 * documentation strictly for non-commercial purposes is hereby granted *
27 * without fee, provided that the above copyright notice appears in all *
28 * copies and that both the copyright notice and this permission notice *
29 * appear in the supporting documentation. The authors make no claims *
30 * about the suitability of this software for any purpose. It is *
31 * provided "as is" without express or implied warranty. *
32 **************************************************************************/
36 <b>//_________________________________________________________________________</b>
37 <b>// Implementation version 1 of the clusterization algorithm </b>
39 <b>//*-- Author: Yves Schutz (SUBATECH) </b>
40 <b>//////////////////////////////////////////////////////////////////////////////</b>
42 <b>// --- ROOT system ---</b>
46 <b>// --- Standard library ---</b>
48 #include <iostream>
50 <b>// --- AliRoot header files ---</b>
52 #include "<a href="../AliPHOSClusterizerv1.h">AliPHOSClusterizerv1.h</a>"
53 #include "<a href="../AliPHOSDigit.h">AliPHOSDigit.h</a>"
54 #include "<a href="../AliPHOSEmcRecPoint.h">AliPHOSEmcRecPoint.h</a>"
55 #include "<a href="../AliPHOSPpsdRecPoint.h">AliPHOSPpsdRecPoint.h</a>"
56 #include "<a href="../AliPHOSv0.h">AliPHOSv0.h</a>"
59 ClassImp(AliPHOSClusterizerv1)
61 <b>//____________________________________________________________________________</b>
62 <a name="AliPHOSClusterizerv1:AliPHOSClusterizerv1"> </a><a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:AliPHOSClusterizerv1">AliPHOSClusterizerv1::AliPHOSClusterizerv1</a>()
64 <b> // default ctor (to be used)</b>
66 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fA">fA</a> = 0.;
67 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fB">fB</a> = 0.01 ;
68 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfEmcClusters">fNumberOfEmcClusters</a> = 0 ;
69 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfPpsdClusters">fNumberOfPpsdClusters</a> = 0 ;
70 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcClusteringThreshold">fEmcClusteringThreshold</a> = 0.1;
71 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcEnergyThreshold">fEmcEnergyThreshold</a> = 0.01;
72 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdClusteringThreshold">fPpsdClusteringThreshold</a> = 0.00000015;
73 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdEnergyThreshold">fPpsdEnergyThreshold</a> = 0.0000001;
74 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fW0">fW0</a> = 4.5 ;
75 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fLocMaxCut">fLocMaxCut</a> = 0.06 ;
78 <b>//____________________________________________________________________________</b>
79 <a name="AliPHOSClusterizerv1:AreNeighbours"> </a><a href="../ListOfTypes.html#Int_t">Int_t</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:AreNeighbours">AliPHOSClusterizerv1::AreNeighbours</a>(<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * d1, <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * d2)
81 <b> // Gives the neighbourness of two digits = 0 are not neighbour but continue searching </b>
82 <b> // = 1 are neighbour</b>
83 <b> // = 2 are not neighbour but do not continue searching</b>
84 <b> // neighbours are defined as digits having at least common vertex</b>
85 <b> // The order of d1 and d2 is important: first (d1) should be a digit already in a cluster </b>
86 <b> // which is compared to a digit (d2) not yet in a cluster </b>
88 <a href="../ListOfTypes.html#Int_t">Int_t</a> rv = 0 ;
90 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * geom = <a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetInstance">AliPHOSGeometry::GetInstance</a>() ;
92 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid1[4] ;
93 geom->AbsToRelNumbering(d1->GetId(), relid1) ;
95 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid2[4] ;
96 geom->AbsToRelNumbering(d2->GetId(), relid2) ;
98 if ( (relid1[0] == relid2[0]) && (relid1[1]==relid2[1]) ) { // inside the same PHOS module and the same PPSD Module
99 <a href="../ListOfTypes.html#Int_t">Int_t</a> rowdiff = TMath::Abs( relid1[2] - relid2[2] ) ;
100 <a href="../ListOfTypes.html#Int_t">Int_t</a> coldiff = TMath::Abs( relid1[3] - relid2[3] ) ;
102 if (( coldiff <= 1 ) && ( rowdiff <= 1 )){
106 if((relid2[2] > relid1[2]) && (relid2[3] > relid1[3]+1))
107 rv = 2; // Difference in row numbers is too large to look further
113 if( (relid1[0] < relid2[0]) || (relid1[1] < relid2[1]) )
121 <b>//____________________________________________________________________________</b>
122 <a name="AliPHOSClusterizerv1:FillandSort"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:FillandSort">AliPHOSClusterizerv1::FillandSort</a>(const <a href="../ListOfTypes.html#DigitsList">DigitsList</a> * dl, TObjArray * tl)
124 <b> // Copies the digits with energy above thershold and sorts the list</b>
125 <b> // according to increasing Id number</b>
127 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * geom = <a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetInstance">AliPHOSGeometry::GetInstance</a>() ;
128 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
131 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
136 while ( (digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *)next()) ) {
138 <b>// cout << " clusterizerv1 " << endl ;</b>
139 <b>// <a href="../ListOfTypes.html#int">int</a> nprim = digit->GetNprimary() ;</b>
140 <b>// <a href="../ListOfTypes.html#int">int</a> * aprim = digit->GetPrimary() ;</b>
141 <b>// for ( <a href="../ListOfTypes.html#int">int</a> ii = 0 ; ii < nprim ; ii++)</b>
142 <b>// cout << ii << " prim = " << aprim[ii] << endl ;</b>
144 <a href="../ListOfTypes.html#Int_t">Int_t</a> id = digit->GetId() ;
145 <a href="../ListOfTypes.html#Float_t">Float_t</a> ene = <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>(digit->GetAmp()) ;
146 geom->AbsToRelNumbering(id, relid) ;
147 if(relid[1]==0){ // EMC
148 if ( ene > <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcEnergyThreshold">fEmcEnergyThreshold</a> )
153 if ( ene > <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdEnergyThreshold">fPpsdEnergyThreshold</a> )
161 <b>//____________________________________________________________________________</b>
162 <a name="AliPHOSClusterizerv1:GetNumberOfClustersFound"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:GetNumberOfClustersFound">AliPHOSClusterizerv1::GetNumberOfClustersFound</a>(<a href="../ListOfTypes.html#Int_t">Int_t</a> * numb)
164 <b> // Fills numb with the number of EMC (numb[0]) clusters found</b>
165 <b> // PPSD (numb[1]) clusters found</b>
167 numb[0] = <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfEmcClusters">fNumberOfEmcClusters</a> ;
168 numb[1] = <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfPpsdClusters">fNumberOfPpsdClusters</a> ;
171 <b>//____________________________________________________________________________</b>
172 <a name="AliPHOSClusterizerv1:IsInEmc"> </a><a href="../ListOfTypes.html#Bool_t">Bool_t</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:IsInEmc">AliPHOSClusterizerv1::IsInEmc</a>(<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit)
174 <b> // Tells if (true) or not (false) the digit is in a PHOS-EMC module</b>
176 <a href="../ListOfTypes.html#Bool_t">Bool_t</a> rv = kFALSE ;
178 <a href=".././AliPHOSGeometry.html">AliPHOSGeometry</a> * geom = <a href=".././AliPHOSGeometry.html#AliPHOSGeometry:GetInstance">AliPHOSGeometry::GetInstance</a>() ;
180 <a href="../ListOfTypes.html#Int_t">Int_t</a> relid[4] ;
181 geom->AbsToRelNumbering(digit->GetId(), relid) ;
189 <b>//____________________________________________________________________________</b>
190 <a name="AliPHOSClusterizerv1:MakeClusters"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:MakeClusters">AliPHOSClusterizerv1::MakeClusters</a>(const <a href="../ListOfTypes.html#DigitsList">DigitsList</a> * dl, <a href="../ListOfTypes.html#RecPointsList">RecPointsList</a> * emcl, <a href="../ListOfTypes.html#RecPointsList">RecPointsList</a> * ppsdl)
192 <b> // Steering method to construct the clusters stored in a list of Reconstructed Points</b>
193 <b> // A cluster is defined as a list of neighbour digits</b>
195 <b> // Fill and sort the working digits list</b>
196 TObjArray tempodigitslist( dl->GetEntries() ) ;
197 <a href="#AliPHOSClusterizerv1:FillandSort">FillandSort</a>(dl, &tempodigitslist) ;
199 <b> // Clusterization starts </b>
200 TIter nextdigit(&tempodigitslist) ;
201 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digit ;
202 <a href="../ListOfTypes.html#Bool_t">Bool_t</a> notremoved = kTRUE ;
205 while ( (digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *)nextdigit()) ) { // scan over the list of digits
206 <a href=".././AliPHOSRecPoint.html">AliPHOSRecPoint</a> * clu ;
208 <a href="../ListOfTypes.html#int">int</a> * clusterdigitslist[dl->GetEntries()] ;
209 <a href="../ListOfTypes.html#Int_t">Int_t</a> index ;
210 if (( ( <a href="#AliPHOSClusterizerv1:IsInEmc">IsInEmc</a>(digit) ) && ( <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>(digit->GetAmp() ) > <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcClusteringThreshold">fEmcClusteringThreshold</a> ) ) ||
211 ( ( !<a href="#AliPHOSClusterizerv1:IsInEmc">IsInEmc</a>(digit) ) && ( <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>(digit->GetAmp() ) > <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdClusteringThreshold">fPpsdClusteringThreshold</a> ) ) ) {
213 <a href="../ListOfTypes.html#Int_t">Int_t</a> iDigitInCluster = 0 ;
215 if ( <a href="#AliPHOSClusterizerv1:IsInEmc">IsInEmc</a>(digit) ) {
216 new ((*emcl)[<a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfEmcClusters">fNumberOfEmcClusters</a>]) <a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a>(<a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fW0">fW0</a>, <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fLocMaxCut">fLocMaxCut</a>) ; // start a new EMC RecPoint
217 clu = (<a href=".././AliPHOSEmcRecPoint.html">AliPHOSEmcRecPoint</a> *) (*emcl)[<a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfEmcClusters">fNumberOfEmcClusters</a>] ;
218 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfEmcClusters">fNumberOfEmcClusters</a>++ ;
219 clu->AddDigit(*digit, <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>(digit->GetAmp())) ;
221 clusterdigitslist[iDigitInCluster] = (<a href="../ListOfTypes.html#int">int</a>* ) digit ;
223 tempodigitslist.Remove(digit) ;
229 new ((*ppsdl)[<a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfPpsdClusters">fNumberOfPpsdClusters</a>]) <a href=".././AliPHOSPpsdRecPoint.html">AliPHOSPpsdRecPoint</a>() ; // start a new PPSD cluster
230 clu = (<a href=".././AliPHOSPpsdRecPoint.html">AliPHOSPpsdRecPoint</a> *) ppsdl->At(<a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfPpsdClusters">fNumberOfPpsdClusters</a>) ;
231 <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fNumberOfPpsdClusters">fNumberOfPpsdClusters</a>++ ;
232 clu->AddDigit(*digit, <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>(digit->GetAmp()) ) ;
233 clusterdigitslist[iDigitInCluster] = (<a href="../ListOfTypes.html#int">int</a>* ) digit ;
235 tempodigitslist.Remove(digit) ;
238 <b> // Here we remove resting EMC digits, which cannot make cluster</b>
242 while( ( digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *)nextdigit() ) ) {
244 if( <a href="#AliPHOSClusterizerv1:IsInEmc">IsInEmc</a>(digit) )
245 tempodigitslist.Remove(digit) ;
257 <a href=".././AliPHOSDigit.html">AliPHOSDigit</a> * digitN ;
259 while (index < iDigitInCluster){ // scan over digits already in cluster
260 digit = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *) clusterdigitslist[index] ;
262 while ( (digitN = (<a href=".././AliPHOSDigit.html">AliPHOSDigit</a> *)nextdigit()) ) { // scan over the reduced list of digits
263 <a href="../ListOfTypes.html#Int_t">Int_t</a> ineb = <a href="#AliPHOSClusterizerv1:AreNeighbours">AreNeighbours</a>(digit, digitN); // call (digit,digitN) in THAT oder !!!!!
265 case 0 : // not a neighbour
267 case 1 : // are neighbours
268 clu->AddDigit( *digitN, <a href="#AliPHOSClusterizerv1:Calibrate">Calibrate</a>( digitN->GetAmp() ) ) ;
269 clusterdigitslist[iDigitInCluster] =(<a href="../ListOfTypes.html#int">int</a>*) digitN ;
271 tempodigitslist.Remove(digitN) ;
273 case 2 : // too far from each other
282 } // loop over cluster
284 } //below energy theshold
288 tempodigitslist.Clear() ;
291 <b>//____________________________________________________________________________</b>
292 <a name="AliPHOSClusterizerv1:PrintParameters"> </a><a href="../ListOfTypes.html#void">void</a> <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:PrintParameters">AliPHOSClusterizerv1::PrintParameters</a>()
294 <b> // Print the energy thresholds </b>
296 cout << "PHOS Clusterizer version 1 :" << endl
297 << " EMC Clustering threshold = " << <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcClusteringThreshold">fEmcClusteringThreshold</a> << endl
298 << " EMC Energy threshold = " << <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fEmcEnergyThreshold">fEmcEnergyThreshold</a> << endl
299 << " PPSD Clustering threshold = " << <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdClusteringThreshold">fPpsdClusteringThreshold</a> << endl
300 << " PPSD Energy threshold = " << <a href=".././AliPHOSClusterizerv1.html#AliPHOSClusterizerv1:fPpsdEnergyThreshold">fPpsdEnergyThreshold</a> << endl ;
309 <a href="http://root.cern.ch/root/Welcome.html">ROOT page</a> - <a href="../ClassIndex.html">Class index</a> - <a href="#TopOfPage">Top of the page</a><br>
311 <hr>This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to <a href="mailto:rootdev@root.cern.ch">ROOT support</a>, or contact <a href="mailto:rootdev@root.cern.ch">the developers</a> with any questions or problems regarding ROOT.