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

#include <HITrackQualityAugmentationTool.h>

Inheritance diagram for DerivationFramework::HITrackQualityAugmentationTool:
Collaboration diagram for DerivationFramework::HITrackQualityAugmentationTool:

Public Types

enum  {
  PP_MIN_BIAS =1<<1, HI_LOOSE =1<<2, HI_LOOSE_7SCT_HITS =1<<5, HI_LOOSE_TIGHT_D0_Z0 =1<<7,
  HI_LOOSE_TIGHTER_D0_Z0 =1<<8, HI_TIGHT =1<<3, HI_TIGHT_TIGHTER_D0_Z0 =1<<4, HI_TIGHT_LOOSE_D0_Z0 =1<<6
}
 

Public Member Functions

 HITrackQualityAugmentationTool (const std::string &t, const std::string &n, const IInterface *p)
 
virtual StatusCode addBranches () const
 Pass the thinning service
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 ()
 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

unsigned short GetTrackQuality (const xAOD::TrackParticle *track, float z_vtx) const
 
unsigned short GetTrackQualityNew (const xAOD::TrackParticle *track, const xAOD::Vertex *pv) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< InDet::IInDetTrackSelectionToolm_trkSelTool_pp
 
ToolHandle< InDet::IInDetTrackSelectionToolm_trkSelTool_hi_loose
 
ToolHandle< InDet::IInDetTrackSelectionToolm_trkSelTool_hi_tight
 
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 23 of file HITrackQualityAugmentationTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
PP_MIN_BIAS 
HI_LOOSE 
HI_LOOSE_7SCT_HITS 
HI_LOOSE_TIGHT_D0_Z0 
HI_LOOSE_TIGHTER_D0_Z0 
HI_TIGHT 
HI_TIGHT_TIGHTER_D0_Z0 
HI_TIGHT_LOOSE_D0_Z0 

Definition at line 25 of file HITrackQualityAugmentationTool.h.

25  {
26  PP_MIN_BIAS=1<<1, //2
27 
28  HI_LOOSE=1<<2, // 4
29  HI_LOOSE_7SCT_HITS =1<<5, // 32
30  HI_LOOSE_TIGHT_D0_Z0 =1<<7, // 128
31  HI_LOOSE_TIGHTER_D0_Z0=1<<8, // 256
32 
33  HI_TIGHT=1<<3, //8
34  HI_TIGHT_TIGHTER_D0_Z0=1<<4, //16
35  HI_TIGHT_LOOSE_D0_Z0 =1<<6, //64
36 
37  };

Constructor & Destructor Documentation

◆ HITrackQualityAugmentationTool()

DerivationFramework::HITrackQualityAugmentationTool::HITrackQualityAugmentationTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 13 of file HITrackQualityAugmentationTool.cxx.

