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

#include <AlphaBetaEstimate.h>

Inheritance diagram for TrigL2MuonSA::AlphaBetaEstimate:
Collaboration diagram for TrigL2MuonSA::AlphaBetaEstimate:

Public Member Functions

 AlphaBetaEstimate (const std::string &type, const std::string &name, const IInterface *parent)
 
void setMCFlag (const BooleanProperty &use_mcLUT, const TrigL2MuonSA::PtEndcapLUTSvc *ptEndcapLUTSvc)
 
StatusCode setAlphaBeta (const TrigRoiDescriptor *p_roids, TrigL2MuonSA::TgcFitResult &tgcFitResult, TrigL2MuonSA::TrackPattern &trackPattern, const TrigL2MuonSA::MuonRoad &muonRoad) 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

double computeRadius (double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, double sign) const
 
double computeRadius3Points (double InnerZ, double InnerR, double EEZ, double EER, double MiddleZ, double MiddleR) const
 
double calcDistance (double x1, double y1, double x2, double y2, double x3, double y3) const
 
bool isZero (float value, float tolerance=1e-5) 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
 
const ToolHandle< PtEndcapLUT > * m_ptEndcapLUT {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 AlphaBetaEstimate.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

◆ AlphaBetaEstimate()

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

Definition at line 17 of file AlphaBetaEstimate.cxx.

19  :
21 {
22 }

Member Function Documentation

◆ calcDistance()

double TrigL2MuonSA::AlphaBetaEstimate::calcDistance ( double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
) const
private

Definition at line 346 of file AlphaBetaEstimate.cxx.

346  {
347  double xm1=(x1+x2)/2;
348  double xm2=(x2+x3)/2;
349  double ym1=(y1+y2)/2;
350  double ym2=(y2+y3)/2;
351  double a1=(x1-x2)/(y2-y1);
352  double a2=(x2-x3)/(y3-y2);
353  double x0=(a2*xm2-a1*xm1-ym2+ym1)/(a2-a1);//center of circle
354  double y0=a1*(x0-xm1)+ym1;//center of circle
355  double a = (x0-x1)/(y1-y0);//slope of sessen
356  double b = y1+x1*(x1-x0)/(y1-y0);//intercept of sessen
357  double d=std::abs(b)/std::sqrt(a*a+1);
358  return d;
359 }

◆ computeRadius()

double TrigL2MuonSA::AlphaBetaEstimate::computeRadius ( double  InnerSlope,
double  InnerR,
double  InnerZ,
double  MiddleSlope,
double  MiddleR,
double  MiddleZ,
double  sign 
) const
private

Definition at line 271 of file AlphaBetaEstimate.cxx.

274 {
275  double cr1 = 0.080/400;
276  double cr2 = cr1;
277  double x1 = InnerZ;
278  if (std::abs(x1)>=0.1) {
279  double x2 = MiddleZ;
280  double y1 = InnerR;
281  double y2 = MiddleR;
282  double A1 = InnerSlope;
283  double A2 = MiddleSlope;
284  if (!(std::abs(MiddleSlope+999)<0.1)) {
285  A2 = MiddleSlope;
286  cr2 = cr1/10;
287  }
288 
289  // find centre of circonference
290  double xm = (x1+x2)/2.;
291  double ym = (y1+y2)/2.;
292  double c1 = (x2-x1)*xm+(y2-y1)*ym;
293  double c2_1 = -x1-A1*y1;
294  double c2_2 = -x2-A2*y2;
295  double yR1 = (-c1-c2_1*(x2-x1))/(A1*(x2-x1)-(y2-y1));
296  double yR2 = (-c1-c2_2*(x2-x1))/(A2*(x2-x1)-(y2-y1));
297  double xR1 = -A1*yR1-c2_1;
298  double xR2 = -A2*yR2-c2_2;
299 
300  double xR = ((1./cr1)*xR1+(1./cr2)*xR2)/((1./cr1)+(1./cr2));
301  double yR = ((1./cr1)*yR1+(1./cr2)*yR2)/((1./cr1)+(1./cr2));
302  double radius = 0.5*(std::sqrt((xR-x1)*(xR-x1)+(yR-y1)*(yR-y1))+std::sqrt((xR-x2)*(xR-x2)+(yR-y2)*(yR-y2)));
303  return sign * radius;
304  }
305 
306  return 0.;
307 }

◆ computeRadius3Points()

double TrigL2MuonSA::AlphaBetaEstimate::computeRadius3Points ( double  InnerZ,
double  InnerR,
double  EEZ,
double  EER,
double  MiddleZ,
double  MiddleR 
) const
private

Definition at line 309 of file AlphaBetaEstimate.cxx.

312  {
313  double radius_EE;
314 
315  double a3;
316 
317  double m = 0.;
318  double cost = 0.;
319  double x0 = 0., y0 = 0., x2 = 0., y2 = 0., x3 = 0., y3 = 0.;
320  double tm = 0.;
321 
322  a3 = ( MiddleZ - InnerZ ) / ( MiddleR - InnerR );
323 
324  m = a3;
325  cost = std::cos(std::atan(m));
326  x2 = EER - InnerR;
327  y2 = EEZ - InnerZ;
328  x3 = MiddleR - InnerR;
329  y3 = MiddleZ - InnerZ;
330 
331  tm = x2;
332  x2 = ( x2 + y2*m)*cost;
333  y2 = (-tm*m + y2 )*cost;
334 
335  tm = x3;
336  x3 = ( x3 + y3*m)*cost;
337  y3 = (-tm*m + y3 )*cost;
338 
339  x0 = x3/2.;
340  y0 = (y2*y2 + x2*x2 -x2*x3)/(2*y2);
341 
342  radius_EE = std::sqrt(x0*x0 + y0*y0);
343  return radius_EE;
344 }

◆ 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

◆ 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.

◆ isZero()

bool TrigL2MuonSA::AlphaBetaEstimate::isZero ( float  value,
float  tolerance = 1e-5 
) const
inlineprivate

Definition at line 49 of file AlphaBetaEstimate.h.

49  {
50  return std::abs( value ) < tolerance;
51  }

◆ 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  }

