2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 // Functions to read rootified raw-data from TPC sector test.
12 // Use tpc_sector_raw_test("filename.root") for initialization,
13 // next_event() to advance along the data stream.
14 // When there is no more data ROOT will crash.
16 class AliRawReaderRoot;
19 class AliEveTPCSector2D;
20 class AliEveTPCSector3D;
23 AliEveTPCSector2D* s = 0;
24 AliEveTPCSector3D* t = 0;
26 AliRawReaderRoot* reader = 0;
28 Int_t default_sector = 13;
30 void tpc_sector_raw_test(const char *file = "", Int_t ievent = 0)
32 gStyle->SetPalette(1, 0);
34 reader = new AliRawReaderRoot(file);
35 //reader->LoadEquipmentIdsMap
36 // (gSystem->ExpandPathName("$(ALICE_ROOT)/TPC/mapping/EquipmentIdMap.data"));
37 // (gSystem->ExpandPathName("EquipmentIdMap.data"));
40 for(Int_t i=0; i<ievent; ++i, ++event) {
41 if(reader->NextEvent() == kFALSE) {
42 printf("End of raw stream at event %d (reqired event %d).\n", i, ievent);
47 x = new AliEveTPCData;
48 // x->SetLoadPedestal(5);
49 x->SetLoadThreshold(5);
50 x->SetAutoPedestal(kTRUE);
52 s = new AliEveTPCSector2D();
53 s->SetSectorID(default_sector);
54 s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
60 t = new AliEveTPCSector3D();
61 t->SetSectorID(default_sector);
62 t->SetAutoTrans(kTRUE);
65 t->SetDriftVel(2.273);
74 if(reader->NextEvent() == kTRUE) {
77 printf("Reached end of stream, rewinding to first event.\n");
79 reader->RewindEvents();
83 printf("Now loading event %d\n", event);
85 AliTPCRawStream input(reader);
86 reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
89 x->LoadRaw(input, kTRUE, kTRUE);
91 printf("Updating scene\n");
97 void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
99 if(r >= AliEveTPCSectorData::GetInnSeg().GetNRows()) {
100 r -= AliEveTPCSectorData::GetInnSeg().GetNRows();
105 AliTPCRawStream input(reader);
106 // reader->Select(0, firstRCU, lastRCU);
108 Int_t sector = input.GetSector();
109 Int_t row = input.GetRow();
111 while (input.Next()) {
112 if (input.IsNewRow()) {
113 sector = input.GetSector();
114 row = input.GetRow();
116 if(sector != s || row != r) continue;
118 Int_t signal = input.GetSignal();
119 Int_t pad = input.GetPad();
120 Int_t time = input.GetTime();
123 printf("%d %d\n", time, signal);