]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSPIDv1.cxx
Particle identification improved by shower profile analysis
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 //_________________________________________________________________________
17 // Algorithm class to identify the type of particle from the PHOS TrackSegment alone 
18 //*-- Author : Y. Schutz SUBATECH
19 //////////////////////////////////////////////////////////////////////////////
20
21 // --- ROOT system ---
22
23 // --- Standard library ---
24
25 #include <iostream>
26
27 // --- AliRoot header files ---
28
29 #include "AliPHOSPIDv1.h"
30 #include "AliPHOSTrackSegment.h"
31 #include "AliPHOSRecParticle.h"
32
33 ClassImp( AliPHOSPIDv1) 
34
35
36 //____________________________________________________________________________
37  AliPHOSPIDv1::AliPHOSPIDv1(): fCutOnDispersion(1.5) 
38
39 {
40   // ctor
41
42 }
43
44 //____________________________________________________________________________
45  AliPHOSPIDv1::~AliPHOSPIDv1()
46
47   // dtor
48 }
49
50
51 //____________________________________________________________________________
52 void  AliPHOSPIDv1::GetParticleType(TrackSegmentsList * trsl, RecParticlesList * rpl)
53 {
54   // main function, does the job
55
56   TIter next(trsl) ; 
57   AliPHOSTrackSegment * tracksegment ; 
58   Int_t index = 0 ; 
59   AliPHOSRecParticle * rp ; 
60   while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
61     new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
62     rp = (AliPHOSRecParticle *)(*rpl)[index] ; 
63     Int_t type =  rp->GetType() ;  
64     if ( type == kNEUTRAL ) { // resolve neutral baryon from photon
65       AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ; 
66       Float_t * lambda = new Float_t[2]; 
67       recp->GetElipsAxis(lambda) ; 
68       if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
69            ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
70         type = kGAMMA ; 
71       else 
72         type = kNEUTRON ; 
73       delete lambda ; 
74    }
75     if (type == kCHARGED) { 
76       if( tracksegment->GetEmcRecPoint()->GetDispersion() > fCutOnDispersion)  // shower dispersion cut
77         type = kCHARGEDHADRON ;
78       else  
79         type = kELECTRON ; 
80     } 
81     rp->SetType(type) ; 
82     index++ ; 
83   }
84     
85 }
86
87 //____________________________________________________________________________
88 void  AliPHOSPIDv1:: Print() 
89 {
90   cout << "AliPHOSPIDv1 : cuts for the particle idendification based on the shower profile " << endl 
91        << fLambda1m << " < value1 < " << fLambda1M << endl 
92        << fLambda2m << " < value2 < " << fLambda2M << endl ;  
93
94 }
95
96 //____________________________________________________________________________
97 void  AliPHOSPIDv1::SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M)
98 {
99   fLambda1m = l1m ; 
100   fLambda1M = l1M ; 
101   fLambda2m = l2m ; 
102   fLambda2M = l2M ; 
103 }