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

#include <CscSegmentMaker.h>

Inheritance diagram for TrigL2MuonSA::CscSegmentMaker:
Collaboration diagram for TrigL2MuonSA::CscSegmentMaker:

Classes

struct  local2dSegment
 
struct  localCscHit
 

Public Member Functions

 CscSegmentMaker (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
ReturnCode FindSuperPointCsc (const TrigL2MuonSA::CscHits &cscHits, std::vector< TrigL2MuonSA::TrackPattern > &v_trackPatterns, const TrigL2MuonSA::TgcFitResult &tgcFitResult, const TrigL2MuonSA::MuonRoad &muroad) const
 
ReturnCode make_segment (int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager *muDetMgr) const
 
ReturnCode make_2dsegment (int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], local2dSegment &seg2d_eta, local2dSegment &local2d_noip, int &nhite) const
 
ReturnCode make_2dseg4hit (int measphi, const localCscHit &ip_loc, std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhite) const
 
ReturnCode make_2dseg3hit (int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhit) const
 
ReturnCode fit_clusters (int measphi, const std::vector< localCscHit > &hits_fit, local2dSegment &seg2d) const
 
ReturnCode make_4dsegment (const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi, Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir) const
 
ReturnCode getModuleSP (int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]) const
 
ReturnCode display_hits (const std::vector< localCscHit > localHits[4]) const
 
CscSegment segmentAtFirstLayer (int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) 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

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

UtilTools m_util
 
ToolHandle< CscRegDictm_cscregdict
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
SG::ReadCondHandleKey< MuonGM::MuonDetectorManagerm_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}
 
Gaudi::Property< bool > m_use_geometry
 
Gaudi::Property< double > m_max_chisquare
 
Gaudi::Property< double > m_max_residual_eta
 
Gaudi::Property< double > m_max_residual_phi
 
Gaudi::Property< double > m_err_eta
 
Gaudi::Property< double > m_err_phi
 
Gaudi::Property< double > m_err_ip
 
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 30 of file CscSegmentMaker.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

◆ CscSegmentMaker()

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

Definition at line 20 of file CscSegmentMaker.cxx.

