Line data Source code
1 : #ifndef ALIMUONTRACKERDATAMAKER_H
2 : #define ALIMUONTRACKERDATAMAKER_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : // $Id$
8 :
9 : /// \ingroup rec
10 : /// \class AliMUONTrackerDataMaker
11 : /// \brief Implementation of VTrackerDataMaker to read raw data
12 : ///
13 : // Author Laurent Aphecetche, Subatech
14 :
15 : #ifndef ALIMUONVTRACKERDATAMAKER_H
16 : # include "AliMUONVTrackerDataMaker.h"
17 : #endif
18 : #ifndef ROOT_TString
19 : # include "TString.h"
20 : #endif
21 :
22 : class AliMUONRecoParam;
23 : class AliMUONCalibrationData;
24 : class AliMUONDigitCalibrator;
25 : class AliMUONVStore;
26 : class AliMUONVTrackerData;
27 : class AliRawReader;
28 : class AliMUONLogger;
29 :
30 : class AliMUONTrackerDataMaker : public AliMUONVTrackerDataMaker
31 : {
32 : public:
33 : AliMUONTrackerDataMaker(TRootIOCtor*);
34 :
35 : AliMUONTrackerDataMaker(const AliMUONRecoParam* recoParam,
36 : Int_t runNumber,
37 : AliRawReader* rawReader,
38 : const char* cdbPath,
39 : const char* calibMode,
40 : Bool_t histogram=kFALSE,
41 : Double_t xmin=0.0,
42 : Double_t xmax=4095.0);
43 :
44 : AliMUONTrackerDataMaker(const AliMUONRecoParam* recoParam,
45 : AliRawReader* rawReader,
46 : const char* cdbPath,
47 : const char* calibMode,
48 : Bool_t histogram=kFALSE,
49 : Double_t xmin=0.0,
50 : Double_t xmax=4095.0);
51 :
52 : AliMUONTrackerDataMaker(AliRawReader* rawReader, Bool_t histogram=kFALSE);
53 :
54 : virtual ~AliMUONTrackerDataMaker();
55 :
56 : Bool_t Add(const AliMUONTrackerDataMaker& other);
57 :
58 : /// Whether we have a valid reader or not
59 0 : Bool_t IsValid() const { return fRawReader != 0x0; }
60 :
61 : /// Get our accumulated data
62 0 : AliMUONVTrackerData* Data() const { return fAccumulatedData; }
63 :
64 : /// Whether or not we're the owner of our fAccumulatedData
65 0 : void SetOwnerOfData(Bool_t flag) { fIsOwnerOfAccumulatedData = flag; }
66 :
67 : /// Whether we're only handling event-by-event data (i.e. no accumulation)
68 0 : Bool_t IsEventByEvent() const { return fIsEventByEvent; }
69 :
70 : /// Set event-by-event mode
71 0 : void SetEventByEvent(Bool_t flag) { fIsEventByEvent = flag; }
72 :
73 : /// We can run if we have a reader
74 0 : Bool_t IsRunnable() const { return IsValid(); }
75 :
76 : /// Whether we are running or not
77 0 : Bool_t IsRunning() const { return fIsRunning; }
78 :
79 : /// Set the runnning status
80 0 : void SetRunning(Bool_t flag) { fIsRunning = flag; }
81 :
82 : Bool_t ProcessEvent();
83 :
84 : Bool_t NextEvent();
85 :
86 : void Print(Option_t* opt="") const;
87 :
88 : void Rewind();
89 :
90 : /// Get our source URI
91 0 : TString Source() const { return fSource.Data(); }
92 :
93 : /// Set our source URI
94 0 : void SetSource(const char* source) { fSource = source; }
95 :
96 : /// Number of events seen
97 0 : Int_t NumberOfEvents() const { return fNumberOfEvents; }
98 :
99 : /// Number of physics events seen
100 0 : Int_t NumberOfPhysicsEvents() const { return fNumberOfPhysicsEvents; }
101 :
102 : /// Number of good physics events seen
103 0 : Int_t NumberOfGoodPhysicsEvents() const { return fNumberOfGoodPhysicsEvents; }
104 :
105 : Long64_t Merge(TCollection* li);
106 :
107 : void SetRawReader(AliRawReader* rawReader);
108 :
109 : /// Set the error logger
110 0 : void EnableErrorLogger(AliMUONLogger* logger) { fLogger = logger; }
111 :
112 : /// Whether last decoded event was empty
113 0 : Bool_t LastEventWasEmpty() const { return fLastEventWasEmpty; }
114 :
115 : /// Whether or not we should try to recover corrupted raw data
116 0 : void SetTryRecover(Bool_t flag) { fTryRecover = flag; }
117 :
118 : /// Set the event range to consider
119 0 : void SetEventRange(Int_t first, Int_t last) { fFirstEvent=first; fLastEvent=last; }
120 :
121 : private:
122 : /// not implemented
123 : AliMUONTrackerDataMaker(const AliMUONTrackerDataMaker& rhs);
124 : /// not implemented
125 : AliMUONTrackerDataMaker& operator=(const AliMUONTrackerDataMaker& rhs);
126 :
127 : void Ctor(const AliMUONRecoParam* param,
128 : Int_t runNumber,
129 : const char* calibMode,
130 : Bool_t histogram,
131 : Double_t xmin=0.0,
132 : Double_t xmax=4095.0);
133 :
134 : private:
135 : AliRawReader* fRawReader; //!<! reader of the data (owner or not)
136 : AliMUONVTrackerData* fAccumulatedData; ///< data (owner or not)
137 : Bool_t fIsOwnerOfAccumulatedData; ///< owner or not of fAccumulatedData
138 : AliMUONVStore* fOneEventData; ///< data for a single event (owner)
139 : AliMUONDigitCalibrator* fDigitCalibrator; //!<! digit calibrator (if calibrating)
140 : AliMUONCalibrationData* fCalibrationData; ///< calibration data (if calibrating)
141 : TString fSource; ///< where the data comes from
142 : TString fOCDBPath; ///< OCDB path (if calibrating)
143 : Int_t fNumberOfEvents; ///< number of events seen
144 : Int_t fRunNumber; ///< run number of the data
145 : Bool_t fIsRunning; ///< whether we are running or not
146 : Bool_t fIsOwnerOfRawReader; ///< whether we must delete rawReader or not
147 : Bool_t fIsEventByEvent; ///< we only keep one event's data (no accumulation)
148 : static Int_t fgkCounter; ///< to count the number of instances
149 : AliMUONLogger* fLogger; ///< error logger (not owner)
150 : Bool_t fLastEventWasEmpty; ///< whether last decoded event was empty
151 : Int_t fNumberOfPhysicsEvents; ///< number of physics events seen
152 : Int_t fNumberOfGoodPhysicsEvents; ///< number of errors with no (fatal) readout error
153 : Bool_t fTryRecover; ///< whether we should try to recover corrupted raw data
154 : Int_t fFirstEvent; ///< first event to consider
155 : Int_t fLastEvent; ///< last event to consider
156 :
157 18 : ClassDef(AliMUONTrackerDataMaker,5) // Producer of AliMUONVTrackerData from raw
158 : };
159 :
160 : #endif
|