42 MsgStream log(msgSvc(),
"EventInfoCnv" );
44 log << MSG::DEBUG <<
"EventInfo write Success" <<
endmsg;
50 static const pool::Guid p4_guid(
"C634FDB6-CC4B-4BA2-B8F9-A84BE6A786C7");
51 static const pool::Guid p3_guid(
"3E240CA8-5124-405B-9059-FAFC4C5954C6");
52 static const pool::Guid p2_guid(
"22006E19-F0DA-4EFB-AF55-6FBDA421BF06");
53 static const pool::Guid p1_guid(
"A3053CD9-47F4-4C0F-B73A-A6F93F5CC7B7");
54 static const pool::Guid p0_guid(
"380D8BB9-B34F-470F-92CC-06C3D60F7BE4");
58 MsgStream log(msgSvc(),
"EventInfoCnv" );
65 MsgStream log(msgSvc(),
"EventInfoCnv" );
72 MsgStream log(msgSvc(),
"EventInfoCnv" );
79 MsgStream log(msgSvc(),
"EventInfoCnv" );
102 throw std::runtime_error(
"Unsupported persistent version of EventInfo");
140 MsgStream log(msgSvc(),
"EventInfoCnv" );
141 log << MSG::DEBUG <<
"massageEventInfo: check if tag is set in jobOpts" <<
endmsg;
145 SmartIF<IProperty> appMgr{serviceLocator()->service(
"ApplicationMgr")};
147 log << MSG::ERROR <<
"massageEventInfo: Cannot get ApplicationMgr " <<
endmsg;
148 throw std::runtime_error(
"Cannot get ApplicationMgr");
150 StringProperty property(
"EvtSel",
"");
151 StatusCode
sc = appMgr->getProperty(&property);
152 if (!
sc.isSuccess()) {
153 log << MSG::ERROR <<
"unable to get EvtSel: found " <<
property.value() <<
endmsg;
154 throw std::runtime_error(
"Cannot get property EvtSel from the ApplicationMgr");
157 std::string eventSelector =
property.value();
158 SmartIF<IProperty> evtSel{serviceLocator()->service(eventSelector)};
160 log << MSG::ERROR <<
"massageEventInfo: Cannot get EventSelector " << eventSelector <<
endmsg;
161 throw std::runtime_error(
"Cannot get EventSelector");
163 BooleanProperty overrideRunNumber(
"OverrideRunNumberFromInput",
false);
164 sc = evtSel->getProperty(&overrideRunNumber);
165 if (!
sc.isSuccess()) {
167 ATH_MSG_INFO(
"massageEventInfo: unable to get OverrideRunNumberFromInput property from EventSelector ");
172 IntegerProperty runNumber(
"RunNumber", 0);
173 sc = evtSel->getProperty(&runNumber);
174 if (!
sc.isSuccess()) {
175 log << MSG::ERROR <<
"massageEventInfo: unable to get RunNumber from EventSelector: found "
178 throw std::runtime_error(
"Cannot get RunNumber");
182 log << MSG::DEBUG <<
"massageEventInfo: Run number: " <<
m_simRunNumber
183 <<
" obtained from " << eventSelector <<
endmsg;
185 IntegerProperty lumiBlockNumber(
"FirstLB", 0);
186 sc = evtSel->getProperty(&lumiBlockNumber);
187 if (!
sc.isSuccess()) {
188 log << MSG::INFO <<
"massageEventInfo: unable to get FirstLB from EventSelector. Using "
194 <<
" obtained from " << eventSelector <<
endmsg;
196 IntegerProperty evtsPerLumiBlock(
"EventsPerLB", 0);
197 sc = evtSel->getProperty(&evtsPerLumiBlock);
198 if (!
sc.isSuccess()) {
199 log << MSG::INFO <<
"massageEventInfo: unable to get EventsPerLB from EventSelector. Using "
205 <<
" obtained from " << eventSelector <<
endmsg;
207 IntegerProperty timeStamp(
"InitialTimeStamp", 0);
208 sc = evtSel->getProperty(&timeStamp);
209 if (!
sc.isSuccess()) {
210 log << MSG::INFO <<
"massageEventInfo: unable to get InitialTimeStamp from EventSelector. Using "
215 log << MSG::DEBUG <<
"massageEventInfo: InitialTimeStamp: " <<
m_timeStamp
216 <<
" obtained from " << eventSelector <<
endmsg;
218 IntegerProperty timeStampInterval(
"TimeStampInterval", 0);
219 sc = evtSel->getProperty(&timeStampInterval);
220 if (!
sc.isSuccess()) {
221 log << MSG::INFO <<
"massageEventInfo: unable to get TimeStampInterval from EventSelector. Using "
227 <<
" obtained from " << eventSelector <<
endmsg;
231 log << MSG::DEBUG <<
"massageEventInfo: OverrideRunNumberFromInput from EventSelector is false "
241 MsgStream log(msgSvc(),
"EventInfoCnv" );
242 log << MSG::ERROR <<
"massageEventInfo: trying to reset run number for data!!! " <<
endmsg;
243 log << MSG::ERROR <<
" Job option EventSelector.RunNumber should NOT be set, found it set to: " <<
m_simRunNumber <<
endmsg;
244 throw std::runtime_error(
"Trying to reset run number for DATA!!!");
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
static const EventInfoCnv_p1 TPconverter_p1
static const EventInfoCnv_p3 TPconverter_p3
static const EventInfoCnv_p2 TPconverter_p2
static const EventInfoCnv_p4 TPconverter_p4
AthenaPool converter for EventInfo.
EventInfo_p4 EventInfo_PERS
T_AthenaPoolCustomCnv< EventInfo, EventInfo_PERS > EventInfoCnvBase
This class is the persistent representation of EventInfo.
This class provides general information about an event.
This class contains trigger related information.
EventInfoCnv(ISvcLocator *svcloc)
bool m_checkedEventSelector
unsigned int m_simRunNumber
unsigned int m_evtsPerLumiBlock
unsigned int m_lbEvtCounter
SmartIF< IEvtIdModifierSvc > m_evtIdModSvc
unsigned int m_timeStampInterval
virtual EventInfo * createTransient()
EventInfo * massageEventInfo(EventInfo *ei)
virtual EventInfo_PERS * createPersistent(EventInfo *transObj)
unsigned int m_lumiBlockNumber
EventID * event_ID()
the unique identification of the event.
TriggerInfo * trigger_info()
trigger information (ptr may be NULL)
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
float mc_event_weight(unsigned int iweight=0) const
Access to MC weight.
void set_mc_event_weight(float weight, unsigned int iweight=0, unsigned int nWeightsMax=0)
Add in MC weight. For more than 1 weight, add with iweight > 0.
void set_mc_channel_number(number_type chan)
Add in the MC generator channel number (aka gen run number)
number_type mc_channel_number() const
Access to the MC generator channel number (was used as run number for generator events)
void set_mc_event_number(uint64_t evt)
Add in the MC generator event number.
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
bool test(EventTypeCode type_code) const
Tests for standard characteristics.
virtual bool compareClassGuid(const Guid &clid) const
const std::vector< number_type > & eventFilterInfo() const
get event filter trigger info
thread_local event_number_t eventIndex