ROOT logo
/**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
 * Author: The ALICE Off-line Project.                                    *
 * Contributors are mentioned in the code where appropriate.              *
 *                                                                        *
 * Permission to use, copy, modify and distribute this software and its   *
 * documentation strictly for non-commercial purposes is hereby granted   *
 * without fee, provided that the above copyright notice appears in all   *
 * copies and that both the copyright notice and this permission notice   *
 * appear in the supporting documentation. The authors make no claims     *
 * about the suitability of this software for any purpose. It is          *
 * provided "as is" without express or implied warranty.                  *
 **************************************************************************/

//
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
//  Laser for the TPChamber version 2 -- detailed TPC and slow simulation    //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#include <TLorentzVector.h>
#include "AliMC.h"


#include "AliTPCLaser.h"


ClassImp(AliTPCLaser)
 
//_____________________________________________________________________________
AliTPCLaser::AliTPCLaser(const char *name, const char *title) :
  AliTPCv2(name, title),
  fNelPerCollision(10),
  fLaserPID(13), // muons
  fCollisionsPerCm(20)
{

}
//______________________________________________________________
void AliTPCLaser::StepManager()
{
  // laser tracks are particles with PID fLaserPID (default PID=13) 
  // stopped in the the TPC inner containment vessel (14) 

  if (TVirtualMC::GetMC()->TrackPid() != fLaserPID) {
    // in this way we can prevent delta-electrons
    TVirtualMC::GetMC()->StopTrack();
    return;
  }
  
  Int_t copy;
  Int_t vol[2];
  vol[0] = TVirtualMC::GetMC()->CurrentVolID(copy);
  
  if (TVirtualMC::GetMC()->TrackPid() == fLaserPID
      && vol[0] == 14) {// 14 = TIIN (inner containment vessel)
    TVirtualMC::GetMC()->StopTrack();
    return;
  }
  
  TLorentzVector p;
  Float_t hits[5]={0,0,0,0,0};
  TVirtualMC::GetMC()->TrackPosition(p);
  hits[0]=p[0];
  hits[1]=p[1];
  hits[2]=p[2];
  hits[3]=fNelPerCollision;
  hits[4]=TVirtualMC::GetMC()->TrackTime();

  Int_t index[3];  
  vol[0]=fTPCParam->Transform0to1(hits,index);
  AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
  
  Double_t rnd = TVirtualMC::GetMC()->GetRandom()->Rndm();  
  TVirtualMC::GetMC()->SetMaxStep(-TMath::Log(rnd)/fCollisionsPerCm);
}
 AliTPCLaser.cxx:1
 AliTPCLaser.cxx:2
 AliTPCLaser.cxx:3
 AliTPCLaser.cxx:4
 AliTPCLaser.cxx:5
 AliTPCLaser.cxx:6
 AliTPCLaser.cxx:7
 AliTPCLaser.cxx:8
 AliTPCLaser.cxx:9
 AliTPCLaser.cxx:10
 AliTPCLaser.cxx:11
 AliTPCLaser.cxx:12
 AliTPCLaser.cxx:13
 AliTPCLaser.cxx:14
 AliTPCLaser.cxx:15
 AliTPCLaser.cxx:16
 AliTPCLaser.cxx:17
 AliTPCLaser.cxx:18
 AliTPCLaser.cxx:19
 AliTPCLaser.cxx:20
 AliTPCLaser.cxx:21
 AliTPCLaser.cxx:22
 AliTPCLaser.cxx:23
 AliTPCLaser.cxx:24
 AliTPCLaser.cxx:25
 AliTPCLaser.cxx:26
 AliTPCLaser.cxx:27
 AliTPCLaser.cxx:28
 AliTPCLaser.cxx:29
 AliTPCLaser.cxx:30
 AliTPCLaser.cxx:31
 AliTPCLaser.cxx:32
 AliTPCLaser.cxx:33
 AliTPCLaser.cxx:34
 AliTPCLaser.cxx:35
 AliTPCLaser.cxx:36
 AliTPCLaser.cxx:37
 AliTPCLaser.cxx:38
 AliTPCLaser.cxx:39
 AliTPCLaser.cxx:40
 AliTPCLaser.cxx:41
 AliTPCLaser.cxx:42
 AliTPCLaser.cxx:43
 AliTPCLaser.cxx:44
 AliTPCLaser.cxx:45
 AliTPCLaser.cxx:46
 AliTPCLaser.cxx:47
 AliTPCLaser.cxx:48
 AliTPCLaser.cxx:49
 AliTPCLaser.cxx:50
 AliTPCLaser.cxx:51
 AliTPCLaser.cxx:52
 AliTPCLaser.cxx:53
 AliTPCLaser.cxx:54
 AliTPCLaser.cxx:55
 AliTPCLaser.cxx:56
 AliTPCLaser.cxx:57
 AliTPCLaser.cxx:58
 AliTPCLaser.cxx:59
 AliTPCLaser.cxx:60
 AliTPCLaser.cxx:61
 AliTPCLaser.cxx:62
 AliTPCLaser.cxx:63
 AliTPCLaser.cxx:64
 AliTPCLaser.cxx:65
 AliTPCLaser.cxx:66
 AliTPCLaser.cxx:67
 AliTPCLaser.cxx:68
 AliTPCLaser.cxx:69
 AliTPCLaser.cxx:70
 AliTPCLaser.cxx:71
 AliTPCLaser.cxx:72
 AliTPCLaser.cxx:73
 AliTPCLaser.cxx:74
 AliTPCLaser.cxx:75
 AliTPCLaser.cxx:76
 AliTPCLaser.cxx:77
 AliTPCLaser.cxx:78