]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Enable reading of DATE and ROOT'ified raw data in AliFMDInput
authorcholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Mar 2008 10:14:54 +0000 (10:14 +0000)
committercholm <cholm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Mar 2008 10:14:54 +0000 (10:14 +0000)
FMD/AliFMDInput.cxx
FMD/AliFMDInput.h

index 5535e6e2c858087e2b72d8b9887d074aeb9b0742..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
@@ -94,6 +96,7 @@ AliFMDInput::AliFMDInput()
     fHeader(0),
     fGeoManager(0),
     fTreeMask(0), 
+    fRawFile(""),
     fIsInit(kFALSE),
     fEventCount(0)
 {
@@ -133,6 +136,7 @@ AliFMDInput::AliFMDInput(const char* gAliceFile)
     fHeader(0),
     fGeoManager(0),
     fTreeMask(0), 
+    fRawFile(""),
     fIsInit(kFALSE),
     fEventCount(0)
 {
@@ -219,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 
index f424653d5bed278e73f72dda01274b405c741bcb..a53f42f819992407da43d269978b086634c49569 100644 (file)
@@ -233,6 +233,11 @@ public:
       @param max  Maximum of axis. 
       @return An array with the bin boundaries. */
   static TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max);
+
+  /** Set the raw data input 
+      @param file File name - if empty, assume simulated raw. */
+  void SetRawFile(const char* file) { if (file) fRawFile = file; }
+     
 protected:
   /** Copy ctor 
       @param o Object to copy from  */
@@ -295,6 +300,7 @@ protected:
   AliHeader*    fHeader;     // Header 
   TGeoManager*  fGeoManager; // Geometry manager
   Int_t         fTreeMask;   // Which tree's to load
+  TString       fRawFile;    // Raw input file
   Bool_t        fIsInit;     // Have we been initialized 
   Int_t         fEventCount; // Event counter 
   ClassDef(AliFMDInput,0)  //Hits for detector FMD