Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
NSWL1::StripSegmentTool Class Reference

interface for the StripTDS tools More...

#include <StripSegmentTool.h>

Inheritance diagram for NSWL1::StripSegmentTool:
Collaboration diagram for NSWL1::StripSegmentTool:

Public Member Functions

 StripSegmentTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~StripSegmentTool ()=default
 
virtual StatusCode initialize () override
 
virtual StatusCode find_segments (std::vector< std::unique_ptr< StripClusterData > > &, const std::unique_ptr< Muon::NSW_TrigRawDataContainer > &) const override
 
StatusCode FetchDetectorEnvelope (Envelope_t &env) 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

uint8_t findRIdx (const float val, const Envelope_t &env) const
 
uint8_t findDtheta (const float) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
 
SG::ReadCondHandleKey< IRegSelLUTCondDatam_regSelTableKey {this, "RegSelLUT", "RegSelLUTCondData_sTGC", "sTGC Region Selector lookup table"}
 
Gaudi::Property< std::string > m_sTgcSdoContainer {this, "sTGC_SdoContainerName", "sTGC_SDO", "Name of the sTGC SDO digit container"}
 
Gaudi::Property< int > m_rIndexBits {this, "rIndexBits", 8, "Number bits in R-index calculation"}
 
Gaudi::Property< int > m_dThetaBits {this, "dthetaBits", 5, "Number bits in dTheta calculation"}
 
Gaudi::Property< float > m_dtheta_min {this, "dthetaMin", -15., "Minimum allowed value for dtheta in mrad"}
 
Gaudi::Property< float > m_dtheta_max {this, "dthetaMax", 15., "Maximum allowed value for dtheta in mrad"}
 
Gaudi::Property< int > m_ridxScheme {this, "rIndexScheme", 1, "rIndex slicing scheme/ 0-->R / 1-->eta"}
 
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

interface for the StripTDS tools

This class implements the Strip Clustering offline simulation. It loops over the hits, readout from the StripTDSOffLineTool

Author
Jacob Searcy jsear.nosp@m.cy@c.nosp@m.ern.c.nosp@m.h

Definition at line 65 of file StripSegmentTool.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

◆ StripSegmentTool()

NSWL1::StripSegmentTool::StripSegmentTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 11 of file StripSegmentTool.cxx.

11  :
13  {
14  declareInterface<NSWL1::IStripSegmentTool>(this);
15  }

◆ ~StripSegmentTool()

virtual NSWL1::StripSegmentTool::~StripSegmentTool ( )
virtualdefault

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

◆ FetchDetectorEnvelope()

StatusCode NSWL1::StripSegmentTool::FetchDetectorEnvelope ( Envelope_t env) const

Definition at line 26 of file StripSegmentTool.cxx.

26  {
27  const MuonGM::MuonDetectorManager* p_det;
28  ATH_CHECK(detStore()->retrieve(p_det));
30  const auto regSelector = dynamic_cast<const RegSelSiLUT*>(rh_stgcLUT->payload());
31  std::vector<const RegSelModule*> moduleList;
32  for(const auto& i : m_idHelperSvc->stgcIdHelper().idVector()) { // all modules
33  IdentifierHash moduleHashId;
34  m_idHelperSvc->stgcIdHelper().get_module_hash(i, moduleHashId);
35  moduleList.push_back(regSelector->Module(moduleHashId));
36  }
37  float etamin=-1;
38  float etamax=-1;
39  float rmin=-1;
40  float rmax=-1;
41  float zmin=-1;
42  float zmax=-1;
43  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->_etaMin()) < std::abs(M2->_etaMin());} );
44  etamin=moduleList.at(0)->_etaMin();
45  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->_etaMax()) > std::abs(M2->_etaMax());} );
46  etamax=moduleList.at(0)->_etaMax();
47  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->rMin()) < std::abs(M2->rMin());} );
48  rmin=moduleList.at(0)->rMin();
49  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->rMax()) > std::abs(M2->rMax());} );
50  rmax=moduleList.at(0)->rMax();
51  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->zMin()) < std::abs(M2->zMin());} );
52  zmin=moduleList.at(0)->zMin();
53  std::sort(moduleList.begin(),moduleList.end(),[](const auto& M1,const auto& M2){ return std::abs(M1->zMax()) > std::abs(M2->zMax());} );
54  zmax=moduleList.at(0)->zMax();
55 
56  if(rmin<=0 || rmax<=0) ATH_MSG_WARNING("Unable to fetch NSW r/z boundaries");
57  env.lower_r = rmin;
58  env.upper_r = rmax;
59  env.lower_eta = etamin;
60  env.upper_eta = etamax;
61  env.lower_z = zmin;
62  env.upper_z = zmax;
63  ATH_MSG_DEBUG("rmin=" << rmin << " rmax=" << rmax << " zmin=" << zmin << " zmax=" << zmax << " etamin=" << etamin << " etamax=" << etamax);
64  return StatusCode::SUCCESS;
65  }

