]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Introduced members GetPrimary and GetNPrimaries, to recover primaries in TreeK depend...
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2002 16:32:36 +0000 (16:32 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 May 2002 16:32:36 +0000 (16:32 +0000)
PHOS/AliPHOSRecParticle.cxx
PHOS/AliPHOSRecParticle.h

index 463902b858268dc124bd743c178a5bb221f347e9..e92de231c9555adb9101bec7fbbb3338a5ab3522 100644 (file)
@@ -43,6 +43,7 @@ ClassImp(AliPHOSRecParticle)
   // copy ctor
 
   fPHOSTrackSegment = rp.fPHOSTrackSegment ; 
+  fDebug            = kFALSE ; 
   fType             = rp.fType ; 
   fIndexInList      = rp.fIndexInList ;
 
@@ -81,17 +82,22 @@ const Int_t AliPHOSRecParticle::GetNPrimaries() const
 //____________________________________________________________________________
 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 ; 
 }
+
index 71e7aa41070f00d37be02b209515f5a802b1f282..5fa1ea2b9c76f40f5120c4010a12eb083155aef5 100644 (file)
@@ -24,13 +24,15 @@ class AliPHOSRecParticle : public AliPHOSFastRecParticle {
 
  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 ; 
@@ -38,8 +40,9 @@ class AliPHOSRecParticle : public AliPHOSFastRecParticle {
  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