X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PHOS%2FAliPHOSClusterizer.cxx;h=3b5af58d27cc1f5760f09191f143acfe4d36291f;hb=09b20ad1c29952cef09057dbfdfdb134149c5127;hp=4a695559560a145771c5886d51b9040b45757825;hpb=b2a609669e35c09c3298f41c1cf13e86bdcbb39d;p=u%2Fmrichter%2FAliRoot.git diff --git a/PHOS/AliPHOSClusterizer.cxx b/PHOS/AliPHOSClusterizer.cxx index 4a695559560..3b5af58d27c 100644 --- a/PHOS/AliPHOSClusterizer.cxx +++ b/PHOS/AliPHOSClusterizer.cxx @@ -13,36 +13,96 @@ * provided "as is" without express or implied warranty. * **************************************************************************/ -/* $Id$ */ - //_________________________________________________________________________ // Base class for the clusterization algorithm (pure abstract) -// +//*-- //*-- Author: Yves Schutz SUBATECH ////////////////////////////////////////////////////////////////////////////// -// --- ROOT system --- - - - -// --- Standard library --- - - - -// --- AliRoot header files --- +#include +#include #include "AliPHOSClusterizer.h" +#include "AliPHOSDigit.h" +#include "AliLog.h" ClassImp(AliPHOSClusterizer) +AliPHOSCalibData * AliPHOSClusterizer::fgCalibData = 0 ; + +//____________________________________________________________________________ +AliPHOSClusterizer::AliPHOSClusterizer(): + fGeom(NULL), + fDigitsArr(0), + fTreeR(0), + fEMCRecPoints(0), + fCPVRecPoints(0) +{ + // ctor +} + //____________________________________________________________________________ -AliPHOSClusterizer::AliPHOSClusterizer() +AliPHOSClusterizer::AliPHOSClusterizer(AliPHOSGeometry *geom): + fGeom(geom), + fDigitsArr(0), + fTreeR(0), + fEMCRecPoints(0), + fCPVRecPoints(0) { // ctor + } //____________________________________________________________________________ AliPHOSClusterizer::~AliPHOSClusterizer() { // dtor + 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 = new TClonesArray("AliPHOSDigit",100); + 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"); + fEMCRecPoints = new TObjArray(100) ; + fEMCRecPoints->SetName("EMCRECPOINTS") ; + Int_t split = 0; + Int_t bufsize = 32000; + fTreeR->Branch("PHOSEmcRP", "TObjArray", &fEMCRecPoints, bufsize, split); + + AliDebug(9, "Making array for CPV clusters"); + fCPVRecPoints = new TObjArray(100) ; + fCPVRecPoints->SetName("CPVRECPOINTS") ; + fTreeR->Branch("PHOSCpvRP", "TObjArray", &fCPVRecPoints, bufsize, split); }