#include <OnlineEventDisplaysSvc.h>
|
SG::ReadHandleKey< xAOD::EventInfo > | m_evt {this, "EventInfo", "EventInfo", "Input event information"} |
|
Gaudi::Property< std::string > | m_outputDirectory {this, "OutputDirectory", "/atlas/EventDisplayEvents", "Output Directory"} |
|
Gaudi::Property< std::vector< std::string > > | m_streamsWanted {this, "StreamsWanted", {}, "Desired trigger streams"} |
|
Gaudi::Property< std::vector< std::string > > | m_publicStreams {this, "PublicStreams", {}, "Streams that can be seen by the public"} |
|
Gaudi::Property< std::string > | m_projectTag {this, "ProjectTag", "", "Is needed to add streams to the Public trigger streams"} |
|
Gaudi::Property< bool > | m_BeamSplash {this, "BeamSplash", false, "Is a beam splash event"} |
|
Gaudi::Property< bool > | m_CheckPair {this, "CheckPair", false, "Check for matching ESD and JiveXML files"} |
|
Gaudi::Property< int > | m_maxEvents {this, "MaxEvents", 200, "Number of events to keep per stream"} |
|
std::string | m_FileNamePrefix = "JiveXML" |
|
std::string | m_outputStreamDir = ".Unknown" |
|
std::string | m_entireOutputStr = "." |
|
int | m_runNumber {} |
|
long | m_eventNumber {} |
|
Definition at line 16 of file OnlineEventDisplaysSvc.h.
◆ OnlineEventDisplaysSvc() [1/2]
OnlineEventDisplaysSvc::OnlineEventDisplaysSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ OnlineEventDisplaysSvc() [2/2]
OnlineEventDisplaysSvc::OnlineEventDisplaysSvc |
( |
| ) |
|
|
private |
◆ beginEvent()
void OnlineEventDisplaysSvc::beginEvent |
( |
| ) |
|
Definition at line 34 of file OnlineEventDisplaysSvc.cxx.
40 std::vector<std::string>
streams;
48 ATH_MSG_DEBUG(
"A trigger in stream " <<
tag.type() <<
"_" <<
tag.name() <<
" was fired in this event.");
49 std::string stream_fullname =
tag.type() +
"_" +
tag.name();
52 ATH_MSG_WARNING(
"You have not requested any specific streams, going to allow all streams");
53 streams.emplace_back(stream_fullname);
59 streams.emplace_back(stream_fullname);
61 bool isPublic =
false;
68 PyObject* pProjectTag = PyUnicode_FromString(
tag.c_str());
72 ATH_MSG_WARNING(
"Failed to create Python Unicode object from project tag");
75 PyObject* pHelper = PyImport_ImportModule(
"EventDisplaysOnline.EventDisplaysOnlineHelpers");
79 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventDisplaysOnlineHelpers module");
85 ATH_MSG_WARNING(
"Could not find or call EventCanBeSeenByPublic function in EventDisplaysOnline.EventDisplaysOnlineHelpers module");
94 isPublic = PyObject_IsTrue(
result);
101 Py_DECREF(pProjectTag);
104 streams.emplace_back(
"Public");
110 ATH_MSG_DEBUG(
"streams where a trigger fired and in your desired streams list: " <<
stream);
◆ createWriteableDir()
void OnlineEventDisplaysSvc::createWriteableDir |
( |
const std::string & |
directory, |
|
|
gid_t |
zpgid |
|
) |
| |
Definition at line 207 of file OnlineEventDisplaysSvc.cxx.
209 const char* char_dir =
directory.c_str();
211 if (
access(char_dir, F_OK) == 0) {
212 struct stat directoryStat;
213 if (
stat(char_dir, &directoryStat) == 0 && S_ISDIR(directoryStat.st_mode) &&
214 access(char_dir, W_OK) == 0) {
216 if (directoryStat.st_gid != zpgid) {
218 chown(char_dir, -1, zpgid);
225 auto rc =
mkdir(char_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
229 rc = chown(char_dir, -1, zpgid);
234 }
catch (
const std::system_error&
err) {
◆ endEvent()
void OnlineEventDisplaysSvc::endEvent |
( |
| ) |
|
Definition at line 130 of file OnlineEventDisplaysSvc.cxx.
136 PyObject* pDirectory = PyUnicode_FromString(cString);
137 PyObject* pArgs = PyTuple_Pack(4, pDirectory, pMaxEvents, pCheckPair,pBeamSplash);
138 PyObject* pModule = PyImport_ImportModule(
const_cast< char*
>(
"EventDisplaysOnline.EventUtils"));
139 if(!pCheckPair || !pBeamSplash || !pMaxEvents || !pDirectory || !pArgs){
144 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventUtils module");
146 ATH_MSG_DEBUG(
"Successfully imported EventDisplaysOnline.EventUtils module");
151 ATH_MSG_WARNING(
"Could not find or call cleanDirectory function in EventDisplaysOnline.EventUtils module");
153 ATH_MSG_DEBUG(
"Found cleanDirectory function in EventDisplaysOnline.EventUtils module");
157 if (PyErr_Occurred()) {
162 throw std::runtime_error(
"OnlineEventDisplaysSvc::endEvent: Py_DECREF on nullptr argument");
169 const char* JiveXMLFileName_cString = JiveXMLFileName.c_str();
170 PyObject* pJiveXMLFileName = PyUnicode_FromString(JiveXMLFileName_cString);
171 PyObject* pArgs_zip = PyTuple_Pack(2, pDirectory, pJiveXMLFileName);
175 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventUtils.zipXMLFile");
179 if (anyNullPtr(pJiveXMLFileName,
zipXMLFile, pArgs_zip)){
180 throw std::runtime_error(
"OnlineEventDisplaysSvc::endEvent: Py_DECREF on nullptr argument");
182 Py_DECREF(pJiveXMLFileName);
184 Py_DECREF(pArgs_zip);
186 if (anyNullPtr(pModule, pArgs, pCheckPair, pMaxEvents, pDirectory)){
187 throw std::runtime_error(
"OnlineEventDisplaysSvc::endEvent: Py_DECREF on nullptr argument");
191 Py_DECREF(pCheckPair);
192 Py_DECREF(pMaxEvents);
193 Py_DECREF(pDirectory);
◆ finalize()
StatusCode OnlineEventDisplaysSvc::finalize |
( |
| ) |
|
|
override |
◆ getEntireOutputStr()
std::string OnlineEventDisplaysSvc::getEntireOutputStr |
( |
| ) |
|
|
override |
◆ getFileNamePrefix()
std::string OnlineEventDisplaysSvc::getFileNamePrefix |
( |
| ) |
|
|
override |
◆ getStreamName()
std::string OnlineEventDisplaysSvc::getStreamName |
( |
| ) |
|
|
override |
◆ handle()
void OnlineEventDisplaysSvc::handle |
( |
const Incident & |
incident | ) |
|
|
override |
Definition at line 281 of file OnlineEventDisplaysSvc.cxx.
282 ATH_MSG_DEBUG(
"Received incident " << incident.type() <<
" from " << incident.source() );
283 if ( incident.type() == IncidentType::BeginEvent && incident.source() ==
"BeginIncFiringAlg" ){
286 if ( incident.type() ==
"StoreCleared" && incident.source() ==
"StoreGateSvc" ){
◆ initialize()
StatusCode OnlineEventDisplaysSvc::initialize |
( |
| ) |
|
|
override |
Definition at line 255 of file OnlineEventDisplaysSvc.cxx.
260 ATH_MSG_DEBUG(
"You have requested to only output JiveXML and ESD files when a trigger in the following streams was fired: ");
267 incSvc->addListener(
this,
"BeginEvent");
268 incSvc->addListener(
this,
"StoreCleared");
272 return StatusCode::SUCCESS;
◆ setOwnershipToZpGrpOrDefault()
gid_t OnlineEventDisplaysSvc::setOwnershipToZpGrpOrDefault |
( |
| ) |
|
Definition at line 240 of file OnlineEventDisplaysSvc.cxx.
243 struct group* grp_result;
245 (void)getgrnam_r(
"zp", &grp, buf,
sizeof(buf), &grp_result);
246 if (grp_result !=
nullptr) {
249 ATH_MSG_DEBUG(
"If running on private machine, zp group might not exist. Just set to the likely value 1307.");
◆ m_BeamSplash
Gaudi::Property<bool> OnlineEventDisplaysSvc::m_BeamSplash {this, "BeamSplash", false, "Is a beam splash event"} |
|
private |
◆ m_CheckPair
Gaudi::Property<bool> OnlineEventDisplaysSvc::m_CheckPair {this, "CheckPair", false, "Check for matching ESD and JiveXML files"} |
|
private |
◆ m_entireOutputStr
std::string OnlineEventDisplaysSvc::m_entireOutputStr = "." |
|
private |
◆ m_eventNumber
long OnlineEventDisplaysSvc::m_eventNumber {} |
|
private |
◆ m_evt
◆ m_FileNamePrefix
std::string OnlineEventDisplaysSvc::m_FileNamePrefix = "JiveXML" |
|
private |
◆ m_maxEvents
Gaudi::Property<int> OnlineEventDisplaysSvc::m_maxEvents {this, "MaxEvents", 200, "Number of events to keep per stream"} |
|
private |
◆ m_outputDirectory
Gaudi::Property<std::string> OnlineEventDisplaysSvc::m_outputDirectory {this, "OutputDirectory", "/atlas/EventDisplayEvents", "Output Directory"} |
|
private |
◆ m_outputStreamDir
std::string OnlineEventDisplaysSvc::m_outputStreamDir = ".Unknown" |
|
private |
◆ m_projectTag
Gaudi::Property<std::string> OnlineEventDisplaysSvc::m_projectTag {this, "ProjectTag", "", "Is needed to add streams to the Public trigger streams"} |
|
private |
◆ m_publicStreams
Gaudi::Property<std::vector<std::string> > OnlineEventDisplaysSvc::m_publicStreams {this, "PublicStreams", {}, "Streams that can be seen by the public"} |
|
private |
◆ m_runNumber
int OnlineEventDisplaysSvc::m_runNumber {} |
|
private |
◆ m_streamsWanted
Gaudi::Property<std::vector<std::string> > OnlineEventDisplaysSvc::m_streamsWanted {this, "StreamsWanted", {}, "Desired trigger streams"} |
|
private |
The documentation for this class was generated from the following files: