]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSClusterizerv1.h
Introducing the notion of QA data acquisition cycle (needed by online)
[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$
9a2cdbdf 11 * Revision 1.52 2007/08/07 14:16:00 kharlov
12 * Quality assurance added (Yves Schutz)
13 *
ddd1a39c 14 * Revision 1.51 2007/04/11 11:55:45 policheh
15 * SetDistancesToBadChannels() added.
16 *
af0b0570 17 * Revision 1.50 2007/03/28 19:18:15 kharlov
18 * RecPoints recalculation in TSM removed
19 *
8c1fb709 20 * Revision 1.49 2007/03/06 06:51:27 kharlov
21 * Calculation of cluster properties dep. on vertex posponed to TrackSegmentMaker
22 *
a978bcea 23 * Revision 1.48 2006/08/30 16:12:52 kharlov
24 * Reconstruction of raw data from beam test 2006 (B.Polichtchouk)
25 *
02e48b45 26 * Revision 1.47 2006/08/25 16:56:30 kharlov
27 * Compliance with Effective C++
28 *
0378398c 29 * Revision 1.46 2006/08/01 12:20:17 cvetan
30 * 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
31 *
f5eaa851 32 * Revision 1.45 2006/04/29 20:26:46 hristov
33 * Separate EMC and CPV calibration (Yu.Kharlov)
34 *
e95226ae 35 * Revision 1.44 2005/09/02 14:32:07 kharlov
36 * Calibration of raw data
37 *
44ae287e 38 * Revision 1.43 2005/05/28 14:19:04 schutz
39 * Compilation warnings fixed by T.P.
40 *
702ab87e 41 */
42
b2a60966 43//_________________________________________________________________________
44// Implementation version 1 of the clusterization algorithm
baef0810 45// Performs clusterization (collects neighbouring active cells) and
46// unfolding of the clusters with several local maxima.
47// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
48// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
b2a60966 49//
88cb7938 50//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 51
52// --- ROOT system ---
ba898748 53class TClonesArray ;
a978bcea 54class TVector3 ;
d15a28e7 55// --- Standard library ---
56
57// --- AliRoot header files ---
58
59#include "AliPHOSClusterizer.h"
9a1398dd 60class AliPHOSEmcRecPoint ;
61class AliPHOSDigit ;
62class AliPHOSDigitizer ;
63class AliPHOSGeometry ;
44ae287e 64class AliPHOSCalibData ;
d15a28e7 65
66class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
67
68public:
69
0378398c 70 AliPHOSClusterizerv1() ;
9a2cdbdf 71 AliPHOSClusterizerv1(AliPHOSGeometry *geom);
9688c1dd 72 virtual ~AliPHOSClusterizerv1() ;
d15a28e7 73
1f96ab2a 74 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
9a1398dd 75 // Checks if digits are in neighbour cells
3758d9fc 76
e95226ae 77 virtual Float_t CalibrateCPV(Int_t amp, Int_t absId) ; // Tranforms CPV Amp to energy
78 virtual Float_t CalibrateEMC(Float_t amp, Int_t absId) ; // Tranforms EMC Amp to energy
3758d9fc 79
baef0810 80 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
81 numb[1] = fNumberOfCpvClusters ; }
9a1398dd 82
83 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
84 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
85 virtual Float_t GetEmcLogWeight()const { return fW0;}
9688c1dd 86 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
9a1398dd 87 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
88 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
89 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
9a2cdbdf 90 // virtual const char * GetRecPointsBranch() const{ return GetName() ;}
9a1398dd 91
9a2cdbdf 92 virtual void Digits2Clusters(Option_t *option);
9a1398dd 93
702ab87e 94 void Print(const Option_t * = "")const ;
9a1398dd 95
ba898748 96 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
97 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
d72dfbc3 98 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 99 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
100 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
fbf811ec 101 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
ed4205d8 102 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 103 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
104 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
ba898748 105 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
106 //Switch to "on flyght" mode, without writing to TreeR and file
5d0435dd 107 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
a978bcea 108 static Double_t ShowerShape(Double_t x, Double_t z) ; // Shape of EM shower used in unfolding;
9a1398dd 109 //class member function (not object member function)
7b7c1533 110 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
ba898748 111 // Chi^2 of the fit. Should be static to be passed to MINUIT
9a2cdbdf 112 // void Unload() ;
88cb7938 113 virtual const char * Version() const { return "clu-v1"; }
9a1398dd 114
f5eaa851 115 virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
116 { fIsOldRCUFormat = rcuFormat; };
117
1f96ab2a 118protected:
119
88cb7938 120 void WriteRecPoints() ;
1f96ab2a 121 virtual void MakeClusters( ) ;
122 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
123 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
ba898748 124 void CleanDigits(TClonesArray * digits) ;
02e48b45 125 void GetCalibrationParameters(void);
af0b0570 126 void SetDistancesToBadChannels();
02e48b45 127
d15a28e7 128private:
9a2cdbdf 129 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
130 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
7b7c1533 131
a0636361 132 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
baef0810 133 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
fbf811ec 134 void Init() ;
135 void InitParameters() ;
9a1398dd 136
9a1398dd 137 virtual void MakeUnfolding() ;
9a1398dd 138 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
a0636361 139 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
9a1398dd 140 void PrintRecPoints(Option_t * option) ;
141
142private:
143
92f521a9 144 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
02e48b45 145 Int_t fEmcCrystals ; // number of EMC cristals in PHOS
3758d9fc 146
9a1398dd 147 Bool_t fToUnfold ; // To perform unfolding
ba898748 148 Bool_t fWrite ; // Write RecPoints to TreeR
02e48b45 149
150 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9688c1dd 151 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
7b7c1533 152
c2cd5471 153 //Calibration parameters
02e48b45 154 AliPHOSCalibData * fCalibData ; //! Calibration database if aval.
3758d9fc 155 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
88cb7938 156 Float_t fADCpedestalEmc ; //
3758d9fc 157 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
88cb7938 158 Float_t fADCpedestalCpv ; //
159
ba898748 160 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
161 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
162 Float_t fEmcMinE ; // minimum energy of digit to be included into cluster
163 Float_t fCpvMinE ; // minimum energy of digit to be included into cluster
9a1398dd 164 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 165 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 166 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 167 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
9a2cdbdf 168 // Int_t fRecPointsInRun ; //! Total number of recpoints in one run
9688c1dd 169 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
f5eaa851 170
171 Bool_t fIsOldRCUFormat; // assume old RCU raw data format
a978bcea 172
9a2cdbdf 173 ClassDef(AliPHOSClusterizerv1,5) // Clusterizer implementation version 1
d15a28e7 174
175};
176
177#endif // AliPHOSCLUSTERIZERV1_H