Skip to content

Commit

Permalink
ALIROOT-5455 - extend the range of "numbered" boards from 234 to 242 …
Browse files Browse the repository at this point in the history
…by adding the 8

  interface boards (in LocalTriggerBoard, TriggerStoreV1, TriggerCrateStore)

- LocalTriggerBoard

  - eliminated functions: Setbit, Set/Get X34 and Y (where doing copies without
    considering the masks of the destination board)

  - modified functions: SetbitM (simplified), GetNumber, IsNotified (the
    interface cards receive a number different from zero so they are identified
    by the function IsNotified)

- DigitMaker::ReadTriggerDDL - add all boards to the trigger store

                   ::TriggerDigits - for the interface boards, use instead of
                   their own number (> 234) the one of the board where they
                   receive the x-strip information from, since it is used in
                   functions which do not accept values larger then 234

- TriggerElectronics - eliminate the function SetCopyInput with the
                       corresponding variable containers

                   ::Feed(AliMUONDigitStore*) - introduce the case of the
                   columns with 22 boards in x-copy and take it out from
                   FeedCopyNeighbours

                   ::FeedCopyNeighbours - here fill only the (physical) up/down
                   boards

                   ::LoadMasks - read all masks from the calibration file
                   (interface boards included)

                   :: LocalResponse - use IsNotified instead of GetNumber to
                   identify the interface boards

                   ::Digits2Trigger - use all boards

- AliMUONTriggerQADataMakerRec
  - Fill the trigger information from all local structures (including copy
    boards)

- AliMUONTriggerUtilities
  - mask strip if ALL of the local boards reading it are masked

(Diego Stocco)
  • Loading branch information
bogdan authored and hristov committed May 26, 2014
1 parent 5e30c63 commit b0f947e
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 219 deletions.
26 changes: 14 additions & 12 deletions MUON/AliMUONDigitMaker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -360,21 +360,16 @@ AliMUONDigitMaker::ReadTriggerDDL(AliRawReader* rawReader)
// if card exist
if (localStruct) {

loCircuit = crate->GetLocalBoardId(localStruct->GetId());

if ( !loCircuit ) continue; // empty slot

AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, kTRUE);

// skip copy cards
if( !localBoard->IsNotified())
continue;
loCircuit = crate->GetLocalBoardId(localStruct->GetId());

if ( !loCircuit ) continue; // empty slot


if (fTriggerStore)
{
// fill local trigger
AliMUONLocalTrigger localTrigger;
localTrigger.SetLocalStruct(loCircuit, *localStruct);
localTrigger.SetLocalStruct(loCircuit, *localStruct);
fTriggerStore->Add(localTrigger);
}

Expand All @@ -383,8 +378,8 @@ AliMUONDigitMaker::ReadTriggerDDL(AliRawReader* rawReader)
//FIXEME should find something better than a TArray
TArrayS xyPattern[2];

localStruct->GetXPattern(xyPattern[0]);
localStruct->GetYPattern(xyPattern[1]);
localStruct->GetXPattern(xyPattern[0]);
localStruct->GetYPattern(xyPattern[1]);

TriggerDigits(loCircuit, xyPattern, *fDigitStore);
}
Expand All @@ -408,6 +403,13 @@ Int_t AliMUONDigitMaker::TriggerDigits(Int_t nBoard,
Int_t detElemId;

AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(nBoard);

if ( ! localBoard->IsNotified() ) {
// Copy board
// The mapping is not correct for copy boards
// Use the one of corresponding phyiscal board
nBoard = localBoard->GetInputXfrom();
}

Int_t n,b;

Expand Down
53 changes: 2 additions & 51 deletions MUON/AliMUONLocalTriggerBoard.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,6 @@ AliMUONLocalTriggerBoard::~AliMUONLocalTriggerBoard()
}


//___________________________________________
Int_t AliMUONLocalTriggerBoard::GetNumber() const
{
/// return board number for notified boards

if (fMpLocalBoard->IsNotified())
return fMpLocalBoard->GetId();
else
return 0;
}

//___________________________________________
void AliMUONLocalTriggerBoard::Reset()
{
Expand Down Expand Up @@ -249,50 +238,12 @@ void AliMUONLocalTriggerBoard::ResetResponse()
}


