#include <VisReco/Analyzer/interface/VisEvent.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
VisEvent (const edm::ParameterSet &) | |
virtual | ~VisEvent (void) |
Definition at line 15 of file VisEvent.h.
VisEvent::VisEvent | ( | const edm::ParameterSet & | iPSet | ) | [explicit] |
virtual VisEvent::~VisEvent | ( | void | ) | [inline, virtual] |
void VisEvent::analyze | ( | const edm::Event & | event, | |
const edm::EventSetup & | ||||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 30 of file VisEvent.cc.
References IgCollection::addProperty(), ASSERT, edmplugin::standard::config(), IgCollection::create(), Exception, IgDataStorage::getCollection(), edm::Service< T >::isAvailable(), LFfwvis, LOG, seconds(), GsfMatrixTools::trace(), and edm::Timestamp::value().
00031 { 00032 edm::Service<IguanaService> config; 00033 if (! config.isAvailable ()) 00034 { 00035 throw cms::Exception ("Configuration") 00036 << "VisEvent requires the IguanaService\n" 00037 "which is not present in the configuration file.\n" 00038 "You must add the service in the configuration file\n" 00039 "or remove the module that requires it"; 00040 } 00041 const edm::Timestamp time = event.time (); 00042 00043 timeval eventTime; 00044 eventTime.tv_sec = time.value () >> 32; 00045 eventTime.tv_usec = 0xFFFFFFFF & time.value (); 00046 00047 boost::posix_time::ptime bt0 = boost::posix_time::from_time_t(0); 00048 boost::posix_time::ptime bt = bt0 + boost::posix_time::seconds(eventTime.tv_sec) 00049 + boost::posix_time::microseconds(eventTime.tv_usec); 00050 00051 std::stringstream oss; 00052 oss << bt << " GMT: Run " << event.id ().run () 00053 << ", Event " << event.id ().event () 00054 << ", LS " << event.luminosityBlock () 00055 << ", Orbit " << event.orbitNumber () 00056 << ", BX " << event.bunchCrossing (); 00057 std::string contents (oss.str ()); 00058 00059 std::string statusText = contents; 00060 00061 LOG (1, trace, LFfwvis, "VisEvent::analyze " << contents << "\n"); 00062 00063 IgDataStorage *storage = config->storage (); 00064 ASSERT (storage); 00065 IgCollection &eventColl = storage->getCollection ("Event_V1"); 00066 00067 IgProperty RUN = eventColl.addProperty ("run", static_cast<int>(0)); 00068 IgProperty EVENT = eventColl.addProperty ("event", static_cast<int>(0)); 00069 IgProperty LS = eventColl.addProperty ("ls", static_cast<int>(0)); 00070 IgProperty ORBIT = eventColl.addProperty ("orbit", static_cast<int>(0)); 00071 IgProperty BX = eventColl.addProperty ("bx", static_cast<int>(0)); 00072 IgProperty TIME = eventColl.addProperty ("time", std::string ()); 00073 00074 IgCollectionItem eventId = eventColl.create(); 00075 eventId [RUN] = static_cast<int>(event.id ().run ()); 00076 eventId [EVENT] = static_cast<int>(event.id ().event ()); 00077 eventId [LS] = static_cast<int>(event.luminosityBlock ()); 00078 eventId [ORBIT] = static_cast<int>(event.orbitNumber ()); 00079 eventId [BX] = static_cast<int>(event.bunchCrossing ()); 00080 eventId [TIME] = static_cast<std::string>(contents); 00081 }