]>
Commit | Line | Data |
---|---|---|
b0d2c2d3 | 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 | /* $Id$ */ | |
17 | ||
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | /// // | |
20 | /// class for VZERO reconstruction // | |
21 | /// // | |
22 | /////////////////////////////////////////////////////////////////////////////// | |
23 | ||
24 | ||
25 | #include "AliVZEROReconstructor.h" | |
26 | ||
b0d2c2d3 | 27 | ClassImp(AliVZEROReconstructor) |
28 | ||
ce7090f5 | 29 | //_____________________________________________________________________________ |
cb2228e6 | 30 | AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(), |
31 | fCalibData(GetCalibData()) | |
ce7090f5 | 32 | { |
33 | // Default constructor | |
ce7090f5 | 34 | // Get calibration data |
35 | ||
cb2228e6 | 36 | // fCalibData = GetCalibData(); |
ce7090f5 | 37 | } |
38 | ||
39 | ||
40 | //_____________________________________________________________________________ | |
41 | AliVZEROReconstructor& AliVZEROReconstructor::operator = | |
42 | (const AliVZEROReconstructor& /*reconstructor*/) | |
43 | { | |
44 | // assignment operator | |
45 | ||
46 | Fatal("operator =", "assignment operator not implemented"); | |
47 | return *this; | |
48 | } | |
49 | ||
50 | //_____________________________________________________________________________ | |
51 | AliVZEROReconstructor::~AliVZEROReconstructor() | |
52 | { | |
53 | // destructor | |
54 | ||
55 | } | |
56 | ||
57 | ||
58 | //_____________________________________________________________________________ | |
59 | AliCDBStorage* AliVZEROReconstructor::SetStorage(const char *uri) | |
60 | { | |
61 | ||
62 | Bool_t deleteManager = kFALSE; | |
63 | ||
64 | AliCDBManager *manager = AliCDBManager::Instance(); | |
65 | AliCDBStorage *defstorage = manager->GetDefaultStorage(); | |
66 | ||
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; | |
71 | } | |
72 | ||
73 | AliCDBStorage *storage = manager->GetDefaultStorage(); | |
74 | ||
75 | if(deleteManager){ | |
76 | AliCDBManager::Instance()->UnsetDefaultStorage(); | |
77 | defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy() | |
78 | } | |
79 | ||
80 | return storage; | |
81 | } | |
82 | ||
83 | //_____________________________________________________________________________ | |
84 | AliVZEROCalibData* AliVZEROReconstructor::GetCalibData() const | |
85 | { | |
86 | ||
87 | // Getting calibration object for VZERO set | |
88 | ||
c0b82b5a | 89 | AliCDBManager *man = AliCDBManager::Instance(); |
ce7090f5 | 90 | |
c0b82b5a | 91 | AliCDBEntry *entry=0; |
92 | ||
93 | entry = man->Get("VZERO/Calib/Data"); | |
94 | ||
95 | if(!entry){ | |
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); | |
101 | ||
102 | } | |
103 | ||
104 | // Retrieval of data in directory VZERO/Calib/Data: | |
105 | ||
106 | ||
107 | AliVZEROCalibData *calibdata = 0; | |
108 | ||
109 | if (entry) calibdata = (AliVZEROCalibData*) entry->GetObject(); | |
110 | if (!calibdata) AliError("No calibration data from calibration database !"); | |
ce7090f5 | 111 | |
112 | return calibdata; | |
113 | } | |
114 |