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