]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In mapping:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Jul 2008 08:43:42 +0000 (08:43 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 5 Jul 2008 08:43:42 +0000 (08:43 +0000)
Implemented storing mapping data as a map of strings
as an alternative to storing mapping objecs:
- Added classes AliMpDataProcessor, AliMpDataStreams, AliMpDataMap
- In AliMpFiles: removed additional / in the paths
- In data files: added end-of-line at the end of file where missing
- In AliMpCDB: added new functions for loading/writing mapping data
  and also a function for regenerating ASCII data files from OCDB

60 files changed:
MUON/Calib/MappingData/Run0_999999999_v0_s0.root [new file with mode: 0644]
MUON/MUONmappingLinkDef.h
MUON/READMEmapping.txt
MUON/libMUONmapping.pkg
MUON/mapping/AliMpCDB.cxx
MUON/mapping/AliMpCDB.h
MUON/mapping/AliMpDDLStore.cxx
MUON/mapping/AliMpDEStore.cxx
MUON/mapping/AliMpDataMap.cxx [new file with mode: 0644]
MUON/mapping/AliMpDataMap.h [new file with mode: 0644]
MUON/mapping/AliMpDataProcessor.cxx [new file with mode: 0644]
MUON/mapping/AliMpDataProcessor.h [new file with mode: 0644]
MUON/mapping/AliMpDataStreams.cxx [new file with mode: 0644]
MUON/mapping/AliMpDataStreams.h [new file with mode: 0644]
MUON/mapping/AliMpFiles.cxx
MUON/mapping/AliMpFiles.h
MUON/mapping/AliMpMotifReader.cxx
MUON/mapping/AliMpMotifReader.h
MUON/mapping/AliMpRegionalTrigger.cxx
MUON/mapping/AliMpRegionalTrigger.h
MUON/mapping/AliMpSectorReader.cxx
MUON/mapping/AliMpSectorReader.h
MUON/mapping/AliMpSegmentation.cxx
MUON/mapping/AliMpSt345Reader.cxx
MUON/mapping/AliMpTriggerReader.cxx
MUON/mapping/data/station1/bending_plane/padPosF.dat
MUON/mapping/data/station345/N2+.pcb
MUON/mapping/data/station345/N2-.pcb
MUON/mapping/data/station345/R1B.pcb
MUON/mapping/data/station345/R1N.pcb
MUON/mapping/data/station345/R2B.pcb
MUON/mapping/data/station345/R35.dat
MUON/mapping/data/station345/S2N.pcb
MUON/mapping/data/stationTrigger/2RL4.NonBending.slat
MUON/mapping/data/stationTrigger/2RL5.Bending.slat
MUON/mapping/data/stationTrigger/2RL6.NonBending.slat
MUON/mapping/data/stationTrigger/2RL7.NonBending.slat
MUON/mapping/data/stationTrigger/4RL4.Bending.slat
MUON/mapping/data/stationTrigger/4RL4.NonBending.slat
MUON/mapping/data/stationTrigger/4RL5.Bending.slat
MUON/mapping/data/stationTrigger/4RL5.NonBending.slat
MUON/mapping/data/stationTrigger/4RL6.Bending.slat
MUON/mapping/data/stationTrigger/4RL6.NonBending.slat
MUON/mapping/data/stationTrigger/4RL7.Bending.slat
MUON/mapping/data/stationTrigger/4RL7.NonBending.slat
MUON/mapping/data/stationTrigger/4RL8.Bending.slat
MUON/mapping/data/stationTrigger/4RL8.NonBending.slat
MUON/mapping/data/stationTrigger/4RL9.Bending.slat
MUON/mapping/data/stationTrigger/4RL9.NonBending.slat
MUON/mapping/data/stationTrigger/MUONLocalTriggerBoard.dat
MUON/mapping/data/stationTrigger/TX16_340.pcb
MUON/mapping/data/stationTrigger/TXD16_340.pcb
MUON/mapping/data/stationTrigger/TXD64_680.pcb
MUON/mapping/data/stationTrigger/TY16_1870.pcb
MUON/mapping/data/stationTrigger/TY16_8_1870.pcb
MUON/mapping/data/stationTrigger/TY8Special.pcb
MUON/mapping/data/stationTrigger/TY8_510.pcb
MUON/mapping/data/stationTrigger/TY8_850.pcb
MUON/mapping/data/stationTrigger/bergToGC.dat
MUON/mapping/data/stationTrigger/motifSpecialY8.dat

diff --git a/MUON/Calib/MappingData/Run0_999999999_v0_s0.root b/MUON/Calib/MappingData/Run0_999999999_v0_s0.root
new file mode 100644 (file)
index 0000000..bcb0f36
Binary files /dev/null and b/MUON/Calib/MappingData/Run0_999999999_v0_s0.root differ
index 5c1fb534055a479a00d7a451f36d14561084ae08..91b6cc2283f41ab8e3e2e7d2aa26fc25b2d98c89 100644 (file)
 #pragma link C++ class  AliMpVSegmentation+;
 #pragma link C++ class  AliMpVPadIterator+;
 #pragma link C++ class  AliMpPadIteratorPtr+;
+#pragma link C++ class  AliMpDataProcessor+;
+#pragma link C++ class  AliMpDataStreams+;
+#pragma link C++ class  AliMpDataMap+;
 #pragma link C++ class  AliMpFiles!;
+//#pragma link C++ class  std::pair<std::string, std::string>+;
 
 #pragma link C++ namespace AliMp;
 #pragma link C++ enum   AliMp::Direction;
index ffb59eed79f7b20d492451bd97b43db338612c86..79e86e9b9cc2f85cd9c4cbc48f13cb6dddf2e09d 100644 (file)
@@ -19,12 +19,9 @@ in OCDB has to be regenerated in this way:
 
 <pre>
 $> cd $ALICE_ROOT/MUON
-$> rm Calib/Mapping/Run0_999999999_v0_s0.root
-$> rm Calib/DDLStore/Run0_999999999_v0_s0.root
+$> rm Calib/MappingData/Run0_999999999_v0_s0.root
 $> aliroot
-root [0] AliMpDDLStore::ReadData(); 
-root [1] AliMpCDB::WriteMpSegmentation(); 
-root [2] AliMpCDB::WriteDDLStore(); 
+root [0] AliMpCDB::WriteMpData(); 
 </pre>
 
 Note that mapping has to be loaded from OCDB almost each time
index b5627eebd323395f1889b33e321fabfca7fdfe1f..f15edfc4408e84f24e1d2f041650d8e2bea9a73f 100644 (file)
@@ -19,7 +19,10 @@ SRCS +=  \
         mapping/AliMpPadPair.cxx  \
         mapping/AliMpVIndexed.cxx  \
         mapping/AliMpVPadIterator.cxx  \
-        mapping/AliMpVSegmentation.cxx
+        mapping/AliMpVSegmentation.cxx \
+         mapping/AliMpDataProcessor.cxx \
+         mapping/AliMpDataStreams.cxx \
+         mapping/AliMpDataMap.cxx
 
 # Category motif
 #
index 4325029e4a62bb00977dedd02f8525cf25f32a94..a58e87d8385eae7a7edc1b7825295857ebd168ce 100644 (file)
@@ -28,6 +28,9 @@
 
 #include "AliMpSegmentation.h"
 #include "AliMpDDLStore.h"
+#include "AliMpDataProcessor.h"
+#include "AliMpDataStreams.h"
+#include "AliMpDataMap.h"
 
 #include "AliLog.h"
 #include "AliCDBManager.h"
 ClassImp(AliMpCDB)
 /// \endcond
 
+Bool_t AliMpCDB::fgLoadFromData = kTRUE;                                       
+
 //
-// static methods
+// private static methods
 //
 
 //______________________________________________________________________________
-Bool_t AliMpCDB::LoadMpSegmentation(Bool_t warn)
+TObject*  AliMpCDB::GetCDBEntryObject(const char* dataPath)
 {
-/// Load the sementation from the CDB if it does not yet exist;
-/// return false only in case loading from CDB failed
+/// Load CDB entry object with checks
 
-  AliDebugClass(1,"");
-
-  if ( AliMpSegmentation::Instance(false) ) {
-    if ( warn )  
-      AliWarningClass("Segmentation has been already loaded."); 
-    return true;
-  }  
-  
   AliCDBManager* cdbManager = AliCDBManager::Instance();
   if ( ! cdbManager->GetDefaultStorage() ) {
     AliErrorClassStream() << "CDB default storage has not been set." << endl; 
-    return kFALSE;
+    return 0;
   }  
 
   Int_t run = cdbManager->GetRun();
   if ( run < 0 ) {
     AliErrorClassStream() << "Cannot get run number from CDB manager." << endl; 
-    return kFALSE;
+    return 0;
   }  
 
-  AliCDBEntry* cdbEntry = cdbManager->Get("MUON/Calib/Mapping", run);
-  
-  if ( cdbEntry ) 
-  {
-    return (AliMpSegmentation*)cdbEntry->GetObject() != 0x0;
+  AliCDBEntry* cdbEntry = cdbManager->Get(dataPath, run);
+  if ( ! cdbEntry ) {
+    AliErrorClassStream() << "Cannot get cdbEntry." << endl; 
+    return 0;
   }
-  else
-  {
-    return kFALSE;
+  
+  TObject* object = cdbEntry->GetObject();
+  if ( ! object ) {
+    AliErrorClassStream() << "Cannot get object from cdbEntry." << endl; 
+    return 0;
+  }  
+
+  return object;
+}    
+  
+
+//______________________________________________________________________________
+TObject*  AliMpCDB::GetCDBEntryObject(const char* dataPath, 
+                                      const char* cdbpath,
+                                      Int_t runNumber )
+{
+/// Load CDB entry from CDB and run specified in arguments
+
+  AliCDBManager* cdbManager = AliCDBManager::Instance();
+  cdbManager->SetDefaultStorage(cdbpath);
+
+  AliCDBEntry* cdbEntry = cdbManager->Get(dataPath, runNumber);
+  if ( ! cdbEntry ) {
+    AliErrorClassStream() << "Cannot get cdbEntry." << endl; 
+    return 0;
+  }  
+    
+  TObject* object = cdbEntry->GetObject();
+  if ( ! object ) {
+    AliErrorClassStream() << "Cannot get object from cdbEntry." << endl; 
+    return 0;
+  }  
+
+  return object;
+}    
+                                      
+//
+// public static methods
+//
+
+   
+//______________________________________________________________________________
+Bool_t AliMpCDB::LoadMpSegmentation(Bool_t warn)
+{
+/// Load the sementation from the mapping data from OCDB,
+///  if it does not yet exist;
+/// return false only in case loading from CDB failed
+
+  if ( AliMpSegmentation::Instance(false) ) {
+    if ( warn )  
+      AliWarningClass("Segmentation has been already loaded."); 
+    return true;
+  }  
+  
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading segmentation from MUON/Calib/MappingData" << endl;
+  
+    TObject* cdbEntryObject = GetCDBEntryObject("MUON/Calib/MappingData");
+    if ( ! cdbEntryObject ) return kFALSE;
+  
+    // Pass the map to the streams and then read segmentation
+    // from data map
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
+    AliMpSegmentation::ReadData();
+    return kTRUE;
   }
+  else {
+    AliDebugClassStream(1)
+      << "Loading segmentation from MUON/Calib/Mapping" << endl;
+  
+    TObject* cdbEntryObject = GetCDBEntryObject("MUON/Calib/Mapping");
+    return cdbEntryObject != 0x0;
+  }  
 }    
 
 //______________________________________________________________________________
 Bool_t AliMpCDB::LoadDDLStore(Bool_t warn)
 {
-/// Load the DDL store from the CDB if it does not yet exist
+/// Load the DDL store from the mapping data from OCDB,
+///  if it does not yet exist;
 /// return false only in case loading from CDB failed
 
-  AliDebugClass(1,"");
-
   if ( AliMpDDLStore::Instance(false) ) {
     if ( warn )  
       AliWarningClass("DDL Store has been already loaded."); 
     return true;
   }  
   
-  // Load segmentation
-  //
-  LoadMpSegmentation(warn); 
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading DDL store from MUON/Calib/MappingData" << endl;
   
-  // Load DDL store
-  //
-  AliCDBManager* cdbManager = AliCDBManager::Instance();
-  if ( ! cdbManager->GetDefaultStorage() ) {
-    AliErrorClassStream() << "CDB default storage has not been set." << endl; 
-    return kFALSE;
-  }  
-
-  Int_t run = cdbManager->GetRun();
-  if ( run < 0 ) {
-    AliErrorClassStream() << "Cannot get run number from CDB manager." << endl; 
-    return kFALSE;
-  }  
-
-  AliCDBEntry* cdbEntry =  cdbManager->Get("MUON/Calib/DDLStore", run);
+    TObject* cdbEntryObject = GetCDBEntryObject("MUON/Calib/MappingData");
+    if ( ! cdbEntryObject ) return kFALSE;
   
-  if ( cdbEntry ) 
-  {
-    return (AliMpDDLStore*)cdbEntry->GetObject() != 0x0;
-  }
-  else
-  {
-    return kFALSE;
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
+    AliMpDDLStore::ReadData();
+    return kTRUE;
   }
+  else {
+    AliDebugClassStream(1)
+      << "Loading DDL store from MUON/Calib/DDLStore" << endl;
+  
+    // Load segmentation
+    LoadMpSegmentation(warn); 
+  
+    // Load DDL store
+    TObject* cdbEntryObject =  GetCDBEntryObject("MUON/Calib/DDLStore");
+    return cdbEntryObject != 0x0;
+  }     
 }    
 
 //______________________________________________________________________________
@@ -137,27 +197,35 @@ Bool_t AliMpCDB::LoadMpSegmentation2(const char* cdbpath, Int_t runNumber,
 /// and run is set directly via arguments.
 
 
-  AliDebugClass(1,"");
-
   if ( AliMpSegmentation::Instance(false) ) {
     if ( warn )  
       AliWarningClass("Segmentation has been already loaded."); 
     return true;
   }  
   
-  AliCDBManager* cdbManager = AliCDBManager::Instance();
-  cdbManager->SetDefaultStorage(cdbpath);
-
-  AliCDBEntry* cdbEntry = cdbManager->Get("MUON/Calib/Mapping", runNumber);
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading segmentation from MUON/Calib/MappingData" << endl;
   
-  if ( cdbEntry ) 
-  {
-    return (AliMpSegmentation*)cdbEntry->GetObject() != 0x0;
-  }
-  else
-  {
-    return kFALSE;
+    TObject* cdbEntryObject 
+      = GetCDBEntryObject("MUON/Calib/MappingData", cdbpath, runNumber);
+    if ( ! cdbEntryObject ) return kFALSE;
+  
+    // Pass the map to the streams and then read segmentation
+    // from data map
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
+    AliMpSegmentation::ReadData();
+    return kTRUE;
   }
+  else {
+    AliDebugClassStream(1)
+      << "Loading segmentation from MUON/Calib/Mapping" << endl;
+  
+    TObject* cdbEntryObject 
+      = GetCDBEntryObject("MUON/Calib/Mapping", cdbpath, runNumber);
+    return cdbEntryObject != 0x0;
+  }  
 }    
 
 //______________________________________________________________________________
@@ -169,35 +237,58 @@ Bool_t AliMpCDB::LoadDDLStore2(const char* cdbpath, Int_t runNumber,
 /// In difference from LoadDDLStore(), in this method the CDB path
 /// and run is set directly via arguments.
 
-  AliDebugClass(1,"");
-
   if ( AliMpDDLStore::Instance(false) ) {
     if ( warn )  
       AliWarningClass("DDL Store has been already loaded."); 
     return true;
   }  
   
-  // Load segmentation
-  //
-  LoadMpSegmentation2(cdbpath, runNumber, warn); 
+  if ( fgLoadFromData ) {
+    AliDebugClassStream(1)
+      << "Loading DDL store from MUON/Calib/MappingData" << endl;
   
-  // Load DDL store
-  //
-  AliCDBManager* cdbManager = AliCDBManager::Instance();
-  cdbManager->SetDefaultStorage(cdbpath);
-
-  AliCDBEntry* cdbEntry =  cdbManager->Get("MUON/Calib/DDLStore", runNumber);
+    TObject* cdbEntryObject 
+      = GetCDBEntryObject("MUON/Calib/MappingData", cdbpath, runNumber);
+    if ( ! cdbEntryObject ) return kFALSE;
   
-  if ( cdbEntry ) 
-  {
-    return (AliMpDDLStore*)cdbEntry->GetObject() != 0x0;
-  }
-  else
-  {
-    return kFALSE;
+    AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+    AliMpDataStreams::Instance()->SetDataMap(dataMap);  
+    AliMpDDLStore::ReadData();
+    return kTRUE;
   }
+  else {
+    AliDebugClassStream(1)
+      << "Loading DDL store from MUON/Calib/DDLStore" << endl;
+  
+    // Load segmentation
+    LoadMpSegmentation2(cdbpath, runNumber, warn); 
+  
+    // Load DDL store
+    TObject* cdbEntryObject =  GetCDBEntryObject("MUON/Calib/DDLStore");
+    return cdbEntryObject != 0x0;
+  }  
 }    
 
+//______________________________________________________________________________
+Bool_t AliMpCDB::WriteMpData()
+{
+/// Write mapping data in OCDB
+
+  AliCDBManager* cdbManager = AliCDBManager::Instance();
+  if ( ! cdbManager->GetDefaultStorage() )
+    cdbManager->SetDefaultStorage("local://$ALICE_ROOT");
+  
+  AliCDBMetaData* cdbData = new AliCDBMetaData();
+  cdbData->SetResponsible("Dimuon Offline project");
+  cdbData->SetComment("MUON mapping");
+  cdbData->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+  AliCDBId id("MUON/Calib/MappingData", 0, AliCDBRunRange::Infinity()); 
+
+  AliMpDataProcessor mp;
+  AliMpDataMap* map = mp.CreateDataMap();
+  return cdbManager->Put(map, id, cdbData);
+}
+
 //______________________________________________________________________________
 Bool_t AliMpCDB::WriteMpSegmentation(Bool_t readData)
 {
@@ -246,3 +337,19 @@ Bool_t AliMpCDB::WriteDDLStore(Bool_t readData)
   }
   return cdbManager->Put(AliMpDDLStore::Instance(), id, cdbData);
 }   
+
+//______________________________________________________________________________
+Bool_t  AliMpCDB::GenerateMpData(const char* cdbpath, Int_t runNumber)
+{
+/// Generate mapping data ASCII files from OCDB
+
+  TObject* cdbEntryObject 
+    = GetCDBEntryObject("MUON/Calib/MappingData", cdbpath, runNumber);
+  if ( ! cdbEntryObject ) return kFALSE;
+  
+  AliMpDataMap* dataMap = (AliMpDataMap*)cdbEntryObject;
+  AliMpDataProcessor mp;
+  return mp.GenerateData(dataMap);
+} 
+
+
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
 
 
index 4dee606a69424eafbebcf13bd4fd6f0b1333d6ed..9775e2677fff79a02bb0f3a2c4e30262254519b2 100644 (file)
@@ -35,6 +35,7 @@
 #include "AliMpFrtCrocusConstants.h"
 #include "AliMpDDL.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpHelper.h"
 #include "AliMpDEManager.h"
 #include "AliMpDetElement.h"
@@ -93,7 +94,8 @@ AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
         return fgInstance;
     }
 
-    AliInfoClass("Reading DDL Store from ASCII files.");
+    if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+      AliInfoClass("Reading DDL Store from ASCII files.");
 
     fgInstance = new AliMpDDLStore();
     return fgInstance;
@@ -202,13 +204,9 @@ Bool_t AliMpDDLStore::ReadDDLs()
 {
     /// Read ddl <-> bus patch file
 
-    TString infile = AliMpFiles::BusPatchFilePath();
-
-    ifstream in(infile, ios::in);
-    if (!in) {
-        AliErrorStream() << "Data file " << infile << " not found.";
-        return false;
-    }
+    istream& in 
+      = AliMpDataStreams::Instance()
+        ->CreateDataStream(AliMpFiles::BusPatchFilePath());
 
     char line[255];
 
@@ -287,7 +285,7 @@ Bool_t AliMpDDLStore::ReadDDLs()
         ddl->FillBusPatchIds();
     }
 
-    in.close();
+    delete &in;
     return true;
 }
 
