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

#include <PtEndcapLUT.h>

Inheritance diagram for TrigL2MuonSA::PtEndcapLUT:
Collaboration diagram for TrigL2MuonSA::PtEndcapLUT:

Classes

struct  KeyType
 
struct  TableType
 

Public Types

enum  DataType {
  INVALID, ALPHAPOL2, BETAPOL2, TGCALPHAPOL2,
  INVRADIUSPOL2, CSCPOL2
}
 

Public Member Functions

 PtEndcapLUT (const std::string &type, const std::string &name, const IInterface *parent)
 
 ~PtEndcapLUT (void)
 
StatusCode readLUT (const std::string &lut_fileName)
 
StatusCode readLUTSigmaMean (const std::string &lut_mean, const std::string &lut_sigma)
 
double alpha (double z1, double r1, double z2, double r2) const
 
double radius (double z1, double r1, double s1, double z2, double r2, double s2, double deltar) const
 
double lookup (int side, int charge, DataType type, int iEta, int iPhi, double value) const
 
double ptcombined (int iEta, int iPhi, double ApT, double BpT, double &CApT, double &CBpT) 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

enum  sizes { ETAS = 30, PHIS = 12, PHISEE = 192 }
 
typedef std::map< KeyType, TableType * > TableMap
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

Static Private Member Functions

static DataType s2dt (const char *type)
 
static const char * dt2s (DataType type)
 

Private Attributes

double m_meana [ETAS1][PHIS1][PTS1] {}
 
double m_meanb [ETAS1][PHIS1][PTS1] {}
 
double m_meanc [ETAS1][PHIS1][PTS1] {}
 
double m_sigmaa [ETAS1][PHIS1][PTS1] {}
 
double m_sigmab [ETAS1][PHIS1][PTS1] {}
 
double m_sigmac [ETAS1][PHIS1][PTS1] {}
 
TableMap m_tables
 
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 21 of file PtEndcapLUT.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

◆ TableMap

Definition at line 72 of file PtEndcapLUT.h.

Member Enumeration Documentation

◆ DataType

Enumerator
INVALID 
ALPHAPOL2 
BETAPOL2 
TGCALPHAPOL2 
INVRADIUSPOL2 
CSCPOL2 

Definition at line 24 of file PtEndcapLUT.h.

◆ sizes

Enumerator
ETAS 
PHIS 
PHISEE 

Definition at line 48 of file PtEndcapLUT.h.

48 { ETAS = 30, PHIS = 12, PHISEE = 192};

Constructor & Destructor Documentation

◆ PtEndcapLUT()

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

Definition at line 15 of file PtEndcapLUT.cxx.

17  :
19 {
20 }

◆ ~PtEndcapLUT()

TrigL2MuonSA::PtEndcapLUT::~PtEndcapLUT ( void  )

Definition at line 25 of file PtEndcapLUT.cxx.

26 {
27  for (TableMap::iterator it = m_tables.begin(); it != m_tables.end(); ++it) {
28  delete it->second;
29  }
30 }

Member Function Documentation

◆ alpha()

double TrigL2MuonSA::PtEndcapLUT::alpha ( double  z1,
double  r1,
double  z2,
double  r2 
) const

Definition at line 123 of file PtEndcapLUT.cxx.

124 {
125  CLHEP::Hep2Vector mid1(z1, r1);
126  CLHEP::Hep2Vector mid2(z2, r2);
127  CLHEP::Hep2Vector dir = mid2 - mid1;
128 
129  if(std::abs(mid1.unit() * dir.unit()) > 1.) return 0;
130 
131  double a = std::acos(mid1.unit() * dir.unit());
132 
133  return a;
134 }

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

◆ dt2s()

const char * TrigL2MuonSA::PtEndcapLUT::dt2s ( DataType  type)
staticprivate

Definition at line 280 of file PtEndcapLUT.cxx.

281 {
282  switch (type) {
283 
284  case ALPHAPOL2:
285  return ("alphapol2"); break;
286 
287  case BETAPOL2:
288  return ("betapol2"); break;
289 
290  case TGCALPHAPOL2:
291  return ("tgcalphapol2"); break;
292 
293  case INVRADIUSPOL2:
294  return ("invradiuspol2"); break;
295 
296  case CSCPOL2:
297  return ("cscpol2"); break;
298 
299  case INVALID:
300  return ("invalid"); break;
301 
302  default:
303  return ("invalid"); break;
304  }
305 }

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

