]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDRawWriter.cxx
Compilation of AliAnalysisGoodies.cxx only if Root was compiled with XML support
[u/mrichter/AliRoot.git] / FMD / AliFMDRawWriter.cxx
index 9b3cbadfca011a059f316a1b06fadce219c38788..229e991ee7aa353647be1ac7ed450172c2885683 100644 (file)
@@ -47,7 +47,8 @@
 // #include "AliFMDAltroIO.h"   // ALIFMDALTROWRITER_H
 #include <TArrayI.h>           // ROOT_TArrayI
 #include <TClonesArray.h>      // ROOT_TClonesArray
-#include <fstream>
+// #include <fstream>
+#include "AliDAQ.h"
 
 //____________________________________________________________________
 ClassImp(AliFMDRawWriter)
@@ -58,8 +59,14 @@ ClassImp(AliFMDRawWriter)
 //____________________________________________________________________
 AliFMDRawWriter::AliFMDRawWriter(AliFMD* fmd) 
   : TTask("FMDRawWriter", "Writer of Raw ADC values from the FMD"),
-    fFMD(fmd)
-{}
+    fFMD(fmd),
+    fSampleRate(0), 
+    fChannelsPerAltro(0), 
+    fThreshold(0)
+{
+  // CTOR 
+}
+
 
 
 //____________________________________________________________________
@@ -154,6 +161,7 @@ AliFMDRawWriter::Exec(Option_t*)
 void
 AliFMDRawWriter::WriteDigits(TClonesArray* digits)
 {
+  // WRite an array of digits to disk file 
   Int_t nDigits = digits->GetEntries();
   if (nDigits < 1) return;
 
@@ -225,11 +233,11 @@ AliFMDRawWriter::WriteDigits(TClonesArray* digits)
       }
       prevddl = ddl;
       // Need to open a new DDL! 
-      TString filename(Form("%s_%d.ddl", fFMD->GetName(),  ddl));
+      TString filename(AliDAQ::DdlFileName(fFMD->GetName(),  ddl));
       AliDebug(15, Form("New altro buffer with DDL file %s", filename.Data()));
       // Create a new altro buffer - a `1' as the second argument
       // means `write mode' 
-      altro = new AliAltroBuffer(filename.Data(), 1);
+      altro = new AliAltroBuffer(filename.Data());
       altro->SetMapping(pars->GetAltroMap());      
       // Write a dummy (first argument is true) header to the DDL
       // file - later on, when we close the file, we write the real
@@ -312,10 +320,10 @@ AliFMDRawWriter::WriteDigits(TClonesArray* digits)
     // If we haven't got a writer (either because none were made so
     // far, or because we've switch DDL), make one. 
     if (!writer) {
-      AliDebug(1, Form("Opening new ALTRO writer w/file FMD_%d.ddl", ddl));
-      file   = new std::ofstream(Form("FMD_%d.ddl", ddl));
+      AliDebug(1, Form("Opening new ALTRO writer w/file %s", AliDAQ::DdlFileName("FMD",ddl)));
+      file   = new std::ofstream(AliDAQ::DdlFileName("FMD",ddl));
       if (!file || !*file) {
-       AliFatal(Form("Failed to open file FMD_%d.ddl", ddl));
+       AliFatal(Form("Failed to open file %s", AliDAQ::DdlFileName("FMD",ddl)));
        return;
       }
       writer  = new AliFMDAltroWriter(*file);