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 "AliMpConstants.h"
33 #include "AliMpDEStore.h"
35 #include "AliMpFiles.h"
36 #include "AliMpHelper.h"
37 #include "AliMpDEManager.h"
38 #include "AliMpDetElement.h"
39 #include "AliMpBusPatch.h"
40 #include "AliMpTriggerCrate.h"
41 #include "AliMpLocalBoard.h"
42 #include "AliMpSegmentation.h"
43 #include "AliMpVSegmentation.h"
44 #include "AliMpStringObjMap.h"
48 #include <Riostream.h>
50 #include <TObjArray.h>
52 #include <TObjString.h>
56 ClassImp(AliMpDDLStore)
59 AliMpDDLStore* AliMpDDLStore::fgInstance = 0;
60 const Int_t AliMpDDLStore::fgkNofDDLs = 20;
61 const Int_t AliMpDDLStore::fgkNofTriggerDDLs = 2;
62 const TString AliMpDDLStore::fgkRevertKeyword = "REVERT";
63 const TString AliMpDDLStore::fgkExplicitKeyword = "EXPLICIT";
69 //______________________________________________________________________________
70 AliMpDDLStore* AliMpDDLStore::Instance(Bool_t warn)
72 /// Create the DDL store if it does not yet exist
73 /// and return its instance
75 if ( ! fgInstance && warn ) {
76 AliWarningClass("DDL Store has not been loaded");
82 //______________________________________________________________________________
83 AliMpDDLStore* AliMpDDLStore::ReadData(Bool_t warn)
85 /// Load the DDL store from ASCII data files
86 /// and return its instance
90 AliWarningClass("DDL Store has been already loaded");
94 AliInfoClass("Reading DDL Store from ASCII files.");
96 fgInstance = new AliMpDDLStore();
104 //______________________________________________________________________________
105 AliMpDDLStore::AliMpDDLStore()
107 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 fRegionalTrigger(ioCtor)
141 /// Constructor for I0
149 //______________________________________________________________________________
150 AliMpDDLStore::~AliMpDDLStore()
156 // DDL objects are deleted with fDDLs
157 // Bus patches objects are deleted with fBusPatches
166 //______________________________________________________________________________
167 Int_t AliMpDDLStore::GetManuListIndex(Int_t detElemId) const
169 /// Return the index of the manu list for given detElemId
171 return AliMpDEManager::GetChamberId(detElemId)*4 + (detElemId % 100);
175 //______________________________________________________________________________
176 Int_t AliMpDDLStore::GetBusPatchIndex(Int_t detElemId, Int_t manuId) const
178 /// Calculate the index of the buspatch from manuId
181 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
182 static Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
184 if( stationType == AliMp::kStation345) {
185 pos = (manuId & manuMask)/100;
187 Int_t idx = GetManuListIndex(detElemId);
189 // using array defined from DetElemIdToBusPatch.dat file
190 for (pos = fManuList12[idx].GetSize()-1; pos >= 0; --pos)
191 if ( manuId >= fManuList12[idx].At(pos))
198 //______________________________________________________________________________
199 Bool_t AliMpDDLStore::ReadDDLs()
201 /// Read ddl <-> bus patch file
203 TString infile = AliMpFiles::BusPatchFilePath();
205 ifstream in(infile, ios::in);
207 AliErrorStream() << "Data file " << infile << " not found.";
213 while ( in.getline(line,255) ) {
215 if ( line[0] == '#' )
218 TString tmp(AliMpHelper::Normalize(line));
220 TObjArray* stringList = tmp.Tokenize(TString(" "));
222 TString sDE = ((TObjString*)stringList->At(0))->GetString();
223 Int_t idDE = atoi(sDE.Data());
225 if ( ! AliMpDEManager::IsValidDetElemId(idDE, false) ) {
226 AliErrorStream() << "DetElemId "<< idDE << " not valid." << endl;
230 TString busPatch = ((TObjString*)stringList->At(1))->GetString();
233 TString sDDL = ((TObjString*)stringList->At(2))->GetString();
234 Int_t iDDL = atoi(sDDL.Data());
236 if ( iDDL < 0 || iDDL >= fgkNofDDLs ) {
237 AliErrorStream() << "DDL id "<< iDDL << " outside limits." << endl;
242 << "idDE " << idDE << " buspatch " << busPatch.Data() << " iDDL " << iDDL
245 // reading 1st manu Id for each bus patch (station 1 & 2)
246 if(AliMpDEManager::GetStationType(idDE) != AliMp::kStation345) {
248 TString sManu = ((TObjString*)stringList->At(3))->GetString();
249 AliMpHelper::DecodeName(sManu,',',fManuList12[GetManuListIndex(idDE)]);
251 if(AliMpDEManager::GetStationType(idDE) == AliMp::kStation2) {
252 TString sManuBridge = ((TObjString*)stringList->At(4))->GetString();
253 AliMpHelper::DecodeName(sManuBridge,',',fManuBridge2[GetManuListIndex(idDE)]);
260 AliMpDDL* ddl = GetDDL(iDDL, false);
262 ddl = new AliMpDDL(iDDL);
263 fDDLs.AddAt(ddl, iDDL);
267 TArrayI busPatchList;
268 // decoding range of buspatch
269 AliMpHelper::DecodeName(busPatch,';',busPatchList);
272 AliMpDetElement* de = AliMpDEManager::GetDetElement(idDE);
274 // filling buspatch -> idDE
275 for (Int_t i = 0; i < busPatchList.GetSize(); i++) {
276 fBusPatches.Add(busPatchList[i],
277 new AliMpBusPatch(busPatchList[i], idDE, iDDL));
278 de->AddBusPatch(busPatchList[i]);
282 // Fill bus patch Ids array in DDLs now
283 for ( Int_t i=0; i<fDDLs.GetEntriesFast(); i++ ) {
284 AliMpDDL* ddl = (AliMpDDL*) fDDLs.At(i);
285 ddl->FillBusPatchIds();
292 //______________________________________________________________________________
293 Bool_t AliMpDDLStore::ReadTrigger()
295 /// create trigger DDL object and Global crate object
297 if ( ! fRegionalTrigger.ReadData() ) return false;
302 //______________________________________________________________________________
303 Bool_t AliMpDDLStore::SetTriggerDDLs()
305 /// Create trigger DDLs and set DDL Ids in the regional trigger
310 for ( Int_t i=0; i<fRegionalTrigger.GetNofTriggerCrates(); ++i ) {
312 AliMpTriggerCrate* crate = fRegionalTrigger.GetTriggerCrateFast(i);
314 TString crateName = crate->GetName();
316 // determine ddl number vs crate side
317 if (crateName.Contains("R"))
318 iDDL = fgkNofDDLs; // starts where tracker ends
320 iDDL = fgkNofDDLs + 1;
322 // Create DDL if it does not yet exist and set it to the crate
323 AliMpDDL* ddl = (AliMpDDL*)fDDLs.At(iDDL);
325 ddl = new AliMpDDL(iDDL);
326 fDDLs.AddAt(ddl, iDDL);
328 crate->SetDdlId(iDDL);
331 // Add trigger crate number for given ddl if not present
332 if ( !ddl->HasTriggerCrateId(crate->GetId()) )
333 ddl->AddTriggerCrate(crate->GetId());
336 // Loop over local boards in this crate
338 for ( Int_t j=0; j<crate->GetNofLocalBoards(); ++j )
340 Int_t localBoardId = crate->GetLocalBoardId(j);
341 AliMpLocalBoard* localBoard
342 = fRegionalTrigger.FindLocalBoard(localBoardId);
344 AliFatalClass("Cannot find local board.");
348 // Loop over DEs in this localBoard
350 for ( Int_t k=0; k<localBoard->GetNofDEs(); ++k )
353 Int_t deId = localBoard->GetDEId(k);
354 AliMpDetElement* de = AliMpDEManager::GetDetElement(deId);
356 if ( de->GetDdlId() == -1 ) de->SetDdlId(iDDL);
358 if ( ! ddl->HasDEId(deId) ) ddl->AddDE(deId);
365 //______________________________________________________________________________
366 Bool_t AliMpDDLStore::SetManus() {
367 /// Set manus for each bus patch
369 Int_t manuMask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane) - 1;
372 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL) {
374 AliDebug(3, Form("DDL # %d\n", iDDL));
376 AliMpDDL* ddl = GetDDL(iDDL);
378 // loop over DE in the given DDL
379 for (Int_t detElemIdx = 0; detElemIdx < ddl->GetNofDEs(); ++detElemIdx) {
381 Int_t detElemId = ddl->GetDEId(detElemIdx);
383 AliMpDetElement* detElement = GetDetElement(detElemId);
385 AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
388 // list of manu per DE on both cathode
390 for ( Int_t cath = 0; cath < 2 ; ++cath ) {
391 const AliMpVSegmentation* seg
392 = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
394 AliMp::PlaneType planeType = detElement->GetPlaneType(AliMp::GetCathodType(cath));
397 seg->GetAllElectronicCardIDs(manus);
399 // filling TList manu
400 for ( Int_t im = 0; im < manus.GetSize(); ++im ) {
402 AliMpIntPair* manu = 0x0;
403 if( stationType == AliMp::kStation345)
404 manu = new AliMpIntPair((manus[im] & manuMask), planeType, kTRUE); //remove offset for NB
406 manu = new AliMpIntPair(manus[im], planeType, kTRUE); //keep offset for NB
410 detElement->AddManu(manus[im]);
414 manuList.Sort(); // sort regardless B or NB plane
416 // filling manu to the corresponding buspatch
417 for (Int_t iEntry = 0; iEntry < manuList.GetEntries(); ++iEntry) {
419 AliMpIntPair* manuPtr = (AliMpIntPair*)manuList.At(iEntry);
421 Int_t manuId = manuPtr->GetFirst();
422 Int_t pos = GetBusPatchIndex(detElemId, manuId);
424 if (pos > detElement->GetNofBusPatches()) {
425 AliError(Form("pos greater %d than size %d manuId %d detElemId %d \n",
426 pos, detElement->GetNofBusPatches(), manuId, detElemId));
430 // get buspatch and fill manus
431 Int_t busPatchId = detElement->GetBusPatchId(pos);
432 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
434 if( stationType == AliMp::kStation345) {
436 if (manuPtr->GetSecond())
437 busPatch->AddManu(manuId+manuMask+1); // add offset again after sorted
439 busPatch->AddManu(manuId);
443 busPatch->AddManu(manuId);
450 if (AliDebugLevel() == 3) {
452 // print out for checking
453 for(Int_t pos = 0; pos < detElement->GetNofBusPatches(); ++pos) {
454 Int_t busPatchId = detElement->GetBusPatchId(pos);
455 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
456 printf("BusPatch: %d\n", busPatch->GetId());
457 for (Int_t iEntry = 0; iEntry < busPatch->GetNofManus(); ++iEntry)
458 printf("manu Id: %d\n", busPatch->GetManuId(iEntry));
462 } // detection element loop
468 //______________________________________________________________________________
469 Bool_t AliMpDDLStore::ReadBusPatchSpecial()
471 /// Read file with bus patches with a special order of manus
472 /// and reset the manus arrays filled via SetManu function
474 TString infile = AliMpFiles::BusPatchSpecialFilePath();
476 ifstream in(infile, ios::in);
478 AliErrorStream() << "Data file " << infile << " not found.";
484 while ( in.getline(line,255) ) {
486 if ( line[0] == '#' ) continue;
488 TString tmp(AliMpHelper::Normalize(line));
489 TObjArray* stringList = tmp.Tokenize(TString(" "));
491 TString sKey = ((TObjString*)stringList->At(0))->GetString();
493 TString sDDL = ((TObjString*)stringList->At(1))->GetString();
495 AliMpHelper::DecodeName(sDDL,';',ddlList);
497 TString sBusPatch = ((TObjString*)stringList->At(2))->GetString();
498 TArrayI busPatchList;
499 AliMpHelper::DecodeName(sBusPatch,',',busPatchList);
501 // Loop over DDL and Bus Patch
502 for (Int_t iDDL = 0; iDDL < ddlList.GetSize(); ++iDDL ) {
503 for (Int_t iBusPatch = 0; iBusPatch < busPatchList.GetSize(); ++iBusPatch) {
504 // Global bus patch ID
506 = AliMpBusPatch::GetGlobalBusID(
507 busPatchList.At(iBusPatch), ddlList.At(iDDL));
509 // Get this bus patch
510 AliMpBusPatch* busPatch = GetBusPatch(busPatchID);
512 AliErrorStream() << "Bus patch " << busPatchID << " does not exist." << endl;
516 if ( sKey == fgkRevertKeyword ) {
518 << "Reverting readout of bus patch " << busPatchID << endl;
520 // Now revert the manus in this bus patch
521 busPatch->RevertReadout();
523 else if ( sKey == fgkExplicitKeyword ) {
525 busPatch->ResetReadout();
527 TString sManus = ((TObjString*)stringList->At(3))->GetString();
529 AliMpHelper::DecodeName(sManus,',',manuList);
532 << "Reseting readout of bus patch " << busPatchID
533 << " manus: " << sManus.Data() << endl;
535 for (Int_t i = 0; i < manuList.GetSize(); i++) {
536 busPatch->AddManu(manuList.At(i));
540 AliErrorStream() << "Unrecognized key." << endl;
551 //______________________________________________________________________________
552 Bool_t AliMpDDLStore::SetPatchModules() {
553 /// Compute the number of manu per PCB for each buspatch
556 Bool_t result = true;
558 for ( it.First(); !it.IsDone(); it.Next() ) {
560 AliMpDetElement* detElement = it.CurrentDE();
562 for (Int_t i = 0; i < detElement->GetNofBusPatches(); ++i) {
563 AliMpBusPatch* busPatch = GetBusPatch(detElement->GetBusPatchId(i));
564 Bool_t newResult = false;
565 Int_t idDE = busPatch->GetDEId();
567 if (AliMpDEManager::GetStationType(idDE) == AliMp::kStation2 )
568 newResult = busPatch->SetNofManusPerModule(fManuBridge2[GetManuListIndex(idDE)].At(i));
570 newResult = busPatch->SetNofManusPerModule();
577 //______________________________________________________________________________
578 Bool_t AliMpDDLStore::SetBusPatchLength() {
579 /// read the buspatch length file and set buspatch length
581 TString infile = AliMpFiles::BusPatchLengthFilePath();
582 ifstream in(infile, ios::in);
584 AliErrorStream() << "Data file " << infile << " not found.";
589 for (Int_t iDDL = 0; iDDL < fgkNofDDLs; ++iDDL ) {
590 AliMpDDL* ddl = GetDDL(iDDL);
592 for (Int_t iBusPatch = 0; iBusPatch < ddl->GetNofBusPatches(); ++iBusPatch) {
595 if (!in.getline(line,255)) {
596 AliWarning(Form("Wrong size in bus patch length file; index %d DDL %d",
600 } while(line[0] == '#');
602 TString tmp(AliMpHelper::Normalize(line));
604 TObjArray* stringList = tmp.Tokenize(TString(" "));
606 TString sLocalBusId = ((TObjString*)stringList->At(0))->GetString();
607 Int_t localBusId = sLocalBusId.Atoi();
609 TString sLength = ((TObjString*)stringList->At(1))->GetString();
610 Float_t length = sLength.Atof();
614 if (localBusId != iBusPatch + 1)
615 AliWarning(Form("Wrong local buspatch id %d instead of %d", iBusPatch+1, localBusId));
617 Int_t busPatchId = ddl->GetBusPatchId(iBusPatch);
618 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
619 busPatch->SetCableLength(length);
627 //________________________________________________________________
628 Int_t AliMpDDLStore::GetLocalBoardId(TString name) const {
629 /// return the first board with a given side and line
632 TExMapIter i = fRegionalTrigger.GetLocalBoardItr();
634 while ( i.Next(key, value) ) {
635 AliMpLocalBoard* local = (AliMpLocalBoard*)value;
637 TString tmp(&local->GetName()[4], 2);
638 if (name.Contains(tmp))
639 if (name[0] == local->GetName()[0])
640 return local->GetId();
652 //______________________________________________________________________________
653 AliMpDDL* AliMpDDLStore::GetDDL(Int_t ddlId, Bool_t warn) const {
654 /// Return DDL for given ddlId
657 = (AliMpDDL*)fDDLs.At(ddlId);
659 if ( ! ddl && warn ) {
661 << "DDL with Id = " << ddlId << " not defined." << endl;
667 //______________________________________________________________________________
668 AliMpDetElement* AliMpDDLStore::GetDetElement(Int_t detElemId, Bool_t warn) const {
669 /// Return detection element with given detElemId
671 if ( ! AliMpDEStore::Instance() ) {
672 AliFatal("DE Store has not been loaded.");
676 return AliMpDEStore::Instance()->GetDetElement(detElemId, warn);
679 //______________________________________________________________________________
680 AliMpBusPatch* AliMpDDLStore::GetBusPatch(Int_t busPatchId, Bool_t warn) const {
681 /// Return bus patch with given Id
683 AliMpBusPatch* busPatch
684 = (AliMpBusPatch*) fBusPatches.GetValue(busPatchId);
686 if ( ! busPatch && warn ) {
688 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
694 //______________________________________________________________________________
695 AliMpLocalBoard* AliMpDDLStore::GetLocalBoard(Int_t localBoardId, Bool_t warn) const {
696 /// Return bus patch with given Id
698 return fRegionalTrigger.FindLocalBoard(localBoardId, warn);
701 //______________________________________________________________________________
702 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(TString name, Bool_t warn) const {
703 /// Return trigger crate with given name
705 return fRegionalTrigger.FindTriggerCrate(name, warn);
708 //______________________________________________________________________________
709 AliMpTriggerCrate* AliMpDDLStore::GetTriggerCrate(Int_t ddlId, Int_t index, Bool_t warn) const {
710 /// Return trigger crate with given ddl and index crate
712 if (ddlId == 0 || ddlId == 1)
715 AliMpDDL* ddl = GetDDL(ddlId, warn);
719 if ( index >= ddl->GetNofTriggerCrates() ) {
720 AliError(Form("crate id %d greater than array[%d]", index, ddl->GetNofTriggerCrates()));
724 TString name = AliMpTriggerCrate::GenerateName(index, ddlId, fgkNofDDLs);
726 return GetTriggerCrate(name, warn);
729 //______________________________________________________________________________
730 Int_t AliMpDDLStore::GetDEfromBus(Int_t busPatchId) const {
731 /// Return detection element Id for given busPatchId
733 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
737 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
741 return busPatch->GetDEId();
744 //______________________________________________________________________________
745 Int_t AliMpDDLStore::GetDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
746 /// Return detElemId for local board Id and chamber id.
748 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
750 if ( ! localBoard ) {
752 << "Loacl board with Id = " << localBoardId << " not defined." << endl;
756 return localBoard->GetDEIdByChamber(chamberId);
759 //______________________________________________________________________________
760 Int_t AliMpDDLStore::GetDDLfromBus(Int_t busPatchId) const {
761 /// Return DDL Id for given busPatchId
763 AliMpBusPatch* busPatch = GetBusPatch(busPatchId);
767 << "Bus patch with Id = " << busPatchId << " not defined." << endl;
771 return busPatch->GetDdlId();
774 //______________________________________________________________________________
775 Int_t AliMpDDLStore::GetBusPatchId(Int_t detElemId, Int_t manuId) const {
776 /// Return bus patch for a given manuId
778 AliMpDetElement* detElement = GetDetElement(detElemId);
779 Int_t pos = GetBusPatchIndex(detElemId, manuId);
781 if ( pos > detElement->GetNofBusPatches() ) {
784 << " greater than the size = " << detElement->GetNofBusPatches()
785 << " for detElemId = " << detElemId
786 << " manuId = " << manuId << endl;
790 return detElement->GetBusPatchId(pos);
793 //______________________________________________________________________________
794 AliMpIntPair AliMpDDLStore::GetDetElemIdManu(Int_t manuSerial) const {
795 /// Return the detElemId and manuId for given serial manu number
797 if ( ! AliMpDEStore::Instance() ) {
798 AliFatal("DE Store has not been loaded.");
799 return AliMpIntPair::Invalid();
802 return AliMpDEStore::Instance()->GetDetElemIdManu(manuSerial);
805 //______________________________________________________________________________
806 void AliMpDDLStore::PrintAllManu() const {
807 /// Print all manu Ids and their serial numbers sorted by detection element
808 /// and bus patch. \n
809 /// As serial manu numbers are filled in a different way than manu Ids this
810 /// printing allows to check that both ways are consistent
814 for ( it.First(); ! it.IsDone(); it.Next() ) {
815 AliMpDetElement* de = it.CurrentDE();
816 cout << "DE: " << de->GetId() << endl;
818 // Loop over bus patches in this DE
819 for ( Int_t i=0; i< de->GetNofBusPatches(); ++i ) {
821 AliMpBusPatch* busPatch = GetBusPatch(de->GetBusPatchId(i));
822 cout << " busPatch: " << busPatch->GetId() << endl;
825 for ( Int_t j=0; j<busPatch->GetNofManus(); ++j ) {
826 cout << std::setw(6) << busPatch->GetManuId(j) << " ";
830 cout << " Manu serial: ";
831 for ( Int_t k=0; k<busPatch->GetNofManus(); ++k ) {
832 cout << std::setw(6) << de->GetManuSerialFromId(busPatch->GetManuId(k)) << " ";
839 //______________________________________________________________________________
840 Int_t AliMpDDLStore::GetNextDEfromLocalBoard(Int_t localBoardId, Int_t chamberId ) const {
841 /// return the next detection element in line
843 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
845 TString name(localBoard->GetName());
847 Int_t line = localBoard->GetPosition().GetFirst();
850 name.Replace(4,1,Form("%d", line));
853 if ((nextLocalId = GetLocalBoardId(name)))
854 return GetDEfromLocalBoard(nextLocalId, chamberId);
861 //______________________________________________________________________________
862 Int_t AliMpDDLStore::GetPreviousDEfromLocalBoard(Int_t localBoardId, Int_t chamberId) const {
863 /// return the previous detection element in line
865 AliMpLocalBoard* localBoard = GetLocalBoard(localBoardId);
867 TString name(localBoard->GetName());
869 Int_t line = localBoard->GetPosition().GetFirst();
872 name.Replace(4,1,Form("%d", line));
875 if ((prevLocalId = GetLocalBoardId(name)))
876 return GetDEfromLocalBoard(prevLocalId, chamberId);
882 //______________________________________________________________________________
883 void AliMpDDLStore::SetRegionalTrigger(const AliMpRegionalTrigger& regionalTrigger)
885 /// Replace the existing regional trigger with the given one
887 fRegionalTrigger = regionalTrigger;
889 // Remove the existing trigger DDLsf
890 fDDLs.RemoveAt(fgkNofDDLs+1);
891 fDDLs.RemoveAt(fgkNofDDLs);
893 // Set new trigger DDLs from new regional trigger