11#include "TRT_G4Utilities/TRTParameters.hh"
12#include "TRT_G4Utilities/TRTOutputFile.hh"
20#include "G4TouchableHistory.hh"
23#include "G4VProcess.hh"
24#include "G4ParticleDefinition.hh"
25#include "G4StepPoint.hh"
26#include "G4ThreeVector.hh"
27#include "G4Geantino.hh"
28#include "G4ChargedGeantino.hh"
29#include <G4EventManager.hh>
31#include "G4Electron.hh"
32#include "G4Positron.hh"
33#include "G4ProcessManager.hh"
34#include "G4ProcessVector.hh"
35#include "G4GammaGeneralProcess.hh"
36#include "G4NistManager.hh"
43 : G4VSensitiveDetector( name ),
64 verboseLevel = setVerboseLevel;
79 G4cout << GetName() <<
" InitializeHitProcessing()" << G4endl;
100 G4cout << GetName() <<
" Fluorescence parameters: EnergyThreshold "
102 G4cout << GetName() <<
" Fluorescence parameters: EnergyThresholdKr "
104 G4cout << GetName() <<
" Fluorescence parameters: EnergyThresholdAr "
106 G4cout << GetName() <<
" Fluorescence parameters: ProbabilityThreshold "
108 G4cout << GetName() <<
" Fluorescence parameters: ProbabilityThresholdKr "
110 G4cout << GetName() <<
" Fluorescence parameters: ProbabilityThresholdAr "
112 G4cout << GetName() <<
" Fluorescence parameters: EnergyDepositCorrection "
114 G4cout << GetName() <<
" Fluorescence parameters: EnergyDepositCorrectionKr "
116 G4cout << GetName() <<
" Fluorescence parameters: EnergyDepositCorrectionAr "
127 pParametersForBarrelHits =
129 pParametersForEndCapHits =
132 delete pParametersForBarrelHits;
133 delete pParametersForEndCapHits;
136 G4NistManager* nist = G4NistManager::Instance();
140 G4cout << GetName() <<
" Could not find Xe material (Only OK if no TRT straws are filled with Xenon)" << G4endl;
145 G4cout << GetName() <<
" Could not find Kr material (Only OK if no TRT straws are filled with Krypton)" << G4endl;
150 G4cout << GetName() <<
" Could not find Ar material (Only OK if no TRT straws are filled with Argon)" << G4endl;
155 description <<
"InitializeHitProcessing: Could not find Xe, Kr or Ar materials (Not OK!)";
156 G4Exception(
"TRTSensitiveDetector",
"NoTRTGasesFound", FatalException,
description);
161 G4cout << GetName() <<
" InitializeHitProcessing() done" << G4endl;
173 G4cout << GetName() <<
" Initialize()" << G4endl;
182 const G4ProcessVector* pVec =
183 G4Gamma::Definition()->GetProcessManager()->GetProcessList();
184 for(
size_t ip=0;ip<pVec->entries();ip++)
186 if((*pVec)[ip]->GetProcessName()==
"phot")
191 if((*pVec)[ip]->GetProcessName()==
"GammaGeneralProc")
193 G4GammaGeneralProcess *genproc =
static_cast<G4GammaGeneralProcess*
>((*pVec)[ip]);
194 G4VEmProcess *proc = genproc->GetEmProcess(
"phot");
195 if (proc && proc->GetProcessName()==
"phot")
204 G4cout << GetName() <<
"ERROR Did not find the photoelectic process!!!" << G4endl;
209 if(
auto* eventManager = G4EventManager::GetEventManager())
219 G4cout << GetName() <<
" Initialize() done" << G4endl;
228 G4TouchableHistory* )
232 G4Track* pTrack = pStep->GetTrack();
233 G4ParticleDefinition* pParticleDefinition = pTrack->GetDefinition();
238 if ( pParticleDefinition != G4Geantino::Definition() &&
239 pParticleDefinition != G4ChargedGeantino::Definition() )
250 if(pTrack->GetCreatorProcess()==
m_phot)
262 if ( pParticleDefinition==G4Gamma::GammaDefinition() &&
263 pStep->GetPostStepPoint()->GetProcessDefinedStep()==
m_phot )
266 double current_energyThreshold = 1E+99;
267 double current_probabilityThreshold = 2.0;
268 double current_energyDepositCorrection = 0.0;
269 G4Material *pPreStepMaterial = pStep->GetPreStepPoint()->GetMaterial();
291 description <<
"ProcessHits: Unknown prestep material";
292 G4Exception(
"TRTSensitiveDetector",
"UnknownGasFound", FatalException,
description);
301 CLHEP::RandFlat::shoot() > current_probabilityThreshold )
311 bool trackerHit =
false;
313 if ( std::fabs(pStep->GetPreStepPoint()->GetPosition().z()) <
m_boundaryZ )
348 G4cout << GetName() <<
" DeleteObjects()" << G4endl;
356 G4cout << GetName() <<
" DeleteObjects() done" << G4endl;
AtlasHitsVector< TRTUncompressedHit > TRTUncompressedHitCollection
This class is attached to G4Event objects as UserInformation.
std::string m_HitCollName
Other member variables.
TRTSensitiveDetector(const std::string &name, const std::string &hitCollectionName, int setVerboseLevel=0)
double m_probabilityThresholdAr
TRTUncompressedHitCollection * m_HitColl
void Initialize(G4HCofThisEvent *) override final
void DeleteObjects()
Called by TRTRunAction::EndOfRunAction ...
HepMcParticleLink m_partLink
G4Material * m_pMaterialXe
friend class TRTProcessingOfEndCapHits
void InitializeHitProcessing()
double m_energyDepositInKeV
int m_hitID
Properties of current TRTUncompressedHit, set by TRTProcessingOfBarrelHits and TRTProcessingOfEndCapH...
double m_probabilityThresholdKr
double m_energyDepositCorrectionKr
const TRTParameters * m_pParameters
double m_energyDepositCorrectionAr
double m_energyDepositCorrection
TRTProcessingOfEndCapHits * m_pProcessingOfEndCapHits
int m_printMessages
Configuration paremeters.
double m_probabilityThreshold
G4Material * m_pMaterialAr
double m_energyThresholdKr
G4bool ProcessHits(G4Step *, G4TouchableHistory *) override final
friend class TRTProcessingOfBarrelHits
G4Material * m_pMaterialKr
int m_hitsWithZeroEnergyDeposit
double m_energyThresholdAr
TRTProcessingOfBarrelHits * m_pProcessingOfBarrelHits
AtlasG4EventUserInfo * m_g4UserEventInfo
std::string description
glabal timer - how long have I taken so far?