|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #include "GaudiKernel/ServiceHandle.h"
12 #include "GaudiKernel/IEvtSelector.h"
13 #include "GaudiKernel/IIncidentSvc.h"
14 #include "GaudiKernel/ToolHandle.h"
49 incSvc->addListener(
this,
"BeginEvent", 0);
50 return StatusCode::SUCCESS;
70 stream <<
"Event type: SIMULATION '" << std::boolalpha
81 ATH_MSG_ERROR(
" Unable to retrieve EventInfo from StoreGate!!!");
90 return StatusCode::SUCCESS;
102 return StatusCode::SUCCESS;
108 ATH_MSG_INFO(
"Handling incident '" << inc.type() <<
"'");
123 ATH_MSG_INFO(
"--> RANDOM MODE: Using a random VP1 configuration file...");
130 std::string commandStr =
"vp1 -batch";
141 ATH_MSG_INFO(
" ===> launching VP1-Batch: " << commandStr);
143 system(commandStr.c_str());
145 }
catch (std::runtime_error&
err) {
147 ATH_MSG_WARNING(
"Unable to launch VP1-Batch on the latest-produced event file");
167 std::vector<std::string> configFiles;
168 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wTRTGeo.vp1");
169 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wTRTGeo_IAview.vp1");
170 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wTRTGeo_wBarrel.vp1");
171 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wPixel_wSCT_wOpenCalo_wGeo_3D.vp1");
172 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wPixel_wSCT_wGeo_3D.vp1");
173 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wPixel_3D.vp1");
174 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wIDGeo.vp1");
175 configFiles.push_back(
"vp1_conf_ATLASatHOME_truth_event_wGeo_frontView.vp1");
177 int nConfigFiles = configFiles.size();
179 int nPositions = nConfigFiles - 1;
182 auto seed = std::random_device{}();
183 auto randomDist = std::bind(std::uniform_int_distribution<int>(0, nPositions ),
206 std::string commandStr =
"convert -composite `cat latest_vp1image` $TestArea/InstallArea/share/ATLAS-Logo-New_300pixels.png -geometry +10+10 -depth 8 `cat latest_vp1image`";
208 ATH_MSG_DEBUG(
" ===> overlay the ATLAS logo: " << commandStr );
210 system(commandStr.c_str());
211 }
catch (std::runtime_error&
err) {
231 std::string commandStr;
234 commandStr +=
"nRun="+nRun+
"; ";
235 commandStr +=
"nEvent="+nEvent+
"; ";
239 commandStr +=
"img=`cat latest_vp1image`; ";
240 commandStr +=
"width=$(identify -format %W ${img}); ";
241 commandStr +=
"width=$(( ${width} * 3 / 10 )); ";
244 commandStr = commandStr
246 +
"-background '#0008' "
247 +
"-geometry +20+20 "
250 +
"-size ${width}x80 "
259 +
"caption:'Run number: '${nRun}'\\nEvent number: '${nEvent}'\\n'${timestamp} "
263 +
"-gravity SouthEast "
268 ATH_MSG_DEBUG(
" ===> overlay the event details: " << commandStr );
270 system(commandStr.c_str());
271 }
catch (std::runtime_error&
err) {
282 localtime_r(&t_timestamp, <m);
286 <<
" - " <<
"Month: "<< 1 + ltm.tm_mon<<
" - "
287 <<
"Day: "<< ltm.tm_mday
288 <<
" - " "Time: "<< ltm.tm_hour <<
":" << ltm.tm_min <<
":" << ltm.tm_sec);
291 std::ostringstream ostri;
292 ostri << 1900 + ltm.tm_year
293 <<
"-" << 1 + ltm.tm_mon
294 <<
"-" << ltm.tm_mday
295 <<
"T" << ltm.tm_hour <<
"-" << ltm.tm_min <<
"-" << ltm.tm_sec;
std::string getRandomConfigFile()
uint64_t eventNumber() const
The current event's event number.
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
bool msgLvl(const MSG::Level lvl) const
unsigned long m_runNumber
#define ATH_MSG_VERBOSE(x)
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
void overlayEventDetails()
unsigned long m_timeStamp
virtual void handle(const Incident &inc) override
virtual StatusCode execute() override
virtual StatusCode initialize() override
::StatusCode StatusCode
StatusCode definition for legacy code.
VP1BatchOnLatestEvent(const std::string &name, ISvcLocator *pSvcLocator)
std::string m_destinationDir
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string to_string(const DetectorType &type)
void getHumanReadableTimestamp()
std::string m_inputVP1CfgFile
#define ATH_MSG_WARNING(x)
std::string m_humanTimestamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
bool eventType(EventType type) const
Check for one particular bitmask value.
virtual StatusCode finalize() override