◆ lookup()

double TrigL2MuonSA::PtEndcapLUT::lookup ( int  side,
int  charge,
DataType  type,
int  iEta,
int  iPhi,
double  value 
) const

Definition at line 180 of file PtEndcapLUT.cxx.

181 {
182  ATH_MSG_DEBUG("lookup(side=" << side << ",charge=" << charge
183  << ",type=" << dt2s(type) << ",iEta=" << iEta
184  << ",iPhi=" << iPhi << ",value=" << value << ")");
185 
186  if (iEta == -1) iEta = 0;
187  if (iEta == 30) iEta = 29;
188 
189  if (iEta < 0 || iEta >= ETAS || iPhi < 0 || iPhi >= PHISEE) {
190  ATH_MSG_WARNING("lookup(" << side << ", " << charge << ", " << dt2s(type)
191  << ", " << iEta << ", " << iPhi << ") Invalid indices");
192  return 0.0;
193  }
194 
195  TableMap::const_iterator it = m_tables.find(KeyType(side, charge, type));
196 
197  if (it == m_tables.end()) {
198  ATH_MSG_ERROR("lookup(" << side << ", " << charge << ", " << dt2s(type)
199  << ", " << iEta << ", " << iPhi << ") Invalid key");
200  return 0.0;
201  }
202 
203  double pt = 0;
204  TableType* table = it->second;
205 
206  double b = table->m_xcepts[iEta][iPhi];
207  double c = table->m_slopes[iEta][iPhi];
208  const double PT_MAX = 500; // 500 GeV upper limit
209  const double ZERO_LIMIT = 1e-5;
210 
211  if( std::abs(c) < ZERO_LIMIT ) {
212 
213  if( std::abs(b) < ZERO_LIMIT ) {
214 
215  pt = PT_MAX;
216 
217  } else {
218 
219  double ptinv = value / b;
220 
221  if( ptinv < 0 ) {
222 
223  ATH_MSG_WARNING("Pol2: ptinv < 0, ptinv=" << ptinv);
224 
225  } else {
226 
227  if( ptinv < (1/PT_MAX) ) pt = PT_MAX;
228  else { pt = 1/ptinv; }
229 
230  }
231  }
232 
233  } else {
234 
235  double judge = b*b + 4*c*value;
236 
237  if( judge > 0 ) {
238 
239  double ptinv = (-b + pow(judge,0.5)) / c / 2;
240 
241  if( ptinv < 0 ) {
242 
243  ATH_MSG_WARNING("Pol2: ptinv < 0, ptinv=" << ptinv);
244 
245  } else {
246 
247  if( ptinv < (1/PT_MAX) ) {
248  pt = PT_MAX;
249  } else {
250  pt = 1/ptinv;
251  }
252  }
253  }
254  }
255 
256  ATH_MSG_DEBUG("Pol2: value=" << value);
257  ATH_MSG_DEBUG("Pol2: b=" << b << " c=" << c << " pt=" << pt);
258  pt *= 1000; // convert to MeV
259 
260  return pt;
261 }

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

◆ ptcombined()

double TrigL2MuonSA::PtEndcapLUT::ptcombined ( int  iEta,
int  iPhi,
double  ApT,
double  BpT,
double &  CApT,
double &  CBpT 
) const

Definition at line 310 of file PtEndcapLUT.cxx.

