X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=PHOS%2FAliPHOSTrackSegment.cxx;h=6d9707f95924c216f6274e1c7da01ed5e97db3df;hb=8e52a0348a42f8434975e4a2da166fbb680b6319;hp=18fa13ac45de59d47280b60053d54e353ca3f7a5;hpb=b9791748e007ba282c12a057a60db875fe90d08b;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSTrackSegment.cxx b/PHOS/AliPHOSTrackSegment.cxx index 18fa13ac45d..6d9707f9592 100644 --- a/PHOS/AliPHOSTrackSegment.cxx +++ b/PHOS/AliPHOSTrackSegment.cxx @@ -13,11 +13,23 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id$ */ + +/* History of cvs commits: + * + * $Log$ + * Revision 1.30 2006/08/28 10:01:56 kharlov + * Effective C++ warnings fixed (Timur Pocheptsov) + * + * Revision 1.29 2005/05/28 14:19:05 schutz + * Compilation warnings fixed by T.P. + * + */ + //_________________________________________________________________________ // Track segment in PHOS // Can be : 1 EmcRecPoint -// 1 EmcRecPoint + 1 PPSD -// 1 EmcRecPoint + 1 PPSD + 1 PPSD +// 1 EmcRecPoint + 1 CPV +// 1 EmcRecPoint + 1 CPV + 1 charged track // //*-- Author: Dmitri Peressounko (RRC KI & SUBATECH) @@ -27,15 +39,31 @@ // --- Standard library --- // --- AliRoot header files --- - +#include "AliPHOSEmcRecPoint.h" #include "AliPHOSTrackSegment.h" -#include "AliPHOSEmcRecPoint.h" +#include "AliESDtrack.h" ClassImp(AliPHOSTrackSegment) +//____________________________________________________________________________ +AliPHOSTrackSegment::AliPHOSTrackSegment() + : fEmcRecPoint(0), + fIndexInList(0), + fCpvRecPoint(0), + fTrack(0) +{ + //def ctor + fDcpv[0]=999. ; + fDcpv[1]=999. ; +} + //____________________________________________________________________________ AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , - AliPHOSRecPoint * ppsdrp1) + AliPHOSRecPoint * cpvrp1) + : fEmcRecPoint(0), + fIndexInList(0), + fCpvRecPoint(0), + fTrack(0) { // ctor @@ -44,17 +72,82 @@ AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , else fEmcRecPoint = -1 ; - if( ppsdrp1 ) - fPpsdUpRecPoint = ppsdrp1->GetIndexInList() ; + if( cpvrp1 ) + fCpvRecPoint = cpvrp1->GetIndexInList() ; else - fPpsdUpRecPoint = -1 ; + fCpvRecPoint = -1 ; + + fTrack = -1 ; + + fIndexInList = -1 ; + fDcpv[0]=999. ; + fDcpv[1]=999. ; +} + +//____________________________________________________________________________ +AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , + AliPHOSRecPoint * cpvrp1, + Int_t track) + : fEmcRecPoint(0), + fIndexInList(0), + fCpvRecPoint(0), + fTrack(0) +{ + // ctor + + if( emc ) + fEmcRecPoint = emc->GetIndexInList() ; + else + fEmcRecPoint = -1 ; + + if( cpvrp1 ) + fCpvRecPoint = cpvrp1->GetIndexInList() ; + else + fCpvRecPoint = -1 ; + + fTrack = track ; + + fIndexInList = -1 ; + fDcpv[0]=999. ; + fDcpv[1]=999. ; +} +//____________________________________________________________________________ +AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , + AliPHOSRecPoint * cpvrp1, + Int_t track, Float_t dx,Float_t dz) + : fEmcRecPoint(0), + fIndexInList(0), + fCpvRecPoint(0), + fTrack(0) +{ + // ctor + + if( emc ) + fEmcRecPoint = emc->GetIndexInList() ; + else + fEmcRecPoint = -1 ; + + if( cpvrp1 ) + fCpvRecPoint = cpvrp1->GetIndexInList() ; + else + fCpvRecPoint = -1 ; + + fTrack = track ; fIndexInList = -1 ; + + fDcpv[0] = dx ; + fDcpv[1] = dz ; } //____________________________________________________________________________ AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) + : TObject(ts), + fEmcRecPoint(0), + fIndexInList(0), + fCpvRecPoint(0), + fTrack(0) { // Copy ctor @@ -63,41 +156,55 @@ AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts) //____________________________________________________________________________ -void AliPHOSTrackSegment::Copy(TObject & obj) +void AliPHOSTrackSegment::Copy(TObject & obj) const { // Copy of a track segment into another track segment TObject::Copy(obj) ; ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ; - ( (AliPHOSTrackSegment &)obj ).fPpsdUpRecPoint = fPpsdUpRecPoint ; + ( (AliPHOSTrackSegment &)obj ).fCpvRecPoint = fCpvRecPoint ; ( (AliPHOSTrackSegment &)obj ).fIndexInList = fIndexInList ; -} + ( (AliPHOSTrackSegment &)obj ).fTrack = fTrack ; + ( (AliPHOSTrackSegment &)obj ).fDcpv[0] = fDcpv[0] ; + ( (AliPHOSTrackSegment &)obj ).fDcpv[1] = fDcpv[1] ; +} + //____________________________________________________________________________ -void AliPHOSTrackSegment::Print(Option_t * opt) const +void AliPHOSTrackSegment::Print(const Option_t *) const { // Print all information on this track Segment - Info("Print", "--------AliPHOSTrackSegment-------- "); - Info("Print", "Stored at position %d", fIndexInList) ; - Info("Print", "Emc RecPoint # %d", fEmcRecPoint) ; - if(fPpsdUpRecPoint >= 0) - Info("Print", "CPV RecPoint # %d", fPpsdUpRecPoint) ; + Info("Print", ""); + printf("Stored at position %d\n", fIndexInList) ; + printf(" Emc RecPoint # %d\n", fEmcRecPoint) ; + if(fCpvRecPoint >= 0) + printf(" CPV RecPoint # %d\n", fCpvRecPoint) ; else - Info("Print", "No CPV RecPoint "); - - - Info("Print", "------------------------------------ ") ; - + printf(" No CPV RecPoint\n"); + if (fTrack >= 0) + printf(" Charged track # %d\n", fTrack) ; + else + printf(" No Charged track\n"); + printf(" Distance to CPV: x=%f, z=%f\n",fDcpv[0],fDcpv[1]) ; } + //____________________________________________________________________________ -void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * PpsdUpRecPoint) +void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * cpvRecPoint) { // gives an id from its position in the list - if( PpsdUpRecPoint ) - fPpsdUpRecPoint = PpsdUpRecPoint->GetIndexInList() ; + if( cpvRecPoint ) + fCpvRecPoint = cpvRecPoint->GetIndexInList() ; else - fPpsdUpRecPoint = -1 ; + fCpvRecPoint = -1 ; } +//____________________________________________________________________________ +Float_t AliPHOSTrackSegment::GetCpvDistance(const Option_t* dr) const +{ + if(strcmp(dr,"x")==0||strcmp(dr,"X")==0) return fDcpv[0] ; + if(strcmp(dr,"z")==0||strcmp(dr,"Z")==0) return fDcpv[1] ; + if(strcmp(dr,"r")==0||strcmp(dr,"R")==0) return TMath::Sqrt(fDcpv[0]*fDcpv[0]+fDcpv[1]*fDcpv[1]) ; + return 999. ; +}