* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
-
+/* $Id$ */
//_________________________________________________________________________
-// class of PHOS Sub Track
-//*-- Author : Dmitri Peressounko RRC KI
-//////////////////////////////////////////////////////////////////////////////
+// Track segment in PHOS
+// Can be : 1 EmcRecPoint
+// 1 EmcRecPoint + 1 PPSD
+// 1 EmcRecPoint + 1 PPSD + 1 PPSD
+//
+//*-- Author: Dmitri Peressounko (RRC KI & SUBATECH)
// --- ROOT system ---
-#include "TVector3.h"
// --- Standard library ---
-#include "iostream.h"
+#include <iostream.h>
// --- AliRoot header files ---
#include "AliPHOSTrackSegment.h"
-#include "AliPHOSv0.h"
ClassImp(AliPHOSTrackSegment)
//____________________________________________________________________________
-AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc , AliPHOSPpsdRecPoint * ppsdRP1,
- AliPHOSPpsdRecPoint * ppsdRP2 )
-{
+AliPHOSTrackSegment::AliPHOSTrackSegment( AliPHOSEmcRecPoint * emc ,
+ AliPHOSRecPoint * ppsdrp1)
+{
+ // ctor
+
if( emc )
- fEmcRecPoint = emc ;
+ fEmcRecPoint = emc->GetIndexInList() ;
+ else
+ fEmcRecPoint = -1 ;
- if( ppsdRP1 )
- fPpsdUp = ppsdRP1 ;
+ if( ppsdrp1 )
+ fPpsdUpRecPoint = ppsdrp1->GetIndexInList() ;
+ else
+ fPpsdUpRecPoint = -1 ;
- if( ppsdRP2 )
- fPpsdLow = ppsdRP2 ;
- fCutOnDispersion = 1.5 ;
+ fIndexInList = -1 ;
}
//____________________________________________________________________________
-AliPHOSTrackSegment::~AliPHOSTrackSegment() // dtor
+AliPHOSTrackSegment::AliPHOSTrackSegment( const AliPHOSTrackSegment & ts)
{
-// fEmcRecPoint.Delete() ; Not Owners !!!
-// fPpsdUp.Delete() ;
-// fPpsdLow.Delete() ;
+ // Copy ctor
+
+ ( (AliPHOSTrackSegment &)ts ).Copy(*this) ;
}
+
//____________________________________________________________________________
-Float_t AliPHOSTrackSegment::GetDistanceInPHOSPlane()
+void AliPHOSTrackSegment::Copy(TObject & obj)
{
-
- TVector3 vecEmc ;
- fEmcRecPoint->GetLocalPosition(vecEmc) ;
-
- TVector3 vecPpsd ;
- if( fPpsdLow->GetMultiplicity() )
- fPpsdLow->GetLocalPosition(vecPpsd) ;
- else {
- vecPpsd.SetX(10000.) ;
- }
- vecEmc -= vecPpsd ;
+ // Copy of a track segment into another track segment
- Float_t R = vecEmc.Mag();;
-
- return R ;
+ TObject::Copy(obj) ;
+ ( (AliPHOSTrackSegment &)obj ).fEmcRecPoint = fEmcRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fPpsdUpRecPoint = fPpsdUpRecPoint ;
+ ( (AliPHOSTrackSegment &)obj ).fIndexInList = fIndexInList ;
}
//____________________________________________________________________________
-Bool_t AliPHOSTrackSegment::GetMomentumDirection( TVector3 & dir )
-{
- // True if determined
- Bool_t ifdeterm = kTRUE ;
-
- if( fPpsdLow ){
- TMatrix mdummy ;
- if( fPpsdUp->GetMultiplicity() ) { // draw line trough 2 points
- TVector3 posEmc ;
- fEmcRecPoint->GetGlobalPosition(posEmc,mdummy) ;
- TVector3 posPpsd ;
- fPpsdLow->GetGlobalPosition(posPpsd,mdummy) ;
- dir = posEmc - posPpsd ;
- dir.SetMag(1.) ;
- }
-
- else { // draw line through 3 pionts
- TVector3 posEmc ;
- fEmcRecPoint->GetGlobalPosition(posEmc,mdummy) ;
- TVector3 posPpsdl ;
- fPpsdLow->GetGlobalPosition(posPpsdl,mdummy) ;
- TVector3 posPpsdup ;
- fPpsdUp->GetGlobalPosition(posPpsdup,mdummy) ;
- posPpsdl = 0.5*( posPpsdup+posPpsdl ) ;
- dir = posEmc - posPpsdl ;
- dir.SetMag(1.) ;
- }
+void AliPHOSTrackSegment::Print(Option_t * opt) const
+{
+ // Print all information on this track Segment
- }
- else
- ifdeterm = kFALSE ;
-
- return ifdeterm ;
-}
-
-//____________________________________________________________________________
-Int_t AliPHOSTrackSegment::GetPartType()
-{
- // Returns 0 - gamma
- // 1 - e+, e-
- // 2 - neutral hadron
- // 3 - charged hadron
-
- Int_t PartType =0;
- if( fPpsdUp ){ // Neutral
- if( fPpsdLow ) // Neutral hadron
- PartType = 2 ;
- else // Gamma
- PartType = 0 ;
-
- }
-
- else { // Charged
+ cout << "--------AliPHOSTrackSegment-------- "<<endl ;
+ cout << "Stored at position " << fIndexInList << endl ;
+ cout << "Emc RecPoint # " << fEmcRecPoint << endl ;
+ if(fPpsdUpRecPoint >= 0)
+ cout << "CPV RecPoint # " << fPpsdUpRecPoint << endl ;
+ else
+ cout << "No CPV RecPoint " << endl ;
- if( fEmcRecPoint->GetDispersion() > fCutOnDispersion)
- PartType = 3 ;
- else
- PartType = 1 ;
- }
+ cout << "------------------------------------ " << endl ;
- return PartType ;
-
}
-
-//____________________________________________________________________________
-void AliPHOSTrackSegment::GetPosition( TVector3 & pos )
-{
- // Returns positions of hits
- TMatrix Dummy ;
- fEmcRecPoint->GetGlobalPosition(pos, Dummy) ;
-}
-
//____________________________________________________________________________
-void AliPHOSTrackSegment::Print()
+void AliPHOSTrackSegment::SetCpvRecPoint(AliPHOSRecPoint * PpsdUpRecPoint)
{
- cout << "--------AliPHOSTrackSegment-------- "<<endl ;
- cout << "EMC Reconstructed Point: " << fEmcRecPoint << endl;
-
- TVector3 pos ;
- TMatrix Dummy ;
-
- fEmcRecPoint->GetGlobalPosition( pos, Dummy ) ;
-
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << " Energy " << fEmcRecPoint->GetTotalEnergy() << endl ;
- cout << "PPSD Low Reconstructed Point: " << endl;
-
- if(fPpsdLow){
- fPpsdLow->GetGlobalPosition( pos , Dummy ) ;
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
- }
-
- cout << "PPSD Up Reconstructed Point: " << endl;
-
- if(fPpsdUp ){
- fPpsdUp->GetGlobalPosition( pos, Dummy ) ;
- cout << " position " << pos.X() << " " << pos.Y() << " " << pos.Z() << endl ;
- }
-
+ // gives an id from its position in the list
+ if( PpsdUpRecPoint )
+ fPpsdUpRecPoint = PpsdUpRecPoint->GetIndexInList() ;
+ else
+ fPpsdUpRecPoint = -1 ;
}