1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //_________________________________________________________________________
19 // Base class for the clusterization algorithm (pure abstract)
21 //*-- Author: Yves Schutz SUBATECH
22 //////////////////////////////////////////////////////////////////////////////
24 // --- ROOT system ---
25 #include "TGeometry.h"
26 #include "TDirectory.h"
31 // --- Standard library ---
35 // --- AliRoot header files ---
37 #include "AliPHOSClusterizer.h"
38 #include "AliHeader.h"
40 ClassImp(AliPHOSClusterizer)
42 //____________________________________________________________________________
43 AliPHOSClusterizer::AliPHOSClusterizer():TTask("","")
49 //____________________________________________________________________________
50 AliPHOSClusterizer::AliPHOSClusterizer(const char* headerFile, const char* name):
51 TTask(name, headerFile)
58 //____________________________________________________________________________
59 AliPHOSClusterizer::~AliPHOSClusterizer()
66 //____________________________________________________________________________
67 void AliPHOSClusterizer::SetSplitFile(const TString splitFileName)
69 // Diverts the RecPoints in a file separate from the Digits file
72 TDirectory * cwd = gDirectory ;
73 fSplitFile = gAlice->InitTreeFile("R",splitFileName.Data());
75 gAlice->Write(0, TObject::kOverwrite);
77 TTree *treeE = gAlice->TreeE();
79 cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> No TreeE found "<<endl;
84 AliHeader *header = new AliHeader();
85 treeE->SetBranchAddress("Header", &header);
86 treeE->SetBranchStatus("*",1);
87 TTree *treeENew = treeE->CloneTree();
88 treeENew->Write(0, TObject::kOverwrite);
91 TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
93 cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
96 AliceGeom->Write(0, TObject::kOverwrite);
98 gAlice->MakeTree("R", fSplitFile);
100 cout << "INFO: AliPHOSClusterizer::SetSPlitMode -> RecPoints will be stored in " << splitFileName.Data() << endl ;