//___________________________________________
void AliMUONLocalTriggerBoard::Setbit(Int_t strip, Int_t cathode, Int_t chamber)
{
/// 0 .. LBS : N-1 .. MSB
TBits w, m;

UShort_t xy = fXY[cathode][chamber], mask = fMask[cathode][chamber];

w.Set(16,&xy);
m.Set(16,&mask);

Int_t s = strip - int(strip / 16) * 16;

w.SetBitNumber(s);

w &= m;

UShort_t value;

w.Get(&value);

fXY[cathode][chamber] = value;
}

//___________________________________________
void AliMUONLocalTriggerBoard::SetbitM(Int_t strip, Int_t cathode, Int_t chamber)
{
/// 0 .. LBS : N-1 .. MSB
TBits w, m;

UShort_t xy = fXY[cathode][chamber], mask = fMask[cathode][chamber];

w.Set(16,&xy);
m.Set(16,&mask);

w.SetBitNumber(strip);

w &= m;

UShort_t value;

w.Get(&value);

fXY[cathode][chamber] = value;
UShort_t stripBit = ( (1<<strip) & 0xFFFF );
fXY[cathode][chamber] |= ( stripBit & fMask[cathode][chamber] );
}


Expand Down
21 changes: 5 additions & 16 deletions MUON/AliMUONLocalTriggerBoard.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard
void SetLUT(AliMUONTriggerLut* lut) { fLUT = lut; }
/// Set Coinc 44 (0/1 = coinc34/coinc44)
void SetCoinc44(Int_t coinc44=0) { fCoinc44 = coinc44; }

virtual void Setbit(Int_t strip, Int_t cathode, Int_t chamber);

virtual void SetbitM(Int_t strip, Int_t cathode, Int_t chamber);

virtual void Pattern(const Option_t *option = "X Y") const; // default option displays X then Y bp
Expand All @@ -49,24 +48,14 @@ class AliMUONLocalTriggerBoard : public AliMUONTriggerBoard
virtual Bool_t GetTC() const {return fMpLocalBoard->GetTC();}

/// Return Board number
virtual Int_t GetNumber() const;
virtual Int_t GetNumber() const { return fMpLocalBoard->GetId(); }

/// Is notified (copy boards are not)
virtual Bool_t IsNotified() const { return fMpLocalBoard->IsNotified(); }

/// Return Crate name
virtual TString GetCrate() const {return fMpLocalBoard->GetCrate();}


/// Return X34
virtual void GetX34(UShort_t *X) const {for (Int_t i=0;i<2;i++) X[i] = fXY[0][i+2];}

/// Set X34
virtual void SetX34(UShort_t *X) {for (Int_t i=0;i<2;i++) fXY[0][i+2] = X[i];}

/// Return Y
virtual void GetY(UShort_t *Y) const {for (Int_t i=0;i<4;i++) Y[i] = fXY[1][i];}

/// Set Y
virtual void SetY(UShort_t *Y) {for (Int_t i=0;i<4;i++) fXY[1][i] = Y[i];}

/// Return XY
virtual void GetXY(UShort_t XY[2][4]) const {for (Int_t i=0;i<2;i++) for (Int_t j=0;j<4;j++) XY[i][j] = fXY[i][j];}

Expand Down
4 changes: 1 addition & 3 deletions MUON/AliMUONTriggerCrateStore.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ AliMUONTriggerCrateStore::ReadFromFile(AliMUONCalibrationData* calibData)
board->SetLUT(lut);


if (localBoardMapping->IsNotified()) {
fLocalBoards->Add(localBoardId, board);
}
fLocalBoards->Add(localBoardId, board);

crate->AddBoard(board, slot);

Expand Down
131 changes: 13 additions & 118 deletions MUON/AliMUONTriggerElectronics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,13 @@ AliMUONTriggerElectronics::AliMUONTriggerElectronics(AliMUONCalibrationData* cal
/// CONSTRUCTOR
///

for (Int_t i = 0; i < 2; ++i) {
fCopyXInput[i] = new TList();
fCopyXInput[i]->SetOwner();
fCopyYInput[i] = new TList();
fCopyYInput[i]->SetOwner();
}

// force loading of mapping if not already done
if ( !AliMpDDLStore::Instance(kFALSE) )
{
AliMpCDB::LoadDDLStore();
}

SetCopyInput();

Factory(calibData);
LoadMasks(calibData);
Expand All @@ -105,61 +98,7 @@ AliMUONTriggerElectronics::~AliMUONTriggerElectronics()
///
delete fGlobalTriggerBoard;
delete fCrates;
for (Int_t i = 0; i < 2; ++i) {
delete fCopyXInput[i];
delete fCopyYInput[i];
}

}

