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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // Base class for the calibration components using
20 // as input TPCseeds and ESDs
21 // Event loop outside of the component
24 // Base functionality to be implemeneted by component
26 //In some cases only one of this function to be implemented
27 virtual void Process(AliESDEvent *event)
28 virtual void Process(AliTPCseed *track)
30 virtual Long64_t Merge(TCollection *li);
31 virtual void Analyze()
34 // Functionality provided by base class for Algorith debuging:
35 // TTreeSRedirector * cstream = GetDebugStreamer() - get debug streamer which can be use for numerical debugging
40 // marian.ivanov@cern.ch
42 #include "AliTPCcalibBase.h"
45 #include "TTreeStream.h"
47 #include "TTimeStamp.h"
50 ClassImp(AliTPCcalibBase)
52 AliTPCcalibBase::AliTPCcalibBase():
63 AliTPCcalibBase::AliTPCcalibBase(const AliTPCcalibBase&calib):
66 fStreamLevel(calib.fStreamLevel),
67 fDebugLevel(calib.fDebugLevel)
74 AliTPCcalibBase &AliTPCcalibBase::operator=(const AliTPCcalibBase&calib){
78 ((TNamed *)this)->operator=(calib);
80 fStreamLevel=calib.fStreamLevel;
81 fDebugLevel=calib.fDebugLevel;
86 AliTPCcalibBase::~AliTPCcalibBase() {
90 if (fDebugLevel>0) printf("AliTPCcalibBase::~AliTPCcalibBase\n");
91 if (fDebugStreamer) delete fDebugStreamer;
95 void AliTPCcalibBase::Terminate(){
99 if (fDebugLevel>0) printf("AliTPCcalibBase::Terminate\n");
100 if (fDebugStreamer) delete fDebugStreamer;
105 TTreeSRedirector *AliTPCcalibBase::GetDebugStreamer(){
107 // Get Debug streamer
108 // In case debug streamer not yet initialized and StreamLevel>0 create new one
110 if (fStreamLevel==0) return 0;
111 if (fDebugStreamer) return fDebugStreamer;
114 dsName+="Debug.root";
115 dsName.ReplaceAll(" ","");
116 fDebugStreamer = new TTreeSRedirector(dsName.Data());
117 return fDebugStreamer;
121 void AliTPCcalibBase::RegisterDebugOutput(const char *path){
123 // store - copy debug output to the destination position
124 // currently ONLY for local copy
125 if (fDebugLevel>0) printf("AliTPCcalibBase::RegisterDebugOutput(%s)\n",path);
126 if (fStreamLevel==0) return;
129 dsName+="Debug.root";
130 dsName.ReplaceAll(" ","");
131 TString dsName2=path;
132 gSystem->MakeDirectory(dsName2.Data());
133 dsName2+=gSystem->HostName();
134 gSystem->MakeDirectory(dsName2.Data());
137 dsName2+=Int_t(s.GetNanoSec());
139 gSystem->MakeDirectory(dsName2.Data());
141 AliInfo(Form("copy %s\t%s\n",dsName.Data(),dsName2.Data()));
142 printf("copy %s\t%s\n",dsName.Data(),dsName2.Data());
143 TFile::Cp(dsName.Data(),dsName2.Data());