]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDBaseDA.h
Updated Detector Algorithm base class to write the conditions data to file. The class...
[u/mrichter/AliRoot.git] / FMD / AliFMDBaseDA.h
1 #ifndef ALIFMDBASEDA_H
2 #define ALIFMDBASEDA_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5  * reserved. 
6  *
7  * See cxx source for full Copyright notice                               
8  */
9 //
10 //This class provides a base interface for the Detector Algorithms (DA) of the FMD. 
11 //At least three implementations are needed: AliFMDPedestalDA, AliFMDGainDA and AliFMDPhysicsDA . 
12 //These classes will provide the calibration data for the AliFMDPreprocessor to be used in the shuttle.
13 //The input for this class are raw data (AliRawReader) and the output is a comma-separated file
14 //(std::ofstream) that contains the values defined in the implementations of this class.
15 //
16 //Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
17 //
18
19 #include "TNamed.h"
20 #include "TObjArray.h"
21 #include "TClonesArray.h"
22 #include "TFile.h"
23 #include "iostream"
24 #include "fstream"
25
26 #include "AliRawReader.h"
27 #include "AliFMDDigit.h"
28 #include "AliFMDParameters.h"
29
30
31 class AliFMDBaseDA: public TNamed {
32   
33  public:
34   AliFMDBaseDA() ;
35   AliFMDBaseDA(const AliFMDBaseDA & baseDA) ;
36   AliFMDBaseDA& operator = (const AliFMDBaseDA & baseDA) ; 
37   
38   ~AliFMDBaseDA() ;
39   
40   void Run(AliRawReader* fmdReader);
41   void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
42   void SetRequiredEvents(Int_t nEvents) {fRequiredEvents = nEvents;}
43   Int_t GetRequiredEvents() {return fRequiredEvents ;}
44  protected:
45   
46   virtual void Init()  {};
47   virtual void FillChannels(AliFMDDigit* )  {};
48   virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t )  {};
49   virtual void WriteHeaderToFile()  {};
50   virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t, UShort_t, UShort_t )  {};
51   virtual void FinishEvent()  {};
52   
53   
54   Int_t GetCurrentEvent() {return fCurrentEvent;}
55   
56   static const UInt_t kBaseDDL = 3072;
57   Char_t* fDiagnosticsFilename;
58   std::ofstream fOutputFile;
59   std::ofstream fConditionsFile;
60   Bool_t fSaveHistograms;
61   TObjArray fDetectorArray;
62   
63   
64  private:
65  
66   void WriteConditionsData();
67   void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
68   void InitContainer();
69   Int_t fRequiredEvents;
70   Int_t fCurrentEvent;   
71    
72   ClassDef(AliFMDBaseDA,0)
73
74 };
75 #endif
76