1 //////////////////////////////////////////////////////////////////
3 // readACORDERawData.C macro //
5 // Reads the information of ACORDE from raw data file //
6 // from the 4-32-words (SL0 & MCN mode) //
7 // and draws four histograms (2 by each mode) //
9 // Author: Mario Rodriguez Cahuantzi //
10 // E-MaiL: mario.rocah@gmail.com, mrodrigu@mail.cern.ch //
12 // Created: July 1st. 2010 @ FCFM -BUAP, Puebla, MX //
13 // Last update: created from old AcoReco.C macro //
15 //////////////////////////////////////////////////////////////////
17 void readACORDERawData(char* fileName)
22 // Pointer to rawReader class
24 AliRawReader* rawReader = new AliRawReaderRoot(fileName);
26 // Pointer to rawData of Acorde
28 AliACORDERawStream* rawStream = new AliACORDERawStream(rawReader);
30 // Create some histograms
32 TH1F *h1 = new TH1F("h1","ACORDE - Single Muon Hits (SL0)",60,-0.5,59.5);
33 TH1F *h2 = new TH1F("h2","ACORDE - Multiplicity of Acorde Modules (SL0)",61,-1,60);
34 TH1F *h3 = new TH1F("h3","ACORDE - Single Muon Hits (MCN)",60,-0.5,59.5);
35 TH1F *h4 = new TH1F("h4","ACORDE - Multiplicity of Acorde Modules (MCN)",61,-1,60);
37 // Declare some counters
41 UInt_t acorde_word[4]; // array to store the 4-words
42 bool word_sl0[60],word_mcn[60]; // boolean array if some hit in module
43 UInt_t shiftword; // shift word
45 for(Int_t m=0;m<60;m++) {word_sl0[m]=0;word_mcn[m]=0;}
48 Int_t nEvents = rawStream->GetNEvents(fileName);
50 printf("File: %s, Number of events: %d \n",fileName,nEvents);
53 // Loop over all the events
55 for (Int_t i=1; i<=nEvents; i++)
58 if (!rawReader->NextEvent()) break;
60 if (!rawStream->Next()) continue;
62 acorde_word[0] = rawStream->GetWord(0);
63 acorde_word[1] = rawStream->GetWord(1);
64 acorde_word[2] = rawStream->GetWord(2);
65 acorde_word[3] = rawStream->GetWord(3);
67 shiftword = acorde_word[0];
68 for(Int_t iaco=0;iaco<30;iaco++)
70 word_sl0[iaco] = shiftword & 1;
74 shiftword = acorde_word[1];
75 for(Int_t iaco=30;iaco<60;iaco++)
77 word_sl0[iaco] = shiftword & 1;
81 shiftword=acorde_word[2];
82 for(Int_t iaco=0;iaco<30;iaco++)
84 word_mcn[iaco] = shiftword & 1;
88 shiftword=acorde_word[3];
89 for(Int_t iaco=30;iaco<60;iaco++)
91 word_mcn[iaco] = shiftword & 1;
96 for(Int_t iaco=0;iaco<60;iaco++)
104 }h2->Fill(contSingle);
106 for(Int_t iaco=0;iaco<60;iaco++)
108 if(word_mcn[iaco]==1)
114 }h4->Fill(contMulti);
118 TCanvas *acorde = new TCanvas("ACORDE","ACORDE-Histograms from Raw-Data",1);
121 h1->GetXaxis()->SetTitle("No. of module");
122 h1->GetYaxis()->SetTitle("No. of Hits");
123 h1->SetFillColor(kRed);
128 h2->GetXaxis()->SetTitle("No. of fired modules");
129 h2->GetYaxis()->SetTitle("No. of events");
130 h2->SetFillColor(kBlue);
134 h3->GetXaxis()->SetTitle("No. of module");
135 h3->GetYaxis()->SetTitle("No. of events");
136 h3->SetFillColor(kRed);
141 h4->GetXaxis()->SetTitle("No. of fired modules");
142 h4->GetYaxis()->SetTitle("No. of events");
143 h4->SetFillColor(kBlue);