ATLAS Offline Software
ForwardDetectors
ForwardTransportSvc
src
ForwardTransportSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "GaudiKernel/ITHistSvc.h"
6
#include "GaudiKernel/SystemOfUnits.h"
7
#include "GaudiKernel/PhysicalConstants.h"
8
#include "
GeneratorObjects/McEventCollection.h
"
9
10
#include "
ForwardTransportSvc.h
"
11
#include "
ForwardTransportSvc/IForwardTransportSvc.h
"
12
#include "
ForwardTracker/TwissFile.h
"
13
14
#include <fstream>
15
#include "TTree.h"
16
17
ForwardTransportSvc::ForwardTransportSvc
(
const
std::string&
name
, ISvcLocator*
svc
) :
18
base_class(
name
,
svc
)
19
{
20
declareProperty(
"TwissFile1"
,
m_cData
.
twissFile1
);
21
declareProperty(
"TwissFile2"
,
m_cData
.
twissFile2
);
22
declareProperty(
"PositionC1"
,
m_cData
.
positionC1
);
23
declareProperty(
"PositionC2"
,
m_cData
.
positionC2
);
24
declareProperty(
"ApertureC1"
,
m_cData
.
apertureC1
);
25
declareProperty(
"ApertureC2"
,
m_cData
.
apertureC2
);
26
declareProperty(
"EndMarker"
,
m_cData
.
endMarker
);
27
}
28
29
StatusCode
ForwardTransportSvc::initialize
() {
30
31
ATH_MSG_INFO
(
"ForwardTransportSvc::initialize"
);
32
return
StatusCode::SUCCESS;
33
}
34
35
bool
ForwardTransportSvc::selectedParticle
(G4ThreeVector
momentum
,
int
pid
) {
36
37
std::ifstream
pfile
(
m_cData
.
twissFile1
.c_str());
38
double
beamEnergy
=
ForwardTracker::GetBeamEnergy
(
pfile
)*
Gaudi::Units::GeV
;
39
40
double
eta
= fabs(
momentum
.pseudoRapidity());
41
double
xi =
momentum
.mag()/
beamEnergy
;
42
43
ATH_MSG_INFO
(
" pseudoRapidity: "
<< std::setprecision(9) <<
eta
);
44
ATH_MSG_INFO
(
" p/beamEnergy: "
<< std::setprecision(9) << xi);
45
46
if
(
eta
<
m_etaCut
)
return
false
;
47
if
(xi <
m_xiCut
)
return
false
;
48
49
if
(
m_transportFlag
) {
50
51
if
(
pid
== 2212)
return
true
;
// proton
52
}
53
else
{
54
55
if
(
pid
== 2112)
return
true
;
// neutron
56
if
(
pid
== 22)
return
true
;
// gamma
57
if
(
pid
== 3122)
return
true
;
// lambda
58
}
59
60
return
false
;
61
}
ForwardTransportSvc::ForwardTransportSvc
ForwardTransportSvc(const std::string &name, ISvcLocator *svc)
Definition:
ForwardTransportSvc.cxx:17
ForwardTracker::ConfigData::positionC1
double positionC1
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:17
GeV
#define GeV
Definition:
PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
ForwardTransportSvc::m_transportFlag
BooleanProperty m_transportFlag
Definition:
ForwardTransportSvc.h:28
IForwardTransportSvc.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
ForwardTransportSvc::m_etaCut
DoubleProperty m_etaCut
Definition:
ForwardTransportSvc.h:29
eta
Scalar eta() const
pseudorapidity method
Definition:
AmgMatrixBasePlugin.h:83
LArNewCalib_Delay_OFC_Cali.pfile
string pfile
Definition:
LArNewCalib_Delay_OFC_Cali.py:181
ForwardTracker::ConfigData::apertureC1
double apertureC1
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:19
ForwardTransportSvc::initialize
virtual StatusCode initialize()
Definition:
ForwardTransportSvc.cxx:29
ForwardTransportSvc::m_xiCut
DoubleProperty m_xiCut
Definition:
ForwardTransportSvc.h:30
ForwardTransportSvc::m_cData
ForwardTracker::ConfigData m_cData
Definition:
ForwardTransportSvc.h:27
ParticleGun_EoverP_Config.momentum
momentum
Definition:
ParticleGun_EoverP_Config.py:63
McEventCollection.h
ForwardTracker::ConfigData::apertureC2
double apertureC2
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:20
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ParticleGun_EoverP_Config.pid
pid
Definition:
ParticleGun_EoverP_Config.py:62
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition:
AthROOTErrorHandlerSvc.cxx:10
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:228
RunTileTBMonitoring.beamEnergy
beamEnergy
Definition:
RunTileTBMonitoring.py:248
TwissFile.h
ForwardTracker::ConfigData::twissFile1
std::string twissFile1
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:15
ForwardTracker::ConfigData::twissFile2
std::string twissFile2
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:16
ForwardTransportSvc.h
ForwardTracker::GetBeamEnergy
double GetBeamEnergy(std::ifstream &)
Definition:
TwissFile.cxx:112
ForwardTransportSvc::selectedParticle
virtual bool selectedParticle(G4ThreeVector mom, int pid)
Definition:
ForwardTransportSvc.cxx:35
ForwardTracker::ConfigData::endMarker
double endMarker
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:21
ForwardTracker::ConfigData::positionC2
double positionC2
Definition:
ForwardTracker/ForwardTracker/ConfigData.h:18
Generated on Wed Jan 8 2025 21:10:05 for ATLAS Offline Software by
1.8.18