]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSPIDv1.h
Prevents to post clusterizer in case no data in TreeR
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.h
index 548f445f9dcb31b58c7d23cfd1a75dec681432d4..18f3399d2c86a1d5aab9e56e5ef450e94345db32 100644 (file)
@@ -8,15 +8,21 @@
 
 //_________________________________________________________________________
 // Implementation version v1 of the PHOS particle identifier 
-// Identification is based on information from PPSD and EMC
-//                  
-//*-- Author: Yves Schutz (SUBATECH)
+// Identification is based on information from CPV and EMC
+// Oh yeah                 
+//*-- Author: Yves Schutz (SUBATECH), Gustavo Conesa.
 
 // --- ROOT system ---
+//class TFormula ;
+class TVector3 ;
+class TMatrixD ;
+class TPrincipal ;
 
 // --- Standard library ---
 
 // --- AliRoot header files ---
+class AliPHOSEmcRecPoint ;
+class AliPHOSRecPoint ;
 
 #include "AliPHOSPID.h"
 
@@ -24,31 +30,81 @@ class  AliPHOSPIDv1 : public AliPHOSPID {
 
 public:
 
-  AliPHOSPIDv1() ;
-                     
-  virtual ~AliPHOSPIDv1(){} ; // dtor
+  AliPHOSPIDv1() ;          // ctor            
+  AliPHOSPIDv1(const char* headerFile, const char * tsBranch = "Default", const char * from = 0) ;
+   
+  virtual ~AliPHOSPIDv1() ; // dtor
 
-
-  Float_t GetDistanceInPHOSPlane(AliPHOSEmcRecPoint * emcclu, AliPHOSPpsdRecPoint * PpsdClu, Bool_t &toofar, Option_t * Axis) ; // Relative Distance PPSD-EMC
-  virtual void MakeParticles(AliPHOSTrackSegment::TrackSegmentsList * trsl, 
-                            AliPHOSRecParticle::RecParticlesList * rpl ) ; // does the job
-  virtual void Print(const char *) ; 
-  virtual void SetDispersionCutOff(Float_t Dcut) {fCutOnDispersion = Dcut ; }    
-  virtual void SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M) ; 
-  virtual void SetRelativeDistanceCut(Float_t CutOnRelativeDistance) ;
+  virtual void Exec(Option_t * option) ;
+  virtual char * GetRecParticlesBranch()const {return (char*) fRecParticlesTitle.Data() ;}      
+  virtual char * GetTrackSegmentsBranch()const{return (char*) fTrackSegmentsTitle.Data(); }
+  virtual const Int_t GetRecParticlesInRun() const  {return fRecParticlesInRun ;}  
  
-
+  virtual void Print(Option_t * option) const {}
+  void Print() ; 
+  // Get CpvtoEmcDistanceCut and TimeGate parameters depending on the custer energy and 
+  // Purity-Efficiency point (possible options "HIGH EFFICIENCY" "MEDIUM EFFICIENCY" "LOW  
+  // EFFICIENCY" and 3 more options changing EFFICIENCY by PURITY)
+  Double_t GetCpvtoEmcDistanceCut(const Float_t Cluster_En, const TString Eff_Pur)const  ;
+  Double_t GetTimeGate(const Float_t Cluster_En, const TString Eff_Pur)const  ;
+  const TString GetPrincipalFile( )const {return fFileName ;}
+  const TString GetPrincipalFilePar( )const {return fFileNamePar ;}
+
+  // Set all parameters necessary in the PID depending on the custer energy and 
+  // Purity-Efficiency point (possible options "HIGH EFFICIENCY" "MEDIUM EFFICIENCY" "LOW  
+  // EFFICIENCY" and 3 more options changing EFFICIENCY by PURITY)
+  void SetCpvtoEmcDistanceCut(Float_t Cluster_En, TString Eff_Pur, Float_t cut)  ; 
+  void SetTimeGate(Float_t Cluster_En, TString Eff_Pur, Float_t gate)  ; 
+  void SetEllipseXCenter(Float_t Cluster_En, TString Eff_Pur, Float_t x)  ;    
+  void SetEllipseYCenter(Float_t Cluster_En, TString Eff_Pur, Float_t y)  ;   
+  void SetEllipseAParameter(Float_t Cluster_En, TString Eff_Pur, Float_t a)  ;  
+  void SetEllipseBParameter(Float_t Cluster_En, TString Eff_Pur, Float_t b)  ; 
+  void SetEllipseAngle(Float_t Cluster_En, TString Eff_Pur, Float_t angle)  ;    
+  void SetEllipseParameters(Float_t Cluster_En, TString Eff_Pur, Float_t x, Float_t y,Float_t a, Float_t b,Float_t angle) ;  
+  void SetParameters(TString OptFileName) ; //Fills the matrix of parameters
+  virtual void SetTrackSegmentsBranch(const char* title) { fTrackSegmentsTitle = title;}
+  virtual void SetRecParticlesBranch (const char* title) { fRecParticlesTitle = title;} 
+  virtual const char * Version() const { return "pid-v1" ; }  
+  
  private:
 
