]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDv1.h
Small fixes
[u/mrichter/AliRoot.git] / FMD / AliFMDv1.h
1 #ifndef ALIFMDV1_H
2 #define ALIFMDV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved. 
5  *
6  * Latest changes by Christian Holm Christensen <cholm@nbi.dk>
7  *
8  * See cxx source for full Copyright notice                               
9  */
10 /** @file    AliFMDv1.h
11     @author  Christian Holm Christensen <cholm@nbi.dk>
12     @date    Mon Mar 27 12:48:51 2006
13     @brief   Concrete implementation of FMD detector driver - detailed
14     version 
15 */
16 //____________________________________________________________________
17 //
18 //  Manager class for the FMD - Detailed version. 
19 //  Implements the full geometry, 
20 //  And does stepping
21 // 
22 #ifndef ALIFMD_H 
23 # include "AliFMD.h"
24 #endif
25 #ifndef ROOT_TLorentzVector
26 # include <TLorentzVector.h>
27 #endif
28  
29 //____________________________________________________________________
30 /** @brief Forward Multiplicity Detector based on Silicon wafers. 
31
32     This class contains the base procedures for the Forward
33     Multiplicity detector Detector consists of 3 sub-detectors FMD1,
34     FMD2, and FMD3, each of which has 1 or 2 rings of silicon sensors.
35                                                            
36     This class contains the detailed version of the FMD - that is,
37     hits are produced during simulation. 
38     @ingroup FMD_sim
39 */
40 class AliFMDv1 : public AliFMD 
41 {
42 public:
43   /** CTOR */
44   AliFMDv1()
45     : AliFMD(),
46       fCurrentDeltaE(0),
47       fCurrentV(),
48       fCurrentP(),
49       fCurrentPdg(0) { fDetailed = kTRUE; }
50   /** CTOR 
51       @param name Name 
52       @param title Title */
53   AliFMDv1(const char *name, const char *title="Detailed geometry") 
54     : AliFMD(name, title),
55       fCurrentDeltaE(0),
56       fCurrentV(),
57       fCurrentP(),
58       fCurrentPdg(0) { fDetailed = kTRUE; }
59   /** DTOR */
60   virtual ~AliFMDv1() {}
61
62   // Required member functions 
63   /** Get version number 
64       @return always 1 */
65   virtual Int_t  IsVersion() const {return 1;}
66   /** Member function that is executed each time a hit is made in the 
67       FMD.  None-charged particles are ignored.   Dead tracks  are
68       ignored.  
69       
70       The procedure is as follows: 
71       - IF NOT track is alive THEN RETURN ENDIF
72       - IF NOT particle is charged THEN RETURN ENDIF
73       - IF NOT volume name is "STRI" or "STRO" THEN RETURN ENDIF 
74       - Get strip number (volume copy # minus 1)
75       - Get phi division number (mother volume copy #)
76       - Get module number (grand-mother volume copy #)
77       - section # = 2 * module # + phi division # - 1
78       - Get ring Id from volume name 
79       - Get detector # from grand-grand-grand-mother volume name 
80       - Get pointer to sub-detector object. 
81       - Get track position 
82       - IF track is entering volume AND track is inside real shape THEN
83       -   Reset energy deposited 
84       -   Get track momentum 
85       -   Get particle ID # 
86       - ENDIF
87       - IF track is inside volume AND inside real shape THEN 
88       -   Update energy deposited 
89       - ENDIF 
90       - IF track is inside real shape AND (track is leaving volume,
91            or it died, or it is stopped  THEN
92       -   Create a hit 
93       - ENDIF 
94   */
95   virtual void   StepManager();
96 protected:
97   /** Translate VMC coordinates to detector coordinates
98       @param v        On output, Current position
99       @param detector On output, detector #
100       @param ring     On output, ring id
101       @param sector   On output, sector #
102       @param strip    On output, strip #
103       @return @c true on success */
104   Bool_t VMC2FMD(TLorentzVector& v, UShort_t& detector,
105                  Char_t& ring, UShort_t& sector, UShort_t& strip) const;
106   /** Translate VMC coordinates to detector coordinates
107       @param copy     Volume copy number 
108       @param v        On output, Current position
109       @param detector On output, detector #
110       @param ring     On output, ring id
111       @param sector   On output, sector #
112       @param strip    On output, strip #
113       @return @c true on success */
114   Bool_t VMC2FMD(Int_t copy, TLorentzVector& v,
115                  UShort_t& detector, Char_t& ring,
116                  UShort_t& sector, UShort_t& strip) const;
117   /** Check if hit is bad.  A hit is bad if 
118       @f[
119       \Delta E > |Q|^2 p / m > 1 
120       @f]
121       holds, where @f$ \Delta E@f$ is the energy loss in this step, 
122       @f$ Q@f$ is the particle charge, @f$ p@f$ is the track momentum,
123       and @f$ m@f$ is the particle mass.   If a track is marked as
124       bad, it's kept in a cache, and can be printed at the end of the
125       event. 
126       @param trackno Track number 
127       @param pdg     PDG particle type ID
128       @param absQ    Absolute value of particle charge
129       @param p       Track momentum
130       @param edep    Energy loss in this step.
131       @return @c true if hit is `bad' */
132   Bool_t CheckHit(Int_t trackno, Int_t pdg, Float_t absQ, 
133                   const TLorentzVector& p, Float_t edep) const;
134
135   Double_t       fCurrentDeltaE;    // The current accumulated energy loss
136   TLorentzVector fCurrentV;         // Current production vertex 
137   TLorentzVector fCurrentP;         // Current momentum vector 
138   Int_t          fCurrentPdg;       // Current PDG code 
139   
140   ClassDef(AliFMDv1,5)  // Detailed FMD geometry
141 };
142
143 #endif
144 //____________________________________________________________________
145 //
146 // Local Variables:
147 //   mode: C++
148 // End:
149 //
150 // EOF
151 //