]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDGainDA.h
Fixes to DA code:
[u/mrichter/AliRoot.git] / FMD / AliFMDGainDA.h
1 #ifndef ALIFMDGAINDA_H
2 #define ALIFMDGAINDA_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * See cxx source for full Copyright notice                               
7  */
8 // This class implements the Gain detector algorithm (DA) for the FMD. 
9 // The gain is the response of the VA chips to a known pulse and has to be 
10 // calculated strip-by-strip, pulse-by-pulse. 
11
12
13 #include "AliFMDBaseDA.h"
14 #include "TH1F.h"
15 #include "TObjArray.h"
16 // #include "TGraphErrors.h"
17 class TGraphErrors;
18 class TH1S;
19
20 class AliFMDGainDA: public AliFMDBaseDA 
21 {
22 public:
23   /** 
24    * Constructor 
25    * 
26    */
27   AliFMDGainDA() ;
28   /** 
29    * Copy constructor 
30    * 
31    * @param gainDA  Object to copy from
32    */  
33   AliFMDGainDA(const AliFMDGainDA & gainDA) ;
34   /** 
35    * Destructor 
36    * 
37    */
38   virtual ~AliFMDGainDA();
39   /** 
40    * Initialize 
41    * 
42    */
43   void Init();
44   /** 
45    * Set the maximum pulse size 
46    * 
47    * @param highPulse Maximum pulse size
48    */
49   void SetMaxPulse(Int_t highPulse = 256) {fHighPulse = highPulse; }
50   /** 
51    * Set the number of strips per input channel 
52    * 
53    * @param nStrips Number of strips per channel
54    */
55   void SetNumberOfStrips(Int_t nStrips) {fNumberOfStripsPerChip = nStrips;}
56
57 protected:
58   /** 
59    * Make a container for a channel 
60    * 
61    * @param sectorArray Sectors 
62    * @param det         Detector # 
63    * @param ring        Ring identifier 
64    * @param sec         Sector number
65    * @param strip       Strip number
66    */ 
67   void AddChannelContainer(TObjArray* sectorArray, 
68                            UShort_t det, Char_t ring, 
69                            UShort_t sec, UShort_t strip);
70   /** 
71    * Fill channel histogram 
72    * 
73    * @param digit Digit to fill from
74    */
75   void FillChannels(AliFMDDigit* digit);
76   /** 
77    * Analyse the result
78    * 
79    * @param det         Detector # 
80    * @param ring        Ring identifier 
81    * @param sec         Sector number
82    * @param strip       Strip number
83    */
84   void Analyse(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip);
85   /**
86    * Write out the header 
87    */
88   void WriteHeaderToFile();
89   /** 
90    * Go to the next sample
91    * 
92    * @param det         Detector # 
93    * @param ring        Ring identifier 
94    * @param sec         Sector number
95    * @param strip       Strip number
96    */
97   void UpdatePulseAndADC(UShort_t det, 
98                          Char_t ring, 
99                          UShort_t sec, 
100                          UShort_t strip);
101   /** 
102    * Reset all 
103    * 
104    */
105   void ResetPulseAndUpdateChannel();
106   /** 
107    * End of event 
108    * 
109    */
110   void FinishEvent();
111   /** 
112    * End of job
113    * 
114    * @param dummy Not used
115    */
116   void Terminate(TFile* dummy);
117   
118 private:
119   /** 
120    * Get the channel histogram
121    * 
122    * @param det         Detector # 
123    * @param ring        Ring identifier 
124    * @param sec         Sector number
125    * @param strip       Strip number
126    * 
127    * @return Histogram
128    */  
129   TH1S* GetChannelHistogram(UShort_t det, Char_t ring, UShort_t sec, 
130                             UShort_t strip);
131   /** 
132    * Get strip graph
133    * 
134    * @param det         Detector # 
135    * @param ring        Ring identifier 
136    * @param sec         Sector number
137    * @param strip       Strip number
138    * 
139    * @return Graph
140    */
141   TGraphErrors* GetChannel(UShort_t det, Char_t ring, 
142                            UShort_t sec, UShort_t strip);
143   TObjArray fGainArray;          // Array of gains 
144   Int_t     fHighPulse;          // Highest pulse
145   TArrayS   fEventsPerChannel;   // # of events per pulse step
146   TArrayS   fCurrentPulse;       // The current pulse size 
147   TArrayS   fCurrentChannel;     // The current strip number
148   Int_t     fNumberOfStripsPerChip; // Number of strips
149   
150   TH1F      fSummaryGains;         // Summary histogram 
151   Int_t     fCurrentSummaryStrip;  // Current strip for summary
152   
153   ClassDef(AliFMDGainDA,0) // Detector algorithm for gain runs
154
155 };
156 #endif
157 // Local Variables: 
158 //  mode: C++ 
159 // End: