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;
20 class AliEveTPCSector2D;
21 class AliEveTPCSector3D;
26 AliEveTPCSector2D* s = 0;
27 AliEveTPCSector3D* t = 0;
29 AliRawReaderRoot* reader = 0;
31 Int_t default_sector = 13;
33 void tpc_sector_raw_test(const char *file = "", Int_t ievent = 0)
35 gStyle->SetPalette(1, 0);
37 reader = new AliRawReaderRoot(file);
38 //reader->LoadEquipmentIdsMap
39 // (gSystem->ExpandPathName("$(ALICE_ROOT)/TPC/mapping/EquipmentIdMap.data"));
40 // (gSystem->ExpandPathName("EquipmentIdMap.data"));
43 for(Int_t i=0; i<ievent; ++i, ++event) {
44 if(reader->NextEvent() == kFALSE) {
45 printf("End of raw stream at event %d (reqired event %d).\n", i, ievent);
50 x = new AliEveTPCData;
51 // x->SetLoadPedestal(5);
52 x->SetLoadThreshold(5);
53 x->SetAutoPedestal(kTRUE);
55 s = new AliEveTPCSector2D();
56 s->SetSectorID(default_sector);
57 s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
63 t = new AliEveTPCSector3D();
64 t->SetSectorID(default_sector);
65 t->SetAutoTrans(kTRUE);
68 t->SetDriftVel(2.273);
77 if(reader->NextEvent() == kTRUE) {
80 printf("Reached end of stream, rewinding to first event.\n");
82 reader->RewindEvents();
86 printf("Now loading event %d\n", event);
88 AliTPCRawStream input(reader);
89 input.SetOldRCUFormat(kTRUE);
90 reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
93 x->LoadRaw(input, kTRUE, kTRUE);
95 printf("Updating scene\n");
101 void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
103 if(r >= AliEveTPCSectorData::GetInnSeg().GetNRows()) {
104 r -= AliEveTPCSectorData::GetInnSeg().GetNRows();
109 AliTPCRawStream input(reader);
110 input.SetOldRCUFormat(kTRUE);
111 // reader->Select(0, firstRCU, lastRCU);
113 Int_t sector = input.GetSector();
114 Int_t row = input.GetRow();
116 while (input.Next()) {
117 if (input.IsNewRow()) {
118 sector = input.GetSector();
119 row = input.GetRow();
121 if(sector != s || row != r) continue;
123 Int_t signal = input.GetSignal();
124 Int_t pad = input.GetPad();
125 Int_t time = input.GetTime();
128 printf("%d %d\n", time, signal);