◆ find_segments()

StatusCode NSWL1::StripSegmentTool::find_segments ( std::vector< std::unique_ptr< StripClusterData > > &  clusters,
const std::unique_ptr< Muon::NSW_TrigRawDataContainer > &  trgContainer 
) const
overridevirtual

Implements NSWL1::IStripSegmentTool.

Definition at line 99 of file StripSegmentTool.cxx.

100  {
101  Envelope_t envelope;
102  ATH_CHECK(FetchDetectorEnvelope(envelope));
103 
104  if (clusters.empty()) {
105  ATH_MSG_WARNING("Received event with no clusters. Skipping...");
106  return StatusCode::SUCCESS;
107  }
108 
109  std::map<uint32_t, std::vector<std::unique_ptr<StripClusterData>>[2] > cluster_map; // gather clusters by hash_bandid and seperate in wedge
110 
111  int sectorid=-1; // [1,8]
112  int sideid=-1; // sideid==0: C
113  int sectorNumber=-1; // [1,16]
114  int hash=-1; // [1,32]
115 
116  int bandId=-1; // bandId is different for large and small sector type, the same for side / specific sector
117 
118  for(auto& cl : clusters){
119  // combine the side, sectortype, sectorid to form the hash
120  sideid=cl->sideId();
121  sectorid=cl->sectorId();
122  if(cl->isSmall()) sectorNumber=2*sectorid;
123  else sectorNumber=2*sectorid-1;
124  hash=16*sideid+sectorNumber;
125 
126  bandId=cl->bandId();
127 
128 
129  std::string id_str=std::to_string(hash)+"000"+std::to_string(bandId); // [1,32]*1000 + [0,90](could be extended in the future), the 1000 factor promise there's no confusion, such as '1'+'12" and '11'+'2'
130  uint32_t hash_bandid=atoi(id_str.c_str());
131 
132  // use the clusters in 2 wedges, with the same bandId, to form the sector segment
133  /*****************************************************************************************************/
134  auto item =cluster_map.find(hash_bandid);
135  if (item != cluster_map.end()){
136  item->second[cl->wedge()-1].push_back(std::move(cl));
137  }
138  else{
139  cluster_map[hash_bandid][cl->wedge()-1].push_back(std::move(cl));
140  }
141  }
142 
143  ATH_MSG_DEBUG(" Building NSW Segment RDO at hash=" << hash);
144 
145  for(const auto& band : cluster_map){//main band loop
146  int bandId=band.first;
147  if (band.second[0].size() == 0){
148  ATH_MSG_WARNING("Cluster size is zero for inner wedge trg with bandId "<<bandId<<"...skipping");
149  continue;
150  }
151  if(band.second[1].size() == 0){
152  ATH_MSG_WARNING("Cluster size is zero for outer wedge trg with bandId "<<bandId<<"...skipping");
153  continue;
154  }
155  float glx1=0;
156  float gly1=0;
157  float glx2=0;
158  float gly2=0;
159  float charge1=0;
160  float charge2=0;
161 
162  float eta=0;
163  float phi=0;
164  float theta=0;
165  float theta_inf=0;
166  float dtheta=0;
167  float eta_inf=0;
168 
169  // First measurement, corresponding to the inner wedge
170  float z1=0;
171  uint16_t sectorID = 0, bcID = 0;
172  char sectorSide = '-';
173  for( const auto& cl : band.second[0] ){
174  z1+=cl->globZ()*cl->charge();
175  glx1+=cl->globX()*cl->charge();
176  gly1+=cl->globY()*cl->charge();
177  charge1+=cl->charge();
178  sectorID = (cl->isSmall()) ? 2*cl->sectorId()-1 : 2*(cl->sectorId()-1);
179  sectorSide = (cl->sideId() == 0) ? 'C' : 'A';
180  bcID = cl->BCID();
181  }
182  auto trgRawData=std::make_unique< Muon::NSW_TrigRawData>(sectorID, sectorSide, bcID);
183 
184  // Second measurement, corresponding to the outer wedge
185  float z2=0;
186  for( const auto& cl : band.second[1] ){
187  z2+=cl->globZ()*cl->charge();
188  glx2+=cl->globX()*cl->charge();
189  gly2+=cl->globY()*cl->charge();
190  charge2+=cl->charge();
191  sectorID = (cl->isSmall()) ? 2*cl->sectorId()-1 : 2*(cl->sectorId()-1);
192  sectorSide = (cl->sideId() == 0) ? 'C' : 'A';
193  bcID = cl->BCID();
194  if (( sectorID != trgRawData->sectorId() ) ||
195  ( sectorSide != trgRawData->sectorSide() ) ||
196  ( bcID != trgRawData->bcId() )) ATH_MSG_WARNING("Possible mismatch between inner and outer wedge RDO parameters");
197  }
198  if(charge1!=0){
199  z1=z1/charge1;
200  glx1=glx1/charge1;
201  gly1=gly1/charge1;
202  }
203  if(charge2!=0){
204  z2=z2/charge2;
205  glx2=glx2/charge2;
206  gly2=gly2/charge2;
207  }
208 
209  //segment calc
210  ROOT::Math::XYZVector v3_centr1(glx1,gly1,z1), v3_centr2(glx2,gly2,z2);
211  ROOT::Math::XYZVector v3_segment = v3_centr2 - v3_centr1;
212  phi=v3_segment.Phi();
213  theta=v3_segment.Theta();
214  eta=v3_segment.Eta();
215 
216  //inf momentum track
217  theta_inf=v3_centr1.Theta();
218  eta_inf=v3_centr1.Eta();
219  dtheta=(theta-theta_inf)*1000;//In Milliradian
220 
221  ATH_MSG_DEBUG("StripSegmentTool: phi:" << phi << " theta:" << theta << " eta: " << eta << " theta_inf: " << theta_inf << " eta_inf: " << eta_inf << " dtheta: " << dtheta);
222 
223  //do not get confused. this one is trigger phiId
224  int phiId=band.second[0].at(0)->phiId();
225 
226  float rfar=envelope.upper_z*std::abs(std::tan(theta_inf));
227 
228  if( rfar >= envelope.upper_r || rfar < envelope.lower_r || std::abs(eta_inf) >= envelope.upper_eta || std::abs(eta_inf) < envelope.lower_eta){
229  ATH_MSG_WARNING("measured r/eta is out of detector envelope!");
230  return StatusCode::SUCCESS;
231  }
232 
233  uint8_t rIndex=0;
234  switch(m_ridxScheme) {
235  case 0:
236  rIndex=findRIdx(rfar, envelope);
237  break;
238  case 1:
239  rIndex=findRIdx(std::abs(eta_inf), envelope);
240  break;
241  default:
242  break;
243  }
244 
245  bool phiRes=true;
246  bool lowRes=false;//we do not have a recipe for a singlewedge trigger. so lowres is always false for now
247  uint8_t dtheta_int=findDtheta(dtheta);
248 
249  //However it needs to be kept an eye on... will be something in between 7 and 15 mrad needs to be decided
250  if(std::abs(dtheta)>15) continue;
251  auto rdo_segment= std::make_unique<Muon::NSW_TrigRawDataSegment>( dtheta_int, (uint8_t)phiId, (rIndex), lowRes, phiRes);
252  trgRawData->push_back(std::move(rdo_segment));
253  trgContainer->push_back(std::move(trgRawData));
254 
255  }//end of clmap loop
256  return StatusCode::SUCCESS;
257  }