@@ -474,13 +472,9 @@ Bool_t AliMpDDLStore::ReadBusPatchSpecial()
 /// Read file with bus patches with a special order of manus
 /// and reset the manus arrays filled via SetManu function
 
-  TString infile = AliMpFiles::BusPatchSpecialFilePath();
-
-  ifstream in(infile, ios::in);
-  if (!in) {
-    AliErrorStream() << "Data file " << infile << " not found.";
-    return false;
-  }
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
 
   char line[255];
 
@@ -547,6 +541,8 @@ Bool_t AliMpDDLStore::ReadBusPatchSpecial()
     }
   }
   
+  delete &in;
+  
   return kTRUE;
 }    
  
@@ -583,12 +579,10 @@ Bool_t AliMpDDLStore::ReadBusPatchInfo()
 {
     /// read the buspatch info file and set buspatch info
 
-    TString infile = AliMpFiles::BusPatchInfoFilePath();
-    ifstream in(infile, ios::in);
-    if (!in) {
-        AliErrorStream() << "Data file " << infile << " not found.";
-        return false;
-    }
+    istream& in 
+      = AliMpDataStreams::Instance()
+        ->CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
+
     char line[255];
 
     for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
@@ -648,6 +642,8 @@ Bool_t AliMpDDLStore::ReadBusPatchInfo()
 
         }
     }
+    
+    delete &in;
 
     return true;
 }
index aaa3838355d3ff753759b62563f0867273ed331d..b72e5210b0600ca4838fc2bbf96fc2947574e676 100644 (file)
@@ -31,6 +31,7 @@
 #include "AliMpDetElement.h"
 #include "AliMpConstants.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpHelper.h"
 #include "AliMpIntPair.h"
 #include "AliMpConstants.h"
@@ -81,7 +82,8 @@ AliMpDEStore* AliMpDEStore::ReadData(Bool_t warn)
     return fgInstance;
   }  
   
-  AliInfoClass("Reading DE Store from ASCII files.");
+  if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+    AliInfoClass("Reading DE Store from ASCII files.");
 
   fgInstance = new AliMpDEStore();
   return fgInstance;
@@ -189,16 +191,21 @@ AliMp::StationType AliMpDEStore::StationType(const TString& stationTypeName)
 
 //______________________________________________________________________________
 Bool_t AliMpDEStore::ReadManuToSerialNbs(AliMpDetElement* detElement, 
-                                       AliMp::StationType stationType)
+                                         AliMp::StationType stationType)
 {
 /// Read manu serial numbers for the given detection element
+
+  // Nothing to be done for trigger
+  if ( stationType == AliMp::kStationTrigger ) return true;
+
   static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
 
   TString deName = detElement->GetDEName();
 
-  TString infile = AliMpFiles::ManuToSerialPath(deName, stationType);
-  ifstream in(infile, ios::in);
-  
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::ManuToSerialPath(deName, stationType));
+
   // Change to Error when all files available
   //if ( !in.is_open() && stationType == AliMp::kStation345 ) {
   //   AliWarningStream() << "File " << infile << " not found." << endl;
