X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALv1.cxx;h=b34f1ecaa1c931e14425397c9e94805d348af286;hb=4e67b745f9153cfd124fbeb8dd3572928e4347d1;hp=3523a2d97196c4f28805bea5ff3e93309f95c71c;hpb=18a21c7cf1f8adfe3b24db9f599862712929b1a7;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALv1.cxx b/EMCAL/AliEMCALv1.cxx index 3523a2d9719..b34f1ecaa1c 100644 --- a/EMCAL/AliEMCALv1.cxx +++ b/EMCAL/AliEMCALv1.cxx @@ -30,6 +30,7 @@ // 2. Timing signal is collected and added to hit // --- ROOT system --- +#include #include #include @@ -41,7 +42,10 @@ #include "AliEMCALGeometry.h" #include "AliRun.h" #include "AliMC.h" +#include "AliStack.h" +using std::cout; +using std::endl; ClassImp(AliEMCALv1) @@ -57,8 +61,9 @@ AliEMCALv1::AliEMCALv1() } //______________________________________________________________________ -AliEMCALv1::AliEMCALv1(const char *name, const char *title) - : AliEMCALv0(name,title), +AliEMCALv1::AliEMCALv1(const char *name, const char *title, + const Bool_t checkGeoAndRun) + : AliEMCALv0(name,title,checkGeoAndRun), fCurPrimary(-1), fCurParent(-1), fCurTrack(-1), @@ -73,26 +78,15 @@ AliEMCALv1::AliEMCALv1(const char *name, const char *title) fIshunt = 2; // All hits are associated with particles entering the calorimeter } -//______________________________________________________________________ -AliEMCALv1::AliEMCALv1(const AliEMCALv1 & emcal) - : AliEMCALv0(emcal), - fCurPrimary(emcal.fCurPrimary), - fCurParent(emcal.fCurParent), - fCurTrack(emcal.fCurTrack), - fTimeCut(emcal.fTimeCut) -{ - //copy ctor -} - //______________________________________________________________________ AliEMCALv1::~AliEMCALv1(){ - // dtor - - if ( fHits) { - fHits->Delete(); - delete fHits; - fHits = 0; - } + // dtor + + if ( fHits ) { + fHits->Clear(); + delete fHits; + fHits = 0; + } } //______________________________________________________________________ @@ -101,10 +95,10 @@ void AliEMCALv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa // Add a hit to the hit list. // An EMCAL hit is the sum of all hits in a tower section // originating from the same entering particle - Int_t hitCounter; + Int_t hitCounter=0; - AliEMCALHit *newHit; - AliEMCALHit *curHit; + AliEMCALHit *newHit=0; + AliEMCALHit *curHit=0; Bool_t deja = kFALSE; newHit = new AliEMCALHit(shunt, primary, tracknumber, iparent, ienergy, id, hits, p); @@ -131,7 +125,7 @@ void AliEMCALv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t ipa void AliEMCALv1::StepManager(void){ // Accumulates hits as long as the track stays in a tower - Int_t id[2]; // (phi, Eta) indices + Int_t id[2]={0,0}; // (phi, Eta) indices // position wrt MRS and energy deposited Float_t xyzte[5]={0.,0.,0.,0.,0.};// position wrt MRS, time and energy deposited Float_t pmom[4]={0.,0.,0.,0.}; @@ -143,6 +137,9 @@ void AliEMCALv1::StepManager(void){ AliEMCALGeometry * geom = GetGeometry() ; + TParticle *part=0; + Int_t parent=-1; + static Int_t idXPHI = gMC->VolId("XPHI"); if(gMC->CurrentVolID(copy) == idXPHI ) { // We are in a Scintillator Layer Float_t depositedEnergy ; @@ -153,16 +150,20 @@ void AliEMCALv1::StepManager(void){ if (fCurParent==-1 || tracknumber != fCurTrack) { // Check parentage - Int_t parent=tracknumber; + //Int_t parent=tracknumber; + parent=tracknumber; if (fCurParent != -1) { while (parent != fCurParent && parent != -1) { - TParticle *part=gAlice->GetMCApp()->Particle(parent); + //TParticle *part=gAlice->GetMCApp()->Particle(parent); + part=gAlice->GetMCApp()->Particle(parent); parent=part->GetFirstMother(); } } if (fCurParent==-1 || parent==-1) { - Int_t parent=tracknumber; - TParticle *part=gAlice->GetMCApp()->Particle(parent); + //Int_t parent=tracknumber; + //TParticle *part=gAlice->GetMCApp()->Particle(parent); + parent=tracknumber; + part=gAlice->GetMCApp()->Particle(parent); while (parent != -1 && geom->IsInEMCAL(part->Vx(),part->Vy(),part->Vz())) { parent=part->GetFirstMother(); if (parent!=-1) @@ -172,7 +173,8 @@ void AliEMCALv1::StepManager(void){ if (fCurParent==-1) Error("StepManager","Cannot find parent"); else { - TParticle *part=gAlice->GetMCApp()->Particle(fCurParent); + //TParticle *part=gAlice->GetMCApp()->Particle(fCurParent); + part=gAlice->GetMCApp()->Particle(fCurParent); ienergy = part->Energy(); } while (parent != -1) { @@ -216,7 +218,7 @@ void AliEMCALv1::StepManager(void){ else birkC1Mod=fBirkC1; } - Float_t dedxcm; + Float_t dedxcm=0.; if (gMC->TrackStep()>0) dedxcm=1000.*gMC->Edep()/gMC->TrackStep(); else @@ -235,6 +237,7 @@ void AliEMCALv1::StepManager(void){ } } +//___________________________________________________________ void AliEMCALv1::RemapTrackHitIDs(Int_t *map) { // remap track index numbers for primary and parent indices // (Called by AliStack::PurifyKine) @@ -253,6 +256,7 @@ void AliEMCALv1::RemapTrackHitIDs(Int_t *map) { } } +//___________________________________________________________ void AliEMCALv1::FinishPrimary() { // finish primary fCurPrimary=-1;