Changing name QualAss to QA
[u/mrichter/AliRoot.git] / PHOS / AliPHOSDigitizer.h
CommitLineData
990119d6 1#ifndef ALIPHOSDigitizer_H
2#define ALIPHOSDigitizer_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
702ab87e 8/* History of cvs commits:
9 *
10 * $Log$
5b188f2f 11 * Revision 1.35 2007/08/07 14:12:03 kharlov
12 * Quality assurance added (Yves Schutz)
13 *
ddd1a39c 14 * Revision 1.34 2006/04/29 20:25:30 hristov
15 * Decalibration is implemented (Yu.Kharlov)
16 *
877695e7 17 * Revision 1.33 2005/05/28 14:19:04 schutz
18 * Compilation warnings fixed by T.P.
19 *
702ab87e 20 */
21
990119d6 22//_________________________________________________________________________
23// Task Class for making SDigits in PHOS
baef0810 24// Class performs digitization of Summable digits (in the PHOS case this is just
25// sum of contributions of all primary particles into given cell).
26// In addition it performs mixing of summable digits from different events.
990119d6 27//
28//*-- Author: Dmitri Peressounko(SUBATECH & KI)
29
30
31// --- ROOT system ---
e957fea8 32//#include "TObjString.h"
8cb3533f 33class TArrayI ;
fb43c866 34class TClonesArray ;
35
990119d6 36// --- Standard library ---
37
38// --- AliRoot header files ---
3f81a70b 39#include "AliDigitizer.h"
990119d6 40class AliPHOSSDigitizer ;
ddd1a39c 41class AliPHOSQualAssDataMaker ;
3f81a70b 42class AliRunDigitizer ;
8cb3533f 43
93aeb834 44class AliPHOSDigitizer: public AliDigitizer {
990119d6 45
46public:
47 AliPHOSDigitizer() ; // ctor
e191bb57 48 AliPHOSDigitizer(TString alirunFileNameFile, TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
88cb7938 49 AliPHOSDigitizer(const AliPHOSDigitizer & dtizer) ;
50 AliPHOSDigitizer(AliRunDigitizer * manager) ;
990119d6 51 virtual ~AliPHOSDigitizer() ;
8cb3533f 52
fc7e2f43 53 void Digitize(Int_t event) ; // Make Digits from SDigits
3758d9fc 54 void Exec(Option_t *option); // Supervising method
8cb3533f 55
3758d9fc 56 //CPV parameters
fc7e2f43 57 Float_t GetCPVNoise() const { return fCPVNoise ;}
58 Float_t GetCPVThreshold() const { return fCPVDigitThreshold ;}
59 Float_t GetCPVchannel() const { return fADCchanelCpv; }
60 Float_t GetCPVpedestal() const { return fADCpedestalCpv; }
3758d9fc 61
62 void SetCPVNoise(Float_t CPVNoise) {fCPVNoise = CPVNoise;}
63 void SetCPVThreshold(Float_t CPVThreshold) {fCPVDigitThreshold= CPVThreshold;}
64 void SetNCPVchannels(Int_t n) { fNADCcpv = n; }
65 void SetCPVchannel(Float_t width) { fADCchanelCpv = width; }
66 void SetCPVpedestal(Float_t ped) { fADCpedestalCpv = ped; }
67
68
69 //EMC parameters
fc7e2f43 70 Float_t GetEMCThreshold() const { return fEMCDigitThreshold;}
71 Float_t GetEMCchannel() const { return fADCchanelEmc; }
72 Float_t GetEMCpedestal() const { return fADCpedestalEmc; }
73 Float_t GetPinNoise() const { return fPinNoise;}
74 Float_t GetTimeResolution() const { return fTimeResolution ; }
7b7c1533 75
3758d9fc 76 void SetEMCThreshold(Float_t EMCThreshold) {fEMCDigitThreshold = EMCThreshold;}
77 void SetPinNoise(Float_t PinNoise ) {fPinNoise = PinNoise;}
78 void SetNEMCchannels(Int_t n) { fNADCemc = n; }
79 void SetEMCchannel(Float_t width) { fADCchanelEmc = width; }
80 void SetEMCpedestal(Float_t ped) { fADCpedestalEmc = ped ; }
88cb7938 81 void SetEventFolderName(TString name) { fEventFolderName = name ; }
fbf811ec 82 void SetTimeResolution(Float_t res){ fTimeResolution = res ; }
212d1c0f 83 void SetEventRange(Int_t first=0, Int_t last=-1) {fFirstEvent=first; fLastEvent=last; }
3758d9fc 84
85 //General
fc7e2f43 86 Int_t GetDigitsInRun() const { return fDigitsInRun ;}
87 void MixWith(TString alirunFileName,
e191bb57 88 TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ; // Add another one file to mix
702ab87e 89
90 void Print(const Option_t * = "")const ;
548f0134 91
8c140292 92 AliPHOSDigitizer & operator = (const AliPHOSDigitizer & /*rvalue*/) {
baef0810 93 // assignement operator requested by coding convention but not needed
f1611b7c 94 Fatal("operator =", "not implemented") ;
baef0810 95 return *this ;
96 }
97
ddd1a39c 98
990119d6 99private:
ddd1a39c 100 AliPHOSQualAssDataMaker * GetQualAssDataMaker() const { return fQADM ; }
3758d9fc 101
88cb7938 102 virtual Bool_t Init() ;
8d0f3f77 103 void InitParameters() ;
8cb3533f 104 void PrintDigits(Option_t * option) ;
88cb7938 105 void Unload() ;
90cceaf6 106 void WriteDigits() ; // Writes Digits for the current event
0bc3b8ed 107 Float_t TimeOfNoise(void) const; // Calculate time signal generated by noise
88cb7938 108
9688c1dd 109 //Calculate the time of crossing of the threshold by front edge
0bc3b8ed 110 Float_t FrontEdgeTime(TClonesArray * ticks) const ;
3758d9fc 111 //Calculate digitized signal with gived ADC parameters
877695e7 112 void DecalibrateEMC(AliPHOSDigit * digit);
113 Int_t DigitizeCPV(Float_t charge, Int_t absId) ;
990119d6 114
3758d9fc 115private:
8cb3533f 116
92f521a9 117 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
88cb7938 118 Int_t fDigitsInRun ; //! Total number of digits in one run
119 Bool_t fInit ; //! To avoid overwriting existing files
120
121 Int_t fInput ; // Number of files to merge
122 TString * fInputFileNames ; //[fInput] List of file names to merge
123 TString * fEventNames ; //[fInput] List of event names to merge
548f0134 124
9688c1dd 125 Int_t fEmcCrystals ; // Number of EMC crystalls in the given geometry
3758d9fc 126
990119d6 127 Float_t fPinNoise ; // Electronics noise in EMC
128 Float_t fEMCDigitThreshold ; // Threshold for storing digits in EMC
3758d9fc 129
990119d6 130 Float_t fCPVNoise ; // Noise in CPV
131 Float_t fCPVDigitThreshold ; // Threshold for storing digits in CPV
3758d9fc 132
990119d6 133
9688c1dd 134 Float_t fTimeResolution ; // Time resolution of FEE electronics
9688c1dd 135 Float_t fTimeThreshold ; // Threshold to start timing for given crystall
136 Float_t fTimeSignalLength ; // Length of the timing signal
137
3758d9fc 138 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
0bc3b8ed 139 Float_t fADCpedestalEmc ; // value of the EMC ADC pedestal
3758d9fc 140 Int_t fNADCemc ; // number of channels in EMC ADC
141
0bc3b8ed 142 Float_t fADCchanelCpv ; // width of one ADC channel in CPV units
143 Float_t fADCpedestalCpv ; // value of the CPV ADC pedestal in CPV units
3758d9fc 144 Int_t fNADCcpv ; // number of channels in CPV ADC
fbf811ec 145
88cb7938 146 TString fEventFolderName; // skowron: name of EFN to read data from in stand alone mode
ddd1a39c 147 Int_t fFirstEvent; // first event to process
148 Int_t fLastEvent; // last event to process
149 AliPHOSQualAssDataMaker * fQADM ; //!Quality Assurance Data Maker
150 Int_t fEventCounter ; //! counts the events processed
5b188f2f 151
152 //QA stuff
153 static const Int_t fgkCycles = 9999 ; // QA data accumulation cycle
ddd1a39c 154
5b188f2f 155 ClassDef(AliPHOSDigitizer,4) // description
990119d6 156
157};
158
159
160#endif // AliPHOSDigitizer_H