//___________________________________________
void AliMUONTriggerElectronics::SetCopyInput()
{
/// set list of copy input

for (Int_t iDDL = 0; iDDL < 2; ++iDDL) {

for(Int_t iReg = 0; iReg < 8; ++iReg){ //reg loop

AliMpTriggerCrate* crateMapping = AliMpDDLStore::Instance()->GetTriggerCrate(iDDL, iReg);

for(Int_t iLocal = 0; iLocal < crateMapping->GetNofLocalBoards(); ++iLocal) {

Int_t localBoardFromId = crateMapping->GetLocalBoardId(iLocal);
if (!localBoardFromId) continue; //empty slot, should not happen

AliMpLocalBoard* localBoardFrom = AliMpDDLStore::Instance()->GetLocalBoard(localBoardFromId);
Int_t localBoardToId;
if ((localBoardToId = localBoardFrom->GetInputXto())) {
AliMpLocalBoard* localBoardTo = AliMpDDLStore::Instance()->GetLocalBoard(localBoardToId);
TString crateFrom = localBoardFrom->GetCrate();
Int_t slotFrom = localBoardFrom->GetSlot();
TString crateTo = localBoardTo->GetCrate();
Int_t slotTo = localBoardTo->GetSlot();

fCopyXInput[0]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateFrom), slotFrom));
fCopyXInput[1]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateTo), slotTo));
AliDebug(3, Form("copy xInputs from local %s_%d to %s_%d\n", crateFrom.Data(), slotFrom,
crateTo.Data(), slotTo));
}

if ((localBoardToId = localBoardFrom->GetInputYto())) {
AliMpLocalBoard* localBoardTo = AliMpDDLStore::Instance()->GetLocalBoard(localBoardToId);
TString crateFrom = localBoardFrom->GetCrate();
Int_t slotFrom = localBoardFrom->GetSlot();
TString crateTo = localBoardTo->GetCrate();
Int_t slotTo = localBoardTo->GetSlot();

fCopyYInput[0]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateFrom), slotFrom));
fCopyYInput[1]->Add(new AliMpIntPair(AliMpExMap::GetIndex(crateTo), slotTo));
AliDebug(3, Form("copy yInputs from local %s_%d to %s_%d\n", crateFrom.Data(), slotFrom,
crateTo.Data(), slotTo));

}

}
}
}
}

//___________________________________________
Expand Down Expand Up @@ -220,6 +159,17 @@ void AliMUONTriggerElectronics::Feed(const AliMUONVDigitStore& digitStore)
if (cathode && b->GetSwitch(AliMpLocalBoard::kZeroAllYLSB)) ibitxy += 8;

b->SetbitM(ibitxy,cathode,ichamber-10);

