Fixed some coding style violations.
[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
e802be3e 14#ifndef ALIFMDEdepMAP_H
97961cbd 15# include "AliFMDEdepMap.h"
4347b38f 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
4347b38f 30
31//====================================================================
32class AliFMDBaseDigitizer : public AliDigitizer
33{
34public:
35 AliFMDBaseDigitizer();
36 AliFMDBaseDigitizer(AliRunDigitizer * manager);
37 AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
38 virtual ~AliFMDBaseDigitizer();
4110645f 39
66d2ede1 40 // Do the main work
4347b38f 41 virtual Bool_t Init();
42
43 // Extra member functions
44 void SetVA1MipRange(UShort_t r=20) { fVA1MipRange = r; }
45 void SetAltroChannelSize(UShort_t s=1024) { fAltroChannelSize = s;}
46 void SetSampleRate(UShort_t r=1) { fSampleRate = (r>2 ? 2 : r); }
47 void SetShapingTime(Float_t t=10) { fShapingTime = t; }
48
49 UShort_t GetVA1MipRange() const { return fVA1MipRange; }
50 UShort_t GetAltroChannelSize() const { return fAltroChannelSize; }
51 UShort_t GetSampleRate() const { return fSampleRate; }
52 Float_t GetShapingTime() const { return fShapingTime; }
53protected:
54 virtual void SumContributions(AliFMD* fmd);
55 virtual void DigitizeHits(AliFMD* fmd) const;
56 virtual void ConvertToCount(Float_t edep,
e802be3e 57 Float_t last,
4347b38f 58 Float_t siThickness,
59 Float_t siDensity,
60 TArrayI& counts) const;
61 virtual UShort_t MakePedestal() const { return 0; }
4347b38f 62 virtual void AddNoise(TArrayI&) const {}
63 virtual void AddDigit(AliFMD* /* fmd */,
64 UShort_t /* detector */,
65 Char_t /* ring */,
66 UShort_t /* sector */,
67 UShort_t /* strip */,
68 Float_t /* edep */,
69 UShort_t /* count1 */,
70 Short_t /* count2 */,
71 Short_t /* count3 */) const {}
66d2ede1 72
69b696b9 73 AliRunLoader* fRunLoader; // Run loader
4347b38f 74 AliFMDEdepMap fEdep; // Cache of Energy from hits
75 UShort_t fVA1MipRange; // How many MIPs the pre-amp can do
76 UShort_t fAltroChannelSize; // Largest # to store in 1 ADC chan.
77 UShort_t fSampleRate; // Times the ALTRO samples pre-amp.
78 Float_t fShapingTime; // Shaping profile parameter
79
088f8e79 80 AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
81 : AliDigitizer(o) {}
82 AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
4347b38f 83 ClassDef(AliFMDBaseDigitizer,0) // Base class for FMD digitizers
84};
85
86//====================================================================
87class AliFMDDigitizer : public AliFMDBaseDigitizer
88{
89public:
90 AliFMDDigitizer();
91 AliFMDDigitizer(AliRunDigitizer * manager);
92 virtual ~AliFMDDigitizer() {}
93 virtual void Exec(Option_t* option=0);
66d2ede1 94
66d2ede1 95
4347b38f 96 // Extra member functions
97 void SetPedestal(Float_t mean=10, Float_t width=.5);
98 void GetPedestal(Float_t& mean, Float_t& width) const;
99protected:
100 virtual void AddDigit(AliFMD* fmd,
101 UShort_t detector,
102 Char_t ring,
103 UShort_t sector,
104 UShort_t strip,
105 Float_t edep,
106 UShort_t count1,
107 Short_t count2,
108 Short_t count3) const;
109 virtual UShort_t MakePedestal() const;
110 virtual void CheckDigit(Float_t edep,
111 UShort_t nhits,
112 const TArrayI& counts);
113 Float_t fPedestal; // Mean of pedestal
114 Float_t fPedestalWidth; // Width of pedestal
115 ClassDef(AliFMDDigitizer,0) // Make Digits from Hits
116};
117//____________________________________________________________________
118inline void
119AliFMDDigitizer::SetPedestal(Float_t mean, Float_t width)
120{
121 fPedestal = mean;
122 fPedestalWidth = width;
123}
124
125//____________________________________________________________________
126inline void
127AliFMDDigitizer::GetPedestal(Float_t& mean, Float_t& width) const
128{
129 mean = fPedestal;
130 width = fPedestalWidth;
131}
66d2ede1 132
4110645f 133
4347b38f 134//====================================================================
135class AliFMDSDigitizer : public AliFMDBaseDigitizer
136{
137public:
138 AliFMDSDigitizer();
139 AliFMDSDigitizer(const Char_t* headerFile, const Char_t* sdigFile="");
140 virtual ~AliFMDSDigitizer();
141 virtual void Exec(Option_t* option=0);
142protected:
143 virtual void AddDigit(AliFMD* fmd,
144 UShort_t detector,
145 Char_t ring,
146 UShort_t sector,
147 UShort_t strip,
148 Float_t edep,
149 UShort_t count1,
150 Short_t count2,
151 Short_t count3) const;
152 ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
153};
4110645f 154
155
4347b38f 156
157#endif
158//____________________________________________________________________
159//
0d0e6995 160// Local Variables:
161// mode: C++
162// End:
163//
164//
4347b38f 165// EOF
166//
167