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"
25 #include "AliRawReaderFile.h"
26 #include "AliRawReaderRoot.h"
29 #include "AliMUONRawStreamTrigger.h"
30 #include "AliMUONDarcHeader.h"
31 #include "AliMUONRegHeader.h"
32 #include "AliMUONLocalStruct.h"
33 #include "AliMUONDDLTrigger.h"
37 // Macro to read rawdata for trigger
38 // Ch. Finck, Subatech, April. 2006
40 // This macro is interface with AliRawReader for RAW
41 // The different stucture of the patload are readout and stored in TClonesArray
42 // with AliMUONRawStreamTrigger classe.
43 // The macro just simpy read again the TClonesArray contents.
44 // The parameter of each structure could be seen in the container classes
45 // AliMUONDarcHeader, AliMUONRegHeader, AliMUONLocalStruct.
46 // The class AliMUONDDLTrigger manages the structure containers.
47 // The number of structures in the rawdata file could be set.
49 void MUONRawStreamTrigger(Int_t maxEvent = 1000, Int_t minDDL = 0, Int_t maxDDL = 1, TString fileName = "./")
51 AliRawReader* rawReader = 0x0;
53 if (fileName.EndsWith("/")) {
54 rawReader = new AliRawReaderFile(fileName);// DDL files
55 } else if (fileName.EndsWith(".root")) {
56 rawReader = new AliRawReaderRoot(fileName);
57 } else if (!fileName.IsNull()) {
58 rawReader = new AliRawReaderDate(fileName);// DATE file
62 AliMUONRawStreamTrigger* rawStream = new AliMUONRawStreamTrigger(rawReader);
64 // set the number of DDL reg & local that are PRESENT in the rawdata file
65 // it's NOT the number to be read.
66 // default wise set to 2, 8, 16 respectively.
67 // rawStream->SetMaxDDL(xx);
68 // rawStream->SetMaxReg(xx);
69 // rawStream->SetMaxLoc(xx);
72 AliMUONDDLTrigger* ddlTrigger = 0x0;
73 AliMUONDarcHeader* darcHeader = 0x0;
74 AliMUONRegHeader* regHeader = 0x0;
75 AliMUONLocalStruct* localStruct = 0x0;
80 while (rawReader->NextEvent()) {
82 if (iEvent == maxEvent)
85 printf("Event %d\n",iEvent++);
87 // read DDL while < 2 DDL
88 while(rawStream->NextDDL()) {
90 if (rawStream->GetDDL() < minDDL || rawStream->GetDDL() > maxDDL)
93 printf("\niDDL %d\n", rawStream->GetDDL());
95 ddlTrigger = rawStream->GetDDLTrigger();
96 darcHeader = ddlTrigger->GetDarcHeader();
98 printf("Global output %x\n", (Int_t)darcHeader->GetGlobalOutput());
100 // loop over regional structures
101 Int_t nReg = darcHeader->GetRegHeaderEntries();
102 for(Int_t iReg = 0; iReg < nReg ;iReg++){ //REG loop
104 printf("RegionalId %d\n", iReg);
106 regHeader = darcHeader->GetRegHeaderEntry(iReg);
107 // printf("Reg length %d\n",regHeader->GetHeaderLength());
109 // loop over local structures
110 Int_t nLocal = regHeader->GetLocalEntries();
111 for(Int_t iLocal = 0; iLocal < nLocal; iLocal++) {
113 localStruct = regHeader->GetLocalEntry(iLocal);
116 if (localStruct->GetTriggerY() == 0) { // no empty data
118 printf("LocalId %d\n", localStruct->GetId());
120 Int_t loStripX = (Int_t)localStruct->GetXPos();
121 Int_t loStripY = (Int_t)localStruct->GetYPos();
122 Int_t loDev = (Int_t)localStruct->GetXDev();
124 printf("XPos: %d, YPos: %d Dev: %d\n", loStripX, loStripY, loDev);