// 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);
}
//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);
}
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;
}
-//___________________________________________
-Int_t AliMUONLocalTriggerBoard::GetNumber() const
-{
-/// return board number for notified boards
-
- if (fMpLocalBoard->IsNotified())
- return fMpLocalBoard->GetId();
- else
- return 0;
-}
-
//___________________________________________
void AliMUONLocalTriggerBoard::Reset()
{
}
-//___________________________________________
-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] );
}
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
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];}
board->SetLUT(lut);
- if (localBoardMapping->IsNotified()) {
- fLocalBoards->Add(localBoardId, board);
- }
+ fLocalBoards->Add(localBoardId, board);
crate->AddBoard(board, slot);
/// 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);
///
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));
-
- }
-
- }
- }
- }
}
//___________________________________________
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
{
/// 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;
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 )
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",
// {
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());
triggerStore.Add(localTrigger);
}
- }
}
pRegTrig.SetId(iReg + 8*iSide);
pRegTrig.SetLocalOutput(regInpLpt, 0);
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
Int_t loCircuit = crate->GetLocalBoardId(localStruct->GetId());
if ( !loCircuit ) continue; // empty slot
-
+
AliMpLocalBoard* localBoard = AliMpDDLStore::Instance()->GetLocalBoard(loCircuit, false);
nBoardsInReg++; // Not necessary when regional output will work
countAllBoards++;
- // skip copy cards
- if( !localBoard->IsNotified())
- continue;
-
AliMUONLocalTrigger inputLocalTrigger;
inputLocalTrigger.SetLocalStruct(loCircuit, *localStruct);
fTriggerStoreFromRaw->Add(inputLocalTrigger);
//Get regional inputs -> not checked, hardware read-out doesn't work
//fTriggerInputRegionalDataLPt[0][loCircuit]=Int_t(((regHeader->GetInput(0))>>(2*iLocal))&1);
//fTriggerInputRegionalDataLPt[1][loCircuit]=Int_t(((regHeader->GetInput(1))>>((2*iLocal)+1))&1);
+
+ if ( ! localBoard->IsNotified() ) continue;
//Get local in/outputs
if (Int_t(localStruct->GetDec())!=0){
while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) )
{
loCircuit = recoLocalTrigger->LoCircuit();
+ // FIXME: skip copy boards for the moment
+ if ( loCircuit > AliMUONConstants::NTriggerCircuit() ) continue;
Int_t iboard = loCircuit - 1;
FillRawsData(AliMUONQAIndices::kTriggerErrorLocalYCopyTest,loCircuit);
while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) )
{
loCircuit = recoLocalTrigger->LoCircuit();
+ // FIXME: skip copy boards for the moment
+ if ( loCircuit > AliMUONConstants::NTriggerCircuit() ) continue;
Int_t iboard = loCircuit - 1;
AliMUONLocalTrigger* inputLocalTrigger = fTriggerStoreFromRaw->FindLocal(loCircuit);
//_____________________________________________________________________________
AliMUONTriggerStoreV1::AliMUONTriggerStoreV1() : AliMUONVTriggerStore(),
-fLocal(new TClonesArray("AliMUONLocalTrigger",234)),
+fLocal(new TClonesArray("AliMUONLocalTrigger",242)),
fRegional(new TClonesArray("AliMUONRegionalTrigger",16)),
fGlobal(new TClonesArray("AliMUONGlobalTrigger",1)),
-fEmptyLocal(new TClonesArray("AliMUONLocalTrigger",234))
+fEmptyLocal(new TClonesArray("AliMUONLocalTrigger",242))
{
/// ctor
fLocal->SetOwner(kTRUE);
}
}
- if ( boardNumber>=1 && boardNumber<=234 )
+ if ( boardNumber>=1 && boardNumber<=242 )
{
AliMUONLocalTrigger empty;
empty.SetLoCircuit(boardNumber);
AliMUONDigitStoreV2R digitStore, digitStorePart;
AliMUONTriggerStoreV1 triggerStore, triggerStorePart;
-// // In the trigger logic, when the regional input is masked in the
TArrayI activeBoards(AliMUONConstants::NTriggerCircuit());
// for (Int_t iSide = 0; iSide < 2; iSide++) // right & left side
// {
Int_t detElemId = dig->DetElemId();
Int_t board = dig->ManuId();
Int_t strip = dig->ManuChannel();
- AliMUONVDigit* currDigit = 0x0;
- if ( activeBoards[board-1] == 1 ) currDigit = digitStoreMasked.FindObject(detElemId, board, strip, cath);
+ AliMUONVDigit* currDigit = digitStoreMasked.FindObject(detElemId, board, strip, cath);
+ Int_t ich = detElemId/100-11;
+ const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, AliMp::GetCathodType(cath));
+ AliMpPad pad = seg->PadByIndices(dig->PadX(), dig->PadY(), kTRUE);
Bool_t isMasked = ( currDigit ) ? kFALSE : kTRUE;
+
+ if ( currDigit ) {
+ // Check if board is active
+ // For the non-bending plane the digit is created for the first board only
+ // The first board may be masked, but there may be some boards which are not.
+ // If so, the strip won't be masked, so we should keep it
+ Bool_t allBoardsMasked = kTRUE;
+ for (Int_t iloc=0; iloc<pad.GetNofLocations(); iloc++) {
+ Int_t currBoard = pad.GetLocalBoardId(iloc);
+ if ( activeBoards[currBoard-1] == 1 ) {
+ allBoardsMasked = kFALSE;
+ break;
+ }
+ }
+ isMasked = allBoardsMasked;
+ }
+
if ( isMasked ) fMaskedDigitsStore->Add(*((AliMUONVDigit*)dig->Clone()), AliMUONVDigitStore::kDeny);
else {
- Int_t ich = detElemId/100-11;
- const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, AliMp::GetCathodType(cath));
- AliMpPad pad = seg->PadByIndices(dig->PadX(), dig->PadY(), kTRUE);
for (Int_t iloc=0; iloc<pad.GetNofLocations(); iloc++) {
Int_t currBoard = pad.GetLocalBoardId(iloc);
Int_t arrayIndex = GetArrayIndex(cath, ich, currBoard);