Added the option to write objects into separate files and improved the cleaning
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizerv1.h
CommitLineData
483b0559 1#ifndef ALIEMCALCLUSTERIZERV1_H
2#define ALIEMCALCLUSTERIZERV1_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//_________________________________________________________________________
9// Implementation version 1 of the clusterization algorithm
10// Performs clusterization (collects neighbouring active cells) and
11// unfolding of the clusters with several local maxima.
12// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
13// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
14//
15//*-- Author: Yves Schutz (SUBATECH)
16
17// --- ROOT system ---
18
19// --- Standard library ---
20
21// --- AliRoot header files ---
22
23#include "AliEMCALClusterizer.h"
24class AliEMCALTowerRecPoint ;
25class AliEMCALDigit ;
26class AliEMCALDigitizer ;
27class AliEMCALGeometry ;
28
29
30class AliEMCALClusterizerv1 : public AliEMCALClusterizer {
31
32public:
33
34 AliEMCALClusterizerv1() ;
35 AliEMCALClusterizerv1(const char * headerFile, const char * name = "Default");
36 virtual ~AliEMCALClusterizerv1() ;
37
38 virtual Int_t AreNeighbours(AliEMCALDigit * d1, AliEMCALDigit * d2)const ;
39 // Checks if digits are in neighbour cells
40
41 virtual Float_t Calibrate(Int_t amp, Bool_t inpresho)const ; // Tranforms Amp to energy
42
43 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfTowerClusters ;
44 numb[1] = fNumberOfPreShoClusters ; }
45
46 virtual Float_t GetEmcClusteringThreshold()const{ return fTowerClusteringThreshold;}
47 virtual Float_t GetEmcLocalMaxCut()const { return fTowerLocMaxCut;}
48 virtual Float_t GetEmcLogWeight()const { return fW0;}
49 virtual Float_t GetTimeGate() const { return fTimeGate ; }
50 virtual Float_t GetCpvClusteringThreshold()const{ return fPreShoClusteringThreshold; }
51 virtual Float_t GetCpvLocalMaxCut()const { return fPreShoLocMaxCut;}
52 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
53 virtual char * GetRecPointsBranch() const { return (char*) fRecPointsBranchTitle.Data() ;}
54 virtual const Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
55 virtual char * GetDigitsBranch() const { return (char*) fDigitsBranchTitle.Data() ;}
56
57 void Exec(Option_t *option); // Does the job
58
59 virtual void Print(Option_t * option)const ;
60
61 virtual void SetTowerClusteringThreshold(Float_t cluth) { fTowerClusteringThreshold = cluth ; }
62 virtual void SetTowerLocalMaxCut(Float_t cut) { fTowerLocMaxCut = cut ; }
63 virtual void SetTowerLogWeight(Float_t w) { fW0 = w ; }
64 virtual void SetTimeGate(Float_t gate) { fTimeGate = gate ;}
65 virtual void SetPreShoClusteringThreshold(Float_t cluth) { fPreShoClusteringThreshold = cluth ; }
66 virtual void SetPreShoLocalMaxCut(Float_t cut) { fPreShoLocMaxCut = cut ; }
67 virtual void SetPreShoLogWeight(Float_t w) { fW0CPV = w ; }
68 virtual void SetDigitsBranch(const char * title) { fDigitsBranchTitle = title ;}
69 virtual void SetRecPointsBranch(const char *title){fRecPointsBranchTitle = title; }
70 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;}
71 static Double_t ShowerShape(Double_t r) ; // Shape of EM shower used in unfolding;
72 //class member function (not object member function)
73 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
74 // Chi^2 of the fit. Should be static to be passes to MINUIT
75 virtual const char * Version() const { return "clu-v1" ; }
76
77protected:
78
79 void WriteRecPoints(Int_t event) ;
80 virtual void MakeClusters( ) ;
81 virtual Bool_t IsInTower (AliEMCALDigit * digit)const ; // Tells if id digit is in Tower
82 virtual Bool_t IsInPreShower (AliEMCALDigit * digit)const ; // Tells if id digit is in PreShower
83
84
85private:
86
87 void GetCalibrationParameters(void) ;
88
a0636361 89 Bool_t FindFit(AliEMCALTowerRecPoint * emcRP, AliEMCALDigit ** MaxAt, Float_t * maxAtEnergy,
483b0559 90 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
91 void Init() ;
839828a6 92 void InitParameters() ;
483b0559 93
94 virtual void MakeUnfolding() ;
95 void UnfoldCluster(AliEMCALTowerRecPoint * iniEmc,Int_t Nmax,
a0636361 96 AliEMCALDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
483b0559 97 void PrintRecPoints(Option_t * option) ;
98
99private:
100
101 TString fHeaderFileName ; // name of the file which contains gAlice, Tree headers etc.
102 TString fDigitsBranchTitle ; // name of the file, where digits branch is stored
103 TString fRecPointsBranchTitle ; // name of the file, where RecPoints branchs are stored
104
105 Int_t fNTowers ; // number of Towers in EMCAL
106
107 Bool_t fToUnfold ; // To perform unfolding
108
109 Int_t fNumberOfTowerClusters ; // number of Tower clusters found
110 Int_t fNumberOfPreShoClusters ; // number of PreShower clusters found
111
112 Float_t fADCchannelTower ; // width of one ADC channel for Tower (GeV)
113 Float_t fADCpedestalTower ; // pedestal of ADC for Tower (GeV)
114 Float_t fADCchannelPreSho ; // width of one ADC channel for Pre Shower (GeV)
115 Float_t fADCpedestalPreSho ; // pedestal of ADC for PreShower (GeV)
116
117 Float_t fTowerClusteringThreshold ; // minimum energy to include a EMC digit in a cluster
118 Float_t fPreShoClusteringThreshold ; // minimum energy to include a CPV digit in a cluster
119 Float_t fTowerLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
120 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
121 Float_t fPreShoLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
122 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
123 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
124 Float_t fTimeGate ; // Maximum time difference between the digits in ont EMC cluster
125
126 ClassDef(AliEMCALClusterizerv1,1) // Clusterizer implementation version 1
127
128};
129
130#endif // AliEMCALCLUSTERIZERV1_H