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 **************************************************************************/
18 ///////////////////////////////////////////////////////////////////////////////
20 /// class for VZERO reconstruction //
22 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliVZEROReconstructor.h"
27 ClassImp(AliVZEROReconstructor)
29 //_____________________________________________________________________________
30 AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(),
31 fCalibData(GetCalibData())
33 // Default constructor
34 // Get calibration data
36 // fCalibData = GetCalibData();
40 //_____________________________________________________________________________
41 AliVZEROReconstructor& AliVZEROReconstructor::operator =
42 (const AliVZEROReconstructor& /*reconstructor*/)
44 // assignment operator
46 Fatal("operator =", "assignment operator not implemented");
50 //_____________________________________________________________________________
51 AliVZEROReconstructor::~AliVZEROReconstructor()
58 //_____________________________________________________________________________
59 AliCDBStorage* AliVZEROReconstructor::SetStorage(const char *uri)
62 Bool_t deleteManager = kFALSE;
64 AliCDBManager *manager = AliCDBManager::Instance();
65 AliCDBStorage *defstorage = manager->GetDefaultStorage();
67 if(!defstorage || !(defstorage->Contains("VZERO"))){
68 AliWarning("No default storage set or default storage doesn't contain VZERO!");
69 manager->SetDefaultStorage(uri);
70 deleteManager = kTRUE;
73 AliCDBStorage *storage = manager->GetDefaultStorage();
76 AliCDBManager::Instance()->UnsetDefaultStorage();
77 defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy()
83 //_____________________________________________________________________________
84 AliVZEROCalibData* AliVZEROReconstructor::GetCalibData() const
87 // Getting calibration object for VZERO set
89 AliCDBManager *man = AliCDBManager::Instance();
93 entry = man->Get("VZERO/Calib/Data");
96 AliWarning("Load of calibration data from default storage failed!");
97 AliWarning("Calibration data will be loaded from local storage ($ALICE_ROOT)");
98 Int_t runNumber = man->GetRun();
99 entry = man->GetStorage("local://$ALICE_ROOT")
100 ->Get("VZERO/Calib/Data",runNumber);
104 // Retrieval of data in directory VZERO/Calib/Data:
107 AliVZEROCalibData *calibdata = 0;
109 if (entry) calibdata = (AliVZEROCalibData*) entry->GetObject();
110 if (!calibdata) AliError("No calibration data from calibration database !");