1 #ifndef ALIPHOSCLUSTERIZERV1_H
2 #define ALIPHOSCLUSTERIZERV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 /* History of cvs commits:
11 * Revision 1.50 2007/03/28 19:18:15 kharlov
12 * RecPoints recalculation in TSM removed
14 * Revision 1.49 2007/03/06 06:51:27 kharlov
15 * Calculation of cluster properties dep. on vertex posponed to TrackSegmentMaker
17 * Revision 1.48 2006/08/30 16:12:52 kharlov
18 * Reconstruction of raw data from beam test 2006 (B.Polichtchouk)
20 * Revision 1.47 2006/08/25 16:56:30 kharlov
21 * Compliance with Effective C++
23 * Revision 1.46 2006/08/01 12:20:17 cvetan
24 * 1. Adding a possibility to read and reconstruct an old rcu formatted raw data. This is controlled by an option of AliReconstruction and AliPHOSReconstructor. 2. In case of raw data processing (without galice.root) create the default AliPHOSGeometry object. Most likely this should be moved to the CDB
26 * Revision 1.45 2006/04/29 20:26:46 hristov
27 * Separate EMC and CPV calibration (Yu.Kharlov)
29 * Revision 1.44 2005/09/02 14:32:07 kharlov
30 * Calibration of raw data
32 * Revision 1.43 2005/05/28 14:19:04 schutz
33 * Compilation warnings fixed by T.P.
37 //_________________________________________________________________________
38 // Implementation version 1 of the clusterization algorithm
39 // Performs clusterization (collects neighbouring active cells) and
40 // unfolding of the clusters with several local maxima.
41 // results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
42 // PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
44 //*-- Author: Yves Schutz (SUBATECH)
46 // --- ROOT system ---
49 // --- Standard library ---
51 // --- AliRoot header files ---
53 #include "AliPHOSClusterizer.h"
54 class AliPHOSEmcRecPoint ;
56 class AliPHOSDigitizer ;
57 class AliPHOSGeometry ;
58 class AliPHOSCalibData ;
60 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
64 AliPHOSClusterizerv1() ;
65 AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
66 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
67 virtual ~AliPHOSClusterizerv1() ;
69 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
70 // Checks if digits are in neighbour cells
72 virtual Float_t CalibrateCPV(Int_t amp, Int_t absId) ; // Tranforms CPV Amp to energy
73 virtual Float_t CalibrateEMC(Float_t amp, Int_t absId) ; // Tranforms EMC Amp to energy
75 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
76 numb[1] = fNumberOfCpvClusters ; }
78 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
79 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
80 virtual Float_t GetEmcLogWeight()const { return fW0;}
81 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
82 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
83 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
84 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
85 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
86 virtual Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
88 virtual void Exec(Option_t *option); // Does the job
90 void Print(const Option_t * = "")const ;
92 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
93 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
94 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
95 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
96 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
97 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
98 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
99 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
100 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
101 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
102 //Switch to "on flyght" mode, without writing to TreeR and file
103 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
104 static Double_t ShowerShape(Double_t x, Double_t z) ; // Shape of EM shower used in unfolding;
105 //class member function (not object member function)
106 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
107 // Chi^2 of the fit. Should be static to be passed to MINUIT
109 virtual const char * Version() const { return "clu-v1"; }
111 virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
112 { fIsOldRCUFormat = rcuFormat; };
116 void WriteRecPoints() ;
117 virtual void MakeClusters( ) ;
118 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
119 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
120 void CleanDigits(TClonesArray * digits) ;
121 void GetCalibrationParameters(void);
122 void SetDistancesToBadChannels();
124 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
128 const TString BranchName() const ;
130 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
131 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
133 void InitParameters() ;
135 virtual void MakeUnfolding() ;
136 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
137 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
138 void PrintRecPoints(Option_t * option) ;
142 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
143 Int_t fEmcCrystals ; // number of EMC cristals in PHOS
145 Bool_t fToUnfold ; // To perform unfolding
146 Bool_t fWrite ; // Write RecPoints to TreeR
148 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
149 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
151 //Calibration parameters
152 AliPHOSCalibData * fCalibData ; //! Calibration database if aval.
153 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
154 Float_t fADCpedestalEmc ; //
155 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
156 Float_t fADCpedestalCpv ; //
158 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
159 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
160 Float_t fEmcMinE ; // minimum energy of digit to be included into cluster
161 Float_t fCpvMinE ; // minimum energy of digit to be included into cluster
162 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
163 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
164 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
165 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
166 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
167 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
169 Bool_t fIsOldRCUFormat; // assume old RCU raw data format
171 ClassDef(AliPHOSClusterizerv1,4) // Clusterizer implementation version 1
175 #endif // AliPHOSCLUSTERIZERV1_H