ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TrigL2MuonSA::SagittaRadiusEstimate Class Reference

#include <SagittaRadiusEstimate.h>

Inheritance diagram for TrigL2MuonSA::SagittaRadiusEstimate:
Collaboration diagram for TrigL2MuonSA::SagittaRadiusEstimate:

Public Member Functions

 SagittaRadiusEstimate (const std::string &type, const std::string &name, const IInterface *parent)
 
void setMCFlag (const BooleanProperty &use_mcLUT, const AlignmentBarrelLUTSvc *alignmentBarrelLUTSvc)
 
void setUseEndcapInner (BooleanProperty use_endcapInner)
 
StatusCode setSagittaRadius (const TrigRoiDescriptor *p_roids, TrigL2MuonSA::RpcFitResult &rpcFitResult, TrigL2MuonSA::TrackPattern &trackPattern) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

float f (float x, float c0, float c1, float c2, float c3) const
 
float fp (float x, float c33, float c22, float c1) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

BooleanProperty m_use_mcLUT {0}
 
BooleanProperty m_use_endcapInner {0}
 
const ToolHandle< AlignmentBarrelLUT > * m_alignmentBarrelLUT = nullptr
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 22 of file SagittaRadiusEstimate.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SagittaRadiusEstimate()

TrigL2MuonSA::SagittaRadiusEstimate::SagittaRadiusEstimate ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 17 of file SagittaRadiusEstimate.cxx.