@@ -229,7 +236,8 @@ Bool_t AliMpDEStore::ReadManuToSerialNbs(AliMpDetElement* detElement,
     delete stringList;
   }
    
-  in.close();
+  delete &in; 
+   
   return true;
 }
 
@@ -240,13 +248,10 @@ AliMpDEStore::ReadDENames(AliMp::StationType station)
 /// Read det element names for cath = 0 from the file specified by name
 /// and fill the map 
 
-  // Open file
-  TString filePath = AliMpFiles::DENamesFilePath(station);
-  std::ifstream in(filePath);
-  if (!in.good()) {
-    AliErrorClassStream() << "Cannot open file " << filePath << endl;;
-    return false;
-  }
+  // Open stream
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::DENamesFilePath(station));
   
   // Read plane types per cathods
   //
@@ -345,10 +350,9 @@ AliMpDEStore::ReadDENames(AliMp::StationType station)
     } 
     in >> word;
   }
-
-  // Close file
-  in.close();
   
+  delete &in;
+
   return true;
 }
 
diff --git a/MUON/mapping/AliMpDataMap.cxx b/MUON/mapping/AliMpDataMap.cxx
new file mode 100644 (file)
index 0000000..ef1386e
--- /dev/null
@@ -0,0 +1,81 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+// $Id$
+// Category: basic
+
+//-----------------------------------------------------------------------------
+// Class AliMpDataMap
+// ------------------------
+// TObject class containing a map of strings to strings
+// Author:Ivana Hrivnacova; IPN Orsay
+//-----------------------------------------------------------------------------
+
+#include "AliMpDataMap.h"
+
+#include "AliLog.h"
+
+#include <TObjString.h>
+
+/// \cond CLASSIMP
+ClassImp(AliMpDataMap)
+/// \endcond
+
+//_____________________________________________________________________________
+AliMpDataMap::AliMpDataMap() 
+  : TObject(),
+    fMap()
+{
+/// Standard & default constructor
+
+}
+
+//_____________________________________________________________________________
+AliMpDataMap::~AliMpDataMap() 
+{
+/// Destructor 
+}
+
+//
+// private methods
+//
+
+//_____________________________________________________________________________
+void AliMpDataMap::Add(const TString& path, const TString& data)
+{
+/// Add map element
+
+  fMap.Add(new TObjString(path), new TObjString(data));
+}  
+
+//_____________________________________________________________________________
+TString  AliMpDataMap::Get(const TString& path, Bool_t warn) const
+{
+/// Find the data string for given path;
+/// give error and return empty string if not found 
+
+  TObject* object = fMap.GetValue(path.Data());
+
+  if ( ! object )  {
+    if ( warn ) {
+      AliWarningStream()
+        << path << " not found in the map." << endl;
+    }    
+    return "";
+  }    
+  
+  return ((TObjString*)object)->String();
+}  
+  
diff --git a/MUON/mapping/AliMpDataMap.h b/MUON/mapping/AliMpDataMap.h
new file mode 100644 (file)
index 0000000..6556822
--- /dev/null
@@ -0,0 +1,41 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// $Id$
+// $MpId: AliMpDataMap.h,v 1.4 2006/05/24 13:58:07 ivana Exp $
+
+/// \ingroup basic
+/// \class AliMpDataMap
+/// \brief TObject class containing a map of strings to strings
+///
+/// \author Ivana Hrivnacova; IPN Orsay
+
+#ifndef ALI_MP_DATA_MAP_H
+#define ALI_MP_DATA_MAP_H
+
+#include <TObject.h>
+#include <TMap.h>
+
+using namespace std;
+
+class AliMpDataMap : public TObject
+{
+  public:
+    AliMpDataMap();
+    virtual ~AliMpDataMap();
+    
+    // methods
+    void    Add(const TString& path, const TString& data); 
+    TString Get(const TString& path, Bool_t warn = kTRUE) const;
+    
+    /// Return the map constant reference 
+    const TMap& GetMap() const { return fMap; }
+    
+  private:  
+    TMap  fMap; ///< the map of strings to strings
+  ClassDef(AliMpDataMap,1)  // TObject class containing a map of strings to strings
+};
+
+#endif //ALI_MP_EX_MAP_H
+
diff --git a/MUON/mapping/AliMpDataProcessor.cxx b/MUON/mapping/AliMpDataProcessor.cxx
new file mode 100644 (file)
index 0000000..2d5e872
--- /dev/null
@@ -0,0 +1,379 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+// $Id$
+//
+// Category: basic
+
+//-----------------------------------------------------------------------------
+// Class AliMpDataProcessor
+// -----------------------
+// Class for converting ASCII data files in the map of string
+// Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
+
+#include "AliMpDataProcessor.h"
+#include "AliMpDataMap.h"
+#include "AliMpFiles.h"
+
+#include "AliLog.h"
+
+#include <TSystem.h>
+#include <TObjString.h>
+#include <TFile.h>
+#include <Riostream.h>
+
+#include <fstream>
+#include <sstream>
+#include <map>
+
+const TString AliMpDataProcessor::fgkHeaderFileName = "add.h";
+const TString AliMpDataProcessor::fgkImplFileName = "add.cxx";
+
+
+//_____________________________________________________________________________
+AliMpDataProcessor::AliMpDataProcessor()
+  : TObject(),
+    fCounter(0),
+    fHeaderFile(),
+    fImplFile()
+{
+/// Default and standar constructor
+
+  fHeaderFile.open(fgkHeaderFileName.Data(), std::ios::out);
+  fImplFile.open(fgkImplFileName.Data(), std::ios::out);
+  
+  // Add check
+
+}
+
+//_____________________________________________________________________________
+AliMpDataProcessor:: ~AliMpDataProcessor()
+{
+/// Destructor
+
+}
+
+//
+// private methods
+//
+
+
+//_____________________________________________________________________________
+void AliMpDataProcessor::ProcessDirectory(const TString& path, 
+                                          AliMpDataMap* dataMap) 
+{
+/// Recursive function to process data directory
+  
+  AliDebugStream(2) << "ProcessDirectory " << path.Data() << endl;
+
+  // skip some directories
+  //if ( path.Contains("manu_serial") ) return;
+  //if ( path.Contains("stationTrigger") ) return;
+  
+  gSystem->cd(path);
+  gSystem->Exec("ls > /tmp/mpfiles.txt");
+  
+  ifstream mpfiles("/tmp/mpfiles.txt");
+  TString mpfilesStr;
+  TString fileName;
+  while ( mpfiles >> fileName ) {
+    mpfilesStr += fileName.Data();
+    mpfilesStr += " ";
+  }  
+
+  istringstream mpFilesStream(mpfilesStr.Data());
+  while ( mpFilesStream >> fileName ) {
+    TString filePath = path + "/" + fileName;
+    if ( gSystem->OpenDirectory(filePath.Data()) )
+      ProcessDirectory(filePath, dataMap);
+    else
+      ProcessFile(filePath, dataMap);
+  }  
+
+  AliDebugStream(2) << "ProcessDirectory done " << path.Data() << endl;
+} 
+
+//_____________________________________________________________________________
+void AliMpDataProcessor::ProcessFile(const TString& path, AliMpDataMap* dataMap) 
+{
+/// Dump the content of the file specified by its path
+/// in a string and fill it in the dataMap
+
+  // cut top path
+  string top = AliMpFiles::GetTop().Data();
+  string fullDataPath = path.Data();
+  string dataPath = string(fullDataPath, top.size()+6);
+  
+  AliDebugStream(2) << "Processing file " << dataPath << endl;
+
+  // skip macros
+  if ( dataPath.find(".C") != std::string::npos || 
+       dataPath.find(".h") != std::string::npos ) return;
+  ifstream input(path.Data(), ios::in);
+  if ( ! input.is_open() ) {
+    cerr << "Cannot open input file " << path.Data() << endl;
+    return;
+  }  
+
+  string fileString;
+  string line;
+
+  do {
+    getline(input, line);
+    if ( ! input.eof() ) { 
+      fileString += line;
+      fileString += '\n';
+    }  
+  }
+  while ( ! input.eof() );
+
+  dataMap->Add(dataPath, fileString);
+  // dataMap->Add(new TObjString(dataPath.c_str()), new TObjString(fileString.c_str()));
+}  
+
+//_____________________________________________________________________________
+void AliMpDataProcessor::GenerateFunction(const TString& path, 
+                                          const TString& data) 
+{
+/// Generate a C++ function which defines a string with the data content 
+/// and map it to the given path in the map
+
+  AliDebugStream(2) << "Processing path " << path.Data() << endl;
+
+  // skip motif & padPos
+  //if ( dataPath.find("motif") != std::string::npos || 
+  //     dataPath.find("padPos") != std::string::npos ) return;
+  // add function declaration in the header file name
+  fHeaderFile << "    void AddData" << ++fCounter << "();" << endl;
+
+  // add function implementation in .cxx
+  fImplFile 
+    << "//_____________________________________________________________________________" << endl
+    << "void AliMpDataMap::AddData" << fCounter << "()" << endl
+    << "{" << endl
+    << "/// Automatically generated function for data file: " << endl
+    << "/// " << path << endl
+    << endl
+    << "  string path = \"" << path << "\";" << endl << endl;
+    
+  GenerateFileCode(data);
+  
+  fImplFile 
+    << endl
+    << "  fMap[path] = data;" << endl
+    << "}" << endl
+    << endl;      
+} 
+
+//_____________________________________________________________________________
+void AliMpDataProcessor::GenerateFileCode(const TString& data) 
+{
+/// Dump the content of the file specified by its path as a C++ string
+
+  istringstream in(data.Data());
+
+  string line;
+  getline(in, line);
+  fImplFile << "  string data = \""; 
+  //for ( unsigned int i=line.size(); i<58; i++ ) line = line + " ";
+  fImplFile << line << " \\n\";";
+  if ( in.eof() ) return; 
+
+  do {
+    getline(in, line);
+    if ( ! in.eof() ) { 
+      fImplFile << endl << "  data = data + \"";
+      // for ( unsigned int i=line.size(); i<58; i++ ) line = line + " ";
+      fImplFile << line << " \\n\";";
+    }  
+  }
+  while ( ! in.eof() );
+
+  fImplFile << endl;
+}  
+
+//_____________________________________________________________________________
+void AliMpDataProcessor::GenerateFill()
+{
+/// Generate function which calls all previously generated functions
+
+  // add function declaration in the header file name
+  fHeaderFile << endl << "    void Fill();" << endl;
+
+  // add function implementation in .cxx
+  fImplFile 
+    << "//_____________________________________________________________________________" << endl
+    << "void AliMpDataMap::Fill()" << endl
+    << "{" << endl
+    << "/// Automatically generated function for calling all generated functions " << endl
+    << endl;
+    
+  for ( Int_t i=1; i<=fCounter; ++i ) 
+   fImplFile << "  AddData" << i << "();" << endl;   
+      
+  fImplFile << "}" << endl;
+}  
+      
+
+//
+// public methods
+//
+
+
+//_____________________________________________________________________________
+AliMpDataMap* AliMpDataProcessor::CreateDataMap(const TString& dataDir) 
+{
+/// Process data directory and map a string with the content of each file to
+/// the file path.
+
+  TString curDir = gSystem->pwd();
+
+  AliMpDataMap* dataMap = new AliMpDataMap();
+
+  TString dataPath = AliMpFiles::GetTop() + "/" + dataDir;
+  ProcessDirectory(dataPath, dataMap); 
+  
+  gSystem->cd(curDir); 
+  
+  return dataMap;
+}
+  
+
+//_____________________________________________________________________________
+Bool_t AliMpDataProcessor::GenerateData(AliMpDataMap* dataMap,
+                                        const TString& outputDataDir) 
+{
+/// Generate ASCII data files in outputDataDir from dataMap
+
+  TString curDir = gSystem->pwd();  
+
+  TString outputDataPath = AliMpFiles::GetTop() + "/" + outputDataDir;
+  if ( gSystem->OpenDirectory(outputDataPath.Data()) ) {
+    AliErrorStream() 
+      << "Directory " << outputDataPath.Data() << " already exists" << endl;
+    return kFALSE;
+  }
+  else {
+    AliDebugStream(2) << "Making directory " <<  outputDataPath.Data() << endl;
+    gSystem->mkdir(outputDataPath.Data());
+  }  
+  
+/*
+  // std::map implementation
+
+  const map<string, string>& kMap = dataMap->GetMap();
+  map<string, string>::const_iterator it;
+  
+  for ( it = kMap.begin(); it != kMap.end(); it++ ) {
+    string path = it->first;
+    string data = it->second; 
+*/    
+
+  const TMap& kMap = dataMap->GetMap();
+  TMapIter it(&kMap);
+  TObject* keyObj;
+  while ( ( keyObj = it.Next() ) ) {
+
+    TString tpath = ((TObjString*)keyObj)->String();
+
+    TObject* dataObj = kMap.GetValue(keyObj);
+    if ( ! dataObj ) {
+      AliErrorStream() 
+        << "Cannot find value when iterating over map." << endl;
+      return kFALSE;
+    }      
+    TString tdata = ((TObjString*)dataObj)->String();   
+  
+    string path = tpath.Data();
+    string data = tdata.Data(); 
+  
+    if ( path.find_last_of("/") != string::npos ) {
+      string dataDir(path, 0, path.find_last_of("/"));
+      TString dataDirPath
+        = outputDataPath + "/" + dataDir.c_str();
+      if ( ! gSystem->OpenDirectory(dataDirPath.Data()) ) {
+        AliDebugStream(2) << "Making directory " <<  dataDirPath.Data() << endl;
+        gSystem->mkdir(dataDirPath.Data(), kTRUE);
+      }
+    }     
+
+    TString dataPath
+      = outputDataPath + "/" + path.c_str();
+
+    ofstream out(dataPath.Data(), ios::out);
+    if ( ! out.good() ) {
+      AliErrorStream() 
+        << "Cannot open output file  " << outputDataPath.Data() << endl;
+   
+      return kFALSE;  
+    }
+    
+    out << data;
+    out.close();
+  }
+
+  delete dataMap;
+  return kTRUE;
+}
+  
+//_____________________________________________________________________________
+Bool_t AliMpDataProcessor::GenerateCode(AliMpDataMap* dataMap) 
+{
+/// Generate C++ code from dataMap.
+/// <pre>
+/// AliMpDataProcessor mp;
+/// AliMpDataMap* dataMap = mp.CreateDataMap();
+/// mp.GenerateCode(dataMap);
+/// </pre>
+/// Not really used, but kept for eventual future explorations.
+
+/*
+  // std::map implementation
+
+  const map<string, string>& kMap = dataMap->GetMap();
+  map<string, string>::const_iterator it;
+  
+  for ( it = kMap.begin(); it != kMap.end(); it++ ) {
+    string path = it->first;
+    string data = it->second; 
+*/
+
+  const TMap& kMap = dataMap->GetMap();
+  TMapIter it(&kMap);
+  TObject* keyObj;
+  while ( ( keyObj = it.Next() ) ) {
+
+    TString tpath = ((TObjString*)keyObj)->String();
+
+    TObject* dataObj = kMap.GetValue(keyObj);
+    if ( ! dataObj ) {
+      AliErrorStream() 
+        << "Cannot find value when iterating over map." << endl;
+      return kFALSE;
+    }      
+    TString tdata = ((TObjString*)dataObj)->String();   
+  
+    GenerateFunction(tpath, tdata);
+  }
+  
+  GenerateFill();
+
+  return kTRUE;
+}
+  
+  
diff --git a/MUON/mapping/AliMpDataProcessor.h b/MUON/mapping/AliMpDataProcessor.h
new file mode 100644 (file)
index 0000000..1387848
--- /dev/null
@@ -0,0 +1,58 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// $Id$
+
+/// \ingroup basic
+/// \class AliMpDataProcessor
+/// \brief Class for converting ASCII data files in the map of string
+///
+/// \author Ivana Hrivnacova, IPN Orsay
+
+#ifndef ALI_MP_DATA_PROCESSOR_H
+#define ALI_MP_DATA_PROCESSOR_H
+
+#include <TObject.h>
+#include <TString.h>
+
+#include <fstream>
+
+class AliMpDataMap;
+
+class AliMpDataProcessor : public TObject
+{
+  public:
+    AliMpDataProcessor();
+    virtual ~AliMpDataProcessor();
+    
+    // methods
+    AliMpDataMap* CreateDataMap(const TString& dataDir = "data" );
+    Bool_t        GenerateData(AliMpDataMap* dataMap,
+                               const TString& outputDataDir = "data_new" );
+    Bool_t        GenerateCode(AliMpDataMap* dataMap);
+    
+  private:
+  
+    // methods  
+    void ProcessDirectory(const TString& path, AliMpDataMap* map);
+    void ProcessFile(const TString& path, AliMpDataMap* map );
+    void GenerateFunction(const TString& path, const TString& data);
+    void GenerateFileCode(const TString& path);
+    void GenerateFill();
+
+    // static data
+    /// default name for generated header file
+    static const TString fgkHeaderFileName;
+    /// default name for generated implementation file
+    static const TString fgkImplFileName;
+
+    // data
+    Int_t     fCounter;    ///< data files counter
+    ofstream  fHeaderFile; ///< header file
+    ofstream  fImplFile;   ///< implementation file
+  ClassDef(AliMpDataProcessor,0)  // Helper class for sorted integer array
+};
+
+#endif //ALI_MP_DATA_PROCESSOR_H
+
diff --git a/MUON/mapping/AliMpDataStreams.cxx b/MUON/mapping/AliMpDataStreams.cxx
new file mode 100644 (file)
index 0000000..4820a67
--- /dev/null
@@ -0,0 +1,212 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+// $Id$
+// $MpId: AliMpDataStreams.cxx,v 1.12 2006/05/23 13:09:54 ivana Exp $
+// Category: basic
+
+//-----------------------------------------------------------------------------
+// Class AliMpDataStreams
+// ----------------------
+// Class for providing mapping data streams
+// Se detailed description in the header file.
+// Author: Ivana Hrivnacova; IPN Orsay
+//-----------------------------------------------------------------------------
+
+#include "AliMpDataStreams.h"
+#include "AliMpDataMap.h"
+#include "AliMpFiles.h"
+
+#include "AliLog.h"
+
+#include <TMap.h>
+#include <TFile.h>
+#include <TObjString.h>
+#include <TString.h>
+#include <Riostream.h>
+
+#include <string>
+
+/// \cond CLASSIMP
+ClassImp(AliMpDataStreams)
+/// \endcond
+
+AliMpDataStreams* AliMpDataStreams::fgInstance = 0;
+
+//
+// static methods
+//
+
+//______________________________________________________________________________
+AliMpDataStreams* AliMpDataStreams::Instance()
+{
+/// Return its instance
+
+  if ( ! fgInstance ) {
+    fgInstance = new AliMpDataStreams();
+  }  
+    
+  return fgInstance;
+}    
+
+//
+// ctor, dtor
+//
+
+
+//______________________________________________________________________________
+AliMpDataStreams::AliMpDataStreams() 
+  : TObject(),
+    fMap(0),
+    fReadFromFiles(kTRUE)
+{
+/// Standard and default constructor
+
+}
+
+//______________________________________________________________________________
+AliMpDataStreams::~AliMpDataStreams() 
+{
+/// Destructor
+
+  delete fMap;
+
+  fgInstance = 0;
+}
+
+//
+// public methods
+//
+
+/*
+//______________________________________________________________________________
+TString AliMpDataStreams::GetDataStream(const TString& path) const
+{
+/// Return the string with data in the mapping file spcified with path
+
+  // Cut top from the path 
+  string top = AliMpFiles::GetTop().Data();
+  string fullDataPath = path.Data();
+  string dataPath = string(fullDataPath, top.size()+1);
+
+  cout << "Go to get value for " << dataPath.c_str() << endl;
+  
+  // Find string object in the map
+  TObject* object = fMap->GetValue(dataPath.c_str());
+  if ( ! object ) {
+    AliErrorStream() 
+      << "Cannot find data for mapping file " << dataPath << endl;
+    return "";
+  }   
+  
+  cout << "Got: " << object << endl;   
+  
+  return ((TObjString*)object)->String();
+}
+*/
+
+//______________________________________________________________________________
+istream& AliMpDataStreams::CreateDataStream(const TString& path) const
+{
+/// Return the string with data in the mapping file spcified with path.
+/// Both full path in the file system and a short path (without 
+/// $LICE_ROOT/mapping/data string) can be used.
+
+
+  if ( fReadFromFiles ) {                                                                
+    AliDebugStream(2) << "Opening file " << path.Data() << endl;
+    ifstream* fileBuffer = new ifstream();
+    fileBuffer->open(path.Data());
+    if ( ! fileBuffer->good() ) {      
+       AliErrorStream() 
+         << "Cannot open file " << path.Data() << endl;
+    }     
+    return *fileBuffer;
+  }
+  else {
+    AliDebugStream(2) << "Opening stream " << path.Data() << endl;
+
+    // Cut top from the path 
+    string top = AliMpFiles::GetTop().Data();
+    string fullDataPath = path.Data();
+    string dataPath = fullDataPath;
+    if ( dataPath.find(top) != string::npos )
+      dataPath.erase(0, top.size()+6);
+
+    istringstream* stringBuffer 
+      = new istringstream(fMap->Get(dataPath).Data());
+    return *stringBuffer;
+   }    
+}
+
+//______________________________________________________________________________
+Bool_t  AliMpDataStreams::IsDataStream(const TString& path) const
+{
+/// Return true, if data with given path exists
+
+  if ( fReadFromFiles ) {                                                                
+    ifstream fileBuffer(path.Data());
+    return fileBuffer.good();
+  }
+  else {
+    // Cut top from the path 
+    string top = AliMpFiles::GetTop().Data();
+    string fullDataPath = path.Data();
+    string dataPath = fullDataPath;
+    if ( dataPath.find(top) != string::npos )
+      dataPath.erase(0, top.size()+6);
+
+    // std::map implementation
+    // return fMap->GetMap().find(dataPath) != fMap->GetMap().end();
+    return ( fMap->Get(dataPath, kFALSE) != "" );
+  }
+}      
+
+
+//______________________________________________________________________________
+void  AliMpDataStreams::SetDataMap(AliMpDataMap* map)
+{
+/// Set the data map and switch off readFromFiles
+
+  if ( fMap && fMap != map ) delete fMap;
+
+  fMap = map;
+  fReadFromFiles = kFALSE;
+}  
+
+//______________________________________________________________________________
+void  AliMpDataStreams::SetReadFromFiles(Bool_t readFromFiles)
+{
+/// Set option to read data from files
+
+  if ( ! fMap && ! readFromFiles ) {
+    AliWarningStream()
+      << "Setting ignored: " << endl
+      << "Selected reading from streams, but data map has not been yet defined"
+      << endl;
+      
+    return;  
+  }     
+
+  fReadFromFiles = readFromFiles;
+}  
+
+//______________________________________________________________________________
+Bool_t AliMpDataStreams::GetReadFromFiles() const
+{ 
+/// Return the info where the data are loaded from
+
+  return fReadFromFiles; 
+}  
diff --git a/MUON/mapping/AliMpDataStreams.h b/MUON/mapping/AliMpDataStreams.h
new file mode 100644 (file)
index 0000000..270ce45
--- /dev/null
@@ -0,0 +1,72 @@
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// $Id$
+// $MpId: AliMpDataStreams.h,v 1.10 2006/05/24 13:58:07 ivana Exp $
+
+/// \ingroup basic
+/// \class AliMpDataStreams
+/// \brief Mapping data streams provider
+///
+/// The class provides input streams for mapping data;
+/// the input streams can be represented either by the
+/// data files or by string streams filled from AliMpDataMap.
+/// The string map is set from outside (AliMpCDB).
+/// The data stream must be deleted by client code.
+///
+/// The selection between files and string streams can
+/// be done via function:                                  \n 
+/// void   SetReadFromFiles(Bool_t readFromFiles);
+///
+/// \author Ivana Hrivnacova; IPN Orsay
+
+#ifndef ALI_MP_DATA_STREAMS_H
+#define ALI_MP_DATA_STREAMS_H
+
+#include "AliMpDataMap.h"
+
+#include <TObject.h>
+#include <TString.h>
+
+#include <fstream>
+#include <sstream>
+
+//class TMap;
+class AliMpDataMap;
+
+class AliMpDataStreams : public TObject
+{
+  public:
+    AliMpDataStreams();
+    virtual ~AliMpDataStreams();
+  
+    // static methods
+    static AliMpDataStreams* Instance();
+
+    // methods
+    istream& CreateDataStream(const TString& path) const; 
+    Bool_t   IsDataStream(const TString& path) const; 
+  
+    // set methods
+    void   SetDataMap(AliMpDataMap* map);
+    void   SetReadFromFiles(Bool_t readFromFiles);
+    Bool_t GetReadFromFiles() const;
+
+  private: 
+    /// Not implemented
+    AliMpDataStreams(const AliMpDataStreams& right);
+    /// Not implemented
+    AliMpDataStreams& operator=(const AliMpDataStreams& right);    
+
+    // static data members
+    static AliMpDataStreams* fgInstance; ///< Singleton instance
+
+    // data members
+    // TMap* fMap;
+    AliMpDataMap*  fMap;           ///< data map
+    Bool_t         fReadFromFiles; ///< option for reading data from files
+    
+  ClassDef(AliMpDataStreams, 1) //File names and paths 
+};  
+
+#endif //ALI_MP_DATA_STREAMS_H
index 62f57c5f9abe0aa5cec170c993997f6c754c2b10..dcab98c39cb84fd436867878cf19969b37f280cb 100755 (executable)
@@ -50,8 +50,8 @@ ClassImp(AliMpFiles)
 
 const TString AliMpFiles::fgkDataDir = "/data";
 const TString AliMpFiles::fgkStationDir = "/station";
