]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCcalibBase.cxx
adding parentheses following gcc 4.3 suggestion
[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),
e5cbd73f 73 fRun(0), //! current Run number
74 fEvent(0), //! current Event number
75 fTime(0), //! current Time
76 fTrigger(0), //! current trigger type
77 fMagF(0), //! current magnetic field
ae28e92e 78 fDebugLevel(calib.fDebugLevel)
79{
80 //
81 // copy constructor
82 //
83}
84
85AliTPCcalibBase &AliTPCcalibBase::operator=(const AliTPCcalibBase&calib){
86 //
87 //
88 //
89 ((TNamed *)this)->operator=(calib);
90 fDebugStreamer=0;
91 fStreamLevel=calib.fStreamLevel;
92 fDebugLevel=calib.fDebugLevel;
525062ee 93 return *this;
ae28e92e 94}
95
96
3ab35fc5 97AliTPCcalibBase::~AliTPCcalibBase() {
98 //
99 // destructor
100 //
f7f33dec 101 if (fDebugLevel>0) printf("AliTPCcalibBase::~AliTPCcalibBase\n");
ae28e92e 102 if (fDebugStreamer) delete fDebugStreamer;
103 fDebugStreamer=0;
104}
105
106void AliTPCcalibBase::Terminate(){
107 //
108 //
109 //
f7f33dec 110 if (fDebugLevel>0) printf("AliTPCcalibBase::Terminate\n");
ae28e92e 111 if (fDebugStreamer) delete fDebugStreamer;
112 fDebugStreamer = 0;
113 return;
114}
115
116TTreeSRedirector *AliTPCcalibBase::GetDebugStreamer(){
117 //
118 // Get Debug streamer
119 // In case debug streamer not yet initialized and StreamLevel>0 create new one
120 //
121 if (fStreamLevel==0) return 0;
122 if (fDebugStreamer) return fDebugStreamer;
123 TString dsName;
124 dsName=GetName();
125 dsName+="Debug.root";
126 dsName.ReplaceAll(" ","");
127 fDebugStreamer = new TTreeSRedirector(dsName.Data());
128 return fDebugStreamer;
3ab35fc5 129}
f7f33dec 130
131
108953e9 132void AliTPCcalibBase::UpdateEventInfo(AliESDEvent * event){
133 //
134 //
135 //
136 fRun = event->GetRunNumber();
137 fEvent = event->GetEventNumberInFile();
138 fTime = event->GetTimeStamp();
139 fTrigger = event->GetTriggerMask();
140 fMagF = event->GetMagneticField();
141}
142
f7f33dec 143void AliTPCcalibBase::RegisterDebugOutput(const char *path){
144 //
145 // store - copy debug output to the destination position
146 // currently ONLY for local copy
147 if (fDebugLevel>0) printf("AliTPCcalibBase::RegisterDebugOutput(%s)\n",path);
148 if (fStreamLevel==0) return;
149 TString dsName;
150 dsName=GetName();
151 dsName+="Debug.root";
152 dsName.ReplaceAll(" ","");
153 TString dsName2=path;
154 gSystem->MakeDirectory(dsName2.Data());
155 dsName2+=gSystem->HostName();
156 gSystem->MakeDirectory(dsName2.Data());
157 dsName2+="/";
47328338 158 TTimeStamp s;
159 dsName2+=Int_t(s.GetNanoSec());
160 dsName2+="/";
161 gSystem->MakeDirectory(dsName2.Data());
f7f33dec 162 dsName2+=dsName;
163 AliInfo(Form("copy %s\t%s\n",dsName.Data(),dsName2.Data()));
164 printf("copy %s\t%s\n",dsName.Data(),dsName2.Data());
165 TFile::Cp(dsName.Data(),dsName2.Data());
166}