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