Compilation warnings fixed by T.P.
[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$
11 */
12
b2a60966 13//_________________________________________________________________________
14// Implementation version 1 of the clusterization algorithm
baef0810 15// Performs clusterization (collects neighbouring active cells) and
16// unfolding of the clusters with several local maxima.
17// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
18// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
b2a60966 19//
88cb7938 20//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 21
22// --- ROOT system ---
ba898748 23class TClonesArray ;
d15a28e7 24// --- Standard library ---
25
26// --- AliRoot header files ---
27
28#include "AliPHOSClusterizer.h"
9a1398dd 29class AliPHOSEmcRecPoint ;
30class AliPHOSDigit ;
31class AliPHOSDigitizer ;
32class AliPHOSGeometry ;
88cb7938 33class AliPHOSCalibrationDB ;
d15a28e7 34
35class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
36
37public:
38
9688c1dd 39 AliPHOSClusterizerv1() ;
e191bb57 40 AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
a8c47ab6 41 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) : AliPHOSClusterizer(clu) {
88cb7938 42 // cpy ctor: no implementation yet
43 // requested by the Coding Convention
0bc3b8ed 44 Fatal("cpy ctor", "not implemented") ;
45 }
9688c1dd 46 virtual ~AliPHOSClusterizerv1() ;
d15a28e7 47
1f96ab2a 48 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
9a1398dd 49 // Checks if digits are in neighbour cells
3758d9fc 50
51 virtual Float_t Calibrate(Int_t amp, Int_t absId)const ; // Tranforms Amp to energy
52
baef0810 53 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
54 numb[1] = fNumberOfCpvClusters ; }
9a1398dd 55
56 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
57 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
58 virtual Float_t GetEmcLogWeight()const { return fW0;}
9688c1dd 59 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
9a1398dd 60 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
61 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
62 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
fbf811ec 63 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
a01512ba 64 virtual Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
9a1398dd 65
eabde521 66 virtual void Exec(Option_t *option); // Does the job
9a1398dd 67
702ab87e 68 void Print(const Option_t * = "")const ;
9a1398dd 69
ba898748 70 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
71 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
d72dfbc3 72 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 73 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
74 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
fbf811ec 75 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
ed4205d8 76 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 77 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
78 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
ba898748 79 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
80 //Switch to "on flyght" mode, without writing to TreeR and file
5d0435dd 81 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
9a1398dd 82 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
83 //class member function (not object member function)
7b7c1533 84 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
ba898748 85 // Chi^2 of the fit. Should be static to be passed to MINUIT
88cb7938 86 void Unload() ;
87 virtual const char * Version() const { return "clu-v1"; }
9a1398dd 88
1f96ab2a 89protected:
90
88cb7938 91 void WriteRecPoints() ;
1f96ab2a 92 virtual void MakeClusters( ) ;
93 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
94 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
ba898748 95 void CleanDigits(TClonesArray * digits) ;
7b7c1533 96
d15a28e7 97private:
7b7c1533 98
fbf811ec 99 const TString BranchName() const ;
3758d9fc 100 void GetCalibrationParameters(void) ;
101
a0636361 102 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
baef0810 103 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
fbf811ec 104 void Init() ;
105 void InitParameters() ;
9a1398dd 106
9a1398dd 107 virtual void MakeUnfolding() ;
9a1398dd 108 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
a0636361 109 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
9a1398dd 110 void PrintRecPoints(Option_t * option) ;
111
112private:
113
92f521a9 114 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
9a1398dd 115
3758d9fc 116 Int_t fEmcCrystals ; // number of EMC cristalls in PHOS
117
9a1398dd 118 Bool_t fToUnfold ; // To perform unfolding
ba898748 119 Bool_t fWrite ; // Write RecPoints to TreeR
9a1398dd 120
ed4205d8 121 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9688c1dd 122 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
7b7c1533 123
c2cd5471 124 //Calibration parameters
88cb7938 125 AliPHOSCalibrationDB * fCalibrationDB ; //! Calibration database if aval
3758d9fc 126 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
88cb7938 127 Float_t fADCpedestalEmc ; //
3758d9fc 128 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
88cb7938 129 Float_t fADCpedestalCpv ; //
130
ba898748 131 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
132 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
133 Float_t fEmcMinE ; // minimum energy of digit to be included into cluster
134 Float_t fCpvMinE ; // minimum energy of digit to be included into cluster
9a1398dd 135 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 136 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 137 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 138 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
2b60655b 139 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
9688c1dd 140 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
141
88cb7938 142 ClassDef(AliPHOSClusterizerv1,3) // Clusterizer implementation version 1
d15a28e7 143
144};
145
146#endif // AliPHOSCLUSTERIZERV1_H