added macro CheckTimeRawData.C to check time from raw data using AliTOFRawStream...
authorrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Sep 2009 08:19:37 +0000 (08:19 +0000)
committerrpreghen <rpreghen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 9 Sep 2009 08:19:37 +0000 (08:19 +0000)
TOF/CheckTimeRawData.C [new file with mode: 0644]

diff --git a/TOF/CheckTimeRawData.C b/TOF/CheckTimeRawData.C
new file mode 100644 (file)
index 0000000..7e2bf7a
--- /dev/null
@@ -0,0 +1,32 @@
+CheckTimeRawData(const Char_t *fileName, Int_t maxEv = kMaxInt)
+{
+
+  AliTOFRawStream::ApplyBCCorrections(kTRUE);
+
+  gStyle->SetPalette(1);
+
+  TH2F *hCrateTime = new TH2F("hCrateTime", ";crate;time (ns)", 72, 0, 72, 2000, 0, 2000);
+  Float_t t;
+  Int_t nPhysEv = 0;
+
+  AliRawReaderRoot reader(fileName);
+  AliTOFRawStream tofs(&reader);
+  while (reader.NextEvent() && nPhysEv < maxEv) {
+    if (reader.GetType() != 7) continue;
+    if (nPhysEv % 100 == 0) printf("nPhysEv = %d\n", nPhysEv);
+    nPhysEv++;
+    for (Int_t i = 0; i < 72; i++) {
+      tofs.LoadRawData(i);
+      TClonesArray *array = tofs.GetRawData();
+      for (Int_t j = 0; j < array->GetEntries(); j++) {
+       AliTOFrawData *tofraw = (AliTOFrawData *)array->At(j);
+       //      tofraw->Dump();
+       t = tofraw->GetLeading() * 24.4e-3; /* ns */
+       hCrateTime->Fill(i, t);
+      }
+    }
+  }
+
+  hCrateTime->Draw("colz");
+
+}