]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Added new static function ReadData() for loading from ASCII files
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Oct 2007 13:28:45 +0000 (13:28 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 3 Oct 2007 13:28:45 +0000 (13:28 +0000)
- Instance() does not load data automatically anymore,
  but client has to take care of it

MUON/mapping/AliMpDEStore.cxx
MUON/mapping/AliMpDEStore.h

index 94713b1107deb82983dd4c75b3d64427691be850..13f1c91580aa3c4a3cf8804124c616b29e4d5055 100644 (file)
@@ -55,14 +55,33 @@ const char    AliMpDEStore::fgkCommentPrefix = '#';
 //
 
 //______________________________________________________________________________
-AliMpDEStore* AliMpDEStore::Instance()
+AliMpDEStore* AliMpDEStore::Instance(Bool_t warn)
 {
 /// Create the DE store if it does not yet exist
 /// and return its instance
 
-  if ( ! fgInstance )
-    fgInstance = new AliMpDEStore();
-    
+  if ( ! fgInstance && warn  ) {
+    AliWarningClass("DE Store has not been loaded");
+  }  
+     
+  return fgInstance;
+}    
+
+//______________________________________________________________________________
+AliMpDEStore* AliMpDEStore::ReadData(Bool_t warn)
+{
+/// Load the DE store data from ASCII data files
+/// and return its instance
+
+  if ( fgInstance ) {
+    if ( warn )
+      AliWarningClass("DE Store has been already loaded");
+    return fgInstance;
+  }  
+  
+  AliInfoClass("Reading DE Store from ASCII files.");
+
+  fgInstance = new AliMpDEStore();
   return fgInstance;
 }    
 
index 493a79e6db310d7700d4482ea654cffeb9abb3c4..4e802ee09c6d3a2b04ddc1e7f7b4adb4cd6baafa 100644 (file)
@@ -34,7 +34,8 @@ class AliMpDEStore : public  TObject {
     virtual ~AliMpDEStore();
     
     // static access method
-    static AliMpDEStore* Instance(); 
+    static AliMpDEStore* Instance(Bool_t warn = true); 
+    static AliMpDEStore* ReadData(Bool_t warn = true);
     
     // methods
     AliMpDetElement* GetDetElement(Int_t detElemId, Bool_t warn = true) const;