From b8aa9154c4138385e0904de626e1c778bb894906 Mon Sep 17 00:00:00 2001 From: coppedis Date: Thu, 27 Mar 2014 12:53:43 +0100 Subject: [PATCH] Adding the possibility not to follow particle mothers during StepManager (default=don't follow) --- ZDC/AliZDC.cxx | 10 +++++++--- ZDC/AliZDC.h | 6 ++++-- ZDC/AliZDCv4.cxx | 52 ++++++++++++++++++++++++------------------------ 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/ZDC/AliZDC.cxx b/ZDC/AliZDC.cxx index 04db5472a97..186b2c6c05e 100644 --- a/ZDC/AliZDC.cxx +++ b/ZDC/AliZDC.cxx @@ -67,7 +67,8 @@ AliZDC::AliZDC() : fBeamEnergy(0.), fIspASystem(kFALSE), fIsRELDISgen(kFALSE), - fOnlyZEM(kFALSE) + fOnlyZEM(kFALSE), + fFindMother(kFALSE) { // // Default constructor for the Zero Degree Calorimeter base class @@ -93,7 +94,8 @@ AliZDC::AliZDC(const char *name, const char *title) : fBeamEnergy(0.), fIspASystem(kFALSE), fIsRELDISgen(kFALSE), - fOnlyZEM(kFALSE) + fOnlyZEM(kFALSE), + fFindMother(kFALSE) { // // Standard constructor for the Zero Degree Calorimeter base class @@ -137,7 +139,8 @@ fSpectatorTracked(ZDC.fSpectatorTracked), fBeamEnergy(ZDC.fBeamEnergy), fIspASystem(ZDC.fIspASystem), fIsRELDISgen(ZDC.fIsRELDISgen), -fOnlyZEM(ZDC.fOnlyZEM) +fOnlyZEM(ZDC.fOnlyZEM), +fFindMother(ZDC.fFindMother) { // copy constructor } @@ -156,6 +159,7 @@ AliZDC& AliZDC::operator=(const AliZDC& ZDC) fIspASystem = ZDC.fIspASystem; fIsRELDISgen = ZDC.fIsRELDISgen; fOnlyZEM = ZDC.fOnlyZEM; + fFindMother = fFindMother; } return *this; } diff --git a/ZDC/AliZDC.h b/ZDC/AliZDC.h index a21dec5a4ea..580723fc338 100644 --- a/ZDC/AliZDC.h +++ b/ZDC/AliZDC.h @@ -88,7 +88,8 @@ public: void SetpAsystem() {fIspASystem = kTRUE;} void SetRELDISGenerator() {fIsRELDISgen = kTRUE;} - void SetOnlyZEM() {fOnlyZEM=kTRUE;} + void SetOnlyZEM() {fOnlyZEM=kTRUE;} + void SetMotherFinding() {fFindMother=kTRUE;} private: @@ -111,8 +112,9 @@ protected: Bool_t fIsRELDISgen; // Is RELDIS used as generator Bool_t fOnlyZEM; // build only ZEM (no had. calorimeters!) + Bool_t fFindMother; // look for particle mothers in the stack in StepManager - ClassDef(AliZDC,13) // Zero Degree Calorimeter base class + ClassDef(AliZDC,14) // Zero Degree Calorimeter base class }; // Calibration diff --git a/ZDC/AliZDCv4.cxx b/ZDC/AliZDCv4.cxx index e04ec5ce784..f98cd50849c 100644 --- a/ZDC/AliZDCv4.cxx +++ b/ZDC/AliZDCv4.cxx @@ -2456,6 +2456,7 @@ void AliZDCv4::StepManager() hits[4] = xdet[0]; } hits[5] = xdet[1]; + hits[6] = 0; hits[7] = 0; hits[8] = 0; hits[9] = 0; @@ -2463,36 +2464,35 @@ void AliZDCv4::StepManager() Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber(); TParticle *part = gAlice->GetMCApp()->Particle(curTrackN); hits[10] = part->GetPdgCode(); + hits[11] = 0; + hits[12] = 1.0e09*gMC->TrackTime(); // in ns! + hits[13] = part->Eta(); // - Int_t imo = part->GetFirstMother(); - //printf(" tracks: pc %d -> mother %d \n", curTrackN,imo); - - int trmo = imo; - TParticle *pmot = 0x0; - Bool_t isChild = kFALSE; - if(imo>-1){ - pmot = gAlice->GetMCApp()->Particle(imo); - trmo = pmot->GetFirstMother(); - isChild = kTRUE; - while(trmo!=-1){ - pmot = gAlice->GetMCApp()->Particle(trmo); - //printf(" **** pc %d -> mother %d \n", trch,trmo); - trmo = pmot->GetFirstMother(); - } - } + if(fFindMother){ + Int_t imo = part->GetFirstMother(); + //printf(" tracks: pc %d -> mother %d \n", curTrackN,imo); + + int trmo = imo; + TParticle *pmot = 0x0; + Bool_t isChild = kFALSE; + if(imo>-1){ + pmot = gAlice->GetMCApp()->Particle(imo); + trmo = pmot->GetFirstMother(); + isChild = kTRUE; + while(trmo!=-1){ + pmot = gAlice->GetMCApp()->Particle(trmo); + //printf(" **** pc %d -> mother %d \n", trch,trmo); + trmo = pmot->GetFirstMother(); + } + } - if(isChild && pmot){ - hits[6] = 1; - hits[11] = pmot->GetPdgCode(); - hits[13] = pmot->Eta(); - } - else{ - hits[6] = 0; - hits[11] = 0; - hits[13] = part->Eta(); + if(isChild && pmot){ + hits[6] = 1; + hits[11] = pmot->GetPdgCode(); + hits[13] = pmot->Eta(); + } } - hits[12] = 1.0e09*gMC->TrackTime(); // in ns! AddHit(curTrackN, vol, hits); -- 2.39.3