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::MuonSegmentSelectionTool Class Reference

tool to select MDT segments, all CSC segments will be kept Quality levels: Level 0 = remove segments with more mdt holes than mdt hits that have no phi hits remove segments with less than 3 mdt hits Level 1 = remove segments with more than 50% mdt holes and no phi hits with phi hits and more mdt holes than mdt hits Level 2 = remove segments with mdt hits in only one multilayer Level 3 = remove segments with mdt holes or no phi hits in chambers where one would expect phi hits More...

#include <MuonSegmentSelectionTool.h>

Inheritance diagram for Muon::MuonSegmentSelectionTool:
Collaboration diagram for Muon::MuonSegmentSelectionTool:

Public Member Functions

 MuonSegmentSelectionTool (const std::string &, const std::string &, const IInterface *)
 
virtual ~MuonSegmentSelectionTool ()=default
 
StatusCode initialize ()
 
bool select (const MuonSegment &seg, bool ignoreHoles=false, int qualityLevel=0, bool useEta=true, bool usePhi=true) const
 select segment More...
 
int quality (const MuonSegment &seg, bool ignoreHoles=false, bool useEta=true, bool usePhi=true) const
 segment quality 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 ()
 access to tool interface More...
 

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

int mdtSegmentQuality (const MuonSegment &seg, bool ignoreHoles) const
 calculate segment quality for MDT segments More...
 
int cscSegmentQuality (const MuonSegment &seg, bool useEta, bool usePhi) const
 calculate segment quality for CSC segments More...
 
int nswSegmentQuality (const MuonSegment &seg, const Identifier &chid, bool ignoreHoles) const
 calculate segment quality for NSW segments More...
 
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
 
ServiceHandle< IMuonEDMHelperSvcm_edmHelperSvc
 EDM Helper tool. More...
 
PublicToolHandle< MuonEDMPrinterToolm_printer
 EDM printer tool. More...
 
PublicToolHandle< IMuonSegmentHitSummaryToolm_hitSummaryTool
 hit summary tool More...
 
Gaudi::Property< double > m_cutSegmentQuality {this, "SegmentQualityCut", 10.}
 cut on the segment quality More...
 
Gaudi::Property< double > m_adcFractionCut {this, "GoodADCFractionCut",-1}
 cut on fraction of MDT hits above ADC cut More...
 
Gaudi::Property< int > m_minAdcPerSegmentCut {this,"MinADCPerSegmentCut",70 }
 minimum value for the MDT with the highest ADC value on the segment More...
 
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 select MDT segments, all CSC segments will be kept Quality levels: Level 0 = remove segments with more mdt holes than mdt hits that have no phi hits remove segments with less than 3 mdt hits Level 1 = remove segments with more than 50% mdt holes and no phi hits with phi hits and more mdt holes than mdt hits Level 2 = remove segments with mdt hits in only one multilayer Level 3 = remove segments with mdt holes or no phi hits in chambers where one would expect phi hits

Definition at line 33 of file MuonSegmentSelectionTool.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

◆ MuonSegmentSelectionTool()

Muon::MuonSegmentSelectionTool::MuonSegmentSelectionTool ( const std::string &  ty,
const std::string &  na,
const IInterface *  pa 
)

Definition at line 16 of file MuonSegmentSelectionTool.cxx.

17  : AthAlgTool(ty, na, pa) {
18  declareInterface<IMuonSegmentSelectionTool>(this);
19 }

◆ ~MuonSegmentSelectionTool()

virtual Muon::MuonSegmentSelectionTool::~MuonSegmentSelectionTool ( )
virtualdefault

Member Function Documentation

◆ cscSegmentQuality()

int Muon::MuonSegmentSelectionTool::cscSegmentQuality ( const MuonSegment seg,
bool  useEta,
bool  usePhi 
) const
private

calculate segment quality for CSC segments

Definition at line 55 of file MuonSegmentSelectionTool.cxx.

