make sure EMCal trigger-cluster matching is done when event is EMCal triggered, in...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSTrackSegmentMaker.cxx
CommitLineData
d15a28e7 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 **************************************************************************/
b2a60966 15/* $Id$ */
702ab87e 16
17/* History of cvs commits:
18 *
19 * $Log$
d76c31f4 20 * Revision 1.29 2007/08/28 12:55:08 policheh
21 * Loaders removed from the reconstruction code (C.Cheshkov)
22 *
9a2cdbdf 23 * Revision 1.28 2007/08/07 14:12:03 kharlov
24 * Quality assurance added (Yves Schutz)
25 *
ddd1a39c 26 * Revision 1.27 2006/08/25 16:56:30 kharlov
27 * Compliance with Effective C++
28 *
0378398c 29 * Revision 1.26 2006/08/25 16:00:53 kharlov
30 * Compliance with Effective C++AliPHOSHit.cxx
31 *
e2429969 32 * Revision 1.25 2005/05/28 14:19:05 schutz
33 * Compilation warnings fixed by T.P.
34 *
702ab87e 35 */
36
d15a28e7 37//_________________________________________________________________________
b2a60966 38// Algorithm Base class to construct PHOS track segments
39// Associates EMC and PPSD clusters
40// Unfolds the EMC cluster
baef0810 41//*--
b2a60966 42//*-- Author: Dmitri Peressounko (RRC Ki & SUBATECH)
43
d15a28e7 44
45// --- ROOT system ---
9a2cdbdf 46#include "TTree.h"
d15a28e7 47
d15a28e7 48// --- Standard library ---
49
d15a28e7 50// --- AliRoot header files ---
2731cd1e 51#include "AliPHOSTrackSegmentMaker.h"
d76c31f4 52#include "AliLog.h"
d15a28e7 53
54ClassImp( AliPHOSTrackSegmentMaker)
55
56
57//____________________________________________________________________________
0378398c 58AliPHOSTrackSegmentMaker:: AliPHOSTrackSegmentMaker() :
9a2cdbdf 59 TObject(),
ddd1a39c 60 fESD(0),
9a2cdbdf 61 fGeom(0),
62 fEMCRecPoints(0),
63 fCPVRecPoints(0)
d15a28e7 64{
ddd1a39c 65 // ctor
dcab1c7e 66 fEMCRecPoints = new TObjArray(100) ;
67 fCPVRecPoints = new TObjArray(100) ;
8d0f3f77 68}
69
70//____________________________________________________________________________
9a2cdbdf 71AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(AliPHOSGeometry *geom):
72 TObject(),
ddd1a39c 73 fESD(0),
9a2cdbdf 74 fGeom(geom),
75 fEMCRecPoints(0),
76 fCPVRecPoints(0)
b9791748 77{
78 // ctor
dcab1c7e 79 fEMCRecPoints = new TObjArray(100) ;
80 fCPVRecPoints = new TObjArray(100) ;
b9791748 81}
82
83//____________________________________________________________________________
e2429969 84AliPHOSTrackSegmentMaker::AliPHOSTrackSegmentMaker(const AliPHOSTrackSegmentMaker & tsmaker) :
9a2cdbdf 85 TObject(tsmaker),
ddd1a39c 86 fESD(tsmaker.GetESD()),
9a2cdbdf 87 fGeom(tsmaker.fGeom),
88 fEMCRecPoints(tsmaker.fEMCRecPoints),
89 fCPVRecPoints(tsmaker.fCPVRecPoints)
e2429969 90{
91 //Copy constructor
92}
93
94//____________________________________________________________________________
8d0f3f77 95AliPHOSTrackSegmentMaker::~AliPHOSTrackSegmentMaker()
96{
7fb9892d 97 //Remove this from the parental task before destroying
9a2cdbdf 98 if (fEMCRecPoints) {
99 fEMCRecPoints->Delete();
100 delete fEMCRecPoints;
101 }
102 if (fCPVRecPoints) {
103 fCPVRecPoints->Delete();
104 delete fCPVRecPoints;
105 }
2731cd1e 106}
107
9a2cdbdf 108//____________________________________________________________________________
109void AliPHOSTrackSegmentMaker::SetInput(TTree *clustersTree)
110{
dcab1c7e 111 // Read the clusters tree and set addresses to the
112 // arrays with the EMC and CPV clusters
9a2cdbdf 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 }
9a2cdbdf 119 emcbranch->SetAddress(&fEMCRecPoints);
dcab1c7e 120 fEMCRecPoints->Delete();
9a2cdbdf 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 }
9a2cdbdf 128 cpvbranch->SetAddress(&fCPVRecPoints);
dcab1c7e 129 fCPVRecPoints->Delete();
9a2cdbdf 130 cpvbranch->GetEntry(0);
131}