]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDHitDigitizer.h
Fix range and binning on histograms
[u/mrichter/AliRoot.git] / FMD / AliFMDHitDigitizer.h
1 #ifndef ALIFMDHITDIGITIZER_H
2 #define ALIFMDHITDIGITIZER_H
3 /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * See cxx source for full Copyright notice                               
7  */
8 // Classses to make Hits into digits and summable digits
9 //    
10 //    Digits consists of
11 //    - Detector #
12 //    - Ring ID                                             
13 //    - Sector #     
14 //    - Strip #
15 //    - ADC count in this channel
16 //
17 /** @file    AliFMDHitDigitizer.h
18     @author  Christian Holm Christensen <cholm@nbi.dk>
19     @date    Mon Mar 27 12:38:26 2006
20     @brief   FMD Digitizers declaration
21     @ingroup FMD_sim
22 */
23 #ifndef ALIFMDBASEDIGITIZER_H
24 # include <AliFMDBaseDigitizer.h>
25 #endif
26
27 //====================================================================
28 class TClonesArray;
29 class AliFMD;
30 class AliLoader;
31 class AliRunLoader;
32 class AliFMDDigit;
33 class AliStack;
34
35
36
37 //====================================================================
38 /** @class AliFMDHitDigitizer
39     @brief Concrete digitizer to make digits from hits.  See also
40     AliFMDBaseDigitizer documentation.  
41     @ingroup FMD_sim
42  */
43 class AliFMDHitDigitizer : public AliFMDBaseDigitizer
44 {
45 public:
46   enum Output_t { 
47     kDigits, 
48     kSDigits
49   };
50     
51   /** CTOR */
52   AliFMDHitDigitizer() 
53     : AliFMDBaseDigitizer(), 
54       fOutput(kDigits), 
55       fHoldTime(2e-6),
56       fStack(0)
57   {}
58   /** CTOR 
59       @param name Name */
60   AliFMDHitDigitizer(AliFMD* fmd, Output_t  output);
61   /** DTOR */
62   virtual ~AliFMDHitDigitizer() {}
63   /** Run over the input events (retrieved via run loader) */
64   void Exec(Option_t* option="");
65   /** 
66    * Set the end of integration
67    * 
68    * @param holdT Time when integration ends (nominally @f$
69    *        2\mu{}s@f$) 
70    */
71   void SetHoldTime(Double_t holdT=2e-6) { fHoldTime = holdT; }
72   /** 
73    * Get the hold time 
74    * 
75    * @return Hold time in seconds
76    */
77   Double_t GetHoldTime() const { return fHoldTime; }
78 protected:
79   /** Copy constructor 
80       @param o Object to copy from */
81   AliFMDHitDigitizer(const AliFMDHitDigitizer& o) 
82     : AliFMDBaseDigitizer(o),
83       fOutput(o.fOutput), 
84       fHoldTime(2e-6),
85       fStack(o.fStack)
86   {}
87   /** 
88    * Assignment operator
89    *
90    * @param o Object to assign from 
91    * @return Reference to this 
92    */
93   AliFMDHitDigitizer& operator=(const AliFMDHitDigitizer& o); 
94   /** 
95    * Make the output tree using the passed loader 
96    *
97    * @param loader 
98    * @return The generated tree. 
99    */
100   TTree* MakeOutputTree(AliLoader* loader);
101   /** Sum energy deposited contributions from each hit in a cache
102       @param hitsBranch Branch in input tree */
103   void SumContributions(TBranch* hitsBranch);
104   /** Make a pedestal 
105       @param detector Detector #
106       @param ring     Ring ID
107       @param sector   Sector #
108       @param strip    Strip #
109       @return Pedestal value */
110   UShort_t MakePedestal(UShort_t  detector, 
111                         Char_t    ring, 
112                         UShort_t  sector, 
113                         UShort_t  strip) const;
114   /** Add a digit to output.
115       @param fmd      Pointer to detector object
116       @param detector Detector #
117       @param ring     Ring ID
118       @param sector   Sector number
119       @param strip    Strip number
120       @param edep     Energy deposited (not used)
121       @param count1   ADC count 1
122       @param count2   ADC count 2 (-1 if not used)
123       @param count3   ADC count 3 (-1 if not used) 
124       @param count4   ADC count 4 (-1 if not used) */
125   void AddDigit(UShort_t       detector, 
126                 Char_t         ring,
127                 UShort_t       sector, 
128                 UShort_t       strip, 
129                 Float_t        edep, 
130                 UShort_t       count1, 
131                 Short_t        count2, 
132                 Short_t        count3,
133                 Short_t        count4, 
134                 UShort_t       ntot, 
135                 UShort_t       nprim,
136                 const TArrayI& trackrefs) const;
137   /** Check that digit data is consistent
138       @param digit   Digit
139       @param nhits   Number of hits
140       @param counts  ADC counts */
141   void CheckDigit(AliFMDDigit*    digit,
142                   UShort_t        nhits,
143                   const TArrayI&  counts);
144   /** 
145    * Store the data using the loader 
146    *
147    * @param loader The loader 
148    */
149   void StoreDigits(const AliLoader* loader);
150   
151
152   Output_t      fOutput;           // Output mode
153   Double_t      fHoldTime;         // Stop of integration
154   AliStack*     fStack;            // Kinematics
155
156   ClassDef(AliFMDHitDigitizer,1) // Make Digits from Hits
157 };
158
159
160 #endif
161 //____________________________________________________________________
162 //
163 // Local Variables:
164 //   mode: C++
165 // End:
166 //
167 //
168 // EOF
169 //
170