312 {
313  ATH_MSG_DEBUG("pTcombined("
314  << "iEta=" << iEta
315  << "iPhi=" << iPhi
316  << "Alpha pT=" << ApT
317  << "Beta pT=" << BpT
318  << ")" );
319 
320  if (iEta == -1) iEta = 0;
321  if (iEta == 30) iEta = 29;
322 
323  if (iEta < 0 || iEta >= ETAS || iPhi < 0 || iPhi >= PHIS) {
324  ATH_MSG_WARNING("pTcombined("<< iEta << ", " << iPhi << ") Invalid indices");
325  return 0.0;
326  }
327 
328  const float ZERO_LIMIT = 1e-5;
329  int iphibin=iPhi;
330  int ietabin=iEta/6;
331  if(iPhi==5||iPhi==6)iphibin=5;
332  if(iPhi==4||iPhi==7)iphibin=4;
333  if(iPhi==3||iPhi==8)iphibin=3;
334  if(iPhi==2||iPhi==9)iphibin=2;
335  if(iPhi==1||iPhi==10)iphibin=1;
336  if(iPhi==0||iPhi==11)iphibin=0;
337  CApT=0.;
338  CBpT=0.;
339  double Ameana = m_meana[ietabin][iphibin][0];
340  double Ameanb = m_meanb[ietabin][iphibin][0];
341  double Ameanc = m_meanc[ietabin][iphibin][0];
342  double Bmeana = m_meana[ietabin][iphibin][1];
343  double Bmeanb = m_meanb[ietabin][iphibin][1];
344  double Bmeanc = m_meanc[ietabin][iphibin][1];
345 
346  double Asigmaa = m_sigmaa[ietabin][iphibin][0];
347  double Asigmab = m_sigmab[ietabin][iphibin][0];
348  double Asigmac = m_sigmac[ietabin][iphibin][0];
349  double Bsigmaa = m_sigmaa[ietabin][iphibin][1];
350  double Bsigmab = m_sigmab[ietabin][iphibin][1];
351  double Bsigmac = m_sigmac[ietabin][iphibin][1];
352 
353 
354  double MeanAP = ( std::abs(ApT) > ZERO_LIMIT)? (Ameana + Ameanb * std::exp( Ameanc / ApT)) : 1.0;
355  double MeanBP = ( std::abs(BpT) > ZERO_LIMIT)? (Bmeana + Bmeanb * std::exp( Bmeanc / BpT)) : 1.0;
356  double ApT_tmp = ( std::abs(1-MeanAP) > ZERO_LIMIT)? (std::abs(ApT) / (1-MeanAP)) : 1.0;
357  ApT_tmp = std::abs(ApT_tmp);
358  if(ApT_tmp >= 500) ApT_tmp = 500;
359  double BpT_tmp = ( std::abs(1-MeanBP) > ZERO_LIMIT)? (std::abs(BpT) / (1-MeanBP)) : 1.0;
360  BpT_tmp = std::abs(BpT_tmp);
361  if(BpT_tmp >= 500) BpT_tmp = 500;
362 
363  CApT = ApT_tmp;
364  CBpT = BpT_tmp;
365 
366  if(ApT == 0. ) CApT = 0.;
367  if(BpT == 0. ) CBpT = 0.;
368  double NSigmaA= Asigmaa * std::abs(ApT_tmp) * std::abs(ApT_tmp) + Asigmab * std::abs(ApT_tmp) + Asigmac;
369  double NSigmaB= Bsigmaa * std::abs(BpT_tmp) * std::abs(BpT_tmp) + Bsigmab * std::abs(BpT_tmp) + Bsigmac;
370 
371  double NVsigpTA =(std::abs(ApT_tmp) > ZERO_LIMIT&& std::abs(NSigmaA) > ZERO_LIMIT)? (1/(NSigmaA * ApT_tmp) ): 1.0;
372  double NVsigpTB =(std::abs(BpT_tmp) > ZERO_LIMIT&& std::abs(NSigmaB) > ZERO_LIMIT)? (1/(NSigmaB * BpT_tmp) ): 1.0;
373  double NVsigAsq =(std::abs(NSigmaA) > ZERO_LIMIT)? (1/(NSigmaA * NSigmaA)) : 1.0;
374  double NVsigBsq =(std::abs(NSigmaB) > ZERO_LIMIT)? (1/(NSigmaB * NSigmaB)) : 1.0;
375 
376  double NVsigpTAsq = NVsigpTA * NVsigpTA;
377  double NVsigpTBsq = NVsigpTB * NVsigpTB;
378  double pt = (std::abs(NVsigAsq + NVsigBsq) > ZERO_LIMIT)? (1/std::sqrt((NVsigpTAsq + NVsigpTBsq)/(NVsigAsq + NVsigBsq))) : 0.;
379  if(pt>500) pt = 500.;
380  return pt;
381 }

◆ radius()

double TrigL2MuonSA::PtEndcapLUT::radius ( double  z1,
double  r1,
double  s1,
double  z2,
double  r2,
double  s2,
double  deltar 
) const

Definition at line 139 of file PtEndcapLUT.cxx.

