Removing use of assert
[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 {
64860867 72 AliWarning("NO MUON TRIGGER DATA");
516d3280 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);
8d4fefab 141 Int_t schg = (Int_t)(mdig->Signal() + 0.5);
516d3280 142
43368512 143 // APPLY CONDITION ON SOFT BACKGROUND
144 Int_t tchg = schg - (Int_t(schg/10))*10;
516d3280 145
43368512 146 if (schg<=10 || tchg>0)
147 {
148 // mdig->Print();
516d3280 149
43368512 150 Int_t detElemId = mdig->DetElemId();
151 Int_t cathode = mdig->Cathode();
8af755f4 152
43368512 153 const AliMpVSegmentation *seg =
666ada1e 154 AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode);
8af755f4 155
43368512 156 Int_t ix = mdig->PadX(), iy = mdig->PadY();
8af755f4 157
43368512 158 AliDebug(3,Form("cathode %d ix %d iy %d ",cathode,ix,iy));
8af755f4 159
43368512 160 AliMpPad pad = seg->PadByIndices(AliMpIntPair(ix,iy),kTRUE);
8af755f4 161
43368512 162 for (Int_t i=0; i<pad.GetNofLocations(); i++)
163 {
164 AliMpIntPair location = pad.GetLocation(i);
8af755f4 165
43368512 166 Int_t nboard = location.GetFirst();
8af755f4 167
43368512 168 Int_t ibitxy = location.GetSecond();
8af755f4 169
43368512 170 AliMUONLocalTriggerBoard *b = fCrates->LocalBoard(nboard);
8af755f4 171
43368512 172 if (b)
173 {
174 if (cathode && b->GetSwitch(6)) ibitxy += 8;
8af755f4 175
43368512 176 b->SetbitM(ibitxy,cathode,ichamber-10);
8af755f4 177
43368512 178 }
179 else
180 {
181 AliError(Form("Could not get local board number %d",b->GetNumber()));
182 }
183 }
184 }
185 }
186 }
8af755f4 187
43368512 188 // Particular case of the columns with 22 local boards (2R(L) 3R(L))
189 AliMUONTriggerCrate *crate = 0x0; TObjArray *bs = 0x0;
8af755f4 190
43368512 191 char *scratess[4] = { "2R", "2L", "3L", "3R"};
192 char *scratesd[4] = {"2-3R", "2-3L", "2-3L", "2-3R"};
193 Int_t slotf[4] = { 2, 2, 10, 10};
194 Int_t slotd[4] = { 1, 1, 9, 9};
8af755f4 195
43368512 196 for (Int_t i = 0; i < 4; i++)
197 {
f1e8d46c 198 crate = fCrates->Crate(scratess[i]);
8af755f4 199 bs = crate->Boards();
200 AliMUONLocalTriggerBoard *desybb = (AliMUONLocalTriggerBoard*)bs->At(14);
201 AliMUONLocalTriggerBoard *fromcb = (AliMUONLocalTriggerBoard*)bs->At(15);
202 AliMUONLocalTriggerBoard *desxbb = (AliMUONLocalTriggerBoard*)bs->At(16);
203
f1e8d46c 204 crate = fCrates->Crate(scratesd[i]);
8af755f4 205 bs = crate->Boards();
206 AliMUONLocalTriggerBoard *frombb = (AliMUONLocalTriggerBoard*)bs->At(slotf[i]);
207 AliMUONLocalTriggerBoard *desycb = (AliMUONLocalTriggerBoard*)bs->At(slotd[i]);
208
209 UShort_t cX[2];
210
43368512 211 // COPY X3-4 FROM BOARD 2 OF CRATE 2-3 TO BOARD 16 OF CRATE 2
212 // COPY X3-4 FROM BOARD 10 OF CRATE 2-3 TO BOARD 16 OF CRATE 3
8af755f4 213 frombb->GetX34(cX); desxbb->SetX34(cX);
214
43368512 215 // COPY X3-4 FROM BOARD 15 OF CRATE 2 TO BOARD 1 OF CRATE 2-3
216 // COPY X3-4 FROM BOARD 15 OF CRATE 3 TO BOARD 9 OF CRATE 2-3
8af755f4 217 fromcb->GetX34(cX); desycb->SetX34(cX);
218
219 UShort_t cY[4];
220
221 desybb->GetY(cY); frombb->SetY(cY);
222
223 frombb->GetY(cY); desxbb->SetY(cY);
224 fromcb->GetY(cY); desycb->SetY(cY);
43368512 225 }
8af755f4 226
43368512 227 // FILL UP/DOWN OF CURRENT BOARD (DONE VIA J3 BUS IN REAL LIFE)
228 AliMUONTriggerCrate* cr;
f1e8d46c 229
43368512 230 fCrates->FirstCrate();
f1e8d46c 231
43368512 232 while ( ( cr = fCrates->NextCrate() ) )
233 {
234 TObjArray *boards = cr->Boards();
8af755f4 235
43368512 236 for (Int_t j = 1; j < boards->GetEntries()-1; j++)
237 {
238 TObject *o = boards->At(j);
8af755f4 239
43368512 240 if (!o) break;
8af755f4 241
43368512 242 AliMUONLocalTriggerBoard *currboard = (AliMUONLocalTriggerBoard*)o;
8af755f4 243
43368512 244 AliMUONLocalTriggerBoard *neighbour = (AliMUONLocalTriggerBoard*)boards->At(j+1);
8af755f4 245
43368512 246 UShort_t cXY[2][4];
8af755f4 247
43368512 248 if (j==1) {neighbour->GetXY(cXY); currboard->SetXYU(cXY);}
8af755f4 249
43368512 250 // LAST BOARD IN THE CRATE HAS NO UP EXCEPT FOR CRATES 2 & 3
251 if (j < boards->GetEntries()-2)
252 {
253 AliMUONLocalTriggerBoard *nextboard = (AliMUONLocalTriggerBoard*)boards->At(j+2);
8af755f4 254
43368512 255 currboard->GetXY(cXY); neighbour->SetXYD(cXY);
256 nextboard->GetXY(cXY); neighbour->SetXYU(cXY);
8af755f4 257
43368512 258 if (j==boards->GetEntries()-3) {neighbour->GetXY(cXY); nextboard->SetXYD(cXY);}
259 }
260 }
261 }
516d3280 262}
516d3280 263
264//___________________________________________
265void AliMUONTriggerElectronics::Feed(UShort_t pattern[2][4])
266{
6014107b 267 /// FILL INPUTS
268 ///
f1e8d46c 269 AliMUONTriggerCrate* cr;
270
271 fCrates->FirstCrate();
272
273 while ( ( cr = fCrates->NextCrate() ) )
274 {
275 TObjArray *boards = cr->Boards();
276
43368512 277 for (Int_t j = 1; j < boards->GetEntries(); j++)
f1e8d46c 278 {
279 TObject *o = boards->At(j);
280
281 if (!o) break;
282
283 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
284
285 board->SetXY(pattern);
286 }
516d3280 287 }
288}
289
290//___________________________________________
291void AliMUONTriggerElectronics::DumpOS()
292{
6014107b 293/// DUMP IN THE OLD WAY
294///
43368512 295 for (Int_t i= 0; i < 234;i++)
516d3280 296 {
f1e8d46c 297 AliMUONLocalTriggerBoard *board = fCrates->LocalBoard(i);
516d3280 298
43368512 299 if (board) board->Scan("ALL");
516d3280 300 }
301}
302
303//___________________________________________
304void AliMUONTriggerElectronics::Scan(Option_t *option)
305{
6014107b 306 /// SCAN
307 ///
516d3280 308
f1e8d46c 309 AliMUONTriggerCrate* cr;
310
311 fCrates->FirstCrate();
312
313 while ( ( cr = fCrates->NextCrate() ) )
43368512 314 {
f1e8d46c 315 TObjArray *boards = cr->Boards();
316
43368512 317 for (Int_t j = 0; j < boards->GetEntries(); j++)
f1e8d46c 318 {
319 TObject *o = boards->At(j);
320
321 TString op = option;
322
323 Bool_t cdtion = kFALSE;
324
325 if (op.Contains("LOCAL")) cdtion = o->IsA() == AliMUONLocalTriggerBoard::Class();
326 if (op.Contains("REGIONAL")) cdtion = o->IsA() == AliMUONRegionalTriggerBoard::Class();
327 if (op.Contains("GLOBAL")) cdtion = o->IsA() == AliMUONGlobalTriggerBoard::Class();
328
329 if (!o || !cdtion) continue;
330
331 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
332
333 board->Scan();
334 }
335 }
516d3280 336}
337
338//___________________________________________
339void AliMUONTriggerElectronics::Reset()
340{
6014107b 341 /// RESET
342 ///
f1e8d46c 343
344 AliMUONTriggerCrate* cr;
345
346 fCrates->FirstCrate();
347
348 while ( ( cr = fCrates->NextCrate() ) )
516d3280 349 {
516d3280 350 TObjArray *boards = cr->Boards();
351
352 for (Int_t j=0; j<boards->GetEntries(); j++)
353 {
354 AliMUONTriggerBoard *b = (AliMUONTriggerBoard*)boards->At(j);
355
356 if (b) b->Reset();
357 }
358 }
359}
360
4c0f0f5d 361//_______________________________________________________________________
362void AliMUONTriggerElectronics::LoadMasks(AliMUONCalibrationData* calibData)
363{
364 // LOAD MASKS FROM CDB
365
366
367 // SET MASKS
f1e8d46c 368
369 AliMUONTriggerCrate* cr;
370
371 fCrates->FirstCrate();
372
373 Int_t irb(0);
374
375 while ( ( cr = fCrates->NextCrate() ) )
43368512 376 {
4c0f0f5d 377 TObjArray *boards = cr->Boards();
378
379 AliMUONRegionalTriggerBoard *regb =
380 (AliMUONRegionalTriggerBoard*)boards->At(0);
381
f1e8d46c 382 AliMUONVCalibParam* regionalBoardMasks = calibData->RegionalTriggerBoardMasks(irb);
4c0f0f5d 383
384 for ( Int_t i = 0; i < regionalBoardMasks->Size(); ++i )
385 {
386 UShort_t rmask = static_cast<UShort_t>(regionalBoardMasks->ValueAsInt(i) & 0x3F);
387 regb->Mask(i,rmask);
388 }
389
43368512 390 for (Int_t j = 1; j < boards->GetEntries(); j++)
4c0f0f5d 391 {
392 AliMUONLocalTriggerBoard *b = (AliMUONLocalTriggerBoard*)boards->At(j);
393
394 Int_t cardNumber = b->GetNumber();
395
396 if (cardNumber) // interface board are not interested
397 {
398 AliMUONVCalibParam* localBoardMasks = calibData->LocalTriggerBoardMasks(cardNumber);
399 for ( Int_t i = 0; i < localBoardMasks->Size(); ++i )
400 {
401 UShort_t lmask = static_cast<UShort_t>(localBoardMasks->ValueAsInt(i) & 0xFFFF);
402 b->Mask(i,lmask);
403 }
404 }
405 }
f1e8d46c 406 ++irb;
4c0f0f5d 407 }
408
409 AliMUONVCalibParam* globalBoardMasks = calibData->GlobalTriggerBoardMasks();
410 for ( Int_t i = 0; i < globalBoardMasks->Size(); ++i )
411 {
412 UShort_t gmask = static_cast<UShort_t>(globalBoardMasks->ValueAsInt(i) & 0xFFF);
413 fGlobalTriggerBoard->Mask(i,gmask);
414 }
415}
416
417
516d3280 418//___________________________________________
419void AliMUONTriggerElectronics::LocalResponse()
420{
6014107b 421/// \todo add comment
516d3280 422
f1e8d46c 423 AliMUONTriggerCrate* cr;
424
425 fCrates->FirstCrate();
426
427 while ( ( cr = fCrates->NextCrate() ) )
43368512 428 {
f1e8d46c 429
430 TObjArray *boards = cr->Boards();
431
432 AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
433
434 UShort_t thisl[16]; for (Int_t j=0; j<16; j++) thisl[j] = 0;
29e3f51e 435
436 for (Int_t j = 1; j < boards->GetEntries(); j++)
f1e8d46c 437 {
43368512 438 TObject *o = boards->At(j);
f1e8d46c 439
43368512 440 if (!o) break;
f1e8d46c 441
43368512 442 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
f1e8d46c 443
29e3f51e 444 if (board) // check if empty slot
43368512 445 {
446 board->Response();
516d3280 447
29e3f51e 448 UShort_t response = board->GetResponse();
f1e8d46c 449
29e3f51e 450 // CRATE CONTAINING INTERFACE BOARD
451 if (board->GetNumber() == 0) // copy boards
452 {
453 if ( response != 0 )
454 AliWarning(Form("Interface board %s in slot %d of crate %s has a non zero response",
43368512 455 board->GetName(),j,cr->GetName()));
29e3f51e 456 AliDebug(1, Form("local slot %d, number %d in crate %s\n", j, board->GetNumber(), cr->GetName()));
457
458 }
f1e8d46c 459
29e3f51e 460 thisl[j-1] = response;
43368512 461 }
516d3280 462 }
f1e8d46c 463
464 regb->SetLocalResponse(thisl);
465 }
516d3280 466}
467
468//___________________________________________
469void AliMUONTriggerElectronics::RegionalResponse()
470{
f1e8d46c 471 /// Compute the response for all regional cards.
472 AliMUONTriggerCrate* cr;
473
474 fCrates->FirstCrate();
475
476 while ( ( cr = fCrates->NextCrate() ) )
43368512 477 {
516d3280 478 TObjArray *boards = cr->Boards();
479
480 AliMUONRegionalTriggerBoard *regb = (AliMUONRegionalTriggerBoard*)boards->At(0);
481
482 if (regb)
483 {
484 regb->Response();
516d3280 485 }
486 }
487}
488
489//___________________________________________
490void AliMUONTriggerElectronics::GlobalResponse()
491{
f1e8d46c 492 /// Compute the global response
516d3280 493
f1e8d46c 494 UShort_t regional[16];
495
496 AliMUONTriggerCrate* cr;
497
498 fCrates->FirstCrate();
499 Int_t irb(0);
500
501 if ( !fCrates->NumberOfCrates() >= 16 )
502 {
503 AliFatal(Form("Something is wrong : too many crates %d",
504 fCrates->NumberOfCrates()));
505 }
506
507 while ( ( cr = fCrates->NextCrate() ) )
43368512 508 {
f1e8d46c 509 AliMUONTriggerBoard* rb =
510 static_cast<AliMUONTriggerBoard*>(cr->Boards()->At(0));
511 regional[irb] = rb->GetResponse();
512 ++irb;
513 }
514
515 fGlobalTriggerBoard->SetRegionalResponse(regional);
516 fGlobalTriggerBoard->Response();
516d3280 517}
518
516d3280 519//_______________________________________________________________________
520void
521AliMUONTriggerElectronics::Exec(Option_t*)
522{
6014107b 523/// \todo add comment
524///
516d3280 525 Digits2Trigger();
526}
527
528//_______________________________________________________________________
529void AliMUONTriggerElectronics::Trigger()
530{
6014107b 531/// \todo add comment
532///
8af755f4 533 FeedM();
516d3280 534 LocalResponse();
535 RegionalResponse();
536 GlobalResponse();
537}
516d3280 538
539//_______________________________________________________________________
516d3280 540void AliMUONTriggerElectronics::Digits2Trigger()
541{
f1e8d46c 542 /// Main method to go from digits to trigger decision
47dc4ee7 543 AliMUONRegionalTrigger *pRegTrig = new AliMUONRegionalTrigger();
f1e8d46c 544 fMUONData->ResetTrigger();
f1e8d46c 545 // RUN THE FULL BEE CHAIN
546 Trigger();
68ee8c5e 547// DumpOS();
8af755f4 548
f1e8d46c 549 AliMUONTriggerCrate* cr;
6a6a56b4 550
551 // stored in right order
552 // do not used iterator order
68ee8c5e 553
6a6a56b4 554 for (Int_t iSide = 0; iSide < 2; iSide++) // right & left side
f1e8d46c 555 {
6a6a56b4 556 for (Int_t iReg = 0; iReg < 8; iReg++) // 8 crates/regional boards for each side.
557 {
558 cr = fCrates->Crate(iSide, iReg);
559 TObjArray *boards = cr->Boards();
47dc4ee7 560
6a6a56b4 561 UInt_t regInpLpt = 0;
562 UInt_t regInpHpt = 0;
563 UShort_t localMask = 0x0;
47dc4ee7 564
6a6a56b4 565 AliMUONRegionalTriggerBoard *regBoard = (AliMUONRegionalTriggerBoard*)boards->At(0);
47dc4ee7 566
6a6a56b4 567 for (Int_t j = 1; j < boards->GetEntries(); j++)
568 {
569 TObject *o = boards->At(j);
f1e8d46c 570
6a6a56b4 571 if (!o) break;
f1e8d46c 572
6a6a56b4 573 AliMUONLocalTriggerBoard *board = (AliMUONLocalTriggerBoard*)o;
f1e8d46c 574
6a6a56b4 575 if (board)
576 {
577 // L0 TRIGGER
578 if (board->Triggered())
579 {
f1e8d46c 580
6a6a56b4 581 Int_t icirc = board->GetNumber();
68ee8c5e 582
6a6a56b4 583 fLocalTrigger->SetLoCircuit(icirc);
584 fLocalTrigger->SetLoStripX(board->GetStripX11());
585 fLocalTrigger->SetLoDev(board->GetDev());
586 fLocalTrigger->SetLoStripY(board->GetStripY11());
f1e8d46c 587
6a6a56b4 588 // SAVE LUT OUTPUT
589 UShort_t response = board->GetResponse();
590 fLocalTrigger->SetLoHpt((response & 12) >> 2);
591 fLocalTrigger->SetLoLpt(response & 3);
592
593 // calculates regional inputs from local for the moment
594 UInt_t hPt = (response >> 4) & 0x3;
595 UInt_t lPt = (response >> 2) & 0x3;
47dc4ee7 596
6a6a56b4 597 regInpHpt |= hPt << (30 - (j-1)*2);
598 regInpLpt |= lPt << (30 - (j-1)*2);
599 localMask |= (0x1 << (j-1)); // local mask
47dc4ee7 600
6a6a56b4 601 TBits rrr;
602 rrr.Set(6,&response);
f1e8d46c 603
6a6a56b4 604 // SAVE BIT PATTERN
605 fLocalTrigger->SetX1Pattern(board->GetXY(0,0));
606 fLocalTrigger->SetX2Pattern(board->GetXY(0,1));
607 fLocalTrigger->SetX3Pattern(board->GetXY(0,2));
608 fLocalTrigger->SetX4Pattern(board->GetXY(0,3));
f1e8d46c 609
6a6a56b4 610 fLocalTrigger->SetY1Pattern(board->GetXY(1,0));
611 fLocalTrigger->SetY2Pattern(board->GetXY(1,1));
612 fLocalTrigger->SetY3Pattern(board->GetXY(1,2));
613 fLocalTrigger->SetY4Pattern(board->GetXY(1,3));
f1e8d46c 614
6a6a56b4 615 // ADD A NEW LOCAL TRIGGER
616 fMUONData->AddLocalTrigger(*fLocalTrigger);
68ee8c5e 617
6a6a56b4 618 }
619 }
516d3280 620 }
6a6a56b4 621 pRegTrig->SetLocalOutput(regInpLpt, 0);
622 pRegTrig->SetLocalOutput(regInpHpt, 1);
623 pRegTrig->SetLocalMask(localMask);
624 pRegTrig->SetOutput((regBoard->GetResponse() >> 4) & 0xF); // to be uniformized (oct06 ?)
47dc4ee7 625
6a6a56b4 626 fMUONData->AddRegionalTrigger(*pRegTrig);
627 }
f1e8d46c 628 }
47dc4ee7 629 delete pRegTrig;
f1e8d46c 630
1908473e 631 // GLOBAL TRIGGER INFORMATION
f1e8d46c 632 UShort_t global = fGlobalTriggerBoard->GetResponse();
8d4fefab 633 fGlobalTrigger->SetFromGlobalResponse(global);
634
f1e8d46c 635
636 // ADD A LOCAL TRIGGER IN THE LIST
1908473e 637 fMUONData->AddGlobalTrigger(*fGlobalTrigger);
47dc4ee7 638
f1e8d46c 639 // NOW RESET ELECTRONICS
640 Reset();
516d3280 641}
642