]> 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 e607c323327c6be919d4f6c0ec9388b62411ff51..229e991ee7aa353647be1ac7ed450172c2885683 100644 (file)
@@ -48,6 +48,7 @@
 #include <TArrayI.h>           // ROOT_TArrayI
 #include <TClonesArray.h>      // ROOT_TClonesArray
 // #include <fstream>
+#include "AliDAQ.h"
 
 //____________________________________________________________________
 ClassImp(AliFMDRawWriter)
@@ -58,7 +59,10 @@ 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 
 }
@@ -229,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
@@ -316,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);