Introduction of raw stream base class
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2008 15:37:43 +0000 (15:37 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 25 Jan 2008 15:37:43 +0000 (15:37 +0000)
TRD/Macros/AliTRDreadRaw.C [new file with mode: 0644]
TRD/Macros/AliTRDreadRaw2Clusters.C [new file with mode: 0644]

diff --git a/TRD/Macros/AliTRDreadRaw.C b/TRD/Macros/AliTRDreadRaw.C
new file mode 100644 (file)
index 0000000..182b111
--- /dev/null
@@ -0,0 +1,40 @@
+void AliTRDreadRaw(const char *fname = "raw.root")
+{
+  AliCDBManager *cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  cdb->SetRun(0);
+  
+  AliTRDdigitsManager manR;
+  manR.CreateArrays();
+
+  AliRawReaderRoot reader(fname, 0);
+  reader.Select("TRD");
+
+  while (reader.NextEvent())
+    {
+      AliTRDrawStreamBase *pstream = AliTRDrawStreamBase::GetRawStream(&reader);
+      AliTRDrawStreamBase &stream = *pstream;
+      
+      Int_t ichambers = 0;
+      while (stream.NextChamber(&manR) >= 0)
+       ichambers++;
+      
+      cout << "Chambers loaded " << stream.IsA()->GetName() << " " 
+          << ichambers << endl;
+      
+      delete pstream
+    }
+}
+
+void readRaw2(const char *fname = "raw.root")
+{
+  AliCDBManager *cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  cdb->SetRun(0);
+
+  AliRawReaderRoot reader(fname, 0);
+  reader.Select("TRD");
+
+  AliTRDrawData rawData;
+  AliTRDdigitsManager *man = rawData.Raw2Digits(&reader);
+}
diff --git a/TRD/Macros/AliTRDreadRaw2Clusters.C b/TRD/Macros/AliTRDreadRaw2Clusters.C
new file mode 100644 (file)
index 0000000..a107bc3
--- /dev/null
@@ -0,0 +1,40 @@
+void AliTRDreadRaw2Clusters(const char *fname = "raw.root", const char *fnameGeom = "./geometry.root")
+{
+  AliCDBManager *cdb = AliCDBManager::Instance();
+  cdb->SetDefaultStorage("local://$ALICE_ROOT");
+  cdb->SetRun(0);
+
+  TFile *fGeometryFile = TFile::Open(fnameGeom);
+  TGeoManager *fGeoManager = 0;
+  if (fGeometryFile)
+    {
+      fGeoManager = (TGeoManager *)fGeometryFile->Get("Geometry");
+    }
+
+  if (fGeoManager == 0)
+    {
+      cout << "Geo Manager init failed." << endl;
+    }
+
+  AliTRDdigitsManager manR;
+  manR.CreateArrays();
+
+  AliRawReaderRoot reader(fname, 0);
+  reader.Select("TRD");
+
+  Int_t ievent = 0;
+  while (reader.NextEvent())
+    {
+      TTree *treeR = new TTree(sdir, "TRD clusters");
+      AliTRDclusterizer clusterizer("TRDclusterizer", "TRDclusterizer");
+      clusterizer.OpenOutput(treeR);
+      Int_t ir = clusterizer.Raw2ClustersChamber(&reader);
+      
+      cout << "Clusterizer returned " << ir << endl;
+
+      // do something witht he clusters...
+
+      ievent++;
+    }
+
+}