ATLAS Offline Software
AFP_SensitiveDetectorTool.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
10 #include "AFP_SensitiveDetector.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 
14 AFP_SensitiveDetectorTool::AFP_SensitiveDetectorTool(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_SensitiveDetectorTool::SetupEvent()" );
24  if(!getSD())
25  {
26  ATH_MSG_ERROR ("SetupEvent: AFP_SensitiveDetector never created!");
27  return StatusCode::FAILURE;
28  }
29  else
30  {
31  AFP_SensitiveDetector *localSD = dynamic_cast<AFP_SensitiveDetector*>(getSD());
32  if(!localSD)
33  {
34  ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into AFP_SensitiveDetector.");
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_SensitiveDetectorTool::Gather()" );
47  if(!getSD())
48  {
49  ATH_MSG_ERROR ("Gather: AFP_SensitiveDetector never created!");
50  return StatusCode::FAILURE;
51  }
52  else
53  {
54  AFP_SensitiveDetector *localSD = dynamic_cast<AFP_SensitiveDetector*>(getSD());
55  if(!localSD)
56  {
57  ATH_MSG_ERROR ("Gather: Failed to cast m_SD into AFP_SensitiveDetector.");
58  return StatusCode::FAILURE;
59  }
60  localSD->EndOfAthenaEvent();
61  }
62  return StatusCode::SUCCESS;
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
67 G4VSensitiveDetector* AFP_SensitiveDetectorTool::makeSD() const
68 {
69  ATH_MSG_DEBUG( "Initializing SD" );
70  // Create a fresh SD
72 }
73 
AFP_SensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: AFP_SensitiveDetector.cxx:774
AFP_SensitiveDetectorTool::Gather
StatusCode Gather() override final
End of an athena event.
Definition: AFP_SensitiveDetectorTool.cxx:44
SensitiveDetectorBase
Common base class for tools that create and manage Geant4 sensitive detectors.
Definition: SensitiveDetectorBase.h:42
AFP_SensitiveDetectorTool::SetupEvent
StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: AFP_SensitiveDetectorTool.cxx:21
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
AFP_SensitiveDetectorTool.h
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
AFP_SensitiveDetector.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AFP_SensitiveDetector
Definition: AFP_SensitiveDetector.h:25
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AFP_SensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: AFP_SensitiveDetector.cxx:57
AFP_SensitiveDetectorTool::AFP_SensitiveDetectorTool
AFP_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: AFP_SensitiveDetectorTool.cxx:14
AFP_SensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: AFP_SensitiveDetectorTool.cxx:67