-const TString AliMpFiles::fgkBendingDir = "/bending_plane/";
-const TString AliMpFiles::fgkNonBendingDir = "/non-bending_plane/";
+const TString AliMpFiles::fgkBendingDir = "bending_plane/";
+const TString AliMpFiles::fgkNonBendingDir = "non-bending_plane/";
 const TString AliMpFiles::fgkDENames = "denames"; 
 const TString AliMpFiles::fgkSector  = "zones"; 
 const TString AliMpFiles::fgkSectorSpecial = "zones_special";
@@ -62,7 +62,7 @@ const TString AliMpFiles::fgkManuToSerialDir ="manu_serial/";
 const TString AliMpFiles::fgkManuToSerial ="_manu";
 const TString AliMpFiles::fgkPadPosPrefix  = "padPos"; 
 const TString AliMpFiles::fgkDataExt = ".dat";      
-const TString AliMpFiles::fgkBergToGCFileName = "/bergToGC"; 
+const TString AliMpFiles::fgkBergToGCFileName = "bergToGC"; 
 const TString AliMpFiles::fgkTriggerLocalBoards = "RegionalCrate";
 const TString AliMpFiles::fgkTriggerGlobalBoards = "GlobalCrate";
 const TString AliMpFiles::fgkBusPatchFileName = "DetElemIdToBusPatch";
