]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpCDB.h
No need to be a singleton
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpCDB.h
CommitLineData
3f862c88 1#ifndef ALI_MP_CDB_H
2#define ALI_MP_CDB_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7// $Id$
8
9/// \ingroup management
10/// \class AliMpCDB
11/// \brief Manager class for mapping CDB IO
12///
228fd720 13/// The mapping can be loaded in two ways:
14/// - from mapping objects stored in the CDB folders Mapping, DDLStore
15/// (old way)
16/// - from mapping data store in a form of string map in the CDB
17/// folder MappingData (new way, now default)
18///
19/// To switch between these two ways:
20/// - AliMpCDB::SetLoadFromData(Bool_t);
21///
22/// Now it is also possible to regenerate mapping ASCII data
23/// from the string map:
24/// - AliMpCDB::GenerateMpData();
25///
3f862c88 26/// \author Ivana Hrivnacova, IPN Orsay
27
28#ifndef ROOT_TObject
29# include <TObject.h>
30#endif
31
32class AliMpSegmentation;
33class AliMpDDLStore;
34
35class AliMpCDB : public TObject {
36
37 public:
38 // static methods
228fd720 39 //
40
3f862c88 41 static Bool_t LoadMpSegmentation(Bool_t warn = false);
42 static Bool_t LoadDDLStore(Bool_t warn = false);
ab167304 43 static Bool_t LoadManuStore(Bool_t warn = false);
d3af4674 44
d3af4674 45 static Bool_t LoadMpSegmentation2(
46 const char* cdbpath = "local://$ALICE_ROOT",
47 Int_t runNumber = 0,
48 Bool_t warn = false);
49 static Bool_t LoadDDLStore2(
50 const char* cdbpath = "local://$ALICE_ROOT",
51 Int_t runNumber = 0,
52 Bool_t warn = false);
ab167304 53 static Bool_t LoadManuStore2(
54 const char* cdbpath = "local://$ALICE_ROOT",
55 Int_t runNumber = 0,
56 Bool_t warn = false);
3f862c88 57
228fd720 58 static Bool_t WriteMpData();
ab167304 59 static Bool_t WriteMpRunData();
90bcb4c9 60 static Bool_t WriteMpSegmentation(Bool_t readData = true);
61 static Bool_t WriteDDLStore(Bool_t readData= true);
ab167304 62 static Bool_t WriteManuStore(Bool_t readData= true);
228fd720 63
64 static Bool_t GenerateMpData(
65 const char* cdbpath = "local://$ALICE_ROOT",
66 Int_t runNumber = 0);
ab167304 67 static Bool_t GenerateMpRunData(
68 const char* cdbpath = "local://$ALICE_ROOT",
69 Int_t runNumber = 0);
228fd720 70
71 // Switch loading
72 static void SetLoadFromData(Bool_t loadFromData);
3f862c88 73
74 private:
75 /// Not implemented
76 AliMpCDB();
77 /// Not implemented
78 AliMpCDB(const AliMpCDB& rhs);
79 /// Not implemented
80 AliMpCDB& operator=(const AliMpCDB& rhs);
81
228fd720 82
83 static TObject* GetCDBEntryObject(const char* dataPath);
84 static TObject* GetCDBEntryObject(const char* dataPath,
85 const char* cdbpath,
86 Int_t runNumber);
87
88 /// option for loading from CDB mapping data or from CDB mapping objects
89 static Bool_t fgLoadFromData;
90
3f862c88 91 ClassDef(AliMpCDB,0) // The factory for building mapping segmentations
92};
93
228fd720 94// inline functions
95
96inline void AliMpCDB::SetLoadFromData(Bool_t loadFromData)
97{
ab167304 98/// Set option for loading from CDB mapping data or from CDB mapping objects
228fd720 99
100 fgLoadFromData = loadFromData;
101}
102
3f862c88 103#endif //ALI_MP_CDB_H
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118