To generate this file, the macro MUONGenerateBusPatch.C could be used.
-\subsection mapping_s3_sub8 crate.dat
+\subsection mapping_s3_sub7 BusPatchSpecial.dat
+
+Lines starting with # are comments.
+
+Contains the list of bus patches which manu readout is
+not in the standard order. The format:
+
+<pre>
+KEYWORD DDLs BusPatches [ManuIDs}
+ where KEYWORD = REVERT or EXPLICIT
+</pre>
+
+- For the bus patches following the REVERT keyword,
+ the manus are just reordered in a reverted order.
+- For the bus patches following the EXPLICIT keyword,
+the manus filled with a standard procedure (using the DetElemIdToBusPatch.dat
+file) are replaced with the list of manus in this file.
+
+
+\subsection mapping_s3_sub9 crate.dat
Muon trigger electronics configuration file (decoded in class
AliMUONTriggerCrateStore) directly copy/paste from the ALICE PRR
return true;
}
+//_____________________________________________________________________________
+Bool_t AliMpArrayI::Revert()
+{
+/// Revert the order of elements
+
+ if ( fSort ) {
+ AliErrorStream() << "Cannot revert sorted array." << endl;
+ return false;
+ }
+
+ Int_t size = GetSize();
+ TArrayI newArray(size);
+ Int_t idx = 0 ;
+ for ( Int_t i = size-1 ; i >= 0 ; i--) {
+ Int_t value = GetValue(i);
+ newArray.AddAt(value,idx++);
+ }
+
+ for (Int_t i = 0; i < size ; i++) {
+ fValues[i]=newArray.At(i);
+ }
+ return true;
+}
+
+//_____________________________________________________________________________
+void AliMpArrayI::Reset()
+{
+/// Reset the array
+
+ fValues.Set(fgkDefaultSize);
+ fNofValues = 0;
+ fLimits = AliMpIntPair(INT_MIN,INT_MAX);
+}
+
//_____________________________________________________________________________
void AliMpArrayI::SetSize(Int_t size)
{
// methods
Bool_t Add(Int_t value, Bool_t warn=kTRUE);
Bool_t Remove(Int_t value);
+ Bool_t Revert();
+ void Reset();
// set methods
void SetSize(Int_t size);
fId(),
fDEId(),
fDdlId(),
- fManus(),
+ fManus(false),
fNofManusPerModule(false),
fCableLength(-1)
{
return false;
}
+//______________________________________________________________________________
+void AliMpBusPatch::RevertReadout()
+{
+/// Revert order of manus
+
+ fManus.Revert();
+}
+
+//______________________________________________________________________________
+void AliMpBusPatch::ResetReadout()
+{
+/// Revert order of manus
+
+ fManus.Reset();
+}
+
//______________________________________________________________________________
Int_t AliMpBusPatch::GetNofManus() const
{
Bool_t AddManu(Int_t manuId);
Bool_t SetNofManusPerModule(Int_t manuNumber = 0);
void SetCableLength(Float_t length);
-
+ void RevertReadout();
+ void ResetReadout();
+
// get methods
Int_t GetId() const;
Int_t GetDEId() const;
AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
const Int_t AliMpDDLStore::fgkNofDDLs = 20;
const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
+const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
+const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
//
// static methods
ReadTrigger();
SetTriggerDDLs();
SetManus();
+ ReadBusPatchSpecial();
SetPatchModules();
SetBusPatchLength();
}
// Create DDL if it does not yet exist and set it to the crate
AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
if ( !ddl) {
- cout << "ReadRegionalTrigger: creating DDL: " << iDDL << endl;
ddl = new AliMpDDL(iDDL);
fDDLs.AddAt(ddl, iDDL);
}
return true;
}
+//______________________________________________________________________________
+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;
+ }
+
+ char line[255];
+
+ while ( in.getline(line,255) ) {
+
+ if ( line[0] == '#' ) continue;
+
+ TString tmp(AliMpHelper::Normalize(line));
+ TObjArray* stringList = tmp.Tokenize(TString(" "));
+
+ TString sKey = ((TObjString*)stringList->At(0))->GetString();
+
+ TString sDDL = ((TObjString*)stringList->At(1))->GetString();
+ TArrayI ddlList;
+ AliMpHelper::DecodeName(sDDL,';',ddlList);
+
+ TString sBusPatch = ((TObjString*)stringList->At(2))->GetString();
+ TArrayI busPatchList;
+ AliMpHelper::DecodeName(sBusPatch,',',busPatchList);
+
+ // Loop over DDL and Bus Patch
+ for (Int_t iDDL = 0; iDDL < ddlList.GetSize(); ++iDDL ) {
+ for (Int_t iBusPatch = 0; iBusPatch < busPatchList.GetSize(); ++iBusPatch) {
+ // Global bus patch ID
+ Int_t busPatchID
+ = AliMpBusPatch::GetGlobalBusID(
+ busPatchList.At(iBusPatch), ddlList.At(iDDL));
+
+ // Get this bus patch
+ AliMpBusPatch* busPatch = GetBusPatch(busPatchID);
+ if ( ! busPatch ) {
+ AliErrorStream() << "Bus patch " << busPatchID << " does not exist." << endl;
+ return kFALSE;
+ }
+
+ if ( sKey == fgkRevertKeyword ) {
+ AliDebugStream(3)
+ << "Reverting readout of bus patch " << busPatchID << endl;
+
+ // Now revert the manus in this bus patch
+ busPatch->RevertReadout();
+ }
+ else if ( sKey == fgkExplicitKeyword ) {
+
+ busPatch->ResetReadout();
+
+ TString sManus = ((TObjString*)stringList->At(3))->GetString();
+ TArrayI manuList;
+ AliMpHelper::DecodeName(sManus,',',manuList);
+
+ AliDebugStream(3)
+ << "Reseting readout of bus patch " << busPatchID
+ << " manus: " << sManus.Data() << endl;
+
+ for (Int_t i = 0; i < manuList.GetSize(); i++) {
+ busPatch->AddManu(manuList.At(i));
+ }
+ }
+ else {
+ AliErrorStream() << "Unrecognized key." << endl;
+ return kFALSE;
+ }
+ }
+ }
+ }
+
+ return kTRUE;
+}
+
+
//______________________________________________________________________________
Bool_t AliMpDDLStore::SetPatchModules() {
/// Compute the number of manu per PCB for each buspatch
Bool_t ReadTrigger();
Bool_t SetTriggerDDLs();
Bool_t SetManus();
+ Bool_t ReadBusPatchSpecial();
Bool_t SetPatchModules();
Bool_t SetBusPatchLength();
Int_t GetLocalBoardId(TString name) const;
static AliMpDDLStore* fgInstance; ///< Singleton instance
static const Int_t fgkNofDDLs; ///< Total number of DDLs
static const Int_t fgkNofTriggerDDLs; ///< Total number of trigger DDLs
+ static const TString fgkRevertKeyword; ///< A keyword for ReadBusPatchSpecial()
+ static const TString fgkExplicitKeyword; ///< A keyword for ReadBusPatchSpecial()
// data members
TObjArray fDDLs; ///< Array of DDL objects
const TString AliMpFiles::fgkTriggerGlobalBoards = "GlobalCrate";
const TString AliMpFiles::fgkBusPatchFileName = "DetElemIdToBusPatch";
const TString AliMpFiles::fgkBusPatchLengthFileName = "BusPatchLength";
+const TString AliMpFiles::fgkBusPatchSpecialFileName = "BusPatchSpecial";
//______________________________________________________________________________
AliMpFiles::~AliMpFiles()
{
return GetTop() + fgkDataDir + "/" + fgkBusPatchLengthFileName + fgkDataExt;
}
+//______________________________________________________________________________
+TString AliMpFiles::BusPatchSpecialFilePath()
+{
+/// Return path to data file with special bus patch mapping.
+
+ return GetTop() + fgkDataDir + "/" + fgkBusPatchSpecialFileName + fgkDataExt;
+}
+
//______________________________________________________________________________
TString AliMpFiles::DENamesFilePath(AliMp::StationType station)
{
//
static TString BusPatchFilePath();
static TString BusPatchLengthFilePath();
+ static TString BusPatchSpecialFilePath();
// de names
//
static const TString fgkTriggerGlobalBoards;///< global board name to id mapping
static const TString fgkBusPatchFileName; ///< DetElemIdToBusPatch file name
static const TString fgkBusPatchLengthFileName;///< BusPatch length file name
+ static const TString fgkBusPatchSpecialFileName;///< BusPatch special file name
ClassDef(AliMpFiles, 0) //File names and paths
};
--- /dev/null
+# Bus patches with reverted order of manus
+# DDL, BusPatch
+REVERT 0-3 12,13,14,15,16,17,18,19,36,37,38,39,40,41,42,43
+#
+# Bus patches with explicit order of manus
+EXPLICIT 0-3 24,48 232,233,234,235,236,237,243,242,241,240,239,238