#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;
<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
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
#
#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;
+ }
}
//______________________________________________________________________________
/// 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;
+ }
}
//______________________________________________________________________________
/// 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)
{
}
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);
+}
+
+
/// \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
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,
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
/// 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
#include "AliMpFrtCrocusConstants.h"
#include "AliMpDDL.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpHelper.h"
#include "AliMpDEManager.h"
#include "AliMpDetElement.h"
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;
{
/// 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];
ddl->FillBusPatchIds();
}
- in.close();
+ delete ∈
return true;
}
/// 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];
}
}
+ delete ∈
+
return kTRUE;
}
{
/// 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 ) {
}
}
+
+ delete ∈
return true;
}
#include "AliMpDetElement.h"
#include "AliMpConstants.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpHelper.h"
#include "AliMpIntPair.h"
#include "AliMpConstants.h"
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;
//______________________________________________________________________________
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;
delete stringList;
}
- in.close();
+ delete ∈
+
return true;
}
/// 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
//
}
in >> word;
}
-
- // Close file
- in.close();
+ delete ∈
+
return true;
}
--- /dev/null
+/**************************************************************************
+ * 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();
+}
+
--- /dev/null
+/* 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
+
--- /dev/null
+/**************************************************************************
+ * 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;
+}
+
+
--- /dev/null
+/* 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
+
--- /dev/null
+/**************************************************************************
+ * 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;
+}
--- /dev/null
+/* 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
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";
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";
// 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)
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");
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;
+}
+
// set methods
static void SetTopPath(const TString& topPath);
+ static TString GetTop();
private:
/// Not implemented
AliMpFiles& operator=(const AliMpFiles& right);
// methods
- static TString GetTop();
static TString PlaneDataDir(AliMp::StationType station, AliMp::PlaneType plane);
static TString StationDataDir(AliMp::StationType station);
//-----------------------------------------------------------------------------
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpMotifReader.h"
#include "AliMpMotifMap.h"
#include "AliMpMotif.h"
//_____________________________________________________________________________
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;
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
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 ...");
}
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;
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();
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;
}
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;
}
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,
/// 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);
}
res->CalculateDimensions();
- in.close();
+ delete ∈
+
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;
+}
+
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
#include "AliMpLocalBoard.h"
#include "AliMpConstants.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpHelper.h"
#include "AliLog.h"
/// 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;
}
}
}
+
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 ∈
+ return result;
+ }
+}
+
//______________________________________________________________________________
AliMpLocalBoard* AliMpRegionalTrigger::FindLocalBoard(Int_t localBoardId,
Bool_t warn) const {
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)
#include "AliMpSectorReader.h"
#include "AliMpSector.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpZone.h"
#include "AliMpSubZone.h"
#include "AliMpRow.h"
fPlaneType(plane),
fSector(0),
fMotifReader(new AliMpMotifReader(station, plane))
+
{
/// Standard constructor
}
//
//_____________________________________________________________________________
-void AliMpSectorReader::ReadSectorData(ifstream& in)
+void AliMpSectorReader::ReadSectorData(istream& in)
{
/// Read sector input data;
/// prepare zones and rows vectors to be filled in.
}
//_____________________________________________________________________________
-void AliMpSectorReader::ReadZoneData(ifstream& in)
+void AliMpSectorReader::ReadZoneData(istream& in)
{
/// Read zone input data;
/// create zone and adds it to zones vector.
}
//_____________________________________________________________________________
-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.
}
//_____________________________________________________________________________
-AliMpVMotif* AliMpSectorReader::ReadMotifData(ifstream& in, AliMpZone* zone)
+AliMpVMotif* AliMpSectorReader::ReadMotifData(istream& in, AliMpZone* zone)
{
/// Read the motif input data.
}
//_____________________________________________________________________________
-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;
}
//_____________________________________________________________________________
-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.
}
//_____________________________________________________________________________
-void AliMpSectorReader::ReadMotifsSpecialData(ifstream& in)
+void AliMpSectorReader::ReadMotifsSpecialData(istream& in)
{
/// Read the special (irregular) motifs input data.
}
//_____________________________________________________________________________
-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.
}
//_____________________________________________________________________________
-void AliMpSectorReader::ReadRowSegmentSpecialData(ifstream& in,
+void AliMpSectorReader::ReadRowSegmentSpecialData(istream& in,
AliMpVRowSegmentSpecial* segment,
AliMp::XDirection direction)
{
//_____________________________________________________________________________
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 ∈
+
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();
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);
AliMpSector* fSector; ///< sector
AliMpMotifReader* fMotifReader; ///< motif reader
- ClassDef(AliMpSectorReader,1) // Data reader
+ ClassDef(AliMpSectorReader,0) // Data reader
};
#endif //ALI_MP_READER_H
#include "AliMpSegmentation.h"
+#include "AliMpDataStreams.h"
#include "AliMpDetElement.h"
#include "AliMpDEStore.h"
#include "AliMpDEManager.h"
return fgInstance;
}
- AliInfoClass("Reading segmentation from ASCII files.");
+ if ( AliMpDataStreams::Instance()->GetReadFromFiles() )
+ AliInfoClass("Reading segmentation from ASCII files.");
fgInstance = new AliMpSegmentation();
return fgInstance;
#include "AliMpSlatMotifMap.h"
#include "AliMpMotifReader.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpMotifType.h"
#include "AliMpPCB.h"
#include "AliMpSlat.h"
/// 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
}
}
- in.close();
+ delete ∈
return pcb;
}
/// 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");
}
}
- in.close();
+ delete ∈
return slat;
-}
+}
+
#include "AliMpTriggerReader.h"
#include "AliMpMotifReader.h"
#include "AliMpFiles.h"
+#include "AliMpDataStreams.h"
#include "AliMpMotifType.h"
#include "AliMpPCB.h"
#include "AliMpSlat.h"
" 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];
}
}
- in.close();
+ delete ∈
}
//_____________________________________________________________________________
{
/// 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 ∈
}
//_____________________________________________________________________________
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
}
}
- in.close();
+ delete ∈
return pcb;
}
L 2 1
M 0 0
N 1 0
-P 2 0
\ No newline at end of file
+P 2 0
-# 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
-# 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
MOTIF O19 14 48
MOTIF O19 12 48
-MOTIF R40 9 44
\ No newline at end of file
+MOTIF R40 9 44
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
MOTIF R28 1 25
MOTIF R27 0 26
-MOTIF R30 7 5
\ No newline at end of file
+MOTIF R30 7 5
48-55
20-29
10-19
-0-9
\ No newline at end of file
+0-9
MOTIF O4 32 4
MOTIF O4 16 4
-MOTIF O4 0 4
\ No newline at end of file
+MOTIF O4 0 4
-SCALE 1RL4 1.01060
\ No newline at end of file
+SCALE 1RL4 1.01060
-SCALE 1RL5 1.01060
\ No newline at end of file
+SCALE 1RL5 1.01060
-SCALE 1RL6 1.01060
\ No newline at end of file
+SCALE 1RL6 1.01060
-SCALE 1RL7 1.01060
\ No newline at end of file
+SCALE 1RL7 1.01060
-SCALE 1RL4 1.07296
\ No newline at end of file
+SCALE 1RL4 1.07296
-SCALE 1RL4 1.07296
\ No newline at end of file
+SCALE 1RL4 1.07296
-SCALE 1RL5 1.07296
\ No newline at end of file
+SCALE 1RL5 1.07296
-SCALE 1RL5 1.07296
\ No newline at end of file
+SCALE 1RL5 1.07296
-SCALE 1RL6 1.07296
\ No newline at end of file
+SCALE 1RL6 1.07296
-SCALE 1RL6 1.07296
\ No newline at end of file
+SCALE 1RL6 1.07296
-SCALE 1RL7 1.07296
\ No newline at end of file
+SCALE 1RL7 1.07296
-SCALE 1RL7 1.07296
\ No newline at end of file
+SCALE 1RL7 1.07296
-SCALE 1RL8 1.07296
\ No newline at end of file
+SCALE 1RL8 1.07296
-SCALE 1RL8 1.07296
\ No newline at end of file
+SCALE 1RL8 1.07296
-SCALE 1RL9 1.07296
\ No newline at end of file
+SCALE 1RL9 1.07296
-SCALE 1RL9 1.07296
\ No newline at end of file
+SCALE 1RL9 1.07296
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
SIZES 34 4.25 34 68
-MOTIF X16 0 0
\ No newline at end of file
+MOTIF X16 0 0
SIZES 34 4.25 34 68
-MOTIF X8 0 0
\ No newline at end of file
+MOTIF X8 0 0
SIZES 34 1.0625 68 68
-MOTIF X8 -1 0
\ No newline at end of file
+MOTIF X8 -1 0
SIZES 2.125 68 187 68
-MOTIF Y16 0 0
\ No newline at end of file
+MOTIF Y16 0 0
SIZES 2.125 68 187 68
MOTIF Y16 0 0
-MOTIF Y8 -8 0
\ No newline at end of file
+MOTIF Y8 -8 0
-SPECIAL_MOTIF Y8 Y16
\ No newline at end of file
+SPECIAL_MOTIF Y8 Y16
SIZES 4.25 68 51 68
-MOTIF Y8 0 0
\ No newline at end of file
+MOTIF Y8 0 0
SIZES 4.25 68 85 68
-MOTIF Y8 0 0
\ No newline at end of file
+MOTIF Y8 0 0
97 GND
98 GND
99 GND
-100 GND
\ No newline at end of file
+100 GND
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