User correct weight for atomes making up Al2O3
[u/mrichter/AliRoot.git] / START / AliSTART.cxx
CommitLineData
6ca40650 1///////////////////////////////////////////////////////////////////////////////
2// //
3// START (T-Zero) Detector //
4// This class contains the base procedures for the START //
5// detector //
6// //
7//Begin_Html
8/*
9<img src="gif/AliSTARTClass.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:Alla.Maevskaia@cern.ch">Alla Maevskaia</a>.
15</font>
16<pre>
17*/
18//End_Html
19// //
20// //
21///////////////////////////////////////////////////////////////////////////////
22
23#include <TTUBE.h>
24#include <TNode.h>
25#include <TGeometry.h>
26#include "AliRun.h"
27#include "AliSTART.h"
28#include <iostream.h>
29#include <fstream.h>
30#include "AliMC.h"
31//#include "TGeant3.h"
32
33ClassImp(AliSTART)
34
35//_____________________________________________________________________________
36AliSTART::AliSTART(): AliDetector()
37{
38 //
39 // Default constructor for class AliSTART
40 //
41 fIshunt = 0;
42}
43
44//_____________________________________________________________________________
45AliSTART::AliSTART(const char *name, const char *title)
46 : AliDetector(name,title)
47{
48 //
49 // Standard constructor for START Detector
50 //
51
52 //
53 // Initialise Hit array
54 fHits = new TClonesArray("AliSTARThit", 405);
55
56 fIshunt = 0;
57 fIdSens1 = 0;
58
59 SetMarkerColor(kRed);
60}
61
62//_____________________________________________________________________________
63void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits)
64{
65 //
66 // Add a START hit
67 //
68 TClonesArray &lhits = *fHits;
69 new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits);
70}
71
72//_____________________________________________________________________________
73void AliSTART::BuildGeometry()
74{
75 //
76 // Build simple ROOT TNode geometry for event display
77 //
78 TNode *Node, *Top;
79 const int kColorSTART = 19;
80 //
81 Top=gAlice->GetGeometry()->GetNode("alice");
82
83 // START define the different volumes
84 new TRotMatrix("rot999","rot999", 90,0,90,90,180,0);
85
86 new TTUBE("S_STR1","START volume 1","void",5.,10.7,5.3);
87 Top->cd();
88 Node = new TNode("STR1","STR1","S_STR1",0,0,75.,"");
89 Node->SetLineColor(kColorSTART);
90 fNodes->Add(Node);
91
92 new TTUBE("S_STR2","START volume 2","void",5.,10.7,5.3);
93 Top->cd();
94 Node = new TNode("STR2","STR2","S_STR2",0,0,-75,"rot999");
95 Node->SetLineColor(kColorSTART);
96 fNodes->Add(Node);
97}
98
99//_____________________________________________________________________________
100Int_t AliSTART::DistanceToPrimitive(Int_t px, Int_t py)
101{
102 //
103 // Calculate the distance from the mouse to the START on the screen
104 // Dummy routine
105 //
106 return 9999;
107}
108
109//_____________________________________________________________________________
110
111//-------------------------------------------------------------------------
112void AliSTART::Init()
113{
114 //
115 // Initialis the START after it has been built
116 Int_t i;
117 AliMC* pMC = AliMC::GetMC();
118 //
119 printf("\n");
120 for(i=0;i<35;i++) printf("*");
121 printf(" START_INIT ");
122 for(i=0;i<35;i++) printf("*");
123 printf("\n");
124 //
125 // Here the START initialisation code (if any!)
126 for(i=0;i<80;i++) printf("*");
127 printf("\n");
128 //
129 //
130 fIdSens1=pMC->VolId("PTOP");
131
132}
133
134//---------------------------------------------------------------------------
135void AliSTART::MakeBranch(Option_t* option)
136{
137
138 // Create Tree branches for the START.
139 Int_t buffersize = 4000;
140 char branchname[10];
141 sprintf(branchname,"%s",GetName());
142
143 AliDetector::MakeBranch(option);
144
145 char *D = strstr(option,"D");
146
147 if (fDigits && gAlice->TreeD() && D) {
148 gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
149 printf("Making Branch %s for digits\n",branchname);
150 }
151
152}
153
154ClassImp(AliSTARThit)
155
156//_____________________________________________________________________________
157AliSTARThit::AliSTARThit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
158 AliHit(shunt, track)
159{
160 //
161 // Add a START hit
162 //
163
164// Int_t i;
165 fVolume = vol[0];
166 fPmt=vol[1];
167//printf("fvolume %d\n",fVolume);
168//printf("fpmt %d\n",fPmt);
169
170 fX=hits[0];
171 fY=hits[1];
172 fZ=hits[2];
173 fEdep=hits[3];
174 fEtot=hits[4];
175 fParticle=Int_t (hits[5]);
176 fTime=hits[6];
177
178//for (i=0; i<=6; i++) {printf("Hits up %f\n",hits[i]);}
179}
180
181// ClassImp(AliSTARTdigit)