]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSClusterizerv1.h
Compliance with Effective C++
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
CommitLineData
e9a88722 1#ifndef ALIPHOSCLUSTERIZERV1_H
d15a28e7 2#define ALIPHOSCLUSTERIZERV1_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6ad0bfa0 6/* $Id$ */
7
702ab87e 8/* History of cvs commits:
9 *
10 * $Log$
0378398c 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
13 *
f5eaa851 14 * Revision 1.45 2006/04/29 20:26:46 hristov
15 * Separate EMC and CPV calibration (Yu.Kharlov)
16 *
e95226ae 17 * Revision 1.44 2005/09/02 14:32:07 kharlov
18 * Calibration of raw data
19 *
44ae287e 20 * Revision 1.43 2005/05/28 14:19:04 schutz
21 * Compilation warnings fixed by T.P.
22 *
702ab87e 23 */
24
b2a60966 25//_________________________________________________________________________
26// Implementation version 1 of the clusterization algorithm
baef0810 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
b2a60966 31//
88cb7938 32//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 33
34// --- ROOT system ---
ba898748 35class TClonesArray ;
d15a28e7 36// --- Standard library ---
37
38// --- AliRoot header files ---
39
40#include "AliPHOSClusterizer.h"
9a1398dd 41class AliPHOSEmcRecPoint ;
42class AliPHOSDigit ;
43class AliPHOSDigitizer ;
44class AliPHOSGeometry ;
44ae287e 45class AliPHOSCalibData ;
d15a28e7 46
47class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
48
49public:
50
0378398c 51 AliPHOSClusterizerv1() ;
e191bb57 52 AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
0378398c 53 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
9688c1dd 54 virtual ~AliPHOSClusterizerv1() ;
d15a28e7 55
1f96ab2a 56 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
9a1398dd 57 // Checks if digits are in neighbour cells
3758d9fc 58
e95226ae 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
3758d9fc 61
baef0810 62 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
63 numb[1] = fNumberOfCpvClusters ; }
9a1398dd 64
65 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
66 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
67 virtual Float_t GetEmcLogWeight()const { return fW0;}
9688c1dd 68 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
9a1398dd 69 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
70 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
71 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
fbf811ec 72 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
a01512ba 73 virtual Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
9a1398dd 74
eabde521 75 virtual void Exec(Option_t *option); // Does the job
9a1398dd 76
702ab87e 77 void Print(const Option_t * = "")const ;
9a1398dd 78
ba898748 79 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
80 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
d72dfbc3 81 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 82 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
83 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
fbf811ec 84 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
ed4205d8 85 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 86 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
87 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
ba898748 88 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
89 //Switch to "on flyght" mode, without writing to TreeR and file
5d0435dd 90 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
9a1398dd 91 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
92 //class member function (not object member function)
7b7c1533 93 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
ba898748 94 // Chi^2 of the fit. Should be static to be passed to MINUIT
88cb7938 95 void Unload() ;
96 virtual const char * Version() const { return "clu-v1"; }
9a1398dd 97
f5eaa851 98 virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
99 { fIsOldRCUFormat = rcuFormat; };
100
1f96ab2a 101protected:
102
88cb7938 103 void WriteRecPoints() ;
1f96ab2a 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
ba898748 107 void CleanDigits(TClonesArray * digits) ;
0378398c 108 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
109
d15a28e7 110private:
7b7c1533 111
fbf811ec 112 const TString BranchName() const ;
3758d9fc 113 void GetCalibrationParameters(void) ;
114
a0636361 115 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
baef0810 116 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
fbf811ec 117 void Init() ;
118 void InitParameters() ;
9a1398dd 119
9a1398dd 120 virtual void MakeUnfolding() ;
9a1398dd 121 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
a0636361 122 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
9a1398dd 123 void PrintRecPoints(Option_t * option) ;
124
125private:
126
92f521a9 127 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
9a1398dd 128
3758d9fc 129 Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
130
9a1398dd 131 Bool_t fToUnfold ; // To perform unfolding
ba898748 132 Bool_t fWrite ; // Write RecPoints to TreeR
9a1398dd 133
ed4205d8 134 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9688c1dd 135 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
7b7c1533 136
c2cd5471 137 //Calibration parameters
44ae287e 138 AliPHOSCalibData * fCalibData ; //! Calibration database if aval
3758d9fc 139 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
88cb7938 140 Float_t fADCpedestalEmc ; //
3758d9fc 141 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
88cb7938 142 Float_t fADCpedestalCpv ; //
143
ba898748 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
9a1398dd 148 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 149 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 150 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 151 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
2b60655b 152 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
9688c1dd 153 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
f5eaa851 154
155 Bool_t fIsOldRCUFormat; // assume old RCU raw data format
9688c1dd 156
f5eaa851 157 ClassDef(AliPHOSClusterizerv1,4) // Clusterizer implementation version 1
d15a28e7 158
159};
160
161#endif // AliPHOSCLUSTERIZERV1_H