|
ATLAS Offline Software
|
Go to the documentation of this file.
32 m_fieldmode (
"MapSolenoid"),
33 m_propTool (
"Trk::RungeKuttaPropagator"),
58 return StatusCode::FAILURE;
67 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
88 if (writeHandle.isValid()) {
89 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid.");
90 return StatusCode::SUCCESS;
93 EventIDRange rangeTrt;
96 if (not trtDetEleHandle.
isValid()) {
98 return StatusCode::FAILURE;
102 if (trtNum==
nullptr){
106 if (not trtDetEleHandle.
range(rangeTrt)) {
107 ATH_MSG_FATAL(
"Failed to retrieve validity range for " << trtDetEleHandle.
key());
108 return StatusCode::FAILURE;
111 auto writeCdo = std::make_unique<InDet::TRT_TrackSegmentsToolCondData_xk>();
112 if(writeCdo->m_ndzdr )
delete [] writeCdo->m_ndzdr ;
113 if(writeCdo->m_slope )
delete [] writeCdo->m_slope ;
114 if(writeCdo->m_islope )
delete [] writeCdo->m_islope ;
126 for(
int ring = 0; ring!=Rings; ++ring) {
130 writeCdo->m_flayers[1][ring] = writeCdo->m_nlayers[1]; writeCdo->m_flayers[2][ring] = writeCdo->m_nlayers[2];
131 writeCdo->m_nlayers[1] += NSlayers ; writeCdo->m_nlayers[2] += NSlayers ;
133 for(
int nsl=0; nsl!=NSlayers; ++nsl) {
136 for(
int f=0;
f!=NPhi; ++
f) {
140 if(!base1 || !base2)
continue;
147 if(!bael1 || !rb1 || !rb2)
continue;
153 RZ [1][
n] = std::sqrt(C1.x()*C1.x()+C1.y()*C1.y());
158 RZ [2][
n] = std::sqrt(C2.x()*C2.x()+C2.y()*C2.y());
165 for(
int s=0;
s!=
ns; ++
s) {
171 if(
f==0) rmean+=std::sqrt(sc1->x()*sc1->x()+sc1->y()*sc1->y());
173 if(!sc1 || !st1 || !tr1 ) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
174 ++writeCdo->m_nstraws[1];
179 if(!sc2 || !st2 || !tr2) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
180 ++writeCdo->m_nstraws[2];
182 if(
f==0) { RZ[1][
n-1] = RZ[2][
n-1] = rmean/
float(
ns);}
189 int Wheels = trtNum->
getNEndcapWheels();
if(!Wheels)
return StatusCode::SUCCESS;
192 for(
int wh = 0;
wh!=Wheels; ++
wh) {
195 writeCdo->m_flayers[0][
wh] = writeCdo->m_nlayers[0]; writeCdo->m_flayers[3][
wh] = writeCdo->m_nlayers[3];
196 writeCdo->m_nlayers[0] += NSlayers ; writeCdo->m_nlayers[3] += NSlayers ;
198 for(
int nsl = 0; nsl!=NSlayers; ++nsl) {
200 for(
int f=0;
f!=NPhi; ++
f) {
204 if(!base1 || !base2)
continue;
212 if(!enel1 || !
db1 || !
db2)
continue;
230 for(
int s=0;
s!=
ns; ++
s) {
237 if(!sc1 || !st1 || !tr1) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
238 ++writeCdo->m_nstraws[0];
245 if(!sc2 || !st2 || !tr2) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
246 ++writeCdo->m_nstraws[3];
252 double zmax = RZ[3][writeCdo->m_nlayers[3]-1]+10.;
253 double rmax = RZ[2][writeCdo->m_nlayers[2]-1]+10.;
257 {-2.05,-1.95,-1.84,-1.72,-1.62,-1.53,-1.43,-1.33,-1.21,-1.00,-.94, -.85,-.32,
258 .32, .85, .94, 1.00, 1.21, 1.33, 1.43, 1.53, 1.62, 1.72,1.84, 1.95,2.05};
260 std::deque<Amg::Vector3D>
G [26];
264 for(
int r=0;
r!=26; ++
r) {
266 double pinv =-1./(
m_pTmin*std::sqrt(1.+writeCdo->m_dzdr[
r]*writeCdo->m_dzdr[
r]));
271 std::atan2(1.,
double(writeCdo->m_dzdr[
r])),
279 for(
int b=0;
b!=4; ++
b) {
280 for(
unsigned int i=0;
i!=writeCdo->m_nlayers[
b]; ++
i) {
281 writeCdo->m_begin[
b][
i] =
n;
282 for(
float r : writeCdo->m_dzdr) {
284 writeCdo->m_end[
b][
i] =
n++;
290 writeCdo->m_ndzdr =
new unsigned int[
n];
291 writeCdo->m_islope =
new int[
n];
292 writeCdo->m_slope =
new float [
n];
293 writeCdo->m_cirsize = writeCdo->m_nstraws[0]+writeCdo->m_nstraws[1];
296 for (
int b = 0;
b != 4; ++
b) {
298 for (
unsigned int i = 0;
i != writeCdo->m_nlayers[
b]; ++
i) {
300 for (
int r = 0;
r != 26; ++
r) {
301 if (writeCdo->m_dzdr[
r] >=
Tmin[
b][
i] &&
302 writeCdo->m_dzdr[
r] <=
Tmax[
b][
i]) {
303 writeCdo->m_ndzdr[
n] =
r;
305 if (
b == 0 ||
b == 3) {
308 for (++gp; gp != gpe; ++gp) {
309 if (
b == 3 && (*gp).z() >= RZ[
b][
i])
311 if (
b == 0 && (*gp).z() <= RZ[
b][
i])
318 for (++gp; gp != gpe; ++gp) {
319 if (std::sqrt((*gp).x() * (*gp).x() + (*gp).y() * (*gp).y()) >
334 double as = 1. / std::sqrt(
ax *
ax +
ay *
ay + az * az);
345 double as = 1. / std::sqrt(
ax *
ax +
ay *
ay + az * az);
352 if (
b == 0 ||
b == 3) {
353 S = (RZ[
b][
i] -
z) / az;
355 double A = (
ax *
x +
ay *
y) * 2.;
356 double D = (RZ[
b][
i] -
x -
y) * (RZ[
b][
i] +
x +
y) + 2. *
x *
y;
358 double B = 2. * (
ax *
ax +
ay *
ay);
359 double Sq = A * A + 2. * D * B;
360 Sq > 0. ? Sq = std::sqrt(Sq) : Sq = 0.;
361 double S1 = -(A + Sq) / B;
362 double S2 = -(A - Sq) / B;
368 writeCdo->m_slope[
n] = std::atan2(
y +
S *
ay,
x +
S *
ax) *
m_A;
369 writeCdo->m_islope[
n] =
int(writeCdo->m_slope[
n] *
m_Psi128);
376 if (writeHandle.record(rangeTrt, std::move(writeCdo)).isFailure()) {
378 <<
" with EventRange " << rangeTrt
379 <<
" into Conditions Store");
380 return StatusCode::FAILURE;
382 ATH_MSG_DEBUG(
"recorded new CDO " << writeHandle.key() <<
" with range "
383 << rangeTrt <<
" into Conditions Store");
385 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
struct TBPatternUnitContext S1
Trk::MagneticFieldProperties m_fieldprop
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual StatusCode execute(const EventContext &ctx) const override
unsigned int nStraws() const
Number of straws in the element.
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
bool range(EventIDRange &r)
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
An algorithm that can be simultaneously executed in multiple threads.
@ FastField
call the fast field access method of the FieldSvc
unsigned int getNEndcapWheels() const
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey
TRT_TrackSegmentsMakerCondAlg_ATLxk(const std::string &name, ISvcLocator *pSvcLocator)
::StatusCode StatusCode
StatusCode definition for legacy code.
ToolHandle< Trk::IPropagator > m_propTool
Eigen::Affine3d Transform3D
unsigned int getNBarrelPhi() const
unsigned int getNBarrelLayers(unsigned int iMod) const
@ FullField
Field is set to be realistic, but within a given Volume.
@ NoField
Field is set to 0., 0., 0.,.
const TRT_BarrelElement * getBarrelDetElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
double halflengthY() const
for consitant naming
StatusCode initialize(bool used=true)
Eigen::Matrix< double, 3, 1 > Vector3D
virtual const Trk::SurfaceBounds & bounds() const override final
Straw layer bounds.
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
virtual Surface::ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theta, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const override final
Use the Surface as a ParametersBase constructor, from local parameters - charged.
virtual StatusCode initialize() override
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
struct TBPatternUnitContext S2
const TRT_Numerology * getTRTNumerology() const
unsigned int getNEndcapPhi() const
unsigned int getNEndcapLayers(unsigned int iWheel) const
unsigned int getNBarrelRings() const
const std::string & key() const
const TRT_EndcapElement * getEndcapDetElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer)
SG::WriteCondHandleKey< TRT_TrackSegmentsToolCondData_xk > m_writeKey
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw: