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 //
22 ///////////////////////////////////////////////////////////////////////////////
26 #include <TLorentzVector.h>
30 #include <TVirtualMC.h>
36 #include "AliTRDgeometry.h"
37 #include "AliTRDhit.h"
42 //_____________________________________________________________________________
48 // AliTRDv0 default constructor
53 //_____________________________________________________________________________
54 AliTRDv0::AliTRDv0(const char *name, const char *title)
59 // Standard constructor for Transition Radiation Detector version 0
64 //_____________________________________________________________________________
68 // AliTRDv0 destructor
73 //_____________________________________________________________________________
74 void AliTRDv0::CreateGeometry()
77 // Create the GEANT geometry for the Transition Radiation Detector - Version 0
78 // This version covers the full azimuth.
81 // Check that FRAME is there otherwise we have no place where to put the TRD
82 AliModule* frame = gAlice->GetModule("FRAME");
84 AliError("TRD needs FRAME to be present\n");
88 // Define the chambers
89 AliTRD::CreateGeometry();
93 //_____________________________________________________________________________
94 void AliTRDv0::CreateMaterials()
97 // Create materials for the Transition Radiation Detector
100 AliTRD::CreateMaterials();
104 //_____________________________________________________________________________
105 void AliTRDv0::Init()
108 // Initialize Transition Radiation Detector after geometry is built
113 AliDebug(1," Fast simulator\n\n");
114 AliDebug(1,"++++++++++++++++++++++++++++++++++++++++++++++");
118 //_____________________________________________________________________________
119 void AliTRDv0::StepManager()
122 // Procedure called at every step in the TRD
123 // Fast simulator. If switched on, a hit is produced when a track
124 // crosses the border between amplification region and pad plane.
136 // Use pad plane as sensitive volume
137 TString cIdSens = "L";
139 Char_t cIdChamber[3];
142 const Int_t kNplan = AliTRDgeometry::Nplan();
144 // Writing out hits enabled?
149 // Use only charged tracks and count them only once per volume
150 if (gMC->TrackCharge() &&
151 gMC->IsTrackEntering()) {
153 // Check on sensitive volume
154 cIdCurrent = gMC->CurrentVolName();
155 if (cIdSens == cIdCurrent[1]) {
157 gMC->TrackPosition(p);
158 for (Int_t i = 0; i < 3; 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]);
171 sec = ((Int_t) (phi / 20.0));
173 // The plane and chamber number
174 cIdChamber[0] = cIdCurrent[2];
175 cIdChamber[1] = cIdCurrent[3];
176 Int_t idChamber = atoi(cIdChamber);
177 cha = ((Int_t) idChamber / kNplan);
178 pla = ((Int_t) idChamber % kNplan);
179 det = fGeometry->GetDetector(pla,cha,sec);
181 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,hits,0,kTRUE);