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

#include <RpcDataPreparator.h>

Inheritance diagram for TrigL2MuonSA::RpcDataPreparator:
Collaboration diagram for TrigL2MuonSA::RpcDataPreparator:

Public Member Functions

 RpcDataPreparator (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 
StatusCode prepareData (const TrigRoiDescriptor *p_roids, TrigL2MuonSA::RpcHits &rpcHits, TrigL2MuonSA::RpcLayerHits &rpcLayerHits, const ToolHandle< RpcPatFinder > *rpcPatFinder, const bool dynamicDeltaRpc) const
 
StatusCode prepareData (const TrigRoiDescriptor *p_roids, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters, const ToolHandle< ClusterPatFinder > *clusterPatFinder, const bool dynamicDeltaRpc) const
 
void setRoIBasedDataAccess (bool use_RoIBasedDataAccess)
 
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

ToolHandle< IRegSelToolm_regionSelector {this,"RegSel_RPC","RegSelTool/RegSelTool_RPC"}
 
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
ToolHandle< LVL1::ITrigT1MuonRecRoiToolm_recRPCRoiTool { this, "TrigT1RPCRecRoiTool", "LVL1::TrigT1RPCRecRoiTool/TrigT1RPCRecRoiTool"}
 
SG::ReadHandleKey< Muon::RpcPrepDataContainerm_rpcPrepContainerKey
 
ToolHandle< RpcClusterPreparatorm_clusterPreparator {this, "RpcClusterPreparator", "TrigL2MuonSA::RpcClusterPreparator"}
 
bool m_use_RoIBasedDataAccess = false
 
Gaudi::Property< bool > m_emulateNoRpcHit { this, "EmulateNoRpcHit", false, "Flag for emulation of no RPC hit events" }
 
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 34 of file RpcDataPreparator.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

◆ RpcDataPreparator()

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

Definition at line 16 of file RpcDataPreparator.cxx.

18  :
20 }

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

◆ 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

◆ initialize()

StatusCode TrigL2MuonSA::RpcDataPreparator::initialize ( )
overridevirtual

Definition at line 25 of file RpcDataPreparator.cxx.