140 {
141  float cr1 = 0.080/400;
142  float cr2 = cr1;
143  double x1 = z1;
144 
145  if (std::abs(x1)>=0.1) {
146  double x2 = z2;
147  double y1 = r1;
148  double y2 = r2;
149  double A1 = s1;
150  double A2 = s2;
151  if(!(std::abs(s2+999)<0.1)) {
152  A2 = s2;
153  cr2 = cr1/10;
154  }
155 
156  // find centre of circonference
157  double xm = (x1+x2)/2.;
158  double ym = (y1+y2)/2.;
159  double c1 = (x2-x1)*xm+(y2-y1)*ym;
160  double c2_1 = -x1-A1*y1;
161  double c2_2 = -x2-A2*y2;
162  double yR1 = (-c1-c2_1*(x2-x1))/(A1*(x2-x1)-(y2-y1));
163  double yR2 = (-c1-c2_2*(x2-x1))/(A2*(x2-x1)-(y2-y1));
164  double xR1 = -A1*yR1-c2_1;
165  double xR2 = -A2*yR2-c2_2;
166 
167  double xR = ((1./cr1)*xR1+(1./cr2)*xR2)/((1./cr1)+(1./cr2));
168  double yR = ((1./cr1)*yR1+(1./cr2)*yR2)/((1./cr1)+(1./cr2));
169  double sign = deltar / std::abs(deltar);
170  double radius = 0.5*(std::sqrt((xR-x1)*(xR-x1)+(yR-y1)*(yR-y1))+std::sqrt((xR-x2)*(xR-x2)+(yR-y2)*(yR-y2)));
171  return(sign * radius);
172  } else {
173  return 0.0;
174  }
175 }

◆ readLUT()

StatusCode TrigL2MuonSA::PtEndcapLUT::readLUT ( const std::string &  lut_fileName)

Definition at line 59 of file PtEndcapLUT.cxx.

60 {
61  std::ifstream ifs(lut_fileName.c_str());
62  if (!ifs.is_open()) {
63  ATH_MSG_ERROR("Cannot open EndcapLUT file " << lut_fileName);
64  return StatusCode::FAILURE;
65  }
66 
67  m_tables.clear();
68  std::string line;
69  int line_no = 0;
70  TableType* table = NULL;
71 
72  while (!ifs.eof()) {
73 
74  getline(ifs, line);
75  line_no++;
76 
77  if (line.empty()) continue;
78 
79  if (line.substr(0, 5) == "side=") {
80  char side, charge, ctype[15];
81 
82  if (sscanf(line.c_str(), "side=%c charge=%c %14s", &side, &charge, ctype) != 3) {
83  ATH_MSG_ERROR("Invalid header line " << line_no << " in EndcapLUT file " << lut_fileName);
84  return StatusCode::FAILURE;
85  }
86 
87  DataType type = s2dt(ctype);
88  if ((side != '-' && side != '+') || (charge != '-' && charge != '+') || type == INVALID) {
89  ATH_MSG_ERROR("Invalid header line " << line_no << " in EndcapLUT file " << lut_fileName);
90  return StatusCode::FAILURE;
91  }
92 
93  KeyType key(side == '+' ? 1 : 0, charge == '+' ? 1 : 0, type);
94  table = new TableType();
95  m_tables.insert(TableMap::value_type(key, table));
96  ATH_MSG_DEBUG("Created table for " << key.toString());
97 
98  } else {
99 
100  if (table == NULL) {
101  ATH_MSG_ERROR("Missing header line " << line_no << " in EndcapLUT file " << lut_fileName);
102  return StatusCode::FAILURE;
103  }
104 
105  int iEta, iPhi;
106  double xcept, slope;
107  if (sscanf(line.c_str(), "%3d %3d %15lf %15lf", &iEta, &iPhi, &xcept, &slope) != 4) {
108  ATH_MSG_ERROR("Invalid data line " << line_no << " in EndcapLUT file " << lut_fileName);
109  return StatusCode::FAILURE;
110  }
111  table->m_xcepts[iEta-1][iPhi] = xcept;
112  table->m_slopes[iEta-1][iPhi] = slope;
113  }
114  }
115  ifs.close();
116 
117  return StatusCode::SUCCESS;
118 }

◆ readLUTSigmaMean()

StatusCode TrigL2MuonSA::PtEndcapLUT::readLUTSigmaMean ( const std::string &  lut_mean,
const std::string &  lut_sigma 
)

Definition at line 385 of file PtEndcapLUT.cxx.

