#include <TMath.h>
#include <TString.h>
#include <TSystem.h>
+#include <TTree.h>
#include "AliConst.h"
#include "AliRun.h"
boxLongSupport[2]=500.0;
boxThinSupport[0]=1.0;
- boxThinSupport[1]=7.0;
+ boxThinSupport[1]=5.0;
boxThinSupport[2]=500.0;
TGeoBBox *acordeLongSupport = new TGeoBBox("ACORDELONGSUPPORT",boxLongSupport[0],boxLongSupport[1],boxLongSupport[2]);
TGeoVolume *acordeLSupport = new TGeoVolume("ACORDELS",acordeLongSupport,aluminium);
TGeoVolume *acordeTSupport = new TGeoVolume("ACORDETS",acordeThinSupport,aluminium);
TGeoVolume *acordeMainSupport = new TGeoVolumeAssembly("ACORDE_SUPPORT");
- acordeMainSupport->AddNode(acordeLSupport,1,new TGeoTranslation("ACOLSA",0,7.5,0));
+ acordeMainSupport->AddNode(acordeLSupport,1,new TGeoTranslation("ACOLSA",0,5.5,0));
acordeMainSupport->AddNode(acordeLSupport,2,new TGeoTranslation("ACOLSB",0,-7.5,0));
acordeMainSupport->AddNode(acordeTSupport,3);
static Float_t eloss;
static Float_t step;
// scintillator volume
- static Int_t idScint = gMC->VolId("ACORDESCINTILLATORMODULE");
+ static Int_t idScint = TVirtualMC::GetMC()->VolId("ACORDESCINTILLATORMODULE");
// local variables
Int_t copy;
TLorentzVector pos;
TLorentzVector mom;
// only charged tracks
- if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
+ if ( !TVirtualMC::GetMC()->TrackCharge() || !TVirtualMC::GetMC()->IsTrackAlive() ) return;
// only in sensitive material
- if (gMC->CurrentVolID(copy) == idScint) {
+ if (TVirtualMC::GetMC()->CurrentVolID(copy) == idScint) {
- step += gMC->TrackStep();
- eloss += gMC->Edep();
+ step += TVirtualMC::GetMC()->TrackStep();
+ eloss += TVirtualMC::GetMC()->Edep();
// set all hit variables except eloss which is resetted
// set volume variables
- if (gMC->IsTrackEntering()) {
+ if (TVirtualMC::GetMC()->IsTrackEntering()) {
eloss = 0.0;
step = 0.0;
- gMC->TrackPosition(pos);
- gMC->TrackMomentum(mom);
+ TVirtualMC::GetMC()->TrackPosition(pos);
+ TVirtualMC::GetMC()->TrackMomentum(mom);
// hit
// [0] = PID
// [1-3] = x, y, z
// [5-7] = px, py, pz
// [8] = energy
// [9] = energy loss
- hits[0] = (Float_t ) gMC->TrackPid();
+ hits[0] = (Float_t ) TVirtualMC::GetMC()->TrackPid();
hits[1] = pos[0];
hits[2] = pos[1];
hits[3] = pos[2];
- hits[4] = gMC->TrackTime();
+ hits[4] = TVirtualMC::GetMC()->TrackTime();
hits[5] = mom[0];
hits[6] = mom[1];
hits[7] = mom[2];
- hits[8] = gMC->Etot();
+ hits[8] = TVirtualMC::GetMC()->Etot();
// volume:
// [0] = module number 1-60 (1==>(0-0), 60 (5-9)
// [1] = Plastic number: 0 (down) to 1 (up)
Int_t copyPlastic; // plastic: down=1, up=2
Int_t copyModule; // module: 1-60
- gMC->CurrentVolID(copyPlastic);
- gMC->CurrentVolOffID(1, copyModule);
+ TVirtualMC::GetMC()->CurrentVolID(copyPlastic);
+ TVirtualMC::GetMC()->CurrentVolOffID(1, copyModule);
// module
vol[0] = copyModule;
// plastic: 0 = down, 1 = up
vol[1] = copyPlastic - 4 ; // !!!!!!!
// vol[1] = copyPlastic;
- } // end if gMC->IsTrackEntering()
+ } // end if TVirtualMC::GetMC()->IsTrackEntering()
// set hit[9] = total energy loss and book hit
- if( gMC->IsTrackExiting() ||
- gMC->IsTrackStop() ||
- gMC->IsTrackDisappeared()){
+ if( TVirtualMC::GetMC()->IsTrackExiting() ||
+ TVirtualMC::GetMC()->IsTrackStop() ||
+ TVirtualMC::GetMC()->IsTrackDisappeared()){
hits[9] = eloss;
hits[10] = step;
eloss = 0.0;
// Creates new branches in the current Root Tree
char branchname[10];
- sprintf(branchname,"%s",GetName());
+ snprintf(branchname,9,"%s",GetName());
AliDebug(2,Form("fBufferSize = %d",fBufferSize));
const char *cH = strstr(option,"H");
if (fHits && fLoader->TreeH() && cH) {