◆ findDtheta()

uint8_t NSWL1::StripSegmentTool::findDtheta ( const float  val) const
private

Definition at line 90 of file StripSegmentTool.cxx.

90  {
91  uint8_t nbins_dtheta=1<<m_dThetaBits;
92  float step_dtheta=(m_dtheta_max-m_dtheta_min)/nbins_dtheta;
93  for(uint8_t i=0;i<nbins_dtheta;++i) {
94  if(val<m_dtheta_min+i*step_dtheta) return i;
95  }
96  return 0;
97  }

◆ findRIdx()

uint8_t NSWL1::StripSegmentTool::findRIdx ( const float  val,
const Envelope_t env 
) const
private

Definition at line 67 of file StripSegmentTool.cxx.

67  {
68  unsigned int nSlices=(1<<m_rIndexBits); //256
69  std::pair<float,float> range;
70  switch(m_ridxScheme){
71  case 0:
72  range=std::make_pair(env.lower_r, env.upper_r);
73  break;
74  case 1:
75  range=std::make_pair(env.lower_eta, env.upper_eta);
76  break;
77  default:
78  break;
79  }
80  float step=(range.second-range.first)/nSlices;
81 
82  // the cases with val<=range.first or val>=range.second have been abandoned before
83  for(uint8_t i=0;i<nSlices;i++) {
84  if(range.first+i*step <= val && val < range.first+(i+1)*step) return i;
85  }
86  ATH_MSG_ERROR( "StripSegmentTool: findRIdx failed!");
87  return 0;
88  }