386 {
387  std::ifstream ifsmean(lut_mean.c_str());
388  std::ifstream ifssigma(lut_sigma.c_str());
389  if (!ifsmean.is_open()) {
390  ATH_MSG_ERROR("Cannot open EndcapLUT Mean file " << lut_mean);
391  return StatusCode::FAILURE;
392  }
393  if (!ifssigma.is_open()) {
394  ATH_MSG_ERROR("Cannot open EndcapLUT Sigma file " << lut_sigma);
395  return StatusCode::FAILURE;
396  }
397 
398  std::string line;
399 
400  for(int ei=0; ei < ETAS1; ei++){
401  for(int pi=0; pi < PHIS1; pi++){
402  for(int pti=0; pti < PTS1; pti++){
403  m_meana[ei][pi][pti] =0.;
404  m_meanb[ei][pi][pti] =0.;
405  m_meanc[ei][pi][pti] =0.;
406  m_sigmaa[ei][pi][pti]=0.;
407  m_sigmab[ei][pi][pti]=0.;
408  m_sigmac[ei][pi][pti]=0.;
409  }
410  }
411  }
412 
413  while (!ifsmean.eof()) {
414  getline(ifsmean, line);
415  if (line.empty()) continue;
416 
417  int iEta, iPhi, iNP;
418  double tmp_par1, tmp_par2, tmp_par3;
419  if (sscanf(line.c_str(), "%d %d %d %lf %lf %lf", &iEta, &iPhi, &iNP, &tmp_par1, &tmp_par2, &tmp_par3) != 6) {
420  ATH_MSG_ERROR(" Invalid data in mean EndcapLUT file " << lut_mean);
421  return StatusCode::FAILURE;
422  }
423 
424  m_meana[iEta][iPhi][iNP] = tmp_par1;
425  m_meanb[iEta][iPhi][iNP] = tmp_par2;
426  m_meanc[iEta][iPhi][iNP] = tmp_par3;
427  }
428  ifsmean.close();
429  std::string line2;
430  while (!ifssigma.eof()) {
431  getline(ifssigma, line2);
432  if (line2.empty()) continue;
433 
434  int iEta, iPhi, iNP;
435  double tmp_par1, tmp_par2, tmp_par3;
436  if (sscanf(line2.c_str(), "%d %d %d %lf %lf %lf", &iEta, &iPhi, &iNP, &tmp_par1, &tmp_par2, &tmp_par3) != 6) {
437  ATH_MSG_ERROR(" Invalid data in mean EndcapLUT file " << lut_mean);
438  return StatusCode::FAILURE;
439  }
440 
441  m_sigmaa[iEta][iPhi][iNP] = tmp_par1;
442  m_sigmab[iEta][iPhi][iNP] = tmp_par2;
443  m_sigmac[iEta][iPhi][iNP] = tmp_par3;
444  }
445  ifssigma.close();
446 
447  return StatusCode::SUCCESS;
448 }

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

◆ s2dt()

TrigL2MuonSA::PtEndcapLUT::DataType TrigL2MuonSA::PtEndcapLUT::s2dt ( const char *  type)
staticprivate

Definition at line 266 of file PtEndcapLUT.cxx.

267 {
268  std::string stype(type);
269  if (stype == "alphapol2") return (ALPHAPOL2);
270  if (stype == "betapol2") return (BETAPOL2);
271  if (stype == "tgcalphapol2") return (TGCALPHAPOL2);
272  if (stype == "invradiuspol2") return (INVRADIUSPOL2);
273  if (stype == "cscpol2") return (CSCPOL2);
274  return (INVALID);
275 }

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

double TrigL2MuonSA::PtEndcapLUT::m_meana[ETAS1][PHIS1][PTS1] {}
private

Definition at line 41 of file PtEndcapLUT.h.

◆ m_meanb

double TrigL2MuonSA::PtEndcapLUT::m_meanb[ETAS1][PHIS1][PTS1] {}
private

Definition at line 42 of file PtEndcapLUT.h.

◆ m_meanc

double TrigL2MuonSA::PtEndcapLUT::m_meanc[ETAS1][PHIS1][PTS1] {}
private

Definition at line 43 of file PtEndcapLUT.h.

◆ m_sigmaa

double TrigL2MuonSA::PtEndcapLUT::m_sigmaa[ETAS1][PHIS1][PTS1] {}
private

Definition at line 44 of file PtEndcapLUT.h.

◆ m_sigmab

double TrigL2MuonSA::PtEndcapLUT::m_sigmab[ETAS1][PHIS1][PTS1] {}
private

Definition at line 45 of file PtEndcapLUT.h.

◆ m_sigmac

double TrigL2MuonSA::PtEndcapLUT::m_sigmac[ETAS1][PHIS1][PTS1] {}
private

