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

#include <RpcPatFinder.h>

Inheritance diagram for TrigL2MuonSA::RpcPatFinder:
Collaboration diagram for TrigL2MuonSA::RpcPatFinder:

Public Member Functions

 RpcPatFinder (const std::string &type, const std::string &name, const IInterface *parent)
 
void addHit (const std::string &stationName, int stationEta, bool measuresPhi, unsigned int gasGap, unsigned int doubletR, double gPosX, double gPosY, double gPosZ, TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
 
bool findPatternEta (double aw[], double bw[], unsigned int &pattern, const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
 
bool findPatternPhi (double &phi_middle, double &phi_outer, unsigned int &pattern, const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) 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

int patfinder (bool iphi, unsigned int &result_pat, double &result_x, double &result_x1, double &result_dMO, const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
 
int patfinder_forEta (bool iphi, unsigned int &result_pat, double result_aw[], double result_bw[], double result_dist[], const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
 
bool deltaOK (int l1, int l2, double x1, double x2, int isphi, double &delta) const
 
double calibR (const std::string &stationName, double R, double Phi) const
 
void abcal (unsigned int result_pat, size_t index[], double aw[], double bw[], const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) 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

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 41 of file RpcPatFinder.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

◆ RpcPatFinder()

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

Definition at line 18 of file RpcPatFinder.cxx.

20  :
22 {
23 }

Member Function Documentation

◆ abcal()

void TrigL2MuonSA::RpcPatFinder::abcal ( unsigned int  result_pat,
size_t  index[],
double  aw[],
double  bw[],
const TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const
private

Definition at line 411 of file RpcPatFinder.cxx.

415  {
416  const float ZERO_LIMIT = 1.e-5;
417 
418  const std::vector<std::vector<double> > * rpc_R;
419  const std::vector<std::vector<double> > * rpc_Z;
420  rpc_R = &rpcLayerHits.hits_in_layer_R;
421  rpc_Z = &rpcLayerHits.hits_in_layer_Z;
422  double R[8]={0,0,0,0,0,0,0,0};
423  double Z[8]={0,0,0,0,0,0,0,0};
424  unsigned int bit=1;
425 
426  int hot_min[3]={999,999,999};
427  int hot_max[3]={-999,-999,-999};
428 
429  int out_counter=0;
430 
431  for(int i=0; i<8; i++){
432  if(i != 0) bit = bit << 1;
433  if((result_pat & bit)==false) continue;
434  R[i] = rpc_R->at(i).at(index[i]);
435  Z[i] = rpc_Z->at(i).at(index[i]);
436 
437  if(i < hot_min[0]) hot_min[0] = i;
438  if(i < hot_min[1]) hot_min[1] = i;
439  if(1 < i && out_counter <1) hot_min[2] = i;
440 
441  if(i < 4){
442  hot_max[0] = i;
443  hot_max[1] = i;
444  }
445  if(hot_max[2] < i ) hot_max[2] = i;
446 
447  if(1 < i) out_counter++;
448  }//for i
449 
450  unsigned int inn_bit;
451  inn_bit=0x3;//00000011
452  if((result_pat & inn_bit)==inn_bit){
453  R[hot_min[0]] = (R[0]+R[1])/2.0;
454  Z[hot_min[0]] = (Z[0]+Z[1])/2.0;
455  }
456  inn_bit=0xC;//00001100
457  if((result_pat & inn_bit)==inn_bit){
458  R[hot_max[0]] = (R[2]+R[3])/2.0;
459  Z[hot_max[0]] = (Z[2]+Z[3])/2.0;
460  }
461 
462  unsigned int mid_bit;
463  mid_bit=0x3;//00000011
464  if((result_pat & mid_bit)==mid_bit){
465  R[hot_min[1]] = (R[0]+R[1])/2.0;
466  Z[hot_min[1]] = (Z[0]+Z[1])/2.0;
467  }
468  mid_bit=0xC;//00001100
469  if((result_pat & mid_bit)==mid_bit){
470  R[hot_max[1]] = (R[2]+R[3])/2.0;
471  Z[hot_max[1]] = (Z[2]+Z[3])/2.0;
472  }
473 
474  unsigned int out_bit;
475  out_bit=0xC;//00001100
476  if((result_pat & out_bit)==out_bit){
477  R[hot_min[2]] = (R[2]+R[3])/2.0;
478  Z[hot_min[2]] = (Z[2]+Z[3])/2.0;
479  }
480 
481  out_bit=0x30;//00110000
482  if((result_pat & out_bit)==out_bit){
483  R[hot_max[2]] = (R[4]+R[5])/2.0;
484  Z[hot_max[2]] = (Z[4]+Z[5])/2.0;
485  }
486 
487  out_bit=0xC0;//11000000
488  if((result_pat & out_bit)==out_bit){
489  R[hot_max[2]] = (R[6]+R[7])/2.0;
490  Z[hot_max[2]] = (Z[6]+Z[7])/2.0;
491  }
492 
493  inn_bit=0xF;//00001111
494  double theta_m,theta_t, theta_f;
495  if((result_pat & inn_bit)==inn_bit){
496  theta_m = std::atan2(R[hot_min[0]],Z[hot_min[0]]);
497  theta_t = std::atan2(R[hot_max[0]]-R[hot_min[0]],Z[hot_max[0]]-Z[hot_min[0]]);
498  theta_f = (theta_m+theta_t)/2.0;
499 
500  aw[0] = std::tan(theta_f);
501  bw[0] = R[hot_min[0]] - Z[hot_min[0]]*aw[0];
502  aw[0] = 1.0/aw[0];
503  }else{
504  if(hot_min[0]!=999){
505  aw[0] = Z[hot_min[0]] / R[hot_min[0]];
506  bw[0] = 0.0;
507  }else{
508  aw[0] = Z[hot_max[0]] / R[hot_max[0]];
509  bw[0] = 0.0;
510  }//else
511  }//else
512 
513  for(int i=1;i<3;i++){
514  if(hot_max[i]!=-999 && hot_min[i]!=999){
515  if(std::abs(Z[hot_max[i]] - Z[hot_min[i]]) > ZERO_LIMIT) {
516  aw[i] = (R[hot_max[i]]- R[hot_min[i]]) / (Z[hot_max[i]]-Z[hot_min[i]]);
517  bw[i] = R[hot_max[i]] - Z[hot_max[i]]*aw[i];
518  aw[i] = 1.0/aw[i];
519  }else if(i<2){
520  aw[i] = Z[hot_min[i]] / R[hot_min[i]];
521  bw[i] = 0.0;
522  } else{
523  aw[i] = Z[hot_max[i]] / R[hot_max[i]];
524  bw[i] = 0.0;
525  }
526  }else{
527  if(i <2){
528  if(hot_min[i]!=999){
529  aw[i] = Z[hot_min[i]] / R[hot_min[i]];
530  bw[i] = 0.0;
531  }else if(hot_max[i]!=-999){
532  aw[i] = Z[hot_max[i]] / R[hot_max[i]];
533  bw[i] = 0.0;
534  }
535  }else{
536  if(hot_max[i]!=-999){
537  aw[i] = Z[hot_max[i]] / R[hot_max[i]];
538  bw[i] = 0.0;
539  }else if(hot_min[i]!=999){
540  aw[i] = Z[hot_min[i]] / R[hot_min[i]];
541  bw[i] = 0.0;
542  }
543  }
544  }
545  }
546 }//abcal()

◆ addHit()

void TrigL2MuonSA::RpcPatFinder::addHit ( const std::string &  stationName,
int  stationEta,
bool  measuresPhi,
unsigned int  gasGap,
unsigned int  doubletR,
double  gPosX,
double  gPosY,
double  gPosZ,
TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const

Definition at line 28 of file RpcPatFinder.cxx.

36  {
37 
38  int ilay=0;
39  // BO
40  if (stationName.substr(0,2)=="BO") ilay=4;
41  // doubletR
42  ilay+=2*(doubletR-1);
43  // BML7 special chamber with 1 RPC doublet (doubletR=1 but RPC2) :
44  if (stationName.substr(0,3)=="BML" && stationEta==7) ilay+=2;
45  // gasGap
46  ilay+=gasGap-1;
47 
48  double R=std::sqrt(gPosX*gPosX+gPosY*gPosY);
49  const double Phi=std::atan2(gPosY,gPosX);
50 
51  if (!measuresPhi){
52  // if eta measurement then save Z/R
53  R = calibR(stationName,R, Phi);
54  double x=gPosZ/R;
55  rpcLayerHits.hits_in_layer_eta.at(ilay).push_back(x);
56  rpcLayerHits.hits_in_layer_R.at(ilay).push_back(R);//mod!
57  rpcLayerHits.hits_in_layer_Z.at(ilay).push_back(gPosZ);//mod!
58  }else{
59  // if phi measurement then save phi
60  rpcLayerHits.hits_in_layer_phi.at(ilay).push_back(Phi);
61  }
62 }

◆ calibR()

double TrigL2MuonSA::RpcPatFinder::calibR ( const std::string &  stationName,
double  R,
double  Phi 
) const
private

Definition at line 382 of file RpcPatFinder.cxx.

382  {
383  double DeltaPhi, temp_phi;
384  double calibPhi = std::acos(std::cos(Phi)); // 0 < Phi < 2PI
385 
386  if(std::string::npos != stationName.rfind('L')){//For Large , SP
387  DeltaPhi= 999; temp_phi=9999;
388  for(int inum=0;inum < 8;inum++){
389  temp_phi = std::abs((inum * M_PI/4.0 )- calibPhi);
390  if(temp_phi < DeltaPhi) DeltaPhi = temp_phi;
391  }
392  }else if(std::string::npos != stationName.rfind('S') ||
393  std::string::npos != stationName.rfind('F') ||
394  std::string::npos != stationName.rfind('G') ){
395  DeltaPhi= 999; temp_phi=9999;
396 
397  for(int inum=0;inum < 8;inum++){
398  temp_phi = std::abs(inum *(M_PI/4.0 )+(M_PI/8.0) - calibPhi);
399  if(temp_phi < DeltaPhi) DeltaPhi = temp_phi;
400  }//for end
401  }else return R;
402 
403  double calibR = R *std::cos(DeltaPhi);
404 
405  return calibR;
406 }//calbR()

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

◆ deltaOK()

bool TrigL2MuonSA::RpcPatFinder::deltaOK ( int  l1,
int  l2,
double  x1,
double  x2,
int  isphi,
double &  delta 
) const
private

Definition at line 309 of file RpcPatFinder.cxx.

309  {
310 
311 
312  // ROAD tuned for ~20 GeV
313  /*
314  double delta_gasgap_eta = 0.004;
315  double delta_lowpt_eta = 0.005;
316  double delta_highpt_eta = 0.012;
317  double delta_feet_eta = 0.02;
318 
319  double delta_gasgap_phi = 0.004;
320  double delta_lowpt_phi = 0.005;
321  double delta_highpt_phi = 0.008;
322  double delta_feet_phi = 0.02;
323  */
324 
325  //OPEN road
326 
327  const double delta_gasgap_eta = 0.01;
328  const double delta_lowpt_eta = 0.05;
329  const double delta_highpt_eta = 0.1;
330  const double delta_feet_eta = 0.05;
331 
332  const double delta_gasgap_phi = 0.01;
333  const double delta_lowpt_phi = 0.03;
334  const double delta_highpt_phi = 0.04;
335  const double delta_feet_phi = 0.03;
336 
337  // calculate delta-eta or delta-phi
338  if(isphi) delta=std::abs(std::acos(std::cos(x2-x1)));
339  else delta=std::abs(x2-x1);
340 
341  double delta_max=0;
342  if (l1>l2) {
343  int tmp=l2;
344  l2=l1;
345  l1=tmp;
346  }
347  // calculate delta_max
348  if (isphi){
349  if (l2-l1==1&&(l1==0||l1==2||l1==4||l1==6)){
350  delta_max=delta_gasgap_phi;
351  } else if (l1<2&&l2<4) {
352  delta_max=delta_lowpt_phi;
353  }else if (l1<4&&l2>=4) {
354  delta_max=delta_highpt_phi;
355  }else if (l1<6&&l1>=4&&l2>=6) {
356  delta_max=delta_feet_phi;
357  }
358  } else {
359  if (l2-l1==1&&(l1==0||l1==2||l1==4||l1==6)){
360  delta_max=delta_gasgap_eta;
361  } else if (l1<2&&l2>=2&&l2<4) {
362  delta_max=delta_lowpt_eta;
363  }else if (l1<4&&l2>=4) {
364  delta_max=delta_highpt_eta;
365  }else if (l1<6&&l1>=4&&l2>=6) {
366  delta_max=delta_feet_eta;
367  }
368  }
369 
370  // evaluate the result
371 
372  bool OK=false;
373  if (delta<delta_max) OK=true;
374 
375  return OK;
376 
377 }

◆ 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

◆ findPatternEta()

bool TrigL2MuonSA::RpcPatFinder::findPatternEta ( double  aw[],
double  bw[],
unsigned int &  pattern,
const TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const

Definition at line 79 of file RpcPatFinder.cxx.

82  {
83  double result_delta[3]={9999,9999,9999};
84  bool found=false;
85  if( patfinder_forEta(false, pattern, aw, bw, result_delta, rpcLayerHits)>=2) found=true;
86  return found;
87 }

◆ findPatternPhi()

bool TrigL2MuonSA::RpcPatFinder::findPatternPhi ( double &  phi_middle,
double &  phi_outer,
unsigned int &  pattern,
const TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const

Definition at line 67 of file RpcPatFinder.cxx.

70  {
71  double result_dMO;
72  bool found=false;
73  if (patfinder(true, pattern, phi_middle,phi_outer, result_dMO, rpcLayerHits)>=2) found=true;
74  return found;
75 }

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

◆ patfinder()

int TrigL2MuonSA::RpcPatFinder::patfinder ( bool  iphi,
unsigned int &  result_pat,
double &  result_x,
double &  result_x1,
double &  result_dMO,
const TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const
private

Definition at line 200 of file RpcPatFinder.cxx.

205  {
206 
207  const int N_layers=8;
208 
209  const std::vector<std::list<double>> * rpc_x;
210  if (iphi){
211  rpc_x = &rpcLayerHits.hits_in_layer_phi;
212  } else {
213  rpc_x = &rpcLayerHits.hits_in_layer_eta;
214  }
215 
216  int l_start_max=2; //max layer of first hit
217  if (rpc_x->at(6).size()+rpc_x->at(7).size()>0) l_start_max=5; // special "feet" towers
218 
219  // reset parameters
220  result_x=0;
221  result_x1=0;
222  result_pat=0;
223  double result_dMM=9999;
224  result_dMO=9999;
225  int n_max=0;
226 
227 
228  // Loop on start layer
229  for (int l_start=0; l_start<=l_start_max; l_start++){
230  // Loop on hits of start layer, for each hit try a new pattern
231  for (std::list<double>::const_iterator i_start=rpc_x->at(l_start).begin(); i_start!=rpc_x->at(l_start).end(); ++i_start){
232  int n_hits=1;
233  unsigned int pat=(1<<l_start); // bit pattern of hit layers
234  double dMO=9999; // disstance middle-outer station
235  double dMM=9999; // distance RPC1-RPC2 on middle stations
236 
237  double current_x =*i_start; // set current_x to the starting hit
238  int l_current = l_start;
239  ATH_MSG_DEBUG("patfinder: l_start = "<< l_start << " x= " << current_x
240  << " pat= " << (std::bitset<8>) pat);
241 
242  // ----- add compatible hits in other layers ----//
243  // loop on test layers:
244  for (int l_test=l_start+1; l_test<N_layers; l_test++){
245  int n_layer=0;
246  double x_layer=0;
247  double delta_layer=999;
248  // loop on hits of test layer and picks the one with smaller distance from current_x
249  for (std::list<double>::const_iterator i_test=rpc_x->at(l_test).begin(); i_test!=rpc_x->at(l_test).end(); ++i_test){
250  double delta=-1;
251  // check if within the road
252  if (deltaOK(l_current,l_test,current_x,*i_test,iphi,delta)){
253  n_layer++;
254  // if closest hit update x_layer
255  if (delta<delta_layer) {
256  delta_layer=delta;
257  x_layer=*i_test;
258  }
259  }
260  }
261  if (n_layer>0) {// compatible hit found in this layer increase n_hits
262  n_hits+=1;
263  current_x=x_layer;
264  pat+=(1<<l_test);
265  l_current=l_test;
266  if (l_start<4&&l_test>=4&&delta_layer<dMO){
267  dMO=delta_layer;
268  }else if (l_start<2&&l_test>=2&&l_test<4&&delta_layer<dMM) {
269  dMM=delta_layer;
270  } else if (l_start>=4&&l_start<5&&l_test>=6&&delta_layer<dMM) {
271  dMM=delta_layer;
272  }
273  }
274  ATH_MSG_DEBUG("patfinder: l_test = "<< l_test << " n_layer= "<< n_layer
275  << " x= " << current_x << " pat= " << (std::bitset<8>)pat);
276  }
277  // if longest pattern found, update result
278  if (n_hits>n_max) {
279  n_max=n_hits;
280  result_x=*i_start;
281  result_pat=pat;
282  result_dMO=dMO;
283  result_dMM=dMM;
284  result_x1=current_x;
285  }else if (n_hits==n_max) {
286  // if same lenght but smallest dMM/dMO, update result
287  if (dMM<result_dMM||(dMM==result_dMM&&dMO<result_dMO)){
288  result_x=*i_start;
289  result_pat=pat;
290  result_dMO=dMO;
291  result_dMM=dMM;
292  result_x1=current_x;
293  }
294  }
295  }
296  }
297  if (n_max>2) {
298  ATH_MSG_DEBUG("patfinder: BEST pat= " << (std::bitset<8>)result_pat
299  <<" dMM= "<<result_dMM <<" dMO= "<<result_dMO
300  <<" x0= "<<result_x <<" x1= "<<result_x1);
301  }
302  return n_max;
303 
304 }

◆ patfinder_forEta()

int TrigL2MuonSA::RpcPatFinder::patfinder_forEta ( bool  iphi,
unsigned int &  result_pat,
double  result_aw[],
double  result_bw[],
double  result_dist[],
const TrigL2MuonSA::RpcLayerHits rpcLayerHits 
) const
private

Definition at line 91 of file RpcPatFinder.cxx.

96  {
97 
98  const std::vector<std::list<double>> * rpc_x;
99  rpc_x = &rpcLayerHits.hits_in_layer_eta;
100 
101  int layer_end;
102  if(rpc_x->at(6).size()+rpc_x->at(7).size() >0) layer_end = 7;//special "feet" towers
103  else layer_end = 5;
104 
105  // reset parameters
106  result_pat=0;
107 
108  int n_max=0;
109  size_t index[8]={};
110  size_t result_index[8]={};
111 
112  // Loop on start layer
113  for (int l_start=0; l_start<layer_end; l_start++){
114  for(int i=0; i<8; i++) index[i]=0;
115 
116  // Loop on hits of start layer, for each hit try a new pattern
117  for (std::list<double>::const_iterator i_start=rpc_x->at(l_start).begin(); i_start!=rpc_x->at(l_start).end(); ++i_start){
118  int n_hits=1;
119  unsigned int pat=(1<<l_start); // bit pattern of hit layers
120  double dMO=9999; // disstance middle-outer station
121  double dMM=9999; // distance RPC1-RPC2 on middle stations
122  double current_x =*i_start; // set current_x to the starting hit
123  int l_current = l_start;
124 
125  index[0] = std::distance(rpc_x->at(l_start).begin(), i_start);//mod!
126 
127  ATH_MSG_DEBUG("patfinder: l_start = "<< l_start << " x= " << current_x
128  << " pat= " << (std::bitset<8>) pat);
129 
130  // ----- add compatible hits in other layers ----//
131  // loop on test layers:
132  for (int l_test=l_start+1; l_test<=layer_end; l_test++){
133  int n_layer=0;
134  double x_layer=0;
135  double delta_layer=999;
136  // loop on hits of test layer and picks the one with smaller distance from current_x
137  for (std::list<double>::const_iterator i_test=rpc_x->at(l_test).begin(); i_test!=rpc_x->at(l_test).end(); ++i_test){
138  double delta=-1;
139  // check if within the road
140  if (deltaOK(l_current,l_test,current_x,*i_test,iphi,delta)){
141  n_layer++;
142  // if closest hit update x_layer
143  if (delta<delta_layer) {
144  delta_layer=delta;
145  x_layer=*i_test;
146  index[l_test] = std::distance(rpc_x->at(l_test).begin(), i_test);//mod!
147  }
148  }
149  }//for i_test
150  if (n_layer>0) {// compatible hit found in this layer increase n_hits
151  n_hits+=1;
152  current_x=x_layer;
153  pat+=(1<<l_test);
154  l_current=l_test;
155  if (l_start<4&&l_test>=4&&delta_layer<dMO){
156  dMO=delta_layer;
157  }else if (l_start<2&&l_test>=2&&l_test<4&&delta_layer<dMM) {
158  dMM=delta_layer;
159  } else if (l_start>=4&&l_start<5&&l_test>=6&&delta_layer<dMM) {
160  dMM=delta_layer;
161  }
162  }// if (n_layer)
163 
164  ATH_MSG_DEBUG("patfinder: l_test = "<< l_test << " n_layer= "<< n_layer
165  << " x= " << current_x << " pat= " << (std::bitset<8>)pat);
166  }//for l_test
167 
168  // if longest pattern found, update result
169  if (n_hits>n_max) {
170  n_max=n_hits;
171  result_pat=pat;
172  result_dist[2]=dMO;
173  result_dist[1]=dMM;
174  for(int i=0; i<8; i++) result_index[i]=index[i];
175  }else if (n_hits==n_max) {
176  // if same lenght but smallest dMM/dMO, update result
177  if (dMM<result_dist[1]||(dMM==result_dist[1]&&dMO<result_dist[2])){
178  result_pat=pat;
179  result_dist[2]=dMO;
180  result_dist[1]=dMM;
181  for(int i=0; i<8; i++) result_index[i]=index[i];
182  }
183  }
184  }//for i_start
185  }//for l_start
186 
187  if (n_max>=2) {
188  abcal(result_pat, result_index, result_aw, result_bw, rpcLayerHits);
189  ATH_MSG_DEBUG("patfinder: BEST pat= " << (std::bitset<8>)result_pat
190  <<" dMM= "<<result_dist[1] <<" dMO= "<<result_dist[2]);
191 
192  }//if(n_max>2)
193 
194  return n_max;
195 }//patfinder_forEta()

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

◆ 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_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:
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TrigL2MuonSA::RpcPatFinder::patfinder_forEta
int patfinder_forEta(bool iphi, unsigned int &result_pat, double result_aw[], double result_bw[], double result_dist[], const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
Definition: RpcPatFinder.cxx:91
IDTPM::R
float R(const U &p)
Definition: TrackParametersHelper.h:101
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
index
Definition: index.py:1
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
createCablingJSON.doubletR
int doubletR
Definition: createCablingJSON.py:10
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
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Phi
@ Phi
Definition: RPCdef.h:8
TrigL2MuonSA::RpcPatFinder::abcal
void abcal(unsigned int result_pat, size_t index[], double aw[], double bw[], const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
Definition: RpcPatFinder.cxx:411
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
x
#define x
TrigL2MuonSA::RpcLayerHits::hits_in_layer_Z
std::vector< std::vector< double > > hits_in_layer_Z
Definition: RpcPatFinder.h:23
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
skel.l2
l2
Definition: skel.GENtoEVGEN.py:426
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigL2MuonSA::RpcPatFinder::patfinder
int patfinder(bool iphi, unsigned int &result_pat, double &result_x, double &result_x1, double &result_dMO, const TrigL2MuonSA::RpcLayerHits &rpcLayerHits) const
Definition: RpcPatFinder.cxx:200
lumiFormat.i
int i
Definition: lumiFormat.py:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigL2MuonSA::RpcLayerHits::hits_in_layer_eta
std::vector< std::list< double > > hits_in_layer_eta
Definition: RpcPatFinder.h:21
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
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
ZERO_LIMIT
const float ZERO_LIMIT
Definition: VP1TriggerHandleL2.cxx:37
TrigL2MuonSA::RpcPatFinder::calibR
double calibR(const std::string &stationName, double R, double Phi) const
Definition: RpcPatFinder.cxx:382
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
dso-stats.pat
pat
Definition: dso-stats.py:39
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
TrigL2MuonSA::RpcPatFinder::deltaOK
bool deltaOK(int l1, int l2, double x1, double x2, int isphi, double &delta) const
Definition: RpcPatFinder.cxx:309
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TrigL2MuonSA::RpcLayerHits::hits_in_layer_phi
std::vector< std::list< double > > hits_in_layer_phi
Definition: RpcPatFinder.h:22
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
skel.l1
l1
Definition: skel.GENtoEVGEN.py:425
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
TrigL2MuonSA::RpcLayerHits::hits_in_layer_R
std::vector< std::vector< double > > hits_in_layer_R
Definition: RpcPatFinder.h:24
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
fitman.k
k
Definition: fitman.py:528