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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 // Transition Radiation Detector version 0 -- fast simulator //
24 <img src="picts/AliTRDfullClass.gif">
29 ///////////////////////////////////////////////////////////////////////////////
33 #include <TLorentzVector.h>
37 #include <TVirtualMC.h>
41 #include "AliTRDgeometry.h"
42 #include "AliTRDhit.h"
48 //_____________________________________________________________________________
49 AliTRDv0::AliTRDv0():AliTRD()
52 // AliTRDv0 default constructor
59 //_____________________________________________________________________________
60 AliTRDv0::AliTRDv0(const char *name, const char *title)
64 // Standard constructor for Transition Radiation Detector version 0
71 //_____________________________________________________________________________
75 // AliTRDv0 destructor
80 //_____________________________________________________________________________
81 void AliTRDv0::CreateGeometry()
84 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
85 // This version covers the full azimuth.
88 // Check that FRAME is there otherwise we have no place where to put the TRD
89 AliModule* frame = gAlice->GetModule("FRAME");
92 // Define the chambers
93 AliTRD::CreateGeometry();
97 //_____________________________________________________________________________
98 void AliTRDv0::CreateMaterials()
101 // Create materials for the Transition Radiation Detector
104 AliTRD::CreateMaterials();
108 //_____________________________________________________________________________
109 void AliTRDv0::Init()
112 // Initialize Transition Radiation Detector after geometry is built
117 printf(" Fast simulator\n\n");
118 for (Int_t i = 0; i < 80; i++) printf("*");
123 //_____________________________________________________________________________
124 void AliTRDv0::StepManager()
127 // Procedure called at every step in the TRD
128 // Fast simulator. If switched on, a hit is produced when a track
129 // crosses the border between amplification region and pad plane.
141 // Use pad plane as sensitive volume
142 TString cIdSens = "L";
144 Char_t cIdChamber[3];
147 const Int_t kNplan = AliTRDgeometry::Nplan();
149 // Writing out hits enabled?
150 if (!(fHitsOn)) return;
152 // Use only charged tracks and count them only once per volume
153 if (gMC->TrackCharge() &&
154 gMC->IsTrackEntering()) {
156 // Check on sensitive volume
157 cIdCurrent = gMC->CurrentVolName();
158 if (cIdSens == cIdCurrent[1]) {
160 gMC->TrackPosition(p);
161 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
163 // The sector number (0 - 17)
164 // The numbering goes clockwise and starts at y = 0
165 Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]);
170 sec = ((Int_t) (phi / 20));
172 // The plane and chamber number
173 cIdChamber[0] = cIdCurrent[2];
174 cIdChamber[1] = cIdCurrent[3];
175 Int_t idChamber = atoi(cIdChamber);
176 cha = ((Int_t) idChamber / kNplan);
177 pla = ((Int_t) idChamber % kNplan);
178 det = fGeometry->GetDetector(pla,cha,sec);
180 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,hits,0,kTRUE);