ATLAS Offline Software
ALFA_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 // Package includes
10 #include "ALFA_SensitiveDetector.h"
11 
12 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
13 
14 ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool(const std::string& type, const std::string& name, const IInterface* parent)
16 {
17  // m_volumeNames = { "ALFA::logALFA_FiberU" , "ALFA::logALFA_FiberV" , "ALFA::logOD_FiberActive" ,
18  // "ALFA::B7L1_GVS" , "ALFA::A7L1_GVS" , "ALFA::A7R1_GVS" , "ALFA::B7R1_GVS" };
19  // for (unsigned int i=0;i<64;++i){
20  // m_volumeNames.push_back( "ALFA::logALFA_FiberU["+std::to_string(i)+"]" );
21  // m_volumeNames.push_back( "ALFA::logALFA_FiberV["+std::to_string(i)+"]" );
22  // }
23 }
24 
25 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
26 
28 {
29  ATH_MSG_VERBOSE( "ALFA_SensitiveDetectorTool::SetupEvent()" );
30  if(!getSD())
31  {
32  ATH_MSG_ERROR ("SetupEvent: ALFA_SensitiveDetector never created!");
33  return StatusCode::FAILURE;
34  }
35  else
36  {
37  ALFA_SensitiveDetector *localSD = dynamic_cast<ALFA_SensitiveDetector*>(getSD());
38  if(!localSD)
39  {
40  ATH_MSG_ERROR ("SetupEvent: Failed to cast m_SD into ALFA_SensitiveDetector.");
41  return StatusCode::FAILURE;
42  }
43  localSD->StartOfAthenaEvent();
44  }
45  return StatusCode::SUCCESS;
46 }
47 
48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
49 
51 {
52  ATH_MSG_VERBOSE( "ALFA_SensitiveDetectorTool::Gather()" );
53  if(!getSD())
54  {
55  ATH_MSG_ERROR ("Gather: ALFA_SensitiveDetector never created!");
56  return StatusCode::FAILURE;
57  }
58  else
59  {
60  ALFA_SensitiveDetector *localSD = dynamic_cast<ALFA_SensitiveDetector*>(getSD());
61  if(!localSD)
62  {
63  ATH_MSG_ERROR ("Gather: Failed to cast m_SD into ALFA_SensitiveDetector.");
64  return StatusCode::FAILURE;
65  }
66  localSD->EndOfAthenaEvent();
67  }
68  return StatusCode::SUCCESS;
69 }
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
73 G4VSensitiveDetector* ALFA_SensitiveDetectorTool::makeSD() const
74 {
75  ATH_MSG_DEBUG( "Initializing SD" );
76  // Create a fresh SD
78 }
ALFA_SensitiveDetectorTool::SetupEvent
StatusCode SetupEvent() override final
Beginning of an athena event.
Definition: ALFA_SensitiveDetectorTool.cxx:27
ALFA_SensitiveDetectorTool::makeSD
G4VSensitiveDetector * makeSD() const override final
Definition: ALFA_SensitiveDetectorTool.cxx:73
ALFA_SensitiveDetector.h
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
SensitiveDetectorBase::getSD
G4VSensitiveDetector * getSD()
Retrieve the current SD.
Definition: SensitiveDetectorBase.cxx:123
ALFA_SensitiveDetectorTool::ALFA_SensitiveDetectorTool
ALFA_SensitiveDetectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ALFA_SensitiveDetectorTool.cxx:14
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
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:228
ALFA_SensitiveDetectorTool.h
ALFA_SensitiveDetector::EndOfAthenaEvent
void EndOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:284
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ALFA_SensitiveDetector::StartOfAthenaEvent
void StartOfAthenaEvent()
Definition: ALFA_SensitiveDetector.cxx:43
ALFA_SensitiveDetector
Definition: ALFA_SensitiveDetector.h:24
ALFA_SensitiveDetectorTool::Gather
StatusCode Gather() override final
End of an athena event.
Definition: ALFA_SensitiveDetectorTool.cxx:50