]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDBaseDA.h
updated dndeta analysis
[u/mrichter/AliRoot.git] / FMD / AliFMDBaseDA.h
index e1923d3aa6085e6107aa6bca06fa6168e93fad2d..dc9e6ba2f05e9910073075efbe3969baa53cd389 100644 (file)
@@ -1,3 +1,4 @@
+// -*- mode: C++ -*- 
 #ifndef ALIFMDBASEDA_H
 #define ALIFMDBASEDA_H
 
@@ -7,13 +8,16 @@
  * See cxx source for full Copyright notice                               
  */
 //
-//This class provides a base interface for the Detector Algorithms (DA) of the FMD. 
-//At least three implementations are needed: AliFMDPedestalDA, AliFMDGainDA and AliFMDPhysicsDA . 
-//These classes will provide the calibration data for the AliFMDPreprocessor to be used in the shuttle.
-//The input for this class are raw data (AliRawReader) and the output is a comma-separated file
-//(std::ofstream) that contains the values defined in the implementations of this class.
+// This class provides a base interface for the Detector Algorithms
+// (DA) of the FMD.  At least three implementations are needed:
+// AliFMDPedestalDA, AliFMDGainDA and AliFMDPhysicsDA .  These classes
+// will provide the calibration data for the AliFMDPreprocessor to be
+// used in the shuttle.  The input for this class are raw data
+// (AliRawReader) and the output is a comma-separated file
+// (std::ofstream) that contains the values defined in the
+// implementations of this class.
 //
-//Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
+// Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
 //
 
 #include "TNamed.h"
 #include "AliRawReader.h"
 #include "AliFMDDigit.h"
 #include "AliFMDParameters.h"
-
+#include "TArrayS.h"
+class TDirectory;
+class AliFMDRawReader;
 
 class AliFMDBaseDA: public TNamed {
   
- public:
+public:
   AliFMDBaseDA() ;
   AliFMDBaseDA(const AliFMDBaseDA & baseDA) ;
   //  AliFMDBaseDA& operator = (const AliFMDBaseDA & baseDA) ; 
@@ -40,8 +46,8 @@ class AliFMDBaseDA: public TNamed {
   void Run(AliRawReader* fmdReader);
   void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
   void SetRequiredEvents(Int_t nEvents) {fRequiredEvents = nEvents;}
-  Int_t GetRequiredEvents() {return fRequiredEvents ;}
- protected:
+  Int_t GetRequiredEvents() const {return fRequiredEvents ;}
+protected:
   
   virtual void Init()  {};
   virtual void FillChannels(AliFMDDigit* )  {};
@@ -49,27 +55,50 @@ class AliFMDBaseDA: public TNamed {
   virtual void WriteHeaderToFile()  {};
   virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t, UShort_t, UShort_t )  {};
   virtual void FinishEvent()  {};
+  virtual void Terminate(TFile* ) {};
   
+  Int_t GetCurrentEvent() const {return fCurrentEvent;}
   
-  Int_t GetCurrentEvent() {return fCurrentEvent;}
-  
-  static const UInt_t kBaseDDL = 3072;
+  static const UInt_t fgkBaseDDL = 3072;   // base FMD ddl
   //Char_t* fDiagnosticsFilename;
-  TString fDiagnosticsFilename;
-  std::ofstream fOutputFile;
-  std::ofstream fConditionsFile;
-  Bool_t fSaveHistograms;
-  TObjArray fDetectorArray;
+  TString fDiagnosticsFilename;            // name of diagnostics file
+  std::ofstream fOutputFile;               // output file
+  std::ofstream fConditionsFile;           // conditions file
+  Bool_t fSaveHistograms;                  // save hists or not
+  TObjArray fDetectorArray;                // array indiced by detector
+
+  Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t) const;
+  Int_t GetPulseSize(UShort_t det , 
+                    Char_t ring, 
+                    UShort_t board) {return fPulseSize.At(GetHalfringIndex(det,ring,board));}
+  Int_t GetPulseLength(UShort_t det, 
+                      Char_t ring, 
+                      UShort_t board) {return fPulseLength.At(GetHalfringIndex(det,ring,board));}
+
+  
+  const char* GetDetectorPath(UShort_t det, Bool_t full=kTRUE) const;
+  const char* GetRingPath(UShort_t det, Char_t ring, Bool_t full=kTRUE) const;
+  const char* GetSectorPath(UShort_t det, Char_t ring, UShort_t sec, 
+                           Bool_t full=kTRUE) const;
+  const char* GetStripPath(UShort_t det, Char_t ring, UShort_t sec, 
+                          UShort_t str, Bool_t full=kTRUE) const;
   
+
   
- private:
+  TArrayS fPulseSize;                     // Pulse size for gain calib
+  TArrayS fPulseLength;                   // Pulse length for gain calib
+
+  Bool_t  fSeenDetectors[3];              // Detectors seen so far
+private:
  
-  void WriteConditionsData();
+  void WriteConditionsData(AliFMDRawReader* fmdReader);
   void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
-  void InitContainer();
-  Int_t fRequiredEvents;
-  Int_t fCurrentEvent;   
-   
+  void InitContainer(TDirectory* dir);
+  Int_t fRequiredEvents;            // number of events required for this calib
+  Int_t fCurrentEvent;              // the current event       
+  
+  
+  
   ClassDef(AliFMDBaseDA,0)
 
 };