]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSPIDv1.cxx
Changes imposed by HP-UX which ignores the new C++ standart
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.cxx
CommitLineData
6ad0bfa0 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
b2a60966 16/* $Id$ */
17
6ad0bfa0 18//_________________________________________________________________________
b2a60966 19// Implementation version v1 of the PHOS particle identifier
20// Identification is based on information from PPSD and EMC
21//
22//*-- Author: Yves Schutz (SUBATECH)
23
6ad0bfa0 24
25// --- ROOT system ---
26
27// --- Standard library ---
28
de9ec31b 29#include <iostream.h>
6ad0bfa0 30
31// --- AliRoot header files ---
32
26d4b141 33#include "AliPHOSPIDv1.h"
6ad0bfa0 34#include "AliPHOSTrackSegment.h"
35#include "AliPHOSRecParticle.h"
36
26d4b141 37ClassImp( AliPHOSPIDv1)
6ad0bfa0 38
6ad0bfa0 39//____________________________________________________________________________
0dd37dda 40void AliPHOSPIDv1::MakeParticles(TrackSegmentsList * trsl, RecParticlesList * rpl)
6ad0bfa0 41{
b2a60966 42 // Makes a RecParticle out of a TrackSegment
6ad0bfa0 43
44 TIter next(trsl) ;
45 AliPHOSTrackSegment * tracksegment ;
46 Int_t index = 0 ;
09fc14a0 47 AliPHOSRecParticle * rp ;
0dd37dda 48 Int_t type ;
49
6ad0bfa0 50 while ( (tracksegment = (AliPHOSTrackSegment *)next()) ) {
09fc14a0 51 new( (*rpl)[index] ) AliPHOSRecParticle(tracksegment) ;
52 rp = (AliPHOSRecParticle *)(*rpl)[index] ;
0dd37dda 53
54 // try to figure out the type of particle:
55 // 1. just looking at the PPSD information
56 if( tracksegment->GetPpsdUp() == 0 ) { // Neutral
57
58 if( tracksegment->GetPpsdLow() == 0 ) // Neutral
59 type = kNEUTRAL ;
c1d256cb 60 else { // check the shower profile
61 AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
62 Float_t * lambda = new Float_t[2];
63 recp->GetElipsAxis(lambda) ;
64 if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
65 ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
66 type = kGAMMA ; // a well identified photon
67 else
68 type = kGAMMAHADRON ; // looks like a photon but is a hadron (most likely)
69 }
70 } // Neutral
0dd37dda 71 else // Charged
72 type = kCHARGED ;
73
74 // 2. from the shower profile analysis
75 if ( type == kNEUTRAL ) {
09fc14a0 76 AliPHOSEmcRecPoint * recp = tracksegment->GetEmcRecPoint() ;
77 Float_t * lambda = new Float_t[2];
78 recp->GetElipsAxis(lambda) ;
79 if ( ( lambda[0] > fLambda1m && lambda[0] < fLambda1M ) && // shower profile cut
80 ( lambda[1] > fLambda2m && lambda[1] < fLambda2M ) )
b9bbdad1 81 type = kNEUTRALEM ;
09fc14a0 82 else
b9bbdad1 83 type = kNEUTRALHADRON ;
09fc14a0 84 delete lambda ;
85 }
0dd37dda 86
87 // 3. from the shower dispersion
09fc14a0 88 if (type == kCHARGED) {
89 if( tracksegment->GetEmcRecPoint()->GetDispersion() > fCutOnDispersion) // shower dispersion cut
90 type = kCHARGEDHADRON ;
91 else
92 type = kELECTRON ;
93 }
94 rp->SetType(type) ;
6ad0bfa0 95 index++ ;
96 }
97
98}
99
09fc14a0 100//____________________________________________________________________________
101void AliPHOSPIDv1:: Print()
102{
b2a60966 103 // Print the parameters used for the particle type identification
104
09fc14a0 105 cout << "AliPHOSPIDv1 : cuts for the particle idendification based on the shower profile " << endl
106 << fLambda1m << " < value1 < " << fLambda1M << endl
107 << fLambda2m << " < value2 < " << fLambda2M << endl ;
108
109}
110
111//____________________________________________________________________________
112void AliPHOSPIDv1::SetShowerProfileCuts(Float_t l1m, Float_t l1M, Float_t l2m, Float_t l2M)
113{
b2a60966 114 // Modifies the parameters used for the particle type identification
115
09fc14a0 116 fLambda1m = l1m ;
117 fLambda1M = l1M ;
118 fLambda2m = l2m ;
119 fLambda2M = l2M ;
120}