1 #if !defined(__CINT__) || defined(__MAKECINT__)
4 #include "TClonesArray.h"
6 // AliRoot include files
10 #include "AliRawReader.h"
11 #include "AliRawReaderFile.h"
13 #include "AliTOFrawData.h"
14 #include "AliTOFRawMap.h"
15 #include "AliTOFRawStream.h"
21 void AliTOFRawDataReadBuffer(Int_t iEvent=0);
23 void AliTOFRawDataReadBuffer(Int_t iEvent)
27 // To read TOF raw data
31 AliTOFHitData *HitData;
32 AliTOFHitDataBuffer *DataBuffer;
33 AliTOFHitDataBuffer *PackedDataBuffer;
35 /* create a tree for decoded data */
36 TTree DataTree("DataTree", "Decoded Data");
37 DataTree.Branch("HitData", "AliTOFHitData", &HitData);
39 /* create a tree for decoded packed data */
40 TTree PackedDataTree("PackedDataTree", "Decoded Packed Data");
41 PackedDataTree.Branch("HitData", "AliTOFHitData", &HitData);
43 AliRawReaderFile reader(iEvent);
44 AliTOFRawStream stream(&reader);
46 reader.RewindEvents();
49 /* loop over events */
50 for (Int_t iEvent = 0; reader.NextEvent(); iEvent++) {
51 printf("processing event %d\n", iEvent);
53 /* reset buffers (actually not needed)*/
54 stream.ResetBuffers();
57 gBenchmark->Start("time");
58 stream.DecodeDDL(0, AliDAQ::NumberOfDdls("TOF") - 1,0);
59 gBenchmark->Stop("time");
62 for (Int_t iDDL = 0; iDDL < AliDAQ::NumberOfDdls("TOF"); iDDL++){
64 /* read decoded data */
65 DataBuffer = stream.GetDataBuffer(iDDL);
66 PackedDataBuffer = stream.GetPackedDataBuffer(iDDL);
68 /* get buffer entries */
69 Int_t nDBEntries = DataBuffer->GetEntries();
70 Int_t nPDBEntries = PackedDataBuffer->GetEntries();
72 /* read data buffer hits */
73 for (Int_t iHit = 0; iHit < nDBEntries; iHit++){
74 HitData = DataBuffer->GetHit(iHit);
75 HitData->SetDDLID(iDDL);
76 /* add volume information to hit */
77 stream.EquipmentId2VolumeId(HitData, HitData->GetVolume());
83 /* read data buffer hits */
84 for (Int_t iHit = 0; iHit < nPDBEntries; iHit++){
85 HitData = PackedDataBuffer->GetHit(iHit);
86 HitData->SetDDLID(iDDL);
87 /* add volume information to hit */
88 stream.EquipmentId2VolumeId(HitData, HitData->GetVolume());
89 PackedDataTree.Fill();
92 PackedDataBuffer->Reset();
96 gBenchmark->Print("time");
98 TFile fileOut("TOF_rawQA.root", "RECREATE");
100 PackedDataTree.Write();