// copy ctor
fPHOSTrackSegment = rp.fPHOSTrackSegment ;
+ fDebug = kFALSE ;
fType = rp.fType ;
fIndexInList = rp.fIndexInList ;
//____________________________________________________________________________
const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const
{
- if ( index > GetNPrimaries() )
- cout << "WARNING : AliPHOSRecParticle::GetPrimary -> " << index << " is larger that the number of primaries "
- << GetNPrimaries() << endl ;
- else {
+ if ( index > GetNPrimaries() ) {
+ if (fDebug)
+ cout << "WARNING : AliPHOSRecParticle::GetPrimary -> " << index << " is larger that the number of primaries "
+ << GetNPrimaries() << endl ;
+ return 0 ;
+ } else {
Int_t dummy ;
AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
Int_t primaryindex = gime->EmcRecPoint(gime->TrackSegment(GetPHOSTSIndex())->GetEmcIndex())->GetPrimaries(dummy)[index] ;
- if (primaryindex >= 10000000)
- cout << "WARNING : AliPHOSRecParticle::GetPrimary -> not a signal primary" << endl ;
- else
+ if (primaryindex >= 10000000) { // it comes from backgroundfile
+ if (fDebug)
+ cout << "WARNING : AliPHOSRecParticle::GetPrimary -> not a signal primary" << endl ;
+ return 0 ;
+ } else
return gime->Primary(primaryindex) ;
- }
+ }
return 0 ;
}
+
public:
- AliPHOSRecParticle() { }
+ AliPHOSRecParticle() { fPHOSTrackSegment = 0 ; fDebug = kFALSE ; }
AliPHOSRecParticle(const AliPHOSRecParticle & rp) ; // ctor
virtual ~AliPHOSRecParticle(){ }
Int_t GetPHOSTSIndex()const { return fPHOSTrackSegment ; }
- const Int_t AliPHOSRecParticle::GetNPrimaries() const ;
- const TParticle * AliPHOSRecParticle::GetPrimary(Int_t index) const ;
+ virtual const Int_t GetNPrimaries() const ;
+ virtual const TParticle * GetPrimary(Int_t index) const ;
+ void SetDebug() { fDebug = kTRUE ; }
+ void UnsetDebug() { fDebug = kFALSE ; }
void SetTraskSegment(Int_t index){fPHOSTrackSegment = index; }
typedef TClonesArray RecParticlesList ;
private:
Int_t fPHOSTrackSegment ; // pointer to the associated track segment in PHOS
-
- ClassDef(AliPHOSRecParticle,1) // Reconstructed Particle
+ Bool_t fDebug ;
+
+ ClassDef(AliPHOSRecParticle,2) // Reconstructed Particle
};
#endif // AliPHOSRECPARTICLE_H