22  m_util()
23 {
24 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

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

◆ declareGaudiProperty() [4/4]

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

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

Definition at line 199 of file AthCommonDataStore.h.

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

◆ declareProperty() [1/6]

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

Declare a new Gaudi property.

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

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

Definition at line 245 of file AthCommonDataStore.h.

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

◆ declareProperty() [2/6]

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

Declare a new Gaudi property.

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

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

Definition at line 221 of file AthCommonDataStore.h.

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

◆ declareProperty() [3/6]

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

Definition at line 259 of file AthCommonDataStore.h.

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

◆ declareProperty() [4/6]

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

Declare a new Gaudi property.

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

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

Definition at line 333 of file AthCommonDataStore.h.

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

◆ declareProperty() [5/6]

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

Declare a new Gaudi property.

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

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

Definition at line 352 of file AthCommonDataStore.h.

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

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ display_hits()

ReturnCode TrigL2MuonSA::CscSegmentMaker::display_hits ( const std::vector< localCscHit localHits[4]) const

Definition at line 650 of file CscSegmentMaker.cxx.

651 {
652  for(unsigned int ilyr=0; ilyr<4; ++ilyr){
653  for (unsigned int ihit=0; ihit<localHits[ilyr].size(); ++ihit) {
654  const localCscHit &locHit = localHits[ilyr][ihit];
655  ATH_MSG_DEBUG("measphi=" << locHit.measphi << " wirelyr=" << ilyr+1
656  << " x=" << locHit.loc_x << " y=" << locHit.loc_y << " z=" << locHit.loc_z
657  << " err=" << locHit.error << " res=" << locHit.residual);
658  }
659  }
660 
661  return ReturnCode::SUCCESS;
662 }

◆ 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

◆ FindSuperPointCsc()

ReturnCode TrigL2MuonSA::CscSegmentMaker::FindSuperPointCsc ( const TrigL2MuonSA::CscHits cscHits,
std::vector< TrigL2MuonSA::TrackPattern > &  v_trackPatterns,
const TrigL2MuonSA::TgcFitResult tgcFitResult,
const TrigL2MuonSA::MuonRoad muroad 
) const

Definition at line 35 of file CscSegmentMaker.cxx.

39 {
40  ATH_MSG_DEBUG( "FindSuperPointCsc" );
42  const MuonGM::MuonDetectorManager* muDetMgr = muDetMgrHandle.cptr();
43 
44  if( !cscHits.empty() ){
45 
46  for (TrigL2MuonSA::TrackPattern& track : v_trackPatterns) { // loop for track candidates
47 
48  //get module hash to read
49  int hash_clusters[32]={0};
50 
52  for(unsigned int iclu=0; iclu<cscHits.size(); ++iclu){
53  const TrigL2MuonSA::CscHitData &cscHit = cscHits[iclu];
54 
55  //outlier or not
56  double width = (cscHit.MeasuresPhi == 0 ) ? m_max_residual_eta : m_max_residual_phi;
57  if ( width < std::abs(cscHit.Residual) ) continue;
58 
59 
60  int cathodelayer = 2*(cscHit.WireLayer-1)+ cscHit.MeasuresPhi;//cathodelayer is in [0,7]
61  int module_hash = m_cscregdict->get_hash(cscHit.StationName, cscHit.StationEta, cscHit.StationPhi);
62 
63  if(0<=module_hash && 32>module_hash){
64  clusters[module_hash][cathodelayer].push_back( cscHit );
65  hash_clusters[module_hash]=1;//set modules to read
66  }else{
67  continue;
68  }
69  }//for clusters
70 
71 
72  //decide which module to read
73  int hashSPs[2]={999,999};
74  if( getModuleSP( hashSPs, tgcFitResult, track.phiBin, muroad, hash_clusters)!=ReturnCode::FAILURE ){
75 
76  bool found_segment=false;
77  for(int ihash=0; ihash<2; ++ihash){
78  if(found_segment) break;//once a segment is found, then finish searching more
79 
80  int hashSP=hashSPs[ihash];
81  if(hashSP>32) continue;
82 
83  //making segment
84  CscSegment cscsegment, cscsegment_noip;
85  if (this->make_segment(hashSP, clusters[hashSP] , cscsegment, cscsegment_noip, muDetMgr) != ReturnCode::FAILURE ){
86  found_segment=true;
87  track.hashID_CSC = hashSP;
88 
91  TrigL2MuonSA::SuperPoint* superPoint = &(track.superPoints[csc]);
92  const TrigL2MuonSA::SuperPoint* outerSP = &(track.superPoints[outer]);
93  bool &large_dphidz = track.large_dPhidZ;
94  double &outerCorFactor = track.outerCorFactor;
95 
96  //tgcfitresult
97  double tgcmid1z = tgcFitResult.tgcMid1[3];
98  double tgcmid2z = tgcFitResult.tgcMid2[3];
99  double phimiddle = tgcFitResult.phi;
100  double dPhidz = tgcFitResult.dPhidZ;
101  if( 0.75e-6<std::abs(dPhidz) ) large_dphidz=true;
102  double tgcmidZ = (tgcmid1z+tgcmid2z)/2.;
103  double outerz = outerSP->Z;
104 
105  //calculate SP
106  CscSegment cscsegment_ext = segmentAtFirstLayer(hashSP, &cscsegment);
107  double phiMod = m_cscregdict->phiMod(hashSP);
108  double CSCR=cscsegment_ext.x()*std::cos(phiMod)+cscsegment_ext.y()*std::sin(phiMod);
109  double CSCZ=cscsegment_ext.z();
110  double PhiAtCsc = phimiddle/* - std::abs(CSCZ-tgcmidZ)*dPhidz*/;
111  double CSCSPR = CSCR/std::cos( m_util.calc_dphi(PhiAtCsc,phiMod) );
112 
113 
114  superPoint->Z = CSCZ;
115  superPoint->R = CSCSPR;
116  superPoint->Alin = cscsegment_ext.slopeRZ();
117  superPoint->Blin = cscsegment_ext.interceptRZ();
118  superPoint->Npoint = cscsegment_ext.nHitEta();
119  superPoint->Chi2 = cscsegment_ext.chiSquare();
120  ATH_MSG_DEBUG("CSC super point:hashID=" << hashSP
121  << ",CSCR=" << CSCSPR << ",CSCZ=" << CSCZ
122  << ",Slope=" << cscsegment_ext.slopeRZ() << ",Intercept=" << cscsegment_ext.interceptRZ()
123  << ",nHitsEta=" << cscsegment_ext.nHitEta() << ",Chi2="<< cscsegment_ext.chiSquare());
124 
125  //calculate outerSP's correction (dphidz of tgcFitResult)
126  double phiouter = phimiddle+std::abs(outerz-tgcmidZ)*dPhidz;
127  outerCorFactor = std::cos( m_util.calc_dphi(phiouter,phiMod) )/std::cos( m_util.calc_dphi(phimiddle,phiMod) );
128  ATH_MSG_DEBUG("outerCorFactor=" << outerCorFactor);
129 
130  }//if there is a segment.
131  }//ihash loop over modules in which segment will be made
132  }//if there is the module in which segment will be made.
133  }//loop over track pattern candidate
134  }//if there are clusters, then make a segment
135 
136 
137  return ReturnCode::SUCCESS;
138 }

◆ fit_clusters()

ReturnCode TrigL2MuonSA::CscSegmentMaker::fit_clusters ( int  measphi,
const std::vector< localCscHit > &  hits_fit,
local2dSegment seg2d 
) const

Definition at line 453 of file CscSegmentMaker.cxx.

453  {
454 
455 
456  double S=0.;
457  double Sx=0.;
458  double Sy=0.;
459  double aStt=0.;
460  int nhit=0;
461  int nhit_with_ip=0;
462  double Stt=0.;
463  double Syy=0.;
464  double Sxx=0.;
465  double Sxy=0.;
466  double a = 0.;
467  double b = 0.;
468  double rp=0.;
469  double rq=0.;
470  double aver_res=0.;
471 
472 
473  for (unsigned int ihit=0; ihit< hits_fit.size(); ++ihit) {
474 
475 
476  double x= hits_fit[ihit].loc_z;
477  double y= (measphi==0) ? hits_fit[ihit].loc_y : hits_fit[ihit].loc_x;
478  double err= hits_fit[ihit].error;
479  double w = 1./(err*err);
480  // ATH_MSG_DEBUG("local pos, z=" << hits_fit[ihit].loc_z << ", x,y=" << y << ", err=" << err << ", w=" << w << ", res=" << hits_fit[ihit].residual << ", measphi="<< hits_fit[ihit].measphi);
481  S += w;
482  Sx += w*x;
483  Sy += w*y;
484  if( !hits_fit[ihit].isIP ){
485  seg2d.stationname=hits_fit[ihit].stationname;
486  aver_res += w*hits_fit[ihit].residual;
487  rq += w;
488  rp += w*x;
489  ++nhit;
490  }
491  ++nhit_with_ip;
492  }//ihit
493  seg2d.zshift=rp/rq;
494 
495  seg2d.residual=aver_res/rq;
496 
497 
498  for (unsigned int ihit=0; ihit< hits_fit.size(); ++ihit) {
499 
500  double x= hits_fit[ihit].loc_z;
501  double y= (measphi==0) ? hits_fit[ihit].loc_y : hits_fit[ihit].loc_x;
502  double err = hits_fit[ihit].error;
503  double w = 1./(err*err);// (ihit==0)?0.25:100.;//
504  Stt += w*(x-Sx/S)*(x-Sx/S);
505  aStt += w*y*(x-Sx/S);
506  Sxx += w*x*x;
507  Syy += w*y*y;
508  Sxy += w*x*y;
509 
510  }//ihit
511 
512 
513 
514  if(nhit_with_ip>1){
515  a = seg2d.a = aStt/Stt;
516  b = seg2d.b = (Sy-Sx*a)/S;
517  seg2d.nhit = nhit;
518 
519  }else{
520  return ReturnCode::FAILURE;
521  }
522  seg2d.chi2 = Syy + a*a*Sxx + 2*b*a*Sx + b*b*S - 2*b*Sy - 2*a*Sxy;
523 
524  ATH_MSG_DEBUG( "fit: a=" << a << " b=" << b << " chi2=" << seg2d.chi2 );
525 
526  return ReturnCode::SUCCESS;
527 }

◆ getModuleSP()

ReturnCode TrigL2MuonSA::CscSegmentMaker::getModuleSP ( int  mod_hash[2],
const TrigL2MuonSA::TgcFitResult tgcFitResult,
int  phibin,
const TrigL2MuonSA::MuonRoad muroad,
const int  exist_clusters[32] 
) const

Definition at line 578 of file CscSegmentMaker.cxx.

583 {
584  ATH_MSG_DEBUG("getModuleSP()");
585 
586 
587  for(unsigned int imod=0; imod<32;++imod){
588 
589  if( 0==hash_clusters[imod] ) continue;
590  int stationeta = m_cscregdict->stationEta(imod);
591  int side = (muroad.side) ? 1 : -1;
592  double phiMod = m_cscregdict->phiMod(imod);
593  double dphi = m_util.calc_dphi(phiMod, tgcFitResult.phi);
594  ATH_MSG_DEBUG("getModuleSP()::(phi,side) modlue:(" << phiMod << "," << stationeta << ") tgcroad:(" << tgcFitResult.phi << "," << side << ")");
595  if( std::abs(dphi)>M_PI/8. || side != stationeta) continue;
596 
597 
598  if(7!=phibin){
599 
600  if(imod<16 && phibin>7){//small normal
601  mod_hashes[0]=imod;
602  } else if( imod >=16 && phibin<7){//large normal
603  mod_hashes[0]=imod;
604  } else {//overlap
605  mod_hashes[1]=imod;
606  }
607 
608  } else if (7==phibin) {
609 
610  if(imod<16 && 1==muroad.LargeSmall ){//small normal
611  mod_hashes[0]=imod;
612  } else if( imod >=16 && 0== muroad.LargeSmall){//large normal
613  mod_hashes[0]=imod;
614  } else {//overlap
615  mod_hashes[1]=imod;
616  }
617 
618  }
619  }//for imod
620  ATH_MSG_DEBUG("getModuleSP::Normal sector=" << mod_hashes[0] << " overlap sector=" << mod_hashes[1]);
621 
622  return ReturnCode::SUCCESS;
623 
624 
625 }

◆ initialize()

StatusCode TrigL2MuonSA::CscSegmentMaker::initialize ( )
overridevirtual

Definition at line 27 of file CscSegmentMaker.cxx.

27  {
28  ATH_CHECK(m_cscregdict.retrieve());
30  ATH_CHECK(m_idHelperSvc.retrieve());
31  return StatusCode::SUCCESS;
32 }

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

◆ make_2dseg3hit()

ReturnCode TrigL2MuonSA::CscSegmentMaker::make_2dseg3hit ( int  measphi,
const localCscHit ip_loc,
const std::vector< localCscHit hits_loc[4],
std::vector< local2dSegment > &  seg2d_4hitCollection,
int &  nhit 
) const

Definition at line 392 of file CscSegmentMaker.cxx.

396 {
397 
398  int empty_lyr=-1;
399  int nohit=0;
400  for (int ilyr=0; ilyr<4; ++ilyr ){
401  if( 0==hits_loc[ilyr].size() ){
402  ++nohit;
403  empty_lyr=ilyr;
404  }
405  }
406 
407  if ( 1<nohit ) return ReturnCode::SUCCESS;
408 
409  std::vector<localCscHit> hit_fit;
410 
411 
412  int hit_lyrA[4] = {1, 2, 3, 0};
413  int hit_lyrB[4] = {2, 3, 0, 1};
414  int hit_lyrC[4] = {3, 0, 1, 2};
415 
416  for(int lyrcomb=0; lyrcomb<4; ++lyrcomb){
417 
418  if(0<=empty_lyr && empty_lyr!=lyrcomb) continue;
419 
420  for (unsigned int ihitA=0; ihitA<hits_loc[hit_lyrA[lyrcomb]].size(); ++ihitA) {
421  for (unsigned int ihitB=0; ihitB<hits_loc[hit_lyrB[lyrcomb]].size(); ++ihitB) {
422  for (unsigned int ihitC=0; ihitC<hits_loc[hit_lyrC[lyrcomb]].size(); ++ihitC) {
423 
424  hit_fit.clear();
425  hit_fit.push_back(ip_loc);
426  hit_fit.push_back(hits_loc[hit_lyrA[lyrcomb]][ihitA]);
427  hit_fit.push_back(hits_loc[hit_lyrB[lyrcomb]][ihitB]);
428  hit_fit.push_back(hits_loc[hit_lyrC[lyrcomb]][ihitC]);
429 
430  //fit clusters
431  local2dSegment seg2d_tmp;
432 
433  if( this->fit_clusters(measphi,hit_fit,seg2d_tmp)!=ReturnCode::SUCCESS ) continue;//for eta
434 
435  if(seg2d_tmp.chi2<2.0*m_max_chisquare/3.0){
436  seg2d_tmp.localHits.push_back(hits_loc[hit_lyrA[lyrcomb]][ihitA]);
437  seg2d_tmp.localHits.push_back(hits_loc[hit_lyrB[lyrcomb]][ihitB]);
438  seg2d_tmp.localHits.push_back(hits_loc[hit_lyrC[lyrcomb]][ihitC]);
439  seg2d_3hitCollection.push_back(seg2d_tmp);
440  ATH_MSG_DEBUG("3hitsegment was made");
441  }
442  }
443  }
444  }
445  }//loop over layer combination
446  nhit=3;
447 
448 
449  return ReturnCode::SUCCESS;
450 }

◆ make_2dseg4hit()

ReturnCode TrigL2MuonSA::CscSegmentMaker::make_2dseg4hit ( int  measphi,
const localCscHit ip_loc,
std::vector< localCscHit hits_loc[4],
std::vector< local2dSegment > &  seg2d_4hitCollection,
int &  nhite 
) const

Definition at line 325 of file CscSegmentMaker.cxx.

329 {
330 
331  std::vector<localCscHit> hit_fit;
332 
333  for (unsigned int ihit0=0; ihit0<hits_loc[0].size(); ++ihit0) {
334  for (unsigned int ihit1=0; ihit1<hits_loc[1].size(); ++ihit1) {
335  for (unsigned int ihit2=0; ihit2<hits_loc[2].size(); ++ihit2) {
336  for (unsigned int ihit3=0; ihit3<hits_loc[3].size(); ++ihit3) {
337 
338  // set clusters
339  hit_fit.clear();
340  hit_fit.push_back(ip_loc);
341  hit_fit.push_back(hits_loc[0][ihit0]);
342  hit_fit.push_back(hits_loc[1][ihit1]);
343  hit_fit.push_back(hits_loc[2][ihit2]);
344  hit_fit.push_back(hits_loc[3][ihit3]);
345 
346  //segment fit
347  local2dSegment seg2d_tmp;
348  if( this->fit_clusters(measphi,hit_fit,seg2d_tmp)!=ReturnCode::SUCCESS ) continue;
349 
350 
351  if(seg2d_tmp.chi2<m_max_chisquare){
352  seg2d_tmp.localHits.push_back(hits_loc[0][ihit0]);
353  seg2d_tmp.localHits.push_back(hits_loc[1][ihit1]);
354  seg2d_tmp.localHits.push_back(hits_loc[2][ihit2]);
355  seg2d_tmp.localHits.push_back(hits_loc[3][ihit3]);
356  //disable hits
357  hits_loc[0][ihit0].enabled=false;
358  hits_loc[1][ihit1].enabled=false;
359  hits_loc[2][ihit2].enabled=false;
360  hits_loc[3][ihit3].enabled=false;
361 
362  seg2d_4hitCollection.push_back(seg2d_tmp);
363  ATH_MSG_DEBUG("4hitsegment was made");
364  }
365 
366  }
367  }
368  }
369  }//loop over all combination of 4hits
370 
371 
372  //make vector of hits left unused
373  std::vector<localCscHit> hit_loc_left[4];
374  for (unsigned int ilyr=0;ilyr<4; ++ilyr){
375  for(unsigned int ihit=0; ihit < hits_loc[ilyr].size(); ++ihit){
376 
377  if ( true==hits_loc[ilyr][ihit].enabled ){
378  hit_loc_left[ilyr].push_back(hits_loc[ilyr][ihit]);
379  }
380  }//loop over hits in layer
381  }//loop over wire layer
382 
383  for(int ilyr=0; ilyr<4; ++ilyr) hits_loc[ilyr]=hit_loc_left[ilyr];//copying "objects" of vector
384 
385  nhit=4;
386 
387  return ReturnCode::SUCCESS;
388 
389 }

◆ make_2dsegment()

ReturnCode TrigL2MuonSA::CscSegmentMaker::make_2dsegment ( int  measphi,
const localCscHit ip_loc,
const std::vector< localCscHit hits_loc[4],
local2dSegment seg2d_eta,
local2dSegment local2d_noip,
int &  nhite 
) const

Definition at line 260 of file CscSegmentMaker.cxx.

264 {
265 
266  int nohit=0;
267  std::vector<int> hit_lyr;
268  hit_lyr.clear();
269 
270  //counting layers without clusters
271  for (int i=0; i<4; ++i ){
272  if( 0==hits_loc[i].size() ) ++nohit;
273  }
274 
275  std::vector<local2dSegment> seg2d_4hitCollection,seg2d_3hitCollection;
276  seg2d_4hitCollection.clear(); seg2d_3hitCollection.clear();
277  std::vector<localCscHit> hits_loc_copy[4];
278  for (int i=0;i<4;++i) hits_loc_copy[i] = hits_loc[i];
279 
280 
281  if(0==nohit){
282 
283  if( this->make_2dseg4hit(measphi, ip_loc, hits_loc_copy, seg2d_4hitCollection, nhit)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
284  //hits already used are removed in hits_loc_copy
285  ATH_MSG_DEBUG("display hits left");
286  display_hits(hits_loc_copy);
287  if( this->make_2dseg3hit(measphi, ip_loc, hits_loc_copy, seg2d_3hitCollection, nhit)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
288 
289  } else if(1==nohit) {
290 
291  if( this->make_2dseg3hit(measphi, ip_loc, hits_loc_copy, seg2d_3hitCollection, nhit)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
292 
293  } else {
294  return ReturnCode::FAILURE;
295  }
296 
297  //select the segment nearest to tgcroad.
298  bool exist=false;
299  seg2d.residual=99999.;
300  for(unsigned int iseg4=0; iseg4< seg2d_4hitCollection.size(); ++iseg4){
301 
302  if( std::abs( seg2d_4hitCollection[iseg4].residual ) < std::abs(seg2d.residual) ){
303  seg2d=seg2d_4hitCollection[iseg4];
304  exist=true;
305  ATH_MSG_DEBUG("seg2d.residual=" << seg2d.residual);
306  }
307  }
308  for(unsigned int iseg3=0; iseg3< seg2d_3hitCollection.size(); ++iseg3){
309 
310  if( std::abs( seg2d_3hitCollection[iseg3].residual ) < std::abs(seg2d.residual) ){
311  seg2d=seg2d_3hitCollection[iseg3];
312  exist=true;
313  ATH_MSG_DEBUG("seg2d.residual=" << seg2d.residual);
314  }
315  }
316 
317  if(false==exist) return ReturnCode::FAILURE;
318 
319  if( this->fit_clusters(measphi,seg2d.localHits,seg2d_ipremoved)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
320 
321  return ReturnCode::SUCCESS;
322 
323 }

◆ make_4dsegment()

ReturnCode TrigL2MuonSA::CscSegmentMaker::make_4dsegment ( const local2dSegment seg2d_eta,
const local2dSegment seg2d_phi,
Amg::Vector3D seg_pos,
Amg::Vector3D seg_dir 
) const

Definition at line 531 of file CscSegmentMaker.cxx.

535 {
536 
537  int nhit_e=seg2d_eta.nhit;
538  int nhit_p=seg2d_phi.nhit;
539  double a_eta=seg2d_eta.a;
540  double b_eta=seg2d_eta.b;
541  double a_phi=seg2d_phi.a;
542  double b_phi=seg2d_phi.b;
543  double rzshift=seg2d_eta.zshift;
544  double phizshift=seg2d_phi.zshift;
545 
546 
547  if (nhit_e<2 || nhit_p<2 ) return ReturnCode::FAILURE;
548 
549 
550 
551  ATH_MSG_DEBUG("rzshift=" << rzshift << " phizshift=" << phizshift << " diff=" << (rzshift-phizshift)
552  << " angle=" << ( 0.5*M_PI - std::atan(a_phi) ) << " b_phi=" << b_phi /*<< " Newb_phi=" << Newb_phi*/ );
553 
554 
555  double norm = std::sqrt( a_phi*a_phi + a_eta*a_eta + 1 );
556 
557 
558 
559  seg_dir = Amg::Vector3D(a_phi/norm, a_eta/norm, 1./norm);
560  ATH_MSG_DEBUG("segdir_loc (px,py,pz)=" << "(" << seg_dir(Amg::px) << "," << seg_dir(Amg::py) << "," << seg_dir(Amg::pz) << ") a_eta="
561  << a_eta << " a_phi=" << a_phi << " chi2_eta=" << seg2d_eta.chi2 << " chi2_phi=" << seg2d_phi.chi2 );
562 
563  double aver_z=0.5*(rzshift+phizshift);
564 
565 
566  ATH_MSG_DEBUG(" new aver_z=" << aver_z );
567  seg_pos = Amg::Vector3D(seg_dir(Amg::px)*aver_z/seg_dir(Amg::pz) + b_phi, seg_dir(Amg::py)*aver_z/seg_dir(Amg::z) + b_eta, aver_z);
568 
569  ATH_MSG_DEBUG( "myseg_loc (x,y,z,px,py,pz)=(" << seg_pos(Amg::x) << "," << seg_pos(Amg::y) << "," << seg_pos(Amg::z)
570  << "," << seg_dir(Amg::px) << "," << seg_dir(Amg::py) << "," << seg_dir(Amg::pz) << ")");
571 
572  return ReturnCode::SUCCESS;
573 
574 }

◆ make_segment()

ReturnCode TrigL2MuonSA::CscSegmentMaker::make_segment ( int  mod_hash,
TrigL2MuonSA::CscHits  clusters[8],
CscSegment cscsegment,
CscSegment cscsegment_noip,
const MuonGM::MuonDetectorManager muDetMgr 
) const

Definition at line 143 of file CscSegmentMaker.cxx.

146 {
147  ATH_MSG_DEBUG("################################## make_segment #####################################");
148 
149  std::vector<localCscHit> hits_loc_eta[4], hits_loc_phi[4],emp;
150  emp.clear();
151  for(int i =0;i<4;++i){
152  hits_loc_eta[i]=emp;
153  hits_loc_phi[i]=emp;
154  }
155 
156 
157 
158  Amg::Transform3D gToLocal;
159  if(m_use_geometry){
160  Identifier Id = m_idHelperSvc->cscIdHelper().channelID(m_cscregdict->stationName(mod_hash), m_cscregdict->stationEta(mod_hash),m_cscregdict->stationPhi(mod_hash),2/*chamberLayer*/, 1, 0, 1);
161  const MuonGM::CscReadoutElement *csc = muDetMgr->getCscReadoutElement(Id);
162  if (csc == NULL){
163  ATH_MSG_DEBUG( "Csc Readout Element not found ---- skip");
164  return ReturnCode::FAILURE;
165  }
166  ATH_MSG_DEBUG("CscReadoutElement");
167  gToLocal = csc->GlobalToAmdbLRSTransform();
168  }else{
169  double rotpi = (m_cscregdict->stationEta(mod_hash)>0) ? -M_PI/2. : M_PI/2.;
170  Amg::AngleAxis3D rotZamg( (-1)*(m_cscregdict->phiMod(mod_hash)), Amg::Vector3D(0,0,1));
171  Amg::AngleAxis3D rotYamg( (-1)*(m_cscregdict->actualAtanNormal(mod_hash)), Amg::Vector3D(0,1,0) );
172  Amg::AngleAxis3D rotPIamg( rotpi, Amg::Vector3D(0,0,1));
173  Amg::Translation3D translation( 0.0, 0.0, (-1)*(m_cscregdict->displacement(mod_hash)) );
174  gToLocal=translation*rotPIamg*rotYamg*rotZamg;
175  }
176 
177 
178  localCscHit ip_loc;
179  Amg::Vector3D ip_vec = gToLocal*Amg::Vector3D(0.0, 0.0, 0.0);
180  ip_loc.loc_x = ip_vec(Amg::x);
181  ip_loc.loc_y = ip_vec(Amg::y);
182  ip_loc.loc_z = ip_vec(Amg::z);
183  ip_loc.measphi = -1;
184  ip_loc.error = m_err_ip;
185  ip_loc.residual = 0.;
186  ip_loc.isIP = true;
187  ip_loc.enabled = false;
188  ip_loc.stationname = 0;
189 
190  for (unsigned int clyr=0; clyr<8; ++clyr) {
191  for (unsigned int ihit=0; ihit<clusters[clyr].size(); ++ihit) {
192 
193  TrigL2MuonSA::CscHitData &cschit = clusters[clyr][ihit];
194  double r = cschit.r;
195  double phi = cschit.phi;
196  double z = cschit.z;
197 
198  //move to local coordinate system
200  Amg::Vector3D loc_vect = gToLocal*vect;
201 
202  //building localCscHit object
203  localCscHit loc_hit;
204  loc_hit.loc_x = loc_vect(Amg::x);
205  loc_hit.loc_y = loc_vect(Amg::y);
206  loc_hit.loc_z = loc_vect(Amg::z);
207  loc_hit.measphi=cschit.MeasuresPhi;
208  loc_hit.error = (loc_hit.measphi==0) ? m_err_eta : m_err_phi;
209  loc_hit.residual = cschit.Residual;
210  loc_hit.enabled=true;
211  loc_hit.isIP=false;
212  loc_hit.stationname=cschit.StationName;
213  ATH_MSG_DEBUG( "measphi=" << cschit.MeasuresPhi << " wirelyr=" << cschit.WireLayer << " x=" << loc_hit.loc_x << " y=" << loc_hit.loc_y << " z=" << loc_hit.loc_z << " err=" << loc_hit.error << " res=" << loc_hit.residual);
214 
215 
216  if(0==loc_hit.measphi) {
217  if(m_max_residual_eta>std::abs(loc_hit.residual)) hits_loc_eta[cschit.WireLayer-1].push_back( loc_hit );
218  }
219  if(1==loc_hit.measphi) {
220  if(m_max_residual_phi>std::abs(loc_hit.residual)) hits_loc_phi[cschit.WireLayer-1].push_back( loc_hit );
221  }
222  }//ihit
223  }//clyr
224 
225  Amg::Vector3D seg_pos_loc, seg_dir_loc,seg_pos_loc_noip, seg_dir_loc_noip;
226  int nhite=0,nhitp=0;
227  local2dSegment seg2d_eta ,seg2d_phi, seg2d_eta_noip, seg2d_phi_noip;
228 
229 
230  if( this->make_2dsegment( 0/*=measphi*/, ip_loc, hits_loc_eta, seg2d_eta, seg2d_eta_noip, nhite)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
231  if( this->make_2dsegment( 1/*=measphi*/, ip_loc, hits_loc_phi, seg2d_phi,seg2d_phi_noip, nhitp)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
232 
233 
234  ATH_MSG_DEBUG("==include IP==");
235  if( this->make_4dsegment(seg2d_eta,seg2d_phi,seg_pos_loc,seg_dir_loc)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
236  ATH_MSG_DEBUG("==exclude IP==");
237  if( this->make_4dsegment(seg2d_eta_noip,seg2d_phi_noip,seg_pos_loc_noip,seg_dir_loc_noip)!=ReturnCode::SUCCESS ) return ReturnCode::FAILURE;
238 
239 
240  Amg::Transform3D lToGlobal = gToLocal.inverse();
241  Amg::Vector3D seg_pos = lToGlobal*seg_pos_loc;
242  Amg::Vector3D seg_dir = lToGlobal.rotation()*seg_dir_loc;
243  Amg::Vector3D seg_pos_noip = lToGlobal*seg_pos_loc_noip;
244  Amg::Vector3D seg_dir_noip = lToGlobal.rotation()*seg_dir_loc_noip;
245 
246 
247  //building CscSegment objects
248  cscsegment.set(seg_pos,seg_dir, seg2d_eta.chi2, seg2d_phi.chi2);
249  cscsegment.setNHitEta(seg2d_eta.nhit);
250  cscsegment.setNHitPhi(seg2d_phi.nhit);
251  cscsegment_noip.set(seg_pos_noip,seg_dir_noip, seg2d_eta_noip.chi2, seg2d_phi_noip.chi2);
252  cscsegment_noip.setNHitEta(seg2d_eta_noip.nhit);
253  cscsegment_noip.setNHitPhi(seg2d_phi_noip.nhit);
254 
255 
256  return ReturnCode::SUCCESS;
257 }

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

◆ segmentAtFirstLayer()

CscSegment TrigL2MuonSA::CscSegmentMaker::segmentAtFirstLayer ( int  mod_hash,
TrigL2MuonSA::CscSegment mu_seg 
) const

Definition at line 628 of file CscSegmentMaker.cxx.

628  {
629 
630 
631  double alpha = m_cscregdict->displacement(mod_hash);
632  Amg::Vector3D n = m_cscregdict->nomalVector(mod_hash);
633  double a0=mu_seg->px(), a1=mu_seg->py(), a2=mu_seg->pz();
634  double b0=mu_seg->x(), b1=mu_seg->y(),b2=mu_seg->z();
635  double t = ( alpha-(n(0)*b0+n(1)*b1+n(2)*b2) )/( n(0)*a0+n(1)*a1+n(2)*a2 );
636  double x0=a0*t+b0,x1=a1*t+b1,x2=a2*t+b2;
637  double chisquare=mu_seg->chiSquare();
638  double chisquare_phi=mu_seg->chiSquarePhi();
639 
640  CscSegment cscsegment;
641  cscsegment.set(x0,x1,x2,a0,a1,a2,chisquare, chisquare_phi);
642  cscsegment.setNHitEta(mu_seg->nHitEta());
643  cscsegment.setNHitPhi(mu_seg->nHitPhi());
644 
645  return cscsegment;
646 }

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

ToolHandle<CscRegDict> TrigL2MuonSA::CscSegmentMaker::m_cscregdict
private
Initial value:
{
this, "CscRegDict", "TrigL2MuonSA::CscRegDict", ""}

Definition at line 92 of file CscSegmentMaker.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_err_eta

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_err_eta
private
Initial value:
{
this, "err_eta", 3., ""}

Definition at line 106 of file CscSegmentMaker.h.

◆ m_err_ip

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_err_ip
private
Initial value:
{
this, "err_ip", 250., ""}

Definition at line 110 of file CscSegmentMaker.h.

◆ m_err_phi

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_err_phi
private
Initial value:
{
this, "err_phi", 6., ""}

Definition at line 108 of file CscSegmentMaker.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_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> TrigL2MuonSA::CscSegmentMaker::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 94 of file CscSegmentMaker.h.

◆ m_max_chisquare

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_max_chisquare
private
Initial value:
{
this, "max_chisquare", 25., ""}

Definition at line 100 of file CscSegmentMaker.h.

◆ m_max_residual_eta

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_max_residual_eta
private
Initial value:
{
this, "max_residual_eta", 100., ""}

Definition at line 102 of file CscSegmentMaker.h.

◆ m_max_residual_phi

Gaudi::Property< double > TrigL2MuonSA::CscSegmentMaker::m_max_residual_phi
private
Initial value:
{
this, "max_residual_phi", 250., ""}

Definition at line 104 of file CscSegmentMaker.h.

◆ m_muDetMgrKey

SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> TrigL2MuonSA::CscSegmentMaker::m_muDetMgrKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"}
private

Definition at line 95 of file CscSegmentMaker.h.

◆ m_use_geometry

Gaudi::Property< bool > TrigL2MuonSA::CscSegmentMaker::m_use_geometry
private
Initial value:
{
this, "UseGeometry", false, ""}

Definition at line 98 of file CscSegmentMaker.h.

◆ m_util

UtilTools TrigL2MuonSA::CscSegmentMaker::m_util
private

Definition at line 91 of file CscSegmentMaker.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::CscSegmentMaker::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: CscSegmentMaker.h:94
beamspotman.r
def r
Definition: beamspotman.py:676
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TrigL2MuonSA::CscHitData
Definition: CscData.h:14
TrigL2MuonSA::ReturnCode::SUCCESS
@ SUCCESS
Definition: CscRegUtils.h:134
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
TrigL2MuonSA::CscSegmentMaker::make_2dseg4hit
ReturnCode make_2dseg4hit(int measphi, const localCscHit &ip_loc, std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhite) const
Definition: CscSegmentMaker.cxx:325
TrigL2MuonSA::CscSegmentMaker::make_2dseg3hit
ReturnCode make_2dseg3hit(int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], std::vector< local2dSegment > &seg2d_4hitCollection, int &nhit) const
Definition: CscSegmentMaker.cxx:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
TrigL2MuonSA::CscHitData::phi
double phi
Definition: CscData.h:26
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
TrigL2MuonSA::CscSegmentMaker::make_4dsegment
ReturnCode make_4dsegment(const local2dSegment &seg2d_eta, const local2dSegment &seg2d_phi, Amg::Vector3D &seg_pos, Amg::Vector3D &seg_dir) const
Definition: CscSegmentMaker.cxx:531
ClusterSeg::residual
@ residual
Definition: ClusterNtuple.h:20
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigL2MuonSA::CscSegmentMaker::fit_clusters
ReturnCode fit_clusters(int measphi, const std::vector< localCscHit > &hits_fit, local2dSegment &seg2d) const
Definition: CscSegmentMaker.cxx:453
TrigL2MuonSA::CscSegmentMaker::m_err_eta
Gaudi::Property< double > m_err_eta
Definition: CscSegmentMaker.h:106
TrigL2MuonSA::CscHitData::StationEta
int StationEta
Definition: CscData.h:16
TrigL2MuonSA::ReturnCode::FAILURE
@ FAILURE
Definition: CscRegUtils.h:133
TrigL2MuonSA::CscSegmentMaker::m_max_chisquare
Gaudi::Property< double > m_max_chisquare
Definition: CscSegmentMaker.h:100
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TrigL2MuonSA::CscSegment::py
double py()
Definition: CscSegmentMaker.h:126
TrigL2MuonSA::CscSegment::nHitPhi
int nHitPhi()
Definition: CscSegmentMaker.h:135
MuonGM::MuonReadoutElement::GlobalToAmdbLRSTransform
virtual Amg::Transform3D GlobalToAmdbLRSTransform() const
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonReadoutElement.cxx:153
TrigL2MuonSA::CscHitData::StationName
unsigned int StationName
Definition: CscData.h:15
Amg::y
@ y
Definition: GeoPrimitives.h:35
TrigL2MuonSA::CscSegment::y
double y()
Definition: CscSegmentMaker.h:123
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
TrigL2MuonSA::CscSegmentMaker::m_muDetMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muDetMgrKey
Definition: CscSegmentMaker.h:95
MuonGM::CscReadoutElement
Definition: CscReadoutElement.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TrigL2MuonSA::CscHits
std::vector< CscHitData > CscHits
Definition: CscData.h:40
x
#define x
JetTiledMap::S
@ S
Definition: TiledEtaPhiMap.h:44
TrigL2MuonSA::CscSegment::chiSquare
double chiSquare()
Definition: CscSegmentMaker.h:130
TrigL2MuonSA::SuperPoint::Blin
float Blin
Definition: SuperPointData.h:106
TrigL2MuonSA::SuperPoint::R
float R
Definition: SuperPointData.h:102
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
TrigL2MuonSA::MuonRoad::side
int side
Definition: MuonRoad.h:76
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TrigL2MuonSA::CscHitData::StationPhi
int StationPhi
Definition: CscData.h:17
TrigL2MuonSA::TrackPattern
Definition: TrackData.h:16
TRT::Hit::side
@ side
Definition: HitInfo.h:83
TrigL2MuonSA::CscSegmentMaker::m_max_residual_phi
Gaudi::Property< double > m_max_residual_phi
Definition: CscSegmentMaker.h:104
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
TrigL2MuonSA::CscHitData::WireLayer
int WireLayer
Definition: CscData.h:19
TrigL2MuonSA::UtilTools::calc_dphi
double calc_dphi(double phi1, double phi2) const
Definition: CscRegUtils.cxx:229
TrigL2MuonSA::CscSegmentMaker::getModuleSP
ReturnCode getModuleSP(int mod_hash[2], const TrigL2MuonSA::TgcFitResult &tgcFitResult, int phibin, const TrigL2MuonSA::MuonRoad &muroad, const int exist_clusters[32]) const
Definition: CscSegmentMaker.cxx:578
Amg::z
@ z
Definition: GeoPrimitives.h:36
TrigL2MuonSA::CscHitData::MeasuresPhi
int MeasuresPhi
Definition: CscData.h:20
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
WriteCellNoiseToCool.exist
exist
Definition: WriteCellNoiseToCool.py:543
TrigL2MuonSA::SuperPoint::Chi2
float Chi2
Definition: SuperPointData.h:109
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
TrigL2MuonSA::CscSegment::z
double z()
Definition: CscSegmentMaker.h:124
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigL2MuonSA::CscSegmentMaker::m_use_geometry
Gaudi::Property< bool > m_use_geometry
Definition: CscSegmentMaker.h:98
Amg::x
@ x
Definition: GeoPrimitives.h:34
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::px
@ px
Definition: GeoPrimitives.h:38
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::CscSegmentMaker::m_max_residual_eta
Gaudi::Property< double > m_max_residual_eta
Definition: CscSegmentMaker.h:102
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigL2MuonSA::TgcFitResult::tgcMid1
float tgcMid1[4]
Definition: TgcFitResult.h:45
TrigL2MuonSA::CscSegment::pz
double pz()
Definition: CscSegmentMaker.h:127
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
a0
double a0
Definition: globals.cxx:27
TrigL2MuonSA::CscSegmentMaker::m_err_phi
Gaudi::Property< double > m_err_phi
Definition: CscSegmentMaker.h:108
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
TrigL2MuonSA::CscHitData::r
double r
Definition: CscData.h:27
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TrigL2MuonSA::CscSegmentMaker::make_segment
ReturnCode make_segment(int mod_hash, TrigL2MuonSA::CscHits clusters[8], CscSegment &cscsegment, CscSegment &cscsegment_noip, const MuonGM::MuonDetectorManager *muDetMgr) const
Definition: CscSegmentMaker.cxx:143
TrigL2MuonSA::TgcFitResult::dPhidZ
double dPhidZ
Definition: TgcFitResult.h:71
TrigL2MuonSA::CscSegmentMaker::m_util
UtilTools m_util
Definition: CscSegmentMaker.h:91
Amg::py
@ py
Definition: GeoPrimitives.h:39
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TrigL2MuonSA::CscSegment::nHitEta
int nHitEta()
Definition: CscSegmentMaker.h:133
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TrigL2MuonSA::CscSegmentMaker::m_cscregdict
ToolHandle< CscRegDict > m_cscregdict
Definition: CscSegmentMaker.h:92
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
TrigL2MuonSA::CscHitData::z
double z
Definition: CscData.h:28
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigL2MuonSA::TgcFitResult::phi
double phi
Definition: TgcFitResult.h:70
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigL2MuonSA::CscSegment::px
double px()
Definition: CscSegmentMaker.h:125
TrigL2MuonSA::CscSegment::chiSquarePhi
double chiSquarePhi()
Definition: CscSegmentMaker.h:131
TrigL2MuonSA::MuonRoad::LargeSmall
int LargeSmall
Definition: MuonRoad.h:77
TrigL2MuonSA::CscSegmentMaker::display_hits
ReturnCode display_hits(const std::vector< localCscHit > localHits[4]) const
Definition: CscSegmentMaker.cxx:650
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigL2MuonSA::CscSegmentMaker::make_2dsegment
ReturnCode make_2dsegment(int measphi, const localCscHit &ip_loc, const std::vector< localCscHit > hits_loc[4], local2dSegment &seg2d_eta, local2dSegment &local2d_noip, int &nhite) const
Definition: CscSegmentMaker.cxx:260
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:49
TrigL2MuonSA::SuperPoint::Npoint
int Npoint
Definition: SuperPointData.h:97
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
TrigL2MuonSA::CscSegmentMaker::segmentAtFirstLayer
CscSegment segmentAtFirstLayer(int mod_hash, TrigL2MuonSA::CscSegment *mu_seg) const
Definition: CscSegmentMaker.cxx:628
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TrigL2MuonSA::SuperPoint::Z
float Z
Definition: SuperPointData.h:103
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TrigL2MuonSA::SuperPoint
Definition: SuperPointData.h:74
Amg::AngleAxis3D
Eigen::AngleAxisd AngleAxis3D
Definition: GeoPrimitives.h:45
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
CSC
@ CSC
Definition: RegSelEnums.h:34
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
rp
ReadCards * rp
Definition: IReadCards.cxx:26
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
TrigL2MuonSA::CscHitData::Residual
double Residual
Definition: CscData.h:33
TrigL2MuonSA::CscSegment::x
double x()
Definition: CscSegmentMaker.h:122
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
TrigL2MuonSA::CscSegmentMaker::m_err_ip
Gaudi::Property< double > m_err_ip
Definition: CscSegmentMaker.h:110
fitman.k
k
Definition: fitman.py:528