-
-//________________________________________________________________
-void AliZDC::CreateCalibData()
-{
- //
- //if(fCalibData) delete fCalibData; // delete previous version
- fCalibData = new AliZDCCalibData(GetName());
-}
-//________________________________________________________________
-void AliZDC::WriteCalibData(Int_t option)
-{
- //
- const int kCompressLevel = 9;
- char* fnam = GetZDCCalibFName();
- if(!fnam || fnam[0]=='\0') {
- fnam = gSystem->ExpandPathName("$(ALICE_ROOT)/data/AliZDCCalib.root");
- Warning("WriteCalibData","No File Name is provided, using default %s",fnam);
- }
- TFile* cdfile = TFile::Open(fnam,"UPDATE","",kCompressLevel);
-
- // Writes Calibration Data to current directory.
- // User MUST take care of corresponding file opening and ->cd()... !!!
- // By default, the object is overwritten. Use 0 option for opposite.
- if(option) option = TObject::kOverwrite;
- if(fCalibData) fCalibData->Write(0,option);
- else if(fCalibData) fCalibData->Write(0,option);
-
- cdfile->Close();
- delete cdfile;
-}
-
-//________________________________________________________________
-void AliZDC::LoadCalibData()
-{
- //
- char* fnam = GetZDCCalibFName();
- if(!fnam || fnam[0]=='\0') return;
- if(!gAlice->IsFileAccessible(fnam)) {
- Error("LoadCalibData","ZDC Calibration Data file is not accessible, %s",fnam);
- exit(1);
- }
- TFile* cdfile = TFile::Open(fnam);
-
- // Loads Calibration Data from current directory.
- // User MUST take care of corresponding file opening and ->cd()...!!!
- //
- if(fCalibData) delete fCalibData; // delete previous version
- TString dtname = "Calib_";
- dtname += GetName();
- fCalibData = (AliZDCCalibData*) gDirectory->Get(dtname.Data());
- if(!fCalibData) {
- Error("LoadCalibData","No Calibration data found for %s",GetName());
- exit(1);
- }
-
- cdfile->Close();
- delete cdfile;
-}
-