]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSClusterizer.cxx
First implementation of neural network PID
[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"
75e8b893 26#include "AliPHOSQualAssDataMaker.h"
9a2cdbdf 27#include "AliPHOSDigit.h"
75e8b893 28
d15a28e7 29ClassImp(AliPHOSClusterizer)
30
31//____________________________________________________________________________
0378398c 32AliPHOSClusterizer::AliPHOSClusterizer():
9a2cdbdf 33 fGeom(NULL),
34 fQADM(0),
35 fDigitsArr(0),
36 fTreeR(0),
37 fEMCRecPoints(0),
38 fCPVRecPoints(0)
9a1398dd 39{
9a2cdbdf 40 // ctor
9a1398dd 41}
8d0f3f77 42
9a1398dd 43//____________________________________________________________________________
9a2cdbdf 44AliPHOSClusterizer::AliPHOSClusterizer(AliPHOSGeometry *geom):
45 fGeom(geom),
46 fQADM(0),
47 fDigitsArr(0),
48 fTreeR(0),
49 fEMCRecPoints(0),
50 fCPVRecPoints(0)
d15a28e7 51{
52 // ctor
75e8b893 53 fQADM = new AliPHOSQualAssDataMaker() ;
54 //initiaizes the quality assurance data maker
55 fQADM ->Init(AliQualAss::kRECPOINTS) ;
d15a28e7 56}
57
58//____________________________________________________________________________
59AliPHOSClusterizer::~AliPHOSClusterizer()
60{
61 // dtor
a5fa6165 62 delete fQADM ;
9a2cdbdf 63 if (fDigitsArr) {
64 fDigitsArr->Delete();
65 delete fDigitsArr;
66 }
67 if (fEMCRecPoints) {
68 fEMCRecPoints->Delete();
69 delete fEMCRecPoints;
70 }
71 if (fCPVRecPoints) {
72 fCPVRecPoints->Delete();
73 delete fCPVRecPoints;
74 }
8d0f3f77 75}
76
9a2cdbdf 77//____________________________________________________________________________
78void AliPHOSClusterizer::SetInput(TTree * digitsTree)
79{
80 // Get the tree with digits and sets
81 // the input array with digits for PHOS
82 TBranch *branch = digitsTree->GetBranch("PHOS");
83 if (!branch) {
84 AliError("can't get the branch with the PHOS digits !");
85 return;
86 }
87 fDigitsArr = new TClonesArray("AliPHOSDigit",100);
88 branch->SetAddress(&fDigitsArr);
89 branch->GetEntry(0);
90}
91
92//____________________________________________________________________________
93void AliPHOSClusterizer::SetOutput(TTree * clustersTree)
94{
95 // Set the output clusters tree,
96 // creates the arrays for EMC and CPV,
97 // and set the corresponding branch addresses
98 fTreeR = clustersTree;
8d0f3f77 99
9a2cdbdf 100 AliDebug(9, "Making array for EMC clusters");
101 fEMCRecPoints = new TObjArray(100) ;
102 fEMCRecPoints->SetName("EMCRECPOINTS") ;
103 Int_t split = 0;
104 Int_t bufsize = 32000;
105 fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split);
106
107 AliDebug(9, "Making array for CPV clusters");
108 fCPVRecPoints = new TObjArray(100) ;
109 fCPVRecPoints->SetName("CPVRECPOINTS") ;
110 fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split);
111}