From 2af5445a199c440e9638cc8f850b96681ff525dc Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 19 Oct 2004 18:28:16 +0000 Subject: [PATCH] fPrimary in Hits removed, using fTrack now --- PHOS/AliPHOSHit.cxx | 65 ++------------------------------------------- PHOS/AliPHOSHit.h | 8 ++---- PHOS/AliPHOSv1.cxx | 49 +++++++++++++++++++--------------- PHOS/AliPHOSv1.h | 2 +- PHOS/AliPHOSv2.cxx | 4 +-- PHOS/AliPHOSv2.h | 2 +- 6 files changed, 36 insertions(+), 94 deletions(-) diff --git a/PHOS/AliPHOSHit.cxx b/PHOS/AliPHOSHit.cxx index c771f733766..32e523836f1 100644 --- a/PHOS/AliPHOSHit.cxx +++ b/PHOS/AliPHOSHit.cxx @@ -22,15 +22,11 @@ //*-- Author: Maxime Volkov (RRC KI) & Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH) // --- ROOT system --- -#include "TVector3.h" // --- Standard library --- // --- AliRoot header files --- #include "AliPHOSHit.h" -#include "AliRun.h" -#include "AliPHOSGeometry.h" -#include "AliPHOS.h" ClassImp(AliPHOSHit) @@ -43,14 +39,13 @@ ClassImp(AliPHOSHit) fZ = hit.fZ ; fId = hit.fId ; fELOS = hit.fELOS ; - fPrimary = hit.fPrimary ; fTrack = hit.fTrack ; fTime = hit.fTime ; } //____________________________________________________________________________ -AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track) +AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t track, Int_t id, Float_t *hits): AliHit(shunt, track) { // // Create a CPV hit object @@ -62,49 +57,6 @@ AliPHOSHit::AliPHOSHit(Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_ fTime = hits[3] ; fId = id ; fELOS = hits[4] ; - fPrimary = primary ; -} -//____________________________________________________________________________ -Float_t AliPHOSHit::X() const -{ - // if(fX < -1000.){ - TVector3 pos ; - AliPHOS * phos = static_cast (gAlice->GetDetector("PHOS")) ; - phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ; - return pos.X() ; - // fX = pos.X() ; - // fY = pos.Y() ; - // fZ = pos.Z() ; - // } - // return fX; -} -//____________________________________________________________________________ -Float_t AliPHOSHit::Y() const -{ - // if(fY < -1000.){ - TVector3 pos ; - AliPHOS * phos = static_cast (gAlice->GetDetector("PHOS")) ; - phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ; - return pos.Y(); - // fX = pos.X() ; - // fY = pos.Y() ; - // fZ = pos.Z() ; - // } - // return fY; -} -//____________________________________________________________________________ -Float_t AliPHOSHit::Z() const -{ - // if(fY < -1000.){ - TVector3 pos ; - AliPHOS * phos = static_cast (gAlice->GetDetector("PHOS")) ; - phos->GetGeometry() ->RelPosInAlice(GetId(), pos) ; - return pos.Z() ; - // fX = pos.X() ; - // fY = pos.Y() ; - // fZ = pos.Z() ; - // } - // return fZ; } //____________________________________________________________________________ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const @@ -113,7 +65,7 @@ Bool_t AliPHOSHit::operator==(AliPHOSHit const &rValue) const Bool_t rv = kFALSE ; - if ( (fId == rValue.GetId()) && ( fPrimary == rValue.GetPrimary() ) ) + if ( (fId == rValue.GetId()) && ( fTrack == rValue.GetPrimary() ) ) rv = kTRUE; return rv; @@ -133,16 +85,3 @@ AliPHOSHit AliPHOSHit::operator+(const AliPHOSHit &rValue) } -//____________________________________________________________________________ -// Commented out by Yu.Kharlov 4.09.2003 -// ostream& operator << (ostream& out, const AliPHOSHit& hit) -// { -// // Print out Id and energy - -// //out << "AliPHOSHit = " << hit.GetId() << " " << hit.GetEnergy() << " " << hit.GetTime() << endl ; -// AliWarning("operator <<", "Implement differently") ; -// return out ; -// } - - - diff --git a/PHOS/AliPHOSHit.h b/PHOS/AliPHOSHit.h index 1b132e5995f..2dc855cdc8c 100644 --- a/PHOS/AliPHOSHit.h +++ b/PHOS/AliPHOSHit.h @@ -29,7 +29,7 @@ class AliPHOSHit : public AliHit { // default ctor } AliPHOSHit(const AliPHOSHit & hit) ; - AliPHOSHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t id, Float_t *hits); + AliPHOSHit(Int_t shunt, Int_t tracknumber, Int_t id, Float_t *hits); virtual ~AliPHOSHit(void) { // dtor } @@ -44,7 +44,7 @@ class AliPHOSHit : public AliHit { } Int_t GetPrimary(void) const { // returns the primary particle id at the origine of this hit - return fPrimary ; + return fTrack ; } Float_t GetTime(void) const { @@ -52,9 +52,6 @@ class AliPHOSHit : public AliHit { return fTime ; } - virtual Float_t X() const ; - virtual Float_t Y() const ; - virtual Float_t Z() const ; Bool_t operator == (AliPHOSHit const &rValue) const ; AliPHOSHit operator + (const AliPHOSHit& rValue) ; @@ -64,7 +61,6 @@ class AliPHOSHit : public AliHit { Int_t fId ; // Absolute Id number of PHOS Xtal or PPSD pad Float_t fELOS ; // Energy deposited - Int_t fPrimary ; // Primary particles at the origine of the hit Float_t fTime ; // Time of the energy deposition ClassDef(AliPHOSHit,1) // Hit for PHOS diff --git a/PHOS/AliPHOSv1.cxx b/PHOS/AliPHOSv1.cxx index d8cc5f0d9dc..820baa92e88 100644 --- a/PHOS/AliPHOSv1.cxx +++ b/PHOS/AliPHOSv1.cxx @@ -184,7 +184,7 @@ void AliPHOSv1::Copy(AliPHOSv1 & phos) } //____________________________________________________________________________ -void AliPHOSv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t Id, Float_t * hits) +void AliPHOSv1::AddHit(Int_t shunt, Int_t primary, Int_t Id, Float_t * hits) { // Add a hit to the hit list. // A PHOS hit is the sum of all hits in a single crystal from one primary and within some time gate @@ -195,7 +195,7 @@ void AliPHOSv1::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t Id, Bool_t deja = kFALSE ; AliPHOSGeometry * geom = GetGeometry() ; - newHit = new AliPHOSHit(shunt, primary, tracknumber, Id, hits) ; + newHit = new AliPHOSHit(shunt, primary, Id, hits) ; for ( hitCounter = fNhits-1 ; hitCounter >= 0 && !deja ; hitCounter-- ) { curHit = dynamic_cast((*fHits)[hitCounter]) ; @@ -287,7 +287,6 @@ void AliPHOSv1::StepManager(void) TLorentzVector pos ; // Lorentz vector of the track current position Int_t copy ; - Int_t tracknumber = gAlice->GetMCApp()->GetCurrentTrackNumber() ; TString name = GetGeometry()->GetName() ; Int_t moduleNumber ; @@ -372,7 +371,9 @@ void AliPHOSv1::StepManager(void) xyzte[3] = gMC->TrackTime() ; xyzte[4] = cpvDigit->GetQpad() ; // amplitude in a pad - AddHit(fIshunt, -1, tracknumber, absid, xyzte); // -1: No need in primary for CPV + + Int_t primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() ); + AddHit(fIshunt, primary, absid, xyzte); if (cpvDigit->GetQpad() > 0.02) { xmean += cpvDigit->GetQpad() * (cpvDigit->GetXpad() + 0.5); @@ -414,7 +415,9 @@ void AliPHOSv1::StepManager(void) vert[1]=part->Vy() ; vert[2]=part->Vz() ; gMC -> Gmtod (vert, vertd, 1); // transform coordinate from master to daughter system - if(vertd[1]<-GetGeometry()->GetCrystalSize(1)/2.-0.1){ //Particle is created in foront of PHOS 0.1 to get rid of numerical errors + if(vertd[1]<-GetGeometry()->GetCrystalSize(1)/2.-0.1){ //Particle is created in foront of PHOS + //0.1 to get rid of numerical errors + part->SetBit(kKeepBit); while ( parent != -1 ) { part = gAlice->GetMCApp()->Particle(parent) ; part->SetBit(kKeepBit); @@ -451,26 +454,30 @@ void AliPHOSv1::StepManager(void) //Calculates de energy deposited in the crystal xyzte[4] = fAPDFactor * lightYield ; - Int_t primary =-1 ; - if(fIshunt == 1) - primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() ); - else if(fIshunt == 2){ - 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->GetMCApp()->Particle(primary) ; - } + Int_t primary ; + if(fIshunt == 2){ + primary = gAlice->GetMCApp()->GetCurrentTrackNumber() ; + TParticle * part = gAlice->GetMCApp()->Particle(primary) ; + while ( !part->TestBit(kKeepBit) ) { + primary = part->GetFirstMother() ; + if(primary == -1){ + primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() ); + 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->GetMCApp()->Particle(primary) ; + } } + else + primary = gAlice->GetMCApp()->GetPrimary( gAlice->GetMCApp()->GetCurrentTrackNumber() ); - + + // add current hit to the hit list // Info("StepManager","%d %d", primary, tracknumber) ; - AddHit(fIshunt, primary,tracknumber, absid, xyzte); + AddHit(fIshunt, primary, absid, xyzte); // fill the relevant QA Checkables fQATotEner->Update( xyzte[4] ) ; // total energy in PHOS diff --git a/PHOS/AliPHOSv1.h b/PHOS/AliPHOSv1.h index 6ce64a8b90c..e59378b7621 100644 --- a/PHOS/AliPHOSv1.h +++ b/PHOS/AliPHOSv1.h @@ -31,7 +31,7 @@ public: virtual ~AliPHOSv1(void) ; virtual void Copy(AliPHOSv1 & phos) ; - virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits) ; + virtual void AddHit( Int_t shunt, Int_t primary, Int_t id, Float_t *hits) ; virtual void FinishEvent() ; virtual void FinishPrimary() ; virtual Int_t IsVersion(void) const { diff --git a/PHOS/AliPHOSv2.cxx b/PHOS/AliPHOSv2.cxx index 88d21829573..cd3b69859af 100644 --- a/PHOS/AliPHOSv2.cxx +++ b/PHOS/AliPHOSv2.cxx @@ -64,13 +64,13 @@ void AliPHOSv2::Copy(AliPHOSv2 & phos) } //____________________________________________________________________________ -void AliPHOSv2::AddHit(Int_t shunt, Int_t primary, Int_t tracknumber, Int_t Id, Float_t * hits) +void AliPHOSv2::AddHit(Int_t shunt, Int_t primary, Int_t Id, Float_t * hits) { // Add a hit to the hit list. AliPHOSHit *newHit ; - newHit = new AliPHOSHit(shunt, primary, tracknumber, Id, hits) ; + newHit = new AliPHOSHit(shunt, primary, Id, hits) ; new((*fHits)[fNhits]) AliPHOSHit(*newHit) ; fNhits++ ; diff --git a/PHOS/AliPHOSv2.h b/PHOS/AliPHOSv2.h index 16236c87c42..8cdc2dedaf9 100644 --- a/PHOS/AliPHOSv2.h +++ b/PHOS/AliPHOSv2.h @@ -26,7 +26,7 @@ public: virtual ~AliPHOSv2(void) ; virtual void Copy(AliPHOSv2 & phos) ; - virtual void AddHit( Int_t shunt, Int_t primary, Int_t track, Int_t id, Float_t *hits); + virtual void AddHit( Int_t shunt, Int_t primary, Int_t id, Float_t *hits); virtual Int_t IsVersion(void) const { // Gives the version number return 2 ; -- 2.43.5