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