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;
73 //______________________________________________________________________________
74 const TString& AliMpDDLStore::GetRevertKeyword()
76 /// A keyword for ReadBusPatchSpecial()
77 static const TString kRevertKeyword = "REVERT";
78 return kRevertKeyword;
81 //______________________________________________________________________________
82 const TString& AliMpDDLStore::GetExplicitKeyword()
84 /// A keyword for ReadBusPatchSpecial()
85 static const TString kExplicitKeyword = "EXPLICIT";
86 return kExplicitKeyword;
89 //______________________________________________________________________________
90 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
92 /// Create the DDL store if it does not yet exist
93 /// and return its instance
95 if ( ! fgInstance && warn ) {
96 AliWarningClass("DDL Store has not been loaded");
102 //______________________________________________________________________________
103 AliMpDDLStore* AliMpDDLStore::ReadData(const AliMpDataStreams& dataStreams,
106 /// Load the DDL store from ASCII data files
107 /// and return its instance
111 AliWarningClass("DDL Store has been already loaded");
115 if ( dataStreams.GetReadFromFiles() )
116 AliInfoClass("Reading DDL Store from ASCII files.");
118 fgInstance = new AliMpDDLStore(dataStreams);
126 //______________________________________________________________________________
127 AliMpDDLStore::AliMpDDLStore(const AliMpDataStreams& dataStreams)
129 fkDataStreams(dataStreams),
130 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
136 /// Standard constructor
139 fDDLs.SetOwner(true);
140 fBusPatches.SetOwner(true);
141 fBusPatches.SetSize(900);
143 // Load segmentation & DE store data
144 if ( ! AliMpSegmentation::Instance(false) )
145 AliMpSegmentation::ReadData(dataStreams, true);
147 // Create all detection elements
152 ReadBusPatchSpecial();
157 //______________________________________________________________________________
158 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
160 fkDataStreams(ioCtor),
163 fRegionalTrigger(ioCtor)
165 /// Constructor for I0
173 //______________________________________________________________________________
174 AliMpDDLStore::~AliMpDDLStore()
180 // DDL objects are deleted with fDDLs
181 // Bus patches objects are deleted with fBusPatches
190 //______________________________________________________________________________
191 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
193 /// Return the index of the manu list for given detElemId
195 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
199 //______________________________________________________________________________
200 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
202 /// Calculate the index of the buspatch from manuId
205 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
206 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
208 if( stationType == AliMp::kStation345) {
209 pos = (manuId & manuMask)/100;
211 Int_t idx = GetManuListIndex(detElemId);
213 // using array defined from DetElemIdToBusPatch.dat file
214 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
215 if ( manuId >= fManuList12[idx].At(pos))
222 //______________________________________________________________________________
223 Bool_t AliMpDDLStore::ReadDDLs()
225 /// Read ddl <-> bus patch file
229 CreateDataStream(AliMpFiles::BusPatchFilePath());
233 while ( in.getline(line,255) ) {
235 if ( line[0] == '#' )
238 TString tmp(AliMpHelper::Normalize(line));
240 TObjArray* stringList = tmp.Tokenize(TString(" "));
242 TString sDE = ((TObjString*)stringList->At(0))->GetString();
243 Int_t idDE = atoi(sDE.Data());
245 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
246 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
251 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
254 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
255 Int_t iDDL = atoi(sDDL.Data());
257 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
258 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
264 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
267 // reading 1st manu Id for each bus patch (station 1 & 2)
268 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
270 TString sManu = ((TObjString*)stringList->At(3))->GetString();
271 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
273 if(AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2) {
274 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
275 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
282 AliMpDDL* ddl = GetDDL(iDDL, false);
284 ddl = new AliMpDDL(iDDL);
285 fDDLs.AddAt(ddl, iDDL);
289 TArrayI busPatchList;
290 // decoding range of buspatch
291 AliMpHelper::DecodeName(busPatch,';',busPatchList);
294 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
296 // filling buspatch -> idDE
297 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
298 fBusPatches.Add(busPatchList[i],
299 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
300 de->AddBusPatch(busPatchList[i]);
304 // Fill bus patch Ids array in DDLs now
305 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
306 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
307 ddl->FillBusPatchIds();
314 //______________________________________________________________________________
315 Bool_t AliMpDDLStore::ReadTrigger()
317 /// create trigger DDL object and Global crate object
319 if ( ! fRegionalTrigger.ReadData(fkDataStreams) ) return false;
324 //______________________________________________________________________________
326 AliMpDDLStore::SetTriggerDDLs()
328 /// Create trigger DDLs and set DDL Ids in the regional trigger
331 TIter next(fRegionalTrigger.CreateCrateIterator());
332 AliMpTriggerCrate* crate;
334 while ( ( crate = static_cast<AliMpTriggerCrate*>(next()) ) )
336 TString crateName = crate->GetName();
338 // determine ddl number vs crate side
339 if (crateName.Contains("R"))
340 iDDL = fgkNofDDLs; // starts where tracker ends
342 iDDL = fgkNofDDLs + 1;
344 // Create DDL if it does not yet exist and set it to the crate
345 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
347 ddl = new AliMpDDL(iDDL);
348 fDDLs.AddAt(ddl, iDDL);
350 crate->SetDdlId(iDDL);
353 // Add trigger crate number for given ddl if not present
354 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
355 ddl->AddTriggerCrate(crate->GetId());
358 // Loop over local boards in this crate
360 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
362 Int_t localBoardId = crate->GetLocalBoardId(j);
363 AliMpLocalBoard* localBoard
364 = fRegionalTrigger.FindLocalBoard(localBoardId);
366 AliFatalClass("Cannot find local board.");
370 // Loop over DEs in this localBoard
372 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
375 Int_t deId = localBoard->GetDEId(k);
376 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
378 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
380 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
387 //______________________________________________________________________________
388 Bool_t AliMpDDLStore::SetManus()
390 /// Set manus for each bus patch
392 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
395 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
397 AliDebug(3, Form("DDL # %d\n", iDDL));
399 AliMpDDL* ddl = GetDDL(iDDL);
401 // loop over DE in the given DDL
402 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
404 Int_t detElemId = ddl->GetDEId(detElemIdx);
406 AliMpDetElement* detElement = GetDetElement(detElemId);
408 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
411 // list of manu per DE on both cathode
413 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
414 const AliMpVSegmentation* seg
415 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
417 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
420 seg->GetAllElectronicCardIDs(manus);
422 // filling TList manu
423 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
425 AliMpIntPair* manu = 0x0;
426 if( stationType == AliMp::kStation345)
427 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
429 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
433 detElement->AddManu(manus[im]);
437 manuList.Sort(); // sort regardless B or NB plane
439 // filling manu to the corresponding buspatch
440 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
442 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
444 Int_t manuId = manuPtr->GetFirst();
445 Int_t pos = GetBusPatchIndex(detElemId, manuId);
447 if (pos > detElement->GetNofBusPatches()) {
448 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
449 pos, detElement->GetNofBusPatches(), manuId, detElemId));
453 // get buspatch and fill manus
454 Int_t busPatchId = detElement->GetBusPatchId(pos);
455 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
457 if( stationType == AliMp::kStation345) {
459 if (manuPtr->GetSecond())
460 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
462 busPatch->AddManu(manuId);
466 busPatch->AddManu(manuId);
473 if (AliDebugLevel() == 3) {
475 // print out for checking
476 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
477 Int_t busPatchId = detElement->GetBusPatchId(pos);
478 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
479 printf("BusPatch: %d\n", busPatch->GetId());
480 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
481 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
485 } // detection element loop
491 //______________________________________________________________________________
492 Bool_t AliMpDDLStore::ReadBusPatchSpecial()
494 /// Read file with bus patches with a special order of manus
495 /// and reset the manus arrays filled via SetManu function
499 CreateDataStream(AliMpFiles::BusPatchSpecialFilePath());
503 while ( in.getline(line,255) ) {
505 if ( line[0] == '#' ) continue;
507 TString tmp(AliMpHelper::Normalize(line));
508 TObjArray* stringList = tmp.Tokenize(TString(" "));
510 TString sKey = ((TObjString*)stringList->At(0))->GetString();
512 TString sDDL = ((TObjString*)stringList->At(1))->GetString();
514 AliMpHelper::DecodeName(sDDL,';',ddlList);
516 TString sBusPatch = ((TObjString*)stringList->At(2))->GetString();
517 TArrayI busPatchList;
518 AliMpHelper::DecodeName(sBusPatch,',',busPatchList);
520 // Loop over DDL and Bus Patch
521 for (Int_t iDDL = 0; iDDL < ddlList.GetSize(); ++iDDL ) {
522 for (Int_t iBusPatch = 0; iBusPatch < busPatchList.GetSize(); ++iBusPatch) {
523 // Global bus patch ID
525 = AliMpBusPatch::GetGlobalBusID(
526 busPatchList.At(iBusPatch), ddlList.At(iDDL));
528 // Get this bus patch
529 AliMpBusPatch* busPatch = GetBusPatch(busPatchID);
531 AliErrorStream() << "Bus patch " << busPatchID << " does not exist." << endl;
536 if ( sKey == GetRevertKeyword() ) {
538 << "Reverting readout of bus patch " << busPatchID << endl;
540 // Now revert the manus in this bus patch
541 busPatch->RevertReadout();
543 else if ( sKey == GetExplicitKeyword() ) {
545 busPatch->ResetReadout();
547 TString sManus = ((TObjString*)stringList->At(3))->GetString();
549 AliMpHelper::DecodeName(sManus,',',manuList);
552 << "Reseting readout of bus patch " << busPatchID
553 << " manus: " << sManus.Data() << endl;
555 for (Int_t i = 0; i < manuList.GetSize(); i++) {
556 busPatch->AddManu(manuList.At(i));
560 AliErrorStream() << "Unrecognized key." << endl;
575 //______________________________________________________________________________
576 Bool_t AliMpDDLStore::SetPatchModules()
578 /// Compute the number of manu per PCB for each buspatch
581 Bool_t result = true;
583 for ( it.First(); !it.IsDone(); it.Next() ) {
585 AliMpDetElement* detElement = it.CurrentDE();
587 for (Int_t i = 0; i < detElement->GetNofBusPatches(); ++i) {
588 AliMpBusPatch* busPatch = GetBusPatch(detElement->GetBusPatchId(i));
589 Bool_t newResult = false;
590 Int_t idDE = busPatch->GetDEId();
592 if (AliMpDEManager::GetStation12Type(idDE) == AliMq::kStation2 )
593 newResult = busPatch->SetNofManusPerModule(fManuBridge2[GetManuListIndex(idDE)].At(i));
595 newResult = busPatch->SetNofManusPerModule();
602 //______________________________________________________________________________
603 Bool_t AliMpDDLStore::ReadBusPatchInfo()
605 /// read the buspatch info file and set buspatch info
609 CreateDataStream(AliMpFiles::BusPatchInfoFilePath());
613 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
614 AliMpDDL* ddl = GetDDL(iDDL);
616 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
619 if (!in.getline(line,255)) {
620 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
624 } while(line[0] == '#');
626 TString tmp(AliMpHelper::Normalize(line));
628 TObjArray* stringList = tmp.Tokenize(TString(" "));
631 TString crLabel = ((TObjString*)stringList->At(0))->GetString();
632 Int_t pos = crLabel.First('-');
633 tmp = crLabel(pos-2, crLabel.Length()-pos+2);
635 AliMpHelper::DecodeName(tmp.Data(), '-', list);
637 Int_t localDDLId = list[0];
638 Int_t frtId = list[1] - 1; // begin at zero !
639 Int_t localBusId = list[2];
641 // Add FRT number for given ddl if not present
642 if ( !ddl->HasFrtId(frtId) )
645 // BP & translator label
646 TString label = ((TObjString*)stringList->At(1))->GetString();
647 TString transLabel = ((TObjString*)stringList->At(2))->GetString();
650 TString sLength = ((TObjString*)stringList->At(3))->GetString();
651 Float_t length = sLength.Atof();
655 if (localBusId != iBusPatch + 1)
656 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
658 if(localDDLId != ddl->GetId()+1)
659 AliWarning(Form("Wrong local DDL id %d instead of %d", ddl->GetId()+1, localDDLId));
661 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
662 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
663 busPatch->SetCableLength(length);
664 busPatch->SetCableLabel(label);
665 busPatch->SetTranslatorLabel(transLabel);
666 busPatch->SetFrtId(frtId);
677 //________________________________________________________________
678 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const {
679 /// return the first board with a given side and line
681 TIter next(fRegionalTrigger.CreateLocalBoardIterator());
682 AliMpLocalBoard* local;
684 while ( ( local = static_cast<AliMpLocalBoard*>(next()) ) )
686 TString tmp(&local->GetName()[4], 2);
687 if (name.Contains(tmp))
688 if (name[0] == local->GetName()[0])
689 return local->GetId();
700 //______________________________________________________________________________
701 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const {
702 /// Return DDL for given ddlId
705 = (AliMpDDL*)fDDLs.At(ddlId);
707 if ( ! ddl && warn ) {
709 << "DDL with Id = " << ddlId << " not defined." << endl;
715 //______________________________________________________________________________
716 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const {
717 /// Return detection element with given detElemId
719 if ( ! AliMpDEStore::Instance() ) {
720 AliFatal("DE Store has not been loaded.");
724 return AliMpDEStore::Instance()->GetDetElement(detElemId, warn);
727 //______________________________________________________________________________
728 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const {
729 /// Return bus patch with given Id
731 AliMpBusPatch* busPatch
732 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
734 if ( ! busPatch && warn ) {
736 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
743 //______________________________________________________________________________
744 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const {
745 /// Return bus patch with given Id
747 return fRegionalTrigger.FindLocalBoard(localBoardId, warn);
750 //______________________________________________________________________________
751 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const {
752 /// Return trigger crate with given name
754 return fRegionalTrigger.FindTriggerCrate(name, warn);
757 //______________________________________________________________________________
758 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const {
759 /// Return trigger crate with given ddl and index crate
761 if (ddlId == 0 || ddlId == 1)
764 AliMpDDL* ddl = GetDDL(ddlId, warn);
768 if ( index >= ddl->GetNofTriggerCrates() ) {
769 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
773 TString name = AliMpTriggerCrate::GenerateName(index, ddlId, fgkNofDDLs);
775 return GetTriggerCrate(name, warn);
778 //______________________________________________________________________________
779 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const {
780 /// Return detection element Id for given busPatchId
782 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
786 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
790 return busPatch->GetDEId();
793 //______________________________________________________________________________
794 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
795 /// Return detElemId for local board Id and chamber id.
797 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
799 if ( ! localBoard ) {
801 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
805 return localBoard->GetDEIdByChamber(chamberId);
808 //______________________________________________________________________________
809 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const {
810 /// Return DDL Id for given busPatchId
812 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
816 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
820 return busPatch->GetDdlId();
823 //______________________________________________________________________________
824 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const {
825 /// Return bus patch for a given manuId
827 AliMpDetElement* detElement = GetDetElement(detElemId);
828 Int_t pos = GetBusPatchIndex(detElemId, manuId);
830 if ( pos >= detElement->GetNofBusPatches() )
834 << " greater than the size = " << detElement->GetNofBusPatches()
835 << " for detElemId = " << detElemId
836 << " manuId = " << manuId << endl;
840 return detElement->GetBusPatchId(pos);
844 //______________________________________________________________________________
845 Long_t AliMpDDLStore::GetLinkPortId(Int_t busPatchId) const {
847 /// Get link port and DSP from busPatch id.
848 /// Return -1 if the value is not valid
849 /// (the validity has to be tested in the client code)
851 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
852 Int_t ddlId = busPatch->GetDdlId();
854 Int_t localBusPatchId = AliMpBusPatch::GetLocalBusID(busPatchId, ddlId) - 1; // begin at zero
856 Int_t pos = (localBusPatchId % AliMpFrtCrocusConstants::GetNofBusPatches());
858 return AliMpFrtCrocusConstants::GetLinkPortId(pos);
862 //______________________________________________________________________________
863 void AliMpDDLStore::PrintAllManu() const {
864 /// Print all manu Ids and their serial numbers sorted by detection element
865 /// and bus patch. \n
866 /// As serial manu numbers are filled in a different way than manu Ids this
867 /// printing allows to check that both ways are consistent
871 for ( it.First(); ! it.IsDone(); it.Next() ) {
872 AliMpDetElement* de = it.CurrentDE();
873 cout << "DE: " << de->GetId() << endl;
875 // Loop over bus patches in this DE
876 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
878 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
879 cout << " busPatch: " << busPatch->GetId() << endl;
882 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
883 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
887 if ( AliMpManuStore::Instance(kFALSE) ) {
888 cout << " Manu serial: ";
889 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
891 << AliMpManuStore::Instance()
892 ->GetManuSerial(de->GetId(), busPatch->GetManuId(k)) << " ";
900 //______________________________________________________________________________
901 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
902 /// return the next detection element in line
904 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
906 TString name(localBoard->GetName());
908 Int_t line = AliMp::PairFirst(localBoard->GetPosition());
911 name.Replace(4,1,Form("%d", line));
914 if ((nextLocalId = GetLocalBoardId(name)))
915 return GetDEfromLocalBoard(nextLocalId, chamberId);
922 //______________________________________________________________________________
923 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
924 /// return the previous detection element in line
926 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
928 TString name(localBoard->GetName());
930 Int_t line = AliMp::PairFirst(localBoard->GetPosition());
933 name.Replace(4,1,Form("%d", line));
936 if ((prevLocalId = GetLocalBoardId(name)))
937 return GetDEfromLocalBoard(prevLocalId, chamberId);
943 //______________________________________________________________________________
944 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
946 /// Replace the existing regional trigger with the given one
948 fRegionalTrigger = regionalTrigger;
950 // Remove the existing trigger DDLsf
951 fDDLs.RemoveAt(fgkNofDDLs+1);
952 fDDLs.RemoveAt(fgkNofDDLs);
954 // Set new trigger DDLs from new regional trigger
959 //______________________________________________________________________________
961 AliMpDDLStore::CreateBusPatchIterator() const
963 /// Create the iterator over bus patches
965 return fBusPatches.CreateIterator();