CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/Provenance/interface/EventAuxiliary.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_EventAuxiliary_h
00002 #define DataFormats_Provenance_EventAuxiliary_h
00003 
00004 #include <iosfwd>
00005 
00006 #include "DataFormats/Provenance/interface/EventID.h"
00007 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
00008 #include "DataFormats/Provenance/interface/Timestamp.h"
00009 
00010 // Auxiliary event data that is persistent
00011 
00012 namespace edm {
00013   class EventAux;
00014   class EventAuxiliary {
00015   public:
00016     friend void conversion(EventAux const&, EventAuxiliary&);
00017     // Updated on 9 Feb. '09 on a request from Emelio Meschi
00018     enum ExperimentType {
00019       Undefined          =  0,
00020       PhysicsTrigger     =  1,
00021       CalibrationTrigger =  2,
00022       RandomTrigger      =  3,
00023       Reserved           =  4, 
00024       TracedEvent        =  5,
00025       TestTrigger        =  6,
00026       ErrorTrigger       = 15
00027     };
00028     static int const invalidBunchXing = -1;
00029     static int const invalidStoreNumber = 0;
00030     EventAuxiliary() :
00031         processHistoryID_(),
00032         id_(),
00033         processGUID_(),
00034         time_(),
00035         luminosityBlock_(0U),
00036         isRealData_(false), 
00037         experimentType_(Undefined),
00038         bunchCrossing_(invalidBunchXing),
00039         orbitNumber_(invalidBunchXing),
00040         storeNumber_(invalidStoreNumber) {}
00041     EventAuxiliary(EventID const& theId, std::string const& theProcessGUID, Timestamp const& theTime,
00042                    bool isReal, ExperimentType eType = Undefined,
00043                    int bunchXing = invalidBunchXing, int storeNumber = invalidStoreNumber,
00044                    int orbitNum = invalidBunchXing) :
00045         processHistoryID_(),
00046         id_(theId),
00047         processGUID_(theProcessGUID),
00048         time_(theTime),
00049         luminosityBlock_(0U),
00050         isRealData_(isReal),
00051         experimentType_(eType),
00052         bunchCrossing_(bunchXing),
00053         orbitNumber_(orbitNum),
00054         storeNumber_(storeNumber) {}
00055     ~EventAuxiliary() {}
00056     void write(std::ostream& os) const;
00057     ProcessHistoryID const& processHistoryID() const {return processHistoryID_;}
00058     void setProcessHistoryID(ProcessHistoryID const& phid) {processHistoryID_ = phid;}
00059     EventID const& id() const {return id_;}
00060     EventID& id() {return id_;}
00061     std::string const& processGUID() const {return processGUID_;}
00062     Timestamp const& time() const {return time_;}
00063     LuminosityBlockNumber_t luminosityBlock() const {return id_.luminosityBlock() != 0U ? id_.luminosityBlock() : luminosityBlock_;}
00064     LuminosityBlockNumber_t oldLuminosityBlock() const {return luminosityBlock_;}
00065     void resetObsoleteInfo() {luminosityBlock_ = 0;}
00066     EventNumber_t event() const {return id_.event();}
00067     RunNumber_t run() const {return id_.run();}
00068     bool isRealData() const {return isRealData_;}
00069     ExperimentType experimentType() const {return experimentType_;}
00070     int bunchCrossing() const {return bunchCrossing_;}
00071     int orbitNumber() const {return orbitNumber_;}
00072     int storeNumber() const {return storeNumber_;}
00073 
00074   private:
00075     // Process history ID of the containing run.
00076     ProcessHistoryID processHistoryID_;
00077     // Event ID
00078     EventID id_;
00079     // Globally unique process ID of process that created event.
00080     std::string processGUID_;
00081     // Time from DAQ
00082     Timestamp time_;
00083     // Associated Luminosity Block identifier (obsolete. for backward compatibility only)
00084     LuminosityBlockNumber_t luminosityBlock_;
00085     // Is this real data (i.e. not simulated)
00086     bool isRealData_;
00087     // Something descriptive of the source of the data
00088     ExperimentType experimentType_;
00089     //  The bunch crossing number
00090     int bunchCrossing_;
00091     // The orbit number
00092     int orbitNumber_;
00093     //  The LHC store number
00094     int storeNumber_;
00095   };
00096 
00097   bool
00098   isSameEvent(EventAuxiliary const& a, EventAuxiliary const& b);
00099 
00100   inline
00101   std::ostream&
00102   operator<<(std::ostream& os, const EventAuxiliary& p) {
00103     p.write(os);
00104     return os;
00105   }
00106 
00107 }
00108 
00109 #endif