Old TOF library: removing
[u/mrichter/AliRoot.git] / FMD / AliFMDDigitizer.h
CommitLineData
66d2ede1 1#ifndef ALIFMDDIGITIZER_H
2#define ALIFMDDIGITIZER_H
4347b38f 3/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
4 * reserved.
5 *
6 * See cxx source for full Copyright notice
7 */
8#ifndef ALIDIGITIZER_H
9# include <AliDigitizer.h>
10#endif
11#ifndef ALIRUNDIGITIZER_H
12# include <AliRunDigitizer.h>
13#endif
14#ifndef ALIFMDMAP_H
15# include <AliFMDMap.h>
16#endif
17#ifndef __UTILITY__
18# include <utility>
19#endif
20// #ifndef ROOT_TArrayF
21// # include <TArrayF.h>
22// #endif
88cb7938 23
4347b38f 24//====================================================================
88cb7938 25class TClonesArray;
4347b38f 26class AliFMD;
27class AliLoader;
28class AliRunLoader;
29
30typedef AliFMDMap<std::pair<Float_t, UShort_t> > AliFMDEdepMap;
31
32//====================================================================
33class AliFMDBaseDigitizer : public AliDigitizer
34{
35public:
36 AliFMDBaseDigitizer();
37 AliFMDBaseDigitizer(AliRunDigitizer * manager);
38 AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
39 virtual ~AliFMDBaseDigitizer();
4110645f 40
66d2ede1 41 // Do the main work
4347b38f 42 virtual Bool_t Init();
43
44 // Extra member functions
45 void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
46 void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
47 void SetSampleRate(UShort_t r=1) { fSampleRate = (r>2 ? 2 : r); }
48 void SetShapingTime(Float_t t=10) { fShapingTime = t; }
49
50 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
51 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
52 UShort_t GetSampleRate() const { return fSampleRate; }
53 Float_t GetShapingTime() const { return fShapingTime; }
54protected:
55 virtual void SumContributions(AliFMD* fmd);
56 virtual void DigitizeHits(AliFMD* fmd) const;
57 virtual void ConvertToCount(Float_t edep,
58 Float_t siThickness,
59 Float_t siDensity,
60 TArrayI& counts) const;
61 virtual UShort_t MakePedestal() const { return 0; }
62 virtual Float_t ShapeIntegral(Float_t u, Float_t v) const;
63 virtual void AddNoise(TArrayI&) const {}
64 virtual void AddDigit(AliFMD* /* fmd */,
65 UShort_t /* detector */,
66 Char_t /* ring */,
67 UShort_t /* sector */,
68 UShort_t /* strip */,
69 Float_t /* edep */,
70 UShort_t /* count1 */,
71 Short_t /* count2 */,
72 Short_t /* count3 */) const {}
66d2ede1 73
4347b38f 74 AliRunLoader* fRunLoader;
75 AliFMDEdepMap fEdep; // Cache of Energy from hits
76 UShort_t fVA1MipRange; // How many MIPs the pre-amp can do
77 UShort_t fAltroChannelSize; // Largest # to store in 1 ADC chan.
78 UShort_t fSampleRate; // Times the ALTRO samples pre-amp.
79 Float_t fShapingTime; // Shaping profile parameter
80
81 enum {
82 kMaxDetectors = 3,
83 kMaxRings = 2,
84 kMaxSectors = 20,
85 kMaxStrips = 512
86 };
87 ClassDef(AliFMDBaseDigitizer,0) // Base class for FMD digitizers
88};
89
90//====================================================================
91class AliFMDDigitizer : public AliFMDBaseDigitizer
92{
93public:
94 AliFMDDigitizer();
95 AliFMDDigitizer(AliRunDigitizer * manager);
96 virtual ~AliFMDDigitizer() {}
97 virtual void Exec(Option_t* option=0);
66d2ede1 98
66d2ede1 99
4347b38f 100 // Extra member functions
101 void SetPedestal(Float_t mean=10, Float_t width=.5);
102 void GetPedestal(Float_t& mean, Float_t& width) const;
103protected:
104 virtual void AddDigit(AliFMD* fmd,
105 UShort_t detector,
106 Char_t ring,
107 UShort_t sector,
108 UShort_t strip,
109 Float_t edep,
110 UShort_t count1,
111 Short_t count2,
112 Short_t count3) const;
113 virtual UShort_t MakePedestal() const;
114 virtual void CheckDigit(Float_t edep,
115 UShort_t nhits,
116 const TArrayI& counts);
117 Float_t fPedestal; // Mean of pedestal
118 Float_t fPedestalWidth; // Width of pedestal
119 ClassDef(AliFMDDigitizer,0) // Make Digits from Hits
120};
121//____________________________________________________________________
122inline void
123AliFMDDigitizer::SetPedestal(Float_t mean, Float_t width)
124{
125 fPedestal = mean;
126 fPedestalWidth = width;
127}
128
129//____________________________________________________________________
130inline void
131AliFMDDigitizer::GetPedestal(Float_t& mean, Float_t& width) const
132{
133 mean = fPedestal;
134 width = fPedestalWidth;
135}
66d2ede1 136
4110645f 137
4347b38f 138//====================================================================
139class AliFMDSDigitizer : public AliFMDBaseDigitizer
140{
141public:
142 AliFMDSDigitizer();
143 AliFMDSDigitizer(const Char_t* headerFile, const Char_t* sdigFile="");
144 virtual ~AliFMDSDigitizer();
145 virtual void Exec(Option_t* option=0);
146protected:
147 virtual void AddDigit(AliFMD* fmd,
148 UShort_t detector,
149 Char_t ring,
150 UShort_t sector,
151 UShort_t strip,
152 Float_t edep,
153 UShort_t count1,
154 Short_t count2,
155 Short_t count3) const;
156 ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
157};
4110645f 158
159
4347b38f 160
161#endif
162//____________________________________________________________________
163//
0d0e6995 164// Local Variables:
165// mode: C++
166// End:
167//
168//
4347b38f 169// EOF
170//
171