]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPIDv1.cxx
Coding convention
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.cxx
index 9eb7804036ab5267bc4745df0ca07fe15869c29c..8a0d43c0a9e50d15abadf2d7d484c3d0d75ca5c1 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
+
 //_________________________________________________________________________
-// Algorithm class to identify the type of particle from the PHOS TrackSegment alone 
-//*-- Author : Y. Schutz SUBATECH
-//////////////////////////////////////////////////////////////////////////////
+// Implementation version v1 of the PHOS particle identifier 
+// Identification is based on information from PPSD and EMC
+//                  
+//*-- Author: Yves Schutz (SUBATECH)  & Gines Martinez (SUBATECH)
+
 
 // --- ROOT system ---
 
 // --- Standard library ---
 
-#include <iostream>
+#include <iostream.h>
 
 // --- AliRoot header files ---
 
 #include "AliPHOSPIDv1.h"
 #include "AliPHOSTrackSegment.h"
 #include "AliPHOSRecParticle.h"
+#include "AliPHOSIndexToObject.h"
 
 ClassImp( AliPHOSPIDv1) 
 
-
 //____________________________________________________________________________
- AliPHOSPIDv1::AliPHOSPIDv1() 
+void  AliPHOSPIDv1::MakeParticles(AliPHOSTrackSegment::TrackSegmentsList * trsl, 
+                                 AliPHOSRecParticle::RecParticlesList * rpl)
 {
-  // ctor
-
-}
-
-//____________________________________________________________________________
- AliPHOSPIDv1::~AliPHOSPIDv1()
-{ 
-  // dtor
-}
-
-
-//____________________________________________________________________________
-void  AliPHOSPIDv1::GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl)
-{
-  // main function, does the job
+  // Makes a RecParticle out of a TrackSegment
 
   TIter next(trsl) ; 
   AliPHOSTrackSegment * tracksegment ; 
   Int_t index = 0 ; 
+  AliPHOSRecParticle * rp ; 
+  Int_t type ; 
+  Int_t showerprofile;  // 0 narrow and 1 wide
+  Int_t cpvdetector;  // 1 hit and 0 no hit
+  Int_t pcdetector;  // 1 hit and 0 no hit
 
   while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
-    new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ; 
+    new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
+    rp = (AliPHOSRecParticle *)rpl->At(index) ; 
+    AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ; 
+    Float_t * lambda = new Float_t[2]; 
+    recp->GetElipsAxis(lambda) ; 
+
+ // Looking at the lateral development of the shower
+    if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
+        ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )         
+      showerprofile = 0 ;   // NARROW PROFILE   
+    else      
+      showerprofile = 1 ;// WIDE PROFILE
+  
+    // Looking at the photon conversion detector
+    if( tracksegment->GetPpsdLowRecPoint() == 0 )   
+      pcdetector = 0 ;  // No hit
+    else      
+      pcdetector = 1 ;  // hit
+  
+    // Looking at the photon conversion detector
+    if( tracksegment->GetPpsdUpRecPoint() == 0 )
+      cpvdetector = 0 ;  // No hit
+    else  
+      cpvdetector = 1 ;  // Hit
+     
+    type = showerprofile + 2 * pcdetector + 4 * cpvdetector ;
+    rp->SetType(type) ; 
     index++ ; 
   }
     
 }
 
+//____________________________________________________________________________
+void  AliPHOSPIDv1:: Print() 
+{
+  // Print the parameters used for the particle type identification
+  
+  cout << "AliPHOSPIDv1 : cuts for the particle idendification based on the shower profile " << endl 
+       << fLambda1m << " < value1 < " << fLambda1M << endl 
+       << fLambda2m << " < value2 < " << fLambda2M << endl ;  
+
+}
+
+//____________________________________________________________________________
+void  AliPHOSPIDv1::SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M)
+{
+  // Modifies the parameters used for the particle type identification
+
+  fLambda1m = l1m ; 
+  fLambda1M = l1M ; 
+  fLambda2m = l2m ; 
+  fLambda2M = l2M ; 
+}