]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONRawData.cxx
Bug found (Jean-Pierre)
[u/mrichter/AliRoot.git] / MUON / AliMUONRawData.cxx
CommitLineData
f6762c71 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////////////////////////////////////
17//
18// MUON Raw Data generator in ALICE-MUON
19//
c8b4255f 20// This class version 1 (further details could be found in Alice-note coming soon right in our direction)
21// Generates raw data for MUON tracker and finally for trigger
f6762c71 22// * a simple mapping is used (see below)
69be760c 23// * the bus patch id is calculated with an absolute number 0 - 999
c8b4255f 24// * one DDL per 1/2 chamber is created for both cathode.
25// For trigger there is no mapping (mapping could be found in AliMUONTriggerCircuit)
26// don't need for digits2raw but needed in raw2Reco
27// the position are given per local card
f6762c71 28////////////////////////////////////
c8b4255f 29
69be760c 30#include <TClonesArray.h>
f6762c71 31#include "AliMUONRawData.h"
32#include "AliMUONDigit.h"
1195fa7b 33
f6762c71 34#include "AliMUONConstants.h"
35#include "AliMUONData.h"
f6762c71 36#include "AliLoader.h"
37#include "AliBitPacking.h"
1195fa7b 38
39#include "AliMUONSubEventTrigger.h"
69be760c 40#include "AliMUONDDLTracker.h"
41#include "AliMUONDDLTrigger.h"
42
c8b4255f 43#include "AliMUONLocalTrigger.h"
44#include "AliMUONGlobalTrigger.h"
f6762c71 45
46const Int_t AliMUONRawData::fgkDefaultPrintLevel = 0;
47
48ClassImp(AliMUONRawData) // Class implementation in ROOT context
49
50//__________________________________________________________________________
51AliMUONRawData::AliMUONRawData(AliLoader* loader)
69be760c 52 : TObject(),
53 fDebug(0)
f6762c71 54{
55 // Standard Constructor
56
f6762c71 57 fPrintLevel = fgkDefaultPrintLevel;
58
59 // initialize loader's
60 fLoader = loader;
61
62 // initialize container
63 fMUONData = new AliMUONData(fLoader,"MUON","MUON");
69be760c 64
65 // trigger decision, temp solution, local & global has to move to Digits Tree
66// fTrigDec = new AliMUONTriggerDecision(fLoader);
67// fTrigData = fTrigDec->GetMUONData();
68
69 // initialize array
70 fSubEventArray[0] = new TClonesArray("AliMUONSubEventTracker",1000);
71 fSubEventArray[1] = new TClonesArray("AliMUONSubEventTracker",1000);
72
73 // initialize array
74 fSubEventTrigArray[0] = new TClonesArray("AliMUONSubEventTrigger",1000);
75 fSubEventTrigArray[1] = new TClonesArray("AliMUONSubEventTrigger",1000);
76
77 // ddl pointer
78 fDDLTracker = new AliMUONDDLTracker();
79 fDDLTrigger= new AliMUONDDLTrigger();
f6762c71 80}
81
82//__________________________________________________________________________
83AliMUONRawData::AliMUONRawData()
84 : TObject(),
f6762c71 85 fMUONData(0),
86 fPrintLevel(fgkDefaultPrintLevel),
87 fDebug(0),
88 fLoader(0)
89{
90 // Default Constructor
91}
92
93//_______________________________________________________________________
94AliMUONRawData::AliMUONRawData (const AliMUONRawData& rhs)
95 : TObject(rhs)
96{
97// Protected copy constructor
98
99 Fatal("AliMUONRawData", "Not implemented.");
100}
101
102//_______________________________________________________________________
103AliMUONRawData &
104AliMUONRawData::operator=(const AliMUONRawData& rhs)
105{
106// Protected assignement operator
107
108 if (this == &rhs) return *this;
109
110 Fatal("operator=", "Not implemented.");
111
112 return *this;
113}
114
115//__________________________________________________________________________
116AliMUONRawData::~AliMUONRawData(void)
117{
118 if (fMUONData)
119 delete fMUONData;
69be760c 120 if (fSubEventArray[0])
121 fSubEventArray[0]->Delete(); //using delete cos allocating memory in copy ctor.
122 if (fSubEventArray[1])
123 fSubEventArray[1]->Delete();
124
125 if (fSubEventTrigArray[0])
126 fSubEventTrigArray[0]->Delete();
127 if (fSubEventTrigArray[1])
128 fSubEventTrigArray[1]->Delete();
129
130 if (fDDLTracker)
131 delete fDDLTracker;
132 if (fDDLTrigger)
133 delete fDDLTrigger;
134
f6762c71 135 return;
136}
137//____________________________________________________________________
138Int_t AliMUONRawData::WriteRawData()
139{
140 // convert digits of the current event to raw data
141
1195fa7b 142 Int_t idDDL;
f6762c71 143 Char_t name[20];
144
145 fLoader->LoadDigits("READ");
69be760c 146
c8b4255f 147 fMUONData->SetTreeAddress("D,GLT");
f6762c71 148
f6762c71 149
c8b4255f 150 // tracking chambers
151
152 for (Int_t ich = 0; ich < AliMUONConstants::NTrackingCh(); ich++) {
153
f6762c71 154 // open files
1195fa7b 155 idDDL = ich * 2 + 0x900;
156 sprintf(name, "MUON_%d.ddl",idDDL);
f6762c71 157 fFile1 = fopen(name,"w");
158
1195fa7b 159 idDDL = (ich * 2) + 1 + 0x900;
160 sprintf(name, "MUON_%d.ddl",idDDL);
f6762c71 161 fFile2 = fopen(name,"w");
162
69be760c 163 WriteTrackerDDL(ich);
f6762c71 164
165 // reset and close
166 fclose(fFile1);
167 fclose(fFile2);
168 fMUONData->ResetDigits();
169 }
69be760c 170
171 // trigger chambers
c8b4255f 172
69be760c 173 // open files
1195fa7b 174 idDDL = 0xA00;
175 sprintf(name, "MUTR_%d.ddl",idDDL);
c8b4255f 176 fFile1 = fopen(name,"w");
69be760c 177
1195fa7b 178 idDDL = 0xA00 + 1;
179 sprintf(name, "MUTR_%d.ddl",idDDL);
c8b4255f 180 fFile2 = fopen(name,"w");
69be760c 181
c8b4255f 182 WriteTriggerDDL();
183
184 // reset and close
185 fclose(fFile1);
186 fclose(fFile2);
187 fMUONData->ResetTrigger();
f6762c71 188
c8b4255f 189 fLoader->UnloadDigits();
69be760c 190
f6762c71 191 return kTRUE;
192}
193//____________________________________________________________________
69be760c 194Int_t AliMUONRawData::WriteTrackerDDL(Int_t iCh)
f6762c71 195{
69be760c 196 // resets
f6762c71 197 TClonesArray* muonDigits = 0;
69be760c 198 fSubEventArray[0]->Clear();
199 fSubEventArray[1]->Clear();
200
201 //
202 TArrayI nbInBus[2];
203
204 nbInBus[0].Set(5000);
205 nbInBus[1].Set(5000);
206
207 nbInBus[0].Reset();
208 nbInBus[1].Reset();
209
210 // DDL header
211 AliRawDataHeader header = fDDLTracker->GetHeader();
212 Int_t headerSize = fDDLTracker->GetHeaderSize();
f6762c71 213
214 // DDL event one per half chamber
69be760c 215 AliMUONSubEventTracker* subEvent;
f6762c71 216
217 // data format
218 Char_t parity = 0x4;
69be760c 219 UShort_t manuId = 0;
220 UChar_t channelId = 0;
221 UShort_t charge = 0;
222 Int_t busPatchId = 0;
f6762c71 223
224 UInt_t word;
69be760c 225 Int_t nEntries = 0;
226 Int_t* buffer = 0;
227 Int_t index;
228 Int_t indexDsp;
229 Int_t indexBlk;
f6762c71 230
231 Int_t nDigits;
69be760c 232 const AliMUONDigit* digit;
f6762c71 233
c8b4255f 234 if (fPrintLevel == 1)
69be760c 235 printf("WriteDDL chamber %d\n", iCh+1);
f6762c71 236
237 for (Int_t iCath = 0; iCath < 2; iCath++) {
238
f6762c71 239 fMUONData->ResetDigits();
240 fMUONData->GetCathode(iCath);
241 muonDigits = fMUONData->Digits(iCh);
242
243 nDigits = muonDigits->GetEntriesFast();
69be760c 244 if (fPrintLevel == 2)
f6762c71 245 printf("ndigits = %d\n",nDigits);
246
247 // open DDL file, on per 1/2 chamber
248
249 for (Int_t idig = 0; idig < nDigits; idig++) {
250
251 digit = (AliMUONDigit*) muonDigits->UncheckedAt(idig);
252
69be760c 253 // mapping
254 GetDummyMapping(iCh, iCath, digit, busPatchId, manuId, channelId, charge);
255
256 //packing word
257 AliBitPacking::PackWord((UInt_t)parity,word,29,31);
258 AliBitPacking::PackWord((UInt_t)manuId,word,18,28);
259 AliBitPacking::PackWord((UInt_t)channelId,word,12,17);
260 AliBitPacking::PackWord((UInt_t)charge,word,0,11);
261
262 // set sub Event
263 subEvent = new AliMUONSubEventTracker();
264 subEvent->AddData(word);
265 subEvent->SetBusPatchId(busPatchId);
266 if (digit->PadX() > 0) {
267 nbInBus[0][busPatchId]++;
268 AddData1(subEvent);
269 } else {
270 nbInBus[1][busPatchId]++;
271 AddData2(subEvent);
272 }
273 delete subEvent;
274 }
275 }
276 fSubEventArray[0]->Sort();
277 fSubEventArray[1]->Sort();
278
279 // gather datas from same bus patch
280 for (Int_t iDDL = 0; iDDL < 2; iDDL++) {
281 nEntries = fSubEventArray[iDDL]->GetEntriesFast();
282
283 for (Int_t i = 0; i < nEntries; i++) {
284 AliMUONSubEventTracker* temp = (AliMUONSubEventTracker*)fSubEventArray[iDDL]->At(i);
285 busPatchId = temp->GetBusPatchId();
286
287 // add bus patch header, length and total length managed by subevent class
288 temp->SetTriggerWord(0xdeadbeef);
289 for (Int_t j = 0; j < nbInBus[iDDL][busPatchId]-1; j++) {
290 AliMUONSubEventTracker* temp1 = (AliMUONSubEventTracker*)fSubEventArray[iDDL]->At(++i);
291 temp->AddData(temp1->GetData(0));
292 fSubEventArray[iDDL]->RemoveAt(i) ;
293 }
294 }
295 fSubEventArray[iDDL]->Compress();
296
297 if (fPrintLevel == 3) {
298 nEntries = fSubEventArray[iDDL]->GetEntriesFast();
299 for (Int_t i = 0; i < nEntries; i++) {
300 AliMUONSubEventTracker* temp = (AliMUONSubEventTracker*)fSubEventArray[iDDL]->At(i);
301 printf("busPatchid back %d\n",temp->GetBusPatchId());
302 for (Int_t j = 0; j < temp->GetLength(); j++) {
303 printf("manuId back %d, ",temp->GetManuId(j));
304 printf("channelId back %d, ",temp->GetChannelId(j));
305 printf("charge back %d\n",temp->GetCharge(j));
306 }
307 }
308 printf("\n");
309 }
310
311 }
312
313 Int_t iBusPatch;
314 Int_t iEntries;
315
316 for (Int_t iDDL = 0; iDDL < 2; iDDL++) {
317
318
319 // filling buffer
320 nEntries = fSubEventArray[iDDL]->GetEntriesFast();
321 buffer = new Int_t [(2048+24)*50]; // 24 words in average for one buspatch and 2048 manu info at most
322
323 indexBlk = 0;
324 indexDsp = 0;
325 index = 0;
326 iBusPatch = 0;
327 iEntries = 0;
328
329 for (Int_t iBlock = 0; iBlock < 2; iBlock++) {
330
331 // block header
332 fDDLTracker->SetTotalBlkLength(0xFFFFFFFF);
333 memcpy(&buffer[index],fDDLTracker->GetBlkHeader(),32);
334 indexBlk = index;
335 index += 8;
336
337 for (Int_t iDsp = 0; iDsp < 5; iDsp++) {
338
339 // DSP header
340 fDDLTracker->SetTotalDspLength(0xEEEEEEEE);
341 memcpy(&buffer[index],fDDLTracker->GetDspHeader(),32);
342 indexDsp = index;
343 index += 8;
344
345 for (Int_t i = 0; i < 5; i++) {
346
347 iBusPatch = i + iBlock*25 + iDsp*5 + 50*(2*iCh + iDDL);
348
349 AliMUONSubEventTracker* temp = (AliMUONSubEventTracker*)fSubEventArray[iDDL]->At(iEntries);
350 if (nEntries > 0)
351 busPatchId = temp->GetBusPatchId();
352 else
353 busPatchId = -1;
354
355 if (busPatchId == iBusPatch) {
356 // add bus patch structure
357 memcpy(&buffer[index],temp->GetAddress(),16);
358 index+= 4;
359 for (Int_t j = 0; j < temp->GetLength(); j++)
360 buffer[index++] = temp->GetData(j);
361 if (iEntries < nEntries-1)
362 iEntries++;
363 } else {
364 buffer[index++] = 4; // total length
365 buffer[index++] = 0; // raw data length
366 buffer[index++] = iBusPatch; // bus patch
367 buffer[index++] = 0xdeadbeef; // trigger word
368 }
369 } // bus patch
370 buffer[indexDsp] = index - indexDsp;
371 buffer[indexDsp+1] = index - indexDsp -8;
372 if ((index - indexDsp) % 2 == 0)
373 buffer[indexDsp+7] = 0;
374 else
375 buffer[indexDsp+7] = 1;
376 } // dsp
377 buffer[indexBlk] = index - indexBlk;
378 buffer[indexBlk+1] = index - indexBlk -8;
379 }
380 if (iDDL == 0) {
381 // write DDL 1
382 header.fSize = index + headerSize;// total length in word
383 fwrite((char*)(&header),headerSize*4,1,fFile1);
384 fwrite(buffer,sizeof(int),index,fFile1);
385 }
386 if (iDDL == 1) {
387 // write DDL 2
388 header.fSize = index + headerSize;// total length in word
389 fwrite((char*)(&header),headerSize*4,1,fFile2);
390 fwrite(buffer,sizeof(int),index,fFile2);
391 }
392 delete[] buffer;
393 }
394
395 return kTRUE;
396}
397//____________________________________________________________________
398Int_t AliMUONRawData::WriteTriggerDDL()
399{
400
c8b4255f 401 // DDL event one per half chamber
402 AliMUONSubEventTrigger* subEvent = 0x0;
69be760c 403
69be760c 404
c8b4255f 405 // stored local id number
406 TArrayI isFired(256);
407 isFired.Reset();
69be760c 408
69be760c 409
c8b4255f 410 // DDL header
411 AliRawDataHeader header = fDDLTrigger->GetHeader();
412 Int_t headerSize = fDDLTrigger->GetHeaderSize();
413
414 TClonesArray* localTrigger;
415 TClonesArray* globalTrigger;
416 AliMUONGlobalTrigger* gloTrg;
417 AliMUONLocalTrigger* locTrg = 0x0;
418
419 fMUONData->GetTriggerD();
420
421 // global trigger for trigger pattern
422 globalTrigger = fMUONData->GlobalTrigger();
423 gloTrg = (AliMUONGlobalTrigger*)globalTrigger->UncheckedAt(0);
424 Int_t gloTrigPat = GetGlobalTriggerPattern(gloTrg);
425
426 // local trigger
427 localTrigger = fMUONData->LocalTrigger();
428
429 UInt_t word;
430 Int_t* buffer = 0;
431 Int_t index;
432 Int_t iEntries = 0;
433 Int_t iLocCard, locCard;
434 Char_t locDec, trigY, posY, devX, posX;
435 Int_t version = 1; // software version
436 Int_t eventType =1; // trigger type: 1 for physics ?
437 Int_t serialNb = 0xF; // serial nb of card: all bits on for the moment
438
439 Int_t nEntries = (Int_t) (localTrigger->GetEntries());// 234 local cards
440 // stored the local card id that's fired
441 for (Int_t i = 0; i < nEntries; i++) {
442 locTrg = (AliMUONLocalTrigger*)localTrigger->At(i);
443 isFired[locTrg->LoCircuit()] = 1;
444 }
445
446 if (!nEntries)
447 Error("AliMUONRawData::WriteTriggerDDL","No Trigger information available");
448
a0b2ac9a 449 buffer = new Int_t [680]; // [16(local)*5 words + 4 words]*8(reg) + 8 words = 680
c8b4255f 450
451 for (Int_t iDDL = 0; iDDL < 2; iDDL++) {
452
453 index = 0;
454
455 // DDL enhanced header
456 word =0;
457 AliBitPacking::PackWord((UInt_t)iDDL+1,word,30,31); //see AliMUONDDLTrigger.h for details
458 AliBitPacking::PackWord((UInt_t)version,word,22,29);
459 AliBitPacking::PackWord((UInt_t)serialNb,word,18,21);
460 AliBitPacking::PackWord((UInt_t)eventType,word,14,17);
461
462 fDDLTrigger->SetDDLWord(word);
463 fDDLTrigger->SetGlobalOutput(gloTrigPat);
464 memcpy(&buffer[index],fDDLTrigger->GetEnhancedHeader(),24);
465 index += 6;
466
467 for (Int_t iReg = 0; iReg < 8; iReg++) {
468
469 subEvent = new AliMUONSubEventTrigger();
470
471 // Regional card header
472 word = 0;
473 AliBitPacking::PackWord((UInt_t)serialNb,word,27,31); //see AliMUONSubEventTrigger.h for details
474 AliBitPacking::PackWord((UInt_t)iReg,word,22,26);
475 AliBitPacking::PackWord((UInt_t)version,word,14,21);
476 subEvent->SetRegWord(word);
477 memcpy(&buffer[index++],subEvent->GetAddress(),4);
478
479 for (Int_t iLoc = 0; iLoc < 16; iLoc++) {
480
481 iLocCard = iLoc + iReg*16 + iDDL*128;
482
483 if (isFired[iLocCard]) {
484 locTrg = (AliMUONLocalTrigger*)localTrigger->At(iEntries);
485 locCard = locTrg->LoCircuit();
486 locDec = locTrg->GetLoDecision();
487 trigY = 0;
488 posY = locTrg->LoStripY();
489 posX = locTrg->LoStripX();
490 devX = locTrg->LoDev();
491 if (fPrintLevel == 4)
492 printf("loctrg %d, posX %d, posY %d, devX %d\n",
493 locTrg-> LoCircuit(),locTrg->LoStripX(),locTrg->LoStripY(),locTrg->LoDev());
494 } else { //no trigger (see PRR chpt 3.4)
495 locCard = -1;
496 locDec = 0;
497 trigY = 1;
498 posY = 15;
499 posX = 0;
500 devX = 0x8000;
501 }
502
503 //packing word
504 word = 0;
505 AliBitPacking::PackWord((UInt_t)(iLocCard % 16),word,19,22); //card id number in crate
506 AliBitPacking::PackWord((UInt_t)locDec,word,15,18);
507 AliBitPacking::PackWord((UInt_t)trigY,word,14,14);
508 AliBitPacking::PackWord((UInt_t)posY,word,10,13);
509 AliBitPacking::PackWord((UInt_t)devX,word,5,9);
510 AliBitPacking::PackWord((UInt_t)posX,word,0,4);
511
512 if (locCard == iLocCard) {
513 // add local cards structure
514 buffer[index++] = (locTrg->GetX1Pattern() | (locTrg->GetX2Pattern() << 16));
515 buffer[index++] = (locTrg->GetX3Pattern() | (locTrg->GetX4Pattern() << 16));
516 buffer[index++] = (locTrg->GetY1Pattern() | (locTrg->GetY2Pattern() << 16));
517 buffer[index++] = (locTrg->GetY3Pattern() | (locTrg->GetY4Pattern() << 16));
518 buffer[index++] = (Int_t)word; // data word
519 if (iEntries < nEntries-1)
520 iEntries++;
521 } else {
522 buffer[index++] = 0; // 4 words for x1, x2, y1, y2
523 buffer[index++] = 0;
524 buffer[index++] = 0;
525 buffer[index++] = 0;
526 buffer[index++] = (Int_t)word; // data word
527
528 }
529 } // local card
530 buffer[index++] = 0;// 2 words of regional input
531 buffer[index++] = 0;
532 buffer[index++] = 0;// regional output
533
534 delete subEvent;
535
536 } // Regional card
537
538 buffer[index++] = fDDLTrigger->GetEoD(); // End of DDL word
a0b2ac9a 539 buffer[index++] = fDDLTrigger->GetEoD(); // End of DDL word for 64 bits transfer purpose
c8b4255f 540
541
542 if (iDDL == 0) {
543 // write DDL 1
544 header.fSize = index + headerSize;// total length in word
545 fwrite((char*)(&header),headerSize*4,1,fFile1);
546 fwrite(buffer,sizeof(int),index,fFile1);
547 }
548 if (iDDL == 1) {
549 // write DDL 2
550 header.fSize = index + headerSize;// total length in word
551 fwrite((char*)(&header),headerSize*4,1,fFile2);
552 fwrite(buffer,sizeof(int),index,fFile2);
553 }
554 }
555 delete[] buffer;
69be760c 556
557 return kTRUE;
558}
559//____________________________________________________________________
560void AliMUONRawData::GetDummyMapping(Int_t iCh, Int_t iCath, const AliMUONDigit* digit,
561 Int_t &busPatchId, UShort_t &manuId, UChar_t &channelId, UShort_t &charge)
562{
1195fa7b 563// Dummy mapping for tracker
69be760c 564
565 Int_t offsetX = 0; // offet row
566 Int_t offsetY = 0; // offset columns
567 Int_t offsetCath = 0; //offset from one cathod to the other
568 Int_t maxChannel = 0; // maximum nb of channel in 1/2 chamber
569 Int_t id;
f6762c71 570 switch (iCh+1) {
571 case 1:
572 case 2:
573 case 3:
574 case 4:
575 offsetX = 512;
576 offsetY = 256;
577 offsetCath = 65536;
578 maxChannel = (offsetY * offsetX + 2* offsetY + offsetCath);
579 break;
580 case 5:
581 case 6:
582 case 7:
583 case 8:
584 case 9:
585 case 10:
586 offsetX = 1024;
587 offsetY = 0;
588 offsetCath = 65536;
589 maxChannel = (256 * offsetX + offsetX + offsetCath);
590 break;
591 }
592 // dummy mapping
593 // manu Id directly from a matrix 8*8, same segmentation for B and NB
594 // 50 buspatches for 1/2 chamber
f6762c71 595
69be760c 596 id = (TMath::Abs(digit->PadX()) * offsetX + digit->PadY() + offsetY +
597 offsetCath * iCath);
598 Int_t chPerBus = maxChannel/50;
599 busPatchId = id/chPerBus; // start at zero
600 if (digit->PadX() > 0)
601 busPatchId += 50*iCh*2;
602 else
603 busPatchId += 50*(2*iCh+1);
f6762c71 604 // 64 manu cards for one buspatch
69be760c 605 manuId = (id % chPerBus)/64; //start at zero
f6762c71 606 manuId &= 0x7FF; // 11 bits
607
608 // channel id
69be760c 609 channelId = (id % chPerBus) % 64; //start at zero
f6762c71 610 channelId &= 0x3F; // 6 bits
611
69be760c 612// id = (TMath::Abs(digit->PadX()) * offsetX + digit->PadY() + offsetY +
613// offsetCath * iCath);
614// busPatchId = id/50;
615
616// Int_t inBusId = id - (maxChannel/50 * busPatchId);// id channel in buspatch
617// Int_t manuPerBus = (maxChannel/(50*64)); // number of manus per buspatch
618
619// // 64 manu cards for one buspatch
620// manuId = inBusId/manuPerBus;
621// manuId &= 0x7FF; // 11 bits
622
623// // channel id
624// channelId = (inBusId % manuPerBus);
625// channelId &= 0x3F; // 6 bits
626
627 if (fPrintLevel == 2)
628 printf("id: %d, busPatchId %d, manuId: %d, channelId: %d, maxchannel: %d, chPerBus %d\n",
629 id, busPatchId, manuId, channelId, maxChannel, chPerBus);
f6762c71 630 // charge
631 charge = digit->Signal();
632 charge &= 0xFFF;
633
69be760c 634 if (fPrintLevel == 2)
f6762c71 635 printf("id: %d, busPatchId %d, manuId: %d, channelId: %d, padx: %d pady %d, charge %d\n",
636 id, busPatchId, manuId, channelId, digit->PadX(), digit->PadY(), digit->Signal());
f6762c71 637
f6762c71 638}
c8b4255f 639
640//____________________________________________________________________
1195fa7b 641Int_t AliMUONRawData::GetGlobalTriggerPattern(const AliMUONGlobalTrigger* gloTrg)
c8b4255f 642{
1195fa7b 643 // global trigger pattern calculation
644
c8b4255f 645 Int_t gloTrigPat = 0;
646
647 if (gloTrg->SinglePlusLpt()) gloTrigPat|= 0x1;
648 if (gloTrg->SinglePlusHpt()) gloTrigPat|= 0x2;
649 if (gloTrg->SinglePlusApt()) gloTrigPat|= 0x4;
650
651 if (gloTrg->SingleMinusLpt()) gloTrigPat|= 0x8;
652 if (gloTrg->SingleMinusHpt()) gloTrigPat|= 0x10;
653 if (gloTrg->SingleMinusApt()) gloTrigPat|= 0x20;
654
655 if (gloTrg->SingleUndefLpt()) gloTrigPat|= 0x40;
656 if (gloTrg->SingleUndefHpt()) gloTrigPat|= 0x80;
657 if (gloTrg->SingleUndefApt()) gloTrigPat|= 0x100;
658
659 if (gloTrg->PairUnlikeLpt()) gloTrigPat|= 0x200;
660 if (gloTrg->PairUnlikeHpt()) gloTrigPat|= 0x400;
661 if (gloTrg->PairUnlikeApt()) gloTrigPat|= 0x800;
662
663 if (gloTrg->PairLikeLpt()) gloTrigPat|= 0x1000;
664 if (gloTrg->PairLikeHpt()) gloTrigPat|= 0x2000;
665 if (gloTrg->PairLikeApt()) gloTrigPat|= 0x4000;
666
667 return gloTrigPat;
668}