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 //-----------------------------------------------------------------------------
30 #include "AliMpDDLStore.h"
31 #include "AliMpConstants.h"
32 #include "AliMpDEStore.h"
34 #include "AliMpFiles.h"
35 #include "AliMpHelper.h"
36 #include "AliMpDEManager.h"
37 #include "AliMpDetElement.h"
38 #include "AliMpBusPatch.h"
39 #include "AliMpTriggerCrate.h"
40 #include "AliMpLocalBoard.h"
41 #include "AliMpSegmentation.h"
42 #include "AliMpVSegmentation.h"
43 #include "AliMpStringObjMap.h"
47 #include <Riostream.h>
49 #include <TObjArray.h>
51 #include <TObjString.h>
55 ClassImp(AliMpDDLStore)
58 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
59 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
60 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
61 const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
62 const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
68 //______________________________________________________________________________
69 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
71 /// Create the DDL store if it does not yet exist
72 /// and return its instance
74 if ( ! fgInstance && warn ) {
75 AliWarningClass("DDL Store has not been loaded");
81 //______________________________________________________________________________
82 AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
84 /// Load the DDL store from ASCII data files
85 /// and return its instance
89 AliWarningClass("DDL Store has been already loaded");
93 AliInfoClass("Reading DDL Store from ASCII files.");
95 fgInstance = new AliMpDDLStore();
103 //______________________________________________________________________________
104 AliMpDDLStore::AliMpDDLStore()
106 fDDLs(fgkNofDDLs+fgkNofTriggerDDLs), // FIXEME
113 /// Standard constructor
116 fDDLs.SetOwner(true);
117 fBusPatches.SetOwner(true);
118 fBusPatches.SetSize(900);
120 // Load segmentation & DE store data
121 if ( ! AliMpSegmentation::Instance(false) )
122 AliMpSegmentation::ReadData(true);
124 // Create all detection elements
129 ReadBusPatchSpecial();
134 //______________________________________________________________________________
135 AliMpDDLStore::AliMpDDLStore(TRootIOCtor* ioCtor)
139 fGlobalCrate(ioCtor),
140 fRegionalTrigger(ioCtor)
142 /// Constructor for I0
150 //______________________________________________________________________________
151 AliMpDDLStore::~AliMpDDLStore()
157 // DDL objects are deleted with fDDLs
158 // Bus patches objects are deleted with fBusPatches
167 //______________________________________________________________________________
168 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
170 /// Return the index of the manu list for given detElemId
172 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
176 //______________________________________________________________________________
177 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
179 /// Calculate the index of the buspatch from manuId
182 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
183 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
185 if( stationType == AliMp::kStation345) {
186 pos = (manuId & manuMask)/100;
188 Int_t idx = GetManuListIndex(detElemId);
190 // using array defined from DetElemIdToBusPatch.dat file
191 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
192 if ( manuId >= fManuList12[idx].At(pos))
199 //______________________________________________________________________________
200 Bool_t AliMpDDLStore::ReadDDLs()
202 /// Read ddl <-> bus patch file
204 TString infile = AliMpFiles::BusPatchFilePath();
206 ifstream in(infile, ios::in);
208 AliErrorStream() << "Data file " << infile << " not found.";
214 while ( in.getline(line,255) ) {
216 if ( line[0] == '#' )
219 TString tmp(AliMpHelper::Normalize(line));
221 TObjArray* stringList = tmp.Tokenize(TString(" "));
223 TString sDE = ((TObjString*)stringList->At(0))->GetString();
224 Int_t idDE = atoi(sDE.Data());
226 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
227 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
231 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
234 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
235 Int_t iDDL = atoi(sDDL.Data());
237 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
238 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
243 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
246 // reading 1st manu Id for each bus patch (station 1 & 2)
247 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
249 TString sManu = ((TObjString*)stringList->At(3))->GetString();
250 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
252 if(AliMpDEManager::GetStationType(idDE) == AliMp::kStation2) {
253 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
254 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
261 AliMpDDL* ddl = GetDDL(iDDL, false);
263 ddl = new AliMpDDL(iDDL);
264 fDDLs.AddAt(ddl, iDDL);
268 TArrayI busPatchList;
269 // decoding range of buspatch
270 AliMpHelper::DecodeName(busPatch,';',busPatchList);
273 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
275 // filling buspatch -> idDE
276 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
277 fBusPatches.Add(busPatchList[i],
278 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
279 de->AddBusPatch(busPatchList[i]);
283 // Fill bus patch Ids array in DDLs now
284 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
285 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
286 ddl->FillBusPatchIds();
293 //______________________________________________________________________________
294 Bool_t AliMpDDLStore::ReadTrigger()
296 /// create trigger DDL object and Global crate object
298 if ( ! fGlobalCrate.ReadData() ) return false;
300 if ( ! fRegionalTrigger.ReadData() ) return false;
305 //______________________________________________________________________________
306 Bool_t AliMpDDLStore::SetTriggerDDLs()
308 /// Create trigger DDLs and set DDL Ids in the regional trigger
313 for ( Int_t i=0; i<fRegionalTrigger.GetNofTriggerCrates(); ++i ) {
315 AliMpTriggerCrate* crate = fRegionalTrigger.GetTriggerCrateFast(i);
317 TString crateName = crate->GetName();
319 // determine ddl number vs crate side
320 if (crateName.Contains("R"))
321 iDDL = fgkNofDDLs; // starts where tracker ends
323 iDDL = fgkNofDDLs + 1;
325 // Create DDL if it does not yet exist and set it to the crate
326 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
328 ddl = new AliMpDDL(iDDL);
329 fDDLs.AddAt(ddl, iDDL);
331 crate->SetDdlId(iDDL);
334 // Add trigger crate number for given ddl if not present
335 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
336 ddl->AddTriggerCrate(crate->GetId());
339 // Loop over local boards in this crate
341 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
343 Int_t localBoardId = crate->GetLocalBoardId(j);
344 AliMpLocalBoard* localBoard
345 = fRegionalTrigger.FindLocalBoard(localBoardId);
347 AliFatalClass("Cannot find local board.");
351 // Loop over DEs in this localBoard
353 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
356 Int_t deId = localBoard->GetDEId(k);
357 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
359 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
361 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
368 //______________________________________________________________________________
369 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() {
556 /// Compute the number of manu per PCB for each buspatch
559 Bool_t result = true;
561 for ( it.First(); !it.IsDone(); it.Next() ) {
563 AliMpDetElement* detElement = it.CurrentDE();
565 for (Int_t i = 0; i < detElement->GetNofBusPatches(); ++i) {
566 AliMpBusPatch* busPatch = GetBusPatch(detElement->GetBusPatchId(i));
567 Bool_t newResult = false;
568 Int_t idDE = busPatch->GetDEId();
570 if (AliMpDEManager::GetStationType(idDE) == AliMp::kStation2 )
571 newResult = busPatch->SetNofManusPerModule(fManuBridge2[GetManuListIndex(idDE)].At(i));
573 newResult = busPatch->SetNofManusPerModule();
580 //______________________________________________________________________________
581 Bool_t AliMpDDLStore::SetBusPatchLength() {
582 /// read the buspatch length file and set buspatch length
584 TString infile = AliMpFiles::BusPatchLengthFilePath();
585 ifstream in(infile, ios::in);
587 AliErrorStream() << "Data file " << infile << " not found.";
592 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
593 AliMpDDL* ddl = GetDDL(iDDL);
595 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
598 if (!in.getline(line,255)) {
599 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
603 } while(line[0] == '#');
605 TString tmp(AliMpHelper::Normalize(line));
607 TObjArray* stringList = tmp.Tokenize(TString(" "));
609 TString sLocalBusId = ((TObjString*)stringList->At(0))->GetString();
610 Int_t localBusId = sLocalBusId.Atoi();
612 TString sLength = ((TObjString*)stringList->At(1))->GetString();
613 Float_t length = sLength.Atof();
617 if (localBusId != iBusPatch + 1)
618 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
620 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
621 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
622 busPatch->SetCableLength(length);
630 //________________________________________________________________
631 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const {
632 /// return the first board with a given side and line
635 TExMapIter i = fRegionalTrigger.GetLocalBoardItr();
637 while ( i.Next(key, value) ) {
638 AliMpLocalBoard* local = (AliMpLocalBoard*)value;
640 TString tmp(&local->GetName()[4], 2);
641 if (name.Contains(tmp))
642 if (name[0] == local->GetName()[0])
643 return local->GetId();
655 //______________________________________________________________________________
656 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const {
657 /// Return DDL for given ddlId
660 = (AliMpDDL*)fDDLs.At(ddlId);
662 if ( ! ddl && warn ) {
664 << "DDL with Id = " << ddlId << " not defined." << endl;
670 //______________________________________________________________________________
671 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const {
672 /// Return detection element with given detElemId
674 if ( ! AliMpDEStore::Instance() ) {
675 AliFatal("DE Store has not been loaded.");
679 return AliMpDEStore::Instance()->GetDetElement(detElemId, warn);
682 //______________________________________________________________________________
683 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const {
684 /// Return bus patch with given Id
686 AliMpBusPatch* busPatch
687 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
689 if ( ! busPatch && warn ) {
691 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
697 //______________________________________________________________________________
698 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const {
699 /// Return bus patch with given Id
701 return fRegionalTrigger.FindLocalBoard(localBoardId, warn);
704 //______________________________________________________________________________
705 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const {
706 /// Return trigger crate with given name
708 return fRegionalTrigger.FindTriggerCrate(name, warn);
711 //______________________________________________________________________________
712 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const {
713 /// Return trigger crate with given ddl and index crate
715 if (ddlId == 0 || ddlId == 1)
718 AliMpDDL* ddl = GetDDL(ddlId, warn);
722 if ( index >= ddl->GetNofTriggerCrates() ) {
723 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
727 TString name = AliMpTriggerCrate::GenerateName(index, ddlId, fgkNofDDLs);
729 return GetTriggerCrate(name, warn);
732 //______________________________________________________________________________
733 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const {
734 /// Return detection element Id for given busPatchId
736 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
740 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
744 return busPatch->GetDEId();
747 //______________________________________________________________________________
748 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
749 /// Return detElemId for local board Id and chamber id.
751 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
753 if ( ! localBoard ) {
755 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
759 return localBoard->GetDEIdByChamber(chamberId);
762 //______________________________________________________________________________
763 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const {
764 /// Return DDL Id for given busPatchId
766 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
770 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
774 return busPatch->GetDdlId();
777 //______________________________________________________________________________
778 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const {
779 /// Return bus patch for a given manuId
781 AliMpDetElement* detElement = GetDetElement(detElemId);
782 Int_t pos = GetBusPatchIndex(detElemId, manuId);
784 if ( pos > detElement->GetNofBusPatches() ) {
787 << " greater than the size = " << detElement->GetNofBusPatches()
788 << " for detElemId = " << detElemId
789 << " manuId = " << manuId << endl;
793 return detElement->GetBusPatchId(pos);
796 //______________________________________________________________________________
797 AliMpIntPair AliMpDDLStore::GetDetElemIdManu(Int_t manuSerial) const {
798 /// Return the detElemId and manuId for given serial manu number
800 if ( ! AliMpDEStore::Instance() ) {
801 AliFatal("DE Store has not been loaded.");
802 return AliMpIntPair::Invalid();
805 return AliMpDEStore::Instance()->GetDetElemIdManu(manuSerial);
808 //______________________________________________________________________________
809 void AliMpDDLStore::PrintAllManu() const {
810 /// Print all manu Ids and their serial numbers sorted by detection element
811 /// and bus patch. \n
812 /// As serial manu numbers are filled in a different way than manu Ids this
813 /// printing allows to check that both ways are consistent
817 for ( it.First(); ! it.IsDone(); it.Next() ) {
818 AliMpDetElement* de = it.CurrentDE();
819 cout << "DE: " << de->GetId() << endl;
821 // Loop over bus patches in this DE
822 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
824 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
825 cout << " busPatch: " << busPatch->GetId() << endl;
828 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
829 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
833 cout << " Manu serial: ";
834 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
835 cout << std::setw(6) << de->GetManuSerialFromId(busPatch->GetManuId(k)) << " ";
842 //______________________________________________________________________________
843 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
844 /// return the next detection element in line
846 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
848 TString name(localBoard->GetName());
850 Int_t line = localBoard->GetPosition().GetFirst();
853 name.Replace(4,1,Form("%d", line));
856 if ((nextLocalId = GetLocalBoardId(name)))
857 return GetDEfromLocalBoard(nextLocalId, chamberId);
864 //______________________________________________________________________________
865 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
866 /// return the previous detection element in line
868 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
870 TString name(localBoard->GetName());
872 Int_t line = localBoard->GetPosition().GetFirst();
875 name.Replace(4,1,Form("%d", line));
878 if ((prevLocalId = GetLocalBoardId(name)))
879 return GetDEfromLocalBoard(prevLocalId, chamberId);
885 //______________________________________________________________________________
886 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
888 /// Replace the existing regional trigger with the given one
890 fRegionalTrigger = regionalTrigger;
892 // Remove the existing trigger DDLs
893 fDDLs.RemoveAt(fgkNofDDLs+1);
894 fDDLs.RemoveAt(fgkNofDDLs);
896 // Set new trigger DDLs from new regional trigger