First implementation of neural network PID
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPID.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// Algorithm class for the identification of particles detected in PHOS
2f04ed65 20// base class of identified particle
21// Why should I put meaningless comments
22// just to satisfy
23// the code checker
24
b2a60966 25//
7acf6008 26//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko
b2a60966 27
6ad0bfa0 28
29// --- ROOT system ---
e957fea8 30
6ad0bfa0 31// --- Standard library ---
6ad0bfa0 32
6ad0bfa0 33// --- AliRoot header files ---
e957fea8 34#include "AliConfig.h"
26d4b141 35#include "AliPHOSPID.h"
b135d5f2 36#include "AliPHOSGetter.h"
ddd1a39c 37#include "AliPHOSQualAssDataMaker.h"
6ad0bfa0 38
26d4b141 39ClassImp(AliPHOSPID)
6ad0bfa0 40
41//____________________________________________________________________________
0378398c 42AliPHOSPID::AliPHOSPID():
9a2cdbdf 43 TObject(),
44 fGeom(NULL),
45 fESD(0x0),
46 fEMCRecPoints(NULL),
47 fCPVRecPoints(NULL),
48 fTrackSegments(NULL),
49 fRecParticles(NULL),
ddd1a39c 50 fQADM(0x0)
6ad0bfa0 51{
52 // ctor
53}
7b7c1533 54
8d0f3f77 55
7acf6008 56//____________________________________________________________________________
9a2cdbdf 57AliPHOSPID::AliPHOSPID(AliPHOSGeometry *geom):
58 TObject(),
59 fGeom(geom),
60 fESD(0x0),
61 fEMCRecPoints(NULL),
62 fCPVRecPoints(NULL),
63 fTrackSegments(NULL),
64 fRecParticles(NULL),
ddd1a39c 65 fQADM(0x0)
7acf6008 66{
67 // ctor
9a2cdbdf 68 fRecParticles = new TClonesArray("AliPHOSRecParticle",100) ;
69 fRecParticles->SetName("RECPARTICLES");
70
ddd1a39c 71 fQADM = new AliPHOSQualAssDataMaker() ; //!Quality Assurance Data Maker
72 GetQualAssDataMaker()->Init(AliQualAss::kRECPARTICLES) ;
b2820c13 73}
74
75//____________________________________________________________________________
e2429969 76AliPHOSPID::AliPHOSPID(const AliPHOSPID & pid) :
9a2cdbdf 77 TObject(pid),
78 fGeom(pid.fGeom),
ddd1a39c 79 fESD(pid.fESD),
9a2cdbdf 80 fEMCRecPoints(pid.fEMCRecPoints),
81 fCPVRecPoints(pid.fCPVRecPoints),
82 fTrackSegments(pid.fTrackSegments),
83 fRecParticles(pid.fRecParticles),
ddd1a39c 84 fQADM(pid.fQADM)
e2429969 85{
86 // Copy constructor
87}
9a2cdbdf 88
e2429969 89//____________________________________________________________________________
26d4b141 90AliPHOSPID::~AliPHOSPID()
6ad0bfa0 91{
92 // dtor
9a2cdbdf 93 if (fEMCRecPoints) {
94 fEMCRecPoints->Delete();
95 delete fEMCRecPoints;
96 }
97 if (fCPVRecPoints) {
98 fCPVRecPoints->Delete();
99 delete fCPVRecPoints;
100 }
ddd1a39c 101 delete fQADM ;
8d0f3f77 102}
88cb7938 103
9a2cdbdf 104//____________________________________________________________________________
105void AliPHOSPID::SetInput(TTree *clustersTree, TClonesArray *trackSegments)
106{
107 // Read the clusters tree and creates the
108 // arrays with the EMC and CPV
109 // clusters.
110 // and set the corresponding branch addresses
111
112 fTrackSegments = trackSegments;
113
114 TBranch *emcbranch = clustersTree->GetBranch("PHOSEmcRP");
115 if (!emcbranch) {
116 AliError("can't get the branch with the PHOS EMC clusters !");
117 return;
118 }
119 fEMCRecPoints = new TObjArray(100) ;
120 emcbranch->SetAddress(&fEMCRecPoints);
121 emcbranch->GetEntry(0);
122
123 TBranch *cpvbranch = clustersTree->GetBranch("PHOSCpvRP");
124 if (!cpvbranch) {
125 AliError("can't get the branch with the PHOS CPV clusters !");
126 return;
127 }
128 fCPVRecPoints = new TObjArray(100) ;
129 cpvbranch->SetAddress(&fCPVRecPoints);
130 cpvbranch->GetEntry(0);
131}