|
ATLAS Offline Software
|
Go to the documentation of this file.
23 #include "G4Version.hh"
28 #include "G4String.hh"
31 #include "G4Electron.hh"
33 #include "G4Positron.hh"
34 #include "G4Neutron.hh"
37 #include "GaudiKernel/ITHistSvc.h"
39 #include <string_view>
49 #if G4VERSION_NUMBER < 1100
58 return s.find(
v) != std::string_view::npos;
94 G4cout<<
"TestActionTimer::Constructor: Labels "
97 G4cout <<
"Particle Dead" << G4endl;
105 for (
int i(0);
i <
eMax; ++
i) {
106 G4Timer*
timer =
new G4Timer();
117 G4cout <<
"TestActionTimer::Constructor done" << G4endl;
153 std::cerr<<
"TestActionTimer::EndOfRunAction "<<
m_report.
runTime <<std::endl;
164 G4Track*
track = aStep->GetTrack();
166 G4String thePrePVname =
track->GetVolume()->GetName();
167 G4String thePostPVname;
168 if (
track->GetNextVolume() != 0) {
169 thePostPVname =
track->GetNextVolume()->GetName();
171 thePostPVname =
"OutOfWorld";
178 if (thePrePVname != thePostPVname){
189 if (
timer->IsValid()) {
195 if (
track->GetDefinition() == G4Electron::ElectronDefinition() ){
202 if (
track->GetDefinition() == G4Positron::PositronDefinition() ){
209 if (
track->GetDefinition() == G4Gamma::GammaDefinition() &&
215 if (
track->GetDefinition() == G4Neutron::NeutronDefinition() &&
226 if (
timer == 0)
return -999.;
228 return (
timer->GetUserElapsed() +
timer->GetSystemElapsed());
234 G4cout <<
"TestActionTimer::PPanic" << G4endl;
241 G4cout <<
"TestActionTimer::PPanic stopping counter i:" <<
i <<
" " <<
timer << G4endl;
243 if (!
timer->IsValid()){
249 G4cout <<
"TestActionTimer::PPanic done" << G4endl;
256 G4cout <<
"TestActionTimer::VPanic" << G4endl;
263 G4cout <<
"TestActionTimer::VPanic stopping counter i:" <<
i <<
" " <<
timer << G4endl;
265 if (!
timer->IsValid()){
271 G4cout <<
"TestActionTimer::VPanic done" << G4endl;
277 std::string_view
nom(nomstr);
278 if(
nom.length() >= 17 &&
279 nom.substr(13,4) ==
"EMEC" ){
282 else if (
nom.length() >= 16 &&
283 nom.substr(13,3) ==
"EMB" ){
286 else if(
nom.length() >= 25 &&
287 nom.substr(21,4) ==
"Cryo" ) {
290 else if(
nom.length() >= 26 &&
291 nom.substr(13,13) ==
"FCAL::Module1"){
294 else if(
nom.length() >= 25 &&
295 nom.substr(13,12) ==
"FCAL::Module" ){
298 else if (
nom.length() >= 17 &&
299 nom.substr(13,4) ==
"FCAL" ){
302 else if (
nom.length() >= 16 &&
303 nom.substr(13,3) ==
"HEC" ){
306 else if(
nom.length() >= 31 &&
307 nom.substr(21,10) ==
"Presampler" ) {
310 else if (
nom.length() >= 3 &&
311 nom.substr(0,3) ==
"LAr" ){
314 else if( ( (
nom.length() >= 4 &&
315 nom.substr(0,4) ==
"Muon") ||
316 nom.substr(0,4) ==
"MUON" ) ||
317 (
nom.length() >= 9 &&
318 nom.substr(0,9) ==
"DriftTube" ) ||
320 (
nom.length() >= 12 &&
321 nom.substr(0,12) ==
"SensitiveGas" ) ||
326 else if (
nom.length() >= 8 &&
327 nom.substr(0,8) ==
"ITkPixel" ){
330 else if (
nom.length() >= 8 &&
331 nom.substr(0,8) ==
"ITkStrip" ){
334 else if ((
nom.length() >= 5 &&
335 nom.substr(0,5) ==
"Pixel") ||
336 nom ==
"Outside Barrel Service"){
339 else if (
nom.length() >= 3 &&
340 nom.substr(0,3) ==
"SCT" ){
343 else if ( (
nom.length() >= 3 &&
344 nom.substr(0,3) ==
"TRT" ) ||
348 else if (
nom.length() >= 4 &&
349 nom.substr(0,4) ==
"Tile"){
352 else if ( (
nom.length() >= 12 &&
353 nom.substr(0,12) ==
"InDetServMat" ) ||
354 (
nom.length() >= 4 &&
355 nom.substr(0,4) ==
"IDET" ) ||
356 (
nom.length() >= 3 &&
357 nom.substr(0,3) ==
"ITK" ) ||
358 (
nom.length() >= 8 &&
359 nom.substr(0,8) ==
"BeamPipe" ) ||
360 (
nom.length() >= 7 &&
361 nom.substr(0,7) ==
"Section" ) ||
362 (
nom.length() >= 3 &&
363 (
nom.substr(0,3) ==
"BLM" ||
364 nom.substr(0,3) ==
"BCM" ||
365 nom.substr(0,3) ==
"PLR" ) ) ||
366 (
nom.length() >= 8 &&
367 nom.substr(0,8) ==
"BCMPrime" ) ){
std::vector< double > time
Vector of timers for each of the enum.
double TimerSum(G4Timer *timer) const
Gets the appropriate time from the timer for adding to the sum.
void PPanic()
Method to shut down all particle timers.
G4Timer * m_runTimer
Timer for the entire run.
std::vector< G4Timer * > m_timer
Vector of timers for each of the enum.
virtual void UserSteppingAction(const G4Step *) override
virtual void EndOfEventAction(const G4Event *) override
virtual void EndOfRunAction(const G4Run *) override
def timer(name, disabled=False)
G4Timer * m_eventTimer
Timer for this event.
bool G4StrContains(const G4String &s, const char *v)
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
TestActionTimer()
constructor
virtual void BeginOfEventAction(const G4Event *) override
void VPanic()
Method to shut down all volume timers.
double m_eventTime
Double for storing this event.
int ClassifyVolume(G4String &) const
Method to sort out which volume we are in.
virtual void BeginOfRunAction(const G4Run *) override
std::vector< std::string > timeName
Vector of names for each of the timers.