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 654 of file CscSegmentMaker.cxx.

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

◆ 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 456 of file CscSegmentMaker.cxx.

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

◆ 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 581 of file CscSegmentMaker.cxx.

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

◆ 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 394 of file CscSegmentMaker.cxx.

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

◆ 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 327 of file CscSegmentMaker.cxx.

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

◆ 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 262 of file CscSegmentMaker.cxx.

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

◆ 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 534 of file CscSegmentMaker.cxx.

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

◆ 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 144 of file CscSegmentMaker.cxx.

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

◆ 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 631 of file CscSegmentMaker.cxx.

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

◆ 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
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
beamspotman.r
def r
Definition: beamspotman.py:676
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
TrigL2MuonSA::CscHitData
Definition: CscData.h:14
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:327
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:394
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
TrigL2MuonSA::CscHitData::phi
double phi
Definition: CscData.h:26
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:534
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:456
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::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
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TRT::Hit::side
@ side
Definition: HitInfo.h:83
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
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:581
Amg::z
@ z
Definition: GeoPrimitives.h:36
TrigL2MuonSA::CscHitData::MeasuresPhi
int MeasuresPhi
Definition: CscData.h:20
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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:182
TrigL2MuonSA::CscSegment::z
double z()
Definition: CscSegmentMaker.h:124
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TrigL2MuonSA::ReturnCode::FAILURE
@ FAILURE
Definition: CscRegUtils.h:133
MuonGM::MuonDetectorManager::getCscReadoutElement
const CscReadoutElement * getCscReadoutElement(const Identifier &id) const
access via extended identifier (requires unpacking)
Definition: MuonDetDescr/MuonReadoutGeometry/src/MuonDetectorManager.cxx:225
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
MuonR4::SegmentFit::ParamDefs::x0
@ x0
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:144
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:228
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:654
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:262
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:50
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:631
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:623
TrigL2MuonSA::SuperPoint::Z
float Z
Definition: SuperPointData.h:103
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:798
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::ReturnCode::SUCCESS
@ SUCCESS
Definition: CscRegUtils.h:134
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
Identifier
Definition: IdentifierFieldParser.cxx:14