#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 21 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 18 of file OnlineEventDisplaysSvc.cxx.
24 std::vector<std::string>
streams;
32 ATH_MSG_DEBUG(
"A trigger in stream " <<
tag.type() <<
"_" <<
tag.name() <<
" was fired in this event.");
33 std::string stream_fullname =
tag.type() +
"_" +
tag.name();
36 ATH_MSG_WARNING(
"You have not requested any specific streams, going to allow all streams");
37 streams.emplace_back(stream_fullname);
43 streams.emplace_back(stream_fullname);
45 bool isPublic =
false;
52 PyObject* pProjectTag = PyUnicode_FromString(
tag.c_str());
56 ATH_MSG_WARNING(
"Failed to create Python Unicode object from project tag");
59 PyObject* pHelper = PyImport_ImportModule(
"EventDisplaysOnline.EventDisplaysOnlineHelpers");
63 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventDisplaysOnlineHelpers module");
69 ATH_MSG_WARNING(
"Could not find or call EventCanBeSeenByPublic function in EventDisplaysOnline.EventDisplaysOnlineHelpers module");
78 isPublic = PyObject_IsTrue(
result);
85 Py_DECREF(pProjectTag);
94 ATH_MSG_DEBUG(
"streams where a trigger fired and in your desired streams list: " <<
stream);
◆ createWriteableDir()
void OnlineEventDisplaysSvc::createWriteableDir |
( |
std::string |
directory, |
|
|
gid_t |
zpgid |
|
) |
| |
Definition at line 184 of file OnlineEventDisplaysSvc.cxx.
186 const char* char_dir =
directory.c_str();
188 if (
access(char_dir, F_OK) == 0) {
189 struct stat directoryStat;
190 if (
stat(char_dir, &directoryStat) == 0 && S_ISDIR(directoryStat.st_mode) &&
191 access(char_dir, W_OK) == 0) {
193 if (directoryStat.st_gid != zpgid) {
195 chown(char_dir, -1, zpgid);
202 mkdir(char_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
203 chown(char_dir, -1, zpgid);
205 }
catch (
const std::system_error&
err) {
206 std::cerr <<
"Failed to create output directory " <<
directory
207 <<
err.what() << std::endl;
◆ endEvent()
void OnlineEventDisplaysSvc::endEvent |
( |
| ) |
|
Definition at line 115 of file OnlineEventDisplaysSvc.cxx.
121 PyObject* pDirectory = PyUnicode_FromString(cString);
122 PyObject* pArgs = PyTuple_Pack(4, pDirectory, pMaxEvents, pCheckPair,pBeamSplash);
123 PyObject* pModule = PyImport_ImportModule(
const_cast< char*
>(
"EventDisplaysOnline.EventUtils"));
124 if(!pCheckPair || !pBeamSplash || !pMaxEvents || !pDirectory || !pArgs){
129 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventUtils module");
131 ATH_MSG_DEBUG(
"Successfully imported EventDisplaysOnline.EventUtils module");
136 ATH_MSG_WARNING(
"Could not find or call cleanDirectory function in EventDisplaysOnline.EventUtils module");
138 ATH_MSG_DEBUG(
"Found cleanDirectory function in EventDisplaysOnline.EventUtils module");
142 if (PyErr_Occurred()) {
151 const char* JiveXMLFileName_cString = JiveXMLFileName.c_str();
152 PyObject* pJiveXMLFileName = PyUnicode_FromString(JiveXMLFileName_cString);
153 PyObject* pArgs_zip = PyTuple_Pack(2, pDirectory, pJiveXMLFileName);
157 ATH_MSG_WARNING(
"Failed to import EventDisplaysOnline.EventUtils.zipXMLFile");
162 Py_DECREF(pJiveXMLFileName);
164 Py_DECREF(pArgs_zip);
168 Py_DECREF(pCheckPair);
169 Py_DECREF(pMaxEvents);
170 Py_DECREF(pDirectory);
◆ finalize()
StatusCode OnlineEventDisplaysSvc::finalize |
( |
| ) |
|
|
override |
◆ getEntireOutputStr()
std::string OnlineEventDisplaysSvc::getEntireOutputStr |
( |
| ) |
|
|
overridevirtual |
◆ getFileNamePrefix()
std::string OnlineEventDisplaysSvc::getFileNamePrefix |
( |
| ) |
|
|
overridevirtual |
◆ getStreamName()
std::string OnlineEventDisplaysSvc::getStreamName |
( |
| ) |
|
|
overridevirtual |
◆ handle()
void OnlineEventDisplaysSvc::handle |
( |
const Incident & |
incident | ) |
|
|
override |
Definition at line 250 of file OnlineEventDisplaysSvc.cxx.
251 ATH_MSG_DEBUG(
"Received incident " << incident.type() <<
" from " << incident.source() );
252 if ( incident.type() == IncidentType::BeginEvent && incident.source() ==
"BeginIncFiringAlg" ){
255 if ( incident.type() ==
"StoreCleared" && incident.source() ==
"StoreGateSvc" ){
◆ initialize()
StatusCode OnlineEventDisplaysSvc::initialize |
( |
| ) |
|
|
override |
Definition at line 224 of file OnlineEventDisplaysSvc.cxx.
227 IIncidentSvc* incSvc =
nullptr;
228 ATH_CHECK( service(
"IncidentSvc",incSvc) );
229 ATH_MSG_DEBUG(
"You have requested to only output JiveXML and ESD files when a trigger in the following streams was fired: ");
236 incSvc->addListener(
this,
"BeginEvent");
237 incSvc->addListener(
this,
"StoreCleared");
241 return StatusCode::SUCCESS;
◆ interfaceID()
const InterfaceID & OnlineEventDisplaysSvc::interfaceID |
( |
| ) |
|
|
inlinestatic |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ queryInterface()
StatusCode OnlineEventDisplaysSvc::queryInterface |
( |
const InterfaceID & |
riid, |
|
|
void ** |
ppvIf |
|
) |
| |
|
override |
Definition at line 260 of file OnlineEventDisplaysSvc.cxx.
266 return AthService::queryInterface(riid, ppvInterface);
269 return StatusCode::SUCCESS;
◆ setOwnershipToZpGrpOrDefault()
gid_t OnlineEventDisplaysSvc::setOwnershipToZpGrpOrDefault |
( |
| ) |
|
Definition at line 212 of file OnlineEventDisplaysSvc.cxx.
214 struct group* zp_group = getgrnam(
"zp");
215 if (zp_group !=
nullptr) {
216 zpgid = zp_group->gr_gid;
218 ATH_MSG_DEBUG(
"If running on private machine, zp group might not exist. Just set to the likely value 1307.");
◆ SvcFactory< OnlineEventDisplaysSvc >
◆ 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: