]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSClusterizer.cxx
tree is written
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizer.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 **************************************************************************/
15
16//_________________________________________________________________________
b2a60966 17// Base class for the clusterization algorithm (pure abstract)
baef0810 18//*--
b2a60966 19//*-- Author: Yves Schutz SUBATECH
d15a28e7 20//////////////////////////////////////////////////////////////////////////////
21
9a2cdbdf 22#include <TClonesArray.h>
23#include <TTree.h>
d15a28e7 24
d15a28e7 25#include "AliPHOSClusterizer.h"
9a2cdbdf 26#include "AliPHOSDigit.h"
d76c31f4 27#include "AliLog.h"
75e8b893 28
d15a28e7 29ClassImp(AliPHOSClusterizer)
30
31//____________________________________________________________________________
0378398c 32AliPHOSClusterizer::AliPHOSClusterizer():
9a2cdbdf 33 fGeom(NULL),
9a2cdbdf 34 fDigitsArr(0),
35 fTreeR(0),
36 fEMCRecPoints(0),
37 fCPVRecPoints(0)
9a1398dd 38{
9a2cdbdf 39 // ctor
9a1398dd 40}
8d0f3f77 41
9a1398dd 42//____________________________________________________________________________
9a2cdbdf 43AliPHOSClusterizer::AliPHOSClusterizer(AliPHOSGeometry *geom):
44 fGeom(geom),
9a2cdbdf 45 fDigitsArr(0),
46 fTreeR(0),
47 fEMCRecPoints(0),
48 fCPVRecPoints(0)
d15a28e7 49{
50 // ctor
d76c31f4 51
d15a28e7 52}
53
54//____________________________________________________________________________
55AliPHOSClusterizer::~AliPHOSClusterizer()
56{
57 // dtor
9a2cdbdf 58 if (fDigitsArr) {
59 fDigitsArr->Delete();
60 delete fDigitsArr;
61 }
62 if (fEMCRecPoints) {
63 fEMCRecPoints->Delete();
64 delete fEMCRecPoints;
65 }
66 if (fCPVRecPoints) {
67 fCPVRecPoints->Delete();
68 delete fCPVRecPoints;
69 }
8d0f3f77 70}
71
9a2cdbdf 72//____________________________________________________________________________
73void AliPHOSClusterizer::SetInput(TTree * digitsTree)
74{
75 // Get the tree with digits and sets
76 // the input array with digits for PHOS
77 TBranch *branch = digitsTree->GetBranch("PHOS");
78 if (!branch) {
79 AliError("can't get the branch with the PHOS digits !");
80 return;
81 }
82 fDigitsArr = new TClonesArray("AliPHOSDigit",100);
83 branch->SetAddress(&fDigitsArr);
84 branch->GetEntry(0);
85}
86
87//____________________________________________________________________________
88void AliPHOSClusterizer::SetOutput(TTree * clustersTree)
89{
90 // Set the output clusters tree,
91 // creates the arrays for EMC and CPV,
92 // and set the corresponding branch addresses
93 fTreeR = clustersTree;
8d0f3f77 94
9a2cdbdf 95 AliDebug(9, "Making array for EMC clusters");
96 fEMCRecPoints = new TObjArray(100) ;
97 fEMCRecPoints->SetName("EMCRECPOINTS") ;
98 Int_t split = 0;
99 Int_t bufsize = 32000;
100 fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split);
101
102 AliDebug(9, "Making array for CPV clusters");
103 fCPVRecPoints = new TObjArray(100) ;
104 fCPVRecPoints->SetName("CPVRECPOINTS") ;
105 fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split);
106}