]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSClusterizer.cxx
Elaborating split mode to write data only to the split files
[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
b2a60966 16/* $Id$ */
17
d15a28e7 18//_________________________________________________________________________
b2a60966 19// Base class for the clusterization algorithm (pure abstract)
baef0810 20//*--
b2a60966 21//*-- Author: Yves Schutz SUBATECH
d15a28e7 22//////////////////////////////////////////////////////////////////////////////
23
24// --- ROOT system ---
8d0f3f77 25#include "TGeometry.h"
26#include "TDirectory.h"
27#include "TFile.h"
28#include "TTree.h"
d15a28e7 29
d15a28e7 30
31// --- Standard library ---
8d0f3f77 32#include <iostream.h>
33#include <stdlib.h>
d15a28e7 34
35// --- AliRoot header files ---
8d0f3f77 36#include "AliRun.h"
d15a28e7 37#include "AliPHOSClusterizer.h"
8d0f3f77 38#include "AliHeader.h"
9bd3caba 39#include "AliPHOSGetter.h"
40#include "AliPHOSSDigitizer.h"
41#include "AliPHOSDigitizer.h"
d15a28e7 42
43ClassImp(AliPHOSClusterizer)
44
45//____________________________________________________________________________
7b7c1533 46 AliPHOSClusterizer::AliPHOSClusterizer():TTask("","")
9a1398dd 47{
48 // ctor
8d0f3f77 49 fSplitFile= 0 ;
fbf811ec 50 fToSplit = kFALSE ;
51// fHitsFileName = "" ;
52// fSDigitsFileName = "" ;
53// fDigitsFileName = "" ;
9bd3caba 54
9a1398dd 55}
8d0f3f77 56
9a1398dd 57//____________________________________________________________________________
fbf811ec 58AliPHOSClusterizer::AliPHOSClusterizer(const char* headerFile, const char* name, const Bool_t toSplit):
7b7c1533 59TTask(name, headerFile)
d15a28e7 60{
61 // ctor
fbf811ec 62 fToSplit = toSplit ;
8d0f3f77 63 fSplitFile= 0 ;
fbf811ec 64 // fDigitsFileName = headerFile ;
65 // AliPHOSGetter * gime = AliPHOSGetter::GetInstance(headerFile, name,toSplit) ;
66// gime->Event(0,"D") ;
67// fSDigitsFileName = gime->Digitizer()->GetTitle() ;
68// gime = AliPHOSGetter::GetInstance(fSDigitsFileName, name) ;
69// gime->Event(0,"S") ;
70// fHitsFileName = gime->SDigitizer()->GetTitle() ;
d15a28e7 71}
72
73//____________________________________________________________________________
74AliPHOSClusterizer::~AliPHOSClusterizer()
75{
76 // dtor
8d0f3f77 77
fbf811ec 78 fSplitFile = 0 ;
8d0f3f77 79}
80
fbf811ec 81// //____________________________________________________________________________
82// void AliPHOSClusterizer::SetSplitFile(const TString splitFileName)
83// {
84// // Diverts the RecPoints in a file separate from the Digits file
8d0f3f77 85
86
fbf811ec 87// TDirectory * cwd = gDirectory ;
88// fSplitFile = gAlice->InitTreeFile("R",splitFileName.Data());
89// fSplitFile->cd() ;
90// gAlice->Write(0, TObject::kOverwrite);
8d0f3f77 91
fbf811ec 92// TTree *treeE = gAlice->TreeE();
93// if (!treeE) {
94// cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> No TreeE found "<<endl;
95// abort() ;
96// }
8d0f3f77 97
fbf811ec 98// // copy TreeE
99// AliHeader *header = new AliHeader();
100// treeE->SetBranchAddress("Header", &header);
101// treeE->SetBranchStatus("*",1);
102// TTree *treeENew = treeE->CloneTree();
103// treeENew->Write(0, TObject::kOverwrite);
8d0f3f77 104
fbf811ec 105// // copy AliceGeom
106// TGeometry *AliceGeom = static_cast<TGeometry*>(cwd->Get("AliceGeom"));
107// if (!AliceGeom) {
108// cerr << "ERROR: AliPHOSClusterizer::SetSplitFile -> AliceGeom was not found in the input file "<<endl;
109// abort() ;
110// }
111// AliceGeom->Write(0, TObject::kOverwrite);
8d0f3f77 112
fbf811ec 113// gAlice->MakeTree("R", fSplitFile);
114// cwd->cd() ;
115// cout << "INFO: AliPHOSClusterizer::SetSPlitMode -> RecPoints will be stored in " << splitFileName.Data() << endl ;
116// }