-  // cuts on the shower profile 
-  Float_t fLambda1m ;        // minimum value for first elips axis
-  Float_t fLambda1M ;        // maximum value for first elips axis
-  Float_t fLambda2m ;        // minimum value for second elips axis
-  Float_t fLambda2M ;        // maximum value for second elips axis
-  Float_t fCutOnDispersion ; // cut on the shower dispersion to distinguish hadronic from EM showers
-  Float_t fCutOnRelativeDistance; //Cut on the relative distance between PPSD and EMC
+  const TString AliPHOSPIDv1::BranchName() const ; 
+  virtual void Init() ;
+  virtual void InitParameters() ;
+  void     MakeRecParticles(void ) ;
+  Float_t  GetDistance(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv, Option_t * Axis)const ; // Relative Distance CPV-EMC
+  Int_t    GetPrincipalSign(Double_t* P, Int_t ell, Int_t eff_pur)const ; //Principal cut
+  TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv)const ;
+  void     PrintRecParticles(Option_t * option) ;
+  //void     SetParameters() ; //Fills the matrix of parameters
+  Int_t    GetClusterOption(const Float_t Cluster_En,const Bool_t rcpv)const ;// Gives in wich cluster energy range is the event
+  Int_t    GetEffPurOption(const TString Eff_Pur)const ;// Gives the Efficiency-Purity point.
+  virtual void WriteRecParticles(Int_t event) ; 
+  void  SetPrincipalFileOptions(TString OptFileName) ;
 
-  ClassDef( AliPHOSPIDv1,1)  // Particle identifier implementation version 1
+ private:
+
+  TString                fFileName ;          // Name of the file which contains the Principal file
+  TString                fFileNamePar ;       // Name of the file which contains the parameters
+  Int_t                  fCluster ;           // Parameter that depens on the energy range to select the parameters of the file       
+  TString                fOptFileName ;       // choose de parameters and principal file
+  TString                fFrom ;              // name of Recpoints and TrackSegments 
+  TString                fHeaderFileName ;    // file name with event header
+  TString                fTrackSegmentsTitle; // branch name with track segments
+  TString                fRecPointsTitle ;    // branch name with rec points
+  TString                fRecParticlesTitle ; // branch name with rec particles
+  Int_t                      fNEvent ;            //! current event number
+  AliPHOSClusterizer *       fClusterizer ;       //! clusterizer
+  AliPHOSTrackSegmentMaker * fTSMaker ;           //! track segment maker
+  TPrincipal *               fPrincipal ;         //! TPrincipal from fFileName 
+  Int_t                      fRecParticlesInRun ; //! Total number of recparticles in one run
+  Double_t *                 fX ;                 //! Principal data 
+  Double_t *                 fP ;                 //! Principal eigenvalues
+  TMatrixD *                 fParameters ;        //! Matrix of all identification Parameters
+
+  ClassDef( AliPHOSPIDv1,3)  // Particle identifier implementation version 1
 
 };