]>
Commit | Line | Data |
---|---|---|
4c039060 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
88cb7938 | 16 | /* $Id$ */ |
4c039060 | 17 | |
6ca40650 | 18 | /////////////////////////////////////////////////////////////////////////////// |
19 | // // | |
20 | // START (T-Zero) Detector // | |
21 | // This class contains the base procedures for the START // | |
22 | // detector // | |
23 | // // | |
24 | //Begin_Html | |
25 | /* | |
26 | <img src="gif/AliSTARTClass.gif"> | |
27 | </pre> | |
28 | <br clear=left> | |
29 | <font size=+2 color=red> | |
30 | <p>The responsible person for this module is | |
31 | <a href="mailto:Alla.Maevskaia@cern.ch">Alla Maevskaia</a>. | |
32 | </font> | |
33 | <pre> | |
34 | */ | |
35 | //End_Html | |
36 | // // | |
37 | // // | |
38 | /////////////////////////////////////////////////////////////////////////////// | |
39 | ||
ef0750c2 | 40 | #include <Riostream.h> |
971579f6 | 41 | |
88cb7938 | 42 | #include <TFile.h> |
43 | #include <TGeometry.h> | |
44 | #include <TMath.h> | |
45 | #include <TNode.h> | |
46 | #include <TParticle.h> | |
47 | #include <TRandom.h> | |
48 | #include <TTUBE.h> | |
49 | #include <TVirtualMC.h> | |
2ab0c725 | 50 | |
88cb7938 | 51 | #include "AliLoader.h" |
971579f6 | 52 | #include "AliRun.h" |
53 | #include "AliSTART.h" | |
54 | #include "AliSTARTdigit.h" | |
971579f6 | 55 | #include "AliSTARThit.h" |
e73d68f2 | 56 | #include "AliSTARThitPhoton.h" |
c345bb4f | 57 | #include "AliSTARTvertex.h" |
971579f6 | 58 | |
6ca40650 | 59 | ClassImp(AliSTART) |
ef51244a | 60 | |
61 | static AliSTARTdigit *digits; | |
62 | ||
6ca40650 | 63 | //_____________________________________________________________________________ |
99560b47 | 64 | AliSTART::AliSTART() |
6ca40650 | 65 | { |
66 | // | |
67 | // Default constructor for class AliSTART | |
68 | // | |
f3ed336b | 69 | fIshunt = 1; |
971579f6 | 70 | fHits = 0; |
71 | fDigits = 0; | |
e73d68f2 | 72 | fPhotons = 0; |
6ca40650 | 73 | } |
74 | ||
75 | //_____________________________________________________________________________ | |
76 | AliSTART::AliSTART(const char *name, const char *title) | |
77 | : AliDetector(name,title) | |
78 | { | |
79 | // | |
80 | // Standard constructor for START Detector | |
81 | // | |
971579f6 | 82 | |
c345bb4f | 83 | |
6ca40650 | 84 | // |
85 | // Initialise Hit array | |
971579f6 | 86 | fHits = new TClonesArray("AliSTARThit", 405); |
b169435d | 87 | gAlice->AddHitList(fHits); |
e73d68f2 | 88 | |
89 | fPhotons = new TClonesArray("AliSTARThitPhoton", 10000); | |
90 | gAlice->AddHitList (fPhotons); | |
6ca40650 | 91 | |
f3ed336b | 92 | fIshunt = 1; |
c345bb4f | 93 | fIdSens = 0; |
e73d68f2 | 94 | fNPhotons = 0; |
6ca40650 | 95 | SetMarkerColor(kRed); |
96 | } | |
bff160c8 | 97 | |
98 | //_____________________________________________________________________________ | |
99 | AliSTART::~AliSTART() { | |
100 | if (fHits) { | |
101 | fHits->Delete(); | |
102 | delete fHits; | |
103 | } | |
e73d68f2 | 104 | if (fPhotons) { |
105 | fPhotons->Delete(); | |
106 | delete fPhotons; | |
107 | } | |
bff160c8 | 108 | } |
6ca40650 | 109 | |
110 | //_____________________________________________________________________________ | |
111 | void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits) | |
112 | { | |
113 | // | |
114 | // Add a START hit | |
115 | // | |
116 | TClonesArray &lhits = *fHits; | |
117 | new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits); | |
118 | } | |
971579f6 | 119 | |
e73d68f2 | 120 | //_____________________________________________________________________________ |
121 | void AliSTART::AddHitPhoton(Int_t track, Int_t *vol, Float_t *hits) | |
122 | { | |
123 | // Add a START hit of photons | |
124 | ||
125 | TClonesArray &lhits = *fPhotons; | |
126 | new(lhits[fNPhotons++]) AliSTARThitPhoton(fIshunt,track,vol,hits); | |
127 | } | |
128 | ||
971579f6 | 129 | //_____________________________________________________________________________ |
c345bb4f | 130 | |
971579f6 | 131 | void AliSTART::AddDigit(Int_t *tracks,Int_t *digits) |
132 | { | |
c345bb4f | 133 | |
f3ed336b | 134 | // Add a START digit to the list. Dummy function. |
c345bb4f | 135 | |
971579f6 | 136 | } |
c345bb4f | 137 | |
6ca40650 | 138 | //_____________________________________________________________________________ |
139 | void AliSTART::BuildGeometry() | |
140 | { | |
141 | // | |
142 | // Build simple ROOT TNode geometry for event display | |
143 | // | |
ef51244a | 144 | TNode *node, *top; |
6ca40650 | 145 | const int kColorSTART = 19; |
f3ed336b | 146 | |
ef51244a | 147 | top=gAlice->GetGeometry()->GetNode("alice"); |
6ca40650 | 148 | |
149 | // START define the different volumes | |
44b06417 | 150 | new TRotMatrix("rotx999","rot999", 90,0,90,90,180,0); |
6ca40650 | 151 | |
2ca99a7f | 152 | new TTUBE("S_0ST1","START volume 1","void",5.,10.7,5.3); |
ef51244a | 153 | top->cd(); |
a94466c5 | 154 | node = new TNode("0ST1","0ST01","S_0ST1",0,0,69.7,""); |
ef51244a | 155 | node->SetLineColor(kColorSTART); |
156 | fNodes->Add(node); | |
6ca40650 | 157 | |
2ca99a7f | 158 | new TTUBE("S_0ST2","START volume 2","void",5.,10.7,5.3); |
ef51244a | 159 | top->cd(); |
a94466c5 | 160 | node = new TNode("0ST2","0ST2","S_0ST2",0,0,-350,"rotx999"); |
ef51244a | 161 | node->SetLineColor(kColorSTART); |
162 | fNodes->Add(node); | |
6ca40650 | 163 | } |
164 | ||
165 | //_____________________________________________________________________________ | |
166 | Int_t AliSTART::DistanceToPrimitive(Int_t px, Int_t py) | |
167 | { | |
168 | // | |
169 | // Calculate the distance from the mouse to the START on the screen | |
170 | // Dummy routine | |
171 | // | |
172 | return 9999; | |
173 | } | |
174 | ||
6ca40650 | 175 | //------------------------------------------------------------------------- |
176 | void AliSTART::Init() | |
177 | { | |
178 | // | |
179 | // Initialis the START after it has been built | |
180 | Int_t i; | |
6ca40650 | 181 | // |
9e1a0ddb | 182 | if(fDebug) { |
183 | printf("\n%s: ",ClassName()); | |
184 | for(i=0;i<35;i++) printf("*"); | |
185 | printf(" START_INIT "); | |
186 | for(i=0;i<35;i++) printf("*"); | |
187 | printf("\n%s: ",ClassName()); | |
188 | // | |
189 | // Here the START initialisation code (if any!) | |
190 | for(i=0;i<80;i++) printf("*"); | |
191 | printf("\n"); | |
192 | } | |
6ca40650 | 193 | } |
194 | ||
195 | //--------------------------------------------------------------------------- | |
88cb7938 | 196 | void AliSTART::MakeBranch(Option_t* option) |
6ca40650 | 197 | { |
ef51244a | 198 | // |
199 | // Specific START branches | |
200 | // | |
6ca40650 | 201 | // Create Tree branches for the START. |
e73d68f2 | 202 | Int_t buffersize = 4000; |
203 | char branchname[20]; | |
6ca40650 | 204 | sprintf(branchname,"%s",GetName()); |
205 | ||
6ca40650 | 206 | |
5cf7bbad | 207 | const char *cD = strstr(option,"D"); |
e73d68f2 | 208 | const char *cH = strstr(option,"H"); |
209 | ||
88cb7938 | 210 | if (cH && fLoader->TreeH()) |
e73d68f2 | 211 | { |
88cb7938 | 212 | if (fPhotons == 0x0) fPhotons = new TClonesArray("AliSTARThitPhoton", 10000); |
e73d68f2 | 213 | sprintf (branchname, "%shitPhoton", GetName()); |
88cb7938 | 214 | MakeBranchInTree (fLoader->TreeH(), branchname, &fPhotons, 50000, 0); |
215 | if (fHits == 0x0) fHits = new TClonesArray("AliSTARThit", 405); | |
e73d68f2 | 216 | } |
2ab0c725 | 217 | |
88cb7938 | 218 | AliDetector::MakeBranch(option); |
219 | ||
2ab0c725 | 220 | if (cD) { |
221 | digits = new AliSTARTdigit(); | |
88cb7938 | 222 | MakeBranchInTree(fLoader->TreeD(), branchname, "AliSTARTdigit", digits, buffersize, 1, 0); |
2ab0c725 | 223 | } |
6ca40650 | 224 | } |
971579f6 | 225 | |
e73d68f2 | 226 | //_____________________________________________________________________________ |
227 | void AliSTART::ResetHits() | |
228 | { | |
229 | AliDetector::ResetHits(); | |
230 | ||
231 | fNPhotons = 0; | |
232 | if (fPhotons) fPhotons->Clear(); | |
233 | } | |
234 | ||
235 | //_____________________________________________________________________________ | |
236 | void AliSTART::SetTreeAddress() | |
237 | { | |
88cb7938 | 238 | TBranch *branch; |
239 | TTree *treeH; | |
240 | ||
241 | ||
242 | treeH = TreeH(); | |
e73d68f2 | 243 | |
244 | if (treeH) | |
e73d68f2 | 245 | { |
88cb7938 | 246 | if (fPhotons == 0x0) fPhotons = new TClonesArray("AliSTARThitPhoton", 10000); |
247 | branch = treeH->GetBranch("STARThitPhoton"); | |
248 | if (branch) branch->SetAddress(&fPhotons); | |
249 | if (fHits == 0x0) fHits = new TClonesArray("AliSTARThit", 405); | |
e73d68f2 | 250 | } |
88cb7938 | 251 | |
252 | AliDetector::SetTreeAddress(); | |
253 | ||
e73d68f2 | 254 | } |
255 | ||
256 | ||
971579f6 | 257 | //_____________________________________________________________________________ |
c345bb4f | 258 | |
971579f6 | 259 | void AliSTART::Hit2digit(Int_t evnum) |
260 | { | |
f3ed336b | 261 | } |
c345bb4f | 262 |