#include "AliFTrackMaker.h"
#include "AliFTrack.h"
#include "AliFDet.h"
+#include "AliMC.h"
const Double_t kPi = TMath::Pi();
const Double_t k2Pi = 2*kPi;
Int_t idPart, idTrack;
Double_t charge, pT, eta, phi;
TParticle *part;
- Int_t nparticles = gAlice->GetNtrack();
+ Int_t nparticles = gAlice->GetMCApp()->GetNtrack();
printf("%10s%10d\n","nparticles",nparticles);
for(Int_t ind=0;ind<nparticles;ind++) {
- part = gAlice->Particle(ind);
+ part = gAlice->GetMCApp()->Particle(ind);
idPart = part->GetPdgCode();
charge = part->GetPDG()->Charge();
pT = part->Pt();
AliCRT& operator=(const AliCRT& crt);
virtual void CreateMaterials();
- virtual Int_t IsVersion() const;
- virtual TString Version();
+// virtual Int_t IsVersion() const;
+// virtual TString Version();
virtual void SetTreeAddress();
ClassDef(AliCRT, 1) // Cosmic Ray Trigger (ACORDE) base class
};
-inline Int_t AliCRT::IsVersion() const
-{ return 0; }
+// inline Int_t AliCRT::IsVersion() const
+// { return 0; }
-inline TString AliCRT::Version()
-{ return TString(""); }
+// inline TString AliCRT::Version()
+// { return TString(""); }
#endif // ALICRT_H
#include <TGeometry.h>
#include <TBRIK.h>
#include <TNode.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliConst.h"
AliCRTv0& operator=(const AliCRTv0& crt);
- virtual TString Version();
- virtual Int_t IsVersion() const;
+ // virtual TString Version();
+ // virtual Int_t IsVersion() const;
virtual void CreateGeometry();
virtual void BuildGeometry();
ClassDef(AliCRTv0,1) // Cosmic Ray Trigger (ACORDE).
};
-inline TString AliCRTv0::Version()
-{ return TString("v0"); }
+// inline TString AliCRTv0::Version()
+// { return TString("v0"); }
-inline Int_t AliCRTv0::IsVersion() const
-{ return 0; }
+// inline Int_t AliCRTv0::IsVersion() const
+// { return 0; }
#endif // ALICRTV0_H
#include <TClonesArray.h>
#include <TLorentzVector.h>
#include <TPDGCode.h>
+#include <TVirtualMC.h>
#include "AliRun.h"
#include "AliConst.h"
#include "AliCRThit.h"
#include "AliCRTConstants.h"
+#include "AliMC.h"
ClassImp(AliCRTv1)
fIshunt = 1; // All hits are associated with primary particles
fHits = new TClonesArray("AliCRThit",400);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
SetMarkerColor(7);
SetMarkerStyle(2);
else vol[0] = -1;// ?
//vol[0] = gMC->GetMedium(); //layer(flay)
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
// Reset the deposited energy only when you reach the Magnet
if ( (strcmp(gMC->CurrentVolName(),"CRT4")==0) ) eloss = 0;
#include "AliRunLoader.h"
#include "AliStack.h"
#include "AliEMCALLoader.h"
+#include "AliMC.h"
ClassImp(AliEMCALGetter)
if(p) {
Int_t daughterIndex = p->GetDaughter(index-1) ;
AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
- return rl->GetAliRun()->Particle(daughterIndex) ;
+ return rl->GetAliRun()->GetMCApp()->Particle(daughterIndex) ;
}
else
return 0 ;
#include "AliEMCALGetter.h"
// Interface to FORTRAN
#include "Ecommon.h"
+#include "AliMC.h"
ClassImp(AliEMCALJetFinder)
// this is for Pythia ??
for (Int_t part = 0; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
+ TParticle *MPart = gAlice->GetMCApp()->Particle(part);
Int_t mpart = MPart->GetPdgCode();
Int_t child1 = MPart->GetFirstDaughter();
Float_t pT = MPart->Pt();
fNtS = 0;
for (Int_t track = 0; track < ntracks; track++) {
- TParticle *MPart = gAlice->Particle(track);
+ TParticle *MPart = gAlice->GetMCApp()->Particle(track);
Float_t pT = MPart->Pt();
Float_t phi = MPart->Phi();
Float_t eta = MPart->Eta();
fTrackList[part] = 0;
- MPart = gAlice->Particle(part);
+ MPart = gAlice->GetMCApp()->Particle(part);
mpart = MPart->GetPdgCode();
child1 = MPart->GetFirstDaughter();
child2 = MPart->GetLastDaughter();
// Go through the partons
Int_t statusCode=0;
for (Int_t part = 8; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
+ TParticle *MPart = gAlice->GetMCApp()->Particle(part);
Int_t mpart = MPart->GetPdgCode();
// Int_t child1 = MPart->GetFirstDaughter();
Float_t pT = MPart->Pt();
Int_t idprim = mHit->GetPrimary(); // primary particle
//Determine the origin point of this particle - it made a hit in the EMCAL
- TParticle *trkPart = gAlice->Particle(iTrk);
+ TParticle *trkPart = gAlice->GetMCApp()->Particle(iTrk);
TParticlePDG *trkPdg = trkPart->GetPDG();
Int_t trkCode = trkPart->GetPdgCode();
Double_t trkChg;
//Loop through the ancestry of the EMCAL entrance particles
Int_t ancestor = trkPart->GetFirstMother(); //Get track's Mother
while (ancestor != -1) {
- TParticle *ancPart = gAlice->Particle(ancestor); //get particle info on ancestor
+ TParticle *ancPart = gAlice->GetMCApp()->Particle(ancestor); //get particle info on ancestor
TParticlePDG *ancPdg = ancPart->GetPDG();
Int_t ancCode = ancPart->GetPdgCode();
Double_t ancChg;
}
//Determine the origin point of the primary particle associated with the hit
- TParticle *primPart = gAlice->Particle(idprim);
+ TParticle *primPart = gAlice->GetMCApp()->Particle(idprim);
TParticlePDG *primPdg = primPart->GetPDG();
Int_t primCode = primPart->GetPdgCode();
Double_t primChg;
#include "AliGenPythiaEventHeader.h"
#include "AliGenerator.h"
#include "AliHeader.h"
+#include "AliMC.h"
ClassImp(AliEMCALJetFinderInputSimPrep)
if (fDebug > 1) Info("FillTracks","Starting particle loop");
for (Int_t part = 0; part < npart; part++) {
- MPart = gAlice->Particle(part);
+ MPart = gAlice->GetMCApp()->Particle(part);
//if (part%10) gObjectTable->Print();
pdgP = MPart->GetPDG();
TParticlePDG* pdgP = 0;
for (Int_t part = 0; part < npart; part++) {
- TParticle *MPart = gAlice->Particle(part);
+ TParticle *MPart = gAlice->GetMCApp()->Particle(part);
pdgP = MPart->GetPDG();
if (fDebug > 10) Info("FillParticles","Checking if particle is a primary");
TParticle *tempPart;
for (Int_t part = 0; part < npart; part++)
{
- tempPart = gAlice->Particle(part);
+ tempPart = gAlice->GetMCApp()->Particle(part);
if (tempPart->GetStatusCode() != 1) continue;
if (tempPart->Eta() > fEtaMax || tempPart->Eta() < fEtaMin ||
tempPart->Phi() > fPhiMax || tempPart->Phi() < fPhiMin ){
ntracks=0;
for (Int_t part = 0; part < npart; part++)
{
- tempPart = gAlice->Particle(part);
+ tempPart = gAlice->GetMCApp()->Particle(part);
if (tempPart->GetStatusCode() != 1) continue;
if (tempPart->Eta() > fEtaMax || tempPart->Eta() < fEtaMin ||
tempPart->Phi() > fPhiMax || tempPart->Phi() < fPhiMin ){
#include <TBrowser.h>
#include <TString.h>
#include <TParticle.h>
+#include "AliMC.h"
ClassImp(AliEMCALJetMicroDst)
TParticle *MPart;
Int_t ind;
for(Int_t i=6; i<8; i++){
- MPart = gAlice->Particle(i);
+ MPart = gAlice->GetMCApp()->Particle(i);
ind = i-6;
xpt[ind] = MPart->Pt();
xeta[ind] = MPart->Eta();
#include "TNode.h"
#include "TRandom.h"
#include "TGeometry.h"
+#include "TVirtualMC.h"
// --- Standard library ---
#include "TTree.h"
#include "TGeometry.h"
#include "TParticle.h"
+#include "TVirtualMC.h"
// --- Standard library ---
#include "AliEMCALGeometry.h"
#include "AliConst.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliEMCALv1)
// Standard Creator.
fHits= new TClonesArray("AliEMCALHit",1000);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
fNhits = 0;
fIshunt = 2; // All hits are associated with particles entering the calorimeter
Float_t pmom[4]={0.,0.,0.,0.};
TLorentzVector pos; // Lorentz vector of the track current position.
TLorentzVector mom; // Lorentz vector of the track current momentum.
- Int_t tracknumber = gAlice->GetCurrentTrackNumber();
+ Int_t tracknumber = gAlice->GetMCApp()->GetCurrentTrackNumber();
Int_t primary = 0;
static Int_t iparent = 0;
static Float_t ienergy = 0;
Int_t parent = iparent ;
while ( parent != -1 ) { // <------------- flags this particle to be kept and
//all the ancestors of this particle
- part = gAlice->Particle(parent) ;
+ part = gAlice->GetMCApp()->Particle(parent) ;
part->SetBit(kKeepBit);
parent = part->GetFirstMother() ;
}
;
xyzte[4] = lightYield ;
- primary = gAlice->GetPrimary(tracknumber);
+ primary = gAlice->GetMCApp()->GetPrimary(tracknumber);
if (gDebug == 2)
Info("StepManager", "id0 = %d, id1 = %d, absid = %d tower = %d layer = %d energy = %f\n", id[0], id[1], absid, tower, layer, xyzte[4]) ;
#include "AliDimuCombinator.h"
#include "AliRun.h"
+#include "AliMC.h"
//
ClassImp(AliDimuCombinator)
//
TParticle* AliDimuCombinator::Particle(Int_t i)
{
- return gAlice->Particle(i);
+ return gAlice->GetMCApp()->Particle(i);
}
TParticle* AliDimuCombinator::FirstMuon()
#include "AliGenCocktailEntry.h"
#include "AliCollisionGeometry.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliGenCocktail)
AliGenCocktailEntry *preventry = 0;
AliGenerator* gen = 0;
- TObjArray *partArray = gAlice->Particles();
+ TObjArray *partArray = gAlice->GetMCApp()->Particles();
//
// Generate the vertex position used by all generators
#include "AliGenCocktailAfterBurner.h"
#include "AliGenCocktailEntry.h"
#include "AliStack.h"
+#include "AliMC.h"
ClassImp(AliGenCocktailAfterBurner)
mech = AliGenCocktailAfterBurner::IntToMCProcess(p->GetUniqueID());
weight = p->GetWeight();
- gAlice->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+ gAlice->GetMCApp()->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
polx, poly, polz, mech, ntr, weight);
}
}
#include <RVersion.h>
#include "TPDGCode.h"
#include "TDatabasePDG.h"
+#include <TVirtualMC.h>
#include "AliGenFLUKAsource.h"
#include "AliRun.h"
#include <TF1.h>
#include <TParticle.h>
#include <TPDGCode.h>
+#include <TVirtualMC.h>
#include "AliConst.h"
#include "AliDecayer.h"
#include <TParticlePDG.h>
#include <TDatabasePDG.h>
#include <TLorentzVector.h>
+#include <TVirtualMC.h>
#include <TF1.h>
#include <TCanvas.h>
#include <TH1.h>
+#include "AliMC.h"
ClassImp(AliGenParam)
} // kinematic selection
else // nodecay option, so parent will be tracked by GEANT (pions, kaons, eta, omegas, baryons)
{
- gAlice->
+ gAlice->GetMCApp()->
PushTrack(fTrackIt,-1,iPart,p,origin0,polar,0,kPPrimary,nt,wgtp);
ipa++;
}
#include "AliLoader.h"
#include "AliMagF.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp (AliFMD)
//_____________________________________________________________________________
// Digits for each Si disk
fDigits = new TClonesArray ("AliFMDdigit", 1000);
fReconParticles=new TClonesArray("AliFMDReconstParticles",1000);
- gAlice->AddHitList (fHits);
+ gAlice->GetMCApp()->AddHitList (fHits);
fIshunt = 0;
// fMerger = 0;
#include <TNode.h>
#include <TTUBE.h>
#include <TLorentzVector.h>
+#include <TVirtualMC.h>
#include "AliFMDv0.h"
#include "AliMagF.h"
#include "AliFMDv1.h"
#include "AliMagF.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliFMDv1)
gMC->IsTrackStop())
{
hits[6]=de+1000.*gMC->Edep();
- new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliFMDhit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
} // IsTrackExiting()
}
}
#include <AliMagF.h>
#include <AliKalmanTrack.h>
#include <AliITSIOTrack.h>
+#include "AliMC.h"
ClassImp(AliHBTReaderITSv1)
/********************************************************************/
gAliceFile->cd();
gAlice->GetEvent(currentEvent);
- gAlice->Particles();
+ gAlice->GetMCApp()->Particles();
Int_t nentr=(Int_t)tracktree->GetEntries();
continue;
}
- TParticle *p = (TParticle*)gAlice->Particle(label);
+ TParticle *p = (TParticle*)gAlice->GetMCApp()->Particle(label);
if(!p)
{
Warning("Read","Can not get particle with label &d",label);
#include "AliITSsimulationSDD.h"
#include "AliITSsimulationSPD.h"
#include "AliITSsimulationSSD.h"
+#include "AliMC.h"
ClassImp(AliITS)
fIshunt = 0; // not zeroed in AliDetector
fHits = new TClonesArray("AliITShit", 1560);//not done in AliDetector
- gAlice->AddHitList(fHits); // Not done in AliDetector.
+ gAlice->GetMCApp()->AddHitList(fHits); // Not done in AliDetector.
fEuclidOut = 0;
fITSgeom = 0;
#include "AliITSFindClustersV2.h"
#include "AliITSclusterV2.h"
#include "AliITSgeom.h"
+#include "AliMC.h"
ClassImp(AliITSFindClustersV2)
lab[3] = i;
lad = lab[0];
if(lad>=0){
- part = (TParticle*) fAr->Particle(lad);
+ part = (TParticle*) fAr->GetMCApp()->Particle(lad);
lad = -3;
while(part->P() < 0.005){
if(part->GetFirstMother()<0){
break;
} // end if part->GetFirstMother()<0
lad = part->GetFirstMother();
- part = (TParticle*) fAr->Particle(lad);
+ part = (TParticle*) fAr->GetMCApp()->Particle(lad);
} // end while part->P() < 0.005
if(lab[1]<0) lab[1] = lad;
else if(lab[2]<0) lab[2] = lad;
#include "AliITSRecPoint.h"
#include "AliITSgeom.h"
#include "AliITSmodule.h"
+#include "AliMC.h"
ClassImp(AliITSRiemannFit)
if(track <0 ) continue;
xcluster=recp->GetX(); // x on cluster
zcluster=recp->GetZ(); // z on cluster
- part = (TParticle*) gAlice->Particle(track);
+ part = (TParticle*) gAlice->GetMCApp()->Particle(track);
part->ProductionVertex(OT); // set the vertex
part->Momentum(PE); // set the vertex momentum
name = part->GetName();
#include "AliITSTrackerV1.h"
#include "AliITSVertex.h"
#include "AliITSPid.h"
+#include "AliMC.h"
ClassImp(AliITSTrackerV1)
//______________________________________________________________________
for(k=0; k<3; k++){
Int_t lpp=(Int_t)vecLabRef(k);
if(lpp>=0) {
- TParticle *p=(TParticle*) gAlice->Particle(lpp);
+ TParticle *p=(TParticle*) gAlice->GetMCApp()->Particle(lpp);
Int_t pcode=p->GetPdgCode();
if(pcode==11) vecLabRef(k)=p->GetFirstMother();
} // end if
#include <TClonesArray.h>
#include "AliITSgeom.h"
#include "AliITSdigit.h"
+#include "AliMC.h"
ClassImp(AliITSclustererV2)
//------------------------------------------------------------
Int_t label=lab[0];
if (label>=0) {
- TParticle *part=(TParticle*)gAlice->Particle(label);
+ TParticle *part=(TParticle*)gAlice->GetMCApp()->Particle(label);
label=-3;
while (part->P() < 0.005) {
Int_t m=part->GetFirstMother();
break;
}
label=m;
- part=(TParticle*)gAlice->Particle(label);
+ part=(TParticle*)gAlice->GetMCApp()->Particle(label);
}
if (lab[1]<0) lab[1]=label;
else if (lab[2]<0) lab[2]=label;
#include "AliITS.h"
#include "AliITSgeom.h"
#include "AliITShit.h"
+#include "AliMC.h"
ClassImp(AliITShit)
// this hit. From the TParticle all kinds of information about this
// particle can be found. See the TParticle class.
////////////////////////////////////////////////////////////////////////
- return gAlice->Particle(GetTrack());
+ return gAlice->GetMCApp()->Particle(GetTrack());
}
//----------------------------------------------------------------------
void AliITShit::Print(ostream *os){
AliITSSDigits2Digits();
}
gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSFindClustersV2.C");
- if (rc=AliITSFindClustersV2(nev,SlowOrFast)) return rc;
+ if (rc=AliITSFindClustersV2(SlowOrFast)) return rc;
gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSFindTracksV2.C");
- if (rc=AliITSFindTracksV2(nev)) return rc;
+ if (rc=AliITSFindTracksV2()) return rc;
gROOT->LoadMacro("$(ALICE_ROOT)/ITS/AliITSComparisonV2.C");
if (rc=AliITSComparisonV2()) return rc;
#include "AliITShit.h"
#include "AliITSv5.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliITSv5)
hits[6]=gMC->Edep();
hits[7]=gMC->TrackTime();
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
return;
}
#include "AliITShit.h"
#include "AliITSv5asymm.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliITSv5asymm)
hits[6]=gMC->Edep();
hits[7]=gMC->TrackTime();
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
return;
}
#include "AliITShit.h"
#include "AliITSv5symm.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliITSv5symm)
hits[6]=gMC->Edep();
hits[7]=gMC->TrackTime();
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
return;
}
#include "AliITSsimulationSPD.h"
#include "AliITSsimulationSSD.h"
#include "AliITSvPPRasymm.h"
+#include "AliMC.h"
ClassImp(AliITSvPPRasymm)
copy = fTrackReferences->GetEntriesFast();
TClonesArray &lTR = *fTrackReferences;
// Fill TrackReference structure with this new TrackReference.
- new(lTR[copy]) AliTrackReference(gAlice->GetCurrentTrackNumber());
+ new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
} // if Outer ITS mother Volume
if(!(this->IsActive())){
return;
return;
} // end if IsEntering
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
gMC->Edep(),gMC->TrackTime(),position,
position0,momentum);
//
#include "AliMagF.h"
#include "AliRun.h"
#include "AliTrackReference.h"
+#include "AliMC.h"
#define GEANTGEOMETRY kTRUE
copy = fTrackReferences->GetEntriesFast();
TClonesArray &lTR = *fTrackReferences;
// Fill TrackReference structure with this new TrackReference.
- new(lTR[copy]) AliTrackReference(gAlice->GetCurrentTrackNumber());
+ new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
} // if Outer ITS mother Volume
return;
} // end if IsEntering
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
gMC->Edep(),gMC->TrackTime(),position,
position0,momentum);
//
#include "AliITSClusterFinderSPD.h"
#include "AliITSClusterFinderSDD.h"
#include "AliITSClusterFinderSSD.h"
+#include "AliMC.h"
ClassImp(AliITSvSPD02)
copy = fTrackReferences->GetEntriesFast();
TClonesArray &lTR = *fTrackReferences;
// Fill TrackReference structure with this new TrackReference.
- new(lTR[copy]) AliTrackReference(gAlice->GetCurrentTrackNumber());
+ new(lTR[copy]) AliTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
} // if Outer ITS mother Volume
if(!(this->IsActive())){
return;
return;
} // end if IsEntering
// Fill hit structure with this new hit only for non-entrerance hits.
- else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,
+ else new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,
gMC->Edep(),gMC->TrackTime(),position,
position0,momentum);
//
#include "AliITShit.h"
#include "AliITSvtest.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliITSvtest)
hits[6]=gMC->Edep();
hits[7]=gMC->TrackTime();
// Fill hit structure with this new hit.
- new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
return;
}
#include "AliMUONRawCluster.h"
#include "AliMUONClusterInput.h"
#include "AliMUONPixel.h"
+#include "AliMC.h"
// This function is used for fitting
void fcn1(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag);
AliLoader * gime = rl->GetLoader("MUONLoader");
if (!fReco) nparticles = rl->GetEvent(nev);
- else nparticles = gAlice->GetNtrack();
+ else nparticles = gAlice->GetMCApp()->GetNtrack();
cout << "nev " << nev <<endl;
cout << "nparticles " << nparticles <<endl;
if (nparticles <= 0) return;
#include "AliMUONResponse.h"
#include "AliMUONChamber.h"
#include "AliMUONConstants.h"
+#include "AliMC.h"
// to manage the same zoom on both cathodes
fChamber,
fCathode);
title->AddText(ptitle);
- Int_t nparticles = gAlice->Particles()->GetEntriesFast();
+ Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
nparticles, fHitsCuts,fClustersCuts);
title->AddText(ptitle);
#include "AliLoader.h"
#include "AliMUONTrackK.h" //AZ
#include <TMatrixD.h> //AZ
+#include "AliMC.h"
//************* Defaults parameters for reconstruction
static const Double_t kDefaultMinBendingMomentum = 3.0;
z, x, y, pX, pY, pZ, c);
}
// informations about generated particles
- np = gAlice->GetNtrack();
+ np = gAlice->GetMCApp()->GetNtrack();
printf(" **** number of generated particles: %d \n", np);
// for (Int_t iPart = 0; iPart < np; iPart++) {
#include "AliMUONRecoEvent.h"
#include "AliMUONRecoDisplay.h"
+#include "AliMC.h"
ClassImp(AliMUONRecoDisplay)
for (Int_t track=0; track<ntracks; track++) {
hit = (AliMUONHit *) pMUON->FirstHit(track);
if (!hit) continue;
- particle = gAlice->Particle(hit->Track());
+ particle = gAlice->GetMCApp()->Particle(hit->Track());
if (IsReconstructible(track) && TMath::Abs(particle->GetPdgCode())==13) {
gtrack = fEvGen->AddEmptyTrack();
gtrack->SetSign(TMath::Sign((Int_t)1, -particle->GetPdgCode()));
#include "AliMUONv0.h"
#include "AliMagF.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliMUONv0)
hits[13] = mom[2]; // Pz
hits[14] = gMC->TrackTime(); // time of flight
new(lhits[fNhits++])
- AliMUONHit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ AliMUONHit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
}
// if( gMC->IsTrackExiting()) gMC->StopTrack();
#include "AliMUONv1.h"
#include "AliMagF.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliMUONv1)
// One hit per chamber
- GetMUONData()->AddHit(fIshunt, gAlice->GetCurrentTrackNumber(), iChamber, ipart,
+ GetMUONData()->AddHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), iChamber, ipart,
fTrackPosition.X(), fTrackPosition.Y()+YAngleEffect, fTrackPosition.Z(), 0.0,
fTrackMomentum.P(),theta, phi, fStepSum[idvol], fDestepSum[idvol],
fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z());
// new hit
new(lhits[fNhits++])
- AliMUONHit(fIshunt, gAlice->GetCurrentTrackNumber(), vol,hits);
+ AliMUONHit(fIshunt, gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits);
eloss = 0;
//
// Check additional signal generation conditions
#include <TArrayI.h>
#include <Riostream.h>
#include <TSystem.h>
+#include <TVirtualMC.h>
#include "AliMpFiles.h"
#include "AliMpReader.h"
// #include "AliPHOSRaw2Digits.h"
//#include "AliPHOSCalibrationDB.h"
#include "AliPHOSBeamTestEvent.h"
+#include "AliMC.h"
ClassImp(AliPHOSGetter)
if(p) {
Int_t daughterIndex = p->GetDaughter(index-1) ;
AliRunLoader * rl = AliRunLoader::GetRunLoader(PhosLoader()->GetTitle());
- return rl->GetAliRun()->Particle(daughterIndex) ;
+ return rl->GetAliRun()->GetMCApp()->Particle(daughterIndex) ;
}
else
return 0 ;
#include "AliPHOSQAMeanChecker.h"
#include "AliPHOSv1.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliPHOSv1)
// and the TreeD at the end of the event (branch is set in FinishEvent() ).
fHits= new TClonesArray("AliPHOSHit",1000) ;
- gAlice->AddHitList(fHits) ;
+ gAlice->GetMCApp()->AddHitList(fHits) ;
fNhits = 0 ;
TLorentzVector pos ; // Lorentz vector of the track current position
Int_t copy ;
- Int_t tracknumber = gAlice->GetCurrentTrackNumber() ;
+ Int_t tracknumber = gAlice->GetMCApp()->GetCurrentTrackNumber() ;
TString name = GetGeometry()->GetName() ;
Int_t moduleNumber ;
gMC -> Gmtod (xyzte, xyzd, 1); // transform coordinate from master to daughter system
if (xyzd[1] < -GetGeometry()->GetCrystalSize(1)/2.+0.001){ //Entered close to forward surface
TParticle * part = 0 ;
- Int_t parent = gAlice->GetCurrentTrackNumber() ;
+ Int_t parent = gAlice->GetMCApp()->GetCurrentTrackNumber() ;
while ( parent != -1 ) {
- part = gAlice->Particle(parent) ;
+ part = gAlice->GetMCApp()->Particle(parent) ;
part->SetBit(kKeepBit);
parent = part->GetFirstMother() ;
}
Int_t primary =-1 ;
if(fIshunt == 1)
- primary = gAlice->GetPrimary( gAlice->GetCurrentTrackNumber() );
+ primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() );
else if(fIshunt == 2){
- primary = gAlice->GetCurrentTrackNumber() ;
- TParticle * part = gAlice->Particle(primary) ;
+ primary = gAlice->GetMCApp()->GetCurrentTrackNumber() ;
+ TParticle * part = gAlice->GetMCApp()->Particle(primary) ;
while ( !part->TestBit(kKeepBit) ) {
primary = part->GetFirstMother() ;
if(primary == -1) break ; //there is a possibility that particle passed e.g. thermal isulator and hits a side
//surface of the crystal. In this case it may have no primary at all.
//We can not easily separate this case from the case when this is part of the shower,
//developed in the neighboring crystal.
- part = gAlice->Particle(primary) ;
+ part = gAlice->GetMCApp()->Particle(primary) ;
}
}
#include "AliPHOSImpact.h"
#include "AliPHOSvImpacts.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliPHOSvImpacts)
TLorentzVector pos ; // Lorentz vector of the track current position
Int_t copy ;
- Int_t tracknumber = gAlice->GetCurrentTrackNumber() ;
- Int_t primary = gAlice->GetPrimary( gAlice->GetCurrentTrackNumber() );
+ Int_t tracknumber = gAlice->GetMCApp()->GetCurrentTrackNumber() ;
+ Int_t primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() );
TString name = GetGeometry()->GetName() ;
// Add impact to EMC
#include "AliPMD.h"
#include "AliPMDRecPoint.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliPMD)
//
// Allocate the array of hits
fHits = new TClonesArray("AliPMDhit", 405);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
fRecPoints = new TClonesArray("AliPMDRecPoint",10000);
fNRecPoints = 0;
#include "AliPMDdigit.h"
#include "AliPMDDigitizer.h"
#include "AliPMDClustering.h"
+#include "AliMC.h"
ClassImp(AliPMDDigitizer)
//
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
printf("Number of Particles = %d \n", nparticles);
fRunLoader->GetEvent(ievt);
- Particles = gAlice->Particles();
+ Particles = gAlice->GetMCApp()->Particles();
// ------------------------------------------------------- //
// Pointer to specific detector hits.
// Get pointers to Alice detectors and Hits containers
// get kinematics of the particles
- particle = gAlice->Particle(trackno);
+ particle = gAlice->GetMCApp()->Particle(trackno);
trackpid = particle->GetPdgCode();
Int_t igatr = -999;
while((imo = mparticle->GetFirstMother()) >= 0)
{
igen++;
- mparticle = gAlice->Particle(imo);
+ mparticle = gAlice->GetMCApp()->Particle(imo);
id_mo = mparticle->GetPdgCode();
vx = mparticle->Vx();
Int_t nparticles = fRunLoader->GetHeader()->GetNtrack();
printf("Number of Particles = %d \n", nparticles);
fRunLoader->GetEvent(ievt);
- Particles = gAlice->Particles();
+ Particles = gAlice->GetMCApp()->Particles();
// ------------------------------------------------------- //
// Pointer to specific detector hits.
// Get pointers to Alice detectors and Hits containers
// get kinematics of the particles
- particle = gAlice->Particle(trackno);
+ particle = gAlice->GetMCApp()->Particle(trackno);
trackpid = particle->GetPdgCode();
Int_t igatr = -999;
while((imo = mparticle->GetFirstMother()) >= 0)
{
igen++;
- mparticle = gAlice->Particle(imo);
+ mparticle = gAlice->GetMCApp()->Particle(imo);
id_mo = mparticle->GetPdgCode();
vx = mparticle->Vx();
#include "AliMagF.h"
#include "AliPMDv0.h"
#include "AliRun.h"
+#include "AliMC.h"
static Int_t kdet, ncell_sm, ncell_hole;
static Float_t zdist, zdist1;
gMC->Gdtom(center,hits,1);
hits[3] = destep*1e9; //Number in eV
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
**************************************************************************/
/*
$Log$
+Revision 1.29 2003/10/13 05:28:59 bnandi
+gaspmd[2] value changed 0.25->7.0 because of overlap
+
Revision 1.28 2003/10/08 12:59:08 bnandi
zpos is positive
#include "AliMagF.h"
#include "Riostream.h"
#include <TVirtualMC.h>
+#include "AliMC.h"
static Int_t ncol_um1,ncol_um2, nrow_um1, nrow_um2;
static Int_t kdet;
gMC->Gdtom(center,hits,1);
hits[3] = destep*1e9; //Number in eV
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
#include "AliRun.h"
#include "AliStack.h"
#include "AliRunLoader.h"
+#include "AliMC.h"
ClassImp(AliGenPythia)
// Adjust the weights after generation of all events
//
TParticle *part;
- Int_t ntrack=gAlice->GetNtrack();
+ Int_t ntrack=gAlice->GetMCApp()->GetNtrack();
for (Int_t i=0; i<ntrack; i++) {
- part= gAlice->Particle(i);
+ part= gAlice->GetMCApp()->Particle(i);
part->SetWeight(part->GetWeight()*fKineBias);
}
}
#include "AliRICHRecHit1D.h"
#include <AliRun.h>
#include <AliRunDigitizer.h>
+#include "AliMC.h"
+#include <TVirtualMC.h>
ClassImp(AliRICHhit)
//__________________________________________________________________________________________________
fpParam = new AliRICHParam;
fChambers = 0; CreateChambers();
//AliDetector ctor deals with Hits and Digits (reset them to 0, does not create them)
- fHits= 0; CreateHits(); gAlice->AddHitList(fHits);
+ fHits= 0; CreateHits(); gAlice->GetMCApp()->AddHitList(fHits);
fSdigits= 0;
fDigitsNew= 0;
fClusters= 0;
- fCerenkovs= 0; CreateCerenkovsOld(); gAlice->AddHitList(fCerenkovs);
+ fCerenkovs= 0; CreateCerenkovsOld(); gAlice->GetMCApp()->AddHitList(fCerenkovs);
fSpecials= 0; CreateSpecialsOld();
fDchambers= 0; //CreateDigitsOld();
fRawClusters=0; //CreateRawClustersOld();
for(j=0;j<3;j++) pol[j]=e1[j]*TMath::Sin(phi)+e2[j]*TMath::Cos(phi);
gMC->Gdtom(pol, pol, 2);
Int_t outputNtracksStored;
- gAlice->PushTrack(1, //do not transport
- gAlice->GetCurrentTrackNumber(),//parent track
+ gAlice->GetMCApp()->PushTrack(1, //do not transport
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),//parent track
kFeedback, //PID
mom[0],mom[1],mom[2],mom[3], //track momentum
x4.X(),x4.Y(),x4.Z(),x4.T(), //track origin
AliRICHChamber* C(Int_t iC) const{return (AliRICHChamber*)fChambers->At(iC-1);}
AliRICHParam* Param() const{return fpParam;}
- AliRICHhit* FirstHit(Int_t iTrkN) {return (AliRICHhit*)AliDetector::FirstHit(iTrkN);} //virtual
- AliRICHhit* NextHit() {return (AliRICHhit*)AliDetector::NextHit();} //virtual
+ // AliRICHhit* FirstHit(Int_t iTrkN) {return (AliRICHhit*)AliDetector::FirstHit(iTrkN);} //virtual
+ // AliRICHhit* NextHit() {return (AliRICHhit*)AliDetector::NextHit();} //virtual
void CreateChambers();
void CreateMaterials(); //virtual
#include "AliRICHDigit.h"
#include "AliRICHRawCluster.h"
#include "AliRICHRecHit1D.h"
+#include "AliMC.h"
ClassImp(AliRICHDisplay)
sprintf(ptitle,"Alice event: %d, Run:%d",
gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
title->AddText(ptitle);
- Int_t nparticles = gAlice->Particles()->GetEntriesFast();
+ Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
sprintf(ptitle,"Nparticles = %d Nhits = %d Npads fired = %d",
nparticles, fHitsCuts,fClustersCuts);
title->AddText(ptitle);
points = new AliRICHPoints(1);
fPhits->AddAt(points,npoints);
mHit = (AliRICHhit*)pRICHhits->UncheckedAt(hit);
- TParticle *current = (TParticle*)gAlice->Particle(mHit->Track());
+ TParticle *current = (TParticle*)gAlice->GetMCApp()->Particle(mHit->Track());
if (current->GetPdgCode() == 50000050) {
points->SetMarkerColor(kBlue);
} else if (current->GetPdgCode() == 50000051) {
#include "AliRICHSDigit.h"
#include "AliRICHDigit.h"
#include "AliRICHRawCluster.h"
+#include "AliMC.h"
const Int_t kMaxNipx=400, kMaxNipy=800;
//
// Returns pointer to particle index in AliRun::fParticles
//
- if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
- return gAlice->Particle(fIndex);
+ if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0;
+ return gAlice->GetMCApp()->Particle(fIndex);
}
//_____________________________________________________________________________
if (marker)
marker->Draw();
}
- TParticle *p = gAlice->Particle(fIndex);
+ TParticle *p = gAlice->GetMCApp()->Particle(fIndex);
printf("\nTrack index %d\n",fTrackIndex);
printf("Particle ID %d\n",p->GetPdgCode());
printf("Parent %d\n",p->GetFirstMother());
#include "AliRICHResponseV0.h"
#include "AliRun.h"
#include "AliSegmentation.h"
+#include "AliMC.h"
//___________________________________________
ClassImp(AliRICHResponseV0)
// Get weight of current particle
TParticle *current = (TParticle*)
- (*gAlice->Particles())[gAlice->GetCurrentTrackNumber()];
+ (*gAlice->GetMCApp()->Particles())[gAlice->GetMCApp()->GetCurrentTrackNumber()];
ifeed = Int_t(current->GetWeight()/100+0.5);
ipart = gMC->TrackPid();
// Put photon on the stack and label it as feedback (51, 52)
++sNfeed;
- gAlice->PushTrack(Int_t(1), gAlice->GetCurrentTrackNumber(), Int_t(50000051),
+ gAlice->GetMCApp()->PushTrack(Int_t(1), gAlice->GetMCApp()->GetCurrentTrackNumber(), Int_t(50000051),
mom[0],mom[1],mom[2],mom[3],source[0],source[1],source[2],position[3],pol[0],pol[1],pol[2],
kPFeedBackPhoton, nt, 1.);
#include "AliRICHConst.h"
#include <AliRun.h>
#include <TLorentzVector.h>
+#include "AliMC.h"
ClassImp(AliRICHv0)
Info("","event=%i hunt=%i tid=%i pid=%i(%s) m=%f q=%3.1f",
gMC->CurrentEvent(),
fIshunt,
- gAlice->GetCurrentTrackNumber(),
+ gAlice->GetMCApp()->GetCurrentTrackNumber(),
gMC->TrackPid(),
sParticle,
gMC->TrackMass(),
#include <AliConst.h>
#include <AliPDG.h>
#include <AliRun.h>
+#include <AliMC.h>
ClassImp(AliRICHv1)
//______________________________________________________________________________
static Float_t eloss, tlength;
const Float_t kBig=1.e10;
- TParticle *current = (TParticle*)(*gAlice->Particles())[gAlice->GetCurrentTrackNumber()];
+ TParticle *current = (TParticle*)(*gAlice->GetMCApp()->Particles())[gAlice->GetMCApp()->GetCurrentTrackNumber()];
if(gMC->IsNewTrack()){//C+E+enter+FRE+new
Int_t mother=current->GetFirstMother();
ckovData[10]=mother;
- ckovData[11]=gAlice->GetCurrentTrackNumber();
+ ckovData[11]=gAlice->GetMCApp()->GetCurrentTrackNumber();
ckovData[12]=1; //Media where photon was produced 1->Freon, 2->Quarz
fCkovNumber++;
fFreonProd=1;
coscerenkov = 0;
ckovData[18]=TMath::ACos(coscerenkov);//Cerenkov angle
}
- AddHit(gAlice->GetCurrentTrackNumber(),vol,ckovData);//PHOTON HIT CF+CSI+DE
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);//PHOTON HIT CF+CSI+DE
//AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
}//CF+CSI+DE
}//CF+CSI
hits[8]= hits[8]+1;
hits[9]= (Float_t) fNsdigits;
}
- AddHit(gAlice->GetCurrentTrackNumber(),vol,hits);//MIP HIT MIP+GAP+Exit
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);//MIP HIT MIP+GAP+Exit
eloss = 0;
}/*MIP+GAP+Exit*/else if(Param()->SigGenCond(localPos[0], localPos[2])){//MIP+GAP+Spec
Param()->SigGenInit(localPos[0], localPos[2]);
#include "AliRICHRawCluster.h"
#include "AliRICHDigit.h"
#include "AliRICHRecHit1D.h"
+#include "AliMC.h"
ClassImp(AliRICHv3)
const Float_t kBig=1.e10;
TClonesArray &lhits = *fHits;
- TParticle *current = (TParticle*)(*gAlice->Particles())[gAlice->GetCurrentTrackNumber()];
+ TParticle *current = (TParticle*)(*gAlice->GetMCApp()->Particles())[gAlice->GetMCApp()->GetCurrentTrackNumber()];
//if (current->Energy()>1)
//{
//printf("Second Mother:%d\n",current->GetSecondMother());
ckovData[10] = mother;
- ckovData[11] = gAlice->GetCurrentTrackNumber();
+ ckovData[11] = gAlice->GetMCApp()->GetCurrentTrackNumber();
ckovData[12] = 1; //Media where photon was produced 1->Freon, 2->Quarz
//printf("Produced in FREO\n");
fCkovNumber++;
if (ranf[0] > t) {
gMC->StopTrack();
ckovData[13] = 5;
- AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
+ AddCerenkov(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
//printf("Added One (1)!\n");
//printf("Lost one in grid\n");
}
if (ranf[0] < t) {
gMC->StopTrack();
ckovData[13] = 6;
- AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
+ AddCerenkov(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
//printf("Added One (2)!\n");
//printf("Lost by Fresnel\n");
ckovData[13]=16;
}
gMC->StopTrack();
- AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
+ AddCerenkov(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
//printf("Added One (3)!\n");
//printf("Added cerenkov %d\n",fCkovNumber);
} //absorption question
else if (procs[i] == kPStop) { //is it below energy treshold?
ckovData[13]=21;
gMC->StopTrack();
- AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
+ AddCerenkov(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
//printf("Added One (4)!\n");
} // energy treshold question
} //number of mechanisms cycle
}
//if (sector != -1)
//{
- AddHit(gAlice->GetCurrentTrackNumber(),vol,ckovData);
- AddCerenkov(gAlice->GetCurrentTrackNumber(),vol,ckovData);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
+ AddCerenkov(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,ckovData);
//printf("Added One (5)!\n");
//}
}
}
//if(sector !=-1)
- new(lhits[fNhits++]) AliRICHhit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliRICHhit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
eloss = 0;
//
// Check additional signal generation conditions
Float_t PTfinal;
Float_t PTvertex;
- TParticle *current = gAlice->Particle(index);
+ TParticle *current = gAlice->GetMCApp()->Particle(index);
//Float_t energy=current->Energy();
#include "AliSTARThit.h"
#include "AliSTARThitPhoton.h"
#include "AliSTARTvertex.h"
+#include "AliMC.h"
ClassImp(AliSTART)
//
// Initialise Hit array
fHits = new TClonesArray("AliSTARThit", 405);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
fPhotons = new TClonesArray("AliSTARThitPhoton", 10000);
- gAlice->AddHitList (fPhotons);
+ gAlice->GetMCApp()->AddHitList (fPhotons);
fIshunt = 1;
fIdSens = 0;
#include "AliRun.h"
#include "AliSTARThit.h"
#include "AliSTARTv1.h"
+#include "AliMC.h"
ClassImp(AliSTARTv1)
Float_t de=gMC->Edep();
edep=edep+de;
hits[3]=edep*1e3;
- new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
}
}
//---------------------------------------------------------------------
#include "AliRun.h"
#include "AliSTARThit.h"
#include "AliSTARTv2.h"
+#include "AliMC.h"
//#include "AliSTARThitPhoton.h"
//#include "TGeant3.h"
hitPhoton[4] = 1e9 * gMC->TrackTime();
hitPhoton[5] = 1e9 * gMC->Etot();
- AddHitPhoton (gAlice->GetCurrentTrackNumber(), vol, hitPhoton);
+ AddHitPhoton (gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hitPhoton);
}
gMC->StopTrack();
}
// printf(" HITS on START Exit %f\n",hits[i]); }
//for (i=0; i<=1; i++) { printf("START vol %d\n",vol[i]);}
- new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
+ new(lhits[fNhits++]) AliSTARThit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
}
}
#include "AliPoints.h"
#include "AliLoader.h"
#include "AliRun.h"
+#include "AliMC.h"
// Static variables for the hit iterator routines
// Error("LoadPoints","nhits == 0. Name is %s",GetName());
return;
}
- Int_t tracks = gAlice->GetNtrack();
+ Int_t tracks = gAlice->GetMCApp()->GetNtrack();
if (fPoints == 0) fPoints = new TObjArray(tracks);
AliHit *ahit;
//
#include "AliStack.h"
#include "TGeometry.h"
#include "TParticle.h"
+#include "AliMC.h"
static const Float_t kptcutmax = 2;
static const Float_t ketacutmax = 1.5;
// fPad->Modified();
// TClonesArray *particles=gAlice->Particles();
// TParticle *p = (TParticle*)particles->UncheckedAt(idx);
- TParticle *p = gAlice->Particle(idx);
+ TParticle *p = gAlice->GetMCApp()->Particle(idx);
printf("\nTrack index %d\n",idx);
printf("Particle ID %d\n",p->GetPdgCode());
printf("Parent %d\n",p->GetFirstMother());
char ptitle[100];
sprintf(ptitle,"Alice event: %d, Run:%d",gAlice->GetHeader()->GetEvent(), gAlice->GetHeader()->GetRun());
title->AddText(ptitle);
- Int_t nparticles = gAlice->Particles()->GetEntriesFast();
+ Int_t nparticles = gAlice->GetMCApp()->Particles()->GetEntriesFast();
sprintf(ptitle,"Nparticles = %d Nhits = %d",nparticles, fHitsCuts);
title->AddText(ptitle);
} else {
gAlice->ResetPoints();
TIter next(gAlice->Modules());
AliModule *module;
- Int_t ntracks = gAlice->GetNtrack();
+ Int_t ntracks = gAlice->GetMCApp()->GetNtrack();
while((module = (AliModule*)next()))
{
for (Int_t track=0; track<fNTracksToDisplay;track++)
{
gAlice->ResetHits();
- Int_t nev = nprim-1-gAlice->GetPrimary(fTracksToDisplay[track]);
+ Int_t nev = nprim-1-gAlice->GetMCApp()->GetPrimary(fTracksToDisplay[track]);
while((module = (AliModule*)next()))
{
AliDetector* detector = dynamic_cast<AliDetector*>(module);
if(detector)
{
detector->TreeH()->GetEvent(nev);
- module->LoadPoints(nprim-1-gAlice->GetPrimary(fTracksToDisplay[track]));
+ module->LoadPoints(nprim-1-gAlice->GetMCApp()->GetPrimary(fTracksToDisplay[track]));
}
}
next.Reset();
#include "AliGenerator.h"
#include "AliRun.h"
#include "AliStack.h"
+#include "AliMC.h"
ClassImp(AliGenerator)
if (gAlice) {
if (gAlice->GetDebug()>0)
printf("\n AliGenerator Default Constructor\n\n");
- gAlice->SetGenerator(this);
+ AliMC * mc = gAlice->GetMCApp();
+ if (mc) mc->SetGenerator(this);
}
SetThetaRange(); ResetBit(kThetaRange);
if (gAlice) {
if (gAlice->GetDebug()>0)
printf("\n AliGenerator Constructor initializing number of particles \n\n");
- gAlice->SetGenerator(this);
+ AliMC * mc = gAlice->GetMCApp();
+ if (mc) mc->SetGenerator(this);
}
SetThetaRange(); ResetBit(kThetaRange);
fStack->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
mech, ntr, weight, is);
else
- gAlice->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
+ gAlice->GetMCApp()->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
mech, ntr, weight, is);
}
fStack->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
polx, poly, polz, mech, ntr, weight, is);
else
- gAlice->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+ gAlice->GetMCApp()->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
polx, poly, polz, mech, ntr, weight, is);
}
if (fStack)
fStack->KeepTrack(itrack);
else
- gAlice->KeepTrack(itrack);
+ gAlice->GetMCApp()->KeepTrack(itrack);
}
if (fStack)
fStack->SetHighWaterMark(nt);
else
- gAlice->SetHighWaterMark(nt);
+ gAlice->GetMCApp()->SetHighWaterMark(nt);
}
void AliGenerator::FinishRun()
#include "AliHit.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliHit)
// Standard constructor
//
if(shunt == 1) {
- int primary = gAlice->GetPrimary(track);
- gAlice->Particle(primary)->SetBit(kKeepBit);
+ int primary = gAlice->GetMCApp()->GetPrimary(track);
+ gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
fTrack=primary;
}
Int_t parent=track;
while (1) {
current=parent;
- part = gAlice->Particle(current);
+ part = gAlice->GetMCApp()->Particle(current);
parent=part->GetFirstMother();
if(parent<0 || part->TestBit(kKeepBit))
break;
else {
fTrack=track;
- gAlice->FlagTrack(fTrack);
+ gAlice->GetMCApp()->FlagTrack(fTrack);
}
}
#include "TH2.h"
#include "TMath.h"
#include "TString.h"
+#include "TVirtualMC.h"
#include "AliConst.h"
#include "AliDebugVolume.h"
#include "AliLego.h"
#include "AliLegoGenerator.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliLego)
fStepsForward = 0;
fStepsBackward = 0;
fErrorCondition = 0;
- if (gAlice->GetCurrentTrackNumber() == 0) fStepBack = 0;
+ if (gAlice->GetMCApp()->GetCurrentTrackNumber() == 0) fStepBack = 0;
}
}
orig[1] = vect[1];
orig[2] = vect[2];
- gAlice->PushTrack(1, gAlice->GetCurrentTrackNumber(),
+ gAlice->GetMCApp()->PushTrack(1, gAlice->GetMCApp()->GetCurrentTrackNumber(),
0, pmom, orig, polar, 0., kPNoProcess, ntr);
} // debug
#include "AliLegoGenerator.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliLegoGenerator)
Float_t polar[3]={0.,0.,0.};
Int_t ntr;
- gAlice->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
+ gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
}
#include "AliLegoGeneratorEta.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliLegoGeneratorEta)
Float_t polar[3]={0.,0.,0.};
Int_t ntr;
- gAlice->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
+ gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
}
#include "AliLegoGeneratorPhiZ.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliLegoGeneratorPhiZ)
Float_t polar[3]={0.,0.,0.};
Int_t ntr;
- gAlice->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
+ gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
}
#include "AliLegoGeneratorXYZ.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliLegoGeneratorXYZ)
Float_t polar[3]={0.,0.,0.};
Int_t ntr;
- gAlice->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
+ gAlice->GetMCApp()->PushTrack(1, -1, kMpart, pmom, orig, polar, 0, kPPrimary, ntr);
}
--- /dev/null
+/**************************************************************************
+ * 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. *
+ **************************************************************************/
+
+/* $Id$ */
+
+#include <TBrowser.h>
+#include <TStopwatch.h>
+#include <TSystem.h>
+#include <TVirtualMC.h>
+
+#include "AliDetector.h"
+#include "AliGenerator.h"
+#include "AliHeader.h"
+#include "AliLego.h"
+#include "AliMC.h"
+#include "AliMCQA.h"
+#include "AliRun.h"
+#include "AliStack.h"
+#include "AliTrackReference.h"
+
+
+ClassImp(AliMC)
+
+//_______________________________________________________________________
+AliMC::AliMC() :
+ fGenerator(0),
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fImedia(0),
+ fTransParName("\0"),
+ fMCQA(0),
+ fHitLists(0),
+ fTrackReferences(0)
+
+{
+}
+
+//_______________________________________________________________________
+AliMC::AliMC(const char *name, const char *title) :
+ TVirtualMCApplication(name, title),
+ fGenerator(0),
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fImedia(new TArrayI(1000)),
+ fTransParName("\0"),
+ fMCQA(0),
+ fHitLists(new TList()),
+ fTrackReferences(new TClonesArray("AliTrackReference", 100))
+{
+
+ // Set transport parameters
+ SetTransPar();
+
+ // Prepare the tracking medium lists
+ for(Int_t i=0;i<1000;i++) (*fImedia)[i]=-99;
+
+}
+
+//_______________________________________________________________________
+AliMC::AliMC(const AliMC &mc) :
+ TVirtualMCApplication(mc),
+ fGenerator(0),
+ fEventEnergy(0),
+ fSummEnergy(0),
+ fSum2Energy(0),
+ fTrRmax(1.e10),
+ fTrZmax(1.e10),
+ fImedia(0),
+ fTransParName("\0"),
+ fMCQA(0),
+ fHitLists(0),
+ fTrackReferences(0)
+{
+ //
+ // Copy constructor for AliRun
+ //
+ mc.Copy(*this);
+}
+
+//_______________________________________________________________________
+AliMC::~AliMC()
+{
+ delete fGenerator;
+ delete fImedia;
+ delete fMCQA;
+ delete fHitLists;
+ // Delete track references
+ if (fTrackReferences) {
+ fTrackReferences->Delete();
+ delete fTrackReferences;
+ fTrackReferences = 0;
+ }
+
+}
+
+//_______________________________________________________________________
+void AliMC::Copy(AliMC &) const
+{
+ Fatal("Copy","Not implemented!\n");
+}
+
+//_______________________________________________________________________
+void AliMC::ConstructGeometry()
+{
+ //
+ // Create modules, materials, geometry
+ //
+
+ TStopwatch stw;
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ if (GetDebug()) Info("ConstructGeometry","Geometry creation:");
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ stw.Start();
+ // Initialise detector materials and geometry
+ detector->CreateMaterials();
+ detector->CreateGeometry();
+ printf("%10s R:%.2fs C:%.2fs\n",
+ detector->GetName(),stw.RealTime(),stw.CpuTime());
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::InitGeometry()
+{
+ //
+ // Initialize detectors and display geometry
+ //
+
+ printf("Initialisation:\n");
+ TStopwatch stw;
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ stw.Start();
+ // Initialise detector and display geometry
+ detector->Init();
+ detector->BuildGeometry();
+ printf("%10s R:%.2fs C:%.2fs\n",
+ detector->GetName(),stw.RealTime(),stw.CpuTime());
+ }
+
+}
+
+//_______________________________________________________________________
+void AliMC::GeneratePrimaries()
+{
+ //
+ // Generate primary particles and fill them in the stack.
+ //
+
+ Generator()->Generate();
+}
+
+//_______________________________________________________________________
+void AliMC::SetGenerator(AliGenerator *generator)
+{
+ //
+ // Load the event generator
+ //
+ if(!fGenerator) fGenerator = generator;
+}
+
+//_______________________________________________________________________
+void AliMC::ResetGenerator(AliGenerator *generator)
+{
+ //
+ // Load the event generator
+ //
+ if(fGenerator)
+ if(generator)
+ Warning("ResetGenerator","Replacing generator %s with %s\n",
+ fGenerator->GetName(),generator->GetName());
+ else
+ Warning("ResetGenerator","Replacing generator %s with NULL\n",
+ fGenerator->GetName());
+ fGenerator = generator;
+}
+
+//_______________________________________________________________________
+void AliMC::FinishRun()
+{
+ // Clean generator information
+ if (GetDebug()) Info("FinishRun"," fGenerator->FinishRun()");
+ fGenerator->FinishRun();
+
+ //Output energy summary tables
+ if (GetDebug()) Info("FinishRun"," EnergySummary()");
+ EnergySummary();
+
+}
+
+//_______________________________________________________________________
+void AliMC::BeginPrimary()
+{
+ //
+ // Called at the beginning of each primary track
+ //
+
+ // Reset Hits info
+ ResetHits();
+ ResetTrackReferences();
+
+}
+
+//_______________________________________________________________________
+void AliMC::PreTrack()
+{
+ TObjArray &dets = *gAlice->Modules();
+ AliModule *module;
+
+ for(Int_t i=0; i<=gAlice->GetNdets(); i++)
+ if((module = dynamic_cast<AliModule*>(dets[i])))
+ module->PreTrack();
+
+ fMCQA->PreTrack();
+}
+
+//_______________________________________________________________________
+void AliMC::Stepping()
+{
+ //
+ // Called at every step during transport
+ //
+
+ Int_t id = DetFromMate(gMC->GetMedium());
+ if (id < 0) return;
+
+ //
+ // --- If lego option, do it and leave
+ if (gAlice->Lego())
+ gAlice->Lego()->StepManager();
+ else {
+ Int_t copy;
+ //Update energy deposition tables
+ AddEnergyDeposit(gMC->CurrentVolID(copy),gMC->Edep());
+
+ //Call the appropriate stepping routine;
+ AliModule *det = dynamic_cast<AliModule*>(gAlice->Modules()->At(id));
+ if(det && det->StepManagerIsEnabled()) {
+ fMCQA->StepManager(id);
+ det->StepManager();
+ }
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::EnergySummary()
+{
+ //
+ // Print summary of deposited energy
+ //
+
+ Int_t ndep=0;
+ Float_t edtot=0;
+ Float_t ed, ed2;
+ Int_t kn, i, left, j, id;
+ const Float_t kzero=0;
+ Int_t ievent=gAlice->GetRunLoader()->GetHeader()->GetEvent()+1;
+ //
+ // Energy loss information
+ if(ievent) {
+ printf("***************** Energy Loss Information per event (GEV) *****************\n");
+ for(kn=1;kn<fEventEnergy.GetSize();kn++) {
+ ed=fSummEnergy[kn];
+ if(ed>0) {
+ fEventEnergy[ndep]=kn;
+ if(ievent>1) {
+ ed=ed/ievent;
+ ed2=fSum2Energy[kn];
+ ed2=ed2/ievent;
+ ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,kzero))/ed;
+ } else
+ ed2=99;
+ fSummEnergy[ndep]=ed;
+ fSum2Energy[ndep]=TMath::Min(static_cast<Float_t>(99.),TMath::Max(ed2,kzero));
+ edtot+=ed;
+ ndep++;
+ }
+ }
+ for(kn=0;kn<(ndep-1)/3+1;kn++) {
+ left=ndep-kn*3;
+ for(i=0;i<(3<left?3:left);i++) {
+ j=kn*3+i;
+ id=Int_t (fEventEnergy[j]+0.1);
+ printf(" %s %10.3f +- %10.3f%%;",gMC->VolName(id),fSummEnergy[j],fSum2Energy[j]);
+ }
+ printf("\n");
+ }
+ //
+ // Relative energy loss in different detectors
+ printf("******************** Relative Energy Loss per event ********************\n");
+ printf("Total energy loss per event %10.3f GeV\n",edtot);
+ for(kn=0;kn<(ndep-1)/5+1;kn++) {
+ left=ndep-kn*5;
+ for(i=0;i<(5<left?5:left);i++) {
+ j=kn*5+i;
+ id=Int_t (fEventEnergy[j]+0.1);
+ printf(" %s %10.3f%%;",gMC->VolName(id),100*fSummEnergy[j]/edtot);
+ }
+ printf("\n");
+ }
+ for(kn=0;kn<75;kn++) printf("*");
+ printf("\n");
+ }
+ //
+ // Reset the TArray's
+ // fEventEnergy.Set(0);
+ // fSummEnergy.Set(0);
+ // fSum2Energy.Set(0);
+}
+
+//_____________________________________________________________________________
+void AliMC::BeginEvent()
+{
+ //
+ // Clean-up previous event
+ // Energy scores
+ if (GetDebug())
+ {
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ Info("BeginEvent"," BEGINNING EVENT ");
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+ }
+
+ AliRunLoader *runloader=gAlice->GetRunLoader();
+
+ /*******************************/
+ /* Clean after eventual */
+ /* previous event */
+ /*******************************/
+
+
+ //Set the next event in Run Loader -> Cleans trees (TreeK and all trees in detectors),
+ gAlice->SetEventNrInRun(gAlice->GetEventNrInRun()+1);
+ runloader->SetEventNumber(gAlice->GetEventNrInRun());// sets new files, cleans the previous event stuff, if necessary, etc.,
+ if (GetDebug()) Info("BeginEvent","EventNr is %d",gAlice->GetEventNrInRun());
+
+ fEventEnergy.Reset();
+ // Clean detector information
+
+ if (runloader->Stack())
+ runloader->Stack()->Reset();//clean stack -> tree is unloaded
+ else
+ runloader->MakeStack();//or make a new one
+
+ if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(K)");
+ runloader->MakeTree("K");
+ if (GetDebug()) Info("BeginEvent"," gMC->SetStack(fRunLoader->Stack())");
+ gMC->SetStack(gAlice->GetRunLoader()->Stack());//Was in InitMC - but was moved here
+ //because we don't have guarantee that
+ //stack pointer is not going to change from event to event
+ //since it bellobgs to header and is obtained via RunLoader
+ //
+ // Reset all Detectors & kinematics & make/reset trees
+ //
+
+ runloader->GetHeader()->Reset(gAlice->GetRunNumber(),gAlice->GetEvNumber(),
+ gAlice->GetEventNrInRun());
+// fRunLoader->WriteKinematics("OVERWRITE"); is there any reason to rewrite here since MakeTree does so
+
+ if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTrackRefsContainer()");
+ runloader->MakeTrackRefsContainer();//for insurance
+
+ if (GetDebug()) Info("BeginEvent"," ResetHits()");
+ ResetHits();
+ if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(H)");
+ runloader->MakeTree("H");
+
+ //
+ if(gAlice->Lego())
+ {
+ gAlice->Lego()->BeginEvent();
+ return;
+ }
+
+ //create new branches and SetAdresses
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = (AliModule*)next()))
+ {
+ if (GetDebug()) Info("BeginEvent"," %s->MakeBranch(H)",detector->GetName());
+ detector->MakeBranch("H");
+ if (GetDebug()) Info("BeginEvent"," %s->MakeBranchTR()",detector->GetName());
+ detector->MakeBranchTR();
+ if (GetDebug()) Info("BeginEvent"," %s->SetTreeAddress()",detector->GetName());
+ detector->SetTreeAddress();
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::ResetHits()
+{
+ //
+ // Reset all Detectors hits
+ //
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ detector->ResetHits();
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::PostTrack()
+{
+ TObjArray &dets = *gAlice->Modules();
+ AliModule *module;
+
+ for(Int_t i=0; i<=gAlice->GetNdets(); i++)
+ if((module = dynamic_cast<AliModule*>(dets[i])))
+ module->PostTrack();
+}
+
+//_______________________________________________________________________
+void AliMC::FinishPrimary()
+{
+ //
+ // Called at the end of each primary track
+ //
+ AliRunLoader *runloader=gAlice->GetRunLoader();
+ // static Int_t count=0;
+ // const Int_t times=10;
+ // This primary is finished, purify stack
+ runloader->Stack()->PurifyKine();
+
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ detector->FinishPrimary();
+ if(detector->GetLoader())
+ detector->GetLoader()->TreeH()->Fill();
+ }
+
+ // Write out track references if any
+ if (runloader->TreeTR()) runloader->TreeTR()->Fill();
+}
+
+//_______________________________________________________________________
+void AliMC::FinishEvent()
+{
+ //
+ // Called at the end of the event.
+ //
+
+ //
+ if(gAlice->Lego()) gAlice->Lego()->FinishEvent();
+
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ detector->FinishEvent();
+ }
+
+ //Update the energy deposit tables
+ Int_t i;
+ for(i=0;i<fEventEnergy.GetSize();i++)
+ {
+ fSummEnergy[i]+=fEventEnergy[i];
+ fSum2Energy[i]+=fEventEnergy[i]*fEventEnergy[i];
+ }
+
+ AliRunLoader *runloader=gAlice->GetRunLoader();
+
+ AliHeader* header = runloader->GetHeader();
+ AliStack* stack = runloader->Stack();
+ if ( (header == 0x0) || (stack == 0x0) )
+ {//check if we got header and stack. If not cry and exit aliroot
+ Fatal("AliRun","Can not get the stack or header from LOADER");
+ return;//never reached
+ }
+ // Update Header information
+ header->SetNprimary(stack->GetNprimary());
+ header->SetNtrack(stack->GetNtrack());
+
+
+ // Write out the kinematics
+ stack->FinishEvent();
+
+ // Write out the event Header information
+ TTree* treeE = runloader->TreeE();
+ if (treeE)
+ {
+ header->SetStack(stack);
+ treeE->Fill();
+ }
+ else
+ {
+ Error("FinishEvent","Can not get TreeE from RL");
+ }
+
+ runloader->WriteKinematics("OVERWRITE");
+ runloader->WriteTrackRefs("OVERWRITE");
+ runloader->WriteHits("OVERWRITE");
+
+ if (GetDebug())
+ {
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ Info("FinishEvent"," FINISHING EVENT ");
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::Field(const Double_t* x, Double_t* b) const
+{
+ gAlice->Field(x,b);
+}
+
+//_______________________________________________________________________
+void AliMC::Init()
+{
+
+ //=================Create Materials and geometry
+ gMC->Init();
+ gMC->DefineParticles(); //Create standard MC particles
+
+ //Read the cuts for all materials
+ ReadTransPar();
+ //Build the special IMEDIA table
+ MediaTable();
+
+ //Compute cross-sections
+ gMC->BuildPhysics();
+
+ //Write Geometry object to current file.
+ gAlice->GetRunLoader()->WriteGeometry();
+
+ //Initialise geometry deposition table
+ fEventEnergy.Set(gMC->NofVolumes()+1);
+ fSummEnergy.Set(gMC->NofVolumes()+1);
+ fSum2Energy.Set(gMC->NofVolumes()+1);
+
+ //
+ fMCQA = new AliMCQA(gAlice->GetNdets());
+
+ // Register MC in configuration
+ AliConfig::Instance()->Add(gMC);
+
+}
+
+//_______________________________________________________________________
+void AliMC::MediaTable()
+{
+ //
+ // Built media table to get from the media number to
+ // the detector id
+ //
+
+ Int_t kz, nz, idt, lz, i, k, ind;
+ // Int_t ibeg;
+ TObjArray &dets = *gAlice->Detectors();
+ AliModule *det;
+ Int_t ndets=gAlice->GetNdets();
+ //
+ // For all detectors
+ for (kz=0;kz<ndets;kz++) {
+ // If detector is defined
+ if((det=dynamic_cast<AliModule*>(dets[kz]))) {
+ TArrayI &idtmed = *(det->GetIdtmed());
+ for(nz=0;nz<100;nz++) {
+ // Find max and min material number
+ if((idt=idtmed[nz])) {
+ det->LoMedium() = det->LoMedium() < idt ? det->LoMedium() : idt;
+ det->HiMedium() = det->HiMedium() > idt ? det->HiMedium() : idt;
+ }
+ }
+ if(det->LoMedium() > det->HiMedium()) {
+ det->LoMedium() = 0;
+ det->HiMedium() = 0;
+ } else {
+ if(det->HiMedium() > fImedia->GetSize()) {
+ Error("MediaTable","Increase fImedia from %d to %d",
+ fImedia->GetSize(),det->HiMedium());
+ return;
+ }
+ // Tag all materials in rage as belonging to detector kz
+ for(lz=det->LoMedium(); lz<= det->HiMedium(); lz++) {
+ (*fImedia)[lz]=kz;
+ }
+ }
+ }
+ }
+ //
+ // Print summary table
+ printf(" Traking media ranges:\n");
+ for(i=0;i<(ndets-1)/6+1;i++) {
+ for(k=0;k< (6<ndets-i*6?6:ndets-i*6);k++) {
+ ind=i*6+k;
+ det=dynamic_cast<AliModule*>(dets[ind]);
+ if(det)
+ printf(" %6s: %3d -> %3d;",det->GetName(),det->LoMedium(),
+ det->HiMedium());
+ else
+ printf(" %6s: %3d -> %3d;","NULL",0,0);
+ }
+ printf("\n");
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::ReadTransPar()
+{
+ //
+ // Read filename to set the transport parameters
+ //
+
+
+ const Int_t kncuts=10;
+ const Int_t knflags=11;
+ const Int_t knpars=kncuts+knflags;
+ const char kpars[knpars][7] = {"CUTGAM" ,"CUTELE","CUTNEU","CUTHAD","CUTMUO",
+ "BCUTE","BCUTM","DCUTE","DCUTM","PPCUTM","ANNI",
+ "BREM","COMP","DCAY","DRAY","HADR","LOSS",
+ "MULS","PAIR","PHOT","RAYL"};
+ char line[256];
+ char detName[7];
+ char* filtmp;
+ Float_t cut[kncuts];
+ Int_t flag[knflags];
+ Int_t i, itmed, iret, ktmed, kz;
+ FILE *lun;
+ //
+ // See whether the file is there
+ filtmp=gSystem->ExpandPathName(fTransParName.Data());
+ lun=fopen(filtmp,"r");
+ delete [] filtmp;
+ if(!lun) {
+ Warning("ReadTransPar","File %s does not exist!\n",fTransParName.Data());
+ return;
+ }
+ //
+ if(fDebug) {
+ printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
+ printf(" *%59s\n","*");
+ printf(" * Please check carefully what you are doing!%10s\n","*");
+ printf(" *%59s\n","*");
+ }
+ //
+ while(1) {
+ // Initialise cuts and flags
+ for(i=0;i<kncuts;i++) cut[i]=-99;
+ for(i=0;i<knflags;i++) flag[i]=-99;
+ itmed=0;
+ for(i=0;i<256;i++) line[i]='\0';
+ // Read up to the end of line excluded
+ iret=fscanf(lun,"%[^\n]",line);
+ if(iret<0) {
+ //End of file
+ fclose(lun);
+ if(fDebug){
+ printf(" *%59s\n","*");
+ printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
+ }
+ return;
+ }
+ // Read the end of line
+ fscanf(lun,"%*c");
+ if(!iret) continue;
+ if(line[0]=='*') continue;
+ // Read the numbers
+ iret=sscanf(line,"%s %d %f %f %f %f %f %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %d",
+ detName,&itmed,&cut[0],&cut[1],&cut[2],&cut[3],&cut[4],&cut[5],&cut[6],&cut[7],&cut[8],
+ &cut[9],&flag[0],&flag[1],&flag[2],&flag[3],&flag[4],&flag[5],&flag[6],&flag[7],
+ &flag[8],&flag[9],&flag[10]);
+ if(!iret) continue;
+ if(iret<0) {
+ //reading error
+ Warning("ReadTransPar","Error reading file %s\n",fTransParName.Data());
+ continue;
+ }
+ // Check that the module exist
+ AliModule *mod = gAlice->GetModule(detName);
+ if(mod) {
+ // Get the array of media numbers
+ TArrayI &idtmed = *mod->GetIdtmed();
+ // Check that the tracking medium code is valid
+ if(0<=itmed && itmed < 100) {
+ ktmed=idtmed[itmed];
+ if(!ktmed) {
+ Warning("ReadTransPar","Invalid tracking medium code %d for %s\n",itmed,mod->GetName());
+ continue;
+ }
+ // Set energy thresholds
+ for(kz=0;kz<kncuts;kz++) {
+ if(cut[kz]>=0) {
+ if(fDebug) printf(" * %-6s set to %10.3E for tracking medium code %4d for %s\n",
+ kpars[kz],cut[kz],itmed,mod->GetName());
+ gMC->Gstpar(ktmed,kpars[kz],cut[kz]);
+ }
+ }
+ // Set transport mechanisms
+ for(kz=0;kz<knflags;kz++) {
+ if(flag[kz]>=0) {
+ if(fDebug) printf(" * %-6s set to %10d for tracking medium code %4d for %s\n",
+ kpars[kncuts+kz],flag[kz],itmed,mod->GetName());
+ gMC->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz]));
+ }
+ }
+ } else {
+ Warning("ReadTransPar","Invalid medium code %d *\n",itmed);
+ continue;
+ }
+ } else {
+ if(fDebug) printf("%s::ReadTransParModule: %s not present\n",ClassName(),detName);
+ continue;
+ }
+ }
+}
+
+//_______________________________________________________________________
+void AliMC::SetTransPar(const char *filename)
+{
+ //
+ // Sets the file name for transport parameters
+ //
+ fTransParName = filename;
+}
+
+//_______________________________________________________________________
+void AliMC::Browse(TBrowser *b)
+{
+ //
+ // Called when the item "Run" is clicked on the left pane
+ // of the Root browser.
+ // It displays the Root Trees and all detectors.
+ //
+ //detectors are in folders anyway
+ b->Add(fMCQA,"AliMCQA");
+}
+
+//PH
+//_______________________________________________________________________
+void AliMC::AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
+{
+ //
+ // Add a hit to detector id
+ //
+ TObjArray &dets = *gAlice->Modules();
+ if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddHit(track,vol,hits);
+}
+
+//_______________________________________________________________________
+void AliMC::AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
+{
+ //
+ // Add digit to detector id
+ //
+ TObjArray &dets = *gAlice->Modules();
+ if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddDigit(tracks,digits);
+}
+
+//_______________________________________________________________________
+Int_t AliMC::GetCurrentTrackNumber() const {
+ //
+ // Returns current track
+ //
+ return gAlice->GetRunLoader()->Stack()->GetCurrentTrackNumber();
+}
+
+//_______________________________________________________________________
+void AliMC::DumpPart (Int_t i) const
+{
+ //
+ // Dumps particle i in the stack
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader->Stack())
+ runloader->Stack()->DumpPart(i);
+}
+
+//_______________________________________________________________________
+void AliMC::DumpPStack () const
+{
+ //
+ // Dumps the particle stack
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader->Stack())
+ runloader->Stack()->DumpPStack();
+}
+
+//_______________________________________________________________________
+Int_t AliMC::GetNtrack() const {
+ //
+ // Returns number of tracks in stack
+ //
+ Int_t ntracks = -1;
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader->Stack())
+ ntracks = runloader->Stack()->GetNtrack();
+ return ntracks;
+}
+
+//_______________________________________________________________________
+Int_t AliMC::GetPrimary(Int_t track) const
+{
+ //
+ // return number of primary that has generated track
+ //
+ Int_t nprimary = -999;
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader->Stack())
+ nprimary = runloader->Stack()->GetPrimary(track);
+ return nprimary;
+}
+
+//_______________________________________________________________________
+TParticle* AliMC::Particle(Int_t i) const
+{
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ return runloader->Stack()->Particle(i);
+ return 0x0;
+}
+
+//_______________________________________________________________________
+TObjArray* AliMC::Particles() const {
+ //
+ // Returns pointer to Particles array
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ return runloader->Stack()->Particles();
+ return 0x0;
+}
+
+//_______________________________________________________________________
+void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
+ Float_t *vpos, Float_t *polar, Float_t tof,
+ TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
+{
+// Delegate to stack
+//
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
+ mech, ntr, weight, is);
+}
+
+//_______________________________________________________________________
+void AliMC::PushTrack(Int_t done, Int_t parent, Int_t pdg,
+ Double_t px, Double_t py, Double_t pz, Double_t e,
+ Double_t vx, Double_t vy, Double_t vz, Double_t tof,
+ Double_t polx, Double_t poly, Double_t polz,
+ TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
+{
+ // Delegate to stack
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
+ polx, poly, polz, mech, ntr, weight, is);
+}
+
+//_______________________________________________________________________
+void AliMC::SetHighWaterMark(const Int_t nt)
+{
+ //
+ // Set high water mark for last track in event
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->SetHighWaterMark(nt);
+}
+
+//_______________________________________________________________________
+void AliMC::KeepTrack(const Int_t track)
+{
+ //
+ // Delegate to stack
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->KeepTrack(track);
+}
+
+//_______________________________________________________________________
+void AliMC::FlagTrack(Int_t track)
+{
+ // Delegate to stack
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->FlagTrack(track);
+}
+
+//_______________________________________________________________________
+void AliMC::SetCurrentTrack(Int_t track)
+{
+ //
+ // Set current track number
+ //
+ AliRunLoader * runloader = gAlice->GetRunLoader();
+ if (runloader)
+ if (runloader->Stack())
+ runloader->Stack()->SetCurrentTrack(track);
+}
+
+//_______________________________________________________________________
+void AliMC::AddTrackReference(Int_t label){
+ //
+ // add a trackrefernce to the list
+ if (!fTrackReferences) {
+ cerr<<"Container trackrefernce not active\n";
+ return;
+ }
+ Int_t nref = fTrackReferences->GetEntriesFast();
+ TClonesArray &lref = *fTrackReferences;
+ new(lref[nref]) AliTrackReference(label);
+}
+
+
+
+//_______________________________________________________________________
+void AliMC::ResetTrackReferences()
+{
+ //
+ // Reset all references
+ //
+ if (fTrackReferences) fTrackReferences->Clear();
+
+ TIter next(gAlice->Modules());
+ AliModule *detector;
+ while((detector = dynamic_cast<AliModule*>(next()))) {
+ detector->ResetTrackReferences();
+ }
+}
+
+void AliMC::RemapTrackReferencesIDs(Int_t *map)
+{
+ //
+ // Remapping track reference
+ // Called at finish primary
+ //
+ if (!fTrackReferences) return;
+ for (Int_t i=0;i<fTrackReferences->GetEntries();i++){
+ AliTrackReference * ref = dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(i));
+ if (ref) {
+ Int_t newID = map[ref->GetTrack()];
+ if (newID>=0) ref->SetTrack(newID);
+ else {
+ //ref->SetTrack(-1);
+ ref->SetBit(kNotDeleted,kFALSE);
+ fTrackReferences->RemoveAt(i);
+ }
+ }
+ }
+ fTrackReferences->Compress();
+}
--- /dev/null
+#ifndef ALIMC_H
+#define ALIMC_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id$ */
+
+#include <TArrayF.h>
+#include <TArrayI.h>
+#include <TVirtualMCApplication.h>
+
+class AliGenerator;
+class AliMCQA;
+
+class AliMC : public TVirtualMCApplication {
+public:
+ AliMC();
+ AliMC(const char *name, const char *title);
+ AliMC(const AliMC &mc);
+ virtual ~AliMC();
+
+ AliMC operator = (const AliMC &mc)
+ {mc.Copy(*this); return *this;}
+
+//
+// MC Application
+//
+ virtual void ConstructGeometry();
+ virtual void InitGeometry();
+ virtual void GeneratePrimaries();
+ virtual void BeginEvent();
+ virtual void BeginPrimary();
+ virtual void PreTrack();
+ virtual void Stepping();
+ virtual void PostTrack();
+ virtual void FinishPrimary();
+ virtual void FinishEvent();
+ virtual Double_t TrackingZmax() const {return fTrZmax;}
+ virtual Double_t TrackingRmax() const {return fTrRmax;}
+ virtual void Field(const Double_t* x, Double_t* b) const;
+ virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
+//
+
+ virtual AliGenerator* Generator() const {return fGenerator;}
+ virtual void SetGenerator(AliGenerator *generator);
+ virtual void ResetGenerator(AliGenerator *generator);
+
+//
+ virtual void ReadTransPar();
+ virtual void MediaTable();
+ virtual void EnergySummary();
+ virtual void FinishRun();
+ void AddEnergyDeposit(Int_t id, Float_t edep)
+ {fEventEnergy[id]+=edep;}
+ virtual void ResetHits();
+ virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10)
+ {fTrRmax=rmax; fTrZmax=zmax;}
+ Int_t GetDebug() const {return fDebug;}
+ virtual void SetDebug(const Int_t level=0) {fDebug = level;}
+ virtual void Init();
+ virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
+ virtual void Browse(TBrowser *b);
+ AliMCQA *GetMCQA() const {return fMCQA;}
+ //PH
+ virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
+ virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
+ virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
+ Int_t GetCurrentTrackNumber() const;
+ virtual void DumpPart (Int_t i) const;
+ virtual void DumpPStack () const;
+ TList* GetHitLists() const {return fHitLists ;}
+ Int_t GetNtrack() const;
+ virtual Int_t GetPrimary(Int_t track) const;
+ TObjArray *Particles() const;
+ TParticle *Particle(Int_t i) const;
+ virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
+ Float_t *pmom, Float_t *vpos, Float_t *polar,
+ Float_t tof, TMCProcess mech, Int_t &ntr,
+ Float_t weight = 1, Int_t is = 0);
+ virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
+ Double_t px, Double_t py, Double_t pz, Double_t e,
+ Double_t vx, Double_t vy, Double_t vz, Double_t tof,
+ Double_t polx, Double_t poly, Double_t polz,
+ TMCProcess mech, Int_t &ntr, Float_t weight=1,
+ Int_t is = 0);
+ virtual void SetHighWaterMark(const Int_t nt);
+
+ virtual void KeepTrack(const Int_t itra);
+ virtual void FlagTrack(Int_t track);
+ virtual void SetCurrentTrack(Int_t track);
+// Track reference related
+ virtual void AddTrackReference(Int_t label);
+ TClonesArray *TrackReferences() const {return fTrackReferences;}
+ virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
+ virtual void ResetTrackReferences();
+
+
+
+private:
+ void Copy (AliMC &mc) const;
+ AliGenerator *fGenerator; // Generator used in the MC
+ TArrayF fEventEnergy; //! Energy deposit for current event
+ TArrayF fSummEnergy; //! Energy per event in each volume
+ TArrayF fSum2Energy; //! Energy squared per event in each volume
+ Float_t fTrRmax; // Maximum radius for tracking
+ Float_t fTrZmax; // Maximu z for tracking
+ Int_t fDebug; // Debug flag
+ TArrayI *fImedia; //! Array of correspondence between media and detectors
+ TString fTransParName; // Name of the transport parameters file
+ AliMCQA *fMCQA; // Pointer to MC Quality assurance class
+ //PH
+ TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
+ TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
+
+ ClassDef(AliMC,1)
+};
+
+
+#endif
#include <TPad.h>
#include <TPaveLabel.h>
#include <TROOT.h>
+#include <TVirtualMC.h>
#include "AliMCQA.h"
#include "AliModule.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliMCQA)
//
// Build list of volume names
//
+ AliMC * mc = gAlice->GetMCApp();
for(i=0;i<fNvolumes;++i) {
AliModule *mod = dynamic_cast<AliModule*>
- ((*gAlice->Modules())[gAlice->DetFromMate(gMC->VolId2Mate(i+1))]);
+ ((*gAlice->Modules())[mc->DetFromMate(gMC->VolId2Mate(i+1))]);
(*fVolNames)[i]=new TNamed(gMC->VolName(i+1),mod->GetName());
}
#include <TTree.h>
#include <TSystem.h>
#include <TDirectory.h>
+#include <TVirtualMC.h>
#include "AliConfig.h"
#include "AliLoader.h"
#include "AliModule.h"
#include "AliRun.h"
#include "AliTrackReference.h"
+#include "AliMC.h"
ClassImp(AliModule)
{
AliRunLoader* rl = AliRunLoader::GetRunLoader();
- rl->GetAliRun()->ResetTrackReferences();
+ rl->GetAliRun()->GetMCApp()->ResetTrackReferences();
rl->TreeTR()->GetEvent(track);
if (rl == 0x0)
Fatal("FirstTrackReference","AliRunLoader not initialized. Can not proceed");
#include "AliDetector.h"
#include "AliPoints.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliPoints)
//
// Returns pointer to particle index in AliRun::fParticles
//
- if (fIndex < 0 || fIndex >= gAlice->GetNtrack()) return 0;
- else return gAlice->Particle(fIndex);
+ if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0;
+ else return gAlice->GetMCApp()->Particle(fIndex);
}
//_______________________________________________________________________
//
TIter next(gAlice->Detectors());
AliDetector *detector;
- while((detector = dynamic_cast<AliDetector*>(next()))) {
+ while((detector = (AliDetector*)(next()))) {
if (!detector->IsActive()) continue;
points = detector->Points();
if (!points) continue;
// //
///////////////////////////////////////////////////////////////////////////////
-#include <Riostream.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
#include <TBRIK.h>
-#include <TBrowser.h>
#include <TCint.h>
-#include <TFile.h>
-#include <TFolder.h>
+#include <TDatabasePDG.h>
#include <TGeometry.h>
-#include <TKey.h>
#include <TNode.h>
-#include <TObjectTable.h>
-#include <TParticle.h>
#include <TROOT.h>
-#include <TRandom.h>
#include <TRandom3.h>
#include <TSystem.h>
-#include <TTree.h>
+#include <TVector.h>
#include <TVirtualMC.h>
-
-#include "AliConfig.h"
+//
#include "AliDetector.h"
#include "AliDisplay.h"
-#include "AliGenEventHeader.h"
-#include "AliGenerator.h"
#include "AliHeader.h"
-#include "AliHit.h"
#include "AliLego.h"
#include "AliLegoGenerator.h"
-#include "AliLoader.h"
-#include "AliMCQA.h"
+#include "AliMC.h"
#include "AliMagFC.h"
#include "AliMagFCM.h"
#include "AliMagFDM.h"
#include "AliPDG.h"
#include "AliRun.h"
-#include "AliRunLoader.h"
#include "AliStack.h"
-#include "AliTrackReference.h"
AliRun *gAlice;
+
ClassImp(AliRun)
//_______________________________________________________________________
fDebug(0),
fModules(0),
fGeometry(0),
+ fMCApp(0),
fDisplay(0),
fTimer(),
fField(0),
fMC(0),
- fImedia(0),
fNdets(0),
- fTrRmax(1.e10),
- fTrZmax(1.e10),
- fGenerator(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(0), //Particle factory object
- fHitLists(0),
- fEventEnergy(0),
- fSummEnergy(0),
- fSum2Energy(0),
fConfigFunction("\0"),
fRandom(0),
- fMCQA(0),
- fTransParName("\0"),
- fRunLoader(0x0),
- fTrackReferences(0)
+ fRunLoader(0x0)
{
//
// Default constructor for AliRun
//_______________________________________________________________________
AliRun::AliRun(const AliRun& arun):
- TVirtualMCApplication(arun),
+ TNamed(arun),
fRun(0),
fEvent(0),
fEventNrInRun(0),
fDebug(0),
fModules(0),
fGeometry(0),
+ fMCApp(0),
fDisplay(0),
fTimer(),
fField(0),
fMC(0),
- fImedia(0),
fNdets(0),
- fTrRmax(1.e10),
- fTrZmax(1.e10),
- fGenerator(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(0), //Particle factory object
- fHitLists(0),
- fEventEnergy(0),
- fSummEnergy(0),
- fSum2Energy(0),
fConfigFunction("\0"),
fRandom(0),
- fMCQA(0),
- fTransParName("\0"),
- fTrackReferences(new TClonesArray("AliTrackReference", 100)),
fRunLoader(0x0)
{
//
//_____________________________________________________________________________
AliRun::AliRun(const char *name, const char *title):
- TVirtualMCApplication(name,title),
+ TNamed(name,title),
fRun(0),
fEvent(0),
fEventNrInRun(0),
fDebug(0),
fModules(new TObjArray(77)), // Support list for the Detectors
fGeometry(0),
+ fMCApp(0),
fDisplay(0),
fTimer(),
fField(0),
fMC(gMC),
- fImedia(new TArrayI(1000)),
fNdets(0),
- fTrRmax(1.e10),
- fTrZmax(1.e10),
- fGenerator(0),
fInitDone(kFALSE),
fLego(0),
fPDGDB(TDatabasePDG::Instance()), //Particle factory object!
- fHitLists(new TList()), // Create HitLists list
- fEventEnergy(0),
- fSummEnergy(0),
- fSum2Energy(0),
fConfigFunction("Config();"),
fRandom(new TRandom3()),
- fMCQA(0),
- fTransParName("\0"),
fRunLoader(0x0)
{
//
// Create default mag field
SetField();
- // Prepare the tracking medium lists
- for(Int_t i=0;i<1000;i++) (*fImedia)[i]=-99;
-
// Add particle list to configuration
AliConfig::Instance()->Add(fPDGDB);
- // Set transport parameters
- SetTransPar();
}
modfold->Remove(mod);
}
}
-
- delete fImedia;
+
+
delete fField;
- // delete fMC;
+ delete fMCApp;
delete gMC; gMC=0;
delete fGeometry;
delete fDisplay;
- delete fGenerator;
delete fLego;
if (fModules) {
fModules->Delete();
delete fModules;
}
- delete fHitLists;
delete fPDGDB;
- delete fMCQA;
- // Delete track references
- if (fTrackReferences) {
- fTrackReferences->Delete();
- delete fTrackReferences;
- fTrackReferences = 0;
- }
-
}
//_______________________________________________________________________
Fatal("Copy","Not implemented!\n");
}
-//_______________________________________________________________________
-void AliRun::AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const
-{
- //
- // Add a hit to detector id
- //
- TObjArray &dets = *fModules;
- if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddHit(track,vol,hits);
-}
-
-//_______________________________________________________________________
-void AliRun::AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const
-{
- //
- // Add digit to detector id
- //
- TObjArray &dets = *fModules;
- if(dets[id]) dynamic_cast<AliModule*>(dets[id])->AddDigit(tracks,digits);
-}
-
-//_______________________________________________________________________
-void AliRun::Browse(TBrowser *b)
-{
- //
- // Called when the item "Run" is clicked on the left pane
- // of the Root browser.
- // It displays the Root Trees and all detectors.
- //
- //detectors are in folders anyway
- b->Add(fMCQA,"AliMCQA");
-}
-
//_______________________________________________________________________
void AliRun::Build()
{
}
//_______________________________________________________________________
-Int_t AliRun::DistancetoPrimitive(Int_t, Int_t) const
-{
- //
- // Return the distance from the mouse to the AliRun object
- // Dummy routine
- //
- return 9999;
-}
-
-//_______________________________________________________________________
-void AliRun::DumpPart (Int_t i) const
+void AliRun::ResetHits()
{
- //
- // Dumps particle i in the stack
- //
- if (fRunLoader->Stack())
- fRunLoader->Stack()->DumpPart(i);
+ fMCApp->ResetHits();
}
//_______________________________________________________________________
-void AliRun::DumpPStack () const
+AliGenerator* AliRun::Generator() const
{
- //
- // Dumps the particle stack
- //
- if (fRunLoader->Stack())
- fRunLoader->Stack()->DumpPStack();
+ return fMCApp->Generator();
}
//_______________________________________________________________________
detector->FinishRun();
}
- //Output energy summary tables
- if (GetDebug()) Info("FinishRun"," EnergySummary()");
- EnergySummary();
-
if (GetDebug()) Info("FinishRun"," fRunLoader->WriteHeader(OVERWRITE)");
fRunLoader->WriteHeader("OVERWRITE");
if (GetDebug()) Info("FinishRun"," fRunLoader->Stack()->FinishRun()");
fRunLoader->Stack()->FinishRun();
- // Clean detector information
- if (GetDebug()) Info("FinishRun"," fGenerator->FinishRun()");
- fGenerator->FinishRun();
- fRunLoader->Synchronize();
-}
+ if(fMCApp) fMCApp->FinishRun();
-//_______________________________________________________________________
-void AliRun::FlagTrack(Int_t track)
-{
- // Delegate to stack
- //
- fRunLoader->Stack()->FlagTrack(track);
-}
-
-//_______________________________________________________________________
-void AliRun::EnergySummary()
-{
- //
- // Print summary of deposited energy
- //
-
- Int_t ndep=0;
- Float_t edtot=0;
- Float_t ed, ed2;
- Int_t kn, i, left, j, id;
- const Float_t kzero=0;
- Int_t ievent=fRunLoader->GetHeader()->GetEvent()+1;
- //
- // Energy loss information
- if(ievent) {
- printf("***************** Energy Loss Information per event (GEV) *****************\n");
- for(kn=1;kn<fEventEnergy.GetSize();kn++) {
- ed=fSummEnergy[kn];
- if(ed>0) {
- fEventEnergy[ndep]=kn;
- if(ievent>1) {
- ed=ed/ievent;
- ed2=fSum2Energy[kn];
- ed2=ed2/ievent;
- ed2=100*TMath::Sqrt(TMath::Max(ed2-ed*ed,kzero))/ed;
- } else
- ed2=99;
- fSummEnergy[ndep]=ed;
- fSum2Energy[ndep]=TMath::Min(static_cast<Float_t>(99.),TMath::Max(ed2,kzero));
- edtot+=ed;
- ndep++;
- }
- }
- for(kn=0;kn<(ndep-1)/3+1;kn++) {
- left=ndep-kn*3;
- for(i=0;i<(3<left?3:left);i++) {
- j=kn*3+i;
- id=Int_t (fEventEnergy[j]+0.1);
- printf(" %s %10.3f +- %10.3f%%;",gMC->VolName(id),fSummEnergy[j],fSum2Energy[j]);
- }
- printf("\n");
- }
- //
- // Relative energy loss in different detectors
- printf("******************** Relative Energy Loss per event ********************\n");
- printf("Total energy loss per event %10.3f GeV\n",edtot);
- for(kn=0;kn<(ndep-1)/5+1;kn++) {
- left=ndep-kn*5;
- for(i=0;i<(5<left?5:left);i++) {
- j=kn*5+i;
- id=Int_t (fEventEnergy[j]+0.1);
- printf(" %s %10.3f%%;",gMC->VolName(id),100*fSummEnergy[j]/edtot);
- }
- printf("\n");
- }
- for(kn=0;kn<75;kn++) printf("*");
- printf("\n");
- }
- //
- // Reset the TArray's
- // fEventEnergy.Set(0);
- // fSummEnergy.Set(0);
- // fSum2Energy.Set(0);
+ fRunLoader->Synchronize();
}
//_______________________________________________________________________
/**** P R E R E L O A D I N G ****/
/*****************************************/
// Reset existing structures
- ResetHits();
- ResetTrackReferences();
+ fMCApp->ResetHits();
+ fMCApp->ResetTrackReferences();
ResetDigits();
ResetSDigits();
return fGeometry;
}
-//_______________________________________________________________________
-Int_t AliRun::GetPrimary(Int_t track) const
-{
- //
- // return number of primary that has generated track
- //
- return fRunLoader->Stack()->GetPrimary(track);
-}
-
-//_______________________________________________________________________
-void AliRun::MediaTable()
-{
- //
- // Built media table to get from the media number to
- // the detector id
- //
-
- Int_t kz, nz, idt, lz, i, k, ind;
- // Int_t ibeg;
- TObjArray &dets = *gAlice->Detectors();
- AliModule *det;
- //
- // For all detectors
- for (kz=0;kz<fNdets;kz++) {
- // If detector is defined
- if((det=dynamic_cast<AliModule*>(dets[kz]))) {
- TArrayI &idtmed = *(det->GetIdtmed());
- for(nz=0;nz<100;nz++) {
- // Find max and min material number
- if((idt=idtmed[nz])) {
- det->LoMedium() = det->LoMedium() < idt ? det->LoMedium() : idt;
- det->HiMedium() = det->HiMedium() > idt ? det->HiMedium() : idt;
- }
- }
- if(det->LoMedium() > det->HiMedium()) {
- det->LoMedium() = 0;
- det->HiMedium() = 0;
- } else {
- if(det->HiMedium() > fImedia->GetSize()) {
- Error("MediaTable","Increase fImedia from %d to %d",
- fImedia->GetSize(),det->HiMedium());
- return;
- }
- // Tag all materials in rage as belonging to detector kz
- for(lz=det->LoMedium(); lz<= det->HiMedium(); lz++) {
- (*fImedia)[lz]=kz;
- }
- }
- }
- }
- //
- // Print summary table
- printf(" Traking media ranges:\n");
- for(i=0;i<(fNdets-1)/6+1;i++) {
- for(k=0;k< (6<fNdets-i*6?6:fNdets-i*6);k++) {
- ind=i*6+k;
- det=dynamic_cast<AliModule*>(dets[ind]);
- if(det)
- printf(" %6s: %3d -> %3d;",det->GetName(),det->LoMedium(),
- det->HiMedium());
- else
- printf(" %6s: %3d -> %3d;","NULL",0,0);
- }
- printf("\n");
- }
-}
-
-//_______________________________________________________________________
-void AliRun::SetGenerator(AliGenerator *generator)
-{
- //
- // Load the event generator
- //
- if(!fGenerator) fGenerator = generator;
-}
-
-//_______________________________________________________________________
-void AliRun::ResetGenerator(AliGenerator *generator)
-{
- //
- // Load the event generator
- //
- if(fGenerator)
- if(generator)
- Warning("ResetGenerator","Replacing generator %s with %s\n",
- fGenerator->GetName(),generator->GetName());
- else
- Warning("ResetGenerator","Replacing generator %s with NULL\n",
- fGenerator->GetName());
- fGenerator = generator;
-}
-
-//_______________________________________________________________________
-void AliRun::SetTransPar(const char *filename)
-{
- //
- // Sets the file name for transport parameters
- //
- fTransParName = filename;
-}
-
//_______________________________________________________________________
void AliRun::SetBaseFile(const char *filename)
{
fBaseFileName = filename;
}
-//_______________________________________________________________________
-void AliRun::ReadTransPar()
-{
- //
- // Read filename to set the transport parameters
- //
-
-
- const Int_t kncuts=10;
- const Int_t knflags=11;
- const Int_t knpars=kncuts+knflags;
- const char kpars[knpars][7] = {"CUTGAM" ,"CUTELE","CUTNEU","CUTHAD","CUTMUO",
- "BCUTE","BCUTM","DCUTE","DCUTM","PPCUTM","ANNI",
- "BREM","COMP","DCAY","DRAY","HADR","LOSS",
- "MULS","PAIR","PHOT","RAYL"};
- char line[256];
- char detName[7];
- char* filtmp;
- Float_t cut[kncuts];
- Int_t flag[knflags];
- Int_t i, itmed, iret, ktmed, kz;
- FILE *lun;
- //
- // See whether the file is there
- filtmp=gSystem->ExpandPathName(fTransParName.Data());
- lun=fopen(filtmp,"r");
- delete [] filtmp;
- if(!lun) {
- Warning("ReadTransPar","File %s does not exist!\n",fTransParName.Data());
- return;
- }
- //
- if(fDebug) {
- printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
- printf(" *%59s\n","*");
- printf(" * Please check carefully what you are doing!%10s\n","*");
- printf(" *%59s\n","*");
- }
- //
- while(1) {
- // Initialise cuts and flags
- for(i=0;i<kncuts;i++) cut[i]=-99;
- for(i=0;i<knflags;i++) flag[i]=-99;
- itmed=0;
- for(i=0;i<256;i++) line[i]='\0';
- // Read up to the end of line excluded
- iret=fscanf(lun,"%[^\n]",line);
- if(iret<0) {
- //End of file
- fclose(lun);
- if(fDebug){
- printf(" *%59s\n","*");
- printf(" "); for(i=0;i<60;i++) printf("*"); printf("\n");
- }
- return;
- }
- // Read the end of line
- fscanf(lun,"%*c");
- if(!iret) continue;
- if(line[0]=='*') continue;
- // Read the numbers
- iret=sscanf(line,"%s %d %f %f %f %f %f %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %d",
- detName,&itmed,&cut[0],&cut[1],&cut[2],&cut[3],&cut[4],&cut[5],&cut[6],&cut[7],&cut[8],
- &cut[9],&flag[0],&flag[1],&flag[2],&flag[3],&flag[4],&flag[5],&flag[6],&flag[7],
- &flag[8],&flag[9],&flag[10]);
- if(!iret) continue;
- if(iret<0) {
- //reading error
- Warning("ReadTransPar","Error reading file %s\n",fTransParName.Data());
- continue;
- }
- // Check that the module exist
- AliModule *mod = GetModule(detName);
- if(mod) {
- // Get the array of media numbers
- TArrayI &idtmed = *mod->GetIdtmed();
- // Check that the tracking medium code is valid
- if(0<=itmed && itmed < 100) {
- ktmed=idtmed[itmed];
- if(!ktmed) {
- Warning("ReadTransPar","Invalid tracking medium code %d for %s\n",itmed,mod->GetName());
- continue;
- }
- // Set energy thresholds
- for(kz=0;kz<kncuts;kz++) {
- if(cut[kz]>=0) {
- if(fDebug) printf(" * %-6s set to %10.3E for tracking medium code %4d for %s\n",
- kpars[kz],cut[kz],itmed,mod->GetName());
- gMC->Gstpar(ktmed,kpars[kz],cut[kz]);
- }
- }
- // Set transport mechanisms
- for(kz=0;kz<knflags;kz++) {
- if(flag[kz]>=0) {
- if(fDebug) printf(" * %-6s set to %10d for tracking medium code %4d for %s\n",
- kpars[kncuts+kz],flag[kz],itmed,mod->GetName());
- gMC->Gstpar(ktmed,kpars[kncuts+kz],Float_t(flag[kz]));
- }
- }
- } else {
- Warning("ReadTransPar","Invalid medium code %d *\n",itmed);
- continue;
- }
- } else {
- if(fDebug) printf("%s::ReadTransParModule: %s not present\n",ClassName(),detName);
- continue;
- }
- }
-}
-//_____________________________________________________________________________
-
-void AliRun::BeginEvent()
-{
- //
- // Clean-up previous event
- // Energy scores
- if (GetDebug())
- {
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent"," BEGINNING EVENT ");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- Info("BeginEvent",">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
- }
-
- /*******************************/
- /* Clean after eventual */
- /* previous event */
- /*******************************/
-
-
- //Set the next event in Run Loader -> Cleans trees (TreeK and all trees in detectors),
- fRunLoader->SetEventNumber(++fEventNrInRun);// sets new files, cleans the previous event stuff, if necessary, etc.,
- if (GetDebug()) Info("BeginEvent","EventNr is %d",fEventNrInRun);
-
- fEventEnergy.Reset();
- // Clean detector information
-
- if (fRunLoader->Stack())
- fRunLoader->Stack()->Reset();//clean stack -> tree is unloaded
- else
- fRunLoader->MakeStack();//or make a new one
-
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(K)");
- fRunLoader->MakeTree("K");
- if (GetDebug()) Info("BeginEvent"," gMC->SetStack(fRunLoader->Stack())");
- gMC->SetStack(fRunLoader->Stack());//Was in InitMC - but was moved here
- //because we don't have guarantee that
- //stack pointer is not going to change from event to event
- //since it bellobgs to header and is obtained via RunLoader
- //
- // Reset all Detectors & kinematics & make/reset trees
- //
-
- fRunLoader->GetHeader()->Reset(fRun,fEvent,fEventNrInRun);
-// fRunLoader->WriteKinematics("OVERWRITE"); is there any reason to rewrite here since MakeTree does so
-
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTrackRefsContainer()");
- fRunLoader->MakeTrackRefsContainer();//for insurance
-
- if (GetDebug()) Info("BeginEvent"," ResetHits()");
- ResetHits();
- if (GetDebug()) Info("BeginEvent"," fRunLoader->MakeTree(H)");
- fRunLoader->MakeTree("H");
-
- //
- if(fLego)
- {
- fLego->BeginEvent();
- return;
- }
-
- //create new branches and SetAdresses
- TIter next(fModules);
- AliModule *detector;
- while((detector = (AliModule*)next()))
- {
- if (GetDebug()) Info("BeginEvent"," %s->MakeBranch(H)",detector->GetName());
- detector->MakeBranch("H");
- if (GetDebug()) Info("BeginEvent"," %s->MakeBranchTR()",detector->GetName());
- detector->MakeBranchTR();
- if (GetDebug()) Info("BeginEvent"," %s->SetTreeAddress()",detector->GetName());
- detector->SetTreeAddress();
- }
- // make branch for AliRun track References
- TTree * treeTR = fRunLoader->TreeTR();
- if (treeTR){
- // make branch for central track references
- if (!fTrackReferences) fTrackReferences = new TClonesArray("AliTrackReference",0);
- TBranch *branch;
- branch = treeTR->Branch("AliRun",&fTrackReferences);
- branch->SetAddress(&fTrackReferences);
- }
- //
-}
-
-//_______________________________________________________________________
-TParticle* AliRun::Particle(Int_t i) const
-{
- if (fRunLoader)
- if (fRunLoader->Stack())
- return fRunLoader->Stack()->Particle(i);
- return 0x0;
-}
-
//_______________________________________________________________________
void AliRun::ResetDigits()
{
}
}
-//_______________________________________________________________________
-void AliRun::ResetHits()
-{
- //
- // Reset all Detectors hits
- //
- TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next()))) {
- detector->ResetHits();
- }
-}
-//_______________________________________________________________________
-
-void AliRun::AddTrackReference(Int_t label){
- //
- // add a trackrefernce to the list
- if (!fTrackReferences) {
- cerr<<"Container trackrefernce not active\n";
- return;
- }
- Int_t nref = fTrackReferences->GetEntriesFast();
- TClonesArray &lref = *fTrackReferences;
- new(lref[nref]) AliTrackReference(label);
-}
-
-
-
-void AliRun::ResetTrackReferences()
-{
- //
- // Reset all references
- //
- if (fTrackReferences) fTrackReferences->Clear();
-
- TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next()))) {
- detector->ResetTrackReferences();
- }
-}
-
-void AliRun::RemapTrackReferencesIDs(Int_t *map)
-{
- //
- // Remapping track reference
- // Called at finish primary
- //
- if (!fTrackReferences) return;
- for (Int_t i=0;i<fTrackReferences->GetEntries();i++){
- AliTrackReference * ref = dynamic_cast<AliTrackReference*>(fTrackReferences->UncheckedAt(i));
- if (ref) {
- Int_t newID = map[ref->GetTrack()];
- if (newID>=0) ref->SetTrack(newID);
- else {
- //ref->SetTrack(-1);
- ref->SetBit(kNotDeleted,kFALSE);
- fTrackReferences->RemoveAt(i);
- }
- }
- }
- fTrackReferences->Compress();
-}
-
-
//_______________________________________________________________________
void AliRun::InitMC(const char *setup)
{
//
- // Initialize the Alice setup
+ // Initialize ALICE Simulation run
//
Announce();
return;
}
+ fMCApp=new AliMC(GetName(),GetTitle());
+
gROOT->LoadMacro(setup);
gInterpreter->ProcessLine(fConfigFunction.Data());
- // Register MC in configuration
- AliConfig::Instance()->Add(gMC);
-
InitLoaders();
fRunLoader->MakeTree("E");
fRunLoader->CdGAFile();
- gMC->DefineParticles(); //Create standard MC particles
AliPDG::AddParticlesToPdgDataBase();
- TObject *objfirst, *objlast;
-
fNdets = fModules->GetLast()+1;
//
- //=================Create Materials and geometry
- gMC->Init();
// Added also after in case of interactive initialisation of modules
fNdets = fModules->GetLast()+1;
TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next())))
+ for(Int_t i=0; i<fNdets; ++i)
{
+ TObject *objfirst, *objlast;
+ AliModule *detector=dynamic_cast<AliModule*>(fModules->At(i));
objlast = gDirectory->GetList()->Last();
// Add Detector histograms in Detector list of histograms
objfirst = gDirectory->GetList()->After(objfirst);
}
}
- ReadTransPar(); //Read the cuts for all materials
-
- MediaTable(); //Build the special IMEDIA table
-
- //Initialise geometry deposition table
- fEventEnergy.Set(gMC->NofVolumes()+1);
- fSummEnergy.Set(gMC->NofVolumes()+1);
- fSum2Energy.Set(gMC->NofVolumes()+1);
- //Compute cross-sections
- gMC->BuildPhysics();
-
- //Write Geometry object to current file.
- fRunLoader->WriteGeometry();
+ fMCApp->Init();
fInitDone = kTRUE;
- fMCQA = new AliMCQA(fNdets);
-
//
// Save stuff at the beginning of the file to avoid file corruption
Write();
// check if initialisation has been done
if (!fInitDone) InitMC(setup);
- // Save current generator
- AliGenerator *gen=Generator();
+ //Save current generator
+ AliGenerator *gen=fMCApp->Generator();
// If runloader has been initialized, set the number of events per file to nc1 * nc2
if (fRunLoader) fRunLoader->SetNumberOfEventsPerFile(nc1 * nc2);
+
// Set new generator
if (!gener) gener = new AliLegoGenerator();
- ResetGenerator(gener);
+ fMCApp->ResetGenerator(gener);
//
// Configure Generator
gener->SetRadiusRange(rmin, rmax);
// End of this run, close files
FinishRun();
// Restore current generator
- ResetGenerator(gen);
+ fMCApp->ResetGenerator(gen);
// Delete Lego Object
delete fLego; fLego=0;
}
fConfigFunction=config;
}
-//_______________________________________________________________________
-void AliRun::SetCurrentTrack(Int_t track)
-{
- //
- // Set current track number
- //
- fRunLoader->Stack()->SetCurrentTrack(track);
-}
-
-//_______________________________________________________________________
-void AliRun::PushTrack(Int_t done, Int_t parent, Int_t pdg, Float_t *pmom,
- Float_t *vpos, Float_t *polar, Float_t tof,
- TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
-{
-// Delegate to stack
-//
- fRunLoader->Stack()->PushTrack(done, parent, pdg, pmom, vpos, polar, tof,
- mech, ntr, weight, is);
-}
-
-//_______________________________________________________________________
-void AliRun::PushTrack(Int_t done, Int_t parent, Int_t pdg,
- Double_t px, Double_t py, Double_t pz, Double_t e,
- Double_t vx, Double_t vy, Double_t vz, Double_t tof,
- Double_t polx, Double_t poly, Double_t polz,
- TMCProcess mech, Int_t &ntr, Float_t weight, Int_t is)
-{
- // Delegate to stack
- //
- fRunLoader->Stack()->PushTrack(done, parent, pdg, px, py, pz, e, vx, vy, vz, tof,
- polx, poly, polz, mech, ntr, weight, is);
-}
-
-//_______________________________________________________________________
-void AliRun::SetHighWaterMark(const Int_t nt)
-{
- //
- // Set high water mark for last track in event
- fRunLoader->Stack()->SetHighWaterMark(nt);
-}
-
-//_______________________________________________________________________
-void AliRun::KeepTrack(const Int_t track)
-{
- //
- // Delegate to stack
- //
- fRunLoader->Stack()->KeepTrack(track);
-}
-
//
// MC Application
//
-//_______________________________________________________________________
-void AliRun::ConstructGeometry()
-{
- //
- // Create modules, materials, geometry
- //
-
- TStopwatch stw;
- TIter next(fModules);
- AliModule *detector;
- if (GetDebug()) Info("ConstructGeometry","Geometry creation:");
- while((detector = dynamic_cast<AliModule*>(next()))) {
- stw.Start();
- // Initialise detector materials and geometry
- detector->CreateMaterials();
- detector->CreateGeometry();
- printf("%10s R:%.2fs C:%.2fs\n",
- detector->GetName(),stw.RealTime(),stw.CpuTime());
- }
-}
-
-//_______________________________________________________________________
-void AliRun::InitGeometry()
-{
- //
- // Initialize detectors and display geometry
- //
-
- printf("Initialisation:\n");
- TStopwatch stw;
- TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next()))) {
- stw.Start();
- // Initialise detector and display geometry
- detector->Init();
- detector->BuildGeometry();
- printf("%10s R:%.2fs C:%.2fs\n",
- detector->GetName(),stw.RealTime(),stw.CpuTime());
- }
-
-}
-//_______________________________________________________________________
-
-void AliRun::GeneratePrimaries()
-{
- //
- // Generate primary particles and fill them in the stack.
- //
-
- Generator()->Generate();
-}
-//_______________________________________________________________________
-
-void AliRun::BeginPrimary()
-{
- //
- // Called at the beginning of each primary track
- //
-
- // Reset Hits info
- gAlice->ResetHits();
- gAlice->ResetTrackReferences();
-
-}
-
-//_______________________________________________________________________
-void AliRun::PreTrack()
-{
- TObjArray &dets = *fModules;
- AliModule *module;
-
- for(Int_t i=0; i<=fNdets; i++)
- if((module = dynamic_cast<AliModule*>(dets[i])))
- module->PreTrack();
-
- fMCQA->PreTrack();
-}
-
-//_______________________________________________________________________
-void AliRun::Stepping()
-{
- //
- // Called at every step during transport
- //
-
- Int_t id = DetFromMate(gMC->GetMedium());
-
- if (id < 0) return;
-
- //
- // --- If lego option, do it and leave
- if (fLego)
- fLego->StepManager();
- else {
- Int_t copy;
- //Update energy deposition tables
- AddEnergyDeposit(gMC->CurrentVolID(copy),gMC->Edep());
- //
- // write tracke reference for track which is dissapearing - MI
- if (gMC->IsTrackDisappeared()) {
- if (gMC->Etot()>0.05) AddTrackReference(GetCurrentTrackNumber());
- }
-
- //Call the appropriate stepping routine;
- AliModule *det = dynamic_cast<AliModule*>(fModules->At(id));
- if(det && det->StepManagerIsEnabled()) {
- fMCQA->StepManager(id);
- det->StepManager();
- }
- }
-}
-
-//_______________________________________________________________________
-void AliRun::PostTrack()
-{
- TObjArray &dets = *fModules;
- AliModule *module;
-
- for(Int_t i=0; i<=fNdets; i++)
- if((module = dynamic_cast<AliModule*>(dets[i])))
- module->PostTrack();
-}
-
-//_______________________________________________________________________
-void AliRun::FinishPrimary()
-{
- //
- // Called at the end of each primary track
- //
-
- // static Int_t count=0;
- // const Int_t times=10;
- // This primary is finished, purify stack
- fRunLoader->Stack()->PurifyKine();
-
- TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next()))) {
- detector->FinishPrimary();
- if(detector->GetLoader())
- {
- detector->GetLoader()->TreeH()->Fill();
- }
- }
-
- // Write out track references if any
- if (fRunLoader->TreeTR())
- {
- fRunLoader->TreeTR()->Fill();
- }
-}
-
-//_______________________________________________________________________
-void AliRun::FinishEvent()
-{
- //
- // Called at the end of the event.
- //
-
- //
- if(fLego) fLego->FinishEvent();
-
- TIter next(fModules);
- AliModule *detector;
- while((detector = dynamic_cast<AliModule*>(next()))) {
- detector->FinishEvent();
- }
-
- //Update the energy deposit tables
- Int_t i;
- for(i=0;i<fEventEnergy.GetSize();i++)
- {
- fSummEnergy[i]+=fEventEnergy[i];
- fSum2Energy[i]+=fEventEnergy[i]*fEventEnergy[i];
- }
-
- AliHeader* header = fRunLoader->GetHeader();
- AliStack* stack = fRunLoader->Stack();
- if ( (header == 0x0) || (stack == 0x0) )
- {//check if we got header and stack. If not cry and exit aliroot
- Fatal("AliRun","Can not get the stack or header from LOADER");
- return;//never reached
- }
- // Update Header information
- header->SetNprimary(stack->GetNprimary());
- header->SetNtrack(stack->GetNtrack());
-
-
- // Write out the kinematics
- stack->FinishEvent();
-
- // Write out the event Header information
- TTree* treeE = fRunLoader->TreeE();
- if (treeE)
- {
- header->SetStack(stack);
- treeE->Fill();
- }
- else
- {
- Error("FinishEvent","Can not get TreeE from RL");
- }
-
- fRunLoader->WriteKinematics("OVERWRITE");
- fRunLoader->WriteTrackRefs("OVERWRITE");
- fRunLoader->WriteHits("OVERWRITE");
-
- if (GetDebug())
- {
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent"," FINISHING EVENT ");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- Info("FinishEvent","<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
- }
-}
-
//_______________________________________________________________________
void AliRun::Field(const Double_t* x, Double_t *b) const
{
//_______________________________________________________________________
-Int_t AliRun::GetCurrentTrackNumber() const {
- //
- // Returns current track
- //
- return fRunLoader->Stack()->GetCurrentTrackNumber();
-}
-
-//_______________________________________________________________________
-Int_t AliRun::GetNtrack() const {
- //
- // Returns number of tracks in stack
- //
- return fRunLoader->Stack()->GetNtrack();
-}
-//_______________________________________________________________________
-
-//_______________________________________________________________________
-TObjArray* AliRun::Particles() const {
- //
- // Returns pointer to Particles array
- //
- if (fRunLoader)
- if (fRunLoader->Stack())
- return fRunLoader->Stack()->Particles();
- return 0x0;
-}
-
-//___________________________________________________________________________
//_______________________________________________________________________
void AliRun::SetGenEventHeader(AliGenEventHeader* header)
/* $Id$ */
-#include <TArrayF.h>
-#include <TArrayI.h>
-#include <TClonesArray.h>
#include <TMCProcess.h>
#include <TStopwatch.h>
-#include <TVirtualMCApplication.h>
-#include <TVirtualMC.h>
#include <TError.h>
-class TBranch;
-class TBrowser;
-class TDatabasePDG;
-class TFile;
class TGeometry;
-class TList;
class TParticle;
class TRandom;
class TTree;
#include "AliRunLoader.h"
-class AliDetector;
class AliDisplay;
class AliGenEventHeader;
class AliGenerator;
class AliHeader;
class AliLego;
class AliLegoGenerator;
-class AliLegoGenerator;
-class AliMCQA;
+class AliMC;
class AliMagF;
-class AliModule;
class AliStack;
-class AliTrackReference;
-
enum {kKeepBit=1, kDaughtersBit=2, kDoneBit=4};
-
-class AliRun : public TVirtualMCApplication {
+class AliRun : public TNamed {
public:
// Creators - distructors
AliRun();
AliRun& operator = (const AliRun &arun)
{arun.Copy(*this); return (*this);}
- virtual void AddHit(Int_t id, Int_t track, Int_t *vol, Float_t *hits) const;
- virtual void AddDigit(Int_t id, Int_t *tracks, Int_t *digits) const;
- virtual void AddHitList(TCollection *hitList) {fHitLists->Add(hitList);}
- virtual void Browse(TBrowser *b);
virtual void Build();
virtual void BuildSimpleGeometry();
virtual void CleanDetectors();
TObjArray *Detectors() const {return fModules;}
TObjArray *Modules() const {return fModules;}
- Int_t GetCurrentTrackNumber() const;
AliDisplay *Display() const { return fDisplay;}
- virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) const;
- virtual void DumpPart (Int_t i) const;
- virtual void DumpPStack () const;
virtual AliMagF *Field() const {return fField;}
virtual void FinishRun();
- virtual void FlagTrack(Int_t track);
- void AddEnergyDeposit(Int_t id, Float_t edep)
- {fEventEnergy[id]+=edep;}
void AddModule(AliModule* mod);
Int_t GetEvNumber() const;
Int_t GetRunNumber() const {return fRun;}
void SetEventNrInRun(Int_t event) {fEventNrInRun=event;}
Int_t GetEventNrInRun() const {return fEventNrInRun;}
Int_t GetEventsPerRun() const {return fEventsPerRun;}
+ Int_t GetNdets() const {return fNdets;}
Int_t GetDebug() const {return fDebug;}
AliModule *GetModule(const char *name) const;
- TList* GetHitLists() const {return fHitLists ;}
AliDetector *GetDetector(const char *name) const;
- AliMCQA *GetMCQA() const {return fMCQA;}
Int_t GetModuleID(const char *name) const;
virtual const char *GetBaseFile() const
{return fBaseFileName.Data();}
{return fConfigFunction.Data();}
TGeometry *GetGeometry();
virtual void SetGenEventHeader(AliGenEventHeader* header);
- Int_t GetNtrack() const;
- virtual Int_t GetPrimary(Int_t track) const;
+ AliMC* GetMCApp() const {return fMCApp;}
virtual void Hits2Digits(const char *detector=0);
virtual void Hits2SDigits(const char *detector=0) {Tree2Tree("S",detector);}
virtual void SDigits2Digits(const char *detector=0) {Tree2Tree("D",detector);}
Bool_t IsFolder() const {return kTRUE;}
virtual AliLego* Lego() const {return fLego;}
- TObjArray *Particles() const;
- TParticle *Particle(Int_t i) const;
virtual void ResetDigits();
virtual void ResetSDigits();
- virtual void ResetHits();
-// Track reference related
- virtual void AddTrackReference(Int_t label);
- TClonesArray *TrackReferences() const {return fTrackReferences;}
- virtual void RemapTrackReferencesIDs(Int_t *map); //remaping track references MI
- virtual void ResetTrackReferences();
-
virtual void ResetPoints();
- virtual void SetTransPar(const char *filename="$(ALICE_ROOT)/data/galice.cuts");
virtual void SetBaseFile(const char *filename="galice.root");
- virtual void ReadTransPar();
virtual void RunMC(Int_t nevent=1, const char *setup="Config.C");
virtual void Run(Int_t nevent=1, const char *setup="Config.C") {RunMC(nevent,setup);}
virtual void RunLego(const char *setup="Config.C",Int_t nc1=60,Float_t c1min=2,Float_t c1max=178,
Float_t rmax=430,Float_t zmax=10000, AliLegoGenerator* gener=NULL);
virtual Bool_t IsLegoRun() const {return (fLego!=0);}
virtual void RunReco(const char *detector=0, Int_t first = 0, Int_t last = 0);
- virtual void SetCurrentTrack(Int_t track);
virtual void SetDebug(const Int_t level=0) {fDebug = level;}
virtual void SetDisplay(AliDisplay *display) {fDisplay = display;}
virtual void SetField(Int_t type=2, Int_t version=1, Float_t scale=1, Float_t maxField=10, char*filename="$(ALICE_ROOT)/data/field01.dat");
virtual void SetField(AliMagF* magField);
- virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
- Float_t *pmom, Float_t *vpos, Float_t *polar,
- Float_t tof, TMCProcess mech, Int_t &ntr,
- Float_t weight = 1, Int_t is = 0);
- virtual void PushTrack(Int_t done, Int_t parent, Int_t pdg,
- Double_t px, Double_t py, Double_t pz, Double_t e,
- Double_t vx, Double_t vy, Double_t vz, Double_t tof,
- Double_t polx, Double_t poly, Double_t polz,
- TMCProcess mech, Int_t &ntr, Float_t weight=1,
- Int_t is = 0);
- virtual void SetHighWaterMark(const Int_t nt);
-
- virtual void KeepTrack(const Int_t itra);
- virtual void MediaTable();
- virtual void TrackingLimits( Float_t rmax=1.e10, Float_t zmax=1.e10) {fTrRmax=rmax; fTrZmax=zmax;}
- virtual Int_t DetFromMate(Int_t i) const { return (*fImedia)[i];}
- virtual AliGenerator* Generator() const {return fGenerator;}
- virtual void SetGenerator(AliGenerator *generator);
- virtual void ResetGenerator(AliGenerator *generator);
- virtual void EnergySummary();
virtual TDatabasePDG* PDGDB() const {return fPDGDB;}
- // MC Application
- //
- virtual void ConstructGeometry();
- virtual void InitGeometry();
- virtual void GeneratePrimaries();
- virtual void BeginEvent();
- virtual void BeginPrimary();
- virtual void PreTrack();
- virtual void Stepping();
- virtual void PostTrack();
- virtual void FinishPrimary();
- virtual void FinishEvent();
- virtual Double_t TrackingZmax() const {return fTrZmax;}
- virtual Double_t TrackingRmax() const {return fTrRmax;}
virtual void Field(const Double_t* x, Double_t* b) const;
+
+ // Delegations
+ virtual void ResetHits();
+ virtual AliGenerator* Generator() const;
//
// End of MC Application
Int_t fDebug; // Debug flag
TObjArray *fModules; // List of Detectors
TGeometry *fGeometry; // Pointer to geometry
+ AliMC *fMCApp; // Pointer to virtual MC Application
AliDisplay *fDisplay; //! Pointer to event display
TStopwatch fTimer; // Timer object
AliMagF *fField; // Magnetic Field Map
TVirtualMC *fMC; //! Pointer to MonteCarlo object
- TArrayI *fImedia; //! Array of correspondence between media and detectors
Int_t fNdets; // Number of detectors
- Float_t fTrRmax; // Maximum radius for tracking
- Float_t fTrZmax; // Maximu z for tracking
- AliGenerator *fGenerator; // Generator used in the MC
Bool_t fInitDone; //! True when initialisation done
AliLego *fLego; //! Pointer to aliLego object if it exists
TDatabasePDG *fPDGDB; // Particle factory object
- TList *fHitLists; //! Lists of hits to be remapped by PurifyKine
- TArrayF fEventEnergy; //! Energy deposit for current event
- TArrayF fSummEnergy; //! Energy per event in each volume
- TArrayF fSum2Energy; //! Energy squared per event in each volume
TString fConfigFunction; // Configuration file to be executed
TRandom *fRandom; // Pointer to the random number generator
- AliMCQA *fMCQA; // Pointer to MC Quality assurance class
- TString fTransParName; // Name of the transport parameters file
TString fBaseFileName; // Name of the base root file
- TClonesArray *fTrackReferences; //!list of track references - for one primary track only -MI
AliRunLoader *fRunLoader; //!run getter - written as a separate object
private:
void Copy(AliRun &arun) const;
#include "AliHit.h"
#include "AliModule.h"
#include "AliRun.h"
+#include "AliMC.h"
#include "AliRunLoader.h"
#include "AliStack.h"
}
// Now loop on all registered hit lists
- TList* hitLists = gAlice->GetHitLists();
+ TList* hitLists = gAlice->GetMCApp()->GetHitLists();
TIter next(hitLists);
TCollection *hitList;
while((hitList = dynamic_cast<TCollection*>(next()))) {
detector->RemapTrackReferencesIDs(map.GetArray());
}
//
- gAlice->RemapTrackReferencesIDs(map.GetArray());
+ gAlice->GetMCApp()->RemapTrackReferencesIDs(map.GetArray());
// Now the output bit, from fHgwmk to nkeep we write everything and we erase
if(nkeep>fParticleFileMap.GetSize()) fParticleFileMap.Set(Int_t (nkeep*1.5));
#pragma link C++ class AliCollisionGeometry+;
#pragma link C++ class AliMemoryWatcher+;
#pragma link C++ class AliBarrelTrack+;
+#pragma link C++ class AliMC+;
#endif
AliGausCorr.cxx AliTrackReference.cxx AliESD.cxx \
AliTrackMap.cxx AliTrackMapper.cxx AliCollisionGeometry.cxx \
AliMemoryWatcher.cxx AliBarrelTrack.cxx \
-AliESDtrack.cxx AliESDv0.cxx AliESDcascade.cxx AliESDvertex.cxx AliESDpid.cxx
+AliESDtrack.cxx AliESDv0.cxx AliESDcascade.cxx AliESDvertex.cxx AliESDpid.cxx \
+AliMC.cxx
HDRS:= $(SRCS:.cxx=.h)
DHDR= STEERLinkDef.h
#include "AliFRAMEv0.h"
#include "AliRun.h"
#include "TSystem.h"
+#include <TVirtualMC.h>
ClassImp(AliFRAMEv0)
//-------------------------------------------------------------------------
#include <TSystem.h>
+#include <TVirtualMC.h>
#include "AliFRAMEv1.h"
#include "AliRun.h"
//------------------------------------------------------------------------
#include <TSystem.h>
+#include <TVirtualMC.h>
#include "AliFRAMEv2.h"
#include "AliMagF.h"
#include "AliRun.h"
#include "AliConst.h"
+#include "AliMC.h"
ClassImp(AliFRAMEv2)
//
// Add the reference track
//
- AddTrackReference(gAlice->GetCurrentTrackNumber());
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
}
// Author: A.Morsch
//-------------------------------------------------------------------------
+#include <TVirtualMC.h>
+#include <TArrayI.h>
+
#include "AliSHILv2.h"
-#include "AliRun.h"
#include "AliConst.h"
#include "AliALIFE.h"
// Author: A.Morsch
//-------------------------------------------------------------------------
+#include <TVirtualMC.h>
+#include <TArrayI.h>
+
#include "AliSHILvF.h"
-#include "AliRun.h"
#include "AliConst.h"
#include "AliALIFE.h"
#include "THerwig6.h"
#include "Riostream.h"
+#include "AliMC.h"
ClassImp(AliGenHerwig)
Float_t tof = kconv*iparticle->T();
Int_t iparent = (imo > -1) ? newPos[imo] : -1;
Int_t trackIt = (ks == 1) && fTrackIt;
- gAlice->PushTrack(trackIt, iparent, kf,
+ gAlice->GetMCApp()->PushTrack(trackIt, iparent, kf,
p[0], p[1], p[2], p[3],
origin[0], origin[1], origin[2],
tof,
{
// Adjust the weights after generation of all events
TParticle *part;
- Int_t ntrack=gAlice->GetNtrack();
+ Int_t ntrack=gAlice->GetMCApp()->GetNtrack();
for (Int_t i=0; i<ntrack; i++) {
- part= gAlice->Particle(i);
+ part= gAlice->GetMCApp()->Particle(i);
part->SetWeight(part->GetWeight()*fKineBias);
}
}
#include "AliTOFdigit.h"
#include "AliTOFhit.h"
#include "AliTOFhitT0.h"
+#include "AliMC.h"
ClassImp(AliTOF)
if (gAlice==0) {
Fatal("AliTOF","gAlice==0 !");
}
- if (gAlice->GetHitLists())
- gAlice->AddHitList(fHits);
+ if (gAlice->GetMCApp()->GetHitLists())
+ gAlice->GetMCApp()->AddHitList(fHits);
else Error("AliTOF","gAlice->GetHitLists()==0");
fIshunt = 0;
#include "AliTOFv3.h"
#include "AliTOFv4.h"
#include "AliTOFv4T0.h"
+#include "AliMC.h"
// #include "../TPC/AliTPC.h"
// AliTPChit class or somewhere
ipart = tofHit->GetTrack();
if(ipart>=fMaxAllTracks) break;
Float_t geantTime= tofHit->GetTof(); // it is given in [s]
- particle = (TParticle*)gAlice->Particle(ipart);
+ particle = (TParticle*)gAlice->GetMCApp()->Particle(ipart);
Int_t pdgCode=particle->GetPdgCode();
// Only high momentum tracks (see fPBound value)
//Test
if(PRINT) {
if(iTOFpixel[ipart] && match!=3) {
- particle = (TParticle*)gAlice->Particle(ipart); //for V3.05
+ particle = (TParticle*)gAlice->GetMCApp()->Particle(ipart); //for V3.05
printf(" ipixel=%i (Sector=%i, Plate=%i, Strip=%i, Pixel=%i), fired by %i track\n",iTOFpixel[ipart],
pixelArray[iTOFpixel[ipart]-1].GetSector(),pixelArray[iTOFpixel[ipart]-1].GetPlate(),
cout << "particle " << i << endl;
cout << "total " << numberOfParticles << endl;
*/
- TParticle *part = (TParticle *) gAlice->Particle(i);
+ TParticle *part = (TParticle *) gAlice->GetMCApp()->Particle(i);
if(charge[PDGtoGeantCode(part->GetPdgCode())-1]) {
icharge++;
/*
#include "AliTOFTrackV2.h"
#include "AliTOFdigit.h"
#include "AliTOFhitT0.h"
+#include "AliMC.h"
ClassImp(AliTOFReconstructionerV2)
if(ipart >= 80000) continue;
if(rtIndex[ipart] < 0) continue;
- TParticle *part = gAlice->Particle(ipart);
+ TParticle *part = gAlice->GetMCApp()->Particle(ipart);
// get first the pdg code
Int_t pdgCode=part->GetPdgCode();
#include "AliTOFv2.h"
#include "AliTOFv3.h"
#include "AliTOFv4.h"
+#include "AliMC.h"
ClassImp(AliTOFSDigitizer)
gAlice->ResetHits();
//PH TH->GetEvent(track);
tofHitsBranch->GetEvent(track);
- particle = gAlice->Particle(track);
+ particle = gAlice->GetMCApp()->Particle(track);
Int_t nhits = TOFhits->GetEntriesFast();
// cleaning all hits of the same track in the same pad volume
// it is a rare event, however it happens
#include "AliTOFT0.h"
#include "AliTOFhitT0.h"
#include "AliTOFv4T0.h"
+#include "AliMC.h"
ClassImp(AliTOFT0)
gAlice->ResetHits();
TH->GetEvent(track);
- particle = gAlice->Particle(track);
+ particle = gAlice->GetMCApp()->Particle(track);
Int_t nhits = TOFhits->GetEntriesFast();
for (Int_t hit = 0; hit < nhits; hit++)
if (ipart != ipartold){
- particle = (TParticle*)gAlice->Particle(ipart);
+ particle = (TParticle*)gAlice->GetMCApp()->Particle(ipart);
Float_t idealtime=tofHit->GetTof();
// Float_t time=idealtime;
#include "AliRun.h"
#include "AliTOFv0.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv0)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv1.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv1)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv2.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv2)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv2FHoles.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv2FHoles)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv3.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv3)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv4.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv4)
vol[3]= padx;
vol[4]= padz;
- AddHit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliRun.h"
#include "AliTOFv4T0.h"
#include "AliTOFConstants.h" // AdC
+#include "AliMC.h"
ClassImp(AliTOFv4T0)
vol[3]= padx;
vol[4]= padz;
- AddT0Hit(gAlice->GetCurrentTrackNumber(),vol, hits);
+ AddT0Hit(gAlice->GetMCApp()->GetCurrentTrackNumber(),vol, hits);
}
}
#include "AliTPCTrackHitsV2.h"
#include "AliTPCcluster.h"
#include "AliTrackReference.h"
+#include "AliMC.h"
ClassImp(AliTPC)
//
// Initialise arrays of hits and digits
fHits = new TClonesArray("AliTPChit", 176);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
fDigitsArray = 0;
fClustersArray= 0;
fDefaults = 0;
continue;
}
ipart=tpcHit->Track();
- particle=gAlice->Particle(ipart);
+ particle=gAlice->GetMCApp()->Particle(ipart);
pl=particle->Pz();
pt=particle->Pt();
if(pt < 1.e-9) pt=1.e-9;
SetTreeAddress();
Stat_t ntracks = tH->GetEntries();
- Int_t npart = gAlice->GetNtrack();
+ Int_t npart = gAlice->GetMCApp()->GetNtrack();
//MI change
TBranch * branch=0;
if (fHitType>1) branch = tH->GetBranch("TPC2");
}
ipart=tpcHit->Track();
- if (ipart<npart) particle=gAlice->Particle(ipart);
+ if (ipart<npart) particle=gAlice->GetMCApp()->Particle(ipart);
//find row number
// add hit to the list
Int_t rtrack;
if (fIshunt) {
- int primary = gAlice->GetPrimary(track);
- gAlice->Particle(primary)->SetBit(kKeepBit);
+ int primary = gAlice->GetMCApp()->GetPrimary(track);
+ gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
rtrack=primary;
} else {
rtrack=track;
- gAlice->FlagTrack(track);
+ gAlice->GetMCApp()->FlagTrack(track);
}
//AliTPChit *hit = (AliTPChit*)fHits->UncheckedAt(fNhits-1);
//if (hit->fTrack!=rtrack)
if (fHitType&2) nhits = fTrackHitsOld->GetEntriesFast();
if (nhits == 0) return;
- Int_t tracks = gAlice->GetNtrack();
+ Int_t tracks = gAlice->GetMCApp()->GetNtrack();
if (fPoints == 0) fPoints = new TObjArray(tracks);
AliHit *ahit;
//
//
Int_t nhits = fTrackHits->GetEntriesFast();
if (nhits == 0) return;
- Int_t tracks = gAlice->GetNtrack();
+ Int_t tracks = gAlice->GetMCApp()->GetNtrack();
if (fPoints == 0) fPoints = new TObjArray(2*tracks);
fPoints->Expand(2*tracks);
AliHit *ahit;
#include "AliTPCtrack.h"
#include "AliTrackReference.h"
#include "AliTPCtrackerParam.h"
+#include "AliMC.h"
//-----------------------------
Double_t RegFunc(Double_t *x,Double_t *par) {
// loop on particles and store pdg codes
for(Int_t l=0; l<nParticles; l++) {
- Part = (TParticle*)gAlice->Particle(l);
+ Part = (TParticle*)gAlice->GetMCApp()->Particle(l);
pdgCodes[l] = Part->GetPdgCode();
ptkine[l] = Part->Pt();
pzkine[l] = Part->Pz();
geatree->GetEvent(j);
label = geatrack->GetLabel();
- Part = (TParticle*)gAlice->Particle(label);
+ Part = (TParticle*)gAlice->GetMCApp()->Particle(label);
// use only injected tracks with fixed values of pT
ptgener = Part->Pt();
#include "AliTPCParamSR.h"
#include "AliTPCv1.h"
#include "TLorentzVector.h"
+#include "AliMC.h"
ClassImp(AliTPCv1)
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); // M.I.
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
gMC->TrackPosition(p);
hits[0]=p[0];
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); // M.I.
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
}
hits[3]=1; //I'd like to have something positive here (I.Belikov)
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); // M.I.
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); // M.I.
}
#include "AliTPCParamSR.h"
#include "AliTPCTrackHitsV2.h"
#include "AliTPCv2.h"
+#include "AliMC.h"
ClassImp(AliTPCv2)
if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting()) &&
((id == fIdLSec) || (id == fIdUSec)) ) {
- AddTrackReference(gAlice->GetCurrentTrackNumber());
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
}
if(id == fIdLSec){
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); //MI change
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
hits[3]=0.; // this hit has no energy loss
// new(lhits[fNhits++]) AliTPChit(fIshunt,gAlice->GetCurrentTrackNumber(),vol,hits);
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); //MI change
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
else return;
Float_t precision = (momentum>0.1) ? 0.002 :0.01;
fTrackHits->SetHitPrecision(precision);
}
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); //MI change
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
#include "AliTPCParamSR.h"
#include "AliTPCTrackHitsV2.h"
#include "AliTPCv3.h"
+#include "AliMC.h"
ClassImp(AliTPCv3)
//_____________________________________________________________________________
// Add this hit
- AddHit(gAlice->GetCurrentTrackNumber(), vol,hits); //MI change
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol,hits); //MI change
}
#include "AliTRDrecPoint.h"
#include "AliTRDtrackHits.h"
#include "AliTrackReference.h"
+#include "AliMC.h"
ClassImp(AliTRD)
// Allocate the hit array
fHits = new TClonesArray("AliTRDhit" ,405);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
// Allocate the digits array
fDigits = 0;
}
if (nhits == 0) return;
- Int_t tracks = gAlice->GetNtrack();
+ Int_t tracks = gAlice->GetMCApp()->GetNtrack();
if (fPoints == 0) fPoints = new TObjArray(tracks);
AliTRDhit *ahit;
Int_t rtrack;
if (fIshunt) {
- Int_t primary = gAlice->GetPrimary(track);
- gAlice->Particle(primary)->SetBit(kKeepBit);
+ Int_t primary = gAlice->GetMCApp()->GetPrimary(track);
+ gAlice->GetMCApp()->Particle(primary)->SetBit(kKeepBit);
rtrack = primary;
}
else {
rtrack = track;
- gAlice->FlagTrack(track);
+ gAlice->GetMCApp()->FlagTrack(track);
}
if ((fTrackHits) && (fHitType > 0)) {
#include "AliTRDtrack.h"
#include "AliTRDtracker.h"
#include "AliTRDgeometry.h"
+#include "AliMC.h"
ClassImp(AliTRDpid)
}
if (accept) {
- particle = gAlice->Particle(track0);
+ particle = gAlice->GetMCApp()->Particle(track0);
if (particle->GetFirstMother() == -1) {
switch (TMath::Abs(particle->GetPdgCode())) {
case kPdgEl:
Int_t trackIndex = cluster->GetLabel(iTrack);
if (trackIndex >= 0) {
- particle = gAlice->Particle(trackIndex);
+ particle = gAlice->GetMCApp()->Particle(trackIndex);
Int_t pdgCode = particle->GetPdgCode();
Bool_t newPart = kTRUE;
for (iPart = 0; iPart < nPart; iPart++) {
#include "AliTRDsimpleGen.h"
#include "AliTRDsimpleMC.h"
+#include "AliMC.h"
ClassImp(AliTRDsimpleGen)
Float_t vtx[3] = { 0.0 };
Float_t pol[3] = { 0.0 };
Int_t ntr = 0;
- gAlice->PushTrack(0,-1,fPdg,mom,vtx,pol,0.0,kPPrimary,ntr);
+ gAlice->GetMCApp()->PushTrack(0,-1,fPdg,mom,vtx,pol,0.0,kPPrimary,ntr);
}
#include "AliTRDsimpleMC.h"
#include "AliTRDv1.h"
#include "AliTRDparameter.h"
+#include "AliMC.h"
ClassImp(AliTRDsimpleMC)
fTrackY = 0.0;
fTrackZ = 0.0;
- gAlice->SetCurrentTrack(0);
+ gAlice->GetMCApp()->SetCurrentTrack(0);
}
#include "AliTRDgeometry.h"
#include "AliTRDhit.h"
#include "AliTRDv0.h"
+#include "AliMC.h"
ClassImp(AliTRDv0)
pla = ((Int_t) idChamber % kNplan);
det = fGeometry->GetDetector(pla,cha,sec);
- AddHit(gAlice->GetCurrentTrackNumber(),det,hits,0,kTRUE);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,hits,0,kTRUE);
}
#include "AliTRDmatrix.h"
#include "AliTRDsim.h"
#include "AliTRDv1.h"
+#include "AliMC.h"
ClassImp(AliTRDv1)
// Add the hit to the array. TR photon hits are marked
// by negative charge
- AddHit(gAlice->GetCurrentTrackNumber(),det,posHit,-q,kTRUE);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,posHit,-q,kTRUE);
}
// momentum components of the particle
if (gMC->IsTrackEntering() || gMC->IsTrackExiting()) {
gMC->TrackMomentum(mom);
- AddTrackReference(gAlice->GetCurrentTrackNumber());
+ AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
}
// Create the hits from TR photons
// Create a new dEdx hit
if (drRegion) {
- AddHit(gAlice->GetCurrentTrackNumber(),det,hits,qTot,kTRUE);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,hits,qTot,kTRUE);
}
else {
- AddHit(gAlice->GetCurrentTrackNumber(),det,hits,qTot,kFALSE);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(),det,hits,qTot,kFALSE);
}
// Calculate the maximum step size for the next tracking step
#include "AliVZEROLoader.h"
#include "AliVZEROdigit.h"
#include "AliVZEROhit.h"
+#include "AliMC.h"
ClassImp(AliVZERO)
fHits = new TClonesArray("AliVZEROhit", 400);
fDigits = new TClonesArray("AliVZEROdigit",400);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
fThickness = 4.1; // total thickness of the V0R box
fThickness1 = 0.7; // thickness of the thickest cell (2.5 in version 0)
#include "AliVZEROdigit.h"
#include "AliVZEROhit.h"
#include "AliVZEROv0.h"
+#include "AliMC.h"
ClassImp(AliVZEROv0)
hits[13] = mom[2];
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
#include "AliVZEROdigit.h"
#include "AliVZEROhit.h"
#include "AliVZEROv2.h"
+#include "AliMC.h"
ClassImp(AliVZEROv2)
hits[12] = mom[1];
hits[13] = mom[2];
- TParticle *par = gAlice->Particle(gAlice->GetCurrentTrackNumber());
+ TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
hits[14] = par->Vx();
hits[15] = par->Vy();
hits[16] = par->Vz();
hits[17] = eloss;
hits[18] = tlength;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
tlength = 0.0;
eloss = 0.0;
#include "AliConst.h"
#include "AliGenZDC.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliGenZDC)
}
Float_t polar[3] = {0,0,0};
- gAlice->PushTrack(fTrackIt,-1,fIpart,fPTrack,fOrigin.GetArray(),polar,0,
+ gAlice->GetMCApp()->PushTrack(fTrackIt,-1,fIpart,fPTrack,fOrigin.GetArray(),polar,0,
kPPrimary,nt);
if(fDebugOpt == 1){
printf("\n\n Track momentum:\n");
#include "AliHeader.h"
#include "AliLoader.h"
#include "AliRun.h"
+#include "AliMC.h"
ClassImp(AliZDC)
// Allocate the hits array
fHits = new TClonesArray("AliZDCHit",1000);
- gAlice->AddHitList(fHits);
+ gAlice->GetMCApp()->AddHitList(fHits);
// Allocate the merged hits array
fMergedHits = new TClonesArray("AliZDCMergedHit",1000);
if(fNhits==0){
// First hit -> setting flag for primary or secondary particle
- Int_t primary = gAlice->GetPrimary(track);
+ Int_t primary = gAlice->GetMCApp()->GetPrimary(track);
if(track != primary){
newquad->fSFlag = 1; // SECONDARY particle entering the ZDC
}
#include "AliRun.h"
#include "AliZDCHit.h"
#include "AliZDCv1.h"
+#include "AliMC.h"
ClassImp(AliZDCv1)
// Int_t PcID = gMC->TrackPid();
// printf("Pc ID -> %d\n",PcID);
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
if(fNoShower==1){
// fpDetected += 1;
hits[9] = ekin;
hits[7] = 0.;
hits[8] = 0.;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[9] = destep;
hits[7] = 0.;
hits[8] = 0.;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
// printf(" Dep. E = %f \n",hits[9]);
}
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[7] = 0;
hits[8] = nphe; //fLightPMC
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
else if((vol[0]==2)) { // (2) ZP fibres
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[7] = 0;
hits[8] = nphe; //fLightPMC
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
else if((vol[0]==3)) { // (3) ZEM fibres
hits[7] = 0;
hits[8] = nphe; //fLightPMC
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
}
#include "AliRun.h"
#include "AliZDCHit.h"
#include "AliZDCv2.h"
+#include "AliMC.h"
ClassImp(AliZDCv2)
// Int_t PcID = gMC->TrackPid();
// printf("Pc ID -> %d\n",PcID);
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
if(fNoShower==1){
fpDetected += 1;
hits[9] = ekin;
hits[7] = 0.;
hits[8] = 0.;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[9] = destep;
hits[7] = 0.;
hits[8] = 0.;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
// printf(" Dep. E = %f \n",hits[9]);
}
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[7] = 0;
hits[8] = nphe; //fLightPMC
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
else if((vol[0]==2)) { // (2) ZP fibres
hits[7] = nphe; //fLightPMQ
hits[8] = 0;
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[7] = 0;
hits[8] = nphe; //fLightPMC
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
else if((vol[0]==3)) { // (3) ZEM fibres
hits[7] = 0;
hits[8] = nphe; //fLightPMC (ZEM1)
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
else{
hits[7] = nphe; //fLightPMQ (ZEM2)
hits[8] = 0;
hits[9] = 0;
- AddHit(gAlice->GetCurrentTrackNumber(), vol, hits);
+ AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
}
}
}