1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // $MpId: AliMpDDLStore.cxx,v 1.4 2006/05/24 13:58:34 ivana Exp $
18 // Category: management
20 //-----------------------------------------------------------------------------
21 // Class AliMpDDLStore
22 // --------------------
23 // The top container class for DDLs, det elements and bus patched
24 // It provides acces to DDL, det element and bus patches objects
25 // via various characteristics.
26 // Authors: Ivana Hrivnacova, IPN Orsay
27 // Christian Finck, SUBATECH Nantes
28 //-----------------------------------------------------------------------------
31 #include "AliMpDDLStore.h"
32 #include "AliMpExMapIterator.h"
33 #include "AliMpConstants.h"
34 #include "AliMpDEStore.h"
35 #include "AliMpFrtCrocusConstants.h"
37 #include "AliMpFiles.h"
38 #include "AliMpDataStreams.h"
39 #include "AliMpHelper.h"
40 #include "AliMpDEManager.h"
41 #include "AliMpManuStore.h"
42 #include "AliMpDetElement.h"
43 #include "AliMpBusPatch.h"
44 #include "AliMpTriggerCrate.h"
45 #include "AliMpLocalBoard.h"
46 #include "AliMpSegmentation.h"
47 #include "AliMpVSegmentation.h"
48 #include "AliMpStringObjMap.h"
52 #include <Riostream.h>
54 #include <TObjArray.h>
56 #include <TObjString.h>
60 ClassImp(AliMpDDLStore)
63 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
64 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
65 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
66 const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
67 const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
73 //______________________________________________________________________________
74 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
76 /// Create the DDL store if it does not yet exist
77 /// and return its instance
79 if ( ! fgInstance && warn ) {
80 AliWarningClass("DDL Store has not been loaded");
86 //______________________________________________________________________________
87 AliMpDDLStore* AliMpDDLStore::ReadData(const AliMpDataStreams& dataStreams,
90 /// Load the DDL store from ASCII data files
91 /// and return its instance
95 AliWarningClass("DDL Store has been already loaded");
99 if ( dataStreams.GetReadFromFiles() )
100 AliInfoClass("Reading Manu Store from ASCII files.");
102 fgInstance = new AliMpDDLStore(dataStreams);
110 //______________________________________________________________________________
111 AliMpDDLStore::AliMpDDLStore(const AliMpDataStreams& dataStreams)
113 fkDataStreams(dataStreams),
114 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
120 /// Standard constructor
123 fDDLs.SetOwner(true);
124 fBusPatches.SetOwner(true);
125 fBusPatches.SetSize(900);
127 // Load segmentation & DE store data
128 if ( ! AliMpSegmentation::Instance(false) )
129 AliMpSegmentation::ReadData(dataStreams, true);
131 // Create all detection elements
136 ReadBusPatchSpecial();
141 //______________________________________________________________________________
142 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
144 fkDataStreams(ioCtor),
147 fRegionalTrigger(ioCtor)
149 /// Constructor for I0
157 //______________________________________________________________________________
158 AliMpDDLStore::~AliMpDDLStore()
164 // DDL objects are deleted with fDDLs
165 // Bus patches objects are deleted with fBusPatches
174 //______________________________________________________________________________
175 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
177 /// Return the index of the manu list for given detElemId
179 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
183 //______________________________________________________________________________
184 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
186 /// Calculate the index of the buspatch from manuId
189 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
190 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
192 if( stationType == AliMp::kStation345) {
193 pos = (manuId & manuMask)/100;
195 Int_t idx = GetManuListIndex(detElemId);
197 // using array defined from DetElemIdToBusPatch.dat file
198 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
199 if ( manuId >= fManuList12[idx].At(pos))
206 //______________________________________________________________________________
207 Bool_t AliMpDDLStore::ReadDDLs()
209 /// Read ddl <-> bus patch file
213 CreateDataStream(AliMpFiles::BusPatchFilePath());
217 while ( in.getline(line,255) ) {
219 if ( line[0] == '#' )
222 TString tmp(AliMpHelper::Normalize(line));
224 TObjArray* stringList = tmp.Tokenize(TString(" "));
226 TString sDE = ((TObjString*)stringList->At(0))->GetString();
227 Int_t idDE = atoi(sDE.Data());
229 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
230 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
234 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
237 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
238 Int_t iDDL = atoi(sDDL.Data());
240 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
241 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
246 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
249 // reading 1st manu Id for each bus patch (station 1 & 2)
250 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
252 TString sManu = ((TObjString*)stringList->At(3))->GetString();
253 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
255 if(AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2) {
256 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
257 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
264 AliMpDDL* ddl = GetDDL(iDDL, false);
266 ddl = new AliMpDDL(iDDL);
267 fDDLs.AddAt(ddl, iDDL);
271 TArrayI busPatchList;
272 // decoding range of buspatch
273 AliMpHelper::DecodeName(busPatch,';',busPatchList);
276 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
278 // filling buspatch -> idDE
279 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
280 fBusPatches.Add(busPatchList[i],
281 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
282 de->AddBusPatch(busPatchList[i]);
286 // Fill bus patch Ids array in DDLs now
287 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
288 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
289 ddl->FillBusPatchIds();
296 //______________________________________________________________________________
297 Bool_t AliMpDDLStore::ReadTrigger()
299 /// create trigger DDL object and Global crate object
301 if ( ! fRegionalTrigger.ReadData(fkDataStreams) ) return false;
306 //______________________________________________________________________________
308 AliMpDDLStore::SetTriggerDDLs()
310 /// Create trigger DDLs and set DDL Ids in the regional trigger
313 TIter next(fRegionalTrigger.CreateCrateIterator());
314 AliMpTriggerCrate* crate;
316 while ( ( crate = static_cast<AliMpTriggerCrate*>(next()) ) )
318 TString crateName = crate->GetName();
320 // determine ddl number vs crate side
321 if (crateName.Contains("R"))
322 iDDL = fgkNofDDLs; // starts where tracker ends
324 iDDL = fgkNofDDLs + 1;
326 // Create DDL if it does not yet exist and set it to the crate
327 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
329 ddl = new AliMpDDL(iDDL);
330 fDDLs.AddAt(ddl, iDDL);
332 crate->SetDdlId(iDDL);
335 // Add trigger crate number for given ddl if not present
336 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
337 ddl->AddTriggerCrate(crate->GetId());
340 // Loop over local boards in this crate
342 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
344 Int_t localBoardId = crate->GetLocalBoardId(j);
345 AliMpLocalBoard* localBoard
346 = fRegionalTrigger.FindLocalBoard(localBoardId);
348 AliFatalClass("Cannot find local board.");
352 // Loop over DEs in this localBoard
354 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
357 Int_t deId = localBoard->GetDEId(k);
358 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
360 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
362 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
369 //______________________________________________________________________________
370 Bool_t AliMpDDLStore::SetManus()
372 /// Set manus for each bus patch
374 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
377 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
379 AliDebug(3, Form("DDL # %d\n", iDDL));
381 AliMpDDL* ddl = GetDDL(iDDL);
383 // loop over DE in the given DDL
384 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
386 Int_t detElemId = ddl->GetDEId(detElemIdx);
388 AliMpDetElement* detElement = GetDetElement(detElemId);
390 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
393 // list of manu per DE on both cathode
395 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
396 const AliMpVSegmentation* seg
397 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
399 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
402 seg->GetAllElectronicCardIDs(manus);
404 // filling TList manu
405 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
407 AliMpIntPair* manu = 0x0;
408 if( stationType == AliMp::kStation345)
409 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
411 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
415 detElement->AddManu(manus[im]);
419 manuList.Sort(); // sort regardless B or NB plane
421 // filling manu to the corresponding buspatch
422 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
424 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
426 Int_t manuId = manuPtr->GetFirst();
427 Int_t pos = GetBusPatchIndex(detElemId, manuId);
429 if (pos > detElement->GetNofBusPatches()) {
430 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
431 pos, detElement->GetNofBusPatches(), manuId, detElemId));
435 // get buspatch and fill manus
436 Int_t busPatchId = detElement->GetBusPatchId(pos);
437 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
439 if( stationType == AliMp::kStation345) {
441 if (manuPtr->GetSecond())
442 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
444 busPatch->AddManu(manuId);
448 busPatch->AddManu(manuId);
455 if (AliDebugLevel() == 3) {
457 // print out for checking
458 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
459 Int_t busPatchId = detElement->GetBusPatchId(pos);
460 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
461 printf("BusPatch: %d\n", busPatch->GetId());
462 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
463 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
467 } // detection element loop
473 //______________________________________________________________________________
474 Bool_t AliMpDDLStore::ReadBusPatchSpecial()
476 /// Read file with bus patches with a special order of manus
477 /// and reset the manus arrays filled via SetManu function
481 CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
485 while ( in.getline(line,255) ) {
487 if ( line[0] == '#' ) continue;
489 TString tmp(AliMpHelper::Normalize(line));
490 TObjArray* stringList = tmp.Tokenize(TString(" "));
492 TString sKey = ((TObjString*)stringList->At(0))->GetString();
494 TString sDDL = ((TObjString*)stringList->At(1))->GetString();
496 AliMpHelper::DecodeName(sDDL,';',ddlList);
498 TString sBusPatch = ((TObjString*)stringList->At(2))->GetString();
499 TArrayI busPatchList;
500 AliMpHelper::DecodeName(sBusPatch,',',busPatchList);
502 // Loop over DDL and Bus Patch
503 for (Int_t iDDL = 0; iDDL < ddlList.GetSize(); ++iDDL ) {
504 for (Int_t iBusPatch = 0; iBusPatch < busPatchList.GetSize(); ++iBusPatch) {
505 // Global bus patch ID
507 = AliMpBusPatch::GetGlobalBusID(
508 busPatchList.At(iBusPatch), ddlList.At(iDDL));
510 // Get this bus patch
511 AliMpBusPatch* busPatch = GetBusPatch(busPatchID);
513 AliErrorStream() << "Bus patch " << busPatchID << " does not exist." << endl;
517 if ( sKey == fgkRevertKeyword ) {
519 << "Reverting readout of bus patch " << busPatchID << endl;
521 // Now revert the manus in this bus patch
522 busPatch->RevertReadout();
524 else if ( sKey == fgkExplicitKeyword ) {
526 busPatch->ResetReadout();
528 TString sManus = ((TObjString*)stringList->At(3))->GetString();
530 AliMpHelper::DecodeName(sManus,',',manuList);
533 << "Reseting readout of bus patch " << busPatchID
534 << " manus: " << sManus.Data() << endl;
536 for (Int_t i = 0; i < manuList.GetSize(); i++) {
537 busPatch->AddManu(manuList.At(i));
541 AliErrorStream() << "Unrecognized key." << endl;
554 //______________________________________________________________________________
555 Bool_t AliMpDDLStore::SetPatchModules()
557 /// Compute the number of manu per PCB for each buspatch
560 Bool_t result = true;
562 for ( it.First(); !it.IsDone(); it.Next() ) {
564 AliMpDetElement* detElement = it.CurrentDE();
566 for (Int_t i = 0; i < detElement->GetNofBusPatches(); ++i) {
567 AliMpBusPatch* busPatch = GetBusPatch(detElement->GetBusPatchId(i));
568 Bool_t newResult = false;
569 Int_t idDE = busPatch->GetDEId();
571 if (AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2 )
572 newResult = busPatch->SetNofManusPerModule(fManuBridge2[GetManuListIndex(idDE)].At(i));
574 newResult = busPatch->SetNofManusPerModule();
581 //______________________________________________________________________________
582 Bool_t AliMpDDLStore::ReadBusPatchInfo()
584 /// read the buspatch info file and set buspatch info
588 CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
592 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
593 AliMpDDL* ddl = GetDDL(iDDL);
595 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
598 if (!in.getline(line,255)) {
599 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
603 } while(line[0] == '#');
605 TString tmp(AliMpHelper::Normalize(line));
607 TObjArray* stringList = tmp.Tokenize(TString(" "));
610 TString crLabel = ((TObjString*)stringList->At(0))->GetString();
611 Int_t pos = crLabel.First('-');
612 tmp = crLabel(pos-2, crLabel.Length()-pos+2);
614 AliMpHelper::DecodeName(tmp.Data(), '-', list);
616 Int_t localDDLId = list[0];
617 Int_t frtId = list[1] - 1; // begin at zero !
618 Int_t localBusId = list[2];
620 // Add FRT number for given ddl if not present
621 if ( !ddl->HasFrtId(frtId) )
624 // BP & translator label
625 TString label = ((TObjString*)stringList->At(1))->GetString();
626 TString transLabel = ((TObjString*)stringList->At(2))->GetString();
629 TString sLength = ((TObjString*)stringList->At(3))->GetString();
630 Float_t length = sLength.Atof();
634 if (localBusId != iBusPatch + 1)
635 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
637 if(localDDLId != ddl->GetId()+1)
638 AliWarning(Form("Wrong local DDL id %d instead of %d", ddl->GetId()+1, localDDLId));
640 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
641 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
642 busPatch->SetCableLength(length);
643 busPatch->SetCableLabel(label);
644 busPatch->SetTranslatorLabel(transLabel);
645 busPatch->SetFrtId(frtId);
656 //________________________________________________________________
657 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const {
658 /// return the first board with a given side and line
660 TIter next(fRegionalTrigger.CreateLocalBoardIterator());
661 AliMpLocalBoard* local;
663 while ( ( local = static_cast<AliMpLocalBoard*>(next()) ) )
665 TString tmp(&local->GetName()[4], 2);
666 if (name.Contains(tmp))
667 if (name[0] == local->GetName()[0])
668 return local->GetId();
679 //______________________________________________________________________________
680 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const {
681 /// Return DDL for given ddlId
684 = (AliMpDDL*)fDDLs.At(ddlId);
686 if ( ! ddl && warn ) {
688 << "DDL with Id = " << ddlId << " not defined." << endl;
694 //______________________________________________________________________________
695 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const {
696 /// Return detection element with given detElemId
698 if ( ! AliMpDEStore::Instance() ) {
699 AliFatal("DE Store has not been loaded.");
703 return AliMpDEStore::Instance()->GetDetElement(detElemId, warn);
706 //______________________________________________________________________________
707 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const {
708 /// Return bus patch with given Id
710 AliMpBusPatch* busPatch
711 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
713 if ( ! busPatch && warn ) {
715 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
722 //______________________________________________________________________________
723 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const {
724 /// Return bus patch with given Id
726 return fRegionalTrigger.FindLocalBoard(localBoardId, warn);
729 //______________________________________________________________________________
730 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const {
731 /// Return trigger crate with given name
733 return fRegionalTrigger.FindTriggerCrate(name, warn);
736 //______________________________________________________________________________
737 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const {
738 /// Return trigger crate with given ddl and index crate
740 if (ddlId == 0 || ddlId == 1)
743 AliMpDDL* ddl = GetDDL(ddlId, warn);
747 if ( index >= ddl->GetNofTriggerCrates() ) {
748 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
752 TString name = AliMpTriggerCrate::GenerateName(index, ddlId, fgkNofDDLs);
754 return GetTriggerCrate(name, warn);
757 //______________________________________________________________________________
758 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const {
759 /// Return detection element Id for given busPatchId
761 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
765 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
769 return busPatch->GetDEId();
772 //______________________________________________________________________________
773 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
774 /// Return detElemId for local board Id and chamber id.
776 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
778 if ( ! localBoard ) {
780 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
784 return localBoard->GetDEIdByChamber(chamberId);
787 //______________________________________________________________________________
788 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const {
789 /// Return DDL Id for given busPatchId
791 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
795 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
799 return busPatch->GetDdlId();
802 //______________________________________________________________________________
803 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const {
804 /// Return bus patch for a given manuId
806 AliMpDetElement* detElement = GetDetElement(detElemId);
807 Int_t pos = GetBusPatchIndex(detElemId, manuId);
809 if ( pos > detElement->GetNofBusPatches() ) {
812 << " greater than the size = " << detElement->GetNofBusPatches()
813 << " for detElemId = " << detElemId
814 << " manuId = " << manuId << endl;
818 return detElement->GetBusPatchId(pos);
822 //______________________________________________________________________________
823 AliMpIntPair AliMpDDLStore::GetLinkPortId(Int_t busPatchId) const {
825 /// Return link port for a given frtId and global busPatchId
827 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
828 Int_t ddlId = busPatch->GetDdlId();
830 Int_t localBusPatchId = AliMpBusPatch::GetLocalBusID(busPatchId, ddlId) - 1; // begin at zero
832 Int_t pos = (localBusPatchId % AliMpFrtCrocusConstants::GetNofBusPatches());
834 return AliMpFrtCrocusConstants::GetLinkPortId(pos);
838 //______________________________________________________________________________
839 void AliMpDDLStore::PrintAllManu() const {
840 /// Print all manu Ids and their serial numbers sorted by detection element
841 /// and bus patch. \n
842 /// As serial manu numbers are filled in a different way than manu Ids this
843 /// printing allows to check that both ways are consistent
847 for ( it.First(); ! it.IsDone(); it.Next() ) {
848 AliMpDetElement* de = it.CurrentDE();
849 cout << "DE: " << de->GetId() << endl;
851 // Loop over bus patches in this DE
852 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
854 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
855 cout << " busPatch: " << busPatch->GetId() << endl;
858 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
859 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
863 if ( AliMpManuStore::Instance(kFALSE) ) {
864 cout << " Manu serial: ";
865 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
867 << AliMpManuStore::Instance()
868 ->GetManuSerial(de->GetId(), busPatch->GetManuId(k)) << " ";
876 //______________________________________________________________________________
877 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
878 /// return the next detection element in line
880 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
882 TString name(localBoard->GetName());
884 Int_t line = localBoard->GetPosition().GetFirst();
887 name.Replace(4,1,Form("%d", line));
890 if ((nextLocalId = GetLocalBoardId(name)))
891 return GetDEfromLocalBoard(nextLocalId, chamberId);
898 //______________________________________________________________________________
899 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
900 /// return the previous detection element in line
902 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
904 TString name(localBoard->GetName());
906 Int_t line = localBoard->GetPosition().GetFirst();
909 name.Replace(4,1,Form("%d", line));
912 if ((prevLocalId = GetLocalBoardId(name)))
913 return GetDEfromLocalBoard(prevLocalId, chamberId);
919 //______________________________________________________________________________
920 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
922 /// Replace the existing regional trigger with the given one
924 fRegionalTrigger = regionalTrigger;
926 // Remove the existing trigger DDLsf
927 fDDLs.RemoveAt(fgkNofDDLs+1);
928 fDDLs.RemoveAt(fgkNofDDLs);
930 // Set new trigger DDLs from new regional trigger
935 //______________________________________________________________________________
937 AliMpDDLStore::CreateBusPatchIterator() const
939 /// Create the iterator over bus patches
941 return fBusPatches.CreateIterator();