2 // Script to read a raw data file, and dump it to std::cout
7 ShowRaw(Int_t det=2, bool verbose=false, Int_t event=0)
9 TString file(Form("raw%d/FMD_%d.ddl", event, AliFMD::kBaseDDL + det - 1));
11 std::cout << "Reading raw data file " << file << std::endl;
13 TH1* h = new TH1F("rawData", "Raw Data", 128, 0, 1024);
16 // This method creates a text file containing the same information
17 // stored in an Altro file. The information in the text file is
18 // organized pad by pad and and for each pad it consists in a
19 // sequence of bunches (Bunch length +2, Time bin of the last
20 // amplitude sample in the bunch, amplitude values) It is used
21 // mainly //for debugging
23 AliAltroBuffer buff(file.Data(),0);
24 Int_t numWords,padNum,rowNum,secNum=0;
27 // if (!buff.ReadDataHeader()) {
28 // std::cout<< file << " isn't a valid data file!" << std::endl;
31 while(buff.ReadTrailerBackward(numWords,padNum,rowNum,secNum)){
33 std::cout << "Ring: " << (secNum == 0 ? 'I' : 'O')
34 << " Sector: " << std::setw(2) << rowNum
35 << " Strip: " << std::setw(3) << padNum
36 << " Words: " << std::setw(4) << numWords << std::endl;
37 if (numWords == 0) zero++;
40 std::cout << "Skipping trailer of "
41 << (4 - numWords % 4) << " words" << std::endl;
42 for(Int_t j = 0; j < (4 - numWords % 4); j++)
43 value=buff.GetNextBackWord();
45 for(Int_t i = 0; i <numWords; i++) {
46 value=buff.GetNextBackWord();
48 std::cout << std::setw(5) << value << std::flush;
49 if (i % 16 == 15) std::cout << std::endl;
54 std::cout << std::endl;
56 std::cout << "Error: Read zero channels - should not happen"
62 TCanvas* c = new TCanvas("raw", "Raw Data");