]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/TPCsim/AliTPCLaser.cxx
TPC module
[u/mrichter/AliRoot.git] / TPC / TPCsim / AliTPCLaser.cxx
CommitLineData
ca142b1f 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
ca142b1f 23#include <TLorentzVector.h>
ca142b1f 24#include "AliMC.h"
d242f3ba 25
26
ca142b1f 27#include "AliTPCLaser.h"
28
d242f3ba 29
ca142b1f 30ClassImp(AliTPCLaser)
31
32//_____________________________________________________________________________
33AliTPCLaser::AliTPCLaser(const char *name, const char *title) :
d242f3ba 34 AliTPCv2(name, title),
35 fNelPerCollision(10),
36 fLaserPID(13), // muons
37 fCollisionsPerCm(20)
ca142b1f 38{
d242f3ba 39
ca142b1f 40}
41//______________________________________________________________
42void AliTPCLaser::StepManager()
43{
d242f3ba 44 // laser tracks are particles with PID fLaserPID (default PID=13)
45 // stopped in the the TPC inner containment vessel (14)
46
2942f542 47 if (TVirtualMC::GetMC()->TrackPid() != fLaserPID) {
d242f3ba 48 // in this way we can prevent delta-electrons
2942f542 49 TVirtualMC::GetMC()->StopTrack();
d242f3ba 50 return;
51 }
52
53 Int_t copy;
54 Int_t vol[2];
2942f542 55 vol[0] = TVirtualMC::GetMC()->CurrentVolID(copy);
d242f3ba 56
2942f542 57 if (TVirtualMC::GetMC()->TrackPid() == fLaserPID
d242f3ba 58 && vol[0] == 14) {// 14 = TIIN (inner containment vessel)
2942f542 59 TVirtualMC::GetMC()->StopTrack();
d242f3ba 60 return;
61 }
62
63 TLorentzVector p;
64 Float_t hits[5]={0,0,0,0,0};
2942f542 65 TVirtualMC::GetMC()->TrackPosition(p);
d242f3ba 66 hits[0]=p[0];
67 hits[1]=p[1];
68 hits[2]=p[2];
69 hits[3]=fNelPerCollision;
2942f542 70 hits[4]=TVirtualMC::GetMC()->TrackTime();
ca142b1f 71
d242f3ba 72 Int_t index[3];
73 vol[0]=fTPCParam->Transform0to1(hits,index);
74 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
75
2942f542 76 Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();
77 TVirtualMC::GetMC()->SetMaxStep(-TMath::Log(rnd)/fCollisionsPerCm);
ca142b1f 78}