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 **************************************************************************/
18 /////////////////////////////////////////////////////////
19 // Manager and hits classes for set:MUON version 2 //
20 /////////////////////////////////////////////////////////
22 #include <Riostream.h>
23 #include <TClonesArray.h>
24 #include <TLorentzVector.h>
29 #include "AliMUONv3.h"
32 #include "AliCallf77.h"
34 #include "AliMUONChamber.h"
35 #include "AliMUONHit.h"
36 #include "AliMUONPadHit.h"
37 #include "AliMUONConstants.h"
38 #include "AliMUONTriggerCircuit.h"
39 #include "AliMUONFactory.h"
43 //___________________________________________
44 AliMUONv3::AliMUONv3() : AliMUONv1()
51 //___________________________________________
52 AliMUONv3::AliMUONv3(const char *name, const char *title)
53 : AliMUONv1(name,title)
56 // By default include all stations
57 fStations = new Int_t[5];
58 for (Int_t i=0; i<5; i++) fStations[i] = 1;
60 AliMUONFactory factory;
61 factory.Build(this, title);
63 //___________________________________________
64 void AliMUONv3::StepManager()
71 // Particule id, pos and mom vectors,
72 // theta, phi angles with respect the normal of the chamber,
73 // spatial step, delta_energy and time of flight
75 TLorentzVector pos, mom;
76 Float_t theta, phi, tof;
79 TClonesArray &lhits = *fHits;
81 // Only charged tracks
82 if( !(gMC->TrackCharge()) ) return;
84 // Only gas gap inside chamber
85 // Tag chambers and record hits when track enters
87 id=gMC->CurrentVolID(copy);
88 for (Int_t i = 1; i <= AliMUONConstants::NCh(); i++) {
89 if(id==((AliMUONChamber*)(*fChambers)[i-1])->GetGid()) {
94 if (idvol == -1) return;
96 // Get current particle id (ipart), track position (pos) and momentum (mom)
97 gMC->TrackPosition(pos);
98 gMC->TrackMomentum(mom);
99 ipart = gMC->TrackPid();
100 theta = mom.Theta()*kRaddeg; // theta of track
101 phi = mom.Phi() *kRaddeg; // phi of the track
102 tof = gMC->TrackTime(); // Time of flight
104 // momentum loss and steplength in last step
105 destep = gMC->Edep();
106 step = gMC->TrackStep();
108 if (destep>0.) new(lhits[fNhits++])
109 AliMUONHit(fIshunt, gAlice->CurrentTrack(), iChamber, ipart,
110 pos.X(), pos.Y(), pos.Z(), tof, mom.P(),
111 theta, phi, step, destep);