19  :
21 {
22 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ f()

float TrigL2MuonSA::SagittaRadiusEstimate::f ( float  x,
float  c0,
float  c1,
float  c2,
float  c3 
) const
inlineprivate

Definition at line 54 of file SagittaRadiusEstimate.h.

55  {
56  return c0 + x * (c1 + x * (c2 + x * c3));
57  }

◆ fp()

float TrigL2MuonSA::SagittaRadiusEstimate::fp ( float  x,
float  c33,
float  c22,
float  c1 
) const
inlineprivate

Definition at line 59 of file SagittaRadiusEstimate.h.

60  {
61  return c1 + x * (c22 + x * c33);
62  }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setMCFlag()

void TrigL2MuonSA::SagittaRadiusEstimate::setMCFlag ( const BooleanProperty &  use_mcLUT,
const AlignmentBarrelLUTSvc alignmentBarrelLUTSvc 
)

Definition at line 27 of file SagittaRadiusEstimate.cxx.

29 {
30  m_use_mcLUT = use_mcLUT;
31  if ( alignmentBarrelLUTSvc ) m_alignmentBarrelLUT = alignmentBarrelLUTSvc->alignmentBarrelLUT();
32 }

◆ setSagittaRadius()

StatusCode TrigL2MuonSA::SagittaRadiusEstimate::setSagittaRadius ( const TrigRoiDescriptor p_roids,
TrigL2MuonSA::RpcFitResult rpcFitResult,
TrigL2MuonSA::TrackPattern trackPattern 
) const

Definition at line 37 of file SagittaRadiusEstimate.cxx.

40 {
41  const int MAX_STATION = 4;
42  const float ZERO_LIMIT = 1e-5;
43 
44  int nit;
45  const int nitmx=10;
46  int count=0;
47  double a3,theta,rad,phi,one,phim=0,signZ;
48 
49  double c0,c1,c2,c3,c22,c33,e2,e3,c2q,c3q,d,da,db,a,b,dx,dy;
50  double m = 0.;
51  double cost = 0.;
52  double x0 = 0., y0 = 0., x1 = 0., y1 = 0., x2 = 0., y2 = 0., x3 = 0., y3 = 0.;
53  double tm = 0.;
54  double xn = 0.;
55  const double eps = 0.005;
56 
57  TrigL2MuonSA::SuperPoint* superPoints[4];
58 
59  for (int i_station=0; i_station<MAX_STATION; i_station++) {
60 
61  int chamberID = -1;
62  if ( i_station == 0 ) chamberID = xAOD::L2MuonParameters::Chamber::BarrelInner;
63  if ( i_station == 1 ) chamberID = xAOD::L2MuonParameters::Chamber::BarrelMiddle;
64  if ( i_station == 2 ) chamberID = xAOD::L2MuonParameters::Chamber::BarrelOuter;
65  if ( i_station == 3 ) chamberID = xAOD::L2MuonParameters::Chamber::EndcapInner;
66  superPoints[i_station] = &(trackPattern.superPoints[chamberID]);
67 
68  if (superPoints[i_station]->R > ZERO_LIMIT) {
69  count++;
70  if ( i_station != 3 ){
71  phim = superPoints[i_station]->Phim;
72  }
73  }
74  }
75 
76  if ( superPoints[3] -> R >ZERO_LIMIT ) count--; // Not use Endcap Inner
77  if ( count==2 ) {
78  y0 = 4230.; // radius of calorimeter.
79 
80  if (superPoints[0]->R < ZERO_LIMIT) {
81  x2 = superPoints[1]->Z;
82  y2 = superPoints[1]->R;
83  x3 = superPoints[2]->Z;
84  y3 = superPoints[2]->R;
85  } else if (superPoints[1]->R < ZERO_LIMIT) {
86  x2 = superPoints[0]->Z;
87  y2 = superPoints[0]->R;
88  x3 = superPoints[2]->Z;
89  y3 = superPoints[2]->R;
90  } else if (superPoints[2]->R < ZERO_LIMIT) {
91  x2 = superPoints[0]->Z;
92  y2 = superPoints[0]->R;
93  x3 = superPoints[1]->Z;
94  y3 = superPoints[1]->R;
95  }
96 
97  dx = x3 - x2;
98  dy = y3 - y2;
99 
100  x0 = y0*x2/y2;
101 
102  c3 = dy;
103  c2 = -y0*dx + 2.*(y2*x3-y3*x2);
104  c1 = -dy*(y2*y3-y0*y0)+ y3*x2*x2 - y2*x3*x3;
105  c0 = y0*x2*x3*dx + y0*x2*(y3-y0)*(y3-y0) - y0*x3*(y2-y0)*(y2-y0);
106  c22 = 2.*c2;
107  c33 = 3.*c3;
108 
109  nit = 1;
110  while((nit++)<=nitmx&&std::abs(x0-xn)>=eps) {
111  xn = x0 - f(x0,c0,c1,c2,c3)/fp(x0,c33,c22,c1);
112  x0 = xn;
113  }
114  if (std::abs(xn)<ZERO_LIMIT) xn = ZERO_LIMIT;//To avoid divergence
115 
116  x1 = xn;
117  y1 = y0;
118 
119  if (superPoints[0]->R > ZERO_LIMIT ) {
120  rad = superPoints[0]->R;
121  theta = std::atan2(rad,(double)std::abs(superPoints[0]->Z));
122  signZ = (std::abs(superPoints[0]->Z) > ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
123  } else {
124  rad = y1;
125  theta = std::atan2(rad,(double)std::abs(x1));
126  signZ = (std::abs(x1) > ZERO_LIMIT)? x1/std::abs(x1): 1.;
127  }
128 
129  trackPattern.etaMap = (-std::log(std::tan(theta/2.)))*signZ;
130  if (rpcFitResult.isSuccess ) {
131  // one = (std::abs(rpcFitResult.rpc1[0]) > 0.)? 1. * rpcFitResult.rpc1[0] / std::abs(rpcFitResult.rpc1[0]): 1.;
132  one = (std::cos(rpcFitResult.phi)>0)? 1: -1;
133  } else {
134  one = (std::cos(p_roids->phi())>0)? 1: -1;
135  }
136  phi = std::atan2(trackPattern.phiMSDir*one,one);
137 
138  if(phim>=M_PI+0.1) phim = phim - 2*M_PI;
139 
140  if(phim>=0) trackPattern.phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
141  else trackPattern.phiMap = phi - phim;
142 
143  trackPattern.phiMS = phi;
144 
145  c2 = x2 - x1;
146  c3 = x3 - x1;
147  e2 = y2 - y1;
148  e3 = y3 - y1;
149  c2q = c2*c2 + e2*e2;
150  c3q = c3*c3 + e3*e3;
151  d = c2*e3 - c3*e2;
152  da = -c2q*e3 + c3q*e2;
153  db = -c2*c3q + c3*c2q;
154  a = da/d;
155  b = db/d;
156 
157  x0 = -a/2. + x1;
158  y0 = -b/2. + y1;
159  trackPattern.barrelRadius = std::sqrt(x0*x0 + y0*y0);
160  trackPattern.charge = -1;
161  if(a<=0.) trackPattern.charge = 1;
162 
163  } else if (count==3) {
164 
165  rad = superPoints[0]->R;
166  theta = std::atan2(rad,(double)std::abs(superPoints[0]->Z));
167  signZ = (std::abs(superPoints[0]->Z) > ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
168 
169  trackPattern.etaMap = (-std::log(std::tan(theta/2.)))*signZ;
170 
171  if (rpcFitResult.isSuccess ) {
172  // one = (std::abs(rpcFitResult.rpc1[0]) > 0.)? 1. * rpcFitResult.rpc1[0] / std::abs(rpcFitResult.rpc1[0]): 1;
173  one = (std::cos(rpcFitResult.phi)>0)? 1: -1;
174  } else {
175  one = (std::cos(p_roids->phi())>0)? 1: -1;
176  }
177  phi = std::atan2(trackPattern.phiMSDir*one,one);
178  if(phim>=M_PI+0.1) phim = phim - 2*M_PI;
179 
180  if(phim>=0) trackPattern.phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
181  else trackPattern.phiMap = phi - phim;
182 
183  trackPattern.phiMS = phi;
184 
185  // Alignment correation to LargeSpecial
186  if ( trackPattern.s_address==1) {
187 
188  if ( !m_alignmentBarrelLUT ) {
189  ATH_MSG_ERROR("Alignment correction service is not prepared");
190  return StatusCode::FAILURE;
191  }
192 
193  double dZ = (*m_alignmentBarrelLUT)->GetDeltaZ(trackPattern.s_address,
194  trackPattern.etaMap,
195  trackPattern.phiMap,
196  trackPattern.phiMS,
197  superPoints[0]->R);
198  superPoints[1]->Z += 10*dZ;
199  }
200 
201  a3 = ( superPoints[2]->Z - superPoints[0]->Z ) / ( superPoints[2]->R - superPoints[0]->R );
202 
203  trackPattern.barrelSagitta = superPoints[1]->Z - superPoints[1]->R*a3 - superPoints[0]->Z + superPoints[0]->R*a3;
204 
205  m = a3;
206  cost = std::cos(std::atan(m));
207  x2 = superPoints[1]->R - superPoints[0]->R;
208  y2 = superPoints[1]->Z - superPoints[0]->Z;
209  x3 = superPoints[2]->R - superPoints[0]->R;
210  y3 = superPoints[2]->Z - superPoints[0]->Z;
211 
212  tm = x2;
213  x2 = ( x2 + y2*m)*cost;
214  y2 = (-tm*m + y2 )*cost;
215 
216  tm = x3;
217  x3 = ( x3 + y3*m)*cost;
218  y3 = (-tm*m + y3 )*cost;
219 
220  x0 = x3/2.;
221  y0 = (y2*y2 + x2*x2 -x2*x3)/(2*y2);
222 
223  trackPattern.barrelRadius = std::sqrt(x0*x0 + y0*y0);
224  trackPattern.charge = (trackPattern.barrelSagitta!=0)? -1.*trackPattern.barrelSagitta/std::abs(trackPattern.barrelSagitta): 0;
225 
226  }
227 
228  if ( m_use_endcapInner == true && count == 1 && superPoints[3]->R > ZERO_LIMIT ) {
229  y0 = 4230.; // radius of calorimeter.
230 
231  if (superPoints[0]->R > ZERO_LIMIT) {
232  x2 = superPoints[0]->Z; //BI
233  y2 = superPoints[0]->R;
234  x3 = superPoints[3]->Z; //EI
235  y3 = superPoints[3]->R;
236  } else if (superPoints[1]->R > ZERO_LIMIT) {
237  x2 = superPoints[3]->Z; //EI
238  y2 = superPoints[3]->R;
239  x3 = superPoints[1]->Z; //BM
240  y3 = superPoints[1]->R;
241  } else if (superPoints[2]->R > ZERO_LIMIT) {
242  x2 = superPoints[3]->Z; //EI
243  y2 = superPoints[3]->R;
244  x3 = superPoints[2]->Z; //BO
245  y3 = superPoints[2]->R;
246  }
247 
248  dx = x3 - x2;
249  dy = y3 - y2;
250 
251  x0 = y0*x2/y2;
252 
253  c3 = dy;
254  c2 = -y0*dx + 2.*(y2*x3-y3*x2);
255  c1 = -dy*(y2*y3-y0*y0)+ y3*x2*x2 - y2*x3*x3;
256  c0 = y0*x2*x3*dx + y0*x2*(y3-y0)*(y3-y0) - y0*x3*(y2-y0)*(y2-y0);
257  c22 = 2.*c2;
258  c33 = 3.*c3;
259 
260  nit = 1;
261  while((nit++)<=nitmx&&std::abs(x0-xn)>=eps) {
262  xn = x0 - f(x0,c0,c1,c2,c3)/fp(x0,c33,c22,c1);
263  x0 = xn;
264  }
265  if (std::abs(xn)<ZERO_LIMIT) xn = ZERO_LIMIT;//To avoid divergence
266 
267  x1 = xn;
268  y1 = y0;
269 
270  if (superPoints[0]->R > ZERO_LIMIT ) {
271  rad = superPoints[0]->R;
272  theta = std::atan2(rad,(double)std::abs(superPoints[0]->Z));
273  signZ = (std::abs(superPoints[0]->Z) > ZERO_LIMIT)? superPoints[0]->Z/std::abs(superPoints[0]->Z): 1.;
274  } else {
275  rad = y1;
276  theta = std::atan2(rad,(double)std::abs(x1));
277  signZ = (std::abs(x1) > ZERO_LIMIT)? x1/std::abs(x1): 1.;
278  }
279 
280  trackPattern.etaMap = (-std::log(std::tan(theta/2.)))*signZ;
281  if (rpcFitResult.isSuccess ) {
282  // one = (std::abs(rpcFitResult.rpc1[0]) > 0.)? 1. * rpcFitResult.rpc1[0] / std::abs(rpcFitResult.rpc1[0]): 1.;
283  one = (std::cos(rpcFitResult.phi)>0)? 1: -1;
284  } else {
285  one = (std::cos(p_roids->phi())>0)? 1: -1;
286  }
287  phi = std::atan2(trackPattern.phiMSDir*one,one);
288 
289  if(phim>=M_PI+0.1) phim = phim - 2*M_PI;
290 
291  if(phim>=0) trackPattern.phiMap = (phi>=0.)? phi - phim : phim -std::abs(phi);
292  else trackPattern.phiMap = phi - phim;
293 
294  trackPattern.phiMS = phi;
295 
296  c2 = x2 - x1;
297  c3 = x3 - x1;
298  e2 = y2 - y1;
299  e3 = y3 - y1;
300  c2q = c2*c2 + e2*e2;
301  c3q = c3*c3 + e3*e3;
302  d = c2*e3 - c3*e2;
303  da = -c2q*e3 + c3q*e2;
304  db = -c2*c3q + c3*c2q;
305  a = da/d;
306  b = db/d;
307 
308  x0 = -a/2. + x1;
309  y0 = -b/2. + y1;
310  double barrelRadius = std::sqrt(x0*x0 + y0*y0);
311  trackPattern.barrelRadius = barrelRadius;
312  trackPattern.charge = -1;
313  if(a<=0.) trackPattern.charge = 1;
314  }
315 
316  ATH_MSG_DEBUG("... count/trackPattern.barrelSagitta/barrelRadius/charge/s_address/phi="
317  << count << " / " << trackPattern.barrelSagitta << "/" << trackPattern.barrelRadius << "/"
318  << trackPattern.charge << "/" << trackPattern.s_address << "/"
319  << trackPattern.phiMS);
320 
321  return StatusCode::SUCCESS;
322 }

◆ setUseEndcapInner()

void TrigL2MuonSA::SagittaRadiusEstimate::setUseEndcapInner ( BooleanProperty  use_endcapInner)
inline

Definition at line 33 of file SagittaRadiusEstimate.h.

33 { m_use_endcapInner = use_endcapInner; };

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_alignmentBarrelLUT

const ToolHandle<AlignmentBarrelLUT>* TrigL2MuonSA::SagittaRadiusEstimate::m_alignmentBarrelLUT = nullptr
private

Definition at line 47 of file SagittaRadiusEstimate.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_use_endcapInner

BooleanProperty TrigL2MuonSA::SagittaRadiusEstimate::m_use_endcapInner {0}
private

Definition at line 45 of file SagittaRadiusEstimate.h.

◆ m_use_mcLUT

BooleanProperty TrigL2MuonSA::SagittaRadiusEstimate::m_use_mcLUT {0}
private

Definition at line 43 of file SagittaRadiusEstimate.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
TrigL2MuonSA::TrackPattern::phiMap
double phiMap
Definition: TrackData.h:78
cost
int cost(std::vector< std::string > &files, node &n, const std::string &directory="", bool deleteref=false, bool relocate=false)
Definition: hcg.cxx:921
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TrigL2MuonSA::SagittaRadiusEstimate::m_alignmentBarrelLUT
const ToolHandle< AlignmentBarrelLUT > * m_alignmentBarrelLUT
Definition: SagittaRadiusEstimate.h:47
TrigL2MuonSA::TrackPattern::superPoints
TrigL2MuonSA::SuperPoint superPoints[s_NCHAMBER]
Definition: TrackData.h:60
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
TrigL2MuonSA::RpcFitResult::phi
double phi
Definition: RpcFitResult.h:44
TrigL2MuonSA::TrackPattern::barrelRadius
double barrelRadius
Definition: TrackData.h:84
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:137
CaloCondBlobAlgs_fillNoiseFromASCII.db
db
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:43
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:71
extractSporadic.c1
c1
Definition: extractSporadic.py:134
TrigL2MuonSA::TrackPattern::s_address
int s_address
Definition: TrackData.h:72
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
xAOD::L2MuonParameters::BarrelInner
@ BarrelInner
Inner station in the barrel spectrometer.
Definition: TrigMuonDefs.h:16
Trk::one
@ one
Definition: TrkDetDescr/TrkSurfaces/TrkSurfaces/RealQuadraticEquation.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
xAOD::barrelRadius
setSAddress setEtaMS setDirPhiMS setDirZMS barrelRadius
Definition: L2StandAloneMuon_v1.cxx:128
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
x
#define x
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
TrigL2MuonSA::SuperPoint::R
float R
Definition: SuperPointData.h:102
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
compileRPVLLRates_emergingFilterTest.c3
c3
Definition: compileRPVLLRates_emergingFilterTest.py:559
hotSpotInTAG.c0
c0
Definition: hotSpotInTAG.py:192
TrigL2MuonSA::SuperPoint::Phim
float Phim
Definition: SuperPointData.h:104
TrigL2MuonSA::TrackPattern::phiMS
double phiMS
Definition: TrackData.h:74
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigL2MuonSA::TrackPattern::barrelSagitta
double barrelSagitta
Definition: TrackData.h:85
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
test_pyathena.parent
parent
Definition: test_pyathena.py:15
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TrigL2MuonSA::SagittaRadiusEstimate::f
float f(float x, float c0, float c1, float c2, float c3) const
Definition: SagittaRadiusEstimate.h:54
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
ZERO_LIMIT
const float ZERO_LIMIT
Definition: VP1TriggerHandleL2.cxx:37
TrigL2MuonSA::TrackPattern::charge
double charge
Definition: TrackData.h:63
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
compileRPVLLRates.c2
c2
Definition: compileRPVLLRates.py:361
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
TrigL2MuonSA::RpcFitResult::isSuccess
bool isSuccess
Definition: RpcFitResult.h:38
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
TrigL2MuonSA::TrackPattern::phiMSDir
double phiMSDir
Definition: TrackData.h:75
xAOD::L2MuonParameters::EndcapInner
@ EndcapInner
Inner station in the endcap spectrometer.
Definition: TrigMuonDefs.h:19
TrigL2MuonSA::TrackPattern::etaMap
double etaMap
Definition: TrackData.h:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::L2MuonParameters::BarrelOuter
@ BarrelOuter
Outer station in the barrel spectrometer.
Definition: TrigMuonDefs.h:18
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TrigL2MuonSA::SuperPoint::Z
float Z
Definition: SuperPointData.h:103
TrigL2MuonSA::SagittaRadiusEstimate::m_use_endcapInner
BooleanProperty m_use_endcapInner
Definition: SagittaRadiusEstimate.h:45
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TrigL2MuonSA::SuperPoint
Definition: SuperPointData.h:74
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TrigL2MuonSA::SagittaRadiusEstimate::fp
float fp(float x, float c33, float c22, float c1) const
Definition: SagittaRadiusEstimate.h:59
TrigL2MuonSA::SagittaRadiusEstimate::m_use_mcLUT
BooleanProperty m_use_mcLUT
Definition: SagittaRadiusEstimate.h:43
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::L2MuonParameters::BarrelMiddle
@ BarrelMiddle
Middle station in the barrel spectrometer.
Definition: TrigMuonDefs.h:17
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
fitman.k
k
Definition: fitman.py:528