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"
49 #include "AliMpEncodePair.h"
50 #include "AliMpIntPair.h"
54 #include <Riostream.h>
56 #include <TObjArray.h>
58 #include <TObjString.h>
62 ClassImp(AliMpDDLStore)
65 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
66 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
67 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
68 const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
69 const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
75 //______________________________________________________________________________
76 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
78 /// Create the DDL store if it does not yet exist
79 /// and return its instance
81 if ( ! fgInstance && warn ) {
82 AliWarningClass("DDL Store has not been loaded");
88 //______________________________________________________________________________
89 AliMpDDLStore* AliMpDDLStore::ReadData(const AliMpDataStreams& dataStreams,
92 /// Load the DDL store from ASCII data files
93 /// and return its instance
97 AliWarningClass("DDL Store has been already loaded");
101 if ( dataStreams.GetReadFromFiles() )
102 AliInfoClass("Reading DDL Store from ASCII files.");
104 fgInstance = new AliMpDDLStore(dataStreams);
112 //______________________________________________________________________________
113 AliMpDDLStore::AliMpDDLStore(const AliMpDataStreams& dataStreams)
115 fkDataStreams(dataStreams),
116 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
122 /// Standard constructor
125 fDDLs.SetOwner(true);
126 fBusPatches.SetOwner(true);
127 fBusPatches.SetSize(900);
129 // Load segmentation & DE store data
130 if ( ! AliMpSegmentation::Instance(false) )
131 AliMpSegmentation::ReadData(dataStreams, true);
133 // Create all detection elements
138 ReadBusPatchSpecial();
143 //______________________________________________________________________________
144 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
146 fkDataStreams(ioCtor),
149 fRegionalTrigger(ioCtor)
151 /// Constructor for I0
159 //______________________________________________________________________________
160 AliMpDDLStore::~AliMpDDLStore()
166 // DDL objects are deleted with fDDLs
167 // Bus patches objects are deleted with fBusPatches
176 //______________________________________________________________________________
177 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
179 /// Return the index of the manu list for given detElemId
181 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
185 //______________________________________________________________________________
186 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
188 /// Calculate the index of the buspatch from manuId
191 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
192 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
194 if( stationType == AliMp::kStation345) {
195 pos = (manuId & manuMask)/100;
197 Int_t idx = GetManuListIndex(detElemId);
199 // using array defined from DetElemIdToBusPatch.dat file
200 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
201 if ( manuId >= fManuList12[idx].At(pos))
208 //______________________________________________________________________________
209 Bool_t AliMpDDLStore::ReadDDLs()
211 /// Read ddl <-> bus patch file
215 CreateDataStream(AliMpFiles::BusPatchFilePath());
219 while ( in.getline(line,255) ) {
221 if ( line[0] == '#' )
224 TString tmp(AliMpHelper::Normalize(line));
226 TObjArray* stringList = tmp.Tokenize(TString(" "));
228 TString sDE = ((TObjString*)stringList->At(0))->GetString();
229 Int_t idDE = atoi(sDE.Data());
231 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
232 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
236 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
239 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
240 Int_t iDDL = atoi(sDDL.Data());
242 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
243 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
248 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
251 // reading 1st manu Id for each bus patch (station 1 & 2)
252 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
254 TString sManu = ((TObjString*)stringList->At(3))->GetString();
255 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
257 if(AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2) {
258 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
259 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
266 AliMpDDL* ddl = GetDDL(iDDL, false);
268 ddl = new AliMpDDL(iDDL);
269 fDDLs.AddAt(ddl, iDDL);
273 TArrayI busPatchList;
274 // decoding range of buspatch
275 AliMpHelper::DecodeName(busPatch,';',busPatchList);
278 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
280 // filling buspatch -> idDE
281 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
282 fBusPatches.Add(busPatchList[i],
283 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
284 de->AddBusPatch(busPatchList[i]);
288 // Fill bus patch Ids array in DDLs now
289 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
290 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
291 ddl->FillBusPatchIds();
298 //______________________________________________________________________________
299 Bool_t AliMpDDLStore::ReadTrigger()
301 /// create trigger DDL object and Global crate object
303 if ( ! fRegionalTrigger.ReadData(fkDataStreams) ) return false;
308 //______________________________________________________________________________
310 AliMpDDLStore::SetTriggerDDLs()
312 /// Create trigger DDLs and set DDL Ids in the regional trigger
315 TIter next(fRegionalTrigger.CreateCrateIterator());
316 AliMpTriggerCrate* crate;
318 while ( ( crate = static_cast<AliMpTriggerCrate*>(next()) ) )
320 TString crateName = crate->GetName();
322 // determine ddl number vs crate side
323 if (crateName.Contains("R"))
324 iDDL = fgkNofDDLs; // starts where tracker ends
326 iDDL = fgkNofDDLs + 1;
328 // Create DDL if it does not yet exist and set it to the crate
329 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
331 ddl = new AliMpDDL(iDDL);
332 fDDLs.AddAt(ddl, iDDL);
334 crate->SetDdlId(iDDL);
337 // Add trigger crate number for given ddl if not present
338 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
339 ddl->AddTriggerCrate(crate->GetId());
342 // Loop over local boards in this crate
344 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
346 Int_t localBoardId = crate->GetLocalBoardId(j);
347 AliMpLocalBoard* localBoard
348 = fRegionalTrigger.FindLocalBoard(localBoardId);
350 AliFatalClass("Cannot find local board.");
354 // Loop over DEs in this localBoard
356 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
359 Int_t deId = localBoard->GetDEId(k);
360 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
362 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
364 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
371 //______________________________________________________________________________
372 Bool_t AliMpDDLStore::SetManus()
374 /// Set manus for each bus patch
376 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
379 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
381 AliDebug(3, Form("DDL # %d\n", iDDL));
383 AliMpDDL* ddl = GetDDL(iDDL);
385 // loop over DE in the given DDL
386 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
388 Int_t detElemId = ddl->GetDEId(detElemIdx);
390 AliMpDetElement* detElement = GetDetElement(detElemId);
392 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
395 // list of manu per DE on both cathode
397 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
398 const AliMpVSegmentation* seg
399 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
401 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
404 seg->GetAllElectronicCardIDs(manus);
406 // filling TList manu
407 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
409 AliMpIntPair* manu = 0x0;
410 if( stationType == AliMp::kStation345)
411 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
413 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
417 detElement->AddManu(manus[im]);
421 manuList.Sort(); // sort regardless B or NB plane
423 // filling manu to the corresponding buspatch
424 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
426 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
428 Int_t manuId = manuPtr->GetFirst();
429 Int_t pos = GetBusPatchIndex(detElemId, manuId);
431 if (pos > detElement->GetNofBusPatches()) {
432 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
433 pos, detElement->GetNofBusPatches(), manuId, detElemId));
437 // get buspatch and fill manus
438 Int_t busPatchId = detElement->GetBusPatchId(pos);
439 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
441 if( stationType == AliMp::kStation345) {
443 if (manuPtr->GetSecond())
444 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
446 busPatch->AddManu(manuId);
450 busPatch->AddManu(manuId);
457 if (AliDebugLevel() == 3) {
459 // print out for checking
460 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
461 Int_t busPatchId = detElement->GetBusPatchId(pos);
462 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
463 printf("BusPatch: %d\n", busPatch->GetId());
464 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
465 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
469 } // detection element loop
475 //______________________________________________________________________________
476 Bool_t AliMpDDLStore::ReadBusPatchSpecial()
478 /// Read file with bus patches with a special order of manus
479 /// and reset the manus arrays filled via SetManu function
483 CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
487 while ( in.getline(line,255) ) {
489 if ( line[0] == '#' ) continue;
491 TString tmp(AliMpHelper::Normalize(line));
492 TObjArray* stringList = tmp.Tokenize(TString(" "));
494 TString sKey = ((TObjString*)stringList->At(0))->GetString();
496 TString sDDL = ((TObjString*)stringList->At(1))->GetString();
498 AliMpHelper::DecodeName(sDDL,';',ddlList);
500 TString sBusPatch = ((TObjString*)stringList->At(2))->GetString();
501 TArrayI busPatchList;
502 AliMpHelper::DecodeName(sBusPatch,',',busPatchList);
504 // Loop over DDL and Bus Patch
505 for (Int_t iDDL = 0; iDDL < ddlList.GetSize(); ++iDDL ) {
506 for (Int_t iBusPatch = 0; iBusPatch < busPatchList.GetSize(); ++iBusPatch) {
507 // Global bus patch ID
509 = AliMpBusPatch::GetGlobalBusID(
510 busPatchList.At(iBusPatch), ddlList.At(iDDL));
512 // Get this bus patch
513 AliMpBusPatch* busPatch = GetBusPatch(busPatchID);
515 AliErrorStream() << "Bus patch " << busPatchID << " does not exist." << endl;
519 if ( sKey == fgkRevertKeyword ) {
521 << "Reverting readout of bus patch " << busPatchID << endl;
523 // Now revert the manus in this bus patch
524 busPatch->RevertReadout();
526 else if ( sKey == fgkExplicitKeyword ) {
528 busPatch->ResetReadout();
530 TString sManus = ((TObjString*)stringList->At(3))->GetString();
532 AliMpHelper::DecodeName(sManus,',',manuList);
535 << "Reseting readout of bus patch " << busPatchID
536 << " manus: " << sManus.Data() << endl;
538 for (Int_t i = 0; i < manuList.GetSize(); i++) {
539 busPatch->AddManu(manuList.At(i));
543 AliErrorStream() << "Unrecognized key." << endl;
557 //______________________________________________________________________________
558 Bool_t AliMpDDLStore::SetPatchModules()
560 /// Compute the number of manu per PCB for each buspatch
563 Bool_t result = true;
565 for ( it.First(); !it.IsDone(); it.Next() ) {
567 AliMpDetElement* detElement = it.CurrentDE();
569 for (Int_t i = 0; i < detElement->GetNofBusPatches(); ++i) {
570 AliMpBusPatch* busPatch = GetBusPatch(detElement->GetBusPatchId(i));
571 Bool_t newResult = false;
572 Int_t idDE = busPatch->GetDEId();
574 if (AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2 )
575 newResult = busPatch->SetNofManusPerModule(fManuBridge2[GetManuListIndex(idDE)].At(i));
577 newResult = busPatch->SetNofManusPerModule();
584 //______________________________________________________________________________
585 Bool_t AliMpDDLStore::ReadBusPatchInfo()
587 /// read the buspatch info file and set buspatch info
591 CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
595 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
596 AliMpDDL* ddl = GetDDL(iDDL);
598 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
601 if (!in.getline(line,255)) {
602 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
606 } while(line[0] == '#');
608 TString tmp(AliMpHelper::Normalize(line));
610 TObjArray* stringList = tmp.Tokenize(TString(" "));
613 TString crLabel = ((TObjString*)stringList->At(0))->GetString();
614 Int_t pos = crLabel.First('-');
615 tmp = crLabel(pos-2, crLabel.Length()-pos+2);
617 AliMpHelper::DecodeName(tmp.Data(), '-', list);
619 Int_t localDDLId = list[0];
620 Int_t frtId = list[1] - 1; // begin at zero !
621 Int_t localBusId = list[2];
623 // Add FRT number for given ddl if not present
624 if ( !ddl->HasFrtId(frtId) )
627 // BP & translator label
628 TString label = ((TObjString*)stringList->At(1))->GetString();
629 TString transLabel = ((TObjString*)stringList->At(2))->GetString();
632 TString sLength = ((TObjString*)stringList->At(3))->GetString();
633 Float_t length = sLength.Atof();
637 if (localBusId != iBusPatch + 1)
638 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
640 if(localDDLId != ddl->GetId()+1)
641 AliWarning(Form("Wrong local DDL id %d instead of %d", ddl->GetId()+1, localDDLId));
643 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
644 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
645 busPatch->SetCableLength(length);
646 busPatch->SetCableLabel(label);
647 busPatch->SetTranslatorLabel(transLabel);
648 busPatch->SetFrtId(frtId);
659 //________________________________________________________________
660 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const {
661 /// return the first board with a given side and line
663 TIter next(fRegionalTrigger.CreateLocalBoardIterator());
664 AliMpLocalBoard* local;
666 while ( ( local = static_cast<AliMpLocalBoard*>(next()) ) )
668 TString tmp(&local->GetName()[4], 2);
669 if (name.Contains(tmp))
670 if (name[0] == local->GetName()[0])
671 return local->GetId();
682 //______________________________________________________________________________
683 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const {
684 /// Return DDL for given ddlId
687 = (AliMpDDL*)fDDLs.At(ddlId);
689 if ( ! ddl && warn ) {
691 << "DDL with Id = " << ddlId << " not defined." << endl;
697 //______________________________________________________________________________
698 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const {
699 /// Return detection element with given detElemId
701 if ( ! AliMpDEStore::Instance() ) {
702 AliFatal("DE Store has not been loaded.");
706 return AliMpDEStore::Instance()->GetDetElement(detElemId, warn);
709 //______________________________________________________________________________
710 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const {
711 /// Return bus patch with given Id
713 AliMpBusPatch* busPatch
714 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
716 if ( ! busPatch && warn ) {
718 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
725 //______________________________________________________________________________
726 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const {
727 /// Return bus patch with given Id
729 return fRegionalTrigger.FindLocalBoard(localBoardId, warn);
732 //______________________________________________________________________________
733 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const {
734 /// Return trigger crate with given name
736 return fRegionalTrigger.FindTriggerCrate(name, warn);
739 //______________________________________________________________________________
740 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const {
741 /// Return trigger crate with given ddl and index crate
743 if (ddlId == 0 || ddlId == 1)
746 AliMpDDL* ddl = GetDDL(ddlId, warn);
750 if ( index >= ddl->GetNofTriggerCrates() ) {
751 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
755 TString name = AliMpTriggerCrate::GenerateName(index, ddlId, fgkNofDDLs);
757 return GetTriggerCrate(name, warn);
760 //______________________________________________________________________________
761 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const {
762 /// Return detection element Id for given busPatchId
764 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
768 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
772 return busPatch->GetDEId();
775 //______________________________________________________________________________
776 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
777 /// Return detElemId for local board Id and chamber id.
779 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
781 if ( ! localBoard ) {
783 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
787 return localBoard->GetDEIdByChamber(chamberId);
790 //______________________________________________________________________________
791 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const {
792 /// Return DDL Id for given busPatchId
794 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
798 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
802 return busPatch->GetDdlId();
805 //______________________________________________________________________________
806 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const {
807 /// Return bus patch for a given manuId
809 AliMpDetElement* detElement = GetDetElement(detElemId);
810 Int_t pos = GetBusPatchIndex(detElemId, manuId);
812 if ( pos >= detElement->GetNofBusPatches() )
816 << " greater than the size = " << detElement->GetNofBusPatches()
817 << " for detElemId = " << detElemId
818 << " manuId = " << manuId << endl;
822 return detElement->GetBusPatchId(pos);
826 //______________________________________________________________________________
827 Long_t AliMpDDLStore::GetLinkPortId(Int_t busPatchId) const {
829 /// Get link port and DSP from busPatch id.
830 /// Return -1 if the value is not valid
831 /// (the validity has to be tested in the client code)
833 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
834 Int_t ddlId = busPatch->GetDdlId();
836 Int_t localBusPatchId = AliMpBusPatch::GetLocalBusID(busPatchId, ddlId) - 1; // begin at zero
838 Int_t pos = (localBusPatchId % AliMpFrtCrocusConstants::GetNofBusPatches());
840 return AliMpFrtCrocusConstants::GetLinkPortId(pos);
844 //______________________________________________________________________________
845 void AliMpDDLStore::PrintAllManu() const {
846 /// Print all manu Ids and their serial numbers sorted by detection element
847 /// and bus patch. \n
848 /// As serial manu numbers are filled in a different way than manu Ids this
849 /// printing allows to check that both ways are consistent
853 for ( it.First(); ! it.IsDone(); it.Next() ) {
854 AliMpDetElement* de = it.CurrentDE();
855 cout << "DE: " << de->GetId() << endl;
857 // Loop over bus patches in this DE
858 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
860 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
861 cout << " busPatch: " << busPatch->GetId() << endl;
864 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
865 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
869 if ( AliMpManuStore::Instance(kFALSE) ) {
870 cout << " Manu serial: ";
871 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
873 << AliMpManuStore::Instance()
874 ->GetManuSerial(de->GetId(), busPatch->GetManuId(k)) << " ";
882 //______________________________________________________________________________
883 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
884 /// return the next detection element in line
886 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
888 TString name(localBoard->GetName());
890 Int_t line = AliMp::PairFirst(localBoard->GetPosition());
893 name.Replace(4,1,Form("%d", line));
896 if ((nextLocalId = GetLocalBoardId(name)))
897 return GetDEfromLocalBoard(nextLocalId, chamberId);
904 //______________________________________________________________________________
905 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
906 /// return the previous detection element in line
908 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
910 TString name(localBoard->GetName());
912 Int_t line = AliMp::PairFirst(localBoard->GetPosition());
915 name.Replace(4,1,Form("%d", line));
918 if ((prevLocalId = GetLocalBoardId(name)))
919 return GetDEfromLocalBoard(prevLocalId, chamberId);
925 //______________________________________________________________________________
926 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
928 /// Replace the existing regional trigger with the given one
930 fRegionalTrigger = regionalTrigger;
932 // Remove the existing trigger DDLsf
933 fDDLs.RemoveAt(fgkNofDDLs+1);
934 fDDLs.RemoveAt(fgkNofDDLs);
936 // Set new trigger DDLs from new regional trigger
941 //______________________________________________________________________________
943 AliMpDDLStore::CreateBusPatchIterator() const
945 /// Create the iterator over bus patches
947 return fBusPatches.CreateIterator();