X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSClusterizer.cxx;h=77fce84bdece2ff7701f5663e9f6176883c4b6d1;hb=66be9a4ed2f499b0d314c260f09305740637285e;hp=4aadfa7a031259bcbf8ff18dea066ff7219ea1aa;hpb=21cd0c07a367c6e6836907ecf5222aef9cb05c05;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSClusterizer.cxx b/PHOS/AliPHOSClusterizer.cxx index 4aadfa7a031..77fce84bdec 100644 --- a/PHOS/AliPHOSClusterizer.cxx +++ b/PHOS/AliPHOSClusterizer.cxx @@ -13,58 +13,101 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id$ */ - //_________________________________________________________________________ // Base class for the clusterization algorithm (pure abstract) //*-- //*-- Author: Yves Schutz SUBATECH ////////////////////////////////////////////////////////////////////////////// -// --- ROOT system --- -#include "TGeometry.h" -#include "TDirectory.h" -#include "TFile.h" -#include "TTree.h" - -// --- Standard library --- -#include +#include +#include -// --- AliRoot header files --- -#include "AliRun.h" #include "AliPHOSClusterizer.h" -#include "AliHeader.h" -#include "AliPHOSGetter.h" -#include "AliPHOSSDigitizer.h" -#include "AliPHOSDigitizer.h" +#include "AliPHOSDigit.h" +#include "AliLog.h" ClassImp(AliPHOSClusterizer) +AliPHOSCalibData * AliPHOSClusterizer::fgCalibData = 0 ; + //____________________________________________________________________________ - AliPHOSClusterizer::AliPHOSClusterizer():TTask("","") +AliPHOSClusterizer::AliPHOSClusterizer(): + fGeom(NULL), + fDigitsArr(0), + fTreeR(0), + fEMCRecPoints(0), + fCPVRecPoints(0) { // ctor - fSplitFile= 0 ; - fToSplit = kFALSE ; - + fDigitsArr = new TClonesArray("AliPHOSDigit",100); + fEMCRecPoints = new TObjArray(100) ; + fEMCRecPoints ->SetName("EMCRECPOINTS") ; + fCPVRecPoints = new TObjArray(100) ; + fCPVRecPoints ->SetName("CPVRECPOINTS") ; } //____________________________________________________________________________ -AliPHOSClusterizer::AliPHOSClusterizer(const char* headerFile, const char* name, const Bool_t toSplit): -TTask(name, headerFile) +AliPHOSClusterizer::AliPHOSClusterizer(AliPHOSGeometry *geom): + fGeom(geom), + fDigitsArr(0), + fTreeR(0), + fEMCRecPoints(0), + fCPVRecPoints(0) { // ctor - fToSplit = toSplit ; - fSplitFile= 0 ; - + fDigitsArr = new TClonesArray("AliPHOSDigit",100); + fEMCRecPoints = new TObjArray(100) ; + fEMCRecPoints ->SetName("EMCRECPOINTS") ; + fCPVRecPoints = new TObjArray(100) ; + fCPVRecPoints ->SetName("CPVRECPOINTS") ; } //____________________________________________________________________________ AliPHOSClusterizer::~AliPHOSClusterizer() { // dtor - - fSplitFile = 0 ; + if (fDigitsArr) { + fDigitsArr->Delete(); + delete fDigitsArr; + } + if (fEMCRecPoints) { + fEMCRecPoints->Delete(); + delete fEMCRecPoints; + } + if (fCPVRecPoints) { + fCPVRecPoints->Delete(); + delete fCPVRecPoints; + } } +//____________________________________________________________________________ +void AliPHOSClusterizer::SetInput(TTree * digitsTree) +{ + // Get the tree with digits and sets + // the input array with digits for PHOS + TBranch *branch = digitsTree->GetBranch("PHOS"); + if (!branch) { + AliError("can't get the branch with the PHOS digits !"); + return; + } + fDigitsArr->Clear("C"); + branch->SetAddress(&fDigitsArr); + branch->GetEntry(0); +} + +//____________________________________________________________________________ +void AliPHOSClusterizer::SetOutput(TTree * clustersTree) +{ + // Set the output clusters tree, + // creates the arrays for EMC and CPV, + // and set the corresponding branch addresses + fTreeR = clustersTree; + + AliDebug(9, "Making array for EMC clusters"); + Int_t split = 0; + Int_t bufsize = 32000; + fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split); + AliDebug(9, "Making array for CPV clusters"); + fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split); +}