]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Using the new altro raw-data format. Removing some obsolete macros.
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Jul 2009 13:02:36 +0000 (13:02 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 2 Jul 2009 13:02:36 +0000 (13:02 +0000)
EVE/EveDet/AliEveTPCData.cxx
EVE/EveDet/AliEveTPCData.h
EVE/EveDet/AliEveTPCLoader.cxx
EVE/alice-macros/tpc_raw.C
EVE/test-macros/tpc_gui.C
EVE/test-macros/tpc_raw_test.C [deleted file]
EVE/test-macros/tpc_sector_raw_test.C [deleted file]

index 34a6c28dd6c842f00c6a31196bd8a449d9ce0faa..d8aaa766787cd0a480f48d118ef040964cde58ab 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <AliSimDigits.h>
 #include <AliTPCParam.h>
 
 #include <AliSimDigits.h>
 #include <AliTPCParam.h>
-#include <AliTPCRawStream.h>
+#include <AliTPCRawStreamV3.h>
 #include <TTree.h>
 
 //==============================================================================
 #include <TTree.h>
 
 //==============================================================================
@@ -167,9 +167,9 @@ void AliEveTPCData::LoadDigits(TTree* tree, Bool_t spawnSectors)
   }
 }
 
   }
 }
 
-void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t warn)
+void AliEveTPCData::LoadRaw(AliTPCRawStreamV3& input, Bool_t spawnSectors, Bool_t warn)
 {
 {
-  // Load data from AliTPCRawStream.
+  // Load data from AliTPCRawStreamV3.
   // If spawnSectors is false only sectors that have been created previously
   // via CreateSector() are loaded.
   // If spawnSectors is true sectors are created if data for them is encountered.
   // If spawnSectors is false only sectors that have been created previously
   // via CreateSector() are loaded.
   // If spawnSectors is true sectors are created if data for them is encountered.
@@ -187,7 +187,7 @@ void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t
 
   Short_t threshold = fLoadThreshold;
 
 
   Short_t threshold = fLoadThreshold;
 
-  while (input.Next()) {
+  while (input.NextDDL()) {
     if (input.IsNewSector()) {
       if (inFill) {
        secData->EndPad(fAutoPedestal, threshold);
     if (input.IsNewSector()) {
       if (inFill) {
        secData->EndPad(fAutoPedestal, threshold);
@@ -205,58 +205,67 @@ void AliEveTPCData::LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors, Bool_t
     if (secData == 0)
       continue;
 
     if (secData == 0)
       continue;
 
-    if (input.IsNewPad()) {
-      if (inFill) {
-       secData->EndPad(fAutoPedestal, threshold);
-       inFill = kFALSE;
-      }
-      row = input.GetRow() + rowOffset;
-      pad = input.GetPad();
-
-      if (pad >= AliEveTPCSectorData::GetNPadsInRow(row) || pad < 0) {
-       if (warn) {
-         Warning(kEH.Data(), "pad out of range (row=%d, pad=%d, maxpad=%d).",
-                 row, pad, AliEveTPCSectorData::GetNPadsInRow(row));
+    while (input.NextChannel()) {
+      if (input.IsNewPad()) {
+       if (inFill) {
+         secData->EndPad(fAutoPedestal, threshold);
+         inFill = kFALSE;
+       }
+       row = input.GetRow() + rowOffset;
+       pad = input.GetPad();
+
+       if (pad >= AliEveTPCSectorData::GetNPadsInRow(row) || pad < 0) {
+         if (warn) {
+           Warning(kEH.Data(), "pad out of range (row=%d, pad=%d, maxpad=%d).",
+                   row, pad, AliEveTPCSectorData::GetNPadsInRow(row));
+         }
+         continue;
        }
        }
-       continue;
-      }
-
-      threshold = fLoadThreshold;
 
 
-      secData->BeginPad(row, pad, kTRUE);
-      inFill   = kTRUE;
-      pdrwCnt  = 0;     pdrwCntWarn  = kFALSE;
-      lastTime = 1024;  lastTimeWarn = kFALSE;
-    }
+       threshold = fLoadThreshold;
 
 
-    time   = input.GetTime();
-    signal = input.GetSignal();
-    ++pdrwCnt;
-    if (pdrwCnt > 1024) {
-      if (pdrwCntWarn == kFALSE) {
-        if (warn)
-         Warning(kEH.Data(), "more than 1024 time-bins (row=%d, pad=%d, time=%d).\nFurther warnings of this type will be suppressed for this padrow.",
-                 row, pad, time);
-        pdrwCntWarn = kTRUE;
+       secData->BeginPad(row, pad, kTRUE);
+       inFill   = kTRUE;
+       pdrwCnt  = 0;     pdrwCntWarn  = kFALSE;
+       lastTime = 1024;  lastTimeWarn = kFALSE;
       }
       }
-      continue;
-    }
-    if (time >= lastTime) {
-      if (lastTimeWarn == kFALSE) {
-       if (warn)
-         Warning(kEH.Data(), "time out of order (row=%d, pad=%d, time=%d, lastTime=%d).\nFurther warnings of this type will be suppressed for this padrow.",
-                 row, pad, time, lastTime);
-        lastTimeWarn = kTRUE;
+
+      while (input.NextBunch()) {
+       const UShort_t *signalarr = input.GetSignals();
+
+       Int_t starttime = input.GetStartTimeBin();
+       for (Int_t i = 0; i < input.GetBunchLength(); i++) {
+         time   = starttime--;;
+         signal = signalarr[i];
+         ++pdrwCnt;
+         if (pdrwCnt > 1024) {
+           if (pdrwCntWarn == kFALSE) {
+             if (warn)
+               Warning(kEH.Data(), "more than 1024 time-bins (row=%d, pad=%d, time=%d).\nFurther warnings of this type will be suppressed for this padrow.",
+                       row, pad, time);
+             pdrwCntWarn = kTRUE;
+           }
+           continue;
+         }
+         if (time >= lastTime) {
+           if (lastTimeWarn == kFALSE) {
+             if (warn)
+               Warning(kEH.Data(), "time out of order (row=%d, pad=%d, time=%d, lastTime=%d).\nFurther warnings of this type will be suppressed for this padrow.",
+                       row, pad, time, lastTime);
+             lastTimeWarn = kTRUE;
+           }
+           continue;
+         }
+         lastTime = time;
+         if (fAutoPedestal) {
+           secData->RegisterData(time, signal);
+         } else {
+           signal -= fLoadPedestal;
+           if (signal > threshold)
+             secData->RegisterData(time, signal);
+         }
+       }
       }
       }
-      continue;
-    }
-    lastTime = time;
-    if (fAutoPedestal) {
-      secData->RegisterData(time, signal);
-    } else {
-      signal -= fLoadPedestal;
-      if (signal > threshold)
-       secData->RegisterData(time, signal);
     }
   }
 
     }
   }
 
index 9bae0f743e8b7f187fae966483c21fa79aa512f2..1e73bf92bd721c2a51eb9f253543492040ff637b 100644 (file)
@@ -17,8 +17,7 @@
 #include <vector>
 
 class TTree;
 #include <vector>
 
 class TTree;
-class AliTPCRawStream;
-class AliTPCRawStreamOld;
+class AliTPCRawStreamV3;
 
 class AliEveTPCSectorData;
 
 
 class AliEveTPCSectorData;
 
@@ -53,7 +52,7 @@ public:
   void   SetAutoPedestal(Bool_t ap)  { fAutoPedestal = ap; }
 
   void LoadDigits(TTree* tree, Bool_t spawnSectors=kTRUE);
   void   SetAutoPedestal(Bool_t ap)  { fAutoPedestal = ap; }
 
   void LoadDigits(TTree* tree, Bool_t spawnSectors=kTRUE);
-  void LoadRaw(AliTPCRawStream& input, Bool_t spawnSectors=kTRUE, Bool_t warn=kFALSE);
+  void LoadRaw(AliTPCRawStreamV3& input, Bool_t spawnSectors=kTRUE, Bool_t warn=kFALSE);
 
 protected:
   std::vector<AliEveTPCSectorData*>  fSectors; // Vector of sector-data.
 
 protected:
   std::vector<AliEveTPCSectorData*>  fSectors; // Vector of sector-data.
index 03a6a5f1d94df76e00d92a1fc96e51508ea05347..561446cad681897b8d1b306aeac20734078177ec 100644 (file)
@@ -15,7 +15,7 @@
 #include <TEveGedEditor.h>
 
 #include <AliRawReaderRoot.h>
 #include <TEveGedEditor.h>
 
 #include <AliRawReaderRoot.h>
-#include <AliTPCRawStream.h>
+#include <AliTPCRawStreamV3.h>
 
 #include <TSystem.h>
 
 
 #include <TSystem.h>
 
@@ -137,7 +137,7 @@ void AliEveTPCLoader::LoadEvent()
 
   printf("Now loading event %d\n", fEvent);
   fReader->Reset();
 
   printf("Now loading event %d\n", fEvent);
   fReader->Reset();
-  AliTPCRawStream input(fReader);
+  AliTPCRawStreamV3 input(fReader);
   fReader->Select("TPC");
 
   fData->DropAllSectors();
   fReader->Select("TPC");
 
   fData->DropAllSectors();
index dda4886d47d1abdb782eb9eef31402551b5bfc51..511d682a9110a569257efcb21055a1eac763376b 100644 (file)
@@ -23,7 +23,7 @@ void tpc_raw(Int_t mode = 3)
 
   AliRawReader *reader = AliEveEventManager::AssertRawReader();
   reader->Reset();
 
   AliRawReader *reader = AliEveEventManager::AssertRawReader();
   reader->Reset();
-  AliTPCRawStream input(reader);
+  AliTPCRawStreamV3 input(reader);
   reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
 
   AliEveTPCData *x = new AliEveTPCData;
   reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
 
   AliEveTPCData *x = new AliEveTPCData;
index b7c42b6118a547154f6ca2d60157eb1392650450..58a99f5e4f41c4eae18b657454a0bc3bf2b40ffc 100644 (file)
 
 #ifdef __CINT__
 
 
 #ifdef __CINT__
 
-class AliRawReaderRoot;
-
 class AliEveTPCData;
 class AliEveTPCSector2D;
 class AliEveTPCSector3D;
 
 #else
 
 class AliEveTPCData;
 class AliEveTPCSector2D;
 class AliEveTPCSector3D;
 
 #else
 
-#include <TEve.h>
 #include <TEveManager.h>
 #include <EveDet/AliEveTPCData.h>
 #include <EveDet/AliEveTPCSector2D.h>
 #include <EveDet/AliEveTPCSector3D.h>
 #include <TEveManager.h>
 #include <EveDet/AliEveTPCData.h>
 #include <EveDet/AliEveTPCSector2D.h>
 #include <EveDet/AliEveTPCSector3D.h>
-
-#include <RAW/AliRawReaderRoot.h>
-#include <TPC/AliTPCRawStream.h>
+#include <EveDet/AliEveTPCLoader.h>
 
 #include <TSystem.h>
 #include <TStyle.h>
 
 #include <TSystem.h>
 #include <TStyle.h>
diff --git a/EVE/test-macros/tpc_raw_test.C b/EVE/test-macros/tpc_raw_test.C
deleted file mode 100644 (file)
index 8682781..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-
-class AliRawReaderFile;
-
-class AliEveTPCData;
-
-AliEveTPCData    *x      = 0;
-AliRawReaderFile *reader = 0;
-
-void tpc_raw_test()
-{
-  gROOT->Macro("alieve_loadlibs.C");
-  gSystem->Load("libAlieve");
-
-  reader = new AliRawReaderFile("raw0");
-  reader->Reset();
-  reader->NextEvent();
-  AliTPCRawStream input(reader);
-
-  x = new AliEveTPCData;
-  //x->SetSectorBlockSize(8192);
-  //x->SetLoadThreshold(5);
-  x->CreateAllSectors();
-  x->LoadRaw(input, kFALSE);
-
-  gStyle->SetPalette(1, 0);
-
-  AliEveTPCSector2D* s = new AliEveTPCSector2D();
-  s->SetDataSource(x);
-  s->SetMainColor(36);
-  gEve->AddElement(s);
-  gEve->DrawElement(s);
-
-}
-
-void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
-{
-  reader->Reset();
-  reader->NextEvent();
-
-  if(r >= AliEveTPCSectorData::GetInnSeg().fNRows) {
-    r -= AliEveTPCSectorData::GetInnSeg().fNRows;
-    s += 36;
-  }
-
-  AliTPCRawStream input(reader);
-  Int_t sector = input.GetSector();
-  Int_t row    = input.GetRow();
-
-  while (input.Next()) {
-    if (input.IsNewRow()) {
-      sector = input.GetSector();
-      row    = input.GetRow();
-    }
-    if(sector != s || row != r) continue;
-
-    Int_t signal = input.GetSignal();
-    Int_t pad    = input.GetPad();
-    Int_t time   = input.GetTime();
-
-    if(pad == p)
-      printf("%d %d\n", time, signal);
-  }
-}
diff --git a/EVE/test-macros/tpc_sector_raw_test.C b/EVE/test-macros/tpc_sector_raw_test.C
deleted file mode 100644 (file)
index 330cafe..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-// $Id$
-// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
-
-/**************************************************************************
- * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
- * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
- * full copyright notice.                                                 *
- **************************************************************************/
-
-// Functions to read rootified raw-data from TPC sector test.
-//
-// Use tpc_sector_raw_test("filename.root") for initialization,
-// next_event() to advance along the data stream.
-// When there is no more data ROOT will crash.
-
-class AliRawReaderRoot;
-
-class AliEveTPCData;
-class AliEveTPCSector2D;
-class AliEveTPCSector3D;
-
-AliEveTPCData*     x = 0;
-AliEveTPCSector2D* s = 0;
-AliEveTPCSector3D* t = 0;
-
-AliRawReaderRoot* reader =  0;
-Int_t             event  = -1;
-Int_t     default_sector =  13;
-
-void tpc_sector_raw_test(const char *file = "", Int_t ievent = 0)
-{
-  gStyle->SetPalette(1, 0);
-
-  reader = new AliRawReaderRoot(file);
-  //reader->LoadEquipmentIdsMap
-  //  (gSystem->ExpandPathName("$(ALICE_ROOT)/TPC/mapping/EquipmentIdMap.data"));
-  //  (gSystem->ExpandPathName("EquipmentIdMap.data"));
-
-  reader->Reset();
-  for(Int_t i=0; i<ievent; ++i, ++event) {
-    if(reader->NextEvent() == kFALSE) {
-      printf("End of raw stream at event %d (reqired event %d).\n", i, ievent);
-      return;
-    }
-  }
-
-  x = new AliEveTPCData;
-  // x->SetLoadPedestal(5);
-  x->SetLoadThreshold(5);
-  x->SetAutoPedestal(kTRUE);
-
-  s = new AliEveTPCSector2D();
-  s->SetSectorID(default_sector);
-  s->SetAutoTrans(kTRUE); // place on proper 3D coordinates
-  s->SetDataSource(x);
-  s->SetFrameColor(36);
-  gEve->AddElement(s);
-  gEve->DrawElement(s);
-
-  t = new AliEveTPCSector3D();
-  t->SetSectorID(default_sector);
-  t->SetAutoTrans(kTRUE);
-  t->SetDataSource(x);
-  t->SetMaxTime(1023);
-  t->SetDriftVel(2.273);
-  gEve->AddElement(t);
-  gEve->DrawElement(t);
-
-  next_event();
-}
-
-void next_event()
-{
-  if(reader->NextEvent() == kTRUE) {
-    ++event;
-  } else {
-    printf("Reached end of stream, rewinding to first event.\n");
-    event = 0;
-    reader->RewindEvents();
-    reader->NextEvent();
-  }
-
-  printf("Now loading event %d\n", event);
-  reader->Reset();
-  AliTPCRawStream input(reader);
-  reader->Select("TPC"); // ("TPC", firstRCU, lastRCU);
-
-  x->DropAllSectors();
-  x->LoadRaw(input, kTRUE, kTRUE);
-
-  printf("Updating scene\n");
-  s->IncRTS();
-  t->IncRTS();
-  gEve->Redraw3D();
-}
-
-void tpc_raw_pad_dump(Int_t s, Int_t r, Int_t p)
-{
-  if(r >= AliEveTPCSectorData::GetInnSeg().GetNRows()) {
-    r -=  AliEveTPCSectorData::GetInnSeg().GetNRows();
-    s += 36;
-  }
-
-  reader->Reset();
-  AliTPCRawStream input(reader);
-  // reader->Select(0, firstRCU, lastRCU);
-
-  Int_t sector = input.GetSector();
-  Int_t row    = input.GetRow();
-
-  while (input.Next()) {
-    if (input.IsNewRow()) {
-      sector = input.GetSector();
-      row    = input.GetRow();
-    }
-    if(sector != s || row != r) continue;
-
-    Int_t signal = input.GetSignal();
-    Int_t pad    = input.GetPad();
-    Int_t time   = input.GetTime();
-
-    if(pad == p)
-      printf("%d %d\n", time, signal);
-  }
-}