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 "AliMpHelper.h"
39 #include "AliMpDEManager.h"
40 #include "AliMpDetElement.h"
41 #include "AliMpBusPatch.h"
42 #include "AliMpTriggerCrate.h"
43 #include "AliMpLocalBoard.h"
44 #include "AliMpSegmentation.h"
45 #include "AliMpVSegmentation.h"
46 #include "AliMpStringObjMap.h"
50 #include <Riostream.h>
52 #include <TObjArray.h>
54 #include <TObjString.h>
58 ClassImp(AliMpDDLStore)
61 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
62 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
63 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
64 const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
65 const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
71 //______________________________________________________________________________
72 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
74 /// Create the DDL store if it does not yet exist
75 /// and return its instance
77 if ( ! fgInstance && warn ) {
78 AliWarningClass("DDL Store has not been loaded");
84 //______________________________________________________________________________
85 AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
87 /// Load the DDL store from ASCII data files
88 /// and return its instance
92 AliWarningClass("DDL Store has been already loaded");
96 AliInfoClass("Reading DDL Store from ASCII files.");
98 fgInstance = new AliMpDDLStore();
106 //______________________________________________________________________________
107 AliMpDDLStore::AliMpDDLStore()
109 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
115 /// Standard constructor
118 fDDLs.SetOwner(true);
119 fBusPatches.SetOwner(true);
120 fBusPatches.SetSize(900);
122 // Load segmentation & DE store data
123 if ( ! AliMpSegmentation::Instance(false) )
124 AliMpSegmentation::ReadData(true);
126 // Create all detection elements
131 ReadBusPatchSpecial();
136 //______________________________________________________________________________
137 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
141 fRegionalTrigger(ioCtor)
143 /// Constructor for I0
151 //______________________________________________________________________________
152 AliMpDDLStore::~AliMpDDLStore()
158 // DDL objects are deleted with fDDLs
159 // Bus patches objects are deleted with fBusPatches
168 //______________________________________________________________________________
169 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
171 /// Return the index of the manu list for given detElemId
173 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
177 //______________________________________________________________________________
178 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
180 /// Calculate the index of the buspatch from manuId
183 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
184 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
186 if( stationType == AliMp::kStation345) {
187 pos = (manuId & manuMask)/100;
189 Int_t idx = GetManuListIndex(detElemId);
191 // using array defined from DetElemIdToBusPatch.dat file
192 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
193 if ( manuId >= fManuList12[idx].At(pos))
200 //______________________________________________________________________________
201 Bool_t AliMpDDLStore::ReadDDLs()
203 /// Read ddl <-> bus patch file
205 TString infile = AliMpFiles::BusPatchFilePath();
207 ifstream in(infile, ios::in);
209 AliErrorStream() << "Data file " << infile << " not found.";
215 while ( in.getline(line,255) ) {
217 if ( line[0] == '#' )
220 TString tmp(AliMpHelper::Normalize(line));
222 TObjArray* stringList = tmp.Tokenize(TString(" "));
224 TString sDE = ((TObjString*)stringList->At(0))->GetString();
225 Int_t idDE = atoi(sDE.Data());
227 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
228 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
232 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
235 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
236 Int_t iDDL = atoi(sDDL.Data());
238 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
239 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
244 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
247 // reading 1st manu Id for each bus patch (station 1 & 2)
248 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
250 TString sManu = ((TObjString*)stringList->At(3))->GetString();
251 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
253 if(AliMpDEManager::GetStationType(idDE) == AliMp::kStation2) {
254 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
255 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
262 AliMpDDL* ddl = GetDDL(iDDL, false);
264 ddl = new AliMpDDL(iDDL);
265 fDDLs.AddAt(ddl, iDDL);
269 TArrayI busPatchList;
270 // decoding range of buspatch
271 AliMpHelper::DecodeName(busPatch,';',busPatchList);
274 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
276 // filling buspatch -> idDE
277 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
278 fBusPatches.Add(busPatchList[i],
279 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
280 de->AddBusPatch(busPatchList[i]);
284 // Fill bus patch Ids array in DDLs now
285 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
286 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
287 ddl->FillBusPatchIds();
294 //______________________________________________________________________________
295 Bool_t AliMpDDLStore::ReadTrigger()
297 /// create trigger DDL object and Global crate object
299 if ( ! fRegionalTrigger.ReadData() ) return false;
304 //______________________________________________________________________________
306 AliMpDDLStore::SetTriggerDDLs()
308 /// Create trigger DDLs and set DDL Ids in the regional trigger
311 TIter next(fRegionalTrigger.CreateCrateIterator());
312 AliMpTriggerCrate* crate;
314 while ( ( crate = static_cast<AliMpTriggerCrate*>(next()) ) )
316 TString crateName = crate->GetName();
318 // determine ddl number vs crate side
319 if (crateName.Contains("R"))
320 iDDL = fgkNofDDLs; // starts where tracker ends
322 iDDL = fgkNofDDLs + 1;
324 // Create DDL if it does not yet exist and set it to the crate
325 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
327 ddl = new AliMpDDL(iDDL);
328 fDDLs.AddAt(ddl, iDDL);
330 crate->SetDdlId(iDDL);
333 // Add trigger crate number for given ddl if not present
334 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
335 ddl->AddTriggerCrate(crate->GetId());
338 // Loop over local boards in this crate
340 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
342 Int_t localBoardId = crate->GetLocalBoardId(j);
343 AliMpLocalBoard* localBoard
344 = fRegionalTrigger.FindLocalBoard(localBoardId);
346 AliFatalClass("Cannot find local board.");
350 // Loop over DEs in this localBoard
352 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
355 Int_t deId = localBoard->GetDEId(k);
356 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
358 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
360 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
367 //______________________________________________________________________________
368 Bool_t AliMpDDLStore::SetManus()
370 /// Set manus for each bus patch
372 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
375 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
377 AliDebug(3, Form("DDL # %d\n", iDDL));
379 AliMpDDL* ddl = GetDDL(iDDL);
381 // loop over DE in the given DDL
382 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
384 Int_t detElemId = ddl->GetDEId(detElemIdx);
386 AliMpDetElement* detElement = GetDetElement(detElemId);
388 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
391 // list of manu per DE on both cathode
393 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
394 const AliMpVSegmentation* seg
395 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
397 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
400 seg->GetAllElectronicCardIDs(manus);
402 // filling TList manu
403 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
405 AliMpIntPair* manu = 0x0;
406 if( stationType == AliMp::kStation345)
407 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
409 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
413 detElement->AddManu(manus[im]);
417 manuList.Sort(); // sort regardless B or NB plane
419 // filling manu to the corresponding buspatch
420 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
422 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
424 Int_t manuId = manuPtr->GetFirst();
425 Int_t pos = GetBusPatchIndex(detElemId, manuId);
427 if (pos > detElement->GetNofBusPatches()) {
428 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
429 pos, detElement->GetNofBusPatches(), manuId, detElemId));
433 // get buspatch and fill manus
434 Int_t busPatchId = detElement->GetBusPatchId(pos);
435 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
437 if( stationType == AliMp::kStation345) {
439 if (manuPtr->GetSecond())
440 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
442 busPatch->AddManu(manuId);
446 busPatch->AddManu(manuId);
453 if (AliDebugLevel() == 3) {
455 // print out for checking
456 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
457 Int_t busPatchId = detElement->GetBusPatchId(pos);
458 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
459 printf("BusPatch: %d\n", busPatch->GetId());
460 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
461 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
465 } // detection element loop
471 //______________________________________________________________________________
472 Bool_t AliMpDDLStore::ReadBusPatchSpecial()
474 /// Read file with bus patches with a special order of manus
475 /// and reset the manus arrays filled via SetManu function
477 TString infile = AliMpFiles::BusPatchSpecialFilePath();
479 ifstream in(infile, ios::in);
481 AliErrorStream() << "Data file " << infile << " not found.";
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;
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::GetStationType(idDE) == AliMp::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
586 TString infile = AliMpFiles::BusPatchInfoFilePath();
587 ifstream in(infile, ios::in);
589 AliErrorStream() << "Data file " << infile << " not found.";
594 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
595 AliMpDDL* ddl = GetDDL(iDDL);
597 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
600 if (!in.getline(line,255)) {
601 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
605 } while(line[0] == '#');
607 TString tmp(AliMpHelper::Normalize(line));
609 TObjArray* stringList = tmp.Tokenize(TString(" "));
612 TString crLabel = ((TObjString*)stringList->At(0))->GetString();
613 Int_t pos = crLabel.First('-');
614 tmp = crLabel(pos-2, crLabel.Length()-pos+2);
616 AliMpHelper::DecodeName(tmp.Data(), '-', list);
618 Int_t localDDLId = list[0];
619 Int_t frtId = list[1] - 1; // begin at zero !
620 Int_t localBusId = list[2];
622 // Add FRT number for given ddl if not present
623 if ( !ddl->HasFrtId(frtId) )
626 // BP & translator label
627 TString label = ((TObjString*)stringList->At(1))->GetString();
628 TString transLabel = ((TObjString*)stringList->At(2))->GetString();
631 TString sLength = ((TObjString*)stringList->At(3))->GetString();
632 Float_t length = sLength.Atof();
636 if (localBusId != iBusPatch + 1)
637 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
639 if(localDDLId != ddl->GetId()+1)
640 AliWarning(Form("Wrong local DDL id %d instead of %d", ddl->GetId()+1, localDDLId));
642 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
643 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
644 busPatch->SetCableLength(length);
645 busPatch->SetCableLabel(label);
646 busPatch->SetTranslatorLabel(transLabel);
647 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 AliMpIntPair AliMpDDLStore::GetDetElemIdManu(Int_t manuSerial) const {
840 /// Return the detElemId and manuId for given serial manu number
842 if ( ! AliMpDEStore::Instance() ) {
843 AliFatal("DE Store has not been loaded.");
844 return AliMpIntPair::Invalid();
847 return AliMpDEStore::Instance()->GetDetElemIdManu(manuSerial);
850 //______________________________________________________________________________
851 void AliMpDDLStore::PrintAllManu() const {
852 /// Print all manu Ids and their serial numbers sorted by detection element
853 /// and bus patch. \n
854 /// As serial manu numbers are filled in a different way than manu Ids this
855 /// printing allows to check that both ways are consistent
859 for ( it.First(); ! it.IsDone(); it.Next() ) {
860 AliMpDetElement* de = it.CurrentDE();
861 cout << "DE: " << de->GetId() << endl;
863 // Loop over bus patches in this DE
864 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
866 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
867 cout << " busPatch: " << busPatch->GetId() << endl;
870 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
871 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
875 cout << " Manu serial: ";
876 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
877 cout << std::setw(6) << de->GetManuSerialFromId(busPatch->GetManuId(k)) << " ";
884 //______________________________________________________________________________
885 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
886 /// return the next detection element in line
888 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
890 TString name(localBoard->GetName());
892 Int_t line = localBoard->GetPosition().GetFirst();
895 name.Replace(4,1,Form("%d", line));
898 if ((nextLocalId = GetLocalBoardId(name)))
899 return GetDEfromLocalBoard(nextLocalId, chamberId);
906 //______________________________________________________________________________
907 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
908 /// return the previous detection element in line
910 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
912 TString name(localBoard->GetName());
914 Int_t line = localBoard->GetPosition().GetFirst();
917 name.Replace(4,1,Form("%d", line));
920 if ((prevLocalId = GetLocalBoardId(name)))
921 return GetDEfromLocalBoard(prevLocalId, chamberId);
927 //______________________________________________________________________________
928 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
930 /// Replace the existing regional trigger with the given one
932 fRegionalTrigger = regionalTrigger;
934 // Remove the existing trigger DDLsf
935 fDDLs.RemoveAt(fgkNofDDLs+1);
936 fDDLs.RemoveAt(fgkNofDDLs);
938 // Set new trigger DDLs from new regional trigger
943 //______________________________________________________________________________
945 AliMpDDLStore::CreateBusPatchIterator() const
947 /// Create the iterator over bus patches
949 return fBusPatches.CreateIterator();