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 purpeateose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 // AliMUONv3 Addapted for AliMUONv1
17 // This was the last revision of AliMUONv1
19 // Revision 1.40 2003/01/28 13:21:06 morsch
20 // Improved response simulation for station 1.
21 // (M. Mac Cormick, I. Hrivnacova, D. Guez)
23 // Gines Martinez (Subatech) jan 2003
25 /////////////////////////////////////////////////////////
26 // Manager and hits classes for set:MUON version 2 //
27 /////////////////////////////////////////////////////////
29 #include <Riostream.h>
30 #include <TClonesArray.h>
31 #include <TLorentzVector.h>
36 #include "AliMUONv3.h"
39 #include "AliCallf77.h"
41 #include "AliMUONChamber.h"
42 #include "AliMUONHit.h"
43 #include "AliMUONPadHit.h"
44 #include "AliMUONConstants.h"
45 #include "AliMUONTriggerCircuit.h"
46 #include "AliMUONFactory.h"
50 //___________________________________________
51 AliMUONv3::AliMUONv3() : AliMUONv1()
58 //___________________________________________
59 AliMUONv3::AliMUONv3(const char *name, const char *title)
60 : AliMUONv1(name,title)
63 // By default include all stations
64 fStations = new Int_t[5];
65 for (Int_t i=0; i<5; i++) fStations[i] = 1;
67 AliMUONFactory factory;
68 factory.Build(this, title);
70 //___________________________________________
71 void AliMUONv3::StepManager()
78 // Particule id, pos and mom vectors,
79 // theta, phi angles with respect the normal of the chamber,
80 // spatial step, delta_energy and time of flight
82 TLorentzVector pos, mom;
83 Float_t theta, phi, tof;
86 TClonesArray &lhits = *fHits;
88 // Only charged tracks
89 if( !(gMC->TrackCharge()) ) return;
91 // Only gas gap inside chamber
92 // Tag chambers and record hits when track enters
94 id=gMC->CurrentVolID(copy);
95 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
96 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) {
101 if (idvol == -1) return;
103 // Get current particle id (ipart), track position (pos) and momentum (mom)
104 gMC->TrackPosition(pos);
105 gMC->TrackMomentum(mom);
106 ipart = gMC->TrackPid();
107 theta = mom.Theta()*kRaddeg; // theta of track
108 phi = mom.Phi() *kRaddeg; // phi of the track
109 tof = gMC->TrackTime(); // Time of flight
111 // momentum loss and steplength in last step
112 destep = gMC->Edep();
113 step = gMC->TrackStep();
116 AliMUONHit(fIshunt, gAlice->CurrentTrack(), iChamber, ipart, pos.X(), pos.Y(), pos.Z(), tof, mom.P(), theta, phi, step, destep);