bug found (Bogdan), located (Philippe) and fixed (Christian)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerElectronics.cxx
CommitLineData
516d3280 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18//*-- Author: Rachid Guernane (LPCCFd)
f4678817 19//* Manager class for muon trigger electronics
20//* Client of trigger board classes
21//*
22//*
516d3280 23
24#include "AliMUONTriggerElectronics.h"
25#include "AliMUONTriggerCrate.h"
f1e8d46c 26#include "AliMUONTriggerCrateStore.h"
516d3280 27#include "AliMUONConstants.h"
28#include "AliMUONLocalTriggerBoard.h"
29#include "AliMUONRegionalTriggerBoard.h"
30#include "AliMUONGlobalTriggerBoard.h"
31#include "AliMUONLocalTrigger.h"
47dc4ee7 32#include "AliMUONRegionalTrigger.h"
516d3280 33#include "AliMUONGlobalTrigger.h"
8af755f4 34#include "AliMUON.h"
516d3280 35#include "AliMUONData.h"
36#include "AliMUONDigit.h"
8af755f4 37#include "AliMUONSegmentation.h"
4c0f0f5d 38#include "AliMUONCalibrationData.h"
39#include "AliMUONVCalibParam.h"
516d3280 40
666ada1e 41#include "AliMpSegmentation.h"
f4678817 42#include "AliMpVSegmentation.h"
43
44#include "AliLog.h"
45#include "AliLoader.h"
46#include "AliRun.h"
47
48//#include "Riostream.h"
49#include "TBits.h"
516d3280 50#include "TSystem.h"
51
6014107b 52/// \cond CLASSIMP
63ed9c6b 53ClassImp(AliMUONTriggerElectronics)
6014107b 54/// \endcond
63ed9c6b 55
516d3280 56//___________________________________________
4c0f0f5d 57AliMUONTriggerElectronics::AliMUONTriggerElectronics(AliMUONData *Data, AliMUONCalibrationData* calibData)
516d3280 58: TTask("AliMUONTriggerElectronics",
59 "From trigger digits to Local and Global Trigger objects"),
43368512 60 fSourceFileName(),
f1e8d46c 61 fCrates(new AliMUONTriggerCrateStore),
516d3280 62 fGlobalTriggerBoard(new AliMUONGlobalTriggerBoard),
1908473e 63 fMUONData(Data),
64 fLocalTrigger(new AliMUONLocalTrigger()),
65 fGlobalTrigger(new AliMUONGlobalTrigger())
66
516d3280 67{
6014107b 68/// CONSTRUCTOR
69///
516d3280 70 if (!fMUONData)
71 {
72 AliFatal("NO MUON TRIGGER DATA");
73 }
74
f1e8d46c 75 SetDataSource();
76 Factory(calibData);
77 LoadMasks(calibData);
516d3280 78}
79
80//___________________________________________
81AliMUONTriggerElectronics::~AliMUONTriggerElectronics()
82{
6014107b 83/// DESTRUCTOR
84///
516d3280 85 delete fGlobalTriggerBoard;
86 delete fCrates;
1908473e 87 delete fLocalTrigger;
88 delete fGlobalTrigger;
89
516d3280 90}
91
92//___________________________________________
4c0f0f5d 93void AliMUONTriggerElectronics::Factory(AliMUONCalibrationData* calibData)
516d3280 94{
6014107b 95 /// BUILD ALL ELECTRONICS
96 ///
e93b11d0 97
98// get coinc44 from AliMUON (added 12/09/06)
99 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
100 Int_t coinc44 = pMUON->GetTriggerCoinc44();
101 if (coinc44 != 0 && coinc44 != 1) {
102 AliFatal("Coinc 44 should be equal to 0 or 1");
103 return;
104 }
105
f1e8d46c 106 fCrates->ReadFromFile(gSystem->ExpandPathName(fSourceFileName.Data()));
107
108 if ( !calibData ) return;
109
110 AliMUONTriggerLut* lut = calibData->TriggerLut();
111
112 if (!lut) return;
113
114 AliMUONLocalTriggerBoard* localBoard;
115
116 fCrates->FirstLocalBoard();
117
118 while ( (localBoard=fCrates->NextLocalBoard()) )
119 {
120 localBoard->SetLUT(lut);
e93b11d0 121 localBoard->SetCoinc44(coinc44);
f1e8d46c 122 }
8af755f4 123}
516d3280 124
8af755f4 125//___________________________________________
126void AliMUONTriggerElectronics::FeedM()
127{
6014107b 128/// FILL INPUTS
129///
43368512 130 for (Int_t ichamber=10; ichamber<14; ichamber++)
131 {
f4678817 132 TClonesArray *muonDigits = fMUONData->Digits(ichamber);
133 Int_t ndigits = muonDigits->GetEntriesFast();
8af755f4 134
8af755f4 135 for (Int_t digit=0; digit<ndigits; digit++)
43368512 136 {
137 AliMUONDigit *mdig = static_cast<AliMUONDigit*>(muonDigits->UncheckedAt(digit));
8af755f4 138
43368512 139 // CHECKME ! The TrackCharge is not ok with new digitizerV3 !
140 // for (Int_t ichg=0; ichg<10; ichg++) schg += mdig->TrackCharge(ichg);
141 // assert(schg==mdig->Signal());
8d4fefab 142 Int_t schg = (Int_t)(mdig->Signal() + 0.5);
516d3280 143
43368512 144 // APPLY CONDITION ON SOFT BACKGROUND
145 Int_t tchg = schg - (Int_t(schg/10))*10;
516d3280 146
43368512 147 if (schg<=10 || tchg>0)
148 {
149 // mdig->Print();
516d3280 150
43368512 151 Int_t detElemId = mdig->DetElemId();
152 Int_t cathode = mdig->Cathode();
8af755f4 153
43368512 154 const AliMpVSegmentation *seg =
666ada1e 155 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode);
8af755f4 156
43368512 157 Int_t ix = mdig->PadX(), iy = mdig->PadY();
8af755f4 158
43368512 159 AliDebug(3,Form("cathode %d ix %d iy %d ",cathode,ix,iy));
8af755f4 160
43368512 161 AliMpPad pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
8af755f4 162
43368512 163 for (Int_t i=0; i<pad.GetNofLocations(); i++)
164 {
165 AliMpIntPair location = pad.GetLocation(i);
8af755f4 166
43368512 167 Int_t nboard = location.GetFirst();
8af755f4 168
43368512 169 Int_t ibitxy = location.GetSecond();
8af755f4 170
43368512 171 AliMUONLocalTriggerBoard *b = fCrates->LocalBoard(nboard);
8af755f4 172
43368512 173 if (b)
174 {
175 if (cathode && b->GetSwitch(6)) ibitxy += 8;
8af755f4 176
43368512 177 b->SetbitM(ibitxy,cathode,ichamber-10);
8af755f4 178
43368512 179 }
180 else
181 {
182 AliError(Form("Could not get local board number %d",b->GetNumber()));
183 }
184 }
185 }
186 }
187 }
8af755f4 188
43368512 189 // Particular case of the columns with 22 local boards (2R(L) 3R(L))
190 AliMUONTriggerCrate *crate = 0x0; TObjArray *bs = 0x0;
8af755f4 191
43368512 192 char *scratess[4] = { "2R", "2L", "3L", "3R"};
193 char *scratesd[4] = {"2-3R", "2-3L", "2-3L", "2-3R"};
194 Int_t slotf[4] = { 2, 2, 10, 10};
195 Int_t slotd[4] = { 1, 1, 9, 9};
8af755f4 196
43368512 197 for (Int_t i = 0; i < 4; i++)
198 {
f1e8d46c 199 crate = fCrates->Crate(scratess[i]);
8af755f4 200 bs = crate->Boards();
201 AliMUONLocalTriggerBoard *desybb = (AliMUONLocalTriggerBoard*)bs->At(14);
202 AliMUONLocalTriggerBoard *fromcb = (AliMUONLocalTriggerBoard*)bs->At(15);
203 AliMUONLocalTriggerBoard *desxbb = (AliMUONLocalTriggerBoard*)bs->At(16);
204
f1e8d46c 205 crate = fCrates->Crate(scratesd[i]);
8af755f4 206 bs = crate->Boards();
207 AliMUONLocalTriggerBoard *frombb = (AliMUONLocalTriggerBoard*)bs->At(slotf[i]);
208 AliMUONLocalTriggerBoard *desycb = (AliMUONLocalTriggerBoard*)bs->At(slotd[i]);
209
210 UShort_t cX[2];
211
43368512 212 // COPY X3-4 FROM BOARD 2 OF CRATE 2-3 TO BOARD 16 OF CRATE 2
213 // COPY X3-4 FROM BOARD 10 OF CRATE 2-3 TO BOARD 16 OF CRATE 3
8af755f4 214 frombb->GetX34(cX); desxbb->SetX34(cX);
215
43368512 216 // COPY X3-4 FROM BOARD 15 OF CRATE 2 TO BOARD 1 OF CRATE 2-3
217 // COPY X3-4 FROM BOARD 15 OF CRATE 3 TO BOARD 9 OF CRATE 2-3
8af755f4 218 fromcb->GetX34(cX); desycb->SetX34(cX);
219
220 UShort_t cY[4];
221
222 desybb->GetY(cY); frombb->SetY(cY);
223
224 frombb->GetY(cY); desxbb->SetY(cY);
225 fromcb->GetY(cY); desycb->SetY(cY);
43368512 226 }
8af755f4 227
43368512 228 // FILL UP/DOWN OF CURRENT BOARD (DONE VIA J3 BUS IN REAL LIFE)
229 AliMUONTriggerCrate* cr;
f1e8d46c 230
43368512 231 fCrates->FirstCrate();
f1e8d46c 232
43368512 233 while ( ( cr = fCrates->NextCrate() ) )
234 {
235 TObjArray *boards = cr->Boards();
8af755f4 236
43368512 237 for (Int_t j = 1; j < boards->GetEntries()-1; j++)
238 {
239 TObject *o = boards->At(j);
8af755f4 240
43368512 241 if (!o) break;
8af755f4 242
43368512 243 AliMUONLocalTriggerBoard *currboard = (AliMUONLocalTriggerBoard*)o;
8af755f4 244
43368512 245 AliMUONLocalTriggerBoard *neighbour = (AliMUONLocalTriggerBoard*)boards->At(j+1);
8af755f4 246
43368512 247 UShort_t cXY[2][4];
8af755f4 248
43368512 249 if (j==1) {neighbour->GetXY(cXY); currboard->SetXYU(cXY);}
8af755f4 250
43368512 251 // LAST BOARD IN THE CRATE HAS NO UP EXCEPT FOR CRATES 2 & 3
252 if (j < boards->GetEntries()-2)
253 {
254 AliMUONLocalTriggerBoard *nextboard = (AliMUONLocalTriggerBoard*)boards->At(j+2);
8af755f4 255
43368512 256 currboard->GetXY(cXY); neighbour->SetXYD(cXY);
257 nextboard->GetXY(cXY); neighbour->SetXYU(cXY);
8af755f4 258
43368512 259 if (j==boards->GetEntries()-3) {neighbour->GetXY(cXY); nextboard->SetXYD(cXY);}
260 }
261 }
262 }
516d3280 263}
516d3280 264
265//___________________________________________
266void AliMUONTriggerElectronics::Feed(UShort_t pattern[2][4])
267{
6014107b 268 /// FILL INPUTS
269 ///
f1e8d46c 270 AliMUONTriggerCrate* cr;
271
272 fCrates->FirstCrate();
273
274 while ( ( cr = fCrates->NextCrate() ) )
275 {
276 TObjArray *boards = cr->Boards();
277
43368512 278 for (Int_t j = 1; j < boards->GetEntries(); j++)
f1e8d46c 279 {
280 TObject *o = boards->At(j);
281
282 if (!o) break;
283
284 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
285
286 board->SetXY(pattern);
287 }
516d3280 288 }
289}
290
291//___________________________________________
292void AliMUONTriggerElectronics::DumpOS()
293{
6014107b 294/// DUMP IN THE OLD WAY
295///
43368512 296 for (Int_t i= 0; i < 234;i++)
516d3280 297 {
f1e8d46c 298 AliMUONLocalTriggerBoard *board = fCrates->LocalBoard(i);
516d3280 299
43368512 300 if (board) board->Scan("ALL");
516d3280 301 }
302}
303
304//___________________________________________
305void AliMUONTriggerElectronics::Scan(Option_t *option)
306{
6014107b 307 /// SCAN
308 ///
516d3280 309
f1e8d46c 310 AliMUONTriggerCrate* cr;
311
312 fCrates->FirstCrate();
313
314 while ( ( cr = fCrates->NextCrate() ) )
43368512 315 {
f1e8d46c 316 TObjArray *boards = cr->Boards();
317
43368512 318 for (Int_t j = 0; j < boards->GetEntries(); j++)
f1e8d46c 319 {
320 TObject *o = boards->At(j);
321
322 TString op = option;
323
324 Bool_t cdtion = kFALSE;
325
326 if (op.Contains("LOCAL")) cdtion = o->IsA() == AliMUONLocalTriggerBoard::Class();
327 if (op.Contains("REGIONAL")) cdtion = o->IsA() == AliMUONRegionalTriggerBoard::Class();
328 if (op.Contains("GLOBAL")) cdtion = o->IsA() == AliMUONGlobalTriggerBoard::Class();
329
330 if (!o || !cdtion) continue;
331
332 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
333
334 board->Scan();
335 }
336 }
516d3280 337}
338
339//___________________________________________
340void AliMUONTriggerElectronics::Reset()
341{
6014107b 342 /// RESET
343 ///
f1e8d46c 344
345 AliMUONTriggerCrate* cr;
346
347 fCrates->FirstCrate();
348
349 while ( ( cr = fCrates->NextCrate() ) )
516d3280 350 {
516d3280 351 TObjArray *boards = cr->Boards();
352
353 for (Int_t j=0; j<boards->GetEntries(); j++)
354 {
355 AliMUONTriggerBoard *b = (AliMUONTriggerBoard*)boards->At(j);
356
357 if (b) b->Reset();
358 }
359 }
360}
361
4c0f0f5d 362//_______________________________________________________________________
363void AliMUONTriggerElectronics::LoadMasks(AliMUONCalibrationData* calibData)
364{
365 // LOAD MASKS FROM CDB
366
367
368 // SET MASKS
f1e8d46c 369
370 AliMUONTriggerCrate* cr;
371
372 fCrates->FirstCrate();
373
374 Int_t irb(0);
375
376 while ( ( cr = fCrates->NextCrate() ) )
43368512 377 {
4c0f0f5d 378 TObjArray *boards = cr->Boards();
379
380 AliMUONRegionalTriggerBoard *regb =
381 (AliMUONRegionalTriggerBoard*)boards->At(0);
382
f1e8d46c 383 AliMUONVCalibParam* regionalBoardMasks = calibData->RegionalTriggerBoardMasks(irb);
4c0f0f5d 384
385 for ( Int_t i = 0; i < regionalBoardMasks->Size(); ++i )
386 {
387 UShort_t rmask = static_cast<UShort_t>(regionalBoardMasks->ValueAsInt(i) & 0x3F);
388 regb->Mask(i,rmask);
389 }
390
43368512 391 for (Int_t j = 1; j < boards->GetEntries(); j++)
4c0f0f5d 392 {
393 AliMUONLocalTriggerBoard *b = (AliMUONLocalTriggerBoard*)boards->At(j);
394
395 Int_t cardNumber = b->GetNumber();
396
397 if (cardNumber) // interface board are not interested
398 {
399 AliMUONVCalibParam* localBoardMasks = calibData->LocalTriggerBoardMasks(cardNumber);
400 for ( Int_t i = 0; i < localBoardMasks->Size(); ++i )
401 {
402 UShort_t lmask = static_cast<UShort_t>(localBoardMasks->ValueAsInt(i) & 0xFFFF);
403 b->Mask(i,lmask);
404 }
405 }
406 }
f1e8d46c 407 ++irb;
4c0f0f5d 408 }
409
410 AliMUONVCalibParam* globalBoardMasks = calibData->GlobalTriggerBoardMasks();
411 for ( Int_t i = 0; i < globalBoardMasks->Size(); ++i )
412 {
413 UShort_t gmask = static_cast<UShort_t>(globalBoardMasks->ValueAsInt(i) & 0xFFF);
414 fGlobalTriggerBoard->Mask(i,gmask);
415 }
416}
417
418
516d3280 419//___________________________________________
420void AliMUONTriggerElectronics::LocalResponse()
421{
6014107b 422/// \todo add comment
516d3280 423
f1e8d46c 424 AliMUONTriggerCrate* cr;
425
426 fCrates->FirstCrate();
427
428 while ( ( cr = fCrates->NextCrate() ) )
43368512 429 {
f1e8d46c 430
431 TObjArray *boards = cr->Boards();
432
433 AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
434
435 UShort_t thisl[16]; for (Int_t j=0; j<16; j++) thisl[j] = 0;
29e3f51e 436
437 for (Int_t j = 1; j < boards->GetEntries(); j++)
f1e8d46c 438 {
43368512 439 TObject *o = boards->At(j);
f1e8d46c 440
43368512 441 if (!o) break;
f1e8d46c 442
43368512 443 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
f1e8d46c 444
29e3f51e 445 if (board) // check if empty slot
43368512 446 {
447 board->Response();
516d3280 448
29e3f51e 449 UShort_t response = board->GetResponse();
f1e8d46c 450
29e3f51e 451 // CRATE CONTAINING INTERFACE BOARD
452 if (board->GetNumber() == 0) // copy boards
453 {
454 if ( response != 0 )
455 AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
43368512 456 board->GetName(),j,cr->GetName()));
29e3f51e 457 AliDebug(1, Form("local slot %d, number %d in crate %s\n", j, board->GetNumber(), cr->GetName()));
458
459 }
f1e8d46c 460
29e3f51e 461 thisl[j-1] = response;
43368512 462 }
516d3280 463 }
f1e8d46c 464
465 regb->SetLocalResponse(thisl);
466 }
516d3280 467}
468
469//___________________________________________
470void AliMUONTriggerElectronics::RegionalResponse()
471{
f1e8d46c 472 /// Compute the response for all regional cards.
473 AliMUONTriggerCrate* cr;
474
475 fCrates->FirstCrate();
476
477 while ( ( cr = fCrates->NextCrate() ) )
43368512 478 {
516d3280 479 TObjArray *boards = cr->Boards();
480
481 AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
482
483 if (regb)
484 {
485 regb->Response();
516d3280 486 }
487 }
488}
489
490//___________________________________________
491void AliMUONTriggerElectronics::GlobalResponse()
492{
f1e8d46c 493 /// Compute the global response
516d3280 494
f1e8d46c 495 UShort_t regional[16];
496
497 AliMUONTriggerCrate* cr;
498
499 fCrates->FirstCrate();
500 Int_t irb(0);
501
502 if ( !fCrates->NumberOfCrates() >= 16 )
503 {
504 AliFatal(Form("Something is wrong : too many crates %d",
505 fCrates->NumberOfCrates()));
506 }
507
508 while ( ( cr = fCrates->NextCrate() ) )
43368512 509 {
f1e8d46c 510 AliMUONTriggerBoard* rb =
511 static_cast<AliMUONTriggerBoard*>(cr->Boards()->At(0));
512 regional[irb] = rb->GetResponse();
513 ++irb;
514 }
515
516 fGlobalTriggerBoard->SetRegionalResponse(regional);
517 fGlobalTriggerBoard->Response();
516d3280 518}
519
516d3280 520//_______________________________________________________________________
521void
522AliMUONTriggerElectronics::Exec(Option_t*)
523{
6014107b 524/// \todo add comment
525///
516d3280 526 Digits2Trigger();
527}
528
529//_______________________________________________________________________
530void AliMUONTriggerElectronics::Trigger()
531{
6014107b 532/// \todo add comment
533///
8af755f4 534 FeedM();
516d3280 535 LocalResponse();
536 RegionalResponse();
537 GlobalResponse();
538}
516d3280 539
540//_______________________________________________________________________
516d3280 541void AliMUONTriggerElectronics::Digits2Trigger()
542{
f1e8d46c 543 /// Main method to go from digits to trigger decision
47dc4ee7 544 AliMUONRegionalTrigger *pRegTrig = new AliMUONRegionalTrigger();
f1e8d46c 545 fMUONData->ResetTrigger();
f1e8d46c 546 // RUN THE FULL BEE CHAIN
547 Trigger();
68ee8c5e 548// DumpOS();
8af755f4 549
f1e8d46c 550 AliMUONTriggerCrate* cr;
6a6a56b4 551
552 // stored in right order
553 // do not used iterator order
68ee8c5e 554
6a6a56b4 555 for (Int_t iSide = 0; iSide < 2; iSide++) // right & left side
f1e8d46c 556 {
6a6a56b4 557 for (Int_t iReg = 0; iReg < 8; iReg++) // 8 crates/regional boards for each side.
558 {
559 cr = fCrates->Crate(iSide, iReg);
560 TObjArray *boards = cr->Boards();
47dc4ee7 561
6a6a56b4 562 UInt_t regInpLpt = 0;
563 UInt_t regInpHpt = 0;
564 UShort_t localMask = 0x0;
47dc4ee7 565
6a6a56b4 566 AliMUONRegionalTriggerBoard *regBoard = (AliMUONRegionalTriggerBoard*)boards->At(0);
47dc4ee7 567
6a6a56b4 568 for (Int_t j = 1; j < boards->GetEntries(); j++)
569 {
570 TObject *o = boards->At(j);
f1e8d46c 571
6a6a56b4 572 if (!o) break;
f1e8d46c 573
6a6a56b4 574 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
f1e8d46c 575
6a6a56b4 576 if (board)
577 {
578 // L0 TRIGGER
579 if (board->Triggered())
580 {
f1e8d46c 581
6a6a56b4 582 Int_t icirc = board->GetNumber();
68ee8c5e 583
6a6a56b4 584 fLocalTrigger->SetLoCircuit(icirc);
585 fLocalTrigger->SetLoStripX(board->GetStripX11());
586 fLocalTrigger->SetLoDev(board->GetDev());
587 fLocalTrigger->SetLoStripY(board->GetStripY11());
f1e8d46c 588
6a6a56b4 589 // SAVE LUT OUTPUT
590 UShort_t response = board->GetResponse();
591 fLocalTrigger->SetLoHpt((response & 12) >> 2);
592 fLocalTrigger->SetLoLpt(response & 3);
593
594 // calculates regional inputs from local for the moment
595 UInt_t hPt = (response >> 4) & 0x3;
596 UInt_t lPt = (response >> 2) & 0x3;
47dc4ee7 597
6a6a56b4 598 regInpHpt |= hPt << (30 - (j-1)*2);
599 regInpLpt |= lPt << (30 - (j-1)*2);
600 localMask |= (0x1 << (j-1)); // local mask
47dc4ee7 601
6a6a56b4 602 TBits rrr;
603 rrr.Set(6,&response);
f1e8d46c 604
6a6a56b4 605 // SAVE BIT PATTERN
606 fLocalTrigger->SetX1Pattern(board->GetXY(0,0));
607 fLocalTrigger->SetX2Pattern(board->GetXY(0,1));
608 fLocalTrigger->SetX3Pattern(board->GetXY(0,2));
609 fLocalTrigger->SetX4Pattern(board->GetXY(0,3));
f1e8d46c 610
6a6a56b4 611 fLocalTrigger->SetY1Pattern(board->GetXY(1,0));
612 fLocalTrigger->SetY2Pattern(board->GetXY(1,1));
613 fLocalTrigger->SetY3Pattern(board->GetXY(1,2));
614 fLocalTrigger->SetY4Pattern(board->GetXY(1,3));
f1e8d46c 615
6a6a56b4 616 // ADD A NEW LOCAL TRIGGER
617 fMUONData->AddLocalTrigger(*fLocalTrigger);
68ee8c5e 618
6a6a56b4 619 }
620 }
516d3280 621 }
6a6a56b4 622 pRegTrig->SetLocalOutput(regInpLpt, 0);
623 pRegTrig->SetLocalOutput(regInpHpt, 1);
624 pRegTrig->SetLocalMask(localMask);
625 pRegTrig->SetOutput((regBoard->GetResponse() >> 4) & 0xF); // to be uniformized (oct06 ?)
47dc4ee7 626
6a6a56b4 627 fMUONData->AddRegionalTrigger(*pRegTrig);
628 }
f1e8d46c 629 }
47dc4ee7 630 delete pRegTrig;
f1e8d46c 631
1908473e 632 // GLOBAL TRIGGER INFORMATION
f1e8d46c 633 UShort_t global = fGlobalTriggerBoard->GetResponse();
8d4fefab 634 fGlobalTrigger->SetFromGlobalResponse(global);
635
f1e8d46c 636
637 // ADD A LOCAL TRIGGER IN THE LIST
1908473e 638 fMUONData->AddGlobalTrigger(*fGlobalTrigger);
47dc4ee7 639
f1e8d46c 640 // NOW RESET ELECTRONICS
641 Reset();
516d3280 642}
643