ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::TriggerChamberClusterOnTrackCreator Class Reference

Tool to cluster several trigger measurements in different gas-gaps of the same detector module. More...

#include <TriggerChamberClusterOnTrackCreator.h>

Inheritance diagram for Muon::TriggerChamberClusterOnTrackCreator:
Collaboration diagram for Muon::TriggerChamberClusterOnTrackCreator:

Public Member Functions

 TriggerChamberClusterOnTrackCreator (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TriggerChamberClusterOnTrackCreator ()=default
 
StatusCode initialize ()
 
std::unique_ptr< CompetingMuonClustersOnTrackcreateBroadCluster (const std::list< const Trk::PrepRawData * > &, const double) const
 method to create a CompetingMuonClustersOnTrack using the PrepRawData hits and a scaled factor for the errors More...
 
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

void applyClusterConsistency (std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots) const
 
std::vector< const Muon::MuonClusterOnTrack * > createPrdRots (const std::list< const Trk::PrepRawData * > &prds) const
 
void makeClustersBySurface (std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots, const std::list< const Trk::PrepRawData * > &prds, const std::vector< const Muon::MuonClusterOnTrack * > &rots) const
 
void makeOverallParameters (Trk::LocalParameters &parameters, Amg::MatrixX &errorMatrix, Trk::Surface *&surface, std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots) 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"}
 
ToolHandle< Muon::IMuonClusterOnTrackCreatorm_clusterCreator {this,"ClusterCreator","Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator"}
 
bool m_chooseBroadestCluster
 
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

Tool to cluster several trigger measurements in different gas-gaps of the same detector module.

Definition at line 32 of file TriggerChamberClusterOnTrackCreator.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

◆ TriggerChamberClusterOnTrackCreator()

Muon::TriggerChamberClusterOnTrackCreator::TriggerChamberClusterOnTrackCreator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 22 of file TriggerChamberClusterOnTrackCreator.cxx.

22  :
25 {
26  declareInterface<Muon::IMuonCompetingClustersOnTrackCreator>(this);
27  declareProperty("ChooseBroadestCluster", m_chooseBroadestCluster);
28 }

◆ ~TriggerChamberClusterOnTrackCreator()

virtual Muon::TriggerChamberClusterOnTrackCreator::~TriggerChamberClusterOnTrackCreator ( )
virtualdefault

Member Function Documentation

◆ applyClusterConsistency()

void Muon::TriggerChamberClusterOnTrackCreator::applyClusterConsistency ( std::list< int > &  limitingChannels,
std::list< const Muon::MuonClusterOnTrack * > &  limitingRots 
) const
private

Definition at line 108 of file TriggerChamberClusterOnTrackCreator.cxx.

111 {
112  // remove any clusters that will NOT contribute to the final cluster
113  int numClusters = limitingChannels.size()/2;
114  int sizeMax = 0;
115  int sizeMin = 999;
116  for (std::list<int>::iterator l = limitingChannels.begin();
117  l != limitingChannels.end() && l != std::prev(limitingChannels.end());
118  )
119  {
120  int end = *l++;
121  int beg = *l++;
122  int size = abs(end - beg);
123  if (size > sizeMax) sizeMax = size;
124  if (size < sizeMin) sizeMin = size;
125  }
126 
127  std::list<int>::iterator discard = limitingChannels.end();
128  for (std::list<int>::iterator l = limitingChannels.begin();
129  l != limitingChannels.end() && l != std::prev(limitingChannels.end());
130  )
131  {
133  int end = *l++;
134  int beg = *l++;
135  int size = abs(end - beg);
136  if (m_chooseBroadestCluster && size < sizeMax) discard = first;
137  if (! m_chooseBroadestCluster && size > sizeMin) discard = first;
138  }
139  if (discard == limitingChannels.begin())
140  {
141  ATH_MSG_VERBOSE(" discard cluster #" << 1 );
142  limitingRots.pop_front();
143  limitingRots.pop_front();
144  limitingChannels.pop_front();
145  limitingChannels.pop_front();
146  }
147  else if (discard != limitingChannels.end())
148  {
149  ATH_MSG_VERBOSE(" discard cluster #" << numClusters );
150  limitingRots.pop_back();
151  limitingRots.pop_back();
152  limitingChannels.pop_back();
153  limitingChannels.pop_back();
154  }
155 }

◆ createBroadCluster()

std::unique_ptr< CompetingMuonClustersOnTrack > Muon::TriggerChamberClusterOnTrackCreator::createBroadCluster ( const std::list< const Trk::PrepRawData * > &  prds,
const double   
) const
virtual

method to create a CompetingMuonClustersOnTrack using the PrepRawData hits and a scaled factor for the errors

Implements Muon::IMuonCompetingClustersOnTrackCreator.

Definition at line 39 of file TriggerChamberClusterOnTrackCreator.cxx.

39  {
40  ATH_MSG_VERBOSE("enter createBroadCluster: number of prds " << prds.size() );
41 
42  // make some PRD consistency checks
43  if (prds.empty()) {
44  ATH_MSG_WARNING("fails: empty PRD list ");
45  return nullptr;
46  }
47  if (!(*prds.begin())) {
48  ATH_MSG_WARNING("fails: first element of RPD list is nullptr");
49  return nullptr;
50  }
51  const Trk::TrkDetElementBase* detectorElement = (**prds.begin()).detectorElement();
52  Identifier channelId = (**prds.begin()).identify();
53  bool isRpc = m_idHelperSvc->isRpc(channelId);
54  if (!isRpc) {
55  if (!m_idHelperSvc->isTgc(channelId)) {
56  ATH_MSG_WARNING("fails: PRD must be from rpc or tgc ");
57  return nullptr;
58  }
59  }
60 
61  bool measuresPhi = isRpc && m_idHelperSvc->rpcIdHelper().measuresPhi(channelId);
62  if (!isRpc) measuresPhi = m_idHelperSvc->tgcIdHelper().isStrip(channelId);
63  for (std::list<const Trk::PrepRawData*>::const_iterator p = prds.begin(); p != prds.end(); ++p) {
64  if (!(*p)) {
65  ATH_MSG_WARNING("fails: current PrepRawData is nullptr, continuing");
66  continue;
67  }
68  channelId = (**p).identify();
69  if ((isRpc && m_idHelperSvc->rpcIdHelper().measuresPhi(channelId) != measuresPhi) || (!isRpc && m_idHelperSvc->tgcIdHelper().isStrip(channelId) != measuresPhi)) {
70  ATH_MSG_WARNING("fails: PRDs must measure same coordinate ");
71  return nullptr;
72  }
73  if ((**p).detectorElement() != detectorElement) {
74  ATH_MSG_WARNING("fails: PRDs must be from same detectorElement ");
75  return nullptr;
76  }
77  }
78 
79  // create a rot for each prd (which gets weight zero)
80  std::vector<const Muon::MuonClusterOnTrack*> rots = createPrdRots(prds);
81  auto assocProbs = std::vector<double>(rots.size(), 0.);
82 
83 
84  // for each surface, find the first and last rot forming the cluster
85  std::list<int> limitingChannels;
86  std::list<const Muon::MuonClusterOnTrack*> limitingRots;
87  makeClustersBySurface(limitingChannels,limitingRots,prds,rots);
88 
89  // cluster consistency - discard any surfaces not contributing to the final cluster
90  applyClusterConsistency(limitingChannels,limitingRots);
91 
92  // overall localPosition, error matrix and surface
94  Amg::MatrixX errorMatrix{};
95  Trk::Surface* surface = nullptr;
96  makeOverallParameters(parameters,errorMatrix,surface,limitingChannels,limitingRots);
97 
98  // clear lists
99  limitingChannels.clear();
100 
101  // return the competingMuonClusterOnTrack object containing the final parameters,
102  // error matrix, surface, list of rots and weights
103  return std::make_unique<CompetingMuonClustersOnTrack>(
104  std::move(parameters), std::move(errorMatrix), surface, std::move(rots), std::move(assocProbs));
105 }

◆ createPrdRots()

std::vector< const Muon::MuonClusterOnTrack * > Muon::TriggerChamberClusterOnTrackCreator::createPrdRots ( const std::list< const Trk::PrepRawData * > &  prds) const
private

Definition at line 157 of file TriggerChamberClusterOnTrackCreator.cxx.

157  {
158  // create clusterRot for each PRD
159  auto rots = std::vector<const Muon::MuonClusterOnTrack*>();
160  if (prds.empty()) {
161  ATH_MSG_WARNING("empty PRD list ");
162  return rots;
163  }
164  if (!(*prds.begin())) {
165  ATH_MSG_WARNING("first element of RPD list is nullptr");
166  return rots;
167  }
168  for (std::list<const Trk::PrepRawData*>::const_iterator p = prds.begin(); p != prds.end(); ++p) {
169  if (!(*p)) {
170  ATH_MSG_WARNING("current PrepRawData is nullptr, continuing");
171  continue;
172  }
173  Identifier id = (**p).identify();
174  const Trk::TrkDetElementBase* detectorElement = (**p).detectorElement();
175  const Amg::Vector3D globalPosition = detectorElement->center(id);
176  const Muon::MuonClusterOnTrack* cluster = m_clusterCreator->createRIO_OnTrack(**p,globalPosition);
177  rots.push_back(cluster);
178  }
179  return rots;
180 }

◆ 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 Muon::TriggerChamberClusterOnTrackCreator::initialize ( )

Definition at line 31 of file TriggerChamberClusterOnTrackCreator.cxx.

32 {
33  ATH_CHECK(m_idHelperSvc.retrieve());
34  ATH_CHECK(m_clusterCreator.retrieve());
35  return StatusCode::SUCCESS;
36 }

◆ 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()

const InterfaceID & Muon::IMuonCompetingClustersOnTrackCreator::interfaceID ( )
inlinestaticinherited

Definition at line 41 of file IMuonCompetingClustersOnTrackCreator.h.

41 { return IID_IMuonCompetingClustersOnTrackCreator; }

◆ makeClustersBySurface()

void Muon::TriggerChamberClusterOnTrackCreator::makeClustersBySurface ( std::list< int > &  limitingChannels,
std::list< const Muon::MuonClusterOnTrack * > &  limitingRots,
const std::list< const Trk::PrepRawData * > &  prds,
const std::vector< const Muon::MuonClusterOnTrack * > &  rots 
) const
private

Definition at line 183 of file TriggerChamberClusterOnTrackCreator.cxx.

183  {
184  if (prds.empty()) {
185  ATH_MSG_WARNING("makeClustersBySurface- empty PRD list ");
186  return;
187  }
188  if (!(*prds.begin())) {
189  ATH_MSG_WARNING("makeClustersBySurface - first element of RPD list is nullptr");
190  return;
191  }
192  std::vector<const Trk::PrepRawData*> usedPrd;
193  std::vector<const Muon::MuonClusterOnTrack*>::const_iterator r = rots.begin();
194  for (std::list<const Trk::PrepRawData*>::const_iterator p = prds.begin(); p != prds.end(); ++p, ++r) {
195  if (!(*p)) {
196  ATH_MSG_WARNING("makeClustersBySurface - current PrepRawData is nullptr, continuing");
197  continue;
198  }
199  if (std::find(usedPrd.begin(),usedPrd.end(),*p) != usedPrd.end()) continue;
200  usedPrd.push_back(*p);
201  int channel = 0;
202  int gasGap = 0;
203  Identifier channelId = (**p).identify();
204  bool isRpc = m_idHelperSvc->isRpc(channelId);
205  if (isRpc)
206  {
207  gasGap = m_idHelperSvc->rpcIdHelper().gasGap(channelId);
208  channel = m_idHelperSvc->rpcIdHelper().strip(channelId);
209  }
210  else
211  {
212  gasGap = m_idHelperSvc->tgcIdHelper().gasGap(channelId);
213  channel = m_idHelperSvc->tgcIdHelper().channel(channelId);
214  }
215  int channelMax = channel;
216  int channelMin = channel;
217  const Muon::MuonClusterOnTrack* rotMax = *r;
218  const Muon::MuonClusterOnTrack* rotMin = *r;
219 
220  std::list<const Trk::PrepRawData*>::const_iterator q = p;
221  std::vector<const Muon::MuonClusterOnTrack*>::const_iterator s = r;
222  for (++q, ++s; q != prds.end(); ++q, ++s) {
223  if (!(*q)) {
224  ATH_MSG_WARNING("makeClustersBySurface - current PrepRawData is nullptr, continuing");
225  continue;
226  }
227  channelId = (**q).identify();
228  if (( isRpc && m_idHelperSvc->rpcIdHelper().gasGap(channelId) != gasGap)
229  || (! isRpc && m_idHelperSvc->tgcIdHelper().gasGap(channelId) != gasGap)) continue;
230  usedPrd.push_back(*q);
231  if (isRpc)
232  {
233  channel = m_idHelperSvc->rpcIdHelper().strip(channelId);
234  }
235  else
236  {
237  channel = m_idHelperSvc->tgcIdHelper().channel(channelId);
238  }
239  if (channel > channelMax)
240  {
241  channelMax = channel;
242  rotMax = *s;
243  }
244  if (channel < channelMin)
245  {
246  channelMin = channel;
247  rotMin = *s;
248  }
249 
250  }
251  limitingChannels.push_back(channelMin);
252  limitingChannels.push_back(channelMax);
253  limitingRots.push_back(rotMin);
254  limitingRots.push_back(rotMax);
255  }
256 
257  // debug
258  if ( msgLvl(MSG::VERBOSE) )
259  {
260  std::list<int>::const_iterator l = limitingChannels.begin();
261  std::list<int>::const_iterator m = limitingChannels.begin();
262  int number = 0;
263  int size = abs(*l - *(++m));
264  for (std::vector<const Trk::PrepRawData*>::const_iterator q = usedPrd.begin();
265  q != usedPrd.end();
266  ++q, --size)
267  {
268  Identifier channelId = (**q).identify();
269  bool isRpc = m_idHelperSvc->isRpc(channelId);
270  if (isRpc)
271  {
272  int stationIndex = m_idHelperSvc->rpcIdHelper().stationName(channelId);
273  ATH_MSG_VERBOSE(" rpc "
274  << std::setiosflags(std::ios::fixed)
275  << " localPosition "
276  << std::setw(8) << std::setprecision(1) << (**q).localPosition()[Trk::locX]
277  << std::setw(8) << std::setprecision(1) << (**q).localPosition()[Trk::locY]
278  << " doublet z/phi"
279  << std::setw(2) << m_idHelperSvc->rpcIdHelper().doubletZ(channelId)
280  << std::setw(2) << m_idHelperSvc->rpcIdHelper().doubletPhi(channelId)
281  << " gasGap" << std::setw(2) << m_idHelperSvc->rpcIdHelper().gasGap(channelId)
282  << " strip" << std::setw(3) << m_idHelperSvc->rpcIdHelper().strip(channelId)
283  << " station " << m_idHelperSvc->rpcIdHelper().stationNameString(stationIndex)
284  << " " << m_idHelperSvc->rpcIdHelper().show_to_string(channelId) );
285  }
286  else
287  {
288  int stationIndex = m_idHelperSvc->tgcIdHelper().stationName(channelId);
289  ATH_MSG_VERBOSE(" tgc "
290  << std::setiosflags(std::ios::fixed)
291  << " localPosition "
292  << std::setw(8) << std::setprecision(1) << (**q).localPosition()[Trk::locX]
293  << std::setw(8) << std::setprecision(1) << (**q).localPosition()[Trk::locY]
294  << " gasGap" << std::setw(2) << m_idHelperSvc->tgcIdHelper().gasGap(channelId)
295  << " channel" << std::setw(3) << m_idHelperSvc->tgcIdHelper().channel(channelId)
296  << " station " << m_idHelperSvc->tgcIdHelper().stationNameString(stationIndex)
297  << " " << m_idHelperSvc->tgcIdHelper().show_to_string(channelId) );
298  }
299  if (size == 0)
300  {
301  ATH_MSG_VERBOSE(" cluster " << ++number
302  << " between channels " << *l << " and " << *m );
303  if (++m != limitingChannels.end())
304  {
305  ++l;
306  size = 1 + abs(*(++l) - *(++m));
307  }
308  }
309  }
310  }
311 }

◆ makeOverallParameters()

void Muon::TriggerChamberClusterOnTrackCreator::makeOverallParameters ( Trk::LocalParameters parameters,
Amg::MatrixX errorMatrix,
Trk::Surface *&  surface,
std::list< int > &  limitingChannels,
std::list< const Muon::MuonClusterOnTrack * > &  limitingRots 
) const
private

Definition at line 314 of file TriggerChamberClusterOnTrackCreator.cxx.

320 {
321  // surfaces, overall localPosition and error matrix
322  //std::list<const Trk::Surface*> surfaces;
323  std::list<const Muon::MuonClusterOnTrack*>::const_iterator r = limitingRots.begin();
324  Amg::Vector3D centre = (**r).associatedSurface().center();
325  Amg::MatrixX covariance = (**r).localCovariance();
326  parameters = Trk::LocalParameters((**r).localParameters());
327  Identifier channelId = (**r).identify();
328  bool isRpc = m_idHelperSvc->isRpc(channelId);
329 
330  int pair = 1;
331  for (++r;
332  r != limitingRots.end();
333  ++r, ++pair)
334  {
335  centre += (**r).associatedSurface().center();
336  covariance += (**r).localCovariance();
337  parameters += (**r).localParameters();
338  }
339  double norm = 1.;
340  norm /= static_cast<double>(limitingRots.size());
341  std::list<int>::iterator l = limitingChannels.begin();
342  int firstChannel = *l;
343  double width = static_cast<double>(1 + abs(*(++l) - firstChannel));
344  if (limitingRots.size() > 2)
345  {
346  int offset = abs(*(++l) - firstChannel);
347  if (!isRpc && offset < 2) {
348  width *= 0.5;
349  } else {
350  width += static_cast<double>(offset);
351  }
352  }
353 
354  // get parameter means
355  centre *= norm;
356  covariance *= width*width*norm;
357  parameters *= norm;
358 
359  // finally create the mean ErrorMatrix and the average Surface
360  // note the cluster surfaces are assumed to have identical orientation and bounds
361  errorMatrix = Amg::MatrixX(covariance);
362  const Trk::Surface& surf = (**limitingRots.begin()).associatedSurface();
364  std::string shape = "";
365 
366  const Trk::RectangleBounds* rectbds = dynamic_cast<const Trk::RectangleBounds*>(&surf.bounds());
367  const Trk::TrapezoidBounds* trapbds = dynamic_cast<const Trk::TrapezoidBounds*>(&surf.bounds());
368  const Trk::RotatedTrapezoidBounds* rottrapbds = dynamic_cast<const Trk::RotatedTrapezoidBounds*>(&surf.bounds());
369 
370  if (rectbds)
371  {
372  shape = " RPC rectangle ";
373  surface = new Trk::PlaneSurface(Amg::Transform3D(rotation),rectbds->clone());
374  }
375  else if (trapbds)
376  {
377  shape = " TGC trapezoid ";
378  surface = new Trk::PlaneSurface(
380  trapbds->clone());
381  }
382  else if (rottrapbds)
383  {
384  shape = " TGC rotatedTrapezoid ";
385  surface = new Trk::PlaneSurface(
387  rottrapbds->clone());
388  }
389 
390  // debug
391  if ( msgLvl(MSG::DEBUG) )
392  {
393  ATH_MSG_DEBUG(shape << " width " << width << " localParameters " << (parameters)[Trk::locX]);
394  if (covariance.cols() > 1) ATH_MSG_DEBUG(" " << (parameters)[Trk::locY]);
395  ATH_MSG_DEBUG(" covariance " << std::sqrt(covariance(Trk::locX,Trk::locX)));
396  if (covariance.cols() > 1) ATH_MSG_DEBUG(" " << std::sqrt(covariance(Trk::locY,Trk::locY)));
397  ATH_MSG_DEBUG(" channel range (cluster) ");
398  pair = 2;
399  for (std::list<int>::iterator i = limitingChannels.begin();
400  i != limitingChannels.end();
401  ++i, ++pair)
402  {
403  ATH_MSG_DEBUG( *i << " ");
404  if (pair%2) ATH_MSG_DEBUG("(" << pair/2 << ") ");
405  }
406  }
407 }

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

bool Muon::TriggerChamberClusterOnTrackCreator::m_chooseBroadestCluster
private

Definition at line 53 of file TriggerChamberClusterOnTrackCreator.h.

◆ m_clusterCreator

ToolHandle<Muon::IMuonClusterOnTrackCreator> Muon::TriggerChamberClusterOnTrackCreator::m_clusterCreator {this,"ClusterCreator","Muon::MuonClusterOnTrackCreator/MuonClusterOnTrackCreator"}
private

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

Definition at line 48 of file TriggerChamberClusterOnTrackCreator.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:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
beamspotman.r
def r
Definition: beamspotman.py:676
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::RectangleBounds
Definition: RectangleBounds.h:38
xAOD::identify
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
Muon::TriggerChamberClusterOnTrackCreator::m_chooseBroadestCluster
bool m_chooseBroadestCluster
Definition: TriggerChamberClusterOnTrackCreator.h:53
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
Trk::locX
@ locX
Definition: ParamDefs.h:37
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
Trk::locY
@ locY
local cartesian
Definition: ParamDefs.h:38
Muon::TriggerChamberClusterOnTrackCreator::m_clusterCreator
ToolHandle< Muon::IMuonClusterOnTrackCreator > m_clusterCreator
Definition: TriggerChamberClusterOnTrackCreator.h:50
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::RotatedTrapezoidBounds
Definition: RotatedTrapezoidBounds.h:45
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
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
Trk::RotatedTrapezoidBounds::clone
virtual RotatedTrapezoidBounds * clone() const override
Virtual constructor.
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Trk::TrapezoidBounds::clone
virtual TrapezoidBounds * clone() const override
Virtual constructor.
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
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::TriggerChamberClusterOnTrackCreator::makeOverallParameters
void makeOverallParameters(Trk::LocalParameters &parameters, Amg::MatrixX &errorMatrix, Trk::Surface *&surface, std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots) const
Definition: TriggerChamberClusterOnTrackCreator.cxx:314
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::TriggerChamberClusterOnTrackCreator::createPrdRots
std::vector< const Muon::MuonClusterOnTrack * > createPrdRots(const std::list< const Trk::PrepRawData * > &prds) const
Definition: TriggerChamberClusterOnTrackCreator.cxx:157
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
Muon::TriggerChamberClusterOnTrackCreator::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: TriggerChamberClusterOnTrackCreator.h:48
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
WriteBchToCool.beg
beg
Definition: WriteBchToCool.py:69
python.selection.number
number
Definition: selection.py:20
Trk::Surface::bounds
virtual const SurfaceBounds & bounds() const =0
Surface Bounds method.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Muon::TriggerChamberClusterOnTrackCreator::applyClusterConsistency
void applyClusterConsistency(std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots) const
Definition: TriggerChamberClusterOnTrackCreator.cxx:108
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::TrapezoidBounds
Definition: TrapezoidBounds.h:43
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trk::RectangleBounds::clone
virtual RectangleBounds * clone() const override
Virtual constructor.
Trk::PlaneSurface
Definition: PlaneSurface.h:64
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
DeMoScan.first
bool first
Definition: DeMoScan.py:536
DEBUG
#define DEBUG
Definition: page_access.h:11
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
Muon::TriggerChamberClusterOnTrackCreator::makeClustersBySurface
void makeClustersBySurface(std::list< int > &limitingChannels, std::list< const Muon::MuonClusterOnTrack * > &limitingRots, const std::list< const Trk::PrepRawData * > &prds, const std::vector< const Muon::MuonClusterOnTrack * > &rots) const
Definition: TriggerChamberClusterOnTrackCreator.cxx:183
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
extractSporadic.q
list q
Definition: extractSporadic.py:98
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Surface::transform
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
Trk::TrkDetElementBase::center
virtual const Amg::Vector3D & center() const =0
Return the center of the element.
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::MuonClusterOnTrack
Base class for Muon cluster RIO_OnTracks.
Definition: MuonClusterOnTrack.h:34
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14