]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpCDB.h
In mapping:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpCDB.h
index c195126792caa41fea8a54acab82d7cb6f7ab672..f537506fadd804b37d98f65a0ecffb0d0205fd68 100644 (file)
 /// \class AliMpCDB
 /// \brief Manager class for mapping CDB IO
 ///
+/// The mapping can be loaded in two ways:
+/// - from mapping objects stored in the CDB folders Mapping, DDLStore
+///   (old way)
+/// - from mapping data store in a form of string map in the CDB 
+///   folder MappingData (new way, now default)
+///
+/// To switch between these two ways:
+/// - AliMpCDB::SetLoadFromData(Bool_t);
+/// 
+/// Now it is also possible to regenerate mapping ASCII data
+/// from the string map:
+/// - AliMpCDB::GenerateMpData();
+///
 /// \author Ivana Hrivnacova, IPN Orsay
 
 #ifndef ROOT_TObject
@@ -23,10 +36,11 @@ class AliMpCDB : public  TObject {
 
   public:
     // static methods
+    //
+
     static Bool_t LoadMpSegmentation(Bool_t warn = false);
     static Bool_t LoadDDLStore(Bool_t warn = false);
     
-    
     static Bool_t LoadMpSegmentation2(
                     const char* cdbpath = "local://$ALICE_ROOT",
                     Int_t runNumber = 0,
@@ -36,8 +50,16 @@ class AliMpCDB : public  TObject {
                     Int_t runNumber = 0,
                     Bool_t warn = false);
 
+    static Bool_t WriteMpData();
     static Bool_t WriteMpSegmentation(Bool_t readData = true);
     static Bool_t WriteDDLStore(Bool_t readData= true);
+    
+    static Bool_t GenerateMpData(
+                    const char* cdbpath = "local://$ALICE_ROOT",
+                    Int_t runNumber = 0);
+
+    // Switch loading
+    static void SetLoadFromData(Bool_t loadFromData);
      
   private:
     /// Not implemented
@@ -47,9 +69,27 @@ class AliMpCDB : public  TObject {
     /// Not implemented
     AliMpCDB& operator=(const AliMpCDB& rhs);
     
+
+    static TObject*  GetCDBEntryObject(const char* dataPath);
+    static TObject*  GetCDBEntryObject(const char* dataPath, 
+                                       const char* cdbpath, 
+                                       Int_t runNumber);
+                                       
+    /// option for loading from CDB mapping data or from CDB mapping objects 
+    static Bool_t fgLoadFromData;                                       
+    
   ClassDef(AliMpCDB,0)  // The factory for building mapping segmentations
 };
 
+// inline functions
+
+inline void AliMpCDB::SetLoadFromData(Bool_t loadFromData)
+{
+/// Set option for loading from objects
+
+  fgLoadFromData = loadFromData;
+}  
+   
 #endif //ALI_MP_CDB_H