/** * \class COMET::IVldRange * * \ingroup Validity * * \brief Delimits and identifies the allowed "context" values * associated with the associated DBI returned information * * * * \author (last to touch it) $Author: finch $ * * \version $Revision: 1.1 $ * * \date $Date: 2011/01/18 05:49:20 $ * * Contact: R. Hatcher * * Created on: 2000.05.03 * */ #ifndef VLDRANGE_H #define VLDRANGE_H #include "TObject.h" #include "TString.h" #include "DbiDetector.hxx" #include "IVldTimeStamp.hxx" #include namespace COMET { class IVldContext; class IVldRange; class IVldRange : public TObject { public: IVldRange(); // necessary for streamer io IVldRange(const Int_t detMask, const Int_t simMask, const IVldTimeStamp &tstart, const IVldTimeStamp &tend, const TString &source); virtual ~IVldRange(); /** Return the IVldRange as a string * * Result is a pointer to a statically allocated string. * User should copy this into their own buffer before calling * this method again. * * option "a": give detector/simflag masks as alpha chars * option "c": compact (single line) * option "s": drop nsec part of times * option "1": include only "start time" * option "-": don't include "source" info */ const char* AsString(Option_t *option = "") const; /** Compare COMET::IVldContext with this IVldRange to see if the * the tagged set is compatible.*/ Bool_t IsCompatible(const COMET::IVldContext &vldc) const; /** Compare COMET::IVldContext with this IVldRange to see if the * the tagged set is compatible.*/ Bool_t IsCompatible(const COMET::IVldContext *vldc) const; Int_t GetDetectorMask() const { return fDetectorMask; } Int_t GetSimMask() const { return fSimMask; } IVldTimeStamp GetTimeStart() const { return fTimeStart; } IVldTimeStamp GetTimeEnd() const { return fTimeEnd; } TString GetDataSource() const { return fDataSource; } /// Print to stdout. See AsString() for options. void Print(Option_t *option = "") const; /// Trim this range to the intersection (ie. more restricted) /// limits of it's initial value and that of the argument void TrimTo(const IVldRange& vldr); void SetTimeStart(const IVldTimeStamp& tstart) { fTimeStart = tstart; } void SetTimeEnd(const IVldTimeStamp& tend) { fTimeEnd = tend; } protected: Int_t fDetectorMask; /// or's of COMET::DbiDetector::Detector_t Int_t fSimMask; /// or's of data/mc conditions IVldTimeStamp fTimeStart; IVldTimeStamp fTimeEnd; TString fDataSource; private: ClassDef(COMET::IVldRange,1) // IVldRange version 1 }; }; std::ostream& operator<<(std::ostream& os, const COMET::IVldRange& vldts); #endif // VLDRANGE_H