]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMD.cxx
Possibility to have different binaries in the same tree introduced
[u/mrichter/AliRoot.git] / FMD / AliFMD.cxx
1 ///////////////////////////////////////////////////////////////////////////////
2 //                                                                           //
3 //  Forward Multiplicity Detector                                            //
4 //  This class contains the base procedures for the Forward Multiplicity     //
5 //  detector                                                                 //
6 //                                                                           //
7 //Begin_Html
8 /*
9 <img src="picts/AliFMDClass.gif">
10 </pre>
11 <br clear=left>
12 <font size=+2 color=red>
13 <p>The responsible person for this module is
14 <a href="mailto:Valeri.Kondratiev@cern.ch">Valeri Kondratiev</a>.
15 </font>
16 <pre>
17 */
18 //End_Html
19 //                                                                           //
20 //                                                                           //
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #include <TTUBE.h>
24 #include <TNode.h>
25 #include "AliRun.h"
26 #include "AliFMD.h"
27  
28 ClassImp(AliFMD)
29  
30 //_____________________________________________________________________________
31 AliFMD::AliFMD(): AliDetector()
32 {
33   //
34   // Default constructor for class AliFMD
35   //
36   fIshunt   = 0;
37 }
38  
39 //_____________________________________________________________________________
40 AliFMD::AliFMD(const char *name, const char *title)
41        : AliDetector(name,title)
42 {
43   //
44   // Standard constructor for Forward Multiplicity Detector
45   //
46  
47   //
48   // Initialise Hit array
49   fHits   = new TClonesArray("AliFMDhit",  405);
50   
51   fIshunt     =  0;
52 }
53  
54 //_____________________________________________________________________________
55 void AliFMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
56 {
57   //
58   // Add a FMD hit
59   //
60   TClonesArray &lhits = *fHits;
61   new(lhits[fNhits++]) AliFMDhit(fIshunt,track,vol,hits);
62 }
63  
64 //_____________________________________________________________________________
65 void AliFMD::BuildGeometry()
66 {
67   //
68   // Build simple ROOT TNode geometry for event display
69   //
70   TNode *Node, *Top;
71   const int kColorFMD  = 7;
72   //
73   Top=gAlice->GetGeometry()->GetNode("alice");
74
75   // FMD define the different volumes
76   
77   new TTUBE("S_FMD1","FMD sensitive volume 1","void",4.5,10.5,3);
78   Top->cd();
79   Node = new TNode("FMD1","FMD1","S_FMD1",0,0,86.5,"");
80   Node->SetLineColor(kColorFMD);
81   fNodes->Add(Node);
82   
83   new TTUBE("S_FMD2","FMD sensitive volume 2","void",4.5,10.5,3);
84   Top->cd();
85   Node = new TNode("FMD2","FMD2","S_FMD2",0,0,-86.5,"");
86   Node->SetLineColor(kColorFMD);
87   fNodes->Add(Node);
88   
89   new TTUBE("S_FMD3","FMD sensitive volume 3","void",8,14,3);
90   Top->cd();
91   Node = new TNode("FMD3","FMD3","S_FMD3",0,0,71.2,"");
92   Node->SetLineColor(kColorFMD);
93   fNodes->Add(Node);
94   
95   new TTUBE("S_FMD4","FMD sensitive volume 4","void",8,14,3);
96   Top->cd();
97   Node = new TNode("FMD4","FMD4","S_FMD4",0,0,-71.2,"");
98   fNodes->Add(Node);
99   Node->SetLineColor(kColorFMD);
100   
101   new TTUBE("S_FMD5","FMD sensitive volume 5","void",8,17.5,3);
102   Top->cd();
103   Node = new TNode("FMD5","FMD5","S_FMD5",0,0,44,"");
104   Node->SetLineColor(kColorFMD);
105   fNodes->Add(Node);
106   
107   new TTUBE("S_FMD6","FMD sensitive volume 6","void",8,17.5,3);
108   Top->cd();
109   Node = new TNode("FMD6","FMD6","S_FMD6",0,0,-44,"");
110   Node->SetLineColor(kColorFMD);
111   fNodes->Add(Node);
112   
113   new TTUBE("S_FMD7","FMD sensitive volume 7","void",4.2,13,3);
114   Top->cd();
115   Node = new TNode("FMD7","FMD7","S_FMD7",0,0,-231,"");
116   Node->SetLineColor(kColorFMD);
117   fNodes->Add(Node);
118 }
119  
120 //_____________________________________________________________________________
121 Int_t AliFMD::DistancetoPrimitive(Int_t , Int_t )
122 {
123   //
124   // Calculate the distance from the mouse to the FMD on the screen
125   // Dummy routine
126   //
127   return 9999;
128 }
129  
130 //_____________________________________________________________________________
131 void AliFMD::StepManager()
132 {
133   //
134   // Called for each step in the FMD
135   //
136   
137   Float_t       hits[3];
138   Int_t         i,copy,vol[1];
139   TClonesArray &lhits = *fHits;
140   TLorentzVector p;
141   
142   gMC->CurrentVolID(copy);
143   vol[0] = copy;
144   gMC->TrackPosition(p);
145   for(i=0;i<3;++i) hits[i]=p[i];
146   new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->CurrentTrack(),vol,hits);
147 }
148
149 //___________________________________________
150 void AliFMD::Init()
151 {
152   //
153   // Initialis the FMD after it has been built
154   Int_t i;
155   //
156   printf("\n");
157   for(i=0;i<35;i++) printf("*");
158   printf(" FMD_INIT ");
159   for(i=0;i<35;i++) printf("*");
160   printf("\n");
161   //
162   // Here the FMD initialisation code (if any!)
163   for(i=0;i<80;i++) printf("*");
164   printf("\n");
165 }
166
167  
168 ClassImp(AliFMDhit)
169  
170 //_____________________________________________________________________________
171 AliFMDhit::AliFMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
172   AliHit(shunt, track)
173 {
174   //
175   // Add a FMD hit
176   //
177   fVolume = vol[0];
178   fX=hits[0];
179   fY=hits[1];
180   fZ=hits[2];
181 }
182