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 // Class AliMpDDLStore
21 // --------------------
22 // The top container class for DDLs, det elements and bus patched
23 // It provides acces to DDL, det element and bus patches objects
24 // via various characteristics.
25 // Authors: Ivana Hrivnacova, IPN Orsay
26 // Christian Finck, SUBATECH Nantes
28 #include "AliMpDDLStore.h"
29 #include "AliMpConstants.h"
30 #include "AliMpDEStore.h"
32 #include "AliMpFiles.h"
33 #include "AliMpHelper.h"
34 #include "AliMpDEManager.h"
35 #include "AliMpDetElement.h"
36 #include "AliMpBusPatch.h"
37 #include "AliMpTriggerCrate.h"
38 #include "AliMpLocalBoard.h"
39 #include "AliMpSegmentation.h"
40 #include "AliMpVSegmentation.h"
41 #include "AliMpStringObjMap.h"
44 #include <Riostream.h>
46 #include <TObjArray.h>
48 #include <TObjString.h>
51 ClassImp(AliMpDDLStore)
54 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
55 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
56 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
62 //______________________________________________________________________________
63 AliMpDDLStore* AliMpDDLStore::Instance()
65 /// Create the DDL store if it does not yet exist
66 /// and return its instance
69 fgInstance = new AliMpDDLStore();
78 //______________________________________________________________________________
79 AliMpDDLStore::AliMpDDLStore()
81 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
82 fDetElements(AliMpDEStore::Instance()),
88 /// Standard constructor
92 fBusPatches.SetOwner(true);
93 fBusPatches.SetSize(900);
95 fTriggerCrates.SetOwner(true);
96 fTriggerCrates.SetSize(16);
98 fLocalBoards.SetOwner(true);
99 fLocalBoards.SetSize(242); // included non-identied board
101 // Create all detection elements
108 //______________________________________________________________________________
109 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* /*ioCtor*/)
115 /// Constructor for IO
123 //______________________________________________________________________________
124 AliMpDDLStore::~AliMpDDLStore()
132 // DDL objects are deleted with fDDLs
133 // Bus patches objects are deleted with fBusPatches
142 //______________________________________________________________________________
143 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
145 /// Return the index of the manu list for given detElemId
147 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
151 //______________________________________________________________________________
152 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
154 /// Calculate the index of the buspatch from manuId
157 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
158 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
160 if( stationType == AliMp::kStation345) {
161 pos = (manuId & manuMask)/100;
163 Int_t idx = GetManuListIndex(detElemId);
165 // using array defined from DetElemIdToBusPatch.dat file
166 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
167 if ( manuId >= fManuList12[idx].At(pos)) break;
174 //______________________________________________________________________________
175 Bool_t AliMpDDLStore::ReadDDLs()
177 /// Read ddl <-> bus patch file
180 TString infile = AliMpFiles::BusPatchFilePath();
182 ifstream in(infile, ios::in);
184 AliErrorStream() << "Data file " << infile << " not found.";
190 while ( in.getline(line,255) ) {
192 if ( line[0] == '#' ) continue;
194 TString tmp(AliMpHelper::Normalize(line));
196 Int_t blankPos = tmp.First(' ');
197 Int_t blankPos1 = tmp.Last(' ');
200 TString sDE(tmp(0, blankPos));
202 Int_t idDE = atoi(sDE.Data());
204 // reading 1st manu Id for each bus patch (station 1 & 2)
205 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
207 TString sManu(tmp(blankPos1 + 1, tmp.Length()-blankPos1));
208 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
210 TString tmp1(tmp(blankPos + 1, blankPos1 - blankPos));
211 blankPos1 = blankPos + tmp1.First(' ') + 1;
212 length = tmp.Last(' ') - blankPos1;
215 length = tmp.Length()-blankPos1;
218 TString sDDL(tmp(blankPos1 + 1, length));
219 Int_t iDDL = atoi(sDDL.Data());
222 TString busPatch(tmp(blankPos + 1,blankPos1-blankPos-1));
224 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
227 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
228 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
232 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
233 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
237 AliMpDDL* ddl = GetDDL(iDDL, false);
239 ddl = new AliMpDDL(iDDL);
240 fDDLs.AddAt(ddl, iDDL);
244 TArrayI busPatchList;
245 // decoding range of buspatch
246 AliMpHelper::DecodeName(busPatch,';',busPatchList);
249 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
251 // filling buspatch -> idDE
252 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
253 fBusPatches.Add(busPatchList[i],
254 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
255 de->AddBusPatch(busPatchList[i]);
259 // Fill bus patch Ids array in DDLs now
260 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
261 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
262 ddl->FillBusPatchIds();
269 //______________________________________________________________________________
270 Bool_t AliMpDDLStore::ReadTriggerDDLs()
272 /// create trigger DDL object ddl<->Crate<->local board
274 AliMpStringObjMap inputXfromMap;
275 AliMpStringObjMap inputXtoMap;
276 AliMpStringObjMap inputYfromMap;
277 AliMpStringObjMap inputYtoMap;
279 Int_t nonNotified = 0;
283 TString infile = AliMpFiles::LocalTriggerBoardMapping();
285 ifstream in(infile, ios::in);
288 AliError(Form("Local Trigger Board Mapping File %s not found", infile.Data()));
292 AliMpLocalBoard* board = 0x0;
293 AliMpTriggerCrate* crate = 0x0;
296 Int_t localNumberId = 0;
300 while (in.getline(line, 255))
303 // files contains lines with some blank caracters ???
304 if (line[0] == ' ' && strlen(line) < 12) continue;
306 TString tmp(AliMpHelper::Normalize(line));
307 if (tmp.IsNull()) continue; // Ignore empty lines
309 if (tmp.Contains("Board"))
311 // extract id, name, slot & crate name
312 TObjArray* stringList = tmp.Tokenize(TString(" "));
314 TString localNumber = ((TObjString*)stringList->At(1))->GetString();
316 if (localNumber.CompareTo("nn") != 0) // Notified cards
317 localNumberId = localNumber.Atoi();
319 localNumberId = AliMpConstants::NofLocalBoards() + (++nonNotified);
321 TString localName = ((TObjString*)stringList->At(4))->GetString();
322 TString slotName = ((TObjString*)stringList->At(10))->GetString();
324 AliDebug(3, Form("%d %s %d\n", localNumberId, localName.Data(), slotName.Atoi()));
326 board = new AliMpLocalBoard(localNumberId, localName.Data(), slotName.Atoi());
328 // not notified board
329 if (localNumber.CompareTo("nn") == 0)
330 board->SetNotified(false);
332 // compose name with number and side (Right or Left)
333 TString crateNumber = ((TObjString*)stringList->At(6))->GetString();
334 TString crateSide = ((TObjString*)stringList->At(7))->GetString();
335 TString crateName = crateNumber + crateSide;
338 board->SetCrate(crateName);
340 // determine ddl number vs crate side
341 if (crateName.Contains("R"))
342 iDDL = fgkNofDDLs; // starts where tracker ends
344 iDDL = fgkNofDDLs + 1;
346 AliMpDDL* ddl = GetDDL(iDDL, false);
348 ddl = new AliMpDDL(iDDL);
349 fDDLs.AddAt(ddl, iDDL);
353 if (crateNumber.CompareTo("2-3") != 0)
354 crateId = crateNumber.Atoi();
358 // add trigger crate number for given ddl if not present
359 if ( !ddl->HasTriggerCrateId(crateId) )
360 ddl->AddTriggerCrate(crateId);
362 // if crate not existing then creating
363 if (!GetTriggerCrate(crateName, false)) {
364 crate = new AliMpTriggerCrate(crateName.Data(), iDDL);
365 fTriggerCrates.Add(crateName.Data(), crate);
368 // create list of local board in this crate
369 crate->AddLocalBoard(localNumberId);
374 if (tmp.Contains("DetElemId"))
377 AliMpDDL* ddl = GetDDL(iDDL, true);
379 // add DE for local board and DDL
380 TString detElem = &tmp[tmp.First(" ")+1];
381 AliMpHelper::DecodeName(detElem,' ',list);
382 for (Int_t i = 0; i < list.GetSize(); ++i) {
383 board->AddDE(list[i]);
384 if(!ddl->HasDEId(list[i]))
389 // map the different copies between cards in X and Y inputs
390 // when copying Xinput, Yinput are copied as well
391 if (tmp.Contains("X3input1"))
393 TObjArray* stringList = tmp.Tokenize(TString(" "));
395 TString copyX = ((TObjString*)stringList->At(3))->GetString();
396 TString input = ((TObjString*)stringList->At(2))->GetString();;
398 if (copyX.Contains("(1)")) {
399 inputXfromMap.Add(input, board);
400 inputYfromMap.Add(input, board);
403 if (copyX.Contains("(2)")) {
404 inputXtoMap.Add(input, board);
405 inputYtoMap.Add(input, board);
410 if (tmp.Contains("Y1input1"))
412 TObjArray* stringList = tmp.Tokenize(TString(" "));
414 TString copyY = ((TObjString*)stringList->At(3))->GetString();
415 TString input = ((TObjString*)stringList->At(2))->GetString();;
417 if (copyY.Contains("(1)"))
418 inputYfromMap.Add(input, board);
419 if (copyY.Contains("(2)"))
420 inputYtoMap.Add(input, board);
425 if (tmp.Contains("transv"))
427 // set transverse connector
428 Int_t blankPos = tmp.Last(' ');
430 TString transv(tmp(blankPos+1, tmp.Length()-blankPos));
432 if (transv.CompareTo("NONE") == 0)
436 if (tmp.Contains("Switch"))
439 in.getline(line, 255);// skip one line
441 in.getline(line, 255);
442 TString tmp(AliMpHelper::Normalize(line));
445 AliMpHelper::DecodeName(tmp,' ',list);
448 AliMpArrayI switches;
450 for (Int_t i = 0; i < list.GetSize(); ++i)
451 board->AddSwitch(list[i]);
453 // add local board into map
454 fLocalBoards.Add(board->GetId(), board);
459 // set copy card number to where the X-Y inputs are copied and
460 // from where the X-Y inputs come.
461 // deleting the first item (TString) done by AliMpStringObjMap itself
462 // keep AliMpLocalBoard object undelete
466 for (inputXfromMap.First(); !inputXfromMap.IsDone(); inputXfromMap.Next()) {
468 value = inputXfromMap.CurrentKey();
469 AliMpLocalBoard* boardFrom = (AliMpLocalBoard*)inputXfromMap.CurrentItem();
470 AliMpLocalBoard* boardTo = (AliMpLocalBoard*)inputXtoMap.Get(value);
471 boardFrom->SetInputXto(boardTo->GetId());
472 boardTo->SetInputXfrom(boardFrom->GetId());
473 AliDebug(3, Form("copy xInputs from local id %d_%s_%d to %d_%s_%d\n",
474 boardTo->GetInputXfrom(), boardFrom->GetCrate().Data(), boardFrom->GetSlot(),
475 boardFrom->GetInputXto(), boardTo->GetCrate().Data(), boardTo->GetSlot()));
478 for (inputYfromMap.First(); !inputYfromMap.IsDone(); inputYfromMap.Next()) {
480 value = inputYfromMap.CurrentKey();
481 AliMpLocalBoard* boardFrom = (AliMpLocalBoard*)inputYfromMap.CurrentItem();
482 AliMpLocalBoard* boardTo = (AliMpLocalBoard*)inputYtoMap.Get(value);
483 boardFrom->SetInputYto(boardTo->GetId());
484 boardTo->SetInputYfrom(boardFrom->GetId());
485 AliDebug(3, Form("copy yInputs from local id %d_%s_%d to %d_%s_%d\n",
486 boardTo->GetInputYfrom(), boardFrom->GetCrate().Data(), boardFrom->GetSlot(),
487 boardFrom->GetInputYto(), boardTo->GetCrate().Data(), boardTo->GetSlot()));
493 //______________________________________________________________________________
494 Bool_t AliMpDDLStore::SetManus()
496 /// Set manus for each bus patch
498 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
501 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
503 AliDebug(3, Form("DDL # %d\n", iDDL));
505 AliMpDDL* ddl = GetDDL(iDDL);
507 // loop over DE in the given DDL
508 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
510 Int_t detElemId = ddl->GetDEId(detElemIdx);
512 AliMpDetElement* detElement = GetDetElement(detElemId);
514 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
517 // list of manu per DE on both cathode
519 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
520 const AliMpVSegmentation* seg
521 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
523 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
526 seg->GetAllElectronicCardIDs(manus);
528 // filling TList manu
529 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
531 AliMpIntPair* manu = 0x0;
532 if( stationType == AliMp::kStation345)
533 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
535 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
541 manuList.Sort(); // sort regardless B or NB plane
543 // filling manu to the corresponding buspatch
544 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
546 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
548 Int_t manuId = manuPtr->GetFirst();
549 Int_t pos = GetBusPatchIndex(detElemId, manuId);
551 if (pos > detElement->GetNofBusPatches()) {
552 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
553 pos, detElement->GetNofBusPatches(), manuId, detElemId));
557 // get buspatch and fill manus
558 Int_t busPatchId = detElement->GetBusPatchId(pos);
559 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
561 if( stationType == AliMp::kStation345) {
563 if (manuPtr->GetSecond())
564 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
566 busPatch->AddManu(manuId);
570 busPatch->AddManu(manuId);
577 if (AliDebugLevel() == 3) {
579 // print out for checking
580 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
581 Int_t busPatchId = detElement->GetBusPatchId(pos);
582 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
583 printf("BusPatch: %d\n", busPatch->GetId());
584 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
585 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
589 } // detection element loop
595 //______________________________________________________________________________
596 Bool_t AliMpDDLStore::SetPatchModules()
598 /// Compute the number of manu per PCB for each buspatch
600 Bool_t result = true;
602 for (Int_t i = 0; i < fBusPatches.GetSize(); ++i) {
603 AliMpBusPatch* busPatch = (AliMpBusPatch*)fBusPatches.GetObject(i);
604 Bool_t newResult = busPatch->SetNofManusPerModule();
605 result = result && newResult;
607 if (AliDebugLevel() == 3) {
608 // print out for checking
609 printf("\nbus patch %d\n", busPatch->GetId());
610 for (Int_t i = 0; i < busPatch->GetNofPatchModules(); ++i)
611 printf("manu per %dth pcb %d\n", i, busPatch->GetNofManusPerModule(i));
618 //________________________________________________________________
619 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const
621 /// return the first board with a given side and line
623 TExMapIter i = fLocalBoards.GetIterator();
625 while ( i.Next(key, value) ) {
626 AliMpLocalBoard* local = (AliMpLocalBoard*)value;
628 TString tmp(&local->GetName()[4], 2);
629 if (name.Contains(tmp))
630 if (name[0] == local->GetName()[0])
631 return local->GetId();
643 //______________________________________________________________________________
644 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const
646 /// Return DDL for given ddlId
649 = (AliMpDDL*)fDDLs.At(ddlId);
651 if ( ! ddl && warn ) {
653 << "DDL with Id = " << ddlId << " not defined." << endl;
659 //______________________________________________________________________________
660 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const
662 /// Return detection element with given detElemId
664 return fDetElements->GetDetElement(detElemId, warn);
667 //______________________________________________________________________________
668 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const
670 /// Return bus patch with given Id
672 AliMpBusPatch* busPatch
673 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
675 if ( ! busPatch && warn ) {
677 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
683 //______________________________________________________________________________
684 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const
686 /// Return bus patch with given Id
688 AliMpLocalBoard* localBoard
689 = (AliMpLocalBoard*) fLocalBoards.GetValue(localBoardId);
691 if ( ! localBoard && warn ) {
693 << "Local board with Id = " << localBoardId << " not defined." << endl;
699 //______________________________________________________________________________
700 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const
702 /// Return trigger crate with given name
704 AliMpTriggerCrate* crate
705 = (AliMpTriggerCrate*) fTriggerCrates.GetValue(name.Data());
707 if ( ! crate && warn ) {
709 << "Trigger crate with name = " << name.Data() << " not defined." << endl;
715 //______________________________________________________________________________
716 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const
718 /// Return trigger crate with given ddl and index crate
720 AliMpDDL* ddl = GetDDL(ddlId, warn);
721 if ( ! ddl ) return 0;
723 if ( index >= ddl->GetNofTriggerCrates() ) {
724 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
728 Int_t crateId = ddl->GetTriggerCrateId(index);
729 TString name = AliMpTriggerCrate::GenerateName(crateId, ddlId, fgkNofDDLs);
731 return GetTriggerCrate(name, warn);
734 //______________________________________________________________________________
735 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const
737 /// Return detection element Id for given busPatchId
739 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
743 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
747 return busPatch->GetDEId();
750 //______________________________________________________________________________
751 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const
753 /// Return detElemId for local board Id and chamber id.
755 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
757 if ( ! localBoard ) {
759 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
763 return localBoard->GetDEIdByChamber(chamberId);
766 //______________________________________________________________________________
767 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const
769 /// Return DDL Id for given busPatchId
771 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
775 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
779 return busPatch->GetDdlId();
782 //______________________________________________________________________________
783 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const
785 /// Return bus patch for a given manuId
787 AliMpDetElement* detElement = GetDetElement(detElemId);
788 Int_t pos = GetBusPatchIndex(detElemId, manuId);
790 if ( pos > detElement->GetNofBusPatches() ) {
793 << " greater than the size = " << detElement->GetNofBusPatches()
794 << " for detElemId = " << detElemId
795 << " manuId = " << manuId << endl;
799 return detElement->GetBusPatchId(pos);
802 //______________________________________________________________________________
803 AliMpIntPair AliMpDDLStore::GetDetElemIdManu(Int_t manuSerial) const
805 /// Return the detElemId and manuId for given serial manu number
807 return fDetElements->GetDetElemIdManu(manuSerial);
810 //______________________________________________________________________________
811 void AliMpDDLStore::PrintAllManu() const
813 /// Print all manu Ids and their serial numbers sorted by detection element
814 /// and bus patch. \n
815 /// As serial manu numbers are filled in a different way than manu Ids this
816 /// printing allows to check that both ways are consistent
820 for ( it.First(); ! it.IsDone(); it.Next() ) {
821 AliMpDetElement* de = it.CurrentDE();
822 cout << "DE: " << de->GetId() << endl;
824 // Loop over bus patches in this DE
825 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
827 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
828 cout << " busPatch: " << busPatch->GetId() << endl;
831 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
832 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
836 cout << " Manu serial: ";
837 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
838 cout << std::setw(6) << de->GetManuSerialFromId(busPatch->GetManuId(k)) << " ";
845 //________________________________________________________________
846 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const
848 /// return the next detection element in line
850 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
852 TString name(localBoard->GetName());
854 Int_t line = localBoard->GetPosition().GetFirst();
857 name.Replace(4,1,Form("%d", line));
860 if ((nextLocalId = GetLocalBoardId(name)))
861 return GetDEfromLocalBoard(nextLocalId, chamberId);
868 //________________________________________________________________
869 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const
871 /// return the previous detection element in line
873 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
875 TString name(localBoard->GetName());
877 Int_t line = localBoard->GetPosition().GetFirst();
880 name.Replace(4,1,Form("%d", line));
883 if ((prevLocalId = GetLocalBoardId(name)))
884 return GetDEfromLocalBoard(prevLocalId, chamberId);