◆ initialize()

StatusCode NSWL1::StripSegmentTool::initialize ( )
overridevirtual

Definition at line 17 of file StripSegmentTool.cxx.

17  {
18  ATH_MSG_DEBUG("initializing " << name() );
19  ATH_MSG_DEBUG(name() << " configuration:");
20 
21  ATH_CHECK(m_idHelperSvc.retrieve());
22  ATH_CHECK(m_regSelTableKey.initialize());
23  return StatusCode::SUCCESS;
24  }

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

◆ interfaceID()

static const InterfaceID& NSWL1::IStripSegmentTool::interfaceID ( )
inlinestaticinherited

Definition at line 37 of file IStripSegmentTool.h.

37  {
38  static const InterfaceID IID_IStripSegmentTool("NSWL1::IStripSegmentTool", 1 ,0);
39  return IID_IStripSegmentTool;
40  }

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

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_dtheta_max

Gaudi::Property<float> NSWL1::StripSegmentTool::m_dtheta_max {this, "dthetaMax", 15., "Maximum allowed value for dtheta in mrad"}
private

Definition at line 85 of file StripSegmentTool.h.

◆ m_dtheta_min

Gaudi::Property<float> NSWL1::StripSegmentTool::m_dtheta_min {this, "dthetaMin", -15., "Minimum allowed value for dtheta in mrad"}
private

Definition at line 84 of file StripSegmentTool.h.

◆ m_dThetaBits

Gaudi::Property<int> NSWL1::StripSegmentTool::m_dThetaBits {this, "dthetaBits", 5, "Number bits in dTheta calculation"}
private

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

Definition at line 78 of file StripSegmentTool.h.

◆ m_regSelTableKey

SG::ReadCondHandleKey<IRegSelLUTCondData> NSWL1::StripSegmentTool::m_regSelTableKey {this, "RegSelLUT", "RegSelLUTCondData_sTGC", "sTGC Region Selector lookup table"}
private

Definition at line 79 of file StripSegmentTool.h.

◆ m_ridxScheme

Gaudi::Property<int> NSWL1::StripSegmentTool::m_ridxScheme {this, "rIndexScheme", 1, "rIndex slicing scheme/ 0-->R / 1-->eta"}
private

Definition at line 86 of file StripSegmentTool.h.

◆ m_rIndexBits

Gaudi::Property<int> NSWL1::StripSegmentTool::m_rIndexBits {this, "rIndexBits", 8, "Number bits in R-index calculation"}
private

