]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCcalibBase.cxx
Eff C++ warnings removal (Marian)
[u/mrichter/AliRoot.git] / TPC / AliTPCcalibBase.cxx
CommitLineData
3ab35fc5 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
16
17///////////////////////////////////////////////////////////////////////////////
18// //
19// Base class for the calibration components using
20// as input TPCseeds and ESDs
21// Event loop outside of the component
22//
23//
ae28e92e 24// Base functionality to be implemeneted by component
25/*
26 //In some cases only one of this function to be implemented
27 virtual void Process(AliESDEvent *event)
28 virtual void Process(AliTPCseed *track)
29 //
30 virtual Long64_t Merge(TCollection *li);
31 virtual void Analyze()
32 void Terminate();
33*/
34// Functionality provided by base class for Algorith debuging:
35// TTreeSRedirector * cstream = GetDebugStreamer() - get debug streamer which can be use for numerical debugging
36//
37
38
39
40// marian.ivanov@cern.ch
3ab35fc5 41//
42#include "AliTPCcalibBase.h"
f7f33dec 43#include "TSystem.h"
44#include "TFile.h"
ae28e92e 45#include "TTreeStream.h"
f7f33dec 46#include "AliLog.h"
47328338 47#include "TTimeStamp.h"
108953e9 48#include "AliESDEvent.h"
f7f33dec 49
3ab35fc5 50
51ClassImp(AliTPCcalibBase)
52
ae28e92e 53AliTPCcalibBase::AliTPCcalibBase():
54 TNamed(),
55 fDebugStreamer(0),
108953e9 56 fStreamLevel(0),
57 fRun(0), //! current Run number
58 fEvent(0), //! current Event number
59 fTime(0), //! current Time
60 fTrigger(0), //! current trigger type
61 fMagF(0), //! current magnetic field
ae28e92e 62 fDebugLevel(0)
3ab35fc5 63{
64 //
65 // Constructor
66 //
67}
68
ae28e92e 69AliTPCcalibBase::AliTPCcalibBase(const AliTPCcalibBase&calib):
70 TNamed(calib),
71 fDebugStreamer(0),
72 fStreamLevel(calib.fStreamLevel),
73 fDebugLevel(calib.fDebugLevel)
74{
75 //
76 // copy constructor
77 //
78}
79
80AliTPCcalibBase &AliTPCcalibBase::operator=(const AliTPCcalibBase&calib){
81 //
82 //
83 //
84 ((TNamed *)this)->operator=(calib);
85 fDebugStreamer=0;
86 fStreamLevel=calib.fStreamLevel;
87 fDebugLevel=calib.fDebugLevel;
525062ee 88 return *this;
ae28e92e 89}
90
91
3ab35fc5 92AliTPCcalibBase::~AliTPCcalibBase() {
93 //
94 // destructor
95 //
f7f33dec 96 if (fDebugLevel>0) printf("AliTPCcalibBase::~AliTPCcalibBase\n");
ae28e92e 97 if (fDebugStreamer) delete fDebugStreamer;
98 fDebugStreamer=0;
99}
100
101void AliTPCcalibBase::Terminate(){
102 //
103 //
104 //
f7f33dec 105 if (fDebugLevel>0) printf("AliTPCcalibBase::Terminate\n");
ae28e92e 106 if (fDebugStreamer) delete fDebugStreamer;
107 fDebugStreamer = 0;
108 return;
109}
110
111TTreeSRedirector *AliTPCcalibBase::GetDebugStreamer(){
112 //
113 // Get Debug streamer
114 // In case debug streamer not yet initialized and StreamLevel>0 create new one
115 //
116 if (fStreamLevel==0) return 0;
117 if (fDebugStreamer) return fDebugStreamer;
118 TString dsName;
119 dsName=GetName();
120 dsName+="Debug.root";
121 dsName.ReplaceAll(" ","");
122 fDebugStreamer = new TTreeSRedirector(dsName.Data());
123 return fDebugStreamer;
3ab35fc5 124}
f7f33dec 125
126
108953e9 127void AliTPCcalibBase::UpdateEventInfo(AliESDEvent * event){
128 //
129 //
130 //
131 fRun = event->GetRunNumber();
132 fEvent = event->GetEventNumberInFile();
133 fTime = event->GetTimeStamp();
134 fTrigger = event->GetTriggerMask();
135 fMagF = event->GetMagneticField();
136}
137
f7f33dec 138void AliTPCcalibBase::RegisterDebugOutput(const char *path){
139 //
140 // store - copy debug output to the destination position
141 // currently ONLY for local copy
142 if (fDebugLevel>0) printf("AliTPCcalibBase::RegisterDebugOutput(%s)\n",path);
143 if (fStreamLevel==0) return;
144 TString dsName;
145 dsName=GetName();
146 dsName+="Debug.root";
147 dsName.ReplaceAll(" ","");
148 TString dsName2=path;
149 gSystem->MakeDirectory(dsName2.Data());
150 dsName2+=gSystem->HostName();
151 gSystem->MakeDirectory(dsName2.Data());
152 dsName2+="/";
47328338 153 TTimeStamp s;
154 dsName2+=Int_t(s.GetNanoSec());
155 dsName2+="/";
156 gSystem->MakeDirectory(dsName2.Data());
f7f33dec 157 dsName2+=dsName;
158 AliInfo(Form("copy %s\t%s\n",dsName.Data(),dsName2.Data()));
159 printf("copy %s\t%s\n",dsName.Data(),dsName2.Data());
160 TFile::Cp(dsName.Data(),dsName2.Data());
161}