]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDHitDigitizer.h
Added calculation of a strip in a FMD ring
[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       fStack(0)
56   {}
57   /** CTOR 
58       @param name Name */
59   AliFMDHitDigitizer(AliFMD* fmd, Output_t  output);
60   /** DTOR */
61   virtual ~AliFMDHitDigitizer() {}
62   /** Run over the input events (retrieved via run loader) */
63   void Exec(Option_t* option="");
64 protected:
65   /** Copy constructor 
66       @param o Object to copy from */
67   AliFMDHitDigitizer(const AliFMDHitDigitizer& o) 
68     : AliFMDBaseDigitizer(o),
69       fOutput(o.fOutput), 
70       fStack(o.fStack)
71   {}
72   /** Assignment operator
73       @param o Object to assign from 
74       @return Reference to this */
75   AliFMDHitDigitizer& operator=(const AliFMDHitDigitizer& o) 
76   {
77     AliFMDBaseDigitizer::operator=(o);
78     fOutput      = o.fOutput;
79     return *this;
80   }
81   /** Make the output tree using the passed loader 
82       @param loader 
83       @return The generated tree. */
84   TTree* MakeOutputTree(AliLoader* loader);
85   /** Sum energy deposited contributions from each hit in a cache
86       @param hitsBranch Branch in input tree */
87   void SumContributions(TBranch* hitsBranch);
88   /** Make a pedestal 
89       @param detector Detector #
90       @param ring     Ring ID
91       @param sector   Sector #
92       @param strip    Strip #
93       @return Pedestal value */
94   UShort_t MakePedestal(UShort_t  detector, 
95                         Char_t    ring, 
96                         UShort_t  sector, 
97                         UShort_t  strip) const;
98   /** Add a digit to output.
99       @param fmd      Pointer to detector object
100       @param detector Detector #
101       @param ring     Ring ID
102       @param sector   Sector number
103       @param strip    Strip number
104       @param edep     Energy deposited (not used)
105       @param count1   ADC count 1
106       @param count2   ADC count 2 (-1 if not used)
107       @param count3   ADC count 3 (-1 if not used) 
108       @param count4   ADC count 4 (-1 if not used) */
109   void AddDigit(UShort_t  detector, 
110                 Char_t    ring,
111                 UShort_t  sector, 
112                 UShort_t  strip, 
113                 Float_t   edep, 
114                 UShort_t  count1, 
115                 Short_t   count2, 
116                 Short_t   count3,
117                 Short_t   count4, 
118                 UShort_t  ntot, 
119                 UShort_t  nprim) const;
120   /** Check that digit data is consistent
121       @param digit   Digit
122       @param nhits   Number of hits
123       @param counts  ADC counts */
124   void CheckDigit(AliFMDDigit*    digit,
125                   UShort_t        nhits,
126                   const TArrayI&  counts);
127   /** Store the data using the loader 
128       @param loader The loader */
129   void StoreDigits(AliLoader* loader);
130   
131
132   Output_t      fOutput;           // Output mode
133   AliStack*     fStack;            // Kinematics
134
135   ClassDef(AliFMDHitDigitizer,1) // Make Digits from Hits
136 };
137
138
139 #endif
140 //____________________________________________________________________
141 //
142 // Local Variables:
143 //   mode: C++
144 // End:
145 //
146 //
147 // EOF
148 //
149