Bug in ZEM2 TDC filling fixed
[u/mrichter/AliRoot.git] / ZDC / AliZDCDigitizer.h
CommitLineData
8309c1ab 1#ifndef ALIZDCDIGITIZER_H
2#define ALIZDCDIGITIZER_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// Digitizer class for ZDC //
10////////////////////////////////////////////////
11
12#include "AliDigitizer.h"
48642b09 13#include "AliCDBManager.h"
14#include "AliCDBStorage.h"
6024ec85 15#include "AliZDCPedestals.h"
8309c1ab 16
f21fc003 17class AliDigitizationInput;
8309c1ab 18
19class AliZDC;
20class AliZDCHit;
8309c1ab 21class AliZDCDigit;
22
23class AliZDCDigitizer: public AliDigitizer {
24
25public:
26 AliZDCDigitizer();
f21fc003 27 AliZDCDigitizer(AliDigitizationInput* digInput);
8309c1ab 28 virtual ~AliZDCDigitizer();
29
30 virtual Bool_t Init();
f21fc003 31 virtual void Digitize(Option_t* option=0);
8309c1ab 32
33 // PM gain
34 void SetPMGain(Int_t det, Int_t pmDet, Int_t pmGain)
35 {fPMGain[det][pmDet] = pmGain;}
36 Float_t GetPMGain(Int_t det, Int_t pmDet) const
37 {return fPMGain[det][pmDet];}
38 // Conversion factor from charge to ADC channels
39 // F = 1.6E-19 / Resolution [Coulomb/ch]
abf60186 40 void SetADCRes(Int_t *adcRes) {for (Int_t i=0;i<2;i++) fADCRes[i] = adcRes[i];}
8309c1ab 41 // Two conversion factor are needed for ADC CAEN V965
8309c1ab 42 Float_t GetADCRes(Int_t i) const {return fADCRes[i];}
48642b09 43
abf60186 44 void SetCalibrationOn() {fIsCalibration=1;}
73bc3a3f 45 AliCDBStorage *SetStorage(const char* uri);
46 AliZDCPedestals *GetPedData() const;
70ecaffe 47
48 void SetSpectators2Track() {fSpectators2Track=kTRUE;}
5d24ec95 49 void SetBeamEnergy(Float_t beamEnergy) {fBeamEnergy = beamEnergy;}
8309c1ab 50
f2e2aa97 51 // Added for p-A simulations
52 void SetpAsystem() {fIspASystem=kTRUE;}
53
5d24ec95 54 // Added for RELDIS
55 void SetRELDISGenerator() {fIsRELDISgen=kTRUE;}
56
8309c1ab 57private:
cc2abffd 58
59 AliZDCDigitizer(const AliZDCDigitizer&);
60 AliZDCDigitizer& operator=(const AliZDCDigitizer&);
61
5d24ec95 62 void CalculatePMTGains();
25175f38 63 void ReadPMTGains();
5d24ec95 64
8309c1ab 65 void Fragmentation(Float_t impPar, Int_t specN, Int_t specP,
66 Int_t &freeSpecN, Int_t &freeSpecP) const;
67 void SpectatorSignal(Int_t SpecType, Int_t numEvents,
68 Float_t pm[3][5]) const;
69
70 Int_t Phe2ADCch(Int_t Detector, Int_t Quadrant, Float_t Light,
71 Int_t Res) const;
48642b09 72 Int_t Pedestal(Int_t Detector, Int_t Quadrant, Int_t Res) const;
8309c1ab 73
edb4e893 74 Float_t fPMGain[5][5]; // PM gain
78d18275 75 Float_t fADCRes[2]; // ADC conversion factors
abf60186 76 Int_t fIsCalibration; // !=0 if simulation creates calibration data
fd9afd60 77 Bool_t fIsSignalInADCGate; // true if signal in ADC gate
78 Float_t fFracLostSignal; // fraction of lost signal
6024ec85 79
73bc3a3f 80 AliZDCPedestals *fPedData; //! pedestal calibration data
70ecaffe 81
82 Bool_t fSpectators2Track; // should digitizer track spectators
5d24ec95 83 Float_t fBeamEnergy; // beam energy
84 TString fBeamType; // beam type
f2e2aa97 85
86 // Added for p-A simulations
87 Bool_t fIspASystem; // true if collision system is p-A
5d24ec95 88
89 // Added for RELDIS
90 Bool_t fIsRELDISgen; // treu if generator is RELDIS
8309c1ab 91
5d24ec95 92 ClassDef(AliZDCDigitizer, 14) // digitizer for ZDC
8309c1ab 93};
94#endif