]>
Commit | Line | Data |
---|---|---|
e9c06036 | 1 | // -*- mode: C++ -*- |
a3b36d36 | 2 | #ifndef ALIFMDBASEDA_H |
3 | #define ALIFMDBASEDA_H | |
4 | ||
5 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights | |
6 | * reserved. | |
7 | * | |
8 | * See cxx source for full Copyright notice | |
9 | */ | |
10 | // | |
e9c06036 | 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. | |
a3b36d36 | 19 | // |
e9c06036 | 20 | // Author: Hans Hjersing Dalsgaard, hans.dalsgaard@cern.ch |
a3b36d36 | 21 | // |
22 | ||
23 | #include "TNamed.h" | |
24 | #include "TObjArray.h" | |
25 | #include "TClonesArray.h" | |
26 | #include "TFile.h" | |
27 | #include "iostream" | |
28 | #include "fstream" | |
a7e41e8d | 29 | #include "TString.h" |
a3b36d36 | 30 | #include "AliRawReader.h" |
31 | #include "AliFMDDigit.h" | |
32 | #include "AliFMDParameters.h" | |
427e8f99 | 33 | #include "TArrayS.h" |
e9c06036 | 34 | class TDirectory; |
3effc6e7 | 35 | class AliFMDRawReader; |
a3b36d36 | 36 | |
37 | class AliFMDBaseDA: public TNamed { | |
38 | ||
e9c06036 | 39 | public: |
a3b36d36 | 40 | AliFMDBaseDA() ; |
41 | AliFMDBaseDA(const AliFMDBaseDA & baseDA) ; | |
fb10ff39 | 42 | // AliFMDBaseDA& operator = (const AliFMDBaseDA & baseDA) ; |
a3b36d36 | 43 | |
44 | ~AliFMDBaseDA() ; | |
45 | ||
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 ;} | |
e9c06036 | 50 | protected: |
a3b36d36 | 51 | |
26be6417 | 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() {}; | |
f7f0b643 | 58 | virtual void Terminate(TFile* ) {}; |
a3b36d36 | 59 | |
60 | Int_t GetCurrentEvent() {return fCurrentEvent;} | |
61 | ||
62 | static const UInt_t kBaseDDL = 3072; | |
a7e41e8d | 63 | //Char_t* fDiagnosticsFilename; |
64 | TString fDiagnosticsFilename; | |
a3b36d36 | 65 | std::ofstream fOutputFile; |
26be6417 | 66 | std::ofstream fConditionsFile; |
a3b36d36 | 67 | Bool_t fSaveHistograms; |
68 | TObjArray fDetectorArray; | |
427e8f99 | 69 | |
70 | Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t); | |
71 | Int_t GetPulseSize(UShort_t det , | |
72 | Char_t ring, | |
73 | UShort_t board) {return fPulseSize.At(GetHalfringIndex(det,ring,board));} | |
74 | Int_t GetPulseLength(UShort_t det, | |
75 | Char_t ring, | |
76 | UShort_t board) {return fPulseLength.At(GetHalfringIndex(det,ring,board));} | |
77 | ||
a3b36d36 | 78 | |
e9c06036 | 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; | |
a3b36d36 | 85 | |
f7f0b643 | 86 | |
87 | ||
427e8f99 | 88 | TArrayS fPulseSize; |
89 | TArrayS fPulseLength; | |
90 | ||
e9c06036 | 91 | private: |
a3b36d36 | 92 | |
3effc6e7 | 93 | void WriteConditionsData(AliFMDRawReader* fmdReader); |
a3b36d36 | 94 | void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; } |
e9c06036 | 95 | void InitContainer(TDirectory* dir); |
a3b36d36 | 96 | Int_t fRequiredEvents; |
97 | Int_t fCurrentEvent; | |
e9c06036 | 98 | |
427e8f99 | 99 | |
100 | ||
a3b36d36 | 101 | ClassDef(AliFMDBaseDA,0) |
102 | ||
103 | }; | |
104 | #endif | |
105 |