#include "AliMpDataStreams.h"
#include "AliMpFiles.h"
#include "AliMpHelper.h"
-#include "AliMpIntPair.h"
#include "AliMpConstants.h"
+#include "AliMpEncodePair.h"
#include "AliLog.h"
//______________________________________________________________________________
AliMpManuStore::AliMpManuStore(const AliMpDataStreams& dataStreams)
: TObject(),
- fDataStreams(dataStreams),
+ fkDataStreams(dataStreams),
fManuToSerialNbs(),
fSerialNbToManus(),
fNofManusInDE(),
//______________________________________________________________________________
AliMpManuStore::AliMpManuStore(TRootIOCtor* ioCtor)
: TObject(),
- fDataStreams(ioCtor),
+ fkDataStreams(ioCtor),
fManuToSerialNbs(),
fSerialNbToManus(),
fNofManusInDE(),
TString deName = de->GetDEName();
AliMp::StationType stationType
= AliMpDEManager::GetStationType(de->GetId());
+ AliMq::Station12Type station12Type
+ = AliMpDEManager::GetStation12Type(de->GetId());
// Nothing to be done for trigger
if ( stationType == AliMp::kStationTrigger ) {
static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
istream& in
- = fDataStreams.
- CreateDataStream(AliMpFiles::ManuToSerialPath(deName, stationType));
+ = fkDataStreams.
+ CreateDataStream(
+ AliMpFiles::ManuToSerialPath(deName, stationType, station12Type));
char line[80];
/// As TExMap has no replcae function, we have to rebuild map once again.
/// Not yet in use, declared private.
- Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+ Long_t index = AliMp::Pair(detElemId, manuId);
TExMap newManuToSerialNbs;
// Loop over map
TString deName = detElement->GetDEName();
AliMp::StationType stationType
= AliMpDEManager::GetStationType(detElemId);
+ AliMq::Station12Type station12Type
+ = AliMpDEManager::GetStation12Type(detElemId);
if ( stationType == AliMp::kStationTrigger ) continue;
// Create directory if it does not yet exist
//
- TString dirPath = outDir + AliMpFiles::StationDataDir(stationType);
+ TString dirPath = outDir + AliMpFiles::StationDataDir(stationType, station12Type);
if ( ! gSystem->OpenDirectory(dirPath.Data()) ) {
AliDebugStream(2) << "Making directory " << dirPath.Data() << endl;
gSystem->mkdir(dirPath.Data());
// Compose output file path
//
- string dataPath = AliMpFiles::ManuToSerialPath(deName, stationType).Data();
+ string dataPath = AliMpFiles::ManuToSerialPath(deName, stationType, station12Type).Data();
string top = AliMpFiles::GetTop().Data();
if ( dataPath.find(top) != string::npos ) dataPath.erase(0, top.size()+1);
dataPath.erase(0,dataPath.find('/')+1);
Long_t key;
Long_t value;
while ( ( it2.Next(key, value) ) ) {
- AliMpIntPair pair = AliMpExMap::GetPair(key);
+ Int_t pairFirst = AliMp::PairFirst(key);
- if ( pair.GetFirst() != detElemId ) continue;
+ if ( pairFirst != detElemId ) continue;
+ Int_t manuId = AliMp::PairSecond(key);
+
AliDebugStream(3)
- << "Go to write " << key << " " << pair << " " << value << endl;
+ << "Go to write " << key << " "
+ << pairFirst << " " << manuId << " " << value << endl;
- Int_t manuId = pair.GetSecond();
static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
TString planeName = PlaneTypeName(AliMp::kBendingPlane);
- if ( pair.GetSecond()> manuMask ) {
+ if ( manuId> manuMask ) {
planeName = PlaneTypeName(AliMp::kNonBendingPlane);
manuId -= manuMask;
}
{
/// Add manu to the map
- Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+ Long_t index = AliMp::Pair(detElemId, manuId);
AliDebugStream(2)
<< "Adding (" << detElemId << "," << manuId
if ( fgWarnIfDoublon ) {
AliWarningStream()
<< "Serial number " << serialNb
- << " already present for (detElemId, manuId) = " << AliMpExMap::GetPair(value)
- << ", it will nod be added for ("
- << detElemId << "," << manuId << ")" << endl;
+ << " already present for (detElemId, manuId) = " ;
+ AliMp::PairPut(AliWarningStream(), (MpPair_t) value) << endl;
}
return kFALSE;
}
{
/// Return manu serial number for given detElemId and manuId
- Long_t index = AliMpExMap::GetIndex(AliMpIntPair(detElemId, manuId));
+ Long_t index = AliMp::Pair(detElemId, manuId);
// cout << index << " " << fManuToSerialNbs.GetValue(index) << endl;
return fManuToSerialNbs.GetValue(index);
}
//______________________________________________________________________________
-AliMpIntPair AliMpManuStore::GetDetElemIdManu(Int_t manuSerial) const
+MpPair_t AliMpManuStore::GetDetElemIdManu(Int_t manuSerial) const
{
/// Return detElemId and manuId for given manu serial number
+/// as encoded pair
- Long_t value = fSerialNbToManus.GetValue(Long_t(manuSerial));
- // cout << manuSerial << " " << value << endl;
-
- return AliMpExMap::GetPair(value);
+ return fSerialNbToManus.GetValue(Long_t(manuSerial));
}