1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 ///////////////////////////////////////////////////////////////////////////////
22 // START (T-Zero) Detector //
23 // This class contains the base procedures for the START //
28 <img src="gif/AliSTARTClass.gif">
31 <font size=+2 color=red>
32 <p>The responsible person for this module is
33 <a href="mailto:Alla.Maevskaia@cern.ch">Alla Maevskaia</a>.
40 ///////////////////////////////////////////////////////////////////////////////
45 #include <TGeometry.h>
51 //#include "TGeant3.h"
55 //_____________________________________________________________________________
59 // Default constructor for class AliSTART
64 //_____________________________________________________________________________
65 AliSTART::AliSTART(const char *name, const char *title)
66 : AliDetector(name,title)
69 // Standard constructor for START Detector
72 AliModule *fmd = gAlice->GetModule("FMD");
74 Int_t fmdversion = fmd->IsVersion();
75 if(fmdversion==0 || fmdversion==1) {
76 Error("ctor","Versions 0 and 1 of FMD incompatible with START\n");
81 // Initialise Hit array
82 fHits = new TClonesArray("AliSTARThit", 405);
90 //_____________________________________________________________________________
91 void AliSTART::AddHit(Int_t track, Int_t *vol, Float_t *hits)
96 TClonesArray &lhits = *fHits;
97 new(lhits[fNhits++]) AliSTARThit(fIshunt,track,vol,hits);
100 //_____________________________________________________________________________
101 void AliSTART::BuildGeometry()
104 // Build simple ROOT TNode geometry for event display
107 const int kColorSTART = 19;
109 Top=gAlice->GetGeometry()->GetNode("alice");
111 // START define the different volumes
112 new TRotMatrix("rot999","rot999", 90,0,90,90,180,0);
114 new TTUBE("S_STR1","START volume 1","void",5.,10.7,5.3);
116 Node = new TNode("STR1","STR1","S_STR1",0,0,75.,"");
117 Node->SetLineColor(kColorSTART);
120 new TTUBE("S_STR2","START volume 2","void",5.,10.7,5.3);
122 Node = new TNode("STR2","STR2","S_STR2",0,0,-75,"rot999");
123 Node->SetLineColor(kColorSTART);
127 //_____________________________________________________________________________
128 Int_t AliSTART::DistanceToPrimitive(Int_t px, Int_t py)
131 // Calculate the distance from the mouse to the START on the screen
137 //_____________________________________________________________________________
139 //-------------------------------------------------------------------------
140 void AliSTART::Init()
143 // Initialis the START after it has been built
145 AliMC* pMC = AliMC::GetMC();
148 for(i=0;i<35;i++) printf("*");
149 printf(" START_INIT ");
150 for(i=0;i<35;i++) printf("*");
153 // Here the START initialisation code (if any!)
154 for(i=0;i<80;i++) printf("*");
158 fIdSens1=pMC->VolId("PTOP");
162 //---------------------------------------------------------------------------
163 void AliSTART::MakeBranch(Option_t* option)
166 // Create Tree branches for the START.
167 Int_t buffersize = 4000;
169 sprintf(branchname,"%s",GetName());
171 AliDetector::MakeBranch(option);
173 char *D = strstr(option,"D");
175 if (fDigits && gAlice->TreeD() && D) {
176 gAlice->TreeD()->Branch(branchname,&fDigits, buffersize);
177 printf("Making Branch %s for digits\n",branchname);
182 ClassImp(AliSTARThit)
184 //_____________________________________________________________________________
185 AliSTARThit::AliSTARThit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
195 //printf("fvolume %d\n",fVolume);
196 //printf("fpmt %d\n",fPmt);
203 fParticle=Int_t (hits[5]);
206 //for (i=0; i<=6; i++) {printf("Hits up %f\n",hits[i]);}
209 // ClassImp(AliSTARTdigit)