◆ setAlphaBeta()

StatusCode TrigL2MuonSA::AlphaBetaEstimate::setAlphaBeta ( const TrigRoiDescriptor p_roids,
TrigL2MuonSA::TgcFitResult tgcFitResult,
TrigL2MuonSA::TrackPattern trackPattern,
const TrigL2MuonSA::MuonRoad muonRoad 
) const

Definition at line 37 of file AlphaBetaEstimate.cxx.

41 {
42  const int MAX_STATION = 6;
43  const double PHI_RANGE = 12./(M_PI/8.);
44 
45  // computing ALPHA, BETA and RADIUS
46  float InnerSlope = 0;
47  float MiddleSlope = 0;
48  float MiddleIntercept = 0;
49  float InnerR = 0;
50  float InnerZ = 0;
51  float EER = 0;//ee
52  float EEZ = 0;//ee
53  float MiddleR = 0;
54  float MiddleZ = 0;
55  float OuterR = 0;
56  float OuterZ = 0;
57  float EBIR = 0;//endcap barrel inner
58  float EBIZ = 0;//endcap barrel inner
59  // float CSCSlope = 0;//csc currrently not used for gamma-pt
60  float CSCR = 0;//csc
61  float CSCZ = 0;//csc
62 
63  // set etaMap and phi
64  double phi = 0.;
65  double phim = 0.;
66 
67  TrigL2MuonSA::SuperPoint* superPoint;
68 
69  for (int i_station=0; i_station<MAX_STATION; i_station++) {
70 
71  int chamber = 0;
77  if ( i_station == 5 ) chamber = xAOD::L2MuonParameters::Chamber::CSC;
78  superPoint = &(trackPattern.superPoints[chamber]);
79 
80  if ( superPoint->Npoint > 2 && superPoint->R > 0.) {
81  if (chamber==3) {
82  InnerSlope = superPoint->Alin;
83  InnerR = superPoint->R;
84  InnerZ = superPoint->Z;
85  } if ( chamber==4 ) {
86  MiddleSlope = superPoint->Alin;
87  MiddleIntercept = superPoint->R - MiddleSlope*superPoint->Z;
88  MiddleR = superPoint->R;
89  MiddleZ = superPoint->Z;
90  } if ( chamber==5 ) {
91  OuterR = superPoint->R;
92  OuterZ = superPoint->Z;
93  } if ( chamber==6 ) {
94  EER = superPoint->R;
95  EEZ = superPoint->Z;
96  } if ( chamber==0 ) {//barrel inner
97  EBIR = superPoint->R;
98  EBIZ = superPoint->Z;
99  } if ( chamber==7 ) {//csc
100  //CSCSlope = superPoint->Alin; //currently not used
101  CSCR = superPoint->R;
102  CSCZ = superPoint->Z;
103  }
104  phim = superPoint->Phim;
105  }
106  } // end loop for stations
107 
108  if (tgcFitResult.isSuccess) {
109  // TGC data properly read
110 
111  double phi1 = tgcFitResult.tgcMid1[1];
112  double phi2 = tgcFitResult.tgcMid2[1];
113  if ( isZero(tgcFitResult.tgcMid1[3]) || isZero(tgcFitResult.tgcMid2[3]) ) {
114  if ( !isZero(tgcFitResult.tgcMid1[3]) ) phi = phi1;
115  if ( !isZero(tgcFitResult.tgcMid2[3]) ) phi = phi2;
116  } else if( phi1*phi2 < 0 && std::abs(phi1)>(M_PI/2.) ) {
117  double tmp1 = (phi1>0)? phi1 - M_PI : phi1 + M_PI;
118  double tmp2 = (phi2>0)? phi2 - M_PI : phi2 + M_PI;
119  double tmp = (tmp1+tmp2)/2.;
120  phi = (tmp>0.)? tmp - M_PI : tmp + M_PI;
121  } else {
122  phi = (phi2+phi1)/2.;
123  }
124 
125  if ( isZero(MiddleZ) ) {
126  if ( !isZero(tgcFitResult.tgcMid1[0]) && !isZero(tgcFitResult.tgcMid2[0]) ) {
127  trackPattern.etaMap = (tgcFitResult.tgcMid1[0]+tgcFitResult.tgcMid2[0])/2;
128  } else {
129  trackPattern.etaMap = (tgcFitResult.tgcMid1[0]!=0)?
130  tgcFitResult.tgcMid1[0] : tgcFitResult.tgcMid2[0];
131  }
132  }
133 
134  double etaInner = 0.;
135  double etaMiddle = 0.;
136  if ( !isZero(MiddleZ) ) {
137  double theta = std::atan(MiddleR/std::abs(MiddleZ));
138  etaMiddle = -std::log(std::tan(theta/2.))*MiddleZ/std::abs(MiddleZ);
139  }
140 
141  if ( !isZero(InnerZ) ) {
142  double theta = std::atan(InnerR/std::abs(InnerZ));
143  etaInner = -std::log(std::tan(theta/2.))*InnerZ/std::abs(InnerZ);
144  }
145 
146  if ( !isZero(MiddleZ) ) trackPattern.etaMap = etaMiddle;
147  else if ( !isZero(InnerZ) ) trackPattern.etaMap = etaInner;
148  if ( !isZero(tgcFitResult.tgcInn[3]) ) phi = tgcFitResult.tgcInn[1];
149 
150  if ( phim > M_PI+0.1 ) phim = phim - 2*M_PI;
151  if ( phim >= 0 ) trackPattern.phiMap = (phi>=0.)? phi - phim : phim - std::abs(phi);
152  else trackPattern.phiMap = phi - phim;
153 
154  int Octant = (int)(tgcFitResult.tgcMid1[1] / (M_PI/4.));
155  double PhiInOctant = std::abs(tgcFitResult.tgcMid1[1] - Octant * (M_PI/4.));
156  if (PhiInOctant > (M_PI/8.)) PhiInOctant = (M_PI/4.) - PhiInOctant;
157 
158  trackPattern.endcapBeta = 0.0;
159  trackPattern.phiMS = phi;
160  trackPattern.pt = std::abs(tgcFitResult.tgcPT);
161  trackPattern.charge = (tgcFitResult.tgcPT!=0.0)? tgcFitResult.tgcPT/std::abs(tgcFitResult.tgcPT) : +1;
162 
163  trackPattern.phiBin = static_cast<int>(PhiInOctant * PHI_RANGE);
164  trackPattern.etaBin = static_cast<int>((std::abs(tgcFitResult.tgcMid1[0])-1.)/0.05);
165 
166  double phiEE = (tgcFitResult.tgcMid1[1]>0) ? tgcFitResult.tgcMid1[1] : tgcFitResult.tgcMid1[1] + 2*M_PI;
167  trackPattern.phiBinEE = static_cast<int> (phiEE*96/M_PI);
168 
169  } else {
170  // TGC data readout problem -> use RoI (eta, phi) and assume straight track
171 
172  trackPattern.etaMap = p_roids->eta();
173  phi = p_roids->phi();
174 
175  if ( phim > M_PI+0.1 ) phim = phim - 2*M_PI;
176  if ( phim >= 0 ) trackPattern.phiMap = (phi>=0.)? phi - phim : phim - std::abs(phi);
177  else trackPattern.phiMap = phi - phim;
178 
179  int Octant = (int)(p_roids->phi() / (M_PI/4.));
180  double PhiInOctant = std::abs(p_roids->phi() - Octant * (M_PI/4.));
181  if (PhiInOctant > (M_PI/8.)) PhiInOctant = (M_PI/4.) - PhiInOctant;
182 
183  trackPattern.endcapBeta = 0.0;
184  trackPattern.phiMS = phi;
185  trackPattern.pt = 0;
186  trackPattern.charge = 0;
187 
188  trackPattern.phiBin = static_cast<int>(PhiInOctant * PHI_RANGE);
189  trackPattern.etaBin = static_cast<int>((std::abs(p_roids->eta())-1.)/0.05);
190 
191  double phiEE = (p_roids->phi()>0) ? p_roids->phi() : p_roids->phi() + 2*M_PI;
192  trackPattern.phiBinEE = static_cast<int> (phiEE*96/M_PI);
193 
194  }
195 
196  if (!isZero(MiddleZ) && !isZero(OuterZ)) {
197  double slope = (OuterR-MiddleR)/(OuterZ-MiddleZ);
198  double inter = MiddleR - slope*MiddleZ;
199 
200  trackPattern.endcapAlpha = (*m_ptEndcapLUT)->alpha(MiddleZ,MiddleR,OuterZ,OuterR);
201  trackPattern.slope = slope;
202  trackPattern.intercept = inter;
203  if (!isZero(InnerR)) {
204  trackPattern.endcapBeta = std::abs( std::atan(InnerSlope) - std::atan(slope) );
205  trackPattern.deltaR = slope * InnerZ + MiddleIntercept - InnerR;
206  double sign = trackPattern.deltaR / std::abs(trackPattern.deltaR);
207  trackPattern.endcapRadius = computeRadius(InnerSlope, InnerR, InnerZ,
208  slope, MiddleR, MiddleZ,
209  sign);
210  }
211  if (!isZero(CSCZ)) {
212  if(trackPattern.large_dPhidZ && (6==trackPattern.phiBin || 7==trackPattern.phiBin) ){
213  trackPattern.cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(MiddleSlope) );
214  }else{
215  double OuterR_modified=OuterR*trackPattern.outerCorFactor;//assume dphidz=0
216  double slope_modified=(OuterR_modified-MiddleR)/(OuterZ-MiddleZ);
217  trackPattern.cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(slope_modified) );
218  ATH_MSG_DEBUG("OuterR_modified=" << OuterR_modified << " slope_modified=" << slope_modified);
219  }
220  }
221  } else {
222  if( trackPattern.pt >= 8. || !tgcFitResult.isSuccess) {
223  if(!isZero(MiddleZ)) {
224  double Ze = MiddleZ+(std::abs(MiddleZ)/MiddleZ)*1000.;
225  double Re = MiddleSlope*(Ze) + MiddleIntercept;
226 
227  trackPattern.endcapAlpha = (*m_ptEndcapLUT)->alpha(MiddleZ,MiddleR,Ze,Re);
228  trackPattern.slope = MiddleSlope;
229  trackPattern.intercept = MiddleIntercept;
230  }
231  }
232 
233  if (!isZero(MiddleZ) && !isZero(InnerZ)) {
234  trackPattern.endcapBeta = std::abs( std::atan(InnerSlope) - std::atan(MiddleSlope) );
235  trackPattern.deltaR = MiddleSlope*InnerZ + MiddleIntercept - InnerR;
236  double sign = trackPattern.deltaR / std::abs(trackPattern.deltaR);
237  trackPattern.endcapRadius = computeRadius(InnerSlope, InnerR, InnerZ,
238  MiddleSlope, MiddleR, MiddleZ,
239  sign);
240  }
241  if(!isZero(MiddleZ) && !isZero(CSCZ)){
242  trackPattern.cscGamma = std::abs( std::atan( (MiddleR-CSCR)/(MiddleZ-CSCZ) ) - std::atan(MiddleSlope) );
243  }
244  }
245 
246  double distance=9999;//distance between track and IP
247  if (std::abs(EEZ)>10000 && std::abs(EEZ)<10600){//Small
248  if ( (!isZero(EBIZ) && !isZero(EEZ)) && !isZero(MiddleZ) ){
249  trackPattern.endcapRadius3P = computeRadius3Points(EBIZ, EBIR, EEZ, EER, MiddleZ, MiddleR);
250  distance = calcDistance(EBIZ, EBIR, EEZ, EER, MiddleZ, MiddleR);
251  }
252  }
253  if (std::abs(EEZ)>10600 && std::abs(EEZ)<12000){//Large
254  if ( (!isZero(InnerZ) && !isZero(EEZ)) && !isZero(MiddleZ) ){
255  trackPattern.endcapRadius3P = computeRadius3Points(InnerZ, InnerR, EEZ, EER, MiddleZ, MiddleR);
256  distance = calcDistance(InnerZ, InnerR, EEZ, EER, MiddleZ, MiddleR);
257  }
258  }
259  if (distance>500) trackPattern.endcapRadius3P=0;//Reconstruction may fail
260 
261  ATH_MSG_DEBUG("... alpha/beta/endcapRadius/cscGamma/charge/s_address="
262  << trackPattern.endcapAlpha << "/" << trackPattern.endcapBeta << "/" << trackPattern.endcapRadius3P << "/"
263  << trackPattern.cscGamma << "/" << trackPattern.charge << "/" << trackPattern.s_address );
264  //
265  return StatusCode::SUCCESS;
266 }