56 {
57 
58  // get hit counts
59  IMuonSegmentHitSummaryTool::HitCounts hitCounts = m_hitSummaryTool->getHitCounts(seg);
60 
61  /**********************************/
62  /* cuts for quality level 0 */
63 
64  // remove CSC segments with only 3 hits
65  // unless either eta or phi are broken, in that case we accept the segment
66  if (hitCounts.ncscHits() < 4 && useEta && usePhi) return -1;
67 
68 
69  /**********************************/
70  /* cuts for quality level 1 */
71 
72  // remove CSC segments with no layer with 4 hits
73  if (hitCounts.ncscHits.nphiHits != 4 && hitCounts.ncscHits.netaHits != 4) return 1;
74 
75 
76  /**********************************/
77  /* cuts for quality level 2 */
78 
79  // require hits in both projections
80  if (!hitCounts.ncscHits.hasEtaAndPhi()) return 1;
81 
82 
83  /**********************************/
84  /* cuts for quality level 3 */
85 
86  // require four hits in one of the projections and hits in the other
87  if ((hitCounts.ncscHits.netaHits == 4 && hitCounts.ncscHits.nphiHits != 4)
88  || (hitCounts.ncscHits.netaHits != 4 && hitCounts.ncscHits.nphiHits == 4))
89  return 2;
90 
91 
92  /**********************************/
93  /* segment has highest quality */
94  return 3;
95 }

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

Definition at line 22 of file MuonSegmentSelectionTool.cxx.

23 {
24  ATH_CHECK(m_edmHelperSvc.retrieve());
25  ATH_CHECK(m_printer.retrieve());
26  ATH_CHECK(m_idHelperSvc.retrieve());
27  ATH_CHECK(m_hitSummaryTool.retrieve());
28  return StatusCode::SUCCESS;
29 }

◆ 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& Muon::IMuonSegmentSelectionTool::interfaceID ( )
inlinestaticinherited

access to tool interface

Definition at line 21 of file IMuonSegmentSelectionTool.h.

21  {
22  static const InterfaceID IID_IMuonSegmentSelectionTool("Muon::IMuonSegmentSelectionTool", 1, 0);
23 
24  return IID_IMuonSegmentSelectionTool;
25  }

◆ mdtSegmentQuality()

int Muon::MuonSegmentSelectionTool::mdtSegmentQuality ( const MuonSegment seg,
bool  ignoreHoles 
) const
private

calculate segment quality for MDT segments

Definition at line 141 of file MuonSegmentSelectionTool.cxx.

