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

#include <DetailedTrackGradeFactory.h>

Inheritance diagram for Analysis::DetailedTrackGradeFactory:
Collaboration diagram for Analysis::DetailedTrackGradeFactory:

Public Member Functions

 DetailedTrackGradeFactory (const std::string &, const std::string &, const IInterface *)
 
virtual ~DetailedTrackGradeFactory ()=default
 
virtual StatusCode initialize () override
 AlgTool initialize method. More...
 
virtual TrackGradegetGrade (const xAOD::TrackParticle &track, const xAOD::IParticle::FourMom_t &jetMomentum) const override
 
virtual const TrackGradesDefinitiongetTrackGradesDefinition () const override
 
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 ()
 AlgTool interface methods. 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

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

TrackGradesDefinition m_trackGradesDefinition
 
bool m_hitBLayerGrade
 
bool m_useSharedHitInfo
 
bool m_useRun2TrackGrading
 if false the following cuts are ignored More...
 
bool m_useITkTrackGrading
 
bool m_useInnerLayers0HitInfo
 
bool m_useDetailSharedHitInfo
 
bool m_useDetailSplitHitInfo
 
int m_nSharedBLayer
 
int m_nSharedPix
 max. number of shared hits in B layer More...
 
int m_nSharedSct
 max. number of shared hits in pixels More...
 
int m_nSharedSi
 max. number of shared hits in SCT More...
 
int m_nSharedInnermostPixelLayer
 max. number of shared hits in pixels+SCT More...
 
int m_nSharedNextToInnermostPixelLayer
 max. number of shared hits in innermost pixel layer (IBL) More...
 
int m_nOutlierPix
 max. number of shared hits next-to-innermost pixel layer (Run1 B layer) More...
 
int m_nSpoiltPix
 max. number of pixel outliers in two first layers More...
 
bool m_ptFracGrade
 max. number of spoilt hits in pixel More...
 
double m_ptFracCut
 
bool m_ptEtaGrades
 cut on ptFrac More...
 
std::vector< double > m_ptLowerCuts
 grades in pt and/or |eta| of tracks More...
 
std::vector< double > m_etaLowerCuts
 
std::vector< std::vector< double > > m_gammaLowerCuts
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 35 of file DetailedTrackGradeFactory.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

◆ DetailedTrackGradeFactory()

Analysis::DetailedTrackGradeFactory::DetailedTrackGradeFactory ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 13 of file DetailedTrackGradeFactory.cxx.

13  :
14  AthAlgTool( t, n, p )
15 {
16  declareProperty("hitBLayerGrade" , m_hitBLayerGrade = true);
17  declareProperty("useSharedHitInfo" , m_useSharedHitInfo = false);
18 
19  declareProperty("useRun2TrackGrading" , m_useRun2TrackGrading = false);
20  declareProperty("useITkTrackGrading" , m_useITkTrackGrading = false);
21  declareProperty("useInnerLayers0HitInfo", m_useInnerLayers0HitInfo= false);
22  declareProperty("useDetailSplitHitInfo" , m_useDetailSplitHitInfo = false);
23  declareProperty("useDetailSharedHitInfo", m_useDetailSharedHitInfo= true);
24 
25  declareProperty("nSharedBLayer", m_nSharedBLayer = 0);
26  declareProperty("nSharedPix" , m_nSharedPix = 0);
27  declareProperty("nSharedSct" , m_nSharedSct = 1);
28  declareProperty("nSharedSi" , m_nSharedSi = 999);
29 
30  // Flag to toggle track gradation according to Run2 pixel layout
31  declareProperty("nSharedInnermostPixelLayer" , m_nSharedInnermostPixelLayer = 0);
32  declareProperty("nSharedNextToInnermostPixelLayer", m_nSharedNextToInnermostPixelLayer = 0);
33 
34  declareProperty("nOutlierPix" , m_nOutlierPix = 0);
35  declareProperty("nSpoiltPix" , m_nSpoiltPix = 1);
36  //
37  declareProperty("ptFracGrade", m_ptFracGrade = false);
38  declareProperty("ptFracCut", m_ptFracCut = 0.04);
39 
40  declareProperty("ptEtaGrades", m_ptEtaGrades = false);
41  declareProperty("ptLowerCuts", m_ptLowerCuts);
42  declareProperty("etaLowerCuts", m_etaLowerCuts);
43 
44  m_ptLowerCuts.push_back(1000.);
45  m_ptLowerCuts.push_back(4000.);
46  m_ptLowerCuts.push_back(10000.);
47 
48  m_etaLowerCuts.push_back(0.);
49  m_etaLowerCuts.push_back(0.5);
50  m_etaLowerCuts.push_back(1.5);
51 
52  declareProperty("gammaLowerCuts", m_gammaLowerCuts = {{0., 0.25e-3, 0.5e-3, 0.75e-3}, // 0<|eta|<1
53  {0., 0.5e-3, 1e-3, 1.5e-3}, // 1<|eta|<2
54  {0., 1e-3, 2e-3, 3e-3}} ); // |eta|>2
55 
56 
57  declareInterface<ITrackGradeFactory>( this );
58 }

◆ ~DetailedTrackGradeFactory()

virtual Analysis::DetailedTrackGradeFactory::~DetailedTrackGradeFactory ( )
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

◆ getGrade()

TrackGrade * Analysis::DetailedTrackGradeFactory::getGrade ( const xAOD::TrackParticle track,
const xAOD::IParticle::FourMom_t jetMomentum 
) const
overridevirtual

Implements Analysis::ITrackGradeFactory.

Definition at line 268 of file DetailedTrackGradeFactory.cxx.

