1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // Macro for reading tracker raw data
18 // Ch. Finck, Subatech Febuary
21 #if !defined(__CINT__) || defined(__MAKECINT__)
24 #include "AliRawReaderDate.h"
27 #include "AliMUONRawStreamTrigger.h"
28 #include "AliMUONDarcHeader.h"
29 #include "AliMUONRegHeader.h"
30 #include "AliMUONLocalStruct.h"
31 #include "AliMUONDDLTrigger.h"
35 // Macro to read rawdata Date File for trigger
36 // Ch. Finck, Subatech, June. 2006
38 // This macro is interface with AliRawReader and DATE for RAW
39 // The different stucture of the patload are readout and stored in TClonesArray
40 // with AliMUONRawStreamTrigger classe.
41 // The decoding of the payload is done by AliMUONPayLoadTrigger class
42 // The macro just simpy read again the TClonesArray contents.
43 // The parameter of each structure could be seen in the container classes
44 // AliMUONDarcHeader, AliMUONRegHeader, AliMUONLocalStruct.
45 // The class AliMUONDDLTrigger manages the structure containers.
46 // The number of structures in the rawdata file could be set.
48 void MUONDateStreamTrigger(Int_t maxEvent = 1000, Int_t minDDL = 0, Int_t maxDDL = 1, TString fileName = "raw.root.date", Int_t eventType = 7 )
50 // eventType = 7 for DATE file generated from AliRoot
51 // eventType = 0 for DATE file from Nantes test bench
52 AliRawReader* rawReader = new AliRawReaderDate(fileName,eventType);// DATE file
56 AliMUONRawStreamTrigger* rawStream = new AliMUONRawStreamTrigger(rawReader);
58 // set the number of DDL reg & local that are PRESENT in the rawdata file
59 // it's NOT the number to be read.
60 // default wise set to 2, 8, 16 respectively for AliRoot
62 rawStream->SetMaxDDL(1);
63 rawStream->SetMaxReg(1);
64 rawStream->SetMaxLoc(16);
67 AliMUONDDLTrigger* ddlTrigger = 0x0;
68 AliMUONDarcHeader* darcHeader = 0x0;
69 AliMUONRegHeader* regHeader = 0x0;
70 AliMUONLocalStruct* localStruct = 0x0;
77 if (iEvent == maxEvent)
80 printf("Event %d\n",iEvent++);
82 // read DDL while < 2 DDL
83 while(rawStream->NextDDL()) {
85 if (rawStream->GetDDL() < minDDL || rawStream->GetDDL() > maxDDL)
88 printf("\niDDL %d\n", rawStream->GetDDL());
90 ddlTrigger = rawStream->GetDDLTrigger();
91 darcHeader = ddlTrigger->GetDarcHeader();
93 printf("Global output %x\n", (Int_t)darcHeader->GetGlobalOutput());
95 // loop over regional structures
96 Int_t nReg = darcHeader->GetRegHeaderEntries();
97 for(Int_t iReg = 0; iReg < nReg ;iReg++){ //REG loop
99 printf("RegionalId %d\n", iReg);
101 regHeader = darcHeader->GetRegHeaderEntry(iReg);
102 // printf("Serial number %d\n",regHeader->GetSerialNb());
104 // loop over local structures
105 Int_t nLocal = regHeader->GetLocalEntries();
106 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++) {
108 localStruct = regHeader->GetLocalEntry(iLocal);
111 // if (localStruct->GetTriggerY() == 0) { // no empty data
113 printf("LocalId %d\n", localStruct->GetId());
115 Int_t loId = (Int_t)localStruct->GetId();
116 Int_t loDec = (Int_t)localStruct->GetDec();
117 Int_t loStripX = (Int_t)localStruct->GetXPos();
118 Int_t loStripY = (Int_t)localStruct->GetYPos();
119 Int_t loDev = (Int_t)localStruct->GetXDev();
121 printf("Id: %d, Dec: %d\n", loId, loDec);
122 printf("XPos: %d, YPos: %d Dev: %d\n", loStripX, loStripY, loDev);
127 } while (rawReader->NextEvent());