@@ -80,25 +80,6 @@ AliMpFiles::~AliMpFiles()
 // private methods
 //
 
-//______________________________________________________________________________
-TString AliMpFiles::GetTop()
-{
-/// Return top path to mapping data defined either via MINSTALL
-/// or ALICE_ROOT environment variable.                                      \n
-/// If both variables are defined, MINSTALL is used.
-
-  TString top = getenv("MINSTALL");    
-  if ( ! top.IsNull() ) return top;
-
-  TString ntop = getenv("ALICE_ROOT");
-  if ( ntop.IsNull() ) {
-    AliErrorClassStream() << "Cannot find path to mapping data." << endl;
-    return ntop;
-  }  
-  ntop += "/MUON/mapping";
-  return ntop;
-}
-
 //______________________________________________________________________________
 TString AliMpFiles::PlaneDataDir(AliMp::StationType station, 
                                  AliMp::PlaneType plane)
@@ -120,7 +101,7 @@ TString AliMpFiles::PlaneDataDir(AliMp::StationType station,
     break;
   case AliMp::kStation345:
   case AliMp::kStationTrigger:  
-    return GetTop() + fgkDataDir + StationDataDir(station) + "/";
+    return GetTop() + fgkDataDir + StationDataDir(station);
     break;
   default:  
     AliFatalClass("Incomplete switch on AliMp::PlaneType");
@@ -356,3 +337,22 @@ AliMpFiles::SetTopPath(const TString& topPath)
   GetTop() = topPath; 
 }
 
+//______________________________________________________________________________
+TString AliMpFiles::GetTop()
+{
+/// Return top path to mapping data defined either via MINSTALL
+/// or ALICE_ROOT environment variable.                                      \n
+/// If both variables are defined, MINSTALL is used.
+
+  TString top = getenv("MINSTALL");    
+  if ( ! top.IsNull() ) return top;
+
+  TString ntop = getenv("ALICE_ROOT");
+  if ( ntop.IsNull() ) {
+    AliErrorClassStream() << "Cannot find path to mapping data." << endl;
+    return ntop;
+  }  
+  ntop += "/MUON/mapping";
+  return ntop;
+}
+
index 1047d1b3a7c80de6106b73243addfd73ba1db6d0..cd13a6f05986f3cd49b5a0957e4a716b5995ea5a 100755 (executable)
@@ -87,6 +87,7 @@ class AliMpFiles : public TObject
 
     // set methods
     static void SetTopPath(const TString& topPath);
+    static TString GetTop();
   
   private: 
     /// Not implemented
@@ -97,7 +98,6 @@ class AliMpFiles : public TObject
     AliMpFiles& operator=(const AliMpFiles& right);    
 
     // methods
-    static TString GetTop();
     static TString PlaneDataDir(AliMp::StationType station, AliMp::PlaneType plane); 
     static TString StationDataDir(AliMp::StationType station); 
   
index 5290549b0959eb19674619ec32c1384111381b10..14450d1427f7bd6c7076178bf929910724771503 100644 (file)
@@ -26,6 +26,7 @@
 //-----------------------------------------------------------------------------
 
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpMotifReader.h"
 #include "AliMpMotifMap.h"
 #include "AliMpMotif.h"
@@ -81,24 +82,34 @@ AliMpMotifReader::~AliMpMotifReader()
 //_____________________________________________________________________________
 AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
 {
-/// Read the files describing a motif in the "$MINSTALL/data" directory
+/// Read the streams describing a motif in the "$MINSTALL/data" directory
 /// and fill the AliMpMotifType structure with.
-/// The files mentioned are are named padPos<maskName>.dat
+/// The streams mentioned are named padPos<maskName>.dat
 /// and connect<maskName>.dat
 
-  AliMpMotifType*  motifType = new AliMpMotifType(motifTypeId);        
+  // Open streams
+  //
+  istream& padPosStream 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::PadPosFilePath(
+                            fStationType,fPlaneType, motifTypeId));
+  istream& bergToGCStream 
+    = AliMpDataStreams::Instance()
+      ->CreateDataStream(AliMpFiles::BergToGCFilePath(fStationType));
+      
+  istream& motifTypeStream 
+    = AliMpDataStreams::Instance()
+      ->CreateDataStream(AliMpFiles::MotifFilePath(
+                            fStationType, fPlaneType, motifTypeId));
 
-  TString padPosFileName(AliMpFiles::PadPosFilePath(fStationType, 
-                                                    fPlaneType, motifTypeId));
-  ifstream padPos(padPosFileName);
-  AliDebugStream(2) << "Opening file " << padPosFileName << endl;
+  AliMpMotifType*  motifType = new AliMpMotifType(motifTypeId);        
 
   PadMapType positions;
 
   char line[256];
   do {
-    padPos.getline(line,255);
-    if (!padPos) break;
+    padPosStream.getline(line,255);
+    if (!padPosStream) break;
 
 #if defined (__HP_aCC) || (__alpha)
     strstream strline;
@@ -121,15 +132,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     positions.Add( AliMpExMap::GetIndex(key), 
                    AliMpExMap::GetIndex(AliMpIntPair(i,j)) ); 
 #endif
-  } while (!padPos.eof());
-
-  padPos.close();
+  } while (!padPosStream.eof());
 
-  TString bergToGCFileName
-    = AliMpFiles::BergToGCFilePath(fStationType);
-  AliDebugStream(2) << "Opening file " << bergToGCFileName << endl;
-
-  ifstream bergToGCFile(bergToGCFileName);
   const Int_t knbergpins = 
     (fStationType == AliMp::kStation1 || fStationType == AliMp::kStation2 ) ? 80 : 100;
   // Station1 & 2 Bergstak connectors have 80 pins, while for stations
@@ -138,8 +142,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
   while(1) {
     Int_t bergNum;
     TString gcStr;
-    bergToGCFile>>bergNum>>gcStr;
-    if (!bergToGCFile.good()) break;
+    bergToGCStream>>bergNum>>gcStr;
+    if (!bergToGCStream.good()) break;
     if (gcStr=="GND") continue;
     if (bergNum>knbergpins) {
         Fatal("BuildMotifType","Berg number > 80 ...");
@@ -147,13 +151,7 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     }
     gassiChannel[bergNum-1]= atoi(gcStr);
   }
-  bergToGCFile.close();
   
-  TString motifTypeFileName(AliMpFiles::MotifFilePath(fStationType, 
-                                                      fPlaneType, motifTypeId));
-  ifstream motif(motifTypeFileName);
-  AliDebugStream(2) << "Opening file " << motifTypeFileName << endl;
-
   Int_t nofPadsX=0;
   Int_t nofPadsY=0;
 
@@ -162,8 +160,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     Int_t ix,iy,numBerg,numKapton,padNum,gassiNum;
 
     TString lineStr,token;
-    lineStr.ReadLine(motif);
-    if (!motif.good()) break;
+    lineStr.ReadLine(motifTypeStream);
+    if (!motifTypeStream.good()) break;
 #if defined (__HP_aCC) || (__alpha)
     strstream tokenList;
     tokenList << lineStr.Data();
@@ -213,8 +211,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     if (iter==positions.end()) {
       AliWarningStream()
         << "Problem: Pad number " << padNum
-       << " found in the file " << motifTypeFileName
-       << " but not in the file " << padPosFileName << endl;
+        << " for motif type " << motifTypeId.Data() 
+       << " found in the motifType stream, but not in the padPos stream" << endl;
       continue;
     }
 