270 {
271 
272  bool nohitBLayer(false);
273  bool nohitInnermostLayer(false);
274  bool nohitNextToInnermostLayer(false);
275  bool exphitInnermostLayer(false);
276  bool exphitNextToInnermostLayer(false);
277 
278  bool sharedClass(false);
279  bool blasharedClass(false);
280  bool innermostsharedClass(false);
281  bool nexttoinnermostsharedClass(false);
282  bool pixsharedClass(false);
283  bool sctsharedClass(false);
284 
285  bool innermostsplitClass(false);
286  bool nexttoinnermostsplitClass(false);
287  bool pixsplitClass(false);
288 
289  bool pixoutlierClass(false);
290  bool pixspoiltClass(false);
291 
292  bool ptFrac(false);
293 
294  //Itk specific:
295  int eta_region = -1; // 0 = 0<|eta|<1, 1 = 1<|eta|<2, 2 = 2<|eta|<3 , 3 = |eta|>3
296  int gamma_region = -1;
297 
298 
300  //check if no hit in BLayer
302  uint8_t nbs;
303  if (!track.summaryValue(nbs, xAOD::numberOfInnermostPixelLayerHits)){
304  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
305  }
306  if (nbs==0) nohitBLayer = true;
307  }
308  else if (m_useRun2TrackGrading){
309  uint8_t nih, nnih;
310  if (!track.summaryValue(nih, xAOD::numberOfInnermostPixelLayerHits)){
311  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
312  }
313  if (nih==0) nohitInnermostLayer = true;
314 
315  if (!track.summaryValue(nnih, xAOD::numberOfNextToInnermostPixelLayerHits)){
316  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerHits for TrackGrade!");
317  }
318  if (nnih==0) nohitNextToInnermostLayer = true;
319 
320  uint8_t Enih, Ennih;
321  // getting expected information
322  if (!track.summaryValue(Enih, xAOD::expectInnermostPixelLayerHit)){
323  ATH_MSG_ERROR("#BTAG# Cannot retrieve expectInnermostPixelLayerHit for TrackGrade!");
324  }
325  if (Enih>0) exphitInnermostLayer=true;
326 
327  if (!track.summaryValue(Ennih, xAOD::expectNextToInnermostPixelLayerHit)){
328  ATH_MSG_ERROR("#BTAG# Cannot retrieve expectNextToInnermostPixelLayerHit for TrackGrade!");
329  }
330  if (Ennih>0) exphitNextToInnermostLayer=true;
331  }
332  }
333 
336  //check if shared
337  uint8_t nbs=0, nps=0, nss=0;
338  if (!track.summaryValue(nbs, xAOD::numberOfInnermostPixelLayerSharedHits)){
339  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfBLayerSharedHists for TrackGrade!");
340  }
341 
342  if (!track.summaryValue(nps, xAOD::numberOfPixelSharedHits)){
343  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfPixelSharedHists for TrackGrade!");
344  }
345 
346  if (!track.summaryValue(nss, xAOD::numberOfSCTSharedHits)){
347  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfSCTSharedHists for TrackGrade!");
348  }
349  int nsht = nps+nss ;
350  if(nbs>m_nSharedBLayer) {
351  sharedClass = true;
352  blasharedClass = true;
353  }
354  if(nps>m_nSharedPix) {
355  sharedClass = true;
356  pixsharedClass = true;
357  }
358  if(nss>m_nSharedSct) {
359  sharedClass = true;
360  sctsharedClass = true;
361  }
362  if(nsht>m_nSharedSi) {
363  sharedClass = true;
364  }
365  }
366 
367  else if (m_useRun2TrackGrading) {
368  uint8_t nips=0, nnips=0, nps=0, nss=0;
369  if (!track.summaryValue(nips, xAOD::numberOfInnermostPixelLayerSharedHits)){
370  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfInnermostPixelLayerSharedHits for TrackGrade!");
371  }
372 
373  if (!track.summaryValue(nnips, xAOD::numberOfNextToInnermostPixelLayerSharedHits)){
374  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSharedHits for TrackGrade!");
375  }
376 
377  if (!track.summaryValue(nps, xAOD::numberOfPixelSharedHits)){
378  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfPixelSharedHits for TrackGrade!");
379  }
380 
381  if (!track.summaryValue(nss, xAOD::numberOfSCTSharedHits)){
382  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfSCTSharedHits for TrackGrade!");
383  }
384 
385  int nsht = nps+nss ;
386  //std::cout << " ... " << Inips << " , " << Innips << " , " << Inps << " , " << Inss << std::endl;
387 
389  sharedClass = true;
390  innermostsharedClass = true;
391  }
393  sharedClass = true;
394  nexttoinnermostsharedClass = true;
395  }
396  if(nps>m_nSharedPix) {
397  sharedClass = true;
398  pixsharedClass = true;
399  }
400  if(nss>m_nSharedSct) {
401  sharedClass = true;
402  sctsharedClass = true;
403  }
404  if(nsht>m_nSharedSi) {
405  sharedClass = true;
406  }
407  }
408  }
409 
410 
412  uint8_t nips, nnips, nps;
413  if (!track.summaryValue(nips, xAOD::numberOfInnermostPixelLayerSplitHits)){
414  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfInnermostPixelLayerSplitHits for TrackGrade!");
415  }
416 
417  if (!track.summaryValue(nnips, xAOD::numberOfNextToInnermostPixelLayerSplitHits)){
418  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSplitHits for TrackGrade!");
419  }
420 
421  if (!track.summaryValue(nps, xAOD::numberOfPixelSplitHits)){
422  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfPixelSplitHits for TrackGrade!");
423  }
424 
425  if(nips>0) {
426  //splitClass = true;
427  innermostsplitClass = true;
428  }
429  if(nnips>0) {
430  //splitClass = true;
431  nexttoinnermostsplitClass = true;
432  }
433  if(nps>0) {
434  //splitClass = true;
435  pixsplitClass = true;
436  }
437  }
438 
439 
440  double ptTrack = track.pt();
441  double etaTrack = fabs(track.eta());
442 
443  //check if ptFrac < cut value
444  if (m_ptFracGrade) {
445  double ptJet = jetMomentum.Pt();
446  if ((ptTrack/ptJet) < m_ptFracCut) ptFrac = true;
447  }
448 
449  std::string ptEtaCategoryName;
450 
451  if (m_ptEtaGrades) {
452  int ptGradeNumber=m_ptLowerCuts.size();
453  int etaGradeNumber=m_etaLowerCuts.size();
454 
455  //check pt
456  int ptBin(-1);
457 
458  for (int i=0;i<ptGradeNumber;i++){
459 
460  if (i<ptGradeNumber-1) {
461  if (ptTrack>m_ptLowerCuts[i]&& ptTrack<=m_ptLowerCuts[i+1]) {
462  ptBin=i;
463  break;
464  }
465  } else {
466  if (ptTrack>m_ptLowerCuts[i]) {
467  ptBin=i;
468  break;
469  }
470  }
471  }
472 
473  int etaBin(-1);
474  for (int i=0;i<etaGradeNumber;i++){
475 
476  if (i<etaGradeNumber-1) {
477  if (etaTrack>m_etaLowerCuts[i]&& etaTrack<=m_etaLowerCuts[i+1]) {
478  etaBin=i;
479  break;
480  }
481  } else {
482  if (etaTrack>m_etaLowerCuts[i]) {
483  etaBin=i;
484  break;
485  }
486  }
487  }
488 
489  //now choose the right grade
490  std::string nameGrade("Good");
491 
492  char namePt[30];
493  if (ptBin<ptGradeNumber-1) {
494  sprintf(namePt,"Pt%.1f-%.1f",m_ptLowerCuts[ptBin]*1e-3,m_ptLowerCuts[ptBin+1]*1e-3);
495  } else {
496  sprintf(namePt,"Pt%.1f-inf",m_ptLowerCuts[ptBin]*1e-3);
497  }
498 
499  char nameEta[30];
500  if (etaBin<etaGradeNumber-1) {
501  sprintf(nameEta,"Eta%.1f-%.1f",m_etaLowerCuts[etaBin],m_etaLowerCuts[etaBin+1]);
502  } else {
503  sprintf(nameEta,"Eta%.1f-2.5",m_etaLowerCuts[etaBin]);
504  }
505 
506  nameGrade+=namePt;
507  nameGrade+=nameEta;
508 
509  ptEtaCategoryName=nameGrade;
510  }
511 
512 
513  const TrackGrade * gradeToReturn(0);
514 
516  if (nohitBLayer) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitBLayer"));
517 
518  else if (sharedClass) {
519  if(!m_useDetailSharedHitInfo) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("Shared"));
520 
521  else {
522  if(blasharedClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("BlaShared"));
523 
524  if(pixsharedClass&&(!blasharedClass)) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("PixShared"));
525 
526  if(sctsharedClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("SctShared"));
527  }
528  } else if (ptFrac) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("PtFrac"));
529 
530  else {
531  if (m_ptEtaGrades) {
532  ATH_MSG_VERBOSE(" category "<<ptEtaCategoryName);
533  gradeToReturn=m_trackGradesDefinition.getGrade(ptEtaCategoryName);
534  } else {
535  gradeToReturn=m_trackGradesDefinition.getGrade(std::string("Good"));
536  }
537  }
538  }
539 
540  else if (m_useRun2TrackGrading){
541  /*
542  std::cout << " using Run2 grading" << std::endl;
543  std::cout << " ... " << nohitBLayer << " " << nohitInnermostLayer
544  << " " << nohitNextToInnermostLayer << " " << exphitInnermostLayer
545  << " " << exphitNextToInnermostLayer
546  << " " << sharedClass << " " << blasharedClass
547  << " " << innermostsharedClass << " " << nexttoinnermostsharedClass
548  << " " << pixsharedClass << " " << sctsharedClass
549  << " " << innermostsplitClass << " " << nexttoinnermostsplitClass
550  << " " << pixsplitClass << std::endl;
551  */
552  if ( m_useInnerLayers0HitInfo ) {
553  if ( nohitInnermostLayer && nohitNextToInnermostLayer ) {
554  if ( exphitInnermostLayer && exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitIn0HitNInExp2"));
555  else if ( exphitInnermostLayer && !exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitIn0HitNInExpIn"));
556  else if ( !exphitInnermostLayer && exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitIn0HitNInExpNIn"));
557  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitIn0HitNIn"));
558  } else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ) {
559  if ( exphitInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitInExp"));
560  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitIn"));
561  } else if ( !nohitInnermostLayer && nohitNextToInnermostLayer ) {
562  if ( exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitNInExp"));
563  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("0HitNIn"));
564  }
565  }
566 
567  // grade are exclusive so not event attempt the next frade is the grade has already been assigned
568 
569  // shared
570  if (sharedClass && m_useDetailSharedHitInfo && gradeToReturn==0) {
571  if( innermostsharedClass && nexttoinnermostsharedClass ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("InANDNInShared"));
572  else if ( pixsharedClass ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("PixShared"));
573  else if ( sctsharedClass ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("SctShared"));
574  }
575 
576  // split
577  if (m_useDetailSplitHitInfo && pixsplitClass && gradeToReturn==0) {
578  if( innermostsplitClass && nexttoinnermostsplitClass ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("InANDNInSplit"));
579  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("PixSplit"));
580  }
581  }
582 
583 
584  else if(m_useITkTrackGrading){
585 
586  uint8_t nih, nnih, nieh, nnieh;
587 
588  if(!track.summaryValue(nih, xAOD::numberOfInnermostPixelLayerHits)){
589  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfInnermostPixelLayerHits for TrackGrade!");
590  }
591  if(!track.summaryValue(nieh, xAOD::numberOfInnermostPixelLayerEndcapHits)){
592  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfInnermostPixelLayerEndcapHits for TrackGrade!");
593  }
594  if ((nih+nieh)==0) nohitInnermostLayer = true;
595 
596  if (!track.summaryValue(nnih, xAOD::numberOfNextToInnermostPixelLayerHits)){
597  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerHits for TrackGrade!");
598  }
599  if (!track.summaryValue(nnieh, xAOD::numberOfNextToInnermostPixelLayerEndcapHits)){
600  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerEndcapHits for TrackGrade!");
601  }
602  if ((nnih+nnieh)==0) nohitNextToInnermostLayer = true;
603 
604  uint8_t Enih, Ennih;
605 
606  // getting expected information
607  if (!track.summaryValue(Enih, xAOD::expectInnermostPixelLayerHit)){
608  ATH_MSG_ERROR("#BTAG# Cannot retrieve expectInnermostPixelLayerHit for TrackGrade!");
609  }
610  if (Enih>0) exphitInnermostLayer=true;
611 
612  if (!track.summaryValue(Ennih, xAOD::expectNextToInnermostPixelLayerHit)){
613  ATH_MSG_ERROR("#BTAG# Cannot retrieve expectNextToInnermostPixelLayerHit for TrackGrade!");
614  }
615  if (Ennih>0) exphitNextToInnermostLayer=true;
616 
617  //check if shared
618  uint8_t nps, nss;
619 
620  if (!track.summaryValue(nps, xAOD::numberOfPixelSharedHits)){
621  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfPixelSharedHists for TrackGrade!");
622  }
623  if (!track.summaryValue(nss, xAOD::numberOfSCTSharedHits)){
624  ATH_MSG_ERROR("#BTAG# Cannot retrieve numberOfSCTSharedHists for TrackGrade!");
625  }
626  int nsht = nps+nss ;
627 
628  uint8_t nips, nnips;
629  if (!track.summaryValue(nips, xAOD::numberOfInnermostPixelLayerSharedHits)){
630  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfInnermostPixelLayerSharedHits for TrackGrade!");
631  }
632  if (!track.summaryValue(nnips, xAOD::numberOfNextToInnermostPixelLayerSharedHits)){
633  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerSharedHits for TrackGrade!");
634  }
635 
636  uint8_t nipo, nnipo;
637  if (!track.summaryValue(nipo, xAOD::numberOfInnermostPixelLayerOutliers)){
638  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfInnermostPixelLayerOutliers for TrackGrade!");
639  }
640  if (!track.summaryValue(nnipo, xAOD::numberOfNextToInnermostPixelLayerOutliers)){
641  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfNextToInnermostPixelLayerOutliers for TrackGrade!");
642  }
643  int notot = nipo + nnipo;
644 
645  uint8_t npsp;
646  if (!track.summaryValue(npsp, xAOD::numberOfPixelSpoiltHits)){
647  ATH_MSG_FATAL("#BTAG# Cannot retrieve numberOfPixelSpoiltHits for TrackGrade!");
648  }
649 
651  sharedClass = true;
652  innermostsharedClass = true;
653  }
655  sharedClass = true;
656  nexttoinnermostsharedClass = true;
657  }
658  if(nps>m_nSharedPix) {
659  sharedClass = true;
660  pixsharedClass = true;
661  }
662  if(nss>m_nSharedSct) {
663  sharedClass = true;
664  sctsharedClass = true;
665  }
666  if(nsht>m_nSharedSi) {
667  sharedClass = true;
668  }
669  if(notot>m_nOutlierPix){
670  pixoutlierClass = true;
671  }
672  if(npsp>m_nSpoiltPix){
673  pixspoiltClass = true;
674  }
675 
676 
677  double etaTrack = fabs(track.eta());
678  double ptTrack = track.pt();
679  double thetaTrack=track.theta();
680  if (etaTrack<=1) eta_region = 0;
681  else if (etaTrack>1 && etaTrack<=2) eta_region = 1;
682  else if (etaTrack>2) eta_region = 2;
683 
684  double gamma =1./(ptTrack*sqrt(sin(thetaTrack)));
685  if(gamma>m_gammaLowerCuts[eta_region][3]) gamma_region = 0;
686  else if(gamma<=m_gammaLowerCuts[eta_region][3] && gamma>m_gammaLowerCuts[eta_region][2]) gamma_region = 1;
687  else if(gamma<=m_gammaLowerCuts[eta_region][2] && gamma>m_gammaLowerCuts[eta_region][1]) gamma_region = 2;
688  else if(gamma<=m_gammaLowerCuts[eta_region][1] && gamma>m_gammaLowerCuts[eta_region][0]) gamma_region = 3;
689 
690 
691  if(eta_region==0){
692 
693  if( nohitInnermostLayer && nohitNextToInnermostLayer) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A01"));
694 
695  else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ){
696  if ( exphitInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A02"));
697  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A03"));
698  }
699 
700  else if (!nohitInnermostLayer && nohitNextToInnermostLayer){
701  if ( exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A04"));
702  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A05"));
703  }
704 
705  else if (pixsharedClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A06"));
706  else if (pixoutlierClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A07"));
707  else if (pixspoiltClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A08"));
708 
709  else if(gamma_region==0) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A14_1"));
710  else if(gamma_region==1) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A14_2"));
711  else if(gamma_region==2) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A14_3"));
712  else if(gamma_region==3) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("A14_4"));
713 
714  } //eta_region = 0
715 
716  else if(eta_region==1){
717 
718  if( nohitInnermostLayer && nohitNextToInnermostLayer) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B01"));
719 
720  else if ( nohitInnermostLayer && !nohitNextToInnermostLayer ){
721  if ( exphitInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B02"));
722  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B03"));
723  }
724 
725  else if (!nohitInnermostLayer && nohitNextToInnermostLayer){
726  if ( exphitNextToInnermostLayer ) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B04"));
727  else gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B05"));
728  }
729 
730  else if (pixsharedClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B06"));
731  else if (pixoutlierClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B07"));
732  else if (pixspoiltClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B08"));
733 
734  else if(gamma_region==0) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B14_1"));
735  else if(gamma_region==1) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B14_2"));
736  else if(gamma_region==2) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B14_3"));
737  else if(gamma_region==3) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("B14_4"));
738 
739  } //eta_region = 1
740 
741  else if(eta_region==2){
742 
743  if(nohitInnermostLayer && nohitNextToInnermostLayer) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C01"));
744  else if (nohitInnermostLayer || nohitNextToInnermostLayer) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C02030405"));
745  else if (pixsharedClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C06"));
746  else if (pixoutlierClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C07"));
747  else if (pixspoiltClass) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C08"));
748 
749  else if(gamma_region==0) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C14_1"));
750  else if(gamma_region==1) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C14_2"));
751  else if(gamma_region==2) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C14_3"));
752  else if(gamma_region==3) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("C14_4"));
753 
754  }
755 
756  }
757 
758 
759 
760 
761  if (gradeToReturn==0) {
762  // others
763  if (ptFrac) gradeToReturn=m_trackGradesDefinition.getGrade(std::string("PtFrac"));
764 
765  else {
766  if (m_ptEtaGrades) {
767  ATH_MSG_VERBOSE(" category "<<ptEtaCategoryName);
768  gradeToReturn=m_trackGradesDefinition.getGrade(ptEtaCategoryName);
769  } else {
770  gradeToReturn=m_trackGradesDefinition.getGrade(std::string("Good"));
771  }
772  }
773  }
774 
775  if (gradeToReturn==0) {
776  ATH_MSG_ERROR("Grade not found. Internal error... ");
777  return nullptr;
778  }
779 
780  return new TrackGrade(*gradeToReturn);
781 }

◆ getTrackGradesDefinition()

const TrackGradesDefinition & Analysis::DetailedTrackGradeFactory::getTrackGradesDefinition ( ) const
overridevirtual

Implements Analysis::ITrackGradeFactory.

Definition at line 260 of file DetailedTrackGradeFactory.cxx.

261 {
263 }

◆ initialize()

StatusCode Analysis::DetailedTrackGradeFactory::initialize ( )
overridevirtual

AlgTool initialize method.

Definition at line 60 of file DetailedTrackGradeFactory.cxx.

61 {
62 
63  if ( m_useRun2TrackGrading==false ) {
66  }
67 
68  std::vector<TrackGrade> myGrades;
69  int nbGrades=0;
70 
72  if (m_hitBLayerGrade)
73  {
74  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitBLayer")));
75  nbGrades++;
76  }
78  {
79  myGrades.push_back(TrackGrade(nbGrades,std::string("Shared")));
80  nbGrades++;
81  }
82  if(m_useDetailSharedHitInfo) //Add By Bai Yu Nov 28,2011
83  {
84  myGrades.push_back(TrackGrade(nbGrades,std::string("BlaShared")));
85  nbGrades++;
86  myGrades.push_back(TrackGrade(nbGrades,std::string("PixShared")));
87  nbGrades++;
88  myGrades.push_back(TrackGrade(nbGrades,std::string("SctShared")));
89  nbGrades++;
90  }
91  }
92 
93  else if (m_useRun2TrackGrading){
95  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitIn0HitNInExp2")));
96  nbGrades++;
97  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitIn0HitNInExpIn")));
98  nbGrades++;
99  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitIn0HitNInExpNIn")));
100  nbGrades++;
101  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitIn0HitNIn")));
102  nbGrades++;
103  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitInExp")));
104  nbGrades++;
105  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitIn")));
106  nbGrades++;
107  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitNInExp")));
108  nbGrades++;
109  myGrades.push_back(TrackGrade(nbGrades,std::string("0HitNIn")));
110  nbGrades++;
111  }
113  myGrades.push_back(TrackGrade(nbGrades,std::string("InANDNInShared")));
114  nbGrades++;
115  myGrades.push_back(TrackGrade(nbGrades,std::string("PixShared")));
116  nbGrades++;
117  myGrades.push_back(TrackGrade(nbGrades,std::string("SctShared")));
118  nbGrades++;
119  }
121  myGrades.push_back(TrackGrade(nbGrades,std::string("InANDNInSplit")));
122  nbGrades++;
123  myGrades.push_back(TrackGrade(nbGrades,std::string("PixSplit")));
124  nbGrades++;
125  }
126  }
127 
128  else if(m_useITkTrackGrading){
129 
130  // Region A: |eta|<1
131 
132  myGrades.push_back( TrackGrade(nbGrades, std::string( "A01")) ); //no hit 1st pixel layer, no hit 2nd pixel layer
133  nbGrades++;
134  myGrades.push_back( TrackGrade(nbGrades, std::string( "A02")) ); //no hit 1st pixel layer but expected
135  nbGrades++;
136  myGrades.push_back( TrackGrade(nbGrades, std::string( "A03")) ); //no hit 1st pixel layer and not expected
137  nbGrades++;
138  myGrades.push_back( TrackGrade(nbGrades, std::string( "A04")) ); //no hit 2nd pixel layer but expected
139  nbGrades++;
140  myGrades.push_back( TrackGrade(nbGrades, std::string( "A05")) ); //no hit 2nd pixel layer and not expected
141  nbGrades++;
142  myGrades.push_back( TrackGrade(nbGrades, std::string( "A06")) ); //total number of shared pixel hits > 0
143  nbGrades++;
144  myGrades.push_back( TrackGrade(nbGrades, std::string( "A07")) ); //number of outliers in 1st+2nd pixel layer > 0
145  nbGrades++;
146  myGrades.push_back( TrackGrade(nbGrades, std::string( "A08")) ); //number of pixel spoilt hits >=2
147  nbGrades++;
148  myGrades.push_back( TrackGrade(nbGrades, std::string( "A14_1")) ); //good tracks gamma>0.75e-3
149  nbGrades++;
150  myGrades.push_back( TrackGrade(nbGrades, std::string( "A14_2")) ); //good tracks 0.5e-3<gamma<0.75e-3
151  nbGrades++;
152  myGrades.push_back( TrackGrade(nbGrades, std::string( "A14_3")) ); //good tracks 0.25e-3<gamma<0.5e-3
153  nbGrades++;
154  myGrades.push_back( TrackGrade(nbGrades, std::string( "A14_4")) ); //good tracks gamma<0.25e-3
155  nbGrades++;
156 
157  // Region B: 1<|eta|<2
158 
159  myGrades.push_back( TrackGrade(nbGrades, std::string( "B01")) ); //no hit 1st pixel layer, no hit 2nd pixel layer
160  nbGrades++;
161  myGrades.push_back( TrackGrade(nbGrades, std::string( "B02")) ); //no hit 1st pixel layer but expected
162  nbGrades++;
163  myGrades.push_back( TrackGrade(nbGrades, std::string( "B03")) ); //no hit 1st pixel layer and not expected
164  nbGrades++;
165  myGrades.push_back( TrackGrade(nbGrades, std::string( "B04")) ); //no hit 2nd pixel layer but expected
166  nbGrades++;
167  myGrades.push_back( TrackGrade(nbGrades, std::string( "B05")) ); //no hit 2nd pixel layer and not expected
168  nbGrades++;
169  myGrades.push_back( TrackGrade(nbGrades, std::string( "B06")) ); //total number of shared pixel hits > 0
170  nbGrades++;
171  myGrades.push_back( TrackGrade(nbGrades, std::string( "B07")) ); //number of outliers in 1st+2nd pixel layer > 0
172  nbGrades++;
173  myGrades.push_back( TrackGrade(nbGrades, std::string( "B08")) ); //number of pixel spoilt hits >=2
174  nbGrades++;
175  myGrades.push_back( TrackGrade(nbGrades, std::string( "B14_1")) ); //good tracks gamma>1.5e-3
176  nbGrades++;
177  myGrades.push_back( TrackGrade(nbGrades, std::string( "B14_2")) ); //good tracks 1e-3<gamma<1.5e-3
178  nbGrades++;
179  myGrades.push_back( TrackGrade(nbGrades, std::string( "B14_3")) ); //good tracks 0.5e-3<gamma<1e-3
180  nbGrades++;
181  myGrades.push_back( TrackGrade(nbGrades, std::string( "B14_4")) ); //good tracks gamma<0.5e-3
182  nbGrades++;
183 
184  // Region C: |eta|>2
185 
186  myGrades.push_back( TrackGrade(nbGrades, std::string( "C01")) ); //no hit 1st pixel layer, no hit 2nd pixel layer
187  nbGrades++;
188  myGrades.push_back( TrackGrade(nbGrades, std::string( "C02030405")) ); //no hit 1st pixel layer OR no hit 2nd pixel layer
189  nbGrades++;
190  myGrades.push_back( TrackGrade(nbGrades, std::string( "C06")) ); //total number of shared pixel hits > 0
191  nbGrades++;
192  myGrades.push_back( TrackGrade(nbGrades, std::string( "C07")) ); //number of outliers in 1st+2nd pixel layer > 0
193  nbGrades++;
194  myGrades.push_back( TrackGrade(nbGrades, std::string( "C08")) ); //number of pixel spoilt hits >=2
195  nbGrades++;
196  myGrades.push_back( TrackGrade(nbGrades, std::string( "C14_1")) ); //good tracks gamma>3e-3
197  nbGrades++;
198  myGrades.push_back( TrackGrade(nbGrades, std::string( "C14_2")) ); //good tracks 2e-3<gamma<3e-3
199  nbGrades++;
200  myGrades.push_back( TrackGrade(nbGrades, std::string( "C14_3")) ); //good tracks 1e-3<gamma<2e-3
201  nbGrades++;
202  myGrades.push_back( TrackGrade(nbGrades, std::string( "C14_4")) ); //good tracks gamma<1e-3
203  nbGrades++;
204 
205  }
206 
207  if (m_ptFracGrade) {
208  myGrades.push_back(TrackGrade(nbGrades,std::string("PtFrac")));
209  nbGrades++;
210  }
211 
212  // VD comment: the grading according to track eta/phi is only implemented for the good category
213  int ptGradeNumber=m_ptLowerCuts.size();
214  int etaGradeNumber=m_etaLowerCuts.size();
215 
216  if (m_ptEtaGrades) {
217  if (ptGradeNumber==0) {
218  ATH_MSG_ERROR("Vector with pt categories has 0 size!!! You need at least 1 lower cut...");
219  }
220 
221  if (etaGradeNumber==0) {
222  ATH_MSG_ERROR("Vector with eta categories has 0 size!!! You need at least 1 lower cut...");
223  }
224 
225  for (int i=0;i<ptGradeNumber;i++){
226  for (int j=0;j<etaGradeNumber;j++){
227  std::string nameGrade("Good");
228 
229  char namePt[30];
230  if (i<ptGradeNumber-1) {
231  sprintf(namePt,"Pt%.1f-%.1f",m_ptLowerCuts[i]*1e-3,m_ptLowerCuts[i+1]*1e-3);
232  } else {
233  sprintf(namePt,"Pt%.1f-inf",m_ptLowerCuts[i]*1e-3);
234  }
235 
236  char nameEta[30];
237  if (j<etaGradeNumber-1) {
238  sprintf(nameEta,"Eta%.1f-%.1f",m_etaLowerCuts[j],m_etaLowerCuts[j+1]);
239  } else {
240  sprintf(nameEta,"Eta%.1f-2.5",m_etaLowerCuts[j]);
241  }
242 
243  nameGrade+=namePt;
244  nameGrade+=nameEta;
245  ATH_MSG_DEBUG("Adding cat. pt "<<i<<" eta "<<j<<" name of Grade: "<<nameGrade);
246 
247  myGrades.push_back(TrackGrade(nbGrades,nameGrade));
248  nbGrades++;
249  }
250  }
251  } else {
252  myGrades.push_back(TrackGrade(nbGrades,std::string("Good")));
253  }
254 
255  m_trackGradesDefinition=TrackGradesDefinition(myGrades);
256 
257  return StatusCode::SUCCESS;
258 }

◆ 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& Analysis::ITrackGradeFactory::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 55 of file ITrackGradeFactory.h.

55 { return IID_ITrackGradeFactory; };

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

std::vector<double> Analysis::DetailedTrackGradeFactory::m_etaLowerCuts
private

Definition at line 77 of file DetailedTrackGradeFactory.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_gammaLowerCuts

std::vector<std::vector<double> > Analysis::DetailedTrackGradeFactory::m_gammaLowerCuts
private

Definition at line 79 of file DetailedTrackGradeFactory.h.

◆ m_hitBLayerGrade

bool Analysis::DetailedTrackGradeFactory::m_hitBLayerGrade
private

Definition at line 54 of file DetailedTrackGradeFactory.h.

◆ m_nOutlierPix

int Analysis::DetailedTrackGradeFactory::m_nOutlierPix
private

max. number of shared hits next-to-innermost pixel layer (Run1 B layer)

Definition at line 69 of file DetailedTrackGradeFactory.h.

◆ m_nSharedBLayer

int Analysis::DetailedTrackGradeFactory::m_nSharedBLayer
private

Definition at line 63 of file DetailedTrackGradeFactory.h.

◆ m_nSharedInnermostPixelLayer

int Analysis::DetailedTrackGradeFactory::m_nSharedInnermostPixelLayer
private

max. number of shared hits in pixels+SCT

Definition at line 67 of file DetailedTrackGradeFactory.h.

◆ m_nSharedNextToInnermostPixelLayer

int Analysis::DetailedTrackGradeFactory::m_nSharedNextToInnermostPixelLayer
private

max. number of shared hits in innermost pixel layer (IBL)

Definition at line 68 of file DetailedTrackGradeFactory.h.

◆ m_nSharedPix

int Analysis::DetailedTrackGradeFactory::m_nSharedPix
private

max. number of shared hits in B layer

Definition at line 64 of file DetailedTrackGradeFactory.h.

◆ m_nSharedSct

int Analysis::DetailedTrackGradeFactory::m_nSharedSct
private

max. number of shared hits in pixels

Definition at line 65 of file DetailedTrackGradeFactory.h.

◆ m_nSharedSi

int Analysis::DetailedTrackGradeFactory::m_nSharedSi
private

max. number of shared hits in SCT

Definition at line 66 of file DetailedTrackGradeFactory.h.

◆ m_nSpoiltPix

int Analysis::DetailedTrackGradeFactory::m_nSpoiltPix
private

max. number of pixel outliers in two first layers

Definition at line 70 of file DetailedTrackGradeFactory.h.

◆ m_ptEtaGrades

bool Analysis::DetailedTrackGradeFactory::m_ptEtaGrades
private

cut on ptFrac

Definition at line 75 of file DetailedTrackGradeFactory.h.

◆ m_ptFracCut

double Analysis::DetailedTrackGradeFactory::m_ptFracCut
private

Definition at line 73 of file DetailedTrackGradeFactory.h.

◆ m_ptFracGrade

bool Analysis::DetailedTrackGradeFactory::m_ptFracGrade
private

max. number of spoilt hits in pixel

Definition at line 72 of file DetailedTrackGradeFactory.h.

◆ m_ptLowerCuts

std::vector<double> Analysis::DetailedTrackGradeFactory::m_ptLowerCuts
private

grades in pt and/or |eta| of tracks

Definition at line 76 of file DetailedTrackGradeFactory.h.

◆ m_trackGradesDefinition

TrackGradesDefinition Analysis::DetailedTrackGradeFactory::m_trackGradesDefinition
private

Definition at line 52 of file DetailedTrackGradeFactory.h.

◆ m_useDetailSharedHitInfo

bool Analysis::DetailedTrackGradeFactory::m_useDetailSharedHitInfo
private

Definition at line 60 of file DetailedTrackGradeFactory.h.

◆ m_useDetailSplitHitInfo

bool Analysis::DetailedTrackGradeFactory::m_useDetailSplitHitInfo
private

Definition at line 61 of file DetailedTrackGradeFactory.h.

◆ m_useInnerLayers0HitInfo

bool Analysis::DetailedTrackGradeFactory::m_useInnerLayers0HitInfo
private

Definition at line 59 of file DetailedTrackGradeFactory.h.

◆ m_useITkTrackGrading

bool Analysis::DetailedTrackGradeFactory::m_useITkTrackGrading
private

Definition at line 58 of file DetailedTrackGradeFactory.h.

◆ m_useRun2TrackGrading

bool Analysis::DetailedTrackGradeFactory::m_useRun2TrackGrading
private

if false the following cuts are ignored

Definition at line 57 of file DetailedTrackGradeFactory.h.

◆ m_useSharedHitInfo

bool Analysis::DetailedTrackGradeFactory::m_useSharedHitInfo
private

Definition at line 55 of file DetailedTrackGradeFactory.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:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Analysis::DetailedTrackGradeFactory::m_nSharedPix
int m_nSharedPix
max. number of shared hits in B layer
Definition: DetailedTrackGradeFactory.h:64
xAOD::numberOfInnermostPixelLayerSplitHits
@ numberOfInnermostPixelLayerSplitHits
number of Pixel 0th layer barrel hits split by cluster splitting
Definition: TrackingPrimitives.h:240
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
xAOD::numberOfSCTSharedHits
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:272
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
Analysis::DetailedTrackGradeFactory::m_nSharedSi
int m_nSharedSi
max. number of shared hits in SCT
Definition: DetailedTrackGradeFactory.h:66
Analysis::TrackGradesDefinition::getGrade
const TrackGrade * getGrade(const std::string &) const
Definition: TrackGradesDefinition.cxx:59
xAOD::numberOfNextToInnermostPixelLayerSplitHits
@ numberOfNextToInnermostPixelLayerSplitHits
number of Pixel 1st layer barrel hits split by cluster splitting
Definition: TrackingPrimitives.h:251
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Analysis::DetailedTrackGradeFactory::m_hitBLayerGrade
bool m_hitBLayerGrade
Definition: DetailedTrackGradeFactory.h:54
Analysis::DetailedTrackGradeFactory::m_useSharedHitInfo
bool m_useSharedHitInfo
Definition: DetailedTrackGradeFactory.h:55
Analysis::DetailedTrackGradeFactory::m_ptFracCut
double m_ptFracCut
Definition: DetailedTrackGradeFactory.h:73
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
Analysis::DetailedTrackGradeFactory::m_nSharedSct
int m_nSharedSct
max. number of shared hits in pixels
Definition: DetailedTrackGradeFactory.h:65
xAOD::expectInnermostPixelLayerHit
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
Definition: TrackingPrimitives.h:236
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Analysis::DetailedTrackGradeFactory::m_nSharedNextToInnermostPixelLayer
int m_nSharedNextToInnermostPixelLayer
max. number of shared hits in innermost pixel layer (IBL)
Definition: DetailedTrackGradeFactory.h:68
Analysis::DetailedTrackGradeFactory::m_nSharedBLayer
int m_nSharedBLayer
Definition: DetailedTrackGradeFactory.h:63
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
Analysis::DetailedTrackGradeFactory::m_useDetailSplitHitInfo
bool m_useDetailSplitHitInfo
Definition: DetailedTrackGradeFactory.h:61
Analysis::DetailedTrackGradeFactory::m_nOutlierPix
int m_nOutlierPix
max. number of shared hits next-to-innermost pixel layer (Run1 B layer)
Definition: DetailedTrackGradeFactory.h:69
xAOD::numberOfInnermostPixelLayerOutliers
@ numberOfInnermostPixelLayerOutliers
number of 0th layer barrel outliers
Definition: TrackingPrimitives.h:238
xAOD::numberOfInnermostPixelLayerEndcapHits
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
Definition: TrackingPrimitives.h:242
xAOD::etaBin
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap etaBin
Definition: L2StandAloneMuon_v1.cxx:148
xAOD::numberOfPixelSharedHits
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
Definition: TrackingPrimitives.h:262
Analysis::DetailedTrackGradeFactory::m_ptFracGrade
bool m_ptFracGrade
max. number of spoilt hits in pixel
Definition: DetailedTrackGradeFactory.h:72
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::expectNextToInnermostPixelLayerHit
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
Definition: TrackingPrimitives.h:247
Analysis::DetailedTrackGradeFactory::m_trackGradesDefinition
TrackGradesDefinition m_trackGradesDefinition
Definition: DetailedTrackGradeFactory.h:52
TrigVtx::gamma
@ gamma
Definition: TrigParticleTable.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
Analysis::DetailedTrackGradeFactory::m_nSharedInnermostPixelLayer
int m_nSharedInnermostPixelLayer
max. number of shared hits in pixels+SCT
Definition: DetailedTrackGradeFactory.h:67
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Analysis::DetailedTrackGradeFactory::m_etaLowerCuts
std::vector< double > m_etaLowerCuts
Definition: DetailedTrackGradeFactory.h:77
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
xAOD::numberOfPixelSplitHits
@ numberOfPixelSplitHits
number of Pixel all-layer hits split by cluster splitting [unit8_t].
Definition: TrackingPrimitives.h:263
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
xAOD::numberOfNextToInnermostPixelLayerEndcapHits
@ numberOfNextToInnermostPixelLayerEndcapHits
these are the hits in the 0.5th and 1st pixel layer endcap rings [unit8_t].
Definition: TrackingPrimitives.h:253
Analysis::DetailedTrackGradeFactory::m_useITkTrackGrading
bool m_useITkTrackGrading
Definition: DetailedTrackGradeFactory.h:58
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
xAOD::numberOfNextToInnermostPixelLayerOutliers
@ numberOfNextToInnermostPixelLayerOutliers
number of 1st pixel layer barrel outliers
Definition: TrackingPrimitives.h:249
xAOD::numberOfNextToInnermostPixelLayerHits
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
Definition: TrackingPrimitives.h:248
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
xAOD::numberOfPixelSpoiltHits
@ numberOfPixelSpoiltHits
number of pixel hits with broad errors (width/sqrt(12)) [unit8_t].
Definition: TrackingPrimitives.h:267
Analysis::DetailedTrackGradeFactory::m_ptLowerCuts
std::vector< double > m_ptLowerCuts
grades in pt and/or |eta| of tracks
Definition: DetailedTrackGradeFactory.h:76
Analysis::DetailedTrackGradeFactory::m_nSpoiltPix
int m_nSpoiltPix
max. number of pixel outliers in two first layers
Definition: DetailedTrackGradeFactory.h:70
a
TList * a
Definition: liststreamerinfos.cxx:10
h
Analysis::DetailedTrackGradeFactory::m_ptEtaGrades
bool m_ptEtaGrades
cut on ptFrac
Definition: DetailedTrackGradeFactory.h:75
Analysis::DetailedTrackGradeFactory::m_useInnerLayers0HitInfo
bool m_useInnerLayers0HitInfo
Definition: DetailedTrackGradeFactory.h:59
Analysis::DetailedTrackGradeFactory::m_useDetailSharedHitInfo
bool m_useDetailSharedHitInfo
Definition: DetailedTrackGradeFactory.h:60
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
Analysis::DetailedTrackGradeFactory::m_gammaLowerCuts
std::vector< std::vector< double > > m_gammaLowerCuts
Definition: DetailedTrackGradeFactory.h:79
xAOD::numberOfInnermostPixelLayerSharedHits
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:239
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Analysis::DetailedTrackGradeFactory::m_useRun2TrackGrading
bool m_useRun2TrackGrading
if false the following cuts are ignored
Definition: DetailedTrackGradeFactory.h:57
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::numberOfNextToInnermostPixelLayerSharedHits
@ numberOfNextToInnermostPixelLayerSharedHits
number of Pixel 1st layer barrel hits shared by several tracks.
Definition: TrackingPrimitives.h:250
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
xAOD::numberOfInnermostPixelLayerHits
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Definition: TrackingPrimitives.h:237