]> git.uio.no Git - u/mrichter/AliRoot.git/blob - VZERO/AliVZEROReconstructor.cxx
Calibration parameters retrieved from local CDB
[u/mrichter/AliRoot.git] / VZERO / AliVZEROReconstructor.cxx
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
27 ClassImp(AliVZEROReconstructor)
28
29 //_____________________________________________________________________________
30 AliVZEROReconstructor:: AliVZEROReconstructor()
31 {
32   // Default constructor  
33   
34   // Get calibration data
35   
36   fCalibData = GetCalibData(); 
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
89   AliCDBEntry  *entry = AliCDBManager::Instance()->Get("VZERO/Calib/Data");
90   AliVZEROCalibData *calibdata = (AliVZEROCalibData*) entry->GetObject();
91
92   if (!calibdata)  AliWarning("No calibration data from calibration database !");
93
94   return calibdata;
95 }
96