ATLAS Offline Software
Functions
G4AtlasAlg.cxx File Reference
#include "G4AtlasAlg.h"
#include "G4AtlasFluxRecorder.h"
#include "G4AtlasTools/G4AtlasActionInitialization.h"
#include "G4AtlasTools/G4AtlasUserWorkerInitialization.h"
#include "AthenaKernel/RNGWrapper.h"
#include "CxxUtils/checker_macros.h"
#include "G4AtlasAlg/G4AtlasMTRunManager.h"
#include "G4AtlasAlg/G4AtlasRunManager.h"
#include "G4AtlasAlg/G4AtlasUserWorkerThreadInitialization.h"
#include "G4AtlasAlg/G4AtlasWorkerRunManager.h"
#include <G4Event.hh>
#include "G4EventManager.hh"
#include "G4GDMLParser.hh"
#include "G4Navigator.hh"
#include "G4ParallelWorldPhysics.hh"
#include "G4PropagatorInField.hh"
#include "G4RunManagerKernel.hh"
#include "G4ScoringManager.hh"
#include "G4StackManager.hh"
#include "G4StateManager.hh"
#include "G4TrackingManager.hh"
#include "G4TransportationManager.hh"
#include "G4UImanager.hh"
#include "G4VModularPhysicsList.hh"
#include "G4VUserPhysicsList.hh"
#include "CLHEP/Random/RandomEngine.h"
#include "GaudiKernel/IThreadInitTool.h"
#include "GeneratorObjects/HepMcParticleLink.h"
#include "GeoModelInterfaces/IGeoModelSvc.h"
#include "HitManagement/HitCollectionMap.h"
#include "MCTruth/AtlasG4EventUserInfo.h"
#include "MCTruthBase/TruthStrategyManager.h"
#include "PathResolver/PathResolver.h"
#include "StoreGate/ReadHandle.h"
#include "StoreGate/WriteHandle.h"
#include <memory>
#include <mutex>

Go to the source code of this file.

Functions

StatusCode G4AtlasAlg::initialize ATLAS_NOT_THREAD_SAFE ()
 Install fatal handler with default options. More...
 

Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode G4AtlasAlg::initialize ATLAS_NOT_THREAD_SAFE ( )
inline

Install fatal handler with default options.

This is meant to be easy to call from python via ctypes.

Install fatal handler with default options.

getLorentzAngle() Read LorentzAngle from HIST and write out into local DB

getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB

getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB

getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB

getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB

getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats

beginning of the loop of channels

bad bit newly found

known bad bit

for low noisy cells

for high noisy cells

0.01 is used to scale "PER" to the same order of magnitude to "SIG"

smaller deviation: distorted

checking TmaxAmp, Not mixed with MaxAmp and Width

channel information output

Only dead or distorted, or short known BCs are considered below.

index of bc

getCoefficientMap(label, EigenIdxList)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. EigenIdxList is user defined vector containing all eigenvector index that user interested in. output: Map of format map<string, map<string, float>> containing decomposition coefficient of the list of eigenvectors defined by EigenIdxList.

getCoefficients(label, evIdx)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. evIdx: The index of eigenvector user interested in. output value: vector of coefficient values. The order is the same as output given by getListOfOriginalNuisanceParameters()

getListOfOriginalNuisanceParameters(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light output value: List of original nuisance parameter names.

getNumEigenVectors(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light return value: number of eigen vectors used for chosen label. Return 0 if error occured.

Definition at line 72 of file G4AtlasAlg.cxx.

73 {
74  ATH_MSG_DEBUG("Start of initialize()");
75 
76  // Read the simplified geometry for FastCaloSim track transportation if requested
77  if(!m_simplifiedGeoPath.empty()) {
78  std::string geoFile = PathResolverFindCalibFile(m_simplifiedGeoPath);
79 
80  if (geoFile.empty()) {
81  ATH_MSG_FATAL("Could not find simplified geometry file: " << m_simplifiedGeoPath);
82  return StatusCode::FAILURE;
83  }
84 
85  G4GDMLParser parser;
86  parser.Read(geoFile, false);
87  }
88 
89  // Create the scoring manager if requested
90  if (m_recordFlux) G4ScoringManager::GetScoringManager();
91 
92  ATH_CHECK( m_userActionSvc.retrieve() );
93  // One-time initialization
94  try {
95  std::call_once(initializeOnceFlag, &G4AtlasAlg::initializeOnce, this);
96  }
97  catch(const std::exception& e) {
98  ATH_MSG_ERROR("Failure in G4AtlasAlg::initializeOnce: " << e.what());
99  return StatusCode::FAILURE;
100  }
101 
102  ATH_CHECK( m_rndmGenSvc.retrieve() );
103  ATH_CHECK(m_actionTools.retrieve());
104 
105  ATH_CHECK(m_senDetTool.retrieve());
106  ATH_CHECK(m_fastSimTool.retrieve());
107 
108  // Truth
109  ATH_CHECK( m_truthRecordSvc.retrieve() );
110  ATH_MSG_INFO( "- Using ISF TruthRecordSvc : " << m_truthRecordSvc.typeAndName() );
111  ATH_CHECK( m_geoIDSvc.retrieve() );
112  ATH_MSG_INFO( "- Using ISF GeoIDSvc : " << m_geoIDSvc.typeAndName() );
113 
114  TruthStrategyManager& sManager = TruthStrategyManager::GetStrategyManager_nc();
115  sManager.SetISFTruthSvc( &(*m_truthRecordSvc) );
116  sManager.SetISFGeoIDSvc( &(*m_geoIDSvc) );
117 
118  // I/O
119  ATH_CHECK( m_inputTruthCollectionKey.initialize());
120  ATH_CHECK( m_outputTruthCollectionKey.initialize());
121  ATH_CHECK( m_eventInfoKey.initialize() );
122 
123  ATH_CHECK(m_inputConverter.retrieve());
124  if ( not m_truthPreselectionTool.empty() ) {
125  ATH_CHECK(m_truthPreselectionTool.retrieve());
126  }
127 
128  if ( not m_qspatcher.empty() ) {
129  ATH_CHECK( m_qspatcher.retrieve() );
130  }
131 
132  ATH_MSG_DEBUG("End of initialize()");
133  return StatusCode::SUCCESS;
134 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TruthStrategyManager::SetISFTruthSvc
void SetISFTruthSvc(ISF::ITruthSvc *truthSvc)
Define which ISF TruthService to use.
Definition: TruthStrategyManager.cxx:53
python.CaloAddPedShiftConfig.parser
parser
Definition: CaloAddPedShiftConfig.py:41
TruthStrategyManager::SetISFGeoIDSvc
void SetISFGeoIDSvc(ISF::IGeoIDSvc *geoIDSvc)
Define which ISF GeoIDSvc to use.
Definition: TruthStrategyManager.cxx:59
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
calibdata.exception
exception
Definition: calibdata.py:495
TruthStrategyManager
Singleton class for creating truth incidents.
Definition: TruthStrategyManager.h:23
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:283
G4AtlasAlg::initializeOnce
void initializeOnce()
G4 initialization called only by the first alg instance.
Definition: G4AtlasAlg.cxx:137