Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-03-01 00:02:34

0001 #ifndef DataFormats_Provenance_EventAuxiliary_h
0002 #define DataFormats_Provenance_EventAuxiliary_h
0003 
0004 #include <iosfwd>
0005 
0006 #include "DataFormats/Provenance/interface/EventID.h"
0007 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0008 #include "DataFormats/Provenance/interface/Timestamp.h"
0009 
0010 // Auxiliary event data that is persistent
0011 
0012 namespace edm {
0013   class EventAux;
0014   class EventAuxiliary {
0015   public:
0016     friend void conversion(EventAux const&, EventAuxiliary&);
0017     // Updated on 9 Feb. '09 on a request from Emelio Meschi
0018     enum ExperimentType {
0019       Undefined = 0,
0020       PhysicsTrigger = 1,
0021       CalibrationTrigger = 2,
0022       RandomTrigger = 3,
0023       Reserved = 4,
0024       TracedEvent = 5,
0025       TestTrigger = 6,
0026       ErrorTrigger = 15
0027     };
0028     static int const invalidBunchXing = -1;
0029     static int const invalidStoreNumber = 0;
0030     EventAuxiliary()
0031         : processHistoryID_(),
0032           id_(),
0033           processGUID_(),
0034           time_(),
0035           luminosityBlock_(0U),
0036           isRealData_(false),
0037           experimentType_(Undefined),
0038           bunchCrossing_(invalidBunchXing),
0039           orbitNumber_(invalidBunchXing),
0040           storeNumber_(invalidStoreNumber) {}
0041     EventAuxiliary(EventID const& theId,
0042                    std::string const& theProcessGUID,
0043                    Timestamp const& theTime,
0044                    bool isReal,
0045                    ExperimentType eType = Undefined,
0046                    int bunchXing = invalidBunchXing,
0047                    int storeNum = invalidStoreNumber,
0048                    int orbitNum = invalidBunchXing)
0049         : processHistoryID_(),
0050           id_(theId),
0051           processGUID_(theProcessGUID),
0052           time_(theTime),
0053           luminosityBlock_(0U),
0054           isRealData_(isReal),
0055           experimentType_(eType),
0056           bunchCrossing_(bunchXing),
0057           orbitNumber_(orbitNum),
0058           storeNumber_(storeNum) {}
0059     ~EventAuxiliary() {}
0060     void write(std::ostream& os) const;
0061     ProcessHistoryID const& processHistoryID() const { return processHistoryID_; }
0062     void setProcessHistoryID(ProcessHistoryID const& phid) { processHistoryID_ = phid; }
0063     EventID const& id() const { return id_; }
0064     EventID& id() { return id_; }
0065     std::string const& processGUID() const { return processGUID_; }
0066     Timestamp const& time() const { return time_; }
0067     LuminosityBlockNumber_t luminosityBlock() const {
0068       return id_.luminosityBlock() != 0U ? id_.luminosityBlock() : luminosityBlock_;
0069     }
0070     LuminosityBlockNumber_t oldLuminosityBlock() const { return luminosityBlock_; }
0071     void resetObsoleteInfo() { luminosityBlock_ = 0; }
0072     EventNumber_t event() const { return id_.event(); }
0073     RunNumber_t run() const { return id_.run(); }
0074     bool isRealData() const { return isRealData_; }
0075     ExperimentType experimentType() const { return experimentType_; }
0076     int bunchCrossing() const { return bunchCrossing_; }
0077     int orbitNumber() const { return orbitNumber_; }
0078     int storeNumber() const { return storeNumber_; }
0079 
0080   private:
0081     // NOTE: any member data added here MUST also be added to CompactEventAuxiliaryVector.h
0082     // Process history ID of the full process history (not the reduced process history)
0083     ProcessHistoryID processHistoryID_;
0084     // Event ID
0085     EventID id_;
0086     // Globally unique process ID of process that created event.
0087     std::string processGUID_;
0088     // Time from DAQ
0089     Timestamp time_;
0090     // Associated Luminosity Block identifier (obsolete. for backward compatibility only)
0091     LuminosityBlockNumber_t luminosityBlock_;
0092     // Is this real data (i.e. not simulated)
0093     bool isRealData_;
0094     // Something descriptive of the source of the data
0095     ExperimentType experimentType_;
0096     //  The bunch crossing number
0097     int bunchCrossing_;
0098     // The orbit number
0099     int orbitNumber_;
0100     //  The LHC store number
0101     int storeNumber_;
0102   };
0103 
0104   bool isSameEvent(EventAuxiliary const& a, EventAuxiliary const& b);
0105 
0106   inline std::ostream& operator<<(std::ostream& os, const EventAuxiliary& p) {
0107     p.write(os);
0108     return os;
0109   }
0110 
0111 }  // namespace edm
0112 
0113 #endif