]>
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 | ||
16 | /* | |
17 | $Log$ | |
1cedd08a | 18 | Revision 1.4 1999/11/12 15:04:00 fca |
19 | Modifications from A.Maevskaya | |
20 | ||
82fc3fb3 | 21 | Revision 1.3 1999/09/29 09:24:29 fca |
22 | Introduction of the Copyright and cvs Log | |
23 | ||
4c039060 | 24 | */ |
25 | ||
6ca40650 | 26 | /////////////////////////////////////////////////////////////////////////////// |
27 | // // | |
28 | // START (T-Zero) Detector // | |
29 | // This class contains the base procedures for the START // | |
30 | // detector // | |
31 | // // | |
32 | //Begin_Html | |
33 | /* | |
34 | <img src="gif/AliSTARTClass.gif"> | |
35 | </pre> | |
36 | <br clear=left> | |
37 | <font size=+2 color=red> | |
38 | <p>The responsible person for this module is | |
39 | <a href="mailto:Alla.Maevskaia@cern.ch">Alla Maevskaia</a>. | |
40 | </font> | |
41 | <pre> | |
42 | */ | |
43 | //End_Html | |
44 | // // | |
45 | // // | |
46 | /////////////////////////////////////////////////////////////////////////////// | |
99560b47 | 47 | #include <stdlib.h> |
6ca40650 | 48 | |
49 | #include <TTUBE.h> | |
50 | #include <TNode.h> | |
51 | #include <TGeometry.h> | |
52 | #include "AliRun.h" | |
53 | #include "AliSTART.h" | |
54 | #include <iostream.h> | |
55 | #include <fstream.h> | |
56 | #include "AliMC.h" | |
6ca40650 | 57 | |
58 | ClassImp(AliSTART) | |
59 | ||
60 | //_____________________________________________________________________________ | |
99560b47 | 61 | AliSTART::AliSTART() |
6ca40650 | 62 | { |
63 | // | |
64 | // Default constructor for class AliSTART | |
65 | // | |
66 | fIshunt = 0; | |
67 | } | |
68 | ||
69 | //_____________________________________________________________________________ | |
70 | AliSTART::AliSTART(const char *name, const char *title) | |
71 | : AliDetector(name,title) | |
72 | { | |
73 | // | |
74 | // Standard constructor for START Detector | |
75 | // | |
76 | ||
99560b47 | 77 | AliModule *fmd = gAlice->GetModule("FMD"); |
78 | if(fmd) { | |
79 | Int_t fmdversion = fmd->IsVersion(); | |
80 | if(fmdversion==0 || fmdversion==1) { | |
81 | Error("ctor","Versions 0 and 1 of FMD incompatible with START\n"); | |
82 | exit(1); | |
83 | } | |
84 | } | |
6ca40650 | 85 | // |
86 | // Initialise Hit array | |
87 | fHits = new TClonesArray("AliSTARThit", 405); | |
1cedd08a | 88 | gAlice->AddHitList(fHits); |
6ca40650 | 89 | |
90 | fIshunt = 0; | |
91 | fIdSens1 = 0; | |
92 | ||
93 | SetMarkerColor(kRed); | |
94 | } | |
95 | ||
96 | //_____________________________________________________________________________ | |
97 | void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits) | |
98 | { | |
99 | // | |
100 | // Add a START hit | |
101 | // | |
102 | TClonesArray &lhits = *fHits; | |
103 | new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits); | |
104 | } | |
105 | ||
106 | //_____________________________________________________________________________ | |
107 | void AliSTART::BuildGeometry() | |
108 | { | |
109 | // | |
110 | // Build simple ROOT TNode geometry for event display | |
111 | // | |
112 | TNode *Node, *Top; | |
113 | const int kColorSTART = 19; | |
114 | // | |
115 | Top=gAlice->GetGeometry()->GetNode("alice"); | |
116 | ||
117 | // START define the different volumes | |
118 | new TRotMatrix("rot999","rot999", 90,0,90,90,180,0); | |
119 | ||
120 | new TTUBE("S_STR1","START volume 1","void",5.,10.7,5.3); | |
121 | Top->cd(); | |
122 | Node = new TNode("STR1","STR1","S_STR1",0,0,75.,""); | |
123 | Node->SetLineColor(kColorSTART); | |
124 | fNodes->Add(Node); | |
125 | ||
126 | new TTUBE("S_STR2","START volume 2","void",5.,10.7,5.3); | |
127 | Top->cd(); | |
128 | Node = new TNode("STR2","STR2","S_STR2",0,0,-75,"rot999"); | |
129 | Node->SetLineColor(kColorSTART); | |
130 | fNodes->Add(Node); | |
131 | } | |
132 | ||
133 | //_____________________________________________________________________________ | |
134 | Int_t AliSTART::DistanceToPrimitive(Int_t px, Int_t py) | |
135 | { | |
136 | // | |
137 | // Calculate the distance from the mouse to the START on the screen | |
138 | // Dummy routine | |
139 | // | |
140 | return 9999; | |
141 | } | |
142 | ||
143 | //_____________________________________________________________________________ | |
144 | ||
145 | //------------------------------------------------------------------------- | |
146 | void AliSTART::Init() | |
147 | { | |
148 | // | |
149 | // Initialis the START after it has been built | |
150 | Int_t i; | |
6ca40650 | 151 | // |
152 | printf("\n"); | |
153 | for(i=0;i<35;i++) printf("*"); | |
154 | printf(" START_INIT "); | |
155 | for(i=0;i<35;i++) printf("*"); | |
156 | printf("\n"); | |
157 | // | |
158 | // Here the START initialisation code (if any!) | |
159 | for(i=0;i<80;i++) printf("*"); | |
160 | printf("\n"); | |
161 | // | |
162 | // | |
82fc3fb3 | 163 | fIdSens1=gMC->VolId("PTOP"); |
6ca40650 | 164 | |
165 | } | |
166 | ||
167 | //--------------------------------------------------------------------------- | |
168 | void AliSTART::MakeBranch(Option_t* option) | |
169 | { | |
170 | ||
171 | // Create Tree branches for the START. | |
172 | Int_t buffersize = 4000; | |
173 | char branchname[10]; | |
174 | sprintf(branchname,"%s",GetName()); | |
175 | ||
176 | AliDetector::MakeBranch(option); | |
177 | ||
178 | char *D = strstr(option,"D"); | |
179 | ||
180 | if (fDigits && gAlice->TreeD() && D) { | |
181 | gAlice->TreeD()->Branch(branchname,&fDigits, buffersize); | |
182 | printf("Making Branch %s for digits\n",branchname); | |
183 | } | |
184 | ||
185 | } | |
186 | ||
187 | ClassImp(AliSTARThit) | |
188 | ||
189 | //_____________________________________________________________________________ | |
190 | AliSTARThit::AliSTARThit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits): | |
191 | AliHit(shunt, track) | |
192 | { | |
193 | // | |
194 | // Add a START hit | |
195 | // | |
196 | ||
197 | // Int_t i; | |
198 | fVolume = vol[0]; | |
199 | fPmt=vol[1]; | |
200 | //printf("fvolume %d\n",fVolume); | |
201 | //printf("fpmt %d\n",fPmt); | |
202 | ||
203 | fX=hits[0]; | |
204 | fY=hits[1]; | |
205 | fZ=hits[2]; | |
206 | fEdep=hits[3]; | |
207 | fEtot=hits[4]; | |
208 | fParticle=Int_t (hits[5]); | |
209 | fTime=hits[6]; | |
210 | ||
211 | //for (i=0; i<=6; i++) {printf("Hits up %f\n",hits[i]);} | |
212 | } | |
213 | ||
214 | // ClassImp(AliSTARTdigit) |