◆ setMCFlag()

void TrigL2MuonSA::AlphaBetaEstimate::setMCFlag ( const BooleanProperty &  use_mcLUT,
const TrigL2MuonSA::PtEndcapLUTSvc ptEndcapLUTSvc 
)

Definition at line 27 of file AlphaBetaEstimate.cxx.

29 {
30  m_use_mcLUT = use_mcLUT;
31  m_ptEndcapLUT = ptEndcapLUTSvc->ptEndcapLUT();
32 }

◆ 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_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_ptEndcapLUT

const ToolHandle<PtEndcapLUT>* TrigL2MuonSA::AlphaBetaEstimate::m_ptEndcapLUT {nullptr}
private

Definition at line 55 of file AlphaBetaEstimate.h.

◆ m_use_mcLUT

BooleanProperty TrigL2MuonSA::AlphaBetaEstimate::m_use_mcLUT
private

Definition at line 53 of file AlphaBetaEstimate.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::TrackPattern::slope
double slope
Definition: TrackData.h:93
TrigL2MuonSA::TrackPattern::superPoints
TrigL2MuonSA::SuperPoint superPoints[s_NCHAMBER]
Definition: TrackData.h:60
tolerance
constexpr double tolerance
Definition: runMdtGeoComparison.cxx:104
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TrigL2MuonSA::AlphaBetaEstimate::m_use_mcLUT
BooleanProperty m_use_mcLUT
Definition: AlphaBetaEstimate.h:53
calibdata.chamber
chamber
Definition: calibdata.py:32
TrigL2MuonSA::TrackPattern::cscGamma
double cscGamma
Definition: TrackData.h:91
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
xAOD::L2MuonParameters::EndcapExtra
@ EndcapExtra
Extra station in the endcap spectrometer.
Definition: TrigMuonDefs.h:22
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
athena.value
value
Definition: athena.py:124
TrigL2MuonSA::TrackPattern::endcapBeta
double endcapBeta
Definition: TrackData.h:88
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
TrigL2MuonSA::SuperPoint::R
float R
Definition: SuperPointData.h:102
TrigL2MuonSA::TrackPattern::endcapRadius3P
double endcapRadius3P
Definition: TrackData.h:90
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
TrigL2MuonSA::SuperPoint::Phim
float Phim
Definition: SuperPointData.h:104
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
TrigL2MuonSA::TgcFitResult::tgcMid2
float tgcMid2[4]
Definition: TgcFitResult.h:46
TrigL2MuonSA::TgcFitResult::isSuccess
bool isSuccess
Definition: TgcFitResult.h:39
TrigL2MuonSA::AlphaBetaEstimate::isZero
bool isZero(float value, float tolerance=1e-5) const
Definition: AlphaBetaEstimate.h:49
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
TrigL2MuonSA::TrackPattern::large_dPhidZ
bool large_dPhidZ
Definition: TrackData.h:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:107
TrigL2MuonSA::TgcFitResult::tgcMid1
float tgcMid1[4]
Definition: TgcFitResult.h:45
TrigL2MuonSA::AlphaBetaEstimate::computeRadius3Points
double computeRadius3Points(double InnerZ, double InnerR, double EEZ, double EER, double MiddleZ, double MiddleR) const
Definition: AlphaBetaEstimate.cxx:309
TrigL2MuonSA::AlphaBetaEstimate::calcDistance
double calcDistance(double x1, double y1, double x2, double y2, double x3, double y3) const
Definition: AlphaBetaEstimate.cxx:346
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
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
MuonR4::SegmentFit::ParamDefs::x0
@ x0
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
TrigL2MuonSA::TrackPattern::intercept
double intercept
Definition: TrackData.h:94
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
TrigL2MuonSA::TrackPattern::pt
double pt
Definition: TrackData.h:62
TrigL2MuonSA::PtEndcapLUTSvc::ptEndcapLUT
const ToolHandle< PtEndcapLUT > * ptEndcapLUT(void) const
Definition: PtEndcapLUTSvc.h:46
MuonR4::SegmentFit::ParamDefs::y0
@ y0
xAOD::L2MuonParameters::EndcapMiddle
@ EndcapMiddle
Middle station in the endcap spectrometer.
Definition: TrigMuonDefs.h:20
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigL2MuonSA::TrackPattern::phiBin
int phiBin
Definition: TrackData.h:81
TrigL2MuonSA::TrackPattern::etaBin
int etaBin
Definition: TrackData.h:80
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigL2MuonSA::AlphaBetaEstimate::m_ptEndcapLUT
const ToolHandle< PtEndcapLUT > * m_ptEndcapLUT
Definition: AlphaBetaEstimate.h:55
TrigL2MuonSA::TrackPattern::deltaR
double deltaR
Definition: TrackData.h:95
TrigL2MuonSA::TgcFitResult::tgcInn
float tgcInn[4]
Definition: TgcFitResult.h:55
TrigL2MuonSA::TrackPattern::outerCorFactor
double outerCorFactor
Definition: TrackData.h:107
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
TrigL2MuonSA::AlphaBetaEstimate::computeRadius
double computeRadius(double InnerSlope, double InnerR, double InnerZ, double MiddleSlope, double MiddleR, double MiddleZ, double sign) const
Definition: AlphaBetaEstimate.cxx:271
TrigL2MuonSA::TgcFitResult::tgcPT
float tgcPT
Definition: TgcFitResult.h:63
a
TList * a
Definition: liststreamerinfos.cxx:10
h
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
xAOD::L2MuonParameters::EndcapInner
@ EndcapInner
Inner station in the endcap spectrometer.
Definition: TrigMuonDefs.h:19
TrigL2MuonSA::SuperPoint::Npoint
int Npoint
Definition: SuperPointData.h:97
TrigL2MuonSA::TrackPattern::etaMap
double etaMap
Definition: TrackData.h:77
TrigL2MuonSA::TrackPattern::phiBinEE
int phiBinEE
Definition: TrackData.h:82
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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:623
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
TrigL2MuonSA::SuperPoint::Z
float Z
Definition: SuperPointData.h:103
TrigL2MuonSA::SuperPoint
Definition: SuperPointData.h:74
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
CSC
@ CSC
Definition: RegSelEnums.h:34
TrigL2MuonSA::TrackPattern::endcapRadius
double endcapRadius
Definition: TrackData.h:89
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TrigL2MuonSA::SuperPoint::Alin
float Alin
Definition: SuperPointData.h:105
xAOD::L2MuonParameters::EndcapOuter
@ EndcapOuter
Outer station in the endcap spectrometer.
Definition: TrigMuonDefs.h:21
fitman.k
k
Definition: fitman.py:528
TrigL2MuonSA::TrackPattern::endcapAlpha
double endcapAlpha
Definition: TrackData.h:87