+ /**
+ * Set whether we should try to get all detectors
+ *
+ * @param all If true, try to get all detectors
+ */
+ void SetTryAll(Bool_t all=true) { fAll = all; }
+ /**
+ * Get the number of required events
+ *
+ *
+ * @return number of required events
+ */
+ Int_t GetRequiredEvents() const {return fRequiredEvents ;}
+ /**
+ * Get list of summary histograms
+ *
+ * @return Array of summary histograms or null if not defined
+ */
+ const TObjArray& GetSummaries() const { return fSummaries; }
+ /**
+ * Check if we saw data for detector
+ *
+ * @param det Detector number to check
+ * @return true if the code has seen data from the detector
+ */
+ Bool_t HasSeenDetector(UShort_t d) const;
+
+ /**
+ * Class to run the DAs
+ */
+ struct Runner {
+ Runner();
+ Runner(const Runner&)
+ : fReader(0), fDiagFile(""), fDiag(false), fAll(false) {}
+ ~Runner() {}
+ Runner& operator=(const Runner&) { return *this; }
+ void AddHandlers();
+ void ShowUsage(std::ostream& o, const char* progname);
+ Int_t Init(int argc, char** argv);
+ void Exec(AliFMDBaseDA& da);
+ Int_t RunNumber() const;
+ AliRawReader* fReader;
+ TString fDiagFile;
+ Bool_t fDiag;
+ Bool_t fAll;
+ };
+protected:
+ /**
+ * Initialize
+ */
+ virtual void Init() {};
+ /**
+ * Fill channels
+ */
+ virtual void FillChannels(AliFMDDigit* ) {};
+ /**
+ * Analyse a single strip result
+ */
+ virtual void Analyse(UShort_t, Char_t, UShort_t, UShort_t) {};
+ /**
+ * Write header to output file
+ */
+ virtual void WriteHeaderToFile() {};
+ /**
+ * Add a strip container
+ */
+ virtual void AddChannelContainer(TObjArray*, UShort_t, Char_t,
+ UShort_t, UShort_t ) {};
+ /**
+ * Add summary(s) for sectors
+ *
+ */
+ virtual void AddSectorSummary(TObjArray*, UShort_t, Char_t, UShort_t,
+ UShort_t) {}
+ /**
+ * End of event
+ */
+ virtual void FinishEvent() {};
+ /**
+ * End of run
+ */
+ virtual void Terminate(TFile* ) {};
+ /**
+ * Current event number
+ *
+ *
+ * @return
+ */
+ Int_t GetCurrentEvent() const {return fCurrentEvent;}
+ /**
+ * Rotate a set of files. @a base is the basic name of the files.
+ * If the file @a base.max exists it is removed.
+ * If the file @a base.n exists (where n < max) it is renamed to @a
+ * base.(n-1).
+ * If the file @a base exists, it is renamed to @a base.1
+ *
+ * @param base Base name of the files
+ * @param max Maximum number to keep (minus one for the current).
+ */
+ void Rotate(const char* base, int max) const;
+ /**
+ * Ge the half-ring index
+ *
+ * @param UShort_t
+ * @param Char_t
+ * @param UShort_t
+ *
+ * @return
+ */
+ Int_t GetHalfringIndex(UShort_t, Char_t, UShort_t) const;
+ /**
+ * Get the pulse size
+ *
+ * @param det Detector number
+ * @param ring Rin identifier
+ * @param board Board number
+ *
+ * @return Pulse step size
+ */
+ Int_t GetPulseSize(UShort_t det ,
+ Char_t ring,
+ UShort_t board)
+ {
+ return fPulseSize.At(GetHalfringIndex(det,ring,board));
+ }
+ /**
+ * Get number of events per pulse size
+ *
+ * @param det Detector number
+ * @param ring Rin identifier
+ * @param board Board number
+ *
+ * @return number of events per Pulse size
+ */
+ Int_t GetPulseLength(UShort_t det,
+ Char_t ring,
+ UShort_t board)
+ {
+ return fPulseLength.At(GetHalfringIndex(det,ring,board));
+ }
+
+ /**
+ * Get the detector path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param full If true, return full path
+ *
+ * @return Path to detector
+ */
+ const char* GetDetectorPath(UShort_t det, Bool_t full=kTRUE) const;
+ /**
+ * Get the ring path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param full If true, return full path
+ *
+ * @return Path to ring
+ */
+ const char* GetRingPath(UShort_t det, Char_t ring, Bool_t full=kTRUE) const;
+ /**
+ * Get the sector path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param full If true, return full path
+ *
+ * @return Path to sector
+ */
+ const char* GetSectorPath(UShort_t det, Char_t ring, UShort_t sec,
+ Bool_t full=kTRUE) const;
+ /**
+ * Get the strip path in diagnositcs file
+ *
+ * @param det Detector number
+ * @param ring Ring identifier
+ * @param sec Sector number
+ * @param str Strip number
+ * @param full If true, return full path
+ *
+ * @return Path to strip
+ */
+ const char* GetStripPath(UShort_t det, Char_t ring, UShort_t sec,
+ UShort_t str, Bool_t full=kTRUE) const;
+ TObjArray* GetDetectorArray(UShort_t det);
+ TObjArray* GetRingArray(UShort_t det, Char_t ring);
+ TObjArray* GetSectorArray(UShort_t det, Char_t ring, UShort_t sector);
+ TObjArray* GetStripArray(UShort_t det, Char_t ring,
+ UShort_t sector, UShort_t strip);
+ /**
+ * Write conditions file
+ *
+ * @param fmdReader Raw input
+ */
+ void WriteConditionsData(AliFMDRawReader* fmdReader);
+ /**
+ * Set the current event
+ *
+ * @param currentEvent
+ */
+ void SetCurrentEvent(Int_t currentEvent) {fCurrentEvent = currentEvent; }
+ /**
+ * Initialize container
+ *
+ * @param dir Directory to make containers in
+ */
+ virtual void InitContainer(TDirectory* dir);
+ /**
+ * Utility function for defining summary histograms
+ *
+ * @param det Detector
+ * @param ring Ring identifier
+ * @param prefix Histogram prefix
+ * @param title Histogram title
+ */
+ TH2* MakeSummaryHistogram(const char* prefix, const char* title,
+ UShort_t det, Char_t ring);
+ /**
+ * Make a summary
+ *
+ */
+ virtual void MakeSummary(UShort_t, Char_t) { }