15  :
16  AthAlgTool(t,n,p)
17  {
18  declareInterface<DerivationFramework::IAugmentationTool>(this);
19  declareProperty("TrackSelectionTool_pp" ,m_trkSelTool_pp );
20  declareProperty("TrackSelectionTool_hi_loose",m_trkSelTool_hi_loose);
21  declareProperty("TrackSelectionTool_hi_tight",m_trkSelTool_hi_tight);
22  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::HITrackQualityAugmentationTool::addBranches ( ) const
virtual

Pass the thinning service

Implements DerivationFramework::IAugmentationTool.

Definition at line 26 of file HITrackQualityAugmentationTool.cxx.

26  {
27  // Set up the decorators
28  SG::AuxElement::Decorator<unsigned short> decorator("TrackQuality");
29 
30  // Get Primary vertex
31  const xAOD::VertexContainer* vertices = evtStore()->retrieve< const xAOD::VertexContainer >("PrimaryVertices");
32  if(!vertices) {
33  ATH_MSG_ERROR ("Couldn't retrieve VertexContainer with key PrimaryVertices");
34  return StatusCode::FAILURE;
35  }
36  const xAOD::Vertex* pv(0);
37  for (const xAOD::Vertex* vx : *vertices) {
38  if (vx->vertexType() == xAOD::VxType::PriVtx) {
39  pv = vx;
40  break;
41  }
42  }
43 
44  //commented out, not used and generates compiler warning
45  //float z_vtx=0;
46  //if(pv) z_vtx=pv->z();
47 
48 
49  // Get the track container
50  const xAOD::TrackParticleContainer* tracks = evtStore()->retrieve< const xAOD::TrackParticleContainer >("InDetTrackParticles");
51  if(!tracks) {
52  ATH_MSG_ERROR ("Couldn't retrieve TrackParticleContainer with key InDetTrackParticles");
53  return StatusCode::FAILURE;
54  }
55 
56 
57  // Get track quality this is what we're adding
58  for(const auto* track:*tracks) {
59  //for (xAOD::TrackParticleContainer::const_iterator trackIt=tracks->begin(); trackIt!=tracks->end(); ++trackIt)
60  //std::cout<<GetTrackQuality(*trackIt,z_vtx)<<std::endl;
61  if(pv) decorator(*track) =GetTrackQualityNew(track,pv);
62  else decorator(*track) = 0;
63  }
64 
65  return StatusCode::SUCCESS;
66 }

◆ 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

◆ GetTrackQuality()

unsigned short DerivationFramework::HITrackQualityAugmentationTool::GetTrackQuality ( const xAOD::TrackParticle track,
float  z_vtx 
) const
private

Definition at line 136 of file HITrackQualityAugmentationTool.cxx.

136  {
137  //-------------------------------------------------------------------------------------------------
138  float pt = track->pt();
139  float eta = track->eta();
140  //float phi = track->phi();
141 
142 
143  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_Ipix_hits("numberOfInnermostPixelLayerHits");
144  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_Ipix_expected("expectInnermostPixelLayerHit");
145  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_NIpix_hits("numberOfNextToInnermostPixelLayerHits");
146  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_NIpix_expected("expectNextToInnermostPixelLayerHit");
147  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_sct_hits("numberOfSCTHits");
148  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_pix_hits("numberOfPixelHits");
149  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_sct_holes("numberOfSCTHoles");
150  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_sct_dead("numberOfSCTDeadSensors");
151  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_pix_dead("numberOfPixelDeadSensors");
152 
153  int n_Ipix_hits = acc_n_Ipix_hits(*track);
154  int n_Ipix_expected = acc_n_Ipix_expected(*track);
155  int n_NIpix_hits = acc_n_NIpix_hits(*track);
156  int n_NIpix_expected = acc_n_NIpix_expected(*track);
157  int n_sct_hits = acc_n_sct_hits(*track);
158  int n_pix_hits = acc_n_pix_hits(*track);
159  int n_sct_holes = acc_n_sct_holes(*track);
160  int n_sct_dead = acc_n_sct_dead(*track);
161  int n_pix_dead = acc_n_pix_dead(*track);
162 
163 
164  float chi2=track->chiSquared();
165  float ndof=track->numberDoF();
166 
167  float d0 = track->d0();
168  float z0_wrtPV= track->z0()+track->vz()-z_vtx;
169  float theta = track->theta();
170  //-------------------------------------------------------------------------------------------------
171 
172 
173  //-------------------------------------------------------------------------------------------------
174  bool pass_min_bias=true;
175  {
176  if(fabs(eta)>2.5) pass_min_bias=false;
177  if(n_Ipix_expected>0){
178  if (n_Ipix_hits==0) pass_min_bias=false;
179  }
180  else{
181  if(n_NIpix_expected>0 && n_NIpix_hits==0) pass_min_bias=false;
182  }
183 
184  int n_sct=n_sct_hits+n_sct_dead;
185  if (pt<=300) {if (n_sct <2) pass_min_bias=false;}
186  else if(pt<=400) {if (n_sct <4) pass_min_bias=false;}
187  else if(pt> 400) {if (n_sct <6) pass_min_bias=false;}
188 
189  int n_pix=n_pix_hits+n_pix_dead;
190  if(n_pix<=0) pass_min_bias=false;
191 
192  if(fabs(d0)>1.5) pass_min_bias=false;
193  if(fabs(z0_wrtPV*sin(theta))>1.5) pass_min_bias=false;
194 
195  if(pt>10000 && TMath::Prob(chi2,ndof)<=0.01) pass_min_bias=false;
196  //if(n_sct_holes>1 || n_pix_holes>0) continue;
197  //if(n_pix_hits<3 || n_sct_hits<8) continue;
198  }
199  //-------------------------------------------------------------------------------------------------
200 
201 
202 
203  //-------------------------------------------------------------------------------------------------
204  bool pass_hi_loose=true;
205  {
206  if(fabs(eta)>2.5) pass_hi_loose=false;
207  if(n_Ipix_expected>0){
208  if (n_Ipix_hits==0) pass_hi_loose=false;
209  }
210  else{
211  if(n_NIpix_expected>0 && n_NIpix_hits==0) pass_hi_loose=false;
212  }
213 
214  if(n_pix_hits==0) pass_hi_loose=false;
215  if(n_sct_hits< 6) pass_hi_loose=false;
216  if(pt>10000 && TMath::Prob(chi2,ndof)<=0.01) pass_hi_loose=false;
217  if(fabs(d0) >1.5) pass_hi_loose=false;
218  if(fabs(z0_wrtPV*sin(theta))>1.5) pass_hi_loose=false;
219  }
220  //-------------------------------------------------------------------------------------------------
221 
222 
223 
224  //-------------------------------------------------------------------------------------------------
225  bool pass_hi_loose_additional_SCT_hit=true;
226  if(!pass_hi_loose) pass_hi_loose_additional_SCT_hit=false;
227  else{
228  if(n_sct_hits<7) pass_hi_loose_additional_SCT_hit=false;
229  }
230  //-------------------------------------------------------------------------------------------------
231 
232 
233 
234  //-------------------------------------------------------------------------------------------------
235  bool pass_hi_loose_tight_d0_z0=true;
236  if(!pass_hi_loose || fabs(d0)>1.0 || fabs(z0_wrtPV*sin(theta))>1.0) pass_hi_loose_tight_d0_z0=false;
237  //-------------------------------------------------------------------------------------------------
238 
239 
240 
241  //-------------------------------------------------------------------------------------------------
242  bool pass_hi_loose_tighter_d0_z0=true;
243  if(!pass_hi_loose || fabs(d0)>0.5 || fabs(z0_wrtPV*sin(theta))>0.5) pass_hi_loose_tighter_d0_z0=false;
244  //-------------------------------------------------------------------------------------------------
245 
246 
247 
248  //-------------------------------------------------------------------------------------------------
249  bool pass_hi_tight_loose_d0_z0=true;
250  if(!pass_hi_loose) pass_hi_tight_loose_d0_z0=false;
251  else{
252  if(n_pix_hits <2 ) pass_hi_tight_loose_d0_z0=false;
253  if(n_sct_hits <8 ) pass_hi_tight_loose_d0_z0=false;
254  if(n_sct_holes>1 ) pass_hi_tight_loose_d0_z0=false;
255  if(ndof==0) pass_hi_tight_loose_d0_z0=false;
256  else if(chi2/ndof>6) pass_hi_tight_loose_d0_z0=false;
257  }
258  //-------------------------------------------------------------------------------------------------
259 
260 
261 
262  //-------------------------------------------------------------------------------------------------
263  bool pass_hi_tight=true;
264  if(!pass_hi_loose) pass_hi_tight=false;
265  else{
266  if(n_pix_hits <2 ) pass_hi_tight=false;
267  if(n_sct_hits <8 ) pass_hi_tight=false;
268  if(n_sct_holes>1 ) pass_hi_tight=false;
269  if(fabs(d0) >1.0) pass_hi_tight=false;
270  if(fabs(z0_wrtPV*sin(theta))>1.0) pass_hi_tight=false;
271  if(ndof==0) pass_hi_tight=false;
272  else if(chi2/ndof>6) pass_hi_tight=false;
273  }
274  //-------------------------------------------------------------------------------------------------
275 
276 
277 
278  //-------------------------------------------------------------------------------------------------
279  bool pass_hi_tight_tighter_d0_z0=true;
280  if(!pass_hi_tight) pass_hi_tight_tighter_d0_z0=false;
281  else{
282  if(fabs(d0)>0.5 || fabs(z0_wrtPV*sin(theta))>0.5) pass_hi_tight_tighter_d0_z0=false;
283  }
284  //-------------------------------------------------------------------------------------------------
285 
286 
287 
288 
289 
290  unsigned short quality =0;
291  if(pass_min_bias ) quality+=PP_MIN_BIAS;
292  if(pass_hi_loose ) quality+=HI_LOOSE;
293  if(pass_hi_loose_additional_SCT_hit) quality+=HI_LOOSE_7SCT_HITS;
294  if(pass_hi_loose_tight_d0_z0 ) quality+=HI_LOOSE_TIGHT_D0_Z0;
295  if(pass_hi_loose_tighter_d0_z0 ) quality+=HI_LOOSE_TIGHTER_D0_Z0;
296  if(pass_hi_tight_loose_d0_z0 ) quality+=HI_TIGHT_LOOSE_D0_Z0;
297  if(pass_hi_tight ) quality+=HI_TIGHT;
298  if(pass_hi_tight_tighter_d0_z0 ) quality+=HI_TIGHT_TIGHTER_D0_Z0;
299  return quality;
300 }

◆ GetTrackQualityNew()

unsigned short DerivationFramework::HITrackQualityAugmentationTool::GetTrackQualityNew ( const xAOD::TrackParticle track,
const xAOD::Vertex pv 
) const
private

Definition at line 69 of file HITrackQualityAugmentationTool.cxx.

69  {
70 
71  static const SG::AuxElement::ConstAccessor<unsigned char> acc_n_sct_hits("numberOfSCTHits");
72  int n_sct_hits = acc_n_sct_hits(*track);
73 
74 
75  float d0 = track->d0();
76  float z0_wrtPV= track->z0()+track->vz()-pv->z();
77  float theta = track->theta();
78 
79  //-------------------------------------------------------------------------------------------------
80  bool pass_min_bias=false;
81  if (m_trkSelTool_pp->accept(*track, pv)) pass_min_bias=true;
82  //-------------------------------------------------------------------------------------------------
83  //-------------------------------------------------------------------------------------------------
84  bool pass_hi_loose=false;
85  if (m_trkSelTool_hi_loose->accept(*track, pv)) pass_hi_loose=true;
86  //-------------------------------------------------------------------------------------------------
87  //-------------------------------------------------------------------------------------------------
88  bool pass_hi_loose_additional_SCT_hit=true;
89  if(!pass_hi_loose || n_sct_hits<7) pass_hi_loose_additional_SCT_hit=false;
90  //-------------------------------------------------------------------------------------------------
91  //-------------------------------------------------------------------------------------------------
92  bool pass_hi_loose_tight_d0_z0=true;
93  if(!pass_hi_loose || fabs(d0)>1.0 || fabs(z0_wrtPV*sin(theta))>1.0) pass_hi_loose_tight_d0_z0=false;
94  //-------------------------------------------------------------------------------------------------
95  //-------------------------------------------------------------------------------------------------
96  bool pass_hi_loose_tighter_d0_z0=true;
97  if(!pass_hi_loose || fabs(d0)>0.5 || fabs(z0_wrtPV*sin(theta))>0.5) pass_hi_loose_tighter_d0_z0=false;
98  //-------------------------------------------------------------------------------------------------
99  //-------------------------------------------------------------------------------------------------
100  bool pass_hi_tight=false;
101  if (m_trkSelTool_hi_tight->accept(*track, pv)) pass_hi_tight=true;
102  //-------------------------------------------------------------------------------------------------
103  //-------------------------------------------------------------------------------------------------
104  bool pass_hi_tight_loose_d0_z0=true;
105  if(pass_hi_tight==false){
106  const auto& taccept = m_trkSelTool_hi_tight->getAcceptInfo();
107  asg::AcceptData acceptData(&taccept);
108  static const auto d0Index = taccept.getCutPosition("D0");
109  static const auto z0Index = taccept.getCutPosition("Z0SinTheta");
110  static const auto nCuts = taccept.getNCuts();
111  auto cutBitset = acceptData.getCutResultBitSet();
112  cutBitset |= (1 << d0Index) | (1 << z0Index);
113  if(cutBitset.count() != nCuts ) pass_hi_tight_loose_d0_z0=false;
114  if(fabs(d0)>1.5 || fabs(z0_wrtPV*sin(theta))>1.5) pass_hi_tight_loose_d0_z0=false;
115  }
116  //-------------------------------------------------------------------------------------------------
117  //-------------------------------------------------------------------------------------------------
118  bool pass_hi_tight_tighter_d0_z0=true;
119  if(!pass_hi_tight || fabs(d0)>0.5 || fabs(z0_wrtPV*sin(theta))>0.5) pass_hi_tight_tighter_d0_z0=false;
120  //-------------------------------------------------------------------------------------------------
121 
122  unsigned short quality =0;
123  if(pass_min_bias ) quality+=PP_MIN_BIAS;
124  if(pass_hi_loose ) quality+=HI_LOOSE;
125  if(pass_hi_loose_additional_SCT_hit) quality+=HI_LOOSE_7SCT_HITS;
126  if(pass_hi_loose_tight_d0_z0 ) quality+=HI_LOOSE_TIGHT_D0_Z0;
127  if(pass_hi_loose_tighter_d0_z0 ) quality+=HI_LOOSE_TIGHTER_D0_Z0;
128  if(pass_hi_tight_loose_d0_z0 ) quality+=HI_TIGHT_LOOSE_D0_Z0;
129  if(pass_hi_tight ) quality+=HI_TIGHT;
130  if(pass_hi_tight_tighter_d0_z0 ) quality+=HI_TIGHT_TIGHTER_D0_Z0;
131  return quality;
132 }

◆ 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& DerivationFramework::IAugmentationTool::interfaceID ( )
inlinestaticinherited

AlgTool interface methods.

Definition at line 31 of file IAugmentationTool.h.

31 { return IID_IAugmentationTool; }

◆ 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_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_trkSelTool_hi_loose

ToolHandle<InDet::IInDetTrackSelectionTool> DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_hi_loose
private

Definition at line 44 of file HITrackQualityAugmentationTool.h.

◆ m_trkSelTool_hi_tight

ToolHandle<InDet::IInDetTrackSelectionTool> DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_hi_tight
private

Definition at line 45 of file HITrackQualityAugmentationTool.h.

◆ m_trkSelTool_pp

ToolHandle<InDet::IInDetTrackSelectionTool> DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_pp
private

Definition at line 43 of file HITrackQualityAugmentationTool.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:
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:134
DerivationFramework::HITrackQualityAugmentationTool::HI_LOOSE
@ HI_LOOSE
Definition: HITrackQualityAugmentationTool.h:28
DerivationFramework::HITrackQualityAugmentationTool::HI_TIGHT_LOOSE_D0_Z0
@ HI_TIGHT_LOOSE_D0_Z0
Definition: HITrackQualityAugmentationTool.h:35
DerivationFramework::HITrackQualityAugmentationTool::HI_TIGHT
@ HI_TIGHT
Definition: HITrackQualityAugmentationTool.h:33
DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_pp
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool_pp
Definition: HITrackQualityAugmentationTool.h:43
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
theta
Scalar theta() const
theta method
Definition: AmgMatrixBasePlugin.h:75
DerivationFramework::HITrackQualityAugmentationTool::PP_MIN_BIAS
@ PP_MIN_BIAS
Definition: HITrackQualityAugmentationTool.h:26
test_pyathena.pt
pt
Definition: test_pyathena.py:11
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
DerivationFramework::HITrackQualityAugmentationTool::HI_LOOSE_7SCT_HITS
@ HI_LOOSE_7SCT_HITS
Definition: HITrackQualityAugmentationTool.h:29
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_hi_loose
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool_hi_loose
Definition: HITrackQualityAugmentationTool.h:44
DerivationFramework::HITrackQualityAugmentationTool::HI_LOOSE_TIGHT_D0_Z0
@ HI_LOOSE_TIGHT_D0_Z0
Definition: HITrackQualityAugmentationTool.h:30
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
DerivationFramework::HITrackQualityAugmentationTool::m_trkSelTool_hi_tight
ToolHandle< InDet::IInDetTrackSelectionTool > m_trkSelTool_hi_tight
Definition: HITrackQualityAugmentationTool.h:45
DerivationFramework::HITrackQualityAugmentationTool::HI_LOOSE_TIGHTER_D0_Z0
@ HI_LOOSE_TIGHTER_D0_Z0
Definition: HITrackQualityAugmentationTool.h:31
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
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
beamspotman.n
n
Definition: beamspotman.py:731
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:523
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
a
TList * a
Definition: liststreamerinfos.cxx:10
h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
python.changerun.pv
pv
Definition: changerun.py:81
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
DerivationFramework::HITrackQualityAugmentationTool::GetTrackQualityNew
unsigned short GetTrackQualityNew(const xAOD::TrackParticle *track, const xAOD::Vertex *pv) const
Definition: HITrackQualityAugmentationTool.cxx:69
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
DerivationFramework::HITrackQualityAugmentationTool::HI_TIGHT_TIGHTER_D0_Z0
@ HI_TIGHT_TIGHTER_D0_Z0
Definition: HITrackQualityAugmentationTool.h:34
asg::AcceptData
Definition: AcceptData.h:30
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