possiblity to read ESD friends and TPC outer check (Jacek)
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALClusterizer.cxx
CommitLineData
483b0559 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// Base class for the clusterization algorithm (pure abstract)
20//*--
21//*-- Author: Yves Schutz SUBATECH
05a92d59 22// Modif:
23// August 2002 Yves Schutz: clone PHOS as closely as possible and intoduction
24// of new IO (à la PHOS)
483b0559 25//////////////////////////////////////////////////////////////////////////////
26
27// --- ROOT system ---
c47157cd 28#include "TClonesArray.h"
29#include "TTree.h"
483b0559 30
31// --- Standard library ---
d64c959b 32
483b0559 33
34// --- AliRoot header files ---
483b0559 35#include "AliEMCALClusterizer.h"
c47157cd 36#include "AliLog.h"
483b0559 37
38ClassImp(AliEMCALClusterizer)
39
40//____________________________________________________________________________
c47157cd 41AliEMCALClusterizer::AliEMCALClusterizer():
42 fDigitsArr(NULL),
43 fTreeR(NULL),
44 fRecPoints(NULL)
483b0559 45{
46 // ctor
47}
839828a6 48
483b0559 49//____________________________________________________________________________
c47157cd 50AliEMCALClusterizer::~AliEMCALClusterizer()
483b0559 51{
c47157cd 52 // dtor
53 if (fDigitsArr) {
54 fDigitsArr->Delete();
55 delete fDigitsArr;
56 }
57 if (fRecPoints) {
58 fRecPoints->Delete();
59 delete fRecPoints;
60 }
18a21c7c 61}
62
63//____________________________________________________________________________
c47157cd 64void AliEMCALClusterizer::SetInput(TTree *digitsTree)
18a21c7c 65{
c47157cd 66 // Read the digits from the input tree
67 TBranch *branch = digitsTree->GetBranch("EMCAL");
68 if (!branch) {
69 AliError("can't get the branch with the EMCAL digits !");
70 return;
71 }
72 fDigitsArr = new TClonesArray("AliEMCALDigit",100);
73 branch->SetAddress(&fDigitsArr);
74 branch->GetEntry(0);
483b0559 75}
76
77//____________________________________________________________________________
c47157cd 78void AliEMCALClusterizer::SetOutput(TTree *clustersTree)
483b0559 79{
c47157cd 80 // Read the digits from the input tree
81 fTreeR = clustersTree;
82
83 AliDebug(9, "Making array for EMCAL clusters");
84 fRecPoints = new TObjArray(100) ;
85 Int_t split = 0;
86 Int_t bufsize = 32000;
87 fTreeR->Branch("EMCALECARP", "TObjArray", &fRecPoints, bufsize, split);
88cb7938 88}