X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=STEER%2FAliPoints.cxx;h=8e7e9ffc7cb57a199041d34be1393d3446684395;hb=ab516493625a1ab57a76ca96091b9f68cbbe88ad;hp=9f5f9199d17e5fee33f6828e638a3604226f92a1;hpb=aee8290b9e98b230f8f38596bffd47ca1abfbf9d;p=u%2Fmrichter%2FAliRoot.git diff --git a/STEER/AliPoints.cxx b/STEER/AliPoints.cxx index 9f5f9199d17..8e7e9ffc7cb 100644 --- a/STEER/AliPoints.cxx +++ b/STEER/AliPoints.cxx @@ -13,12 +13,7 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* -$Log$ -Revision 1.4 1999/09/29 09:24:29 fca -Introduction of the Copyright and cvs Log - -*/ +/* $Id$ */ /////////////////////////////////////////////////////////////////////////////// // // @@ -33,26 +28,32 @@ Introduction of the Copyright and cvs Log // // /////////////////////////////////////////////////////////////////////////////// -#include "AliPoints.h" -#include "AliRun.h" -#include "AliDetector.h" #include "TPad.h" +#include "TParticle.h" #include "TView.h" + +#include "AliDetector.h" +#include "AliMC.h" +#include "AliPoints.h" +#include "AliRun.h" ClassImp(AliPoints) -//_____________________________________________________________________________ -AliPoints::AliPoints() +//_______________________________________________________________________ +AliPoints::AliPoints(): + fDetector(0), + fIndex(0) { // // Default constructor // - fDetector = 0; - fIndex = 0; } -//_____________________________________________________________________________ -AliPoints::AliPoints(const AliPoints &pts) +//_______________________________________________________________________ +AliPoints::AliPoints(const AliPoints &pts): + TPolyMarker3D(pts), + fDetector(0), + fIndex(0) { // // Copy constructor @@ -60,45 +61,42 @@ AliPoints::AliPoints(const AliPoints &pts) pts.Copy(*this); } -//_____________________________________________________________________________ -AliPoints::AliPoints(Int_t nhits) - :TPolyMarker3D(nhits) +//_______________________________________________________________________ +AliPoints::AliPoints(Int_t nhits): + TPolyMarker3D(nhits), + fDetector(0), + fIndex(0) { // // Standard constructor // - fDetector = 0; - fIndex = 0; ResetBit(kCanDelete); } -//_____________________________________________________________________________ +//_______________________________________________________________________ AliPoints::~AliPoints() { // - // Default constructor + // Default destructor // - fDetector = 0; - fIndex = 0; } -//_____________________________________________________________________________ -void AliPoints::Copy(AliPoints &pts) const +//_______________________________________________________________________ +void AliPoints::Copy(TObject &pts) const { // // Copy *this onto pts // - if(this != &pts) { - ((TPolyMarker3D*)this)->Copy((TPolyMarker3D&)pts); - pts.fGLList = fGLList; - pts.fLastPoint = fLastPoint; - pts.fDetector = fDetector; - pts.fIndex = fIndex; + if((TObject*)this != &pts) { + ((TPolyMarker3D*)this)->Copy(dynamic_cast(pts)); + (dynamic_cast(pts)).fGLList = fGLList; + (dynamic_cast(pts)).fLastPoint = fLastPoint; + (dynamic_cast(pts)).fDetector = fDetector; + (dynamic_cast(pts)).fIndex = fIndex; } } - -//_____________________________________________________________________________ +//_______________________________________________________________________ Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py) { // @@ -118,8 +116,8 @@ Int_t AliPoints::DistancetoPrimitive(Int_t px, Int_t py) return TPolyMarker3D::DistancetoPrimitive(px,py); } -//_____________________________________________________________________________ -void AliPoints::DumpParticle() +//_______________________________________________________________________ +void AliPoints::DumpParticle() const { // // Dump particle corresponding to this point @@ -128,7 +126,7 @@ void AliPoints::DumpParticle() if (particle) particle->Dump(); } -//_____________________________________________________________________________ +//_______________________________________________________________________ void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py) { // @@ -147,7 +145,7 @@ void AliPoints::ExecuteEvent(Int_t event, Int_t px, Int_t py) } -//_____________________________________________________________________________ +//_______________________________________________________________________ const Text_t *AliPoints::GetName() const { // @@ -158,8 +156,8 @@ const Text_t *AliPoints::GetName() const return particle->GetName(); } -//_____________________________________________________________________________ -Text_t *AliPoints::GetObjectInfo(Int_t, Int_t) +//_______________________________________________________________________ +Text_t *AliPoints::GetObjectInfo(Int_t, Int_t) const { // // Redefines TObject::GetObjectInfo. @@ -171,20 +169,18 @@ Text_t *AliPoints::GetObjectInfo(Int_t, Int_t) return info; } -//_____________________________________________________________________________ +//_______________________________________________________________________ TParticle *AliPoints::GetParticle() const { // // Returns pointer to particle index in AliRun::fParticles // - TClonesArray *particles = gAlice->Particles(); - Int_t nparticles = particles->GetEntriesFast(); - if (fIndex < 0 || fIndex >= nparticles) return 0; - return (TParticle*)particles->UncheckedAt(fIndex); + if (fIndex < 0 || fIndex >= gAlice->GetMCApp()->GetNtrack()) return 0; + else return gAlice->GetMCApp()->Particle(fIndex); } -//_____________________________________________________________________________ -void AliPoints::InspectParticle() +//_______________________________________________________________________ +void AliPoints::InspectParticle() const { // // Inspect particle corresponding to this point @@ -193,17 +189,7 @@ void AliPoints::InspectParticle() if (particle) particle->Inspect(); } -//_____________________________________________________________________________ -AliPoints & AliPoints::operator=(const AliPoints &pts) -{ - // - // Assignment operator - // - pts.Copy(*this); - return (*this); -} - -//_____________________________________________________________________________ +//_______________________________________________________________________ void AliPoints::Propagate() { // @@ -215,13 +201,13 @@ void AliPoints::Propagate() // TIter next(gAlice->Detectors()); AliDetector *detector; - while((detector = (AliDetector*)next())) { + while((detector = (AliDetector*)(next()))) { if (!detector->IsActive()) continue; points = detector->Points(); if (!points) continue; ntracks = points->GetEntriesFast(); for (track=0;trackUncheckedAt(track); + pm = dynamic_cast(points->UncheckedAt(track)); if (!pm) continue; if (fIndex == pm->GetIndex()) { pm->SetMarkerColor(GetMarkerColor());