]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDInput.cxx
Adding comment lines
[u/mrichter/AliRoot.git] / FMD / AliFMDInput.cxx
index ae5d30f5f288b6fdafdd831a4c4ae65a203075a5..18e0b4bbc7a4a8d310a2d8409876bc966f208d71 100644 (file)
@@ -35,6 +35,8 @@
 #include "AliRun.h"             // ALIRUN_H
 #include "AliStack.h"           // ALISTACK_H
 #include "AliRawReaderFile.h"   // ALIRAWREADERFILE_H
+#include "AliRawReaderRoot.h"   // ALIRAWREADERROOT_H
+#include "AliRawReaderDate.h"   // ALIRAWREADERDATE_H
 #include "AliFMD.h"             // ALIFMD_H
 #include "AliFMDHit.h"         // ALIFMDHIT_H
 #include "AliFMDDigit.h"       // ALIFMDDigit_H
@@ -91,9 +93,12 @@ AliFMDInput::AliFMDInput()
     fArrayS(0), 
     fArrayR(0), 
     fArrayA(0), 
+    fHeader(0),
     fGeoManager(0),
     fTreeMask(0), 
-    fIsInit(kFALSE)
+    fRawFile(""),
+    fIsInit(kFALSE),
+    fEventCount(0)
 {
 
   // Constructor of an FMD input object.  Specify what data to read in
@@ -128,9 +133,12 @@ AliFMDInput::AliFMDInput(const char* gAliceFile)
     fArrayS(0), 
     fArrayR(0), 
     fArrayA(0), 
+    fHeader(0),
     fGeoManager(0),
     fTreeMask(0), 
-    fIsInit(kFALSE)
+    fRawFile(""),
+    fIsInit(kFALSE),
+    fEventCount(0)
 {
   
   // Constructor of an FMD input object.  Specify what data to read in
@@ -215,7 +223,13 @@ AliFMDInput::Init()
   if (TESTBIT(fTreeMask, kRaw)) {
     AliInfo("Getting FMD raw data digits");
     fArrayA = new TClonesArray("AliFMDDigit");
-    fReader = new AliRawReaderFile(-1);
+    if (!fRawFile.IsNull() && fRawFile.EndsWith(".root")) 
+      fReader = new AliRawReaderRoot(fRawFile.Data());
+    else if (!fRawFile.IsNull() && fRawFile.EndsWith(".raw"))
+      fReader = new AliRawReaderDate(fRawFile.Data());
+    else
+      fReader = new AliRawReaderFile(-1);
+    
   }
   
   // Optionally, get the geometry 
@@ -291,6 +305,13 @@ AliFMDInput::Begin(Int_t event)
     if (!fArrayH) fArrayH = fFMD->Hits(); 
   }
 
+  // Possibly load heaedr information 
+  if (TESTBIT(fTreeMask, kHeader)) {
+    // AliInfo("Getting FMD hits");
+    if (!fLoader /* || fLoader->LoadHeader()*/) return kFALSE;
+    fHeader = fLoader->GetHeader();
+  }
+
   // Possibly load FMD Digit information 
   if (TESTBIT(fTreeMask, kDigits)) {
     // AliInfo("Getting FMD digits");