Definition at line 46 of file PtEndcapLUT.h.

◆ m_tables

TableMap TrigL2MuonSA::PtEndcapLUT::m_tables
private

Definition at line 77 of file PtEndcapLUT.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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
checkFileSG.line
line
Definition: checkFileSG.py:75
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigL2MuonSA::PtEndcapLUT::m_meanc
double m_meanc[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:43
ETAS1
#define ETAS1
Definition: PtEndcapLUT.h:15
TrigL2MuonSA::PtEndcapLUT::m_meanb
double m_meanb[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:42
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigL2MuonSA::PtEndcapLUT::INVRADIUSPOL2
@ INVRADIUSPOL2
Definition: PtEndcapLUT.h:24
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TrigL2MuonSA::PtEndcapLUT::radius
double radius(double z1, double r1, double s1, double z2, double r2, double s2, double deltar) const
Definition: PtEndcapLUT.cxx:139
extractSporadic.c1
c1
Definition: extractSporadic.py:134
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
DataType
OFFLINE_FRAGMENTS_NAMESPACE::PointerType DataType
Definition: RoIBResultByteStreamTool.cxx:25
TrigL2MuonSA::PtEndcapLUT::PHIS
@ PHIS
Definition: PtEndcapLUT.h:48
skel.it
it
Definition: skel.GENtoEVGEN.py:423
test_pyathena.pt
pt
Definition: test_pyathena.py:11
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
athena.value
value
Definition: athena.py:122
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MCP::ScaleSmearParam::r2
@ r2
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
pi
#define pi
Definition: TileMuonFitter.cxx:65
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TrigL2MuonSA::PtEndcapLUT::m_sigmac
double m_sigmac[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:46
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigL2MuonSA::PtEndcapLUT::CSCPOL2
@ CSCPOL2
Definition: PtEndcapLUT.h:24
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigL2MuonSA::PtEndcapLUT::m_sigmaa
double m_sigmaa[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:44
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
test_pyathena.parent
parent
Definition: test_pyathena.py:15
sign
int sign(int a)
Definition: TRT_StrawNeighbourSvc.h:127
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TrigL2MuonSA::PtEndcapLUT::ALPHAPOL2
@ ALPHAPOL2
Definition: PtEndcapLUT.h:24
TrigL2MuonSA::PtEndcapLUT::s2dt
static DataType s2dt(const char *type)
Definition: PtEndcapLUT.cxx:266
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
ZERO_LIMIT
const float ZERO_LIMIT
Definition: VP1TriggerHandleL2.cxx:37
beamspotman.dir
string dir
Definition: beamspotman.py:623
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
TrigL2MuonSA::PtEndcapLUT::ETAS
@ ETAS
Definition: PtEndcapLUT.h:48
python.ext.table_printer.table
list table
Definition: table_printer.py:81
charge
double charge(const T &p)
Definition: AtlasPID.h:494
TrigL2MuonSA::PtEndcapLUT::m_tables
TableMap m_tables
Definition: PtEndcapLUT.h:77
TrigL2MuonSA::PtEndcapLUT::TGCALPHAPOL2
@ TGCALPHAPOL2
Definition: PtEndcapLUT.h:24
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
TrigL2MuonSA::PtEndcapLUT::m_meana
double m_meana[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:41
PHIS1
#define PHIS1
Definition: PtEndcapLUT.h:16
PTS1
#define PTS1
Definition: PtEndcapLUT.h:17
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
LArG4FSStartPointFilterLegacy.line2
line2
Definition: LArG4FSStartPointFilterLegacy.py:59
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TrigL2MuonSA::PtEndcapLUT::BETAPOL2
@ BETAPOL2
Definition: PtEndcapLUT.h:24
MCP::ScaleSmearParam::r1
@ r1
TrigL2MuonSA::PtEndcapLUT::INVALID
@ INVALID
Definition: PtEndcapLUT.h:24
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
python.compressB64.c
def c
Definition: compressB64.py:93
TrigL2MuonSA::PtEndcapLUT::m_sigmab
double m_sigmab[ETAS1][PHIS1][PTS1]
Definition: PtEndcapLUT.h:45
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::PtEndcapLUT::dt2s
static const char * dt2s(DataType type)
Definition: PtEndcapLUT.cxx:280
fitman.k
k
Definition: fitman.py:528
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
TrigL2MuonSA::PtEndcapLUT::PHISEE
@ PHISEE
Definition: PtEndcapLUT.h:48