Definition at line 82 of file StripSegmentTool.h.

◆ m_sTgcSdoContainer

Gaudi::Property<std::string> NSWL1::StripSegmentTool::m_sTgcSdoContainer {this, "sTGC_SdoContainerName", "sTGC_SDO", "Name of the sTGC SDO digit container"}
private

Definition at line 81 of file StripSegmentTool.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
NSWL1::eta
float eta(float x, float y, float z)
Definition: GeoUtils.cxx:9
NSWL1::StripSegmentTool::findRIdx
uint8_t findRIdx(const float val, const Envelope_t &env) const
Definition: StripSegmentTool.cxx:67
NSWL1::StripSegmentTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: StripSegmentTool.h:78
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
PixelAthClusterMonAlgCfg.zmin
zmin
Definition: PixelAthClusterMonAlgCfg.py:169
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
NSWL1::StripSegmentTool::m_ridxScheme
Gaudi::Property< int > m_ridxScheme
Definition: StripSegmentTool.h:86
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
NSWL1::StripSegmentTool::m_dtheta_max
Gaudi::Property< float > m_dtheta_max
Definition: StripSegmentTool.h:85
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Envelope_t::upper_r
float upper_r
Definition: StripSegmentTool.h:43
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
NSWL1::StripSegmentTool::FetchDetectorEnvelope
StatusCode FetchDetectorEnvelope(Envelope_t &env) const
Definition: StripSegmentTool.cxx:26
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Muon::nsw::STGTPSegments::MergedSegmentProperty::phiRes
@ phiRes
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
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
NSWL1::StripSegmentTool::m_rIndexBits
Gaudi::Property< int > m_rIndexBits
Definition: StripSegmentTool.h:82
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
PixelAthClusterMonAlgCfg.zmax
zmax
Definition: PixelAthClusterMonAlgCfg.py:169
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Envelope_t::upper_z
float upper_z
Definition: StripSegmentTool.h:47
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
jobOption.theta
theta
Definition: jobOption.ParticleGun_fwd_sequence.py:13
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
NSWL1::StripSegmentTool::m_dThetaBits
Gaudi::Property< int > m_dThetaBits
Definition: StripSegmentTool.h:83
Envelope_t::lower_r
float lower_r
Definition: StripSegmentTool.h:42
NSWL1::StripSegmentTool::m_dtheta_min
Gaudi::Property< float > m_dtheta_min
Definition: StripSegmentTool.h:84
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
item
Definition: ItemListSvc.h:43
NSWL1::StripSegmentTool::findDtheta
uint8_t findDtheta(const float) const
Definition: StripSegmentTool.cxx:90
Envelope_t::upper_eta
float upper_eta
Definition: StripSegmentTool.h:45
a
TList * a
Definition: liststreamerinfos.cxx:10
h
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
MuonGM::MuonDetectorManager
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonDetectorManager.h:50
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Envelope_t::lower_eta
float lower_eta
Definition: StripSegmentTool.h:44
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:629
RegSelSiLUT
Definition: RegSelSiLUT.h:41
LArCellBinning.step
step
Definition: LArCellBinning.py:158
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Envelope_t
Definition: StripSegmentTool.h:41
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
python.DataFormatRates.env
env
Definition: DataFormatRates.py:32
NSWL1::phi
float phi(float x, float y, float z)
Definition: GeoUtils.cxx:14
LArCellBinning.etamin
etamin
Definition: LArCellBinning.py:137
dq_make_web_display.cl
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Definition: dq_make_web_display.py:26
NSWL1::StripSegmentTool::m_regSelTableKey
SG::ReadCondHandleKey< IRegSelLUTCondData > m_regSelTableKey
Definition: StripSegmentTool.h:79
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
Muon::nsw::STGTPSegments::MergedSegmentProperty::lowRes
@ lowRes
WriteBchToCool.moduleList
moduleList
Definition: WriteBchToCool.py:72
fitman.k
k
Definition: fitman.py:528
Muon::nsw::STGTPSegments::MergedSegmentProperty::rIndex
@ rIndex