5 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
8 * See cxx source for full Copyright notice
11 // This class provides a base interface for the Detector Algorithms
12 // (DA) of the FMD. At least three implementations are needed:
13 // AliFMDPedestalDA, AliFMDGainDA and AliFMDPhysicsDA . These classes
14 // will provide the calibration data for the AliFMDPreprocessor to be
15 // used in the shuttle. The input for this class are raw data
16 // (AliRawReader) and the output is a comma-separated file
17 // (std::ofstream) that contains the values defined in the
18 // implementations of this class.
20 // Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch
24 #include "TObjArray.h"
25 #include "TClonesArray.h"
30 #include "AliRawReader.h"
31 #include "AliFMDDigit.h"
32 #include "AliFMDParameters.h"
37 class AliFMDBaseDA: public TNamed {
41 AliFMDBaseDA(const AliFMDBaseDA & baseDA) ;
42 // AliFMDBaseDA& operator = (const AliFMDBaseDA & baseDA) ;
46 void Run(AliRawReader* fmdReader);
47 void SetSaveDiagnostics(Bool_t save) {fSaveHistograms = save;}
48 void SetRequiredEvents(Int_t nEvents) {fRequiredEvents = nEvents;}
49 Int_t GetRequiredEvents() {return fRequiredEvents ;}
52 virtual void Init() {};
53 virtual void FillChannels(AliFMDDigit* ) {};
54 virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t ) {};
55 virtual void WriteHeaderToFile() {};
56 virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t, UShort_t, UShort_t ) {};
57 virtual void FinishEvent() {};
58 virtual void Terminate(TFile* ) {};
60 Int_t GetCurrentEvent() {return fCurrentEvent;}
62 static const UInt_t kBaseDDL = 3072;
63 //Char_t* fDiagnosticsFilename;
64 TString fDiagnosticsFilename;
65 std::ofstream fOutputFile;
66 std::ofstream fConditionsFile;
67 Bool_t fSaveHistograms;
68 TObjArray fDetectorArray;
70 Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t);
71 Int_t GetPulseSize(UShort_t det ,
73 UShort_t board) {return fPulseSize.At(GetHalfringIndex(det,ring,board));}
74 Int_t GetPulseLength(UShort_t det,
76 UShort_t board) {return fPulseLength.At(GetHalfringIndex(det,ring,board));}
79 const char* GetDetectorPath(UShort_t det, Bool_t full=kTRUE) const;
80 const char* GetRingPath(UShort_t det, Char_t ring, Bool_t full=kTRUE) const;
81 const char* GetSectorPath(UShort_t det, Char_t ring, UShort_t sec,
82 Bool_t full=kTRUE) const;
83 const char* GetStripPath(UShort_t det, Char_t ring, UShort_t sec,
84 UShort_t str, Bool_t full=kTRUE) const;
93 void WriteConditionsData();
94 void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
95 void InitContainer(TDirectory* dir);
96 Int_t fRequiredEvents;
102 ClassDef(AliFMDBaseDA,0)