Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
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 : **************************************************************************/
15 :
16 : //
17 : ///////////////////////////////////////////////////////////////////////////////
18 : // //
19 : // Laser for the TPChamber version 2 -- detailed TPC and slow simulation //
20 : // //
21 : ///////////////////////////////////////////////////////////////////////////////
22 :
23 : #include <TLorentzVector.h>
24 : #include "AliMC.h"
25 :
26 :
27 : #include "AliTPCLaser.h"
28 :
29 :
30 12 : ClassImp(AliTPCLaser)
31 :
32 : //_____________________________________________________________________________
33 : AliTPCLaser::AliTPCLaser(const char *name, const char *title) :
34 0 : AliTPCv2(name, title),
35 0 : fNelPerCollision(10),
36 0 : fLaserPID(13), // muons
37 0 : fCollisionsPerCm(20)
38 0 : {
39 :
40 0 : }
41 : //______________________________________________________________
42 : void AliTPCLaser::StepManager()
43 : {
44 : // laser tracks are particles with PID fLaserPID (default PID=13)
45 : // stopped in the the TPC inner containment vessel (14)
46 :
47 0 : if (TVirtualMC::GetMC()->TrackPid() != fLaserPID) {
48 : // in this way we can prevent delta-electrons
49 0 : TVirtualMC::GetMC()->StopTrack();
50 0 : return;
51 : }
52 :
53 0 : Int_t copy;
54 0 : Int_t vol[2];
55 0 : vol[0] = TVirtualMC::GetMC()->CurrentVolID(copy);
56 :
57 0 : if (TVirtualMC::GetMC()->TrackPid() == fLaserPID
58 0 : && vol[0] == 14) {// 14 = TIIN (inner containment vessel)
59 0 : TVirtualMC::GetMC()->StopTrack();
60 0 : return;
61 : }
62 :
63 0 : TLorentzVector p;
64 0 : Float_t hits[5]={0,0,0,0,0};
65 0 : TVirtualMC::GetMC()->TrackPosition(p);
66 0 : hits[0]=p[0];
67 0 : hits[1]=p[1];
68 0 : hits[2]=p[2];
69 0 : hits[3]=fNelPerCollision;
70 0 : hits[4]=TVirtualMC::GetMC()->TrackTime();
71 :
72 0 : Int_t index[3];
73 0 : vol[0]=fTPCParam->Transform0to1(hits,index);
74 0 : AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
75 :
76 0 : Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();
77 0 : TVirtualMC::GetMC()->SetMaxStep(-TMath::Log(rnd)/fCollisionsPerCm);
78 0 : }
|