@@ -227,8 +225,8 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     if (!value) {
       AliWarningStream()
         << "Problem: Pad number " << padNum
-       << " found in the file " << motifTypeFileName
-       << " but not in the file " << padPosFileName << endl;
+        << " for motif type " << motifTypeId.Data() 
+       << " found in the motifType stream, but not in the padPos stream" << endl;
       continue;
     }
 
@@ -245,34 +243,18 @@ AliMpMotifType* AliMpMotifReader::BuildMotifType(const TString& motifTypeId)
     if (ix>=nofPadsX) nofPadsX=ix+1;
     if (iy>=nofPadsY) nofPadsY=iy+1;
 
-  } while (!motif.eof());    
+  } while (!motifTypeStream.eof());    
 
 
   motifType->SetNofPads(nofPadsX, nofPadsY);
-
-  motif.close();
+  
+  delete &padPosStream;
+  delete &bergToGCStream;
+  delete &motifTypeStream;
 
   return motifType;
 }
 
-//_____________________________________________________________________________
-TString 
-AliMpMotifReader::MotifSpecialName(const TString& motifID, Double_t scale)
-{
-  /// Build the name taking into the scale, if not 1.0
-  TString id;
-  
-  if ( scale != 1.0 )
-  {
-    id = Form("%s-%e",motifID.Data(),scale);
-  }
-  else
-  {
-    id = motifID;
-  }
-  return id;
-}
-
 //_____________________________________________________________________________
 AliMpMotifSpecial*  
 AliMpMotifReader::BuildMotifSpecial(const TString& motifID,
@@ -282,15 +264,12 @@ AliMpMotifReader::BuildMotifSpecial(const TString& motifID,
 /// Build a special motif by reading the file motifSpecial<motifId>.dat
 /// in the data directory
 
-  // Open the input file
-  TString motifSpecialFileName(AliMpFiles::MotifSpecialFilePath(fStationType, 
-                                                                fPlaneType, motifID));
-  ifstream in(motifSpecialFileName);
-  if (!in) {   
-     AliErrorStream() 
-       << "File " << motifSpecialFileName.Data() << " not found." << endl;
-     return 0;
-  }
+  // Open streams
+  //
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::MotifSpecialFilePath(
+                             fStationType,fPlaneType, motifID));
 
   TString id = MotifSpecialName(motifID,scale);
   
@@ -305,7 +284,26 @@ AliMpMotifReader::BuildMotifSpecial(const TString& motifID,
   }
   res->CalculateDimensions();
   
-  in.close();
+  delete &in;
+  
   return res;
 }
 
+//_____________________________________________________________________________
+TString 
+AliMpMotifReader::MotifSpecialName(const TString& motifID, Double_t scale)
+{
+  /// Build the name taking into the scale, if not 1.0
+  TString id;
+  
+  if ( scale != 1.0 )
+  {
+    id = Form("%s-%e",motifID.Data(),scale);
+  }
+  else
+  {
+    id = motifID;
+  }
+  return id;
+}
+
index 70b653bc3d5b6a31dbe11fd73d9e19c67d9ce3ad..d1f1b3e7dd2c72c91e7ed78b7fe88160c78f2505 100644 (file)
@@ -75,7 +75,7 @@ class AliMpMotifReader : public TObject
     AliMp::StationType  fStationType; ///< station type 
     AliMp::PlaneType    fPlaneType;   ///< plane type 
 
-  ClassDef(AliMpMotifReader,1)  // Data reader
+  ClassDef(AliMpMotifReader,0)  // Data reader
 };
 
 #endif //ALI_MP_MOTIF_READER_H
index 441352afd5954e04b4f6164f37bff1c155c3ee5a..906378c0534d53ffa9b6cd58e2a60fe210128b50 100644 (file)
@@ -29,6 +29,7 @@
 #include "AliMpLocalBoard.h"
 #include "AliMpConstants.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpHelper.h"
 
 #include "AliLog.h"
@@ -101,29 +102,17 @@ AliMpRegionalTrigger::~AliMpRegionalTrigger()
 /// Destructor
 }
 
+
 //
-// public methods
+// private methods
 //
 
 //______________________________________________________________________________
-Bool_t AliMpRegionalTrigger::ReadData(const TString& fileName)
+Bool_t AliMpRegionalTrigger::ReadData(istream& in)
 {
 /// Load the Regional trigger from ASCII data files
 /// and return its instance
     
-    TString inFileName(fileName);
-    if ( inFileName == "" )
-      inFileName = AliMpFiles::LocalTriggerBoardMapping();
-    
-    inFileName = gSystem->ExpandPathName(inFileName.Data());
-
-    ifstream in(inFileName.Data(), ios::in);
-
-    if (!in) {
-      AliErrorStream()
-         << "Local Trigger Board Mapping File " << fileName.Data() << " not found" << endl;
-      return kFALSE;
-    }
 
     AliMpLocalBoard* board = 0x0;
     AliMpTriggerCrate* crate = 0x0;
@@ -210,9 +199,47 @@ Bool_t AliMpRegionalTrigger::ReadData(const TString& fileName)
         }
       }
     }
+    
     return kTRUE;
 }
 
