// //
////////////////////////////////////////////////////////////////////////////
-#include <stdlib.h>
-
#include <TLorentzVector.h>
#include <TMath.h>
#include <TRandom.h>
-#include <TVector.h>
#include <TVirtualMC.h>
#include <TGeoManager.h>
#include <TGeoMatrix.h>
#include <TGeoPhysicalNode.h>
-#include "AliConst.h"
-#include "AliLog.h"
#include "AliTrackReference.h"
#include "AliMC.h"
#include "AliRun.h"
#include "AliTRDgeometry.h"
#include "AliTRDCommonParam.h"
-#include "AliTRDhit.h"
#include "AliTRDsimTR.h"
#include "AliTRDv1.h"
//_____________________________________________________________________________
AliTRDv1::AliTRDv1()
:AliTRD()
- ,fTRon(kFALSE)
+ ,fTRon(kTRUE)
,fTR(NULL)
,fStepSize(0)
,fWion(0)
Int_t nTR;
// Create TR photons
- gMC->TrackMomentum(mom);
+ TVirtualMC::GetMC()->TrackMomentum(mom);
Float_t pTot = mom.Rho();
fTR->CreatePhotons(11,pTot,nTR,eTR);
if (nTR > kNTR) {
// The position of the absorbtion
Float_t posHit[3];
- gMC->TrackPosition(pos);
+ TVirtualMC::GetMC()->TrackPosition(pos);
posHit[0] = pos[0] + mom[0] / pTot * absLength;
posHit[1] = pos[1] + mom[1] / pTot * absLength;
posHit[2] = pos[2] + mom[2] / pTot * absLength;
,det
,posHit
,-q
- ,gMC->TrackTime()*1.0e06
+ ,TVirtualMC::GetMC()->TrackTime()*1.0e06
,kTRUE);
}
// Set the maximum step size to a very large number for all
// neutral particles and those outside the driftvolume
- gMC->SetMaxStep(kBig);
+ if (!fPrimaryIonisation) TVirtualMC::GetMC()->SetMaxStep(kBig);
// If not charged track or already stopped or disappeared, just return.
- if ((!gMC->TrackCharge()) ||
- gMC->IsTrackDisappeared()) {
+ if ((!TVirtualMC::GetMC()->TrackCharge()) ||
+ TVirtualMC::GetMC()->IsTrackDisappeared()) {
return;
}
// Inside a sensitive volume?
- cIdCurrent = gMC->CurrentVolName();
+ cIdCurrent = TVirtualMC::GetMC()->CurrentVolName();
if (cIdSensDr == cIdCurrent[1]) {
drRegion = kTRUE;
}
// The hit coordinates and charge
- gMC->TrackPosition(pos);
+ TVirtualMC::GetMC()->TrackPosition(pos);
hits[0] = pos[0];
hits[1] = pos[1];
hits[2] = pos[2];
// Special hits only in the drift region
if ((drRegion) &&
- (gMC->IsTrackEntering())) {
+ (TVirtualMC::GetMC()->IsTrackEntering())) {
// Create a track reference at the entrance of each
// chamber that contains the momentum components of the particle
- gMC->TrackMomentum(mom);
+ TVirtualMC::GetMC()->TrackMomentum(mom);
AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
trkStat = 1;
// Create the hits from TR photons if electron/positron is
// entering the drift volume
- if ((fTR) &&
- (TMath::Abs(gMC->TrackPid()) == kPdgElectron)) {
+ if ((fTR) &&
+ (fTRon) &&
+ (TMath::Abs(TVirtualMC::GetMC()->TrackPid()) == kPdgElectron)) {
CreateTRhit(det);
}
}
else if ((amRegion) &&
- (gMC->IsTrackExiting())) {
+ (TVirtualMC::GetMC()->IsTrackExiting())) {
// Create a track reference at the exit of each
// chamber that contains the momentum components of the particle
- gMC->TrackMomentum(mom);
+ TVirtualMC::GetMC()->TrackMomentum(mom);
AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kTRD);
trkStat = 2;
// Calculate the charge according to GEANT Edep
// Create a new dEdx hit
- eDep = TMath::Max(gMC->Edep(),0.0) * 1.0e+09;
+ eDep = TMath::Max(TVirtualMC::GetMC()->Edep(),0.0) * 1.0e+09;
qTot = (Int_t) (eDep / fWion);
if ((qTot) ||
(trkStat)) {
,det
,hits
,qTot
- ,gMC->TrackTime()*1.0e06
+ ,TVirtualMC::GetMC()->TrackTime()*1.0e06
,drRegion);
}
// Set Maximum Step Size
// Produce only one hit if Ekin is below cutoff
- if ((gMC->Etot() - gMC->TrackMass()) < kEkinMinStep) {
+ if ((TVirtualMC::GetMC()->Etot() - TVirtualMC::GetMC()->TrackMass()) < kEkinMinStep) {
return;
}
- gMC->SetMaxStep(fStepSize);
+ if (!fPrimaryIonisation) TVirtualMC::GetMC()->SetMaxStep(fStepSize);
}