if ( cathode == 0 ) {
// Particular case of the columns with 22 local boards (2R(L) 3R(L))
// Fill copy boards
AliMpLocalBoard* mpLocalBoard = AliMpDDLStore::Instance()->GetLocalBoard(nboard);
Int_t nboardCopy = mpLocalBoard->GetInputXto();
if ( nboardCopy > 0 ) {
AliMUONLocalTriggerBoard* copyBoard = fCrates->LocalBoard(nboardCopy);
copyBoard->SetbitM(ibitxy,cathode,ichamber-10);
}
}
}
else
{
Expand All @@ -240,58 +190,6 @@ void AliMUONTriggerElectronics::FeedCopyNeighbours()
/// Feed the local copies
/// and complete the feed with the information of neighbours
//

// Particular case of the columns with 22 local boards (2R(L) 3R(L))
// fill copy input from mapping instead of hardcoded valued (Ch.F)
AliMUONTriggerCrate *crate = 0x0; TObjArray *bs = 0x0;

for (Int_t i = 0; i < fCopyXInput[0]->GetEntries(); ++i)
{
AliMpIntPair* pair = (AliMpIntPair*)fCopyXInput[0]->At(i);
TString crateFrom = AliMpExMap::GetString(pair->GetFirst());
Int_t slotFrom = pair->GetSecond();

pair = (AliMpIntPair*)fCopyXInput[1]->At(i);
TString crateTo = AliMpExMap::GetString(pair->GetFirst());
Int_t slotTo = pair->GetSecond();

AliDebug(3, Form("copy xInputs from local %s_%d to %s_%d\n", crateFrom.Data(), slotFrom,
crateTo.Data(), slotTo));

UShort_t cX[2];
crate = fCrates->Crate(crateFrom);
bs = crate->Boards();
AliMUONLocalTriggerBoard *fromxb = (AliMUONLocalTriggerBoard*)bs->At(slotFrom);
crate = fCrates->Crate(crateTo);
bs = crate->Boards();
AliMUONLocalTriggerBoard *desxb = (AliMUONLocalTriggerBoard*)bs->At(slotTo);
fromxb->GetX34(cX); desxb->SetX34(cX);


}

for (Int_t i = 0; i < fCopyYInput[0]->GetEntries(); ++i)
{
AliMpIntPair* pair = (AliMpIntPair*)fCopyYInput[0]->At(i);
TString crateFrom = AliMpExMap::GetString(pair->GetFirst());
Int_t slotFrom = pair->GetSecond();

pair = (AliMpIntPair*)fCopyYInput[1]->At(i);
TString crateTo = AliMpExMap::GetString(pair->GetFirst());
Int_t slotTo = pair->GetSecond();

AliDebug(3, Form("copy yInputs from local %s_%d to %s_%d\n", crateFrom.Data(), slotFrom,
crateTo.Data(), slotTo));

UShort_t cY[4];
crate = fCrates->Crate(crateFrom);
bs = crate->Boards();
AliMUONLocalTriggerBoard *fromyb = (AliMUONLocalTriggerBoard*)bs->At(slotFrom);
crate = fCrates->Crate(crateTo);
bs = crate->Boards();
AliMUONLocalTriggerBoard *desyb = (AliMUONLocalTriggerBoard*)bs->At(slotTo);
fromyb->GetY(cY); desyb->SetY(cY);
}

// FILL UP/DOWN OF CURRENT BOARD (DONE VIA J3 BUS IN REAL LIFE)
AliMUONTriggerCrate* cr;
Expand Down Expand Up @@ -467,7 +365,7 @@ void AliMUONTriggerElectronics::LoadMasks(AliMUONCalibrationData* calibData)

Int_t cardNumber = b->GetNumber();

if (cardNumber) // interface board are not interested
if (cardNumber) // skip empty slots
{
AliMUONVCalibParam* localBoardMasks = calibData->LocalTriggerBoardMasks(cardNumber);
for ( Int_t i = 0; i < localBoardMasks->Size(); ++i )
Expand Down Expand Up @@ -527,7 +425,7 @@ void AliMUONTriggerElectronics::LocalResponse()
UShort_t response = board->GetResponse();

// CRATE CONTAINING INTERFACE BOARD
if (board->GetNumber() == 0) // copy boards
if (!board->IsNotified()) // copy boards
{
if ( response != 0 )
AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
Expand Down Expand Up @@ -657,8 +555,6 @@ void AliMUONTriggerElectronics::Digits2Trigger(const AliMUONVDigitStore& digitSt
// {

Int_t icirc = board->GetNumber();
if (icirc != 0) { // pcrochet 181206: MOOD needs ALL boards

localTrigger.SetLoCircuit(icirc);
localTrigger.SetLoStripX(board->GetStripX11());
localTrigger.SetLoDev(board->GetDev());
Expand Down Expand Up @@ -696,7 +592,6 @@ void AliMUONTriggerElectronics::Digits2Trigger(const AliMUONVDigitStore& digitSt
triggerStore.Add(localTrigger);

}
}
}
pRegTrig.SetId(iReg + 8*iSide);
pRegTrig.SetLocalOutput(regInpLpt, 0);
Expand Down
6 changes: 1 addition & 5 deletions MUON/AliMUONTriggerElectronics.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,9 @@ class AliMUONTriggerElectronics : public TObject
AliMUONTriggerElectronics& operator = (const AliMUONTriggerElectronics& right);

void FeedCopyNeighbours();

/// set copy card array
void SetCopyInput();


private:
TList* fCopyXInput[2]; ///< list of copy X input from local to local board
TList* fCopyYInput[2]; ///< list of copy Y input from local to local board
AliMUONTriggerCrateStore *fCrates; ///< Crate array
AliMUONGlobalTriggerBoard *fGlobalTriggerBoard; ///< Global trigger board

Expand Down
Loading

0 comments on commit b0f947e

Please sign in to comment.