+//
+// public methods
+//
+
+//______________________________________________________________________________
+Bool_t AliMpRegionalTrigger::ReadData(const TString& fileName)
+{
+/// Load the Regional trigger from ASCII data files
+/// and return its instance
+    
+    if ( fileName != "" ) {
+      AliDebugStream(2) << "Read data from file " << fileName.Data() << endl;
+    
+      TString inFileName(fileName);
+      inFileName = gSystem->ExpandPathName(inFileName.Data());
+      ifstream inFile(inFileName.Data(), ios::in);
+      if ( ! inFile.good() ) {
+        AliErrorStream()
+           << "Local Trigger Board Mapping File " << fileName.Data() << " not found" << endl;
+        return kFALSE;
+      }
+      
+      return ReadData(inFile);  
+    } 
+    else {
+      AliDebugStream(2) << "Read data from stream " << fileName.Data() << endl;
+      istream& in
+         = AliMpDataStreams::Instance()
+             ->CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
+             
+      Bool_t result = ReadData(in);
+      
+      delete &in;
+      return result;        
+    }
+}
+
 //______________________________________________________________________________
 AliMpLocalBoard* AliMpRegionalTrigger::FindLocalBoard(Int_t localBoardId, 
                                                       Bool_t warn) const {
index 9c83dd864ae1fb6da24743c805e2b14b3b7126bf..04f7aadf7207ab610442d1cb743382637f620975 100644 (file)
@@ -52,6 +52,8 @@ class AliMpRegionalTrigger : public  TObject{
     Int_t GetNofLocalBoards() const;
 
   private:
+    Bool_t ReadData(istream& in);
+
     // data members  
     AliMpExMap  fTriggerCrates; ///< map for trigger crates
     AliMpExMap fLocalBoardMap; ///< map of local boards (owner of boards)
index b37175664900506da82c7ce7565f41457fa5a120..c7b846641cb43fb8f7cdabe938344f3522a53c3e 100755 (executable)
@@ -28,6 +28,7 @@
 #include "AliMpSectorReader.h"
 #include "AliMpSector.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpZone.h"
 #include "AliMpSubZone.h"
 #include "AliMpRow.h"
@@ -80,6 +81,7 @@ AliMpSectorReader::AliMpSectorReader(AliMp::StationType station,
     fPlaneType(plane),
     fSector(0),
     fMotifReader(new AliMpMotifReader(station, plane))
 {
 /// Standard constructor
 }
@@ -108,7 +110,7 @@ AliMpSectorReader::~AliMpSectorReader()
 //
 
 //_____________________________________________________________________________
-void  AliMpSectorReader::ReadSectorData(ifstream& in)
+void  AliMpSectorReader::ReadSectorData(istream& in)
 {
 /// Read sector input data;
 /// prepare zones and rows vectors to be filled in.
@@ -152,7 +154,7 @@ void  AliMpSectorReader::ReadSectorData(ifstream& in)
 }  
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadZoneData(ifstream& in)
+void AliMpSectorReader::ReadZoneData(istream& in)
 {
 /// Read zone input data;
 /// create zone and adds it to zones vector.
@@ -181,7 +183,7 @@ void AliMpSectorReader::ReadZoneData(ifstream& in)
 }
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadSubZoneData(ifstream& in, AliMpZone* zone)
+void AliMpSectorReader::ReadSubZoneData(istream& in, AliMpZone* zone)
 {
 /// Read subzone input data;
 /// create subzone and its to the specified zone.
@@ -204,7 +206,7 @@ void AliMpSectorReader::ReadSubZoneData(ifstream& in, AliMpZone* zone)
 }   
 
 //_____________________________________________________________________________
-AliMpVMotif*  AliMpSectorReader::ReadMotifData(ifstream& in, AliMpZone* zone)
+AliMpVMotif*  AliMpSectorReader::ReadMotifData(istream& in, AliMpZone* zone)
 {
 /// Read the motif input data.
 
@@ -241,7 +243,7 @@ AliMpVMotif*  AliMpSectorReader::ReadMotifData(ifstream& in, AliMpZone* zone)
 }  
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadRowSegmentsData(ifstream& in, 
+void AliMpSectorReader::ReadRowSegmentsData(istream& in, 
                                       AliMpZone* zone, AliMpSubZone* subZone)
 {
 /// Read row segments input data of a specified zone and subzone;
@@ -301,7 +303,7 @@ void AliMpSectorReader::ReadRowSegmentsData(ifstream& in,
 }   
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadSectorSpecialData(ifstream& in, AliMp::XDirection direction)
+void AliMpSectorReader::ReadSectorSpecialData(istream& in, AliMp::XDirection direction)
 {
 /// Read sector input data
 /// with a special (irregular) motifs.
@@ -331,7 +333,7 @@ void AliMpSectorReader::ReadSectorSpecialData(ifstream& in, AliMp::XDirection di
 }  
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadMotifsSpecialData(ifstream& in)
+void AliMpSectorReader::ReadMotifsSpecialData(istream& in)
 {
 /// Read the special (irregular) motifs input data.
 
@@ -358,7 +360,7 @@ void AliMpSectorReader::ReadMotifsSpecialData(ifstream& in)
 }  
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadRowSpecialData(ifstream& in, AliMp::XDirection direction)
+void AliMpSectorReader::ReadRowSpecialData(istream& in, AliMp::XDirection direction)
 {
 /// Read row input data
 /// with a special (irregular) motifs.
@@ -419,7 +421,7 @@ void AliMpSectorReader::ReadRowSpecialData(ifstream& in, AliMp::XDirection direc
 }  
 
 //_____________________________________________________________________________
-void AliMpSectorReader::ReadRowSegmentSpecialData(ifstream& in, 
+void AliMpSectorReader::ReadRowSegmentSpecialData(istream& in, 
                                             AliMpVRowSegmentSpecial* segment,
                                            AliMp::XDirection direction)
 {
@@ -530,50 +532,47 @@ void AliMpSectorReader::ReadRowSegmentSpecialData(ifstream& in,
 //_____________________________________________________________________________
 AliMpSector* AliMpSectorReader::BuildSector()
 {
-/// Read the mapping data from ascii data file
-/// and create the basic objects:                                            \n
+/// Read the mapping data from stream and create the basic objects:         \n
 /// zones, subzones, rows, row segments, motifs.
 
-  // Open input file
-  ifstream in(AliMpFiles::SectorFilePath(fStationType, fPlaneType).Data(), ios::in);
-  if (!in) {
-     AliErrorStream()
-       << "File " << AliMpFiles::SectorFilePath(fStationType, fPlaneType) 
-       << " not found." << endl;
-     return 0;
-  }
-  
+  // Open input stream
+  //
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::SectorFilePath(fStationType,fPlaneType));
+
   ReadSectorData(in);
+  delete &in;
+  
   fSector->SetRowSegmentOffsets();
 
-  // Open input file for special inner zone
+  // Open input stream for special inner zone
+  
+  // add is data function
+  
   TString sectorSpecialFileName 
     = AliMpFiles::SectorSpecialFilePath(fStationType, fPlaneType);
-  if (!gSystem->AccessPathName(sectorSpecialFileName.Data())) {
-    ifstream in2(sectorSpecialFileName.Data(), ios::in);
-    if (!in2) {        
-       AliErrorStream()
-         << "File " << AliMpFiles::SectorSpecialFilePath(fStationType, fPlaneType) 
-        << " not found." << endl;
-       return 0;
-    }
-    
+  if ( AliMpDataStreams::Instance()-> IsDataStream(sectorSpecialFileName) ) {
+    istream& in2 
+      = AliMpDataStreams::Instance()
+         ->CreateDataStream(sectorSpecialFileName);
+  
     ReadSectorSpecialData(in2, AliMp::kLeft);
-  }   
+    
+    delete &in2;
+  }  
 
   // Open input file for special outer zone
   TString sectorSpecialFileName2 
     = AliMpFiles::SectorSpecialFilePath2(fStationType, fPlaneType);
-  if (!gSystem->AccessPathName(sectorSpecialFileName2.Data())) {
-    ifstream in3(sectorSpecialFileName2.Data(), ios::in);
-    if (!in3) {        
-       AliErrorStream()
-         << "File " << AliMpFiles::SectorSpecialFilePath2(fStationType, fPlaneType) 
-        << " not found."<< endl;       
-       return 0;
-    }
+  if ( AliMpDataStreams::Instance()-> IsDataStream(sectorSpecialFileName2) ) {
+    istream& in3
+      = AliMpDataStreams::Instance()
+         ->CreateDataStream(sectorSpecialFileName2);
     
     ReadSectorSpecialData(in3, AliMp::kRight);
+    
+    delete &in3;
   }   
 
   fSector->Initialize();
index 71b99a108589f682933429960a9eed0891b8e0b5..802fb0ae5e80ab06fee41cc5a227b693a38a3153 100755 (executable)
@@ -51,16 +51,16 @@ class AliMpSectorReader : public TObject
     AliMpSectorReader& operator = (const AliMpSectorReader& right);
 
     // methods
-    void  ReadSectorData(ifstream& in);
-    void  ReadZoneData(ifstream& in);
-    void  ReadSubZoneData(ifstream& in, AliMpZone* zone);
-    void  ReadRowSegmentsData(ifstream& in,
+    void  ReadSectorData(istream& in);
+    void  ReadZoneData(istream& in);
+    void  ReadSubZoneData(istream& in, AliMpZone* zone);
+    void  ReadRowSegmentsData(istream& in,
                           AliMpZone* zone, AliMpSubZone* subZone);
-    AliMpVMotif*  ReadMotifData(ifstream& in, AliMpZone* zone);
-    void  ReadSectorSpecialData(ifstream& in, AliMp::XDirection direction);
-    void  ReadMotifsSpecialData(ifstream& in);
-    void  ReadRowSpecialData(ifstream& in, AliMp::XDirection direction);
-    void  ReadRowSegmentSpecialData(ifstream& in,
+    AliMpVMotif*  ReadMotifData(istream& in, AliMpZone* zone);
+    void  ReadSectorSpecialData(istream& in, AliMp::XDirection direction);
+    void  ReadMotifsSpecialData(istream& in);
+    void  ReadRowSpecialData(istream& in, AliMp::XDirection direction);
+    void  ReadRowSegmentSpecialData(istream& in,
                           AliMpVRowSegmentSpecial* segment,
                          AliMp::XDirection direction);
     
@@ -82,7 +82,7 @@ class AliMpSectorReader : public TObject
     AliMpSector*        fSector;      ///< sector
     AliMpMotifReader*   fMotifReader; ///< motif reader
 
-  ClassDef(AliMpSectorReader,1)  // Data reader
+  ClassDef(AliMpSectorReader,0)  // Data reader
 };
 
 #endif //ALI_MP_READER_H
index 8a592ea1aceb2369711aa1cca0329f865bb44a1e..d948839c3fe9e72ca7cd38b4aed6a8d64089c777 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "AliMpSegmentation.h"
 
+#include "AliMpDataStreams.h"
 #include "AliMpDetElement.h"
 #include "AliMpDEStore.h"
 #include "AliMpDEManager.h"
@@ -89,7 +90,8 @@ AliMpSegmentation* AliMpSegmentation::ReadData(Bool_t warn)
     return fgInstance;
   }  
   
-  AliInfoClass("Reading segmentation from ASCII files.");
+  if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+    AliInfoClass("Reading segmentation from ASCII files.");
 
   fgInstance = new AliMpSegmentation();
   return fgInstance;
index 021ba9b31a4b857ef3a192cd3bd179a83a963ad7..3b97d45e2413e5c2f48f46cb8457af57e9f6bbbd 100644 (file)
@@ -22,6 +22,7 @@
 #include "AliMpSlatMotifMap.h"
 #include "AliMpMotifReader.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpMotifType.h"
 #include "AliMpPCB.h"
 #include "AliMpSlat.h"
@@ -81,12 +82,10 @@ AliMpSt345Reader::ReadPCB(const char* pcbType)
   /// Create a new AliMpPCB object, by reading it from file.
   /// The returned object must be deleted by the client
   
-  std::ifstream in(AliMpFiles::SlatPCBFilePath(AliMp::kStation345,pcbType).Data());
-  if (!in.good()) 
-  {
-    AliErrorClass(Form("Cannot open file for PCB %s",pcbType));
-    return 0;
-  }
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::SlatPCBFilePath(
+                             AliMp::kStation345, pcbType));
  
   AliMpMotifReader reader(AliMp::kStation345,AliMp::kNonBendingPlane); 
   // note that the nonbending
@@ -148,7 +147,7 @@ AliMpSt345Reader::ReadPCB(const char* pcbType)
     }
   }
   
-  in.close();
+  delete &in;
   
   return pcb;
 }
@@ -161,15 +160,11 @@ AliMpSt345Reader::ReadSlat(const char* slatType, AliMp::PlaneType planeType)
   /// Create a new AliMpSlat object, by reading it from file.
   /// The returned object must be deleted by the client.
   
-  std::ifstream in(AliMpFiles::SlatFilePath(AliMp::kStation345,slatType,
-                                            planeType).Data());
-  if (!in.good()) 
-  {
-    AliErrorClass(Form("Cannot read slat from %s",
-                       AliMpFiles::SlatFilePath(AliMp::kStation345,slatType,planeType).Data()));
-    return 0;
-  }
-  
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::SlatFilePath(
+                             AliMp::kStation345, slatType, planeType));
+
   char line[80];
   
   const TString kpcbKeyword("PCB");
@@ -226,8 +221,9 @@ AliMpSt345Reader::ReadSlat(const char* slatType, AliMp::PlaneType planeType)
     }
   }
   
-  in.close();
+  delete &in;
   
   return slat;
-}
+}  
+                              
 
index 7e4fbdb03465a5df28f27619dc6d23c4ee99b045..990de9bbcbc9047a5bcd4b1fb72112a6720c4357 100644 (file)
@@ -20,6 +20,7 @@
 #include "AliMpTriggerReader.h"
 #include "AliMpMotifReader.h"
 #include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
 #include "AliMpMotifType.h"
 #include "AliMpPCB.h"
 #include "AliMpSlat.h"
@@ -465,13 +466,10 @@ AliMpTriggerReader::ReadLines(const char* slatType,
                        " destLine %d\n",slatType,scale,flipX,flipY,
                        srcLine,destLine));
   
-  TString filename(AliMpFiles::SlatFilePath(AliMp::kStationTrigger,slatType,
-                                            planeType).Data());
-  std::ifstream in(filename.Data());
-  if (!in.good()) 
-  {
-    AliErrorClass(Form("Cannot read slat from %s",filename.Data()));
-  }
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::SlatFilePath(
+                             AliMp::kStationTrigger,slatType, planeType));
   
   char line[80];
   
@@ -533,7 +531,7 @@ AliMpTriggerReader::ReadLines(const char* slatType,
     }
   }
   
-  in.close();
+  delete &in;
 }
                                         
 //_____________________________________________________________________________
@@ -542,55 +540,47 @@ AliMpTriggerReader::ReadLocalBoardMapping()
 {
   /// Reads the file that contains the mapping local board name <-> number
 
-  TString filename(AliMpFiles::LocalTriggerBoardMapping());
-  
-  AliDebugClass(2,Form("Reading from %s\n",filename.Data()));
-
   fLocalBoardMap.DeleteAll();
   
   UShort_t mask;
   
-  ifstream in(filename.Data());
-  if (!in.good())
-  {
-    AliErrorClass(Form("Cannot read file %s\n",filename.Data()));    
-  }
-  else
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::LocalTriggerBoardMapping());
+
+  char line[80];
+  Char_t localBoardName[20];
+  Int_t j,localBoardId;
+  UInt_t switches;
+  
+  while (!in.eof())
   {
-    char line[80];
-    Char_t localBoardName[20];
-    Int_t j,localBoardId;
-    UInt_t switches;
-    
-    while (!in.eof())
-    {
-      for (Int_t i = 0; i < 4; ++i)
-        if (!in.getline(line,80)) continue; //skip 4 first lines
+    for (Int_t i = 0; i < 4; ++i)
+      if (!in.getline(line,80)) continue; //skip 4 first lines
  
-      // read mask
-      if (!in.getline(line,80)) break;
-      sscanf(line,"%hx",&mask);
-      
-      for ( Int_t i = 0; i < 16; ++i ) 
-      {      
-        if ( (mask >> i ) & 0x1 )
+    // read mask
+    if (!in.getline(line,80)) break;
+    sscanf(line,"%hx",&mask);
+    
+    for ( Int_t i = 0; i < 16; ++i ) 
+    {      
+      if ( (mask >> i ) & 0x1 )
+      {
+        if (!in.getline(line,80)) break; 
+        sscanf(line,"%02d %s %03d %03x", &j, localBoardName, &localBoardId, &switches);
+        if (localBoardId <= AliMpConstants::NofLocalBoards()) 
         {
-          if (!in.getline(line,80)) break; 
-          sscanf(line,"%02d %s %03d %03x", &j, localBoardName, &localBoardId, &switches);
-          if (localBoardId <= AliMpConstants::NofLocalBoards()) 
-          {
-            fLocalBoardMap.Add(new TObjString(localBoardName), new TObjString(Form("%d",localBoardId)));
-            AliDebugClass(10,Form("Board %s has number %d\n", localBoardName, localBoardId));
-          }
-          // skip 2 following lines
-          if (!in.getline(line,80)) break; 
-          if (!in.getline(line,80)) break; 
-         }
-      }
-    }      
+          fLocalBoardMap.Add(new TObjString(localBoardName), new TObjString(Form("%d",localBoardId)));
+          AliDebugClass(10,Form("Board %s has number %d\n", localBoardName, localBoardId));
+        }
+        // skip 2 following lines
+        if (!in.getline(line,80)) break; 
+        if (!in.getline(line,80)) break; 
+       }
+    }
   }
-
-  in.close();
+  
+  delete &in;      
 }
 
 //_____________________________________________________________________________
@@ -615,12 +605,10 @@ AliMpTriggerReader::ReadPCB(const char* pcbType)
     pcbName = pcbName(0,pos);
   }
   
