|
ATLAS Offline Software
|
Go to the documentation of this file.
47 return StatusCode::FAILURE;
56 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
77 if (writeHandle.isValid()) {
78 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid.");
79 return StatusCode::SUCCESS;
82 EventIDRange rangeTrt;
85 if (not trtDetEleHandle.
isValid()) {
87 return StatusCode::FAILURE;
95 if (not trtDetEleHandle.
range(rangeTrt)) {
96 ATH_MSG_FATAL(
"Failed to retrieve validity range for " << trtDetEleHandle.
key());
97 return StatusCode::FAILURE;
100 auto writeCdo = std::make_unique<InDet::TRT_TrackSegmentsToolCondData_xk>();
101 if(writeCdo->m_ndzdr )
delete [] writeCdo->m_ndzdr ;
102 if(writeCdo->m_slope )
delete [] writeCdo->m_slope ;
103 if(writeCdo->m_islope )
delete [] writeCdo->m_islope ;
115 for(
int ring = 0; ring!=Rings; ++ring) {
119 writeCdo->m_flayers[1][ring] = writeCdo->m_nlayers[1]; writeCdo->m_flayers[2][ring] = writeCdo->m_nlayers[2];
120 writeCdo->m_nlayers[1] += NSlayers ; writeCdo->m_nlayers[2] += NSlayers ;
122 for(
int nsl=0; nsl!=NSlayers; ++nsl) {
125 for(
int f=0;
f!=NPhi; ++
f) {
129 if(!base1 || !base2)
continue;
136 if(!bael1 || !rb1 || !rb2)
continue;
142 RZ [1][
n] = std::sqrt(C1.x()*C1.x()+C1.y()*C1.y());
147 RZ [2][
n] = std::sqrt(C2.x()*C2.x()+C2.y()*C2.y());
154 for(
int s=0;
s!=
ns; ++
s) {
160 if(
f==0) rmean+=std::sqrt(sc1->x()*sc1->x()+sc1->y()*sc1->y());
162 if(!sc1 || !st1 || !tr1 ) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
163 ++writeCdo->m_nstraws[1];
168 if(!sc2 || !st2 || !tr2) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
169 ++writeCdo->m_nstraws[2];
171 if(
f==0) { RZ[1][
n-1] = RZ[2][
n-1] = rmean/
float(
ns);}
178 int Wheels = trtNum->
getNEndcapWheels();
if(!Wheels)
return StatusCode::SUCCESS;
181 for(
int wh = 0;
wh!=Wheels; ++
wh) {
184 writeCdo->m_flayers[0][
wh] = writeCdo->m_nlayers[0]; writeCdo->m_flayers[3][
wh] = writeCdo->m_nlayers[3];
185 writeCdo->m_nlayers[0] += NSlayers ; writeCdo->m_nlayers[3] += NSlayers ;
187 for(
int nsl = 0; nsl!=NSlayers; ++nsl) {
189 for(
int f=0;
f!=NPhi; ++
f) {
193 if(!base1 || !base2)
continue;
201 if(!enel1 || !
db1 || !
db2)
continue;
219 for(
int s=0;
s!=
ns; ++
s) {
226 if(!sc1 || !st1 || !tr1) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
227 ++writeCdo->m_nstraws[0];
234 if(!sc2 || !st2 || !tr2) {
ATH_MSG_ERROR(
"problem with TRT geometry");}
235 ++writeCdo->m_nstraws[3];
241 double zmax = RZ[3][writeCdo->m_nlayers[3]-1]+10.;
242 double rmax = RZ[2][writeCdo->m_nlayers[2]-1]+10.;
246 {-2.05,-1.95,-1.84,-1.72,-1.62,-1.53,-1.43,-1.33,-1.21,-1.00,-.94, -.85,-.32,
247 .32, .85, .94, 1.00, 1.21, 1.33, 1.43, 1.53, 1.62, 1.72,1.84, 1.95,2.05};
249 std::deque<Amg::Vector3D>
G [26];
253 for(
int r=0;
r!=26; ++
r) {
255 double pinv =-1./(
m_pTmin*std::sqrt(1.+writeCdo->m_dzdr[
r]*writeCdo->m_dzdr[
r]));
260 std::atan2(1.,
double(writeCdo->m_dzdr[
r])),
268 for(
int b=0;
b!=4; ++
b) {
269 for(
unsigned int i=0;
i!=writeCdo->m_nlayers[
b]; ++
i) {
270 writeCdo->m_begin[
b][
i] =
n;
271 for(
float r : writeCdo->m_dzdr) {
273 writeCdo->m_end[
b][
i] =
n++;
279 writeCdo->m_ndzdr =
new unsigned int[
n];
280 writeCdo->m_islope =
new int[
n];
281 writeCdo->m_slope =
new float [
n];
282 writeCdo->m_cirsize = writeCdo->m_nstraws[0]+writeCdo->m_nstraws[1];
285 for (
int b = 0;
b != 4; ++
b) {
287 for (
unsigned int i = 0;
i != writeCdo->m_nlayers[
b]; ++
i) {
289 for (
int r = 0;
r != 26; ++
r) {
290 if (writeCdo->m_dzdr[
r] >=
Tmin[
b][
i] &&
291 writeCdo->m_dzdr[
r] <=
Tmax[
b][
i]) {
292 writeCdo->m_ndzdr[
n] =
r;
294 if (
b == 0 ||
b == 3) {
297 for (++gp; gp != gpe; ++gp) {
298 if (
b == 3 && (*gp).z() >= RZ[
b][
i])
300 if (
b == 0 && (*gp).z() <= RZ[
b][
i])
307 for (++gp; gp != gpe; ++gp) {
308 if (std::sqrt((*gp).x() * (*gp).x() + (*gp).y() * (*gp).y()) >
323 double as = 1. / std::sqrt(
ax *
ax +
ay *
ay + az * az);
334 double as = 1. / std::sqrt(
ax *
ax +
ay *
ay + az * az);
341 if (
b == 0 ||
b == 3) {
342 S = (RZ[
b][
i] -
z) / az;
344 double A = (
ax *
x +
ay *
y) * 2.;
345 double D = (RZ[
b][
i] -
x -
y) * (RZ[
b][
i] +
x +
y) + 2. *
x *
y;
347 double B = 2. * (
ax *
ax +
ay *
ay);
348 double Sq =
A *
A + 2. * D * B;
349 Sq > 0. ? Sq = std::sqrt(Sq) : Sq = 0.;
350 double S1 = -(
A + Sq) / B;
351 double S2 = -(
A - Sq) / B;
357 writeCdo->m_slope[
n] = std::atan2(
y +
S *
ay,
x +
S *
ax) *
m_A;
358 writeCdo->m_islope[
n] =
int(writeCdo->m_slope[
n] *
m_Psi128);
365 if (writeHandle.record(rangeTrt, std::move(writeCdo)).isFailure()) {
367 <<
" with EventRange " << rangeTrt
368 <<
" into Conditions Store");
369 return StatusCode::FAILURE;
371 ATH_MSG_DEBUG(
"recorded new CDO " << writeHandle.key() <<
" with range "
372 << rangeTrt <<
" into Conditions Store");
374 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
JetConstituentVector::iterator iterator
struct TBPatternUnitContext S1
Trk::MagneticFieldProperties m_fieldprop
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)
StringProperty m_fieldmode
::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: