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"
47 //_____________________________________________________________________________
48 AliTRDv0::AliTRDv0():AliTRD()
51 // AliTRDv0 default constructor
58 //_____________________________________________________________________________
59 AliTRDv0::AliTRDv0(const char *name, const char *title)
63 // Standard constructor for Transition Radiation Detector version 0
70 //_____________________________________________________________________________
74 // AliTRDv0 destructor
79 //_____________________________________________________________________________
80 void AliTRDv0::CreateGeometry()
83 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
84 // This version covers the full azimuth.
87 // Check that FRAME is there otherwise we have no place where to put the TRD
88 AliModule* frame = gAlice->GetModule("FRAME");
91 // Define the chambers
92 AliTRD::CreateGeometry();
96 //_____________________________________________________________________________
97 void AliTRDv0::CreateMaterials()
100 // Create materials for the Transition Radiation Detector
103 AliTRD::CreateMaterials();
107 //_____________________________________________________________________________
108 void AliTRDv0::Init()
111 // Initialize Transition Radiation Detector after geometry is built
116 printf(" Fast simulator\n\n");
117 for (Int_t i = 0; i < 80; i++) printf("*");
122 //_____________________________________________________________________________
123 void AliTRDv0::StepManager()
126 // Procedure called at every step in the TRD
127 // Fast simulator. If switched on, a hit is produced when a track
128 // crosses the border between amplification region and pad plane.
140 // Use pad plane as sensitive volume
141 TString cIdSens = "L";
143 Char_t cIdChamber[3];
146 const Int_t kNplan = AliTRDgeometry::Nplan();
148 // Writing out hits enabled?
149 if (!(fHitsOn)) return;
151 // Use only charged tracks and count them only once per volume
152 if (gMC->TrackCharge() &&
153 gMC->IsTrackEntering()) {
155 // Check on sensitive volume
156 cIdCurrent = gMC->CurrentVolName();
157 if (cIdSens == cIdCurrent[1]) {
159 gMC->TrackPosition(p);
160 for (Int_t i = 0; i < 3; i++) hits[i] = p[i];
162 // The sector number (0 - 17)
163 // The numbering goes clockwise and starts at y = 0
164 Float_t phi = kRaddeg*TMath::ATan2(hits[0],hits[1]);
169 sec = ((Int_t) (phi / 20));
171 // The plane and chamber number
172 cIdChamber[0] = cIdCurrent[2];
173 cIdChamber[1] = cIdCurrent[3];
174 Int_t idChamber = atoi(cIdChamber);
175 cha = ((Int_t) idChamber / kNplan);
176 pla = ((Int_t) idChamber % kNplan);
177 det = fGeometry->GetDetector(pla,cha,sec);
179 AddHit(gAlice->GetCurrentTrackNumber(),det,hits,0,kTRUE);