ATLAS Offline Software
AFP_SiDSensitiveDetectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // Class header
8 
9 // For the SD itself
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 
14 AFP_SiDSensitiveDetectorTool::AFP_SiDSensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent)
16 {
17 }
18 
19 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
20 
22 {
23  ATH_MSG_VERBOSE( "AFP_SiDSensitiveDetectorTool::SetupEvent()" );
24  if(!getSD())
25  {
26  ATH_MSG_ERROR ("SetupEvent: AFP_SiDSensitiveDetector never created!");
27  return StatusCode::FAILURE;
28  }
29  else
30  {
31  AFP_SiDSensitiveDetector *localSD = dynamic_cast<AFP_SiDSensitiveDetector*>(getSD());
32  if(!localSD)
33  {
34  ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into AFP_SiDSensitiveDetector.");
35  return StatusCode::FAILURE;
36  }
37  localSD->StartOfAthenaEvent();
38  }
39  return StatusCode::SUCCESS;
40 }
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 
45 {
46  ATH_MSG_VERBOSE( "AFP_SiDSensitiveDetectorTool::Gather()" );
47  if(!getSD())
48  {
49  ATH_MSG_ERROR ("Gather: AFP_SiDSensitiveDetector never created!");
50  return StatusCode::FAILURE;
51  }
52  else
53  {
54  AFP_SiDSensitiveDetector *localSD = dynamic_cast<AFP_SiDSensitiveDetector*>(getSD());
55  if(!localSD)
56  {
57  ATH_MSG_ERROR ("Gather: Failed to cast m_SD into AFP_SiDSensitiveDetector.");
58  return StatusCode::FAILURE;
59  }
60  localSD->EndOfAthenaEvent();
61  }
62  return StatusCode::SUCCESS;
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
67 G4VSensitiveDetector* AFP_SiDSensitiveDetectorTool::makeSD() const
68 {
69  ATH_MSG_DEBUG( "Initializing SD" );
70  // Create a fresh SD
72 }
73 
AFP_SiDSensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: AFP_SiDSensitiveDetector.cxx:535
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:42
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AFP_SiDSensitiveDetectorTool::SetupEvent
StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: AFP_SiDSensitiveDetectorTool.cxx:21
SensitiveDetectorBase::getSD
G4VSensitiveDetector * getSD()
Retrieve the current SD.
Definition: SensitiveDetectorBase.cxx:123
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AFP_SiDSensitiveDetectorTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFP_SiDSensitiveDetector
Definition: AFP_SiDSensitiveDetector.h:23
AFP_SiDSensitiveDetectorTool::Gather
StatusCode Gather() override final
End of an athena event.
Definition: AFP_SiDSensitiveDetectorTool.cxx:44
SensitiveDetectorBase::m_outputCollectionNames
Gaudi::Property< std::vector< std::string > > m_outputCollectionNames
Names of all output collections written out by this SD.
Definition: SensitiveDetectorBase.h:84
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AFP_SiDSensitiveDetectorTool::AFP_SiDSensitiveDetectorTool
AFP_SiDSensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFP_SiDSensitiveDetectorTool.cxx:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFP_SiDSensitiveDetector.h
AFP_SiDSensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: AFP_SiDSensitiveDetector.cxx:51
AFP_SiDSensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: AFP_SiDSensitiveDetectorTool.cxx:67