// 2. Timing signal is collected and added to hit
// --- ROOT system ---
+#include <TClonesArray.h>
#include <TParticle.h>
#include <TVirtualMC.h>
#include "AliEMCALGeometry.h"
#include "AliRun.h"
#include "AliMC.h"
+#include "AliStack.h"
ClassImp(AliEMCALv1)
//______________________________________________________________________
-AliEMCALv1::AliEMCALv1():AliEMCALv0(), fCurPrimary(-1), fCurParent(-1), fCurTrack(-1){
- // ctor
+AliEMCALv1::AliEMCALv1()
+ : AliEMCALv0(),
+ fCurPrimary(-1),
+ fCurParent(-1),
+ fCurTrack(-1),
+ fTimeCut(30e-09)
+{
+ // default ctor
}
//______________________________________________________________________
-AliEMCALv1::AliEMCALv1(const char *name, const char *title):
- AliEMCALv0(name,title), fCurPrimary(-1), fCurParent(-1), fCurTrack(-1) {
+AliEMCALv1::AliEMCALv1(const char *name, const char *title)
+ : AliEMCALv0(name,title),
+ fCurPrimary(-1),
+ fCurParent(-1),
+ fCurTrack(-1),
+ fTimeCut(30e-09)
+{
// Standard Creator.
fHits= new TClonesArray("AliEMCALHit",1000);
fNhits = 0;
fIshunt = 2; // All hits are associated with particles entering the calorimeter
- fTimeCut = 30e-09;
}
//______________________________________________________________________
// 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);
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.};
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 ;
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)
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) {
else
birkC1Mod=fBirkC1;
}
- Float_t dedxcm;
+ Float_t dedxcm=0.;
if (gMC->TrackStep()>0)
dedxcm=1000.*gMC->Edep()/gMC->TrackStep();
else
}
}
+//___________________________________________________________
void AliEMCALv1::RemapTrackHitIDs(Int_t *map) {
// remap track index numbers for primary and parent indices
// (Called by AliStack::PurifyKine)
}
}
+//___________________________________________________________
void AliEMCALv1::FinishPrimary() {
// finish primary
fCurPrimary=-1;