142 {
143 
144 
145  // get hit counts
146  IMuonSegmentHitSummaryTool::HitCounts hitCounts = m_hitSummaryTool->getHitCounts(seg);
147 
148  /**********************************/
149  /* cuts for quality level 0 */
150 
151  // remove segments with less than 3 mdt hits
152  if (hitCounts.nmdtHits() < 3) return -1;
153 
154  // get holes
155  unsigned int nholes = !ignoreHoles ? hitCounts.nmdtHoles : 0;
156 
157  // calculate hole fraction
158  double holeFraction = (double)nholes / (double)hitCounts.nmdtHits();
159 
160  // check whether we expect trigger hits in the station
161  bool triggerHitRegion = hitCounts.nexpectedTrigHitLayers > 0;
162 
163  ATH_MSG_DEBUG("Segment: " << m_printer->print(seg) << std::endl
164  << hitCounts.print() << " Hole frac " << holeFraction);
165 
166  // only look at segments with phi hits
167  if (triggerHitRegion && hitCounts.nphiTrigHitLayers == 0) {
168 
169  // reject if more holes than hits
170  if (holeFraction > 1.1) return -1;
171  }
172 
173  // reject events with a good ADC fraction below the cut
174  if (hitCounts.goodADCFraction() < m_adcFractionCut) return -1;
175  if (hitCounts.nmdtHits() == 3 && hitCounts.adcMax < m_minAdcPerSegmentCut) return -1;
176 
177  /**********************************/
178  /* cuts for quality level 1 */
179 
180  if (!hitCounts.closeToChamberEdge) {
181 
182  // reject segments with phi hits and more holes as hits
183  if (hitCounts.nphiTrigHitLayers != 0 && holeFraction > 1.1) return 0;
184 
185  // // reject segments with phi hits and a hole fraction larger than 50%
186  // if( triggerHitRegion && hitCounts.nphiTrigHitLayers == 0 && holeFraction > 0.5 ) return 0;
187  }
188 
189  // reject segments with more than one enclosed hole and no trigger hits
190  if (hitCounts.nphiTrigHitLayers == 0 && hitCounts.nmdtEnclosedHoles > 2) return 0;
191 
192 
193  /**********************************/
194  /* cuts for quality level 2 */
195 
196  // reject segments with phi hits and more holes as hits
197  if (hitCounts.nphiTrigHitLayers != 0 && holeFraction > 1.1) return 1;
198 
199  // reject segments with phi hits and a hole fraction larger than 50%
200  if (triggerHitRegion && hitCounts.nphiTrigHitLayers == 0 && holeFraction > 0.5) return 1;
201 
202  // reject segments with more than one enclosed hole
203  if (hitCounts.nmdtEnclosedHoles > 2) return 0;
204 
205  // reject all segments that have no phi hits and hits in only one multi layer
206  bool twoMultiLayerSegment = hitCounts.nmdtHitsMl1 > 1 && hitCounts.nmdtHitsMl2 > 1;
207  if (hitCounts.nphiTrigHitLayers == 0 && !twoMultiLayerSegment) return 1;
208 
209 
210  if (hitCounts.nphiTrigHitLayers == 0) {
211 
212  // cut on segment quality
213  if (hitCounts.segmentQuality > m_cutSegmentQuality) return 1;
214 
215  // tighter cut for segments with only on multi layer
216  if ((!twoMultiLayerSegment || hitCounts.nmdtHits() < 5) && hitCounts.segmentQuality > 0.5 * m_cutSegmentQuality)
217  return 1;
218  }
219 
220  // cut on number of holes
221  if (hitCounts.nmdtHoles > 2) {
222  ATH_MSG_DEBUG("Failed hole cut " << hitCounts.nmdtHoles);
223  return 1;
224  }
225 
226  /**********************************/
227  /* cuts for quality level 3 */
228 
229  // cut on segment quality
230  if (hitCounts.segmentQuality > m_cutSegmentQuality) {
231  ATH_MSG_DEBUG("Failed quality cut" << hitCounts.segmentQuality << " cut " << m_cutSegmentQuality);
232  return 2;
233  }
234  // tighter cut for segments with only on multi layer
235  if ((!twoMultiLayerSegment || hitCounts.nmdtHits() < 5) && hitCounts.segmentQuality > 0.5 * m_cutSegmentQuality) {
236  ATH_MSG_DEBUG("Single multi layer or too few hits: quality " << hitCounts.segmentQuality << " cut "
237  << 0.5 * m_cutSegmentQuality);
238  return 2;
239  }
240 
241  // reject all segments that have in only one multi layer
242  if (!twoMultiLayerSegment) {
243  ATH_MSG_DEBUG("Single multi layer");
244  return 2;
245  }
246 
247  // reject segments without missing trigger layers in regions where we expect phi hits
248  if (triggerHitRegion && hitCounts.nphiTrigHitLayers < hitCounts.nexpectedTrigHitLayers) {
249  ATH_MSG_DEBUG("Missing trigger hits: phi hits " << hitCounts.nphiTrigHitLayers << " expected "
250  << hitCounts.nexpectedTrigHitLayers);
251  return 2;
252  }
253 
254  /**********************************/
255  /* segment has highest quality */
256  return 3;
257 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ nswSegmentQuality()

int Muon::MuonSegmentSelectionTool::nswSegmentQuality ( const MuonSegment seg,
const Identifier chid,
bool  ignoreHoles 
) const
private

calculate segment quality for NSW segments

For the moment count the micromega hits to precision eta hits

Definition at line 98 of file MuonSegmentSelectionTool.cxx.

98  {
99 
100 
101  // get hit counts
102  IMuonSegmentHitSummaryTool::HitCounts hitCounts = m_hitSummaryTool->getHitCounts(seg);
103  const uint8_t nPrecHits = hitCounts.nnswHits();
105  const uint8_t nPrecEtaHits = hitCounts.nmmHits() + hitCounts.nstgcHits.netaHits;
106  const uint8_t nPrecPhiHits = hitCounts.nstgcHits.nphiHits;
107 
108  const uint8_t nMM_Hits = hitCounts.nmmHits();
109  const uint8_t nSTGC_Hits = hitCounts.nstgcHits();
110  /**********************************/
111  /* cuts for quality level 0 */
112  // remove NSW segments with only 3 hits
113  if (nPrecEtaHits < 2) return -1;
114 
115  /**********************************/
116  /* cuts for quality level 1 */
117 
118  // remove NSW segments where both chambers have below than 4 associated hits
119  if (std::max(nMM_Hits, nSTGC_Hits) < 4) return 0;
120 
121  /**********************************/
122  /* cuts for quality level 2 */
123  // require hits in both projections
124  if (nSTGC_Hits && !hitCounts.nstgcHits.hasEtaAndPhi()) return 1;
125 
126  if (nMM_Hits && (!hitCounts.nmmEtaHits || !hitCounts.nmmStereoHits)) return 1;
127 
128  /**********************************/
129  /* cuts for quality level 3 */
130 
131  // require four hits in one of the projections and hits in the other
132  if (nPrecHits < 12 || nPrecPhiHits < 4)
133  return 2;
134 
135  /**********************************/
136  /* segment has highest quality */
137  return 3;
138 }

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

◆ quality()

int Muon::MuonSegmentSelectionTool::quality ( const MuonSegment seg,
bool  ignoreHoles = false,
bool  useEta = true,
bool  usePhi = true 
) const
virtual

segment quality

Implements Muon::IMuonSegmentSelectionTool.

Definition at line 32 of file MuonSegmentSelectionTool.cxx.

33 {
34  Identifier chid = m_edmHelperSvc->chamberId(seg);
35  if (!chid.is_valid()) {
36  ATH_MSG_WARNING("Got invalid segment identifier");
37  return -1;
38  }
39 
40  // different treatment for CSC and MDT segments
41  // mdt treatment
42  if (m_idHelperSvc->isMdt(chid)) return mdtSegmentQuality(seg, ignoreHoles);
43 
44  // csc segments
45  if (m_idHelperSvc->isCsc(chid)) return cscSegmentQuality(seg, useEta, usePhi);
46 
47  // rpc/tgc case
48  if (m_idHelperSvc->isTgc(chid) || m_idHelperSvc->isRpc(chid)) return 1;
49 
50  // NSW segments
51  return nswSegmentQuality(seg, chid, ignoreHoles);
52 }

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

◆ select()

bool Muon::MuonSegmentSelectionTool::select ( const MuonSegment seg,
bool  ignoreHoles = false,
int  qualityLevel = 0,
bool  useEta = true,
bool  usePhi = true 
) const
virtual

select segment

Implements Muon::IMuonSegmentSelectionTool.

Definition at line 260 of file MuonSegmentSelectionTool.cxx.

262 {
263  // check quality is better or equal to required level
264  return quality(seg, ignoreHoles, useEta, usePhi) >= qualityLevel;
265 }

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

Gaudi::Property<double> Muon::MuonSegmentSelectionTool::m_adcFractionCut {this, "GoodADCFractionCut",-1}
private

cut on fraction of MDT hits above ADC cut

Definition at line 78 of file MuonSegmentSelectionTool.h.

◆ m_cutSegmentQuality

Gaudi::Property<double> Muon::MuonSegmentSelectionTool::m_cutSegmentQuality {this, "SegmentQualityCut", 10.}
private

cut on the segment quality

Definition at line 77 of file MuonSegmentSelectionTool.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_edmHelperSvc

ServiceHandle<IMuonEDMHelperSvc> Muon::MuonSegmentSelectionTool::m_edmHelperSvc
private
Initial value:
{
this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
"Handle to the service providing the IMuonEDMHelperSvc interface"}

EDM Helper tool.

Definition at line 61 of file MuonSegmentSelectionTool.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_hitSummaryTool

PublicToolHandle<IMuonSegmentHitSummaryTool> Muon::MuonSegmentSelectionTool::m_hitSummaryTool
private
Initial value:
{
this,
"MuonSegmentHitSummaryTool",
"Muon::MuonSegmentHitSummaryTool/MuonSegmentHitSummaryTool",
}

hit summary tool

Definition at line 71 of file MuonSegmentSelectionTool.h.

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> Muon::MuonSegmentSelectionTool::m_idHelperSvc
private
Initial value:
{this, "MuonIdHelperSvc",
"Muon::MuonIdHelperSvc/MuonIdHelperSvc"}

Definition at line 59 of file MuonSegmentSelectionTool.h.

◆ m_minAdcPerSegmentCut

Gaudi::Property<int> Muon::MuonSegmentSelectionTool::m_minAdcPerSegmentCut {this,"MinADCPerSegmentCut",70 }
private

minimum value for the MDT with the highest ADC value on the segment

Definition at line 79 of file MuonSegmentSelectionTool.h.

◆ m_printer

PublicToolHandle<MuonEDMPrinterTool> Muon::MuonSegmentSelectionTool::m_printer
private
Initial value:
{
this,
"Printer",
"Muon::MuonEDMPrinterTool/MuonEDMPrinterTool",
}

EDM printer tool.

Definition at line 65 of file MuonSegmentSelectionTool.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:
Muon::MuonSegmentSelectionTool::m_printer
PublicToolHandle< MuonEDMPrinterTool > m_printer
EDM printer tool.
Definition: MuonSegmentSelectionTool.h:65
Muon::MuonSegmentSelectionTool::m_adcFractionCut
Gaudi::Property< double > m_adcFractionCut
cut on fraction of MDT hits above ADC cut
Definition: MuonSegmentSelectionTool.h:78
Muon::MuonSegmentSelectionTool::m_minAdcPerSegmentCut
Gaudi::Property< int > m_minAdcPerSegmentCut
minimum value for the MDT with the highest ADC value on the segment
Definition: MuonSegmentSelectionTool.h:79
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Muon::MuonSegmentSelectionTool::m_edmHelperSvc
ServiceHandle< IMuonEDMHelperSvc > m_edmHelperSvc
EDM Helper tool.
Definition: MuonSegmentSelectionTool.h:61
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon::MuonSegmentSelectionTool::quality
int quality(const MuonSegment &seg, bool ignoreHoles=false, bool useEta=true, bool usePhi=true) const
segment quality
Definition: MuonSegmentSelectionTool.cxx:32
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Muon::MuonSegmentSelectionTool::nswSegmentQuality
int nswSegmentQuality(const MuonSegment &seg, const Identifier &chid, bool ignoreHoles) const
calculate segment quality for NSW segments
Definition: MuonSegmentSelectionTool.cxx:98
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Muon::MuonSegmentSelectionTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonSegmentSelectionTool.h:59
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Muon::MuonSegmentSelectionTool::cscSegmentQuality
int cscSegmentQuality(const MuonSegment &seg, bool useEta, bool usePhi) const
calculate segment quality for CSC segments
Definition: MuonSegmentSelectionTool.cxx:55
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
Muon::MuonSegmentSelectionTool::m_cutSegmentQuality
Gaudi::Property< double > m_cutSegmentQuality
cut on the segment quality
Definition: MuonSegmentSelectionTool.h:77
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
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::MuonSegmentSelectionTool::m_hitSummaryTool
PublicToolHandle< IMuonSegmentHitSummaryTool > m_hitSummaryTool
hit summary tool
Definition: MuonSegmentSelectionTool.h:71
Muon::MuonSegmentSelectionTool::mdtSegmentQuality
int mdtSegmentQuality(const MuonSegment &seg, bool ignoreHoles) const
calculate segment quality for MDT segments
Definition: MuonSegmentSelectionTool.cxx:141
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14