26 {
27 
28  // Locate RegionSelector
29  ATH_CHECK( m_regionSelector.retrieve() );
30 
31  ATH_CHECK( m_recRPCRoiTool.retrieve() );
32 
33  ATH_CHECK(m_idHelperSvc.retrieve());
34  ATH_MSG_DEBUG("Retrieved " << m_idHelperSvc);
35 
36  ATH_CHECK(m_rpcPrepContainerKey.initialize());
37 
38  ATH_CHECK(m_clusterPreparator.retrieve());
39  ATH_MSG_DEBUG("Retrieved service " << m_clusterPreparator);
40 
41  return StatusCode::SUCCESS;
42 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepareData() [1/2]

StatusCode TrigL2MuonSA::RpcDataPreparator::prepareData ( const TrigRoiDescriptor p_roids,
TrigL2MuonSA::RpcHits rpcHits,
TrigL2MuonSA::RpcLayerHits rpcLayerHits,
const ToolHandle< RpcPatFinder > *  rpcPatFinder,
const bool  dynamicDeltaRpc 
) const

Definition at line 55 of file RpcDataPreparator.cxx.

60 {
61  // RPC data extraction referring TrigMuonEFStandaloneTrackTool and MuonHoughPatternFinderTool
62  rpcHits.clear();
63 
64  if( m_emulateNoRpcHit )
65  return StatusCode::SUCCESS;
66 
67  const IRoiDescriptor* iroi = (IRoiDescriptor*) p_roids;
68 
69  std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
70  std::vector<IdentifierHash> rpcHashList;
71  std::vector<IdentifierHash> rpcHashListWithData;
72  std::vector<IdentifierHash> rpcHashList_cache;
73 
75 
76  ATH_MSG_DEBUG("Use RoI based data access");
77 
78  if (iroi) m_regionSelector->HashIDList(*iroi, rpcHashList);
79  else {
80  TrigRoiDescriptor fullscan_roi( true );
81  m_regionSelector->HashIDList(fullscan_roi, rpcHashList);
82  }
83  ATH_MSG_DEBUG("rpcHashList.size()=" << rpcHashList.size());
84 
85  std::vector<uint32_t> rpcRobList;
86  m_regionSelector->ROBIDList(*iroi, rpcRobList);
87  } else {
88 
89  ATH_MSG_DEBUG("Use full data access");
90 
91  TrigRoiDescriptor fullscan_roi( true );
92  m_regionSelector->HashIDList(fullscan_roi, rpcHashList);
93  ATH_MSG_DEBUG("rpcHashList.size()=" << rpcHashList.size());
94 
95  std::vector<uint32_t> rpcRobList;
96  m_regionSelector->ROBIDList(fullscan_roi, rpcRobList);
97 
98  }
99 
100  if (!rpcHashList.empty()) {
101 
102  // Get RPC container
103  const Muon::RpcPrepDataContainer* rpcPrds;
104  auto rpcPrepContainerHandle = SG::makeHandle(m_rpcPrepContainerKey);
105  rpcPrds = rpcPrepContainerHandle.cptr();
106  if (!rpcPrepContainerHandle.isValid()) {
107  ATH_MSG_ERROR("Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
108  return StatusCode::FAILURE;
109  } else {
110  ATH_MSG_DEBUG("RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
111  }
112 
113  // Get RPC collections
114  for(const IdentifierHash& id : rpcHashList) {
115  auto RPCcoll = rpcPrds->indexFindPtr(id);
116 
117  if( RPCcoll == nullptr ) {
118  continue;
119  }
120 
121  if( RPCcoll->size() == 0) {
122  ATH_MSG_DEBUG("Empty RPC list");
123  continue;
124  }
125 
126  rpcHashList_cache.push_back(id);
127  rpcCols.push_back(RPCcoll);
128  }
129  }
130 
131  for( const Muon::RpcPrepDataCollection* rpc : rpcCols ){
132 
133  rpcHits.reserve( rpcHits.size() + rpc->size() );
134  for( const Muon::RpcPrepData* prd : *rpc ) {
135 
136  const Identifier id = prd->identify();
137 
138  const int doubletR = m_idHelperSvc->rpcIdHelper().doubletR(id);
139  const int doubletPhi = m_idHelperSvc->rpcIdHelper().doubletPhi(id);
140  const int doubletZ = m_idHelperSvc->rpcIdHelper().doubletZ(id);
141  const int gasGap = m_idHelperSvc->rpcIdHelper().gasGap(id);
142  const bool measuresPhi = m_idHelperSvc->rpcIdHelper().measuresPhi(id);
143  const int stationEta = m_idHelperSvc->rpcIdHelper().stationEta(id);
144  std::string stationName = m_idHelperSvc->rpcIdHelper().stationNameString(m_idHelperSvc->rpcIdHelper().stationName(id));
145 
146  int layer = 0;
147  // BO
148  if (stationName.substr(0,2)=="BO") layer = 4;
149  // doubletR
150  layer += 2*(doubletR-1);
151  // BML7 special chamber with 1 RPC doublet (doubletR=1 but RPC2) :
152  if (stationName.substr(0,3)=="BML"&&stationEta==7) layer+=2;
153  // gasGap
154  layer += gasGap - 1;
155 
156  const Amg::Vector3D globalpos = prd->globalPosition();
157  const double hitx=globalpos.x();
158  const double hity=globalpos.y();
159  const double hitz=globalpos.z();
160 
161  const double hittime = prd->time();
162  const MuonGM::RpcReadoutElement* detEl = prd->detectorElement();
163  const double distToPhiReadout = detEl->distanceToPhiReadout(globalpos);
164  const double distToEtaReadout = detEl->distanceToEtaReadout(globalpos);
165 
166  ATH_MSG_DEBUG("Selected Rpc Collection: station name:" << stationName
167  << " global positions x/y/z=" << hitx << "/" << hity << "/" << hitz
168  << " doubletR: " << doubletR << " doubletZ: " << doubletZ << " doubletPhi " << doubletPhi
169  << " gasGap " << gasGap << " layer " << layer << " time " << hittime
170  << " distToEtaReadout " << distToEtaReadout << " distToPhiReadout " << distToPhiReadout);
171 
172  TrigL2MuonSA::RpcHitData lutDigit;
173 
174  lutDigit.x = hitx;
175  lutDigit.y = hity;
176  lutDigit.z = hitz;
177  lutDigit.time = hittime;
178  lutDigit.distToEtaReadout = distToEtaReadout;
179  lutDigit.distToPhiReadout = distToPhiReadout;
180  lutDigit.gasGap = gasGap;
181  lutDigit.doubletR = doubletR;
182  lutDigit.doubletPhi = doubletPhi;
183  lutDigit.doubletZ = doubletZ;
184  lutDigit.measuresPhi = measuresPhi;
185  lutDigit.stationName = stationName;
186  lutDigit.layer = layer;
187 
188  const float r2 = hitx*hitx+hity*hity;
189  float phi = std::atan2(hity,hitx);
190  const float l = std::sqrt(hitz*hitz+r2);
191  const float tan = std::sqrt( (l-hitz)/(l+hitz) );
192  const float eta = -std::log(tan);
193  const float deta = std::abs(p_roids->eta() - eta);
194  const float dphi = std::abs(CxxUtils::wrapToPi(p_roids->phi() - phi));
195 
196  lutDigit.eta = eta;
197  lutDigit.phi = phi;
198  lutDigit.l = l;
199  rpcHits.push_back(lutDigit);
200 
201  float deta_thr = 0.1;
202  float dphi_thr = 0.1;
203  float dynamic_add = 0.02;
204 
205  //Determine deta, dphi threshold in case of dynamicDeltaRpcMode
206  if( dynamicDeltaRpc ){
207  ATH_MSG_DEBUG("Collected RPC hits by MultiMuonTriggerMode");
208  double RoiPhiMin(0);
209  double RoiPhiMax(0);
210  double RoiEtaMin(0);
211  double RoiEtaMax(0);
212  ATH_CHECK( m_recRPCRoiTool->RoIsize(p_roids->roiWord(), RoiEtaMin, RoiEtaMax, RoiPhiMin, RoiPhiMax) );
213  ATH_MSG_DEBUG( "RoI Phi min = " << RoiPhiMin << " RoI Phi max = " << RoiPhiMax << " RoI Eta min = " << RoiEtaMin << " RoI Eta max = " << RoiEtaMax );
214  deta_thr = std::abs( RoiEtaMax - RoiEtaMin )/2. + dynamic_add;
215  dphi_thr = std::abs( std::acos( std::cos( RoiPhiMax - RoiPhiMin ) ) )/2. + dynamic_add;
216  ATH_MSG_DEBUG( "deta threshold = " << deta_thr);
217  ATH_MSG_DEBUG( "dphi threshold = " << dphi_thr);
218  }
219 
221  if ( deta<deta_thr && dphi<dphi_thr)
222  (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
223  } else {
224  if ( deta<0.15 && dphi<0.1)
225  (*rpcPatFinder)->addHit(stationName, stationEta, measuresPhi, gasGap, doubletR, hitx, hity, hitz, rpcLayerHits);
226  }
227  }
228  }
229 
230  return StatusCode::SUCCESS;
231 }

◆ prepareData() [2/2]

StatusCode TrigL2MuonSA::RpcDataPreparator::prepareData ( const TrigRoiDescriptor p_roids,
TrigL2MuonSA::RpcLayerClusters rpcLayerClusters,
const ToolHandle< ClusterPatFinder > *  clusterPatFinder,
const bool  dynamicDeltaRpc 
) const

Definition at line 236 of file RpcDataPreparator.cxx.

240 {
241  // RPC data extraction referring TrigMuonEFStandaloneTrackTool and MuonHoughPatternFinderTool
242 
243  if( m_emulateNoRpcHit )
244  return StatusCode::SUCCESS;
245 
246  const IRoiDescriptor* iroi = (IRoiDescriptor*) p_roids;
247 
248  std::vector<const Muon::RpcPrepDataCollection*> rpcCols;
249  std::vector<IdentifierHash> rpcHashList;
250  std::vector<IdentifierHash> rpcHashList_cache;
251 
253 
254  ATH_MSG_DEBUG("Use RoI based data access");
255 
256  if (iroi) m_regionSelector->HashIDList(*iroi, rpcHashList);
257  else {
258  TrigRoiDescriptor fullscan_roi( true );
259  m_regionSelector->HashIDList(fullscan_roi, rpcHashList);
260  }
261  ATH_MSG_DEBUG("rpcHashList.size()=" << rpcHashList.size());
262 
263  } else {
264 
265  ATH_MSG_DEBUG("Use full data access");
266 
267  TrigRoiDescriptor fullscan_roi( true );
268  m_regionSelector->HashIDList(fullscan_roi, rpcHashList);
269  ATH_MSG_DEBUG("rpcHashList.size()=" << rpcHashList.size());
270 
271  }
272 
273  if (!rpcHashList.empty()) {
274 
275  // Get RPC container
276  const Muon::RpcPrepDataContainer* rpcPrds;
277  auto rpcPrepContainerHandle = SG::makeHandle(m_rpcPrepContainerKey);
278  rpcPrds = rpcPrepContainerHandle.cptr();
279  if (!rpcPrepContainerHandle.isValid()) {
280  ATH_MSG_ERROR("Cannot retrieve RPC PRD Container key: " << m_rpcPrepContainerKey.key());
281  return StatusCode::FAILURE;
282  } else {
283  ATH_MSG_DEBUG("RPC PRD Container retrieved with key: " << m_rpcPrepContainerKey.key());
284  }
285 
286  // Get RPC collections
287  for(const IdentifierHash& id : rpcHashList) {
288 
289  auto RPCcoll = rpcPrds->indexFindPtr(id);
290 
291  if( RPCcoll == nullptr ) {
292  continue;
293  }
294 
295  if( RPCcoll->size() == 0) {
296  ATH_MSG_DEBUG("Empty RPC list");
297  continue;
298  }
299 
300  rpcHashList_cache.push_back(id);
301  rpcCols.push_back(RPCcoll);
302  }
303  }
304  ATH_MSG_DEBUG("Do rpc clustering");
305  ATH_CHECK( m_clusterPreparator->clusteringRPCs(dynamicDeltaRpc, rpcCols, p_roids, clusterPatFinder, rpcLayerClusters) );
306 
307  return StatusCode::SUCCESS;
308 }

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

◆ setRoIBasedDataAccess()

void TrigL2MuonSA::RpcDataPreparator::setRoIBasedDataAccess ( bool  use_RoIBasedDataAccess)

Definition at line 47 of file RpcDataPreparator.cxx.

48 {
49  m_use_RoIBasedDataAccess = use_RoIBasedDataAccess;
50 }

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

ToolHandle<RpcClusterPreparator> TrigL2MuonSA::RpcDataPreparator::m_clusterPreparator {this, "RpcClusterPreparator", "TrigL2MuonSA::RpcClusterPreparator"}
private

Definition at line 69 of file RpcDataPreparator.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_emulateNoRpcHit

Gaudi::Property< bool > TrigL2MuonSA::RpcDataPreparator::m_emulateNoRpcHit { this, "EmulateNoRpcHit", false, "Flag for emulation of no RPC hit events" }
private

Definition at line 75 of file RpcDataPreparator.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::RpcDataPreparator::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 60 of file RpcDataPreparator.h.

◆ m_recRPCRoiTool

ToolHandle<LVL1::ITrigT1MuonRecRoiTool> TrigL2MuonSA::RpcDataPreparator::m_recRPCRoiTool { this, "TrigT1RPCRecRoiTool", "LVL1::TrigT1RPCRecRoiTool/TrigT1RPCRecRoiTool"}
private

Definition at line 62 of file RpcDataPreparator.h.

◆ m_regionSelector

ToolHandle<IRegSelTool> TrigL2MuonSA::RpcDataPreparator::m_regionSelector {this,"RegSel_RPC","RegSelTool/RegSelTool_RPC"}
private

Definition at line 59 of file RpcDataPreparator.h.

◆ m_rpcPrepContainerKey

SG::ReadHandleKey<Muon::RpcPrepDataContainer> TrigL2MuonSA::RpcDataPreparator::m_rpcPrepContainerKey
private
Initial value:
{
this, "RpcPrepDataContainer", "RPC_Measurements", "Name of the RPCContainer to read in"}

Definition at line 65 of file RpcDataPreparator.h.

◆ m_use_RoIBasedDataAccess

bool TrigL2MuonSA::RpcDataPreparator::m_use_RoIBasedDataAccess = false
private

Definition at line 73 of file RpcDataPreparator.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::RpcHitData::y
double y
Definition: RpcData.h:37
TrigL2MuonSA::RpcHitData::measuresPhi
bool measuresPhi
Definition: RpcData.h:50
TrigL2MuonSA::RpcDataPreparator::m_use_RoIBasedDataAccess
bool m_use_RoIBasedDataAccess
Definition: RpcDataPreparator.h:73
test_pyathena.eta
eta
Definition: test_pyathena.py:10
Muon::MuonPrepDataContainer
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
Definition: MuonPrepDataContainer.h:42
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
TrigL2MuonSA::RpcHitData::distToEtaReadout
double distToEtaReadout
Definition: RpcData.h:40
TrigL2MuonSA::RpcHitData::doubletR
int doubletR
Definition: RpcData.h:43
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
TrigL2MuonSA::RpcHitData::stationName
std::string stationName
Definition: RpcData.h:51
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigL2MuonSA::RpcHitData::phi
double phi
Definition: RpcData.h:48
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
createCablingJSON.doubletR
int doubletR
Definition: createCablingJSON.py:10
TrigRoiDescriptor::roiWord
virtual unsigned int roiWord() const override final
Definition: TrigRoiDescriptor.h:135
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::RpcDataPreparator::m_regionSelector
ToolHandle< IRegSelTool > m_regionSelector
Definition: RpcDataPreparator.h:59
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
MCP::ScaleSmearParam::r2
@ r2
TrigL2MuonSA::RpcHitData::doubletZ
int doubletZ
Definition: RpcData.h:45
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TrigL2MuonSA::RpcHitData::l
double l
Definition: RpcData.h:49
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
TrigL2MuonSA::RpcHitData::doubletPhi
int doubletPhi
Definition: RpcData.h:44
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TrigL2MuonSA::RpcDataPreparator::m_emulateNoRpcHit
Gaudi::Property< bool > m_emulateNoRpcHit
Definition: RpcDataPreparator.h:75
TrigL2MuonSA::RpcHitData::time
double time
Definition: RpcData.h:39
TrigL2MuonSA::RpcDataPreparator::m_rpcPrepContainerKey
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_rpcPrepContainerKey
Definition: RpcDataPreparator.h:65
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
MuonGM::RpcReadoutElement::distanceToPhiReadout
double distanceToPhiReadout(const Amg::Vector3D &P) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx:223
Muon::RpcPrepData
Class to represent RPC measurements.
Definition: RpcPrepData.h:35
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigL2MuonSA::RpcHitData::z
double z
Definition: RpcData.h:38
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::RpcHitData::gasGap
int gasGap
Definition: RpcData.h:42
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TrigL2MuonSA::RpcDataPreparator::m_clusterPreparator
ToolHandle< RpcClusterPreparator > m_clusterPreparator
Definition: RpcDataPreparator.h:69
TrigL2MuonSA::RpcDataPreparator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: RpcDataPreparator.h:60
Muon::MuonPrepDataCollection
Template to hold collections of MuonPrepRawData objects.
Definition: MuonPrepDataCollection.h:46
TrigL2MuonSA::RpcHitData
Definition: RpcData.h:14
TrigL2MuonSA::RpcHitData::layer
int layer
Definition: RpcData.h:46
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TrigL2MuonSA::RpcHitData::distToPhiReadout
double distToPhiReadout
Definition: RpcData.h:41
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IdentifiableContainerMT::indexFindPtr
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
Definition: IdentifiableContainerMT.h:292
a
TList * a
Definition: liststreamerinfos.cxx:10
h
RoiDescriptor::phi
virtual double phi() const override final
Methods to retrieve data members.
Definition: RoiDescriptor.h:100
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
TrigL2MuonSA::RpcHitData::x
double x
Definition: RpcData.h:33
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
RoiDescriptor::eta
virtual double eta() const override final
Definition: RoiDescriptor.h:101
createCablingJSON.doubletPhi
int doubletPhi
Definition: createCablingJSON.py:11
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
MuonGM::RpcReadoutElement::distanceToEtaReadout
double distanceToEtaReadout(const Amg::Vector3D &P) const
Definition: MuonDetDescr/MuonReadoutGeometry/src/RpcReadoutElement.cxx:278
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:156
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
TrigL2MuonSA::RpcDataPreparator::m_recRPCRoiTool
ToolHandle< LVL1::ITrigT1MuonRecRoiTool > m_recRPCRoiTool
Definition: RpcDataPreparator.h:62
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::RpcHitData::eta
double eta
Definition: RpcData.h:47
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14