-  std::ifstream in(AliMpFiles::SlatPCBFilePath(AliMp::kStationTrigger,pcbName).Data());
-  if (!in.good()) 
-  {
-    AliErrorClass(Form("Cannot open file for PCB %s",pcbName.Data()));
-    return 0;
-  }
+  istream& in 
+    = AliMpDataStreams::Instance()
+       ->CreateDataStream(AliMpFiles::SlatPCBFilePath(
+                             AliMp::kStationTrigger,pcbName));
  
   AliMpMotifReader reader(AliMp::kStationTrigger,AliMp::kNonBendingPlane); 
   // note that the nonbending
@@ -727,7 +715,7 @@ AliMpTriggerReader::ReadPCB(const char* pcbType)
     }
   }
   
-  in.close();
+  delete &in;
   
   return pcb;
 }
index c8199141474ddc22ff05f37f6a599e62bd4d6dd9..5213361e554f93a9df925b0d2818853c69409481 100755 (executable)
@@ -60,4 +60,4 @@ K     1       1
 L      2       1
 M      0       0
 N      1       0
-P      2       0
\ No newline at end of file
+P      2       0
index 21243c02828e23a9a8bc3978bdc59533fe604384..69b05255d3bfdc8c550cbe6ceb80f64a92d175e1 100644 (file)
@@ -1,4 +1,4 @@
-# NonBending PCB. Density 2. Left to right (labelled "plus")
+# NonBending PCB. Density 2. Left to right (labelled plus)
 # Placing motifs starting bottom left and going counter-clockwise
 
 SIZES 0.714285714 5 40 40
index c6dee7934171962723ab3947be60eb82dac018a0..1098281eb6708a66eb65ece0ffd0966d5c86c6de 100644 (file)
@@ -1,4 +1,4 @@
-# NonBending PCB. Density 2. Right to left (labelled "minus")
+# NonBending PCB. Density 2. Right to left (labelled minus)
 # Placing motifs starting bottom left and going counter-clockwise
 
 SIZES 0.714285714 5 40 40
index 4de9a8e2927f3615dfa9b394974eba82cdacbac4..80ee3c4902c4bfaa0477720acb13c2534b4a038f 100644 (file)
@@ -11,4 +11,4 @@ MOTIF L17 14  0
 
 MOTIF O19 14 48
 MOTIF O19 12 48
-MOTIF R40  9 44
\ No newline at end of file
+MOTIF R40  9 44
index b72300fc95e740c3a2c4a3db4aa29ce74c473f86..a3396363fe3be281e12e8970d54d0e2653bbd681 100644 (file)
@@ -8,4 +8,4 @@ MOTIF R38 30  0
 MOTIF R39 45  0
 MOTIF R37 49  6
 MOTIF R36 43  6
-MOTIF R35 30  6
\ No newline at end of file
+MOTIF R35 30  6
index 3e523e654f7108b090010f7c1e93267822203ead..c79e76eff6ac15d28334b323befdc7ac971df169 100644 (file)
@@ -22,4 +22,4 @@ MOTIF R29  2 24
 MOTIF R28  1 25
 MOTIF R27  0 26
 
-MOTIF R30  7  5
\ No newline at end of file
+MOTIF R30  7  5
index 1e9267d7c908564dc3ad83d02fdc2f693f139700..4ffe17536a55b5d716ad7cccfbdbd9ec274002a7 100644 (file)
@@ -10,4 +10,4 @@
 48-55
 20-29
 10-19
-0-9
\ No newline at end of file
+0-9
index 2cb0ab65bc258136f9100fd740fa5ceadc0cf94c..efa458888549b40912160193d980cace3e9562e9 100644 (file)
@@ -9,4 +9,4 @@ MOTIF O3 32  0
 
 MOTIF O4 32  4
 MOTIF O4 16  4
-MOTIF O4  0  4
\ No newline at end of file
+MOTIF O4  0  4
index bbbe9d81cd063d0cf70057f45d9fb37b670dff46..b6340ead6e186bd1c64a27943e7caa26239d6c95 100644 (file)
@@ -1 +1 @@
-SCALE 1RL4 1.01060
\ No newline at end of file
+SCALE 1RL4 1.01060
index 73e7782717e8d1115beee7003e00d6b9df57b3cc..6349ca7ce6815d82006b2dca77a465e70f115028 100644 (file)
@@ -1 +1 @@
-SCALE 1RL5 1.01060
\ No newline at end of file
+SCALE 1RL5 1.01060
index 09efa2746c6d69296d22d473b4e5dc3b787a0ab4..850ec62c52a530dda1993c7cdc94cfafa6f952ea 100644 (file)
@@ -1 +1 @@
-SCALE 1RL6 1.01060
\ No newline at end of file
+SCALE 1RL6 1.01060
index 5a9cb62f9deb19b29b8fdf577f609cd45506f7fd..25a818e5ae7ed8100ed6c8fd2a18a49a6e519b0d 100644 (file)
@@ -1 +1 @@
-SCALE 1RL7 1.01060
\ No newline at end of file
+SCALE 1RL7 1.01060
index 7ef6a293a0208a5a5ae4ddd4eac42d75e491c0b0..24d2ecb9c3edec1d22c497cb346b2844ddff4b17 100644 (file)
@@ -1 +1 @@
-SCALE 1RL4 1.07296
\ No newline at end of file
+SCALE 1RL4 1.07296
index 7ef6a293a0208a5a5ae4ddd4eac42d75e491c0b0..24d2ecb9c3edec1d22c497cb346b2844ddff4b17 100644 (file)
@@ -1 +1 @@
-SCALE 1RL4 1.07296
\ No newline at end of file
+SCALE 1RL4 1.07296
index ac0bedeb5b682dd733708e29fe91467a72c65778..0467efa0afb5e689573abfbf03dfc152c168e6d9 100644 (file)
@@ -1 +1 @@
-SCALE 1RL5 1.07296
\ No newline at end of file
+SCALE 1RL5 1.07296
index ac0bedeb5b682dd733708e29fe91467a72c65778..0467efa0afb5e689573abfbf03dfc152c168e6d9 100644 (file)
@@ -1 +1 @@
-SCALE 1RL5 1.07296
\ No newline at end of file
+SCALE 1RL5 1.07296
index 009350f18af4e2b3744db5674058433f84e5da4b..0b1fa17613832a6d061cc3626f21667309372e8f 100644 (file)
@@ -1 +1 @@
-SCALE 1RL6 1.07296
\ No newline at end of file
+SCALE 1RL6 1.07296
index 009350f18af4e2b3744db5674058433f84e5da4b..0b1fa17613832a6d061cc3626f21667309372e8f 100644 (file)
@@ -1 +1 @@
-SCALE 1RL6 1.07296
\ No newline at end of file
+SCALE 1RL6 1.07296
index 5defe754a981c5c88c1d3d3e4afb17487b7eb4f7..8af796f0c17a95c3b253290d31f9ebb515c53e7d 100644 (file)
@@ -1 +1 @@
-SCALE 1RL7 1.07296
\ No newline at end of file
+SCALE 1RL7 1.07296
index 5defe754a981c5c88c1d3d3e4afb17487b7eb4f7..8af796f0c17a95c3b253290d31f9ebb515c53e7d 100644 (file)
@@ -1 +1 @@
-SCALE 1RL7 1.07296
\ No newline at end of file
+SCALE 1RL7 1.07296
index b24d5ed0acc70e57d0c3d11a8647dafe006feba1..c413745b8d0e34375a2c7fbb2d4d36a6248cad74 100644 (file)
@@ -1 +1 @@
-SCALE 1RL8 1.07296
\ No newline at end of file
+SCALE 1RL8 1.07296
index b24d5ed0acc70e57d0c3d11a8647dafe006feba1..c413745b8d0e34375a2c7fbb2d4d36a6248cad74 100644 (file)
@@ -1 +1 @@
-SCALE 1RL8 1.07296
\ No newline at end of file
+SCALE 1RL8 1.07296
index e43330a071c5314a8fbcd1b6ff48b83833cbc882..d6469407d10924e3086b8e4f2a62336a5091c42a 100644 (file)
@@ -1 +1 @@
-SCALE 1RL9 1.07296
\ No newline at end of file
+SCALE 1RL9 1.07296
index e43330a071c5314a8fbcd1b6ff48b83833cbc882..d6469407d10924e3086b8e4f2a62336a5091c42a 100644 (file)
@@ -1 +1 @@
-SCALE 1RL9 1.07296
\ No newline at end of file
+SCALE 1RL9 1.07296
index 5ecbd0904340f37abcb7d9c7f062e3e21c064204..ee1db8917f1b68a80b9a2a851e041069fc71d20b 100644 (file)
 231 LC7L6B1 7L 6 000-11-1-0-000
 232 LC7L7B1 7L 7 000-11-1-0-000
 233 LC7L8B1 7L 8 000-11-1-0-000
-234 LC7L9B1 7L 9 000-01-1-0-001
\ No newline at end of file
+234 LC7L9B1 7L 9 000-01-1-0-001
index 127e01eda68bf9537f772cd45e749c07e5e09e45..ce50daf58ce00aeaf013cd329adf7d7f20442e54 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 34 4.25 34 68
 
-MOTIF X16 0 0
\ No newline at end of file
+MOTIF X16 0 0
index 56024467bd4fb4616effa3a55e5da5024374859e..24ccbc1900699ff13b06888fa8d2688adbc83892 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 34 4.25 34 68
 
-MOTIF X8 0 0
\ No newline at end of file
+MOTIF X8 0 0
index acc8a15a1b0a5ffade80319c1ff4b494a80f85fd..b89f2eeeb84f38e98034ff52ee6eb8acfc143b85 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 34 1.0625 68 68
 
-MOTIF X8 -1 0
\ No newline at end of file
+MOTIF X8 -1 0
index fac70972a3ce45532f8fd2913a0e112477c7067b..6b04451452f2dc44be115c6879b37b5d2e4f991b 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 2.125 68 187 68
 
-MOTIF Y16 0 0
\ No newline at end of file
+MOTIF Y16 0 0
index caf1d290b15598fa261e02df23de076fb3eb0268..0c8983550817211393fab8a21a4d827a8e414e59 100644 (file)
@@ -1,4 +1,4 @@
 SIZES 2.125 68 187 68
 
 MOTIF Y16 0 0
-MOTIF Y8 -8 0
\ No newline at end of file
+MOTIF Y8 -8 0
index 2da6b8a40df6e7c10238604a24ee3b4bd9c360c2..ba5b6dee268b2172b8790b207f5447b973858046 100644 (file)
@@ -1 +1 @@
-SPECIAL_MOTIF Y8 Y16
\ No newline at end of file
+SPECIAL_MOTIF Y8 Y16
index b0f5ed4d5e391ab032e3fea33771579a94eafdb9..67be142e37d5db4b3a2adc80b2757b30a1747786 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 4.25 68 51 68
 
-MOTIF Y8 0 0 
\ No newline at end of file
+MOTIF Y8 0 0
index bdcba40c111f3976b951f6d557bd76ae331089f0..17fd22dd2c83836a1c47d306991006585af91a2f 100644 (file)
@@ -1,3 +1,3 @@
 SIZES 4.25 68 85 68
 
-MOTIF Y8 0 0
\ No newline at end of file
+MOTIF Y8 0 0
index 2120072ae39257c717cf2e182ab1f7daafb8aaa7..5ae0b81145256014f384d2fdae5533adf9549ee0 100644 (file)
@@ -97,4 +97,4 @@
 97  GND
 98  GND
 99  GND
-100  GND
\ No newline at end of file
+100  GND
index d9c63998e5e558946512646c2eeb9d443babf629..b0ee07785a3902706736296e7ecc7d946dd4e93d 100644 (file)
@@ -13,4 +13,4 @@
 12 0 2.125 68
 13 0 2.125 68
 14 0 2.125 68
-15 0 2.125 68
\ No newline at end of file
+15 0 2.125 68