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.46 2006/08/01 12:20:17 cvetan
12 * 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
14 * Revision 1.45 2006/04/29 20:26:46 hristov
15 * Separate EMC and CPV calibration (Yu.Kharlov)
17 * Revision 1.44 2005/09/02 14:32:07 kharlov
18 * Calibration of raw data
20 * Revision 1.43 2005/05/28 14:19:04 schutz
21 * Compilation warnings fixed by T.P.
25 //_________________________________________________________________________
26 // Implementation version 1 of the clusterization algorithm
27 // Performs clusterization (collects neighbouring active cells) and
28 // unfolding of the clusters with several local maxima.
29 // results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
30 // PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
32 //*-- Author: Yves Schutz (SUBATECH)
34 // --- ROOT system ---
36 // --- Standard library ---
38 // --- AliRoot header files ---
40 #include "AliPHOSClusterizer.h"
41 class AliPHOSEmcRecPoint ;
43 class AliPHOSDigitizer ;
44 class AliPHOSGeometry ;
45 class AliPHOSCalibData ;
47 class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
51 AliPHOSClusterizerv1() ;
52 AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
53 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
54 virtual ~AliPHOSClusterizerv1() ;
56 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
57 // Checks if digits are in neighbour cells
59 virtual Float_t CalibrateCPV(Int_t amp, Int_t absId) ; // Tranforms CPV Amp to energy
60 virtual Float_t CalibrateEMC(Float_t amp, Int_t absId) ; // Tranforms EMC Amp to energy
62 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
63 numb[1] = fNumberOfCpvClusters ; }
65 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
66 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
67 virtual Float_t GetEmcLogWeight()const { return fW0;}
68 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
69 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
70 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
71 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
72 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
73 virtual Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
75 virtual void Exec(Option_t *option); // Does the job
77 void Print(const Option_t * = "")const ;
79 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
80 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
81 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
82 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
83 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
84 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
85 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
86 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
87 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
88 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
89 //Switch to "on flyght" mode, without writing to TreeR and file
90 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
91 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
92 //class member function (not object member function)
93 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
94 // Chi^2 of the fit. Should be static to be passed to MINUIT
96 virtual const char * Version() const { return "clu-v1"; }
98 virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
99 { fIsOldRCUFormat = rcuFormat; };
103 void WriteRecPoints() ;
104 virtual void MakeClusters( ) ;
105 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
106 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
107 void CleanDigits(TClonesArray * digits) ;
108 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
112 const TString BranchName() const ;
113 void GetCalibrationParameters(void) ;
115 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
116 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
118 void InitParameters() ;
120 virtual void MakeUnfolding() ;
121 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
122 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
123 void PrintRecPoints(Option_t * option) ;
127 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
129 Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
131 Bool_t fToUnfold ; // To perform unfolding
132 Bool_t fWrite ; // Write RecPoints to TreeR
134 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
135 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
137 //Calibration parameters
138 AliPHOSCalibData * fCalibData ; //! Calibration database if aval
139 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
140 Float_t fADCpedestalEmc ; //
141 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
142 Float_t fADCpedestalCpv ; //
144 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
145 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
146 Float_t fEmcMinE ; // minimum energy of digit to be included into cluster
147 Float_t fCpvMinE ; // minimum energy of digit to be included into cluster
148 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
149 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
150 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
151 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
152 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
153 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
155 Bool_t fIsOldRCUFormat; // assume old RCU raw data format
157 ClassDef(AliPHOSClusterizerv1,4) // Clusterizer implementation version 1
161 #endif // AliPHOSCLUSTERIZERV1_H