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

Implements Hypo selection on triggering displaced vertex. More...

#include <TrigHitDVHypoAlg.h>

Inheritance diagram for TrigHitDVHypoAlg:
Collaboration diagram for TrigHitDVHypoAlg:

Public Member Functions

 TrigHitDVHypoAlg (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual StatusCode initialize () override
 
virtual StatusCode execute (const EventContext &context) const override
 
virtual StatusCode sysInitialize () override
 initialise this base class More...
 
virtual bool isClonable () const override
 Specify if the algorithm is clonable. More...
 
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant. More...
 
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
virtual bool filterPassed (const EventContext &ctx) const
 
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode 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 StatusCode runtimeValidation (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MsgStream &msg, bool onlyValidateOneStep=true, bool runTwoConversion=false)
 Executes all individual runtime tests. More...
 

Protected Member Functions

const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput () const
 methods for derived classes to access handles of the base class input other read/write handles may be implemented by derived classes More...
 
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput () const
 methods for derived classes to access handles of the base class output other read/write handles may be implemented by derived classes
More...
 
StatusCode hypoBaseOutputProcessing (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
 Base class function to be called once slice specific code has finished. Handles debug printing and validation. More...
 
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

using SeedType = TrigHitDVHypoTool::SeedType
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

StatusCode doMonitor (const xAOD::TrigCompositeContainer *) const
 
float deltaR2 (float, float, float, float) const
 
int getSPLayer (int, float) const
 
StatusCode findSPSeeds (const EventContext &, const std::vector< HitDVSpacePoint > &, std::vector< float > &, std::vector< float > &) const
 
StatusCode findJetSeeds (const xAOD::JetContainer *, const float, const float, std::vector< float > &, std::vector< float > &, std::vector< float > &) const
 
StatusCode selectSeedsNearby (const std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< float > &jetSeeds_eta, std::vector< float > &jetSeeds_phi, std::vector< float > &jetSeeds_pt) const
 
StatusCode calculateBDT (const std::vector< HitDVSpacePoint > &, const std::vector< HitDVTrk > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const float &, const int, xAOD::TrigCompositeContainer *, int &) const
 
StatusCode findSPSeeds (const EventContext &ctx, const std::vector< float > &v_sp_eta, const std::vector< float > &v_sp_phi, const std::vector< int > &v_sp_layer, const std::vector< int > &v_sp_usedTrkId, std::vector< float > &seeds_eta, std::vector< float > &seeds_phi) const
 
StatusCode findHitDV (const EventContext &ctx, const std::vector< TrigSiSpacePointBase > &convertedSpacePoints, const DataVector< Trk::Track > &tracks, std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< HitDVTrk > &hitDVTrksContainer, std::vector< HitDVSpacePoint > &hitDVSPContainer) const
 
StatusCode printDebugInformation (SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl) const
 Common base function to print information on chains passed by objects considered in the hypo. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ToolHandle< ITrigSpacePointConversionToolm_spacePointTool {this, "SpacePointProviderTool", "TrigSpacePointConversionTool"}
 
ToolHandleArray< TrigHitDVHypoToolm_hypoTools {this, "HypoTools", {}, "Tools to perform selection"}
 
SG::ReadHandleKey< xAOD::JetContainerm_jetsKey {this, "Jets", "HLT_AntiKt4EMTopoJets_subjesIS", ""}
 
SG::WriteHandleKey< xAOD::TrigCompositeContainerm_hitDVKey {this, "HitDV", "HLT_HitDV", ""}
 
SG::ReadHandleKey< TrackCollectionm_tracksKey {this, "HitDVTracks", "HLT_IDTrkTrack_FS_FTF", ""}
 
ToolHandle< ILumiBlockMuToolm_lumiBlockMuTool
 
SG::ReadCondHandleKey< LuminosityCondDatam_lumiDataKey {this, "LuminosityCondDataKey", "LuminosityCondData", ""}
 
Gaudi::Property< bool > m_isMC {this, "isMC", false, "Real data or MC"}
 
Gaudi::Property< float > m_jetSeed_ptMin {this, "jetSeed_ptMin", 50.0, "Minimum pT for jet seed"}
 
Gaudi::Property< float > m_jetSeed_etaMax {this, "jetSeed_etaMin", 2.0, "Maximum eta for jet seed"}
 
Gaudi::Property< std::string > m_hitDVLinkName {this, "hitDVLinkName", "HitDVSeedLink", "Name of the link to HitDVContainer. Used by ViewCreatorROITool."}
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 
std::unique_ptr< MVAUtils::BDTm_bdt_eta [2]
 
int m_tools_lowest_jetEt = 1000
 
int m_tools_loosest_wp = 0
 
bool m_useBeamSpot = true
 
bool m_doHitDV_Seeding = true
 
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainerm_jetRoiCollectionKey {this, "jFexSRJetRoI", "", ""}
 
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
 
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainerm_input { this, "HypoInputDecisions", "UNSPECIFIED_INPUT", "Input Decision (implicit)" }
 input decisions More...
 
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainerm_output { this, "HypoOutputDecisions", "UNSPECIFIED_OUTPUT", "Ouput Decision" }
 output decisions More...
 
Gaudi::Property< bool > m_runtimeValidation { this, "RuntimeValidation", false, "Enable detailed runtime validation of HypoAlg output, and upstream Decisions." }
 Enabling of detailed validation checks for use during development. More...
 
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks. More...
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Runtime validation methods


enum  LogicalFlowCheckMode { kRequireOne, kRequireAll }
 
static StatusCode validateHasLinks (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure all Decisions have the named ElementLink graph edges which they are required to by spec. More...
 
static StatusCode validateLogicalFlow (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, const LogicalFlowCheckMode mode)
 Ensure that all DecisionIDs have propagated correctly from their parent. More...
 
static StatusCode validateDuplicatedDecisionID (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects. More...
 
static StatusCode validateDecisionIDs (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 Ensure that all present IDs correspond to configured chains. More...
 
static StatusCode validateParentLinking (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool runTwoConversion)
 Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTSeeding. More...
 
static StatusCode recursiveValidateGraph (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool onlyValidateOneStep, bool runTwoConversion, size_t callDepth, std::set< const TrigCompositeUtils::Decision * > &fullyExploredFrom)
 Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1. More...
 
static void printBangs (MsgStream &msg)
 Print header line. More...
 
static void printErrorHeader (const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
 A problem was found, print common output data. More...
 

Detailed Description

Implements Hypo selection on triggering displaced vertex.

Author
Kunihiro Nagano kunih.nosp@m.iro..nosp@m.nagan.nosp@m.o@ce.nosp@m.rn.ch - KEK

Definition at line 63 of file TrigHitDVHypoAlg.h.

Member Typedef Documentation

◆ SeedType

Definition at line 94 of file TrigHitDVHypoAlg.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ LogicalFlowCheckMode

enum HypoBase::LogicalFlowCheckMode
privateinherited
Enumerator
kRequireOne 

Require all DecisionIDs to be present in at least one of my parent Decision objects.

kRequireAll 

Definition at line 52 of file HypoBase.h.

52  {
53  kRequireOne,
54  kRequireAll //<! Require all DecisionIDs to be present in all of my parent Decision objects
55  };

Constructor & Destructor Documentation

◆ TrigHitDVHypoAlg()

TrigHitDVHypoAlg::TrigHitDVHypoAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 46 of file TrigHitDVHypoAlg.cxx.

47  :
48  ::HypoBase( name, pSvcLocator ),
49  m_lumiBlockMuTool("LumiBlockMuTool/LumiBlockMuTool")
50 {}

Member Function Documentation

◆ calculateBDT()

StatusCode TrigHitDVHypoAlg::calculateBDT ( const std::vector< HitDVSpacePoint > &  spsContainer,
const std::vector< HitDVTrk > &  trksContainer,
const std::vector< float > &  seeds_pt,
const std::vector< float > &  seeds_eta,
const std::vector< float > &  seeds_phi,
const float &  cutBDTthreshold,
const int  seed_type,
xAOD::TrigCompositeContainer dvContainer,
int &  n_passed 
) const
private

Definition at line 555 of file TrigHitDVHypoAlg.cxx.

561 {
562  if( seeds_eta.size() != seeds_phi.size() ) return StatusCode::SUCCESS;
563  n_passed = 0;
564 
565  for(unsigned int iseed=0; iseed<seeds_eta.size(); iseed++) {
566 
567  float seed_eta = seeds_eta[iseed];
568  float seed_phi = seeds_phi[iseed];
569 
570  ATH_MSG_VERBOSE("+++++ seed eta: " << seed_eta << ", phi:" << seed_phi << " +++++");
571 
572  // loop on space points
573  const int N_LAYER = 8;
574  const float DR_SQUARED_TO_REF_CUT = 0.16; // const float DR_TO_REF_CUT = 0.4;
575 
576  int n_sp_injet = 0;
577  int n_sp_injet_usedByTrk = 0;
578  int v_n_sp_injet[N_LAYER];
579  int v_n_sp_injet_usedByTrk[N_LAYER];
580  for(int i=0; i<N_LAYER; i++) { v_n_sp_injet[i]=0; v_n_sp_injet_usedByTrk[i]=0; }
581 
582  for ( const auto & spData : spsContainer ) {
583  // match within dR
584  float sp_eta = spData.eta;
585  float sp_phi = spData.phi;
586  float dR2 = deltaR2(sp_eta,sp_phi,seed_eta,seed_phi);
587  if( dR2 > DR_SQUARED_TO_REF_CUT ) continue;
588 
589  //
590  int sp_layer = (int)spData.layer;
591  int sp_trkid = (int)spData.usedTrkId;
592  bool isUsedByTrk = (sp_trkid != -1);
593 
594  int ilayer = getSPLayer(sp_layer,sp_eta);
595 
596  if( ilayer<=7 ) { // Pixel barrel or Sct barrel
597  n_sp_injet++;
598  v_n_sp_injet[ilayer]++;
599  if( isUsedByTrk ) {
600  n_sp_injet_usedByTrk++;
601  v_n_sp_injet_usedByTrk[ilayer]++;
602  }
603  }
604  }
605  ATH_MSG_VERBOSE("nr of SPs in jet: usedByTrk / all = " << n_sp_injet_usedByTrk << " / " << n_sp_injet);
606  float v_ly_sp_frac[N_LAYER];
607  for(int i=0; i<N_LAYER; i++) {
608  float frac = 0.;
609  if( v_n_sp_injet[i] > 0 ) frac = 1.0 - static_cast<float>(v_n_sp_injet_usedByTrk[i]) / static_cast<float>(v_n_sp_injet[i]);
610  v_ly_sp_frac[i] = frac;
611  ATH_MSG_VERBOSE("Layer " << i << ": frac=" << v_ly_sp_frac[i] << ", n used / all = " << v_n_sp_injet_usedByTrk[i] << " / " << v_n_sp_injet[i]);
612  }
613 
614  // loop on tracks
615  const float TRK_PT_GEV_CUT = 2.0;
616 
617  unsigned int n_qtrk_injet = 0;
618  for ( const auto& trk : trksContainer ) {
619  float trk_ptGeV = trk.pt;
620  trk_ptGeV /= Gaudi::Units::GeV;
621  if( trk_ptGeV < TRK_PT_GEV_CUT ) continue;
622  float dR2 = deltaR2(trk.eta,trk.phi,seed_eta,seed_phi);
623  if( dR2 > DR_SQUARED_TO_REF_CUT ) continue;
624  n_qtrk_injet++;
625  }
626  ATH_MSG_DEBUG("nr of all / quality tracks matched = " << trksContainer.size() << " / " << n_qtrk_injet);
627 
628  // evaluate BDT
629  bool isSeedOutOfRange = false;
630  if( n_qtrk_injet == 0 ) {
631  isSeedOutOfRange = true;
632  for(int i=0; i<N_LAYER; i++) {
633  if( std::fabs(v_ly_sp_frac[i]) > 1e-3 ) {
634  isSeedOutOfRange = false; break;
635  }
636  }
637  }
638  float bdt_score = -2.0;
639  if( ! isSeedOutOfRange ) {
640  const std::vector<float> input_values = {
641  static_cast<float>(n_qtrk_injet),
642  v_ly_sp_frac[0],
643  v_ly_sp_frac[1],
644  v_ly_sp_frac[2],
645  v_ly_sp_frac[3],
646  v_ly_sp_frac[4],
647  v_ly_sp_frac[5],
648  v_ly_sp_frac[6],
649  v_ly_sp_frac[7] };
650 
651  if ( std::abs(seed_eta) < 1 ) {
652  bdt_score = m_bdt_eta[0]->GetClassification(input_values);
653  } else if ( std::abs(seed_eta) < 2 ) {
654  bdt_score = m_bdt_eta[1]->GetClassification(input_values);
655  }
656  }
657 
658  // BDT threshold
659  if( bdt_score < cutBDTthreshold ) continue;
660 
661  // passed selection
662  ATH_MSG_VERBOSE("Passed selection");
663  n_passed++;
664 
665  // create EDM object
667  dv->makePrivateStore();
668  dvContainer->push_back(dv);
669 
670  float seed_pt = 0;
671  if ( seed_type == SeedType::HLTJet ) seed_pt = seeds_pt[iseed];
672  dv->setDetail<float>("hitDV_seed_pt", seed_pt);
673  dv->setDetail<float>("hitDV_seed_eta", seed_eta);
674  dv->setDetail<float>("hitDV_seed_phi", seed_phi);
675  dv->setDetail<int> ("hitDV_seed_type", seed_type);
676  dv->setDetail<int> ("hitDV_n_track_qual", n_qtrk_injet);
677  dv->setDetail<float>("hitDV_ly0_sp_frac", v_ly_sp_frac[0]);
678  dv->setDetail<float>("hitDV_ly1_sp_frac", v_ly_sp_frac[1]);
679  dv->setDetail<float>("hitDV_ly2_sp_frac", v_ly_sp_frac[2]);
680  dv->setDetail<float>("hitDV_ly3_sp_frac", v_ly_sp_frac[3]);
681  dv->setDetail<float>("hitDV_ly4_sp_frac", v_ly_sp_frac[4]);
682  dv->setDetail<float>("hitDV_ly5_sp_frac", v_ly_sp_frac[5]);
683  dv->setDetail<float>("hitDV_ly6_sp_frac", v_ly_sp_frac[6]);
684  dv->setDetail<float>("hitDV_ly7_sp_frac", v_ly_sp_frac[7]);
685  dv->setDetail<float>("hitDV_bdt_score", bdt_score);
686 
687  ATH_MSG_VERBOSE("Created a new entry EDM");
688  }
689  ATH_MSG_DEBUG("nr of BDT passed = " << n_passed);
690 
691  //
692  return StatusCode::SUCCESS;
693 }

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64 {
65  return 0;
66 }

◆ decisionInput()

const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & HypoBase::decisionInput ( ) const
protectedinherited

methods for derived classes to access handles of the base class input other read/write handles may be implemented by derived classes

Definition at line 16 of file HypoBase.cxx.

16  {
17  return m_input;
18 }

◆ decisionOutput()

const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & HypoBase::decisionOutput ( ) const
protectedinherited

methods for derived classes to access handles of the base class output other read/write handles may be implemented by derived classes

Definition at line 20 of file HypoBase.cxx.

20  {
21  return m_output;
22 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ deltaR2()

float TrigHitDVHypoAlg::deltaR2 ( float  eta_1,
float  phi_1,
float  eta_2,
float  phi_2 
) const
private

Definition at line 323 of file TrigHitDVHypoAlg.cxx.

323  {
324  float dPhi = CxxUtils::wrapToPi(phi_1 - phi_2);
325  float dEta = eta_1 - eta_2;
326  return (dPhi*dPhi)+(dEta*dEta);
327 }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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; }

◆ doMonitor()

StatusCode TrigHitDVHypoAlg::doMonitor ( const xAOD::TrigCompositeContainer dvContainer) const
private

Definition at line 456 of file TrigHitDVHypoAlg.cxx.

457 {
458  std::vector<float> mnt_eta1_ly0_spfr;
459  std::vector<float> mnt_eta1_ly1_spfr;
460  std::vector<float> mnt_eta1_ly2_spfr;
461  std::vector<float> mnt_eta1_ly3_spfr;
462  std::vector<float> mnt_eta1_ly4_spfr;
463  std::vector<float> mnt_eta1_ly5_spfr;
464  std::vector<float> mnt_eta1_ly6_spfr;
465  std::vector<float> mnt_eta1_ly7_spfr;
466  std::vector<int> mnt_eta1_n_qtrk;
467  std::vector<float> mnt_eta1_bdtscore;
468  std::vector<float> mnt_1eta2_ly0_spfr;
469  std::vector<float> mnt_1eta2_ly1_spfr;
470  std::vector<float> mnt_1eta2_ly2_spfr;
471  std::vector<float> mnt_1eta2_ly3_spfr;
472  std::vector<float> mnt_1eta2_ly4_spfr;
473  std::vector<float> mnt_1eta2_ly5_spfr;
474  std::vector<float> mnt_1eta2_ly6_spfr;
475  std::vector<float> mnt_1eta2_ly7_spfr;
476  std::vector<int> mnt_1eta2_n_qtrk;
477  std::vector<float> mnt_1eta2_bdtscore;
478  auto mon_eta1_ly0_spfr = Monitored::Collection("eta1_ly0_spfr", mnt_eta1_ly0_spfr);
479  auto mon_eta1_ly1_spfr = Monitored::Collection("eta1_ly1_spfr", mnt_eta1_ly1_spfr);
480  auto mon_eta1_ly2_spfr = Monitored::Collection("eta1_ly2_spfr", mnt_eta1_ly2_spfr);
481  auto mon_eta1_ly3_spfr = Monitored::Collection("eta1_ly3_spfr", mnt_eta1_ly3_spfr);
482  auto mon_eta1_ly4_spfr = Monitored::Collection("eta1_ly4_spfr", mnt_eta1_ly4_spfr);
483  auto mon_eta1_ly5_spfr = Monitored::Collection("eta1_ly5_spfr", mnt_eta1_ly5_spfr);
484  auto mon_eta1_ly6_spfr = Monitored::Collection("eta1_ly6_spfr", mnt_eta1_ly6_spfr);
485  auto mon_eta1_ly7_spfr = Monitored::Collection("eta1_ly7_spfr", mnt_eta1_ly7_spfr);
486  auto mon_eta1_n_qtrk = Monitored::Collection("eta1_n_qtrk", mnt_eta1_n_qtrk);
487  auto mon_eta1_bdtscore = Monitored::Collection("eta1_bdtscore", mnt_eta1_bdtscore);
488  auto mon_1eta2_ly0_spfr = Monitored::Collection("1eta2_ly0_spfr", mnt_1eta2_ly0_spfr);
489  auto mon_1eta2_ly1_spfr = Monitored::Collection("1eta2_ly1_spfr", mnt_1eta2_ly1_spfr);
490  auto mon_1eta2_ly2_spfr = Monitored::Collection("1eta2_ly2_spfr", mnt_1eta2_ly2_spfr);
491  auto mon_1eta2_ly3_spfr = Monitored::Collection("1eta2_ly3_spfr", mnt_1eta2_ly3_spfr);
492  auto mon_1eta2_ly4_spfr = Monitored::Collection("1eta2_ly4_spfr", mnt_1eta2_ly4_spfr);
493  auto mon_1eta2_ly5_spfr = Monitored::Collection("1eta2_ly5_spfr", mnt_1eta2_ly5_spfr);
494  auto mon_1eta2_ly6_spfr = Monitored::Collection("1eta2_ly6_spfr", mnt_1eta2_ly6_spfr);
495  auto mon_1eta2_ly7_spfr = Monitored::Collection("1eta2_ly7_spfr", mnt_1eta2_ly7_spfr);
496  auto mon_1eta2_n_qtrk = Monitored::Collection("1eta2_n_qtrk", mnt_1eta2_n_qtrk);
497  auto mon_1eta2_bdtscore = Monitored::Collection("1eta2_bdtscore", mnt_1eta2_bdtscore);
498  auto monitorIt = Monitored::Group( m_monTool,
499  mon_eta1_ly0_spfr, mon_eta1_ly1_spfr, mon_eta1_ly2_spfr, mon_eta1_ly3_spfr,
500  mon_eta1_ly4_spfr, mon_eta1_ly5_spfr, mon_eta1_ly6_spfr, mon_eta1_ly7_spfr,
501  mon_eta1_n_qtrk, mon_eta1_bdtscore,
502  mon_1eta2_ly0_spfr, mon_1eta2_ly1_spfr, mon_1eta2_ly2_spfr, mon_1eta2_ly3_spfr,
503  mon_1eta2_ly4_spfr, mon_1eta2_ly5_spfr, mon_1eta2_ly6_spfr, mon_1eta2_ly7_spfr,
504  mon_1eta2_n_qtrk, mon_1eta2_bdtscore);
505 
506  //
507  for ( auto dv : *dvContainer ) {
508  int seed_type = dv->getDetail<int> ("hitDV_seed_type");
509  // do not fill sp-seeded candidates
510  if( seed_type == SeedType::SP ) continue;
511  float seed_eta = dv->getDetail<float>("hitDV_seed_eta");
512  int n_track_qual= dv->getDetail<int> ("hitDV_n_track_qual");
513  float bdt_score = dv->getDetail<float>("hitDV_bdt_score");
514  float ly0_sp_frac = dv->getDetail<float>("hitDV_ly0_sp_frac");
515  float ly1_sp_frac = dv->getDetail<float>("hitDV_ly1_sp_frac");
516  float ly2_sp_frac = dv->getDetail<float>("hitDV_ly2_sp_frac");
517  float ly3_sp_frac = dv->getDetail<float>("hitDV_ly3_sp_frac");
518  float ly4_sp_frac = dv->getDetail<float>("hitDV_ly4_sp_frac");
519  float ly5_sp_frac = dv->getDetail<float>("hitDV_ly5_sp_frac");
520  float ly6_sp_frac = dv->getDetail<float>("hitDV_ly6_sp_frac");
521  float ly7_sp_frac = dv->getDetail<float>("hitDV_ly7_sp_frac");
522  if( std::abs(seed_eta) < 1.0 ) {
523  mnt_eta1_ly0_spfr.push_back(ly0_sp_frac);
524  mnt_eta1_ly1_spfr.push_back(ly1_sp_frac);
525  mnt_eta1_ly2_spfr.push_back(ly2_sp_frac);
526  mnt_eta1_ly3_spfr.push_back(ly3_sp_frac);
527  mnt_eta1_ly4_spfr.push_back(ly4_sp_frac);
528  mnt_eta1_ly5_spfr.push_back(ly5_sp_frac);
529  mnt_eta1_ly6_spfr.push_back(ly6_sp_frac);
530  mnt_eta1_ly7_spfr.push_back(ly7_sp_frac);
531  mnt_eta1_n_qtrk.push_back(n_track_qual);
532  mnt_eta1_bdtscore.push_back(bdt_score);
533  }
534  else if( std::abs(seed_eta) < 2.0 ) {
535  mnt_1eta2_ly0_spfr.push_back(ly0_sp_frac);
536  mnt_1eta2_ly1_spfr.push_back(ly1_sp_frac);
537  mnt_1eta2_ly2_spfr.push_back(ly2_sp_frac);
538  mnt_1eta2_ly3_spfr.push_back(ly3_sp_frac);
539  mnt_1eta2_ly4_spfr.push_back(ly4_sp_frac);
540  mnt_1eta2_ly5_spfr.push_back(ly5_sp_frac);
541  mnt_1eta2_ly6_spfr.push_back(ly6_sp_frac);
542  mnt_1eta2_ly7_spfr.push_back(ly7_sp_frac);
543  mnt_1eta2_n_qtrk.push_back(n_track_qual);
544  mnt_1eta2_bdtscore.push_back(bdt_score);
545  }
546  }
547 
548  //
549  return StatusCode::SUCCESS;
550 }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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; }

◆ execute()

StatusCode TrigHitDVHypoAlg::execute ( const EventContext &  context) const
overridevirtual

Definition at line 117 of file TrigHitDVHypoAlg.cxx.

118 {
119 
120  const TrigRoiDescriptor roi = TrigRoiDescriptor(0, -4.5, 4.5, 0, -M_PI, M_PI, 0, -168.0, 168.0);
121  std::vector<TrigSiSpacePointBase> convertedSpacePoints;
122  convertedSpacePoints.reserve(5000);
123  int mnt_roi_nSPsPIX;
124  int mnt_roi_nSPsSCT;
125  ATH_CHECK(m_spacePointTool->getSpacePoints(roi, convertedSpacePoints, mnt_roi_nSPsPIX, mnt_roi_nSPsSCT, context));
126 
127  // monitoring
128  auto mon_n_dvtrks = Monitored::Scalar<int>( "n_dvtrks", 0 );
129  auto mon_n_dvsps = Monitored::Scalar<int>( "n_dvsps", 0 );
130  auto mon_n_jetseeds = Monitored::Scalar<int>( "n_jetseeds", 0 );
131  auto mon_n_jetseedsdel= Monitored::Scalar<int>( "n_jetseedsdel",0 );
132  auto mon_n_spseeds = Monitored::Scalar<int>( "n_spseeds", 0 );
133  auto mon_n_spseedsdel = Monitored::Scalar<int>( "n_spseedsdel", 0 );
134  auto mon_average_mu = Monitored::Scalar<float>( "average_mu", 0.);
135  auto monitorIt = Monitored::Group( m_monTool, mon_n_dvtrks, mon_n_dvsps, mon_n_jetseeds, mon_n_jetseedsdel, mon_n_spseeds, mon_n_spseedsdel, mon_average_mu );
136 
137  // previous decisions
138  ATH_MSG_DEBUG( "Retrieving pervious decision: \"" << decisionInput().key() << "\"" );
139  auto previousDecisionsHandle = SG::makeHandle( decisionInput(), context );
140  ATH_CHECK( previousDecisionsHandle.isValid() );
141 
142  ATH_MSG_DEBUG( "Running with " << previousDecisionsHandle->size() << " previous decisions" );
143  if( previousDecisionsHandle->size()!=1 ) {
144  ATH_MSG_ERROR( "Previous decision handle size is not 1. It is" << previousDecisionsHandle->size() );
145  return StatusCode::FAILURE;
146  }
147  const Decision * previousDecision = previousDecisionsHandle->at(0);
148 
149  TrigCompositeUtils::DecisionIDContainer previousDecisionIDs;
150  TrigCompositeUtils::decisionIDs(previousDecision, previousDecisionIDs);
151  ATH_MSG_DEBUG( "IDs of active legs:" );
152  for(auto decisionID: previousDecisionIDs) { ATH_MSG_DEBUG( " " << decisionID ); }
153 
154  // new output decisions
155  ATH_MSG_DEBUG( "Creating new output decision handle" );
157  auto outputDecisions = outputHandle.ptr();
158 
159  // input objects
160 
161  // jets
162  auto jetsHandle = SG::makeHandle(m_jetsKey, context );
163  ATH_CHECK( jetsHandle.isValid() );
164  ATH_MSG_DEBUG( "jet handle size: " << jetsHandle->size() );
165 
166  const xAOD::JetContainer* jetsContainer = jetsHandle.get();
167  if( jetsContainer == nullptr ) {
168  ATH_MSG_ERROR( "ERROR Cannot get jet container" );
169  return StatusCode::FAILURE;
170  }
171  bool isJetEtPassToolsCut = false;
172  float jetEtaToolsCut = 2.0;
173  if( m_tools_loosest_wp >= 3 ) jetEtaToolsCut = 1.0;
174  for ( const xAOD::Jet* jet : *jetsContainer ) {
175  float jet_pt = static_cast<float>(jet->pt() / Gaudi::Units::GeV );
176  float jet_eta = static_cast<float>(jet->eta());
177  if( jet_pt >= m_tools_lowest_jetEt && std::abs(jet_eta)<=jetEtaToolsCut ) {
178  isJetEtPassToolsCut = true;
179  break;
180  }
181  }
182 
183  auto tracks = SG::makeHandle( m_tracksKey, context );
184  ATH_CHECK(tracks.isValid());
185 
186  std::vector<HitDVSeed> hitDVSeedsContainer;
187  std::vector<HitDVTrk> hitDVTrksContainer;
188  std::vector<HitDVSpacePoint> hitDVSPsContainer;
189 
190 
191  ATH_CHECK( findHitDV(context, convertedSpacePoints, *tracks, hitDVSeedsContainer, hitDVTrksContainer, hitDVSPsContainer) );
192 
193  mon_n_dvtrks = hitDVTrksContainer.size();
194  mon_n_dvsps = hitDVSPsContainer.size();
195  const unsigned int N_MAX_SP_STORED = 100000;
196  bool isSPOverflow = false;
197  if( hitDVSPsContainer.size() >= N_MAX_SP_STORED ) isSPOverflow = true;
198  ATH_MSG_DEBUG( "hitDVSP size=" << mon_n_dvsps );
199 
200  // average mu
201  float averageMu = 0;
202  if( m_isMC ) {
203  if( m_lumiBlockMuTool ) {
204  averageMu = static_cast<float>(m_lumiBlockMuTool->averageInteractionsPerCrossing(context));
205  ATH_MSG_DEBUG( "offline averageMu = " << averageMu );
206  }
207  }
208  else {
210  averageMu = lcd.cptr()->lbAverageInteractionsPerCrossing();
211  ATH_MSG_DEBUG( "online averageMu = " << averageMu );
212  }
213  mon_average_mu = averageMu;
214 
215  // find seeds based on HLT jets
216  std::vector<float> jetSeeds_pt;
217  std::vector<float> jetSeeds_eta;
218  std::vector<float> jetSeeds_phi;
219  ATH_CHECK( findJetSeeds(jetsContainer, m_jetSeed_ptMin, m_jetSeed_etaMax, jetSeeds_pt, jetSeeds_eta, jetSeeds_phi) );
220  int n_alljetseeds = jetSeeds_eta.size();
221  ATH_CHECK( selectSeedsNearby(hitDVSeedsContainer, jetSeeds_eta, jetSeeds_phi, jetSeeds_pt) );
222  mon_n_jetseeds = jetSeeds_eta.size();
223  mon_n_jetseedsdel = n_alljetseeds - jetSeeds_eta.size();
224 
225  // find seeds based on SP frac itself
226  std::vector<float> spSeeds_eta;
227  std::vector<float> spSeeds_phi;
228  std::vector<float> void_pt;
229  int n_allspseeds = 0;
230  if( m_tools_loosest_wp <= 1 ) {
231  ATH_CHECK( findSPSeeds(context, hitDVSPsContainer, spSeeds_eta, spSeeds_phi) );
232  n_allspseeds = spSeeds_eta.size();
233  ATH_CHECK( selectSeedsNearby(hitDVSeedsContainer, spSeeds_eta, spSeeds_phi, void_pt) );
234  mon_n_spseeds = spSeeds_eta.size();
235  mon_n_spseedsdel = n_allspseeds - spSeeds_eta.size();
236  }
237  else {
238  mon_n_spseeds = 0;
239  mon_n_spseedsdel = 0;
240  }
241 
242  // output EDM object
243  auto hitDVContainer = std::make_unique<xAOD::TrigCompositeContainer>();
244  auto hitDVContainerAux = std::make_unique<xAOD::TrigCompositeAuxContainer>();
245  hitDVContainer->setStore(hitDVContainerAux.get());
246 
247  xAOD::TrigCompositeContainer* dvContainer = hitDVContainer.get();
248  std::vector<TrigHitDVHypoTool::HitDVHypoInfo> hitDVHypoInputs;
249  std::unordered_map<Decision*, size_t> mapDecIdx;
250 
251  // calculate BDT and create hitDVContainer EDM
252  if( isJetEtPassToolsCut ) {
253  const float preselBDTthreshold = -0.6;
254 
255  int n_passed_jet = 0;
256  int seed_type = SeedType::HLTJet;
257  ATH_CHECK( calculateBDT(hitDVSPsContainer, hitDVTrksContainer, jetSeeds_pt, jetSeeds_eta, jetSeeds_phi, preselBDTthreshold, seed_type, dvContainer, n_passed_jet) );
258 
259  int n_passed_sp = 0;
260  if( m_tools_loosest_wp <= 1 ) {
261  seed_type = SeedType::SP;
262  ATH_CHECK( calculateBDT(hitDVSPsContainer, hitDVTrksContainer, void_pt, spSeeds_eta, spSeeds_phi, preselBDTthreshold, seed_type, dvContainer, n_passed_sp) );
263  }
264 
265  ATH_MSG_DEBUG( "nr of dv container / jet-seeded / sp-seed candidates = " << dvContainer->size() << " / " << n_passed_jet << " / " << n_passed_sp );
266 
267  // Prepare inputs to HypoTool
268  for ( auto dv : *dvContainer ) {
269  Decision* newDecision = TrigCompositeUtils::newDecisionIn( outputDecisions, previousDecision, TrigCompositeUtils::hypoAlgNodeName(), context);
270  mapDecIdx.emplace( newDecision, dv->index() );
271  TrigHitDVHypoTool::HitDVHypoInfo hypoInfo{ newDecision, isSPOverflow, averageMu, dv, previousDecisionIDs };
272  hitDVHypoInputs.push_back( hypoInfo );
273  }
274  }
275 
276  // monitor
277  ATH_CHECK( doMonitor(dvContainer) );
278 
279  // Loop over all hypoToolinputs and get their decisions
280  for ( auto & tool: m_hypoTools ) {
281  ATH_MSG_DEBUG( "+++++ Now computing decision for " << tool->name() );
282  ATH_CHECK( tool->decide( hitDVHypoInputs ) );
283  }
284 
285  // record hitDV object
287  ATH_CHECK( hitDVHandle.record( std::move( hitDVContainer ), std::move( hitDVContainerAux ) ) );
288  ATH_MSG_DEBUG( "recorded hitDV object to SG" );
289 
290  DecisionContainer::iterator it = outputDecisions->begin();
291  while(it != outputDecisions->end()) {
292  ATH_MSG_DEBUG( "+++++ outputDecision: " << *it << " +++++" );
293  if ( allFailed( *it ) ) {
294  ATH_MSG_DEBUG( "---> all failed, erasing" );
295  it = outputDecisions->erase(it);
296  } else {
297  ATH_MSG_DEBUG( "---> not all failed" );
298 
299  // Link hitDV object
300  auto decision = *it;
301  size_t idx = mapDecIdx.at(*it);
302 
304  ATH_CHECK( dvEL.isValid() );
305 
306  ATH_CHECK( decision->setObjectLink<xAOD::TrigCompositeContainer>(featureString(), dvEL) );
307 
308  ATH_MSG_DEBUG(*decision);
309  ++it;
310  }
311  }
312 
313  //
314  ATH_CHECK( hypoBaseOutputProcessing(outputHandle) );
315 
316  //
317  return StatusCode::SUCCESS;
318 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90 {
91  // If we didn't find any symlinks to add, just return the collection
92  // from the base class. Otherwise, return the extended collection.
93  if (!m_extendedExtraObjects.empty()) {
95  }
96  return BaseAlg::extraOutputDeps();
97 }

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext &  ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96  {
97  return execState( ctx ).filterPassed();
98  }

◆ findHitDV()

StatusCode TrigHitDVHypoAlg::findHitDV ( const EventContext &  ctx,
const std::vector< TrigSiSpacePointBase > &  convertedSpacePoints,
const DataVector< Trk::Track > &  tracks,
std::vector< HitDVSeed > &  hitDVSeedsContainer,
std::vector< HitDVTrk > &  hitDVTrksContainer,
std::vector< HitDVSpacePoint > &  hitDVSPContainer 
) const
private

Definition at line 1166 of file TrigHitDVHypoAlg.cxx.

1170 {
1171  std::vector<int> v_dvtrk_id;
1172  std::vector<float> v_dvtrk_pt;
1173  std::vector<float> v_dvtrk_eta;
1174  std::vector<float> v_dvtrk_phi;
1175  std::vector<int> v_dvtrk_n_hits_inner;
1176  std::vector<int> v_dvtrk_n_hits_pix;
1177  std::vector<int> v_dvtrk_n_hits_sct;
1178  std::vector<float> v_dvtrk_a0beam;
1179  std::unordered_map<Identifier, int> umap_fittedTrack_identifier;
1180  int fittedTrack_id = -1;
1181 
1182  static constexpr float TRKCUT_PTGEV_HITDV = 0.5;
1183 
1184  for (const auto track: tracks) {
1185  float shift_x = 0; float shift_y = 0;
1186  if(m_useBeamSpot) {
1188  FTF::getBeamSpotShift(shift_x, shift_y, **beamSpotHandle);
1189  }
1190  trackInfo theTrackInfo;
1191  bool igt = FTF::isGoodTrackUTT(track, theTrackInfo, shift_x, shift_y, TRKCUT_PTGEV_HITDV);
1192  if (not igt) {continue;}
1193 
1194  fittedTrack_id++;
1195  ATH_MSG_DEBUG("Selected track pT = " << theTrackInfo.ptGeV << " GeV");
1196 
1197 
1199  m = track->measurementsOnTrack()->begin(),
1200  me = track->measurementsOnTrack()->end ();
1201  for(; m!=me; ++m ) {
1202  const Trk::PrepRawData* prd = ((const Trk::RIO_OnTrack*)(*m))->prepRawData();
1203  if( prd == nullptr ) continue;
1204  Identifier id_prd = prd->identify();
1205  if( umap_fittedTrack_identifier.find(id_prd) == umap_fittedTrack_identifier.end() ) {
1206  umap_fittedTrack_identifier.insert(std::make_pair(id_prd,fittedTrack_id));
1207  }
1208  }
1209  float phi = track->perigeeParameters()->parameters()[Trk::phi];
1210  v_dvtrk_id.push_back(fittedTrack_id);
1211  v_dvtrk_pt.push_back(theTrackInfo.ptGeV*Gaudi::Units::GeV);
1212  v_dvtrk_eta.push_back(theTrackInfo.eta);
1213  v_dvtrk_phi.push_back(phi);
1214  v_dvtrk_n_hits_inner.push_back(theTrackInfo.n_hits_inner);
1215  v_dvtrk_n_hits_pix.push_back(theTrackInfo.n_hits_pix);
1216  v_dvtrk_n_hits_sct.push_back(theTrackInfo.n_hits_sct);
1217  v_dvtrk_a0beam.push_back(theTrackInfo.a0beam);
1218  }
1219  ATH_MSG_DEBUG("Nr of selected tracks / all = " << fittedTrack_id << " / " << tracks.size());
1220  ATH_MSG_DEBUG("Nr of Identifiers used by selected tracks = " << umap_fittedTrack_identifier.size());
1221 
1222  // space points
1223  int n_sp = 0;
1224  int n_sp_usedByTrk = 0;
1225 
1226  std::unordered_map<Identifier, int> umap_sp_identifier;
1227  umap_sp_identifier.reserve(1.3*convertedSpacePoints.size());//up to 2 Identifiers per spacepoint, end up with 1.3 from measurements
1228 
1229  auto add_to_sp_map = [&](const Trk::PrepRawData* prd) {
1230  if (prd) {
1231  Identifier id_prd = prd->identify();
1232  if( umap_sp_identifier.find(id_prd) == umap_sp_identifier.end() ) {
1233  umap_sp_identifier.insert(std::make_pair(id_prd,-1));
1234  }
1235  }
1236  };
1237 
1238  for(unsigned int iSp=0; iSp<convertedSpacePoints.size(); ++iSp) {
1239  bool isPix = convertedSpacePoints[iSp].isPixel();
1240  bool isSct = convertedSpacePoints[iSp].isSCT();
1241  if( ! isPix && ! isSct ) continue;
1242  const Trk::SpacePoint* sp = convertedSpacePoints[iSp].offlineSpacePoint();
1243  add_to_sp_map(sp->clusterList().first);
1244  add_to_sp_map(sp->clusterList().second);
1245  }
1246  int n_id_usedByTrack = 0;
1247  for(auto it=umap_sp_identifier.begin(); it!=umap_sp_identifier.end(); ++it) {
1248  Identifier id_sp = it->first;
1249  if( umap_fittedTrack_identifier.find(id_sp) != umap_fittedTrack_identifier.end() ) {
1250  umap_sp_identifier[id_sp] = umap_fittedTrack_identifier[id_sp];
1251  ++n_id_usedByTrack;
1252  }
1253  }
1254  ATH_MSG_DEBUG("Nr of SPs / Identifiers (all) / Identifiers (usedByTrack) = " << convertedSpacePoints.size() << " / " << umap_sp_identifier.size() << " / " << n_id_usedByTrack);
1255 
1256  auto sp_map_used_id = [&](const Trk::PrepRawData* prd) {
1257  int usedTrack_id = -1;
1258  if (prd) {
1259  Identifier id_prd = prd->identify();
1260  if( umap_sp_identifier.find(id_prd) != umap_sp_identifier.end() ) {
1261  usedTrack_id = umap_sp_identifier[id_prd];
1262  }
1263  }
1264  return usedTrack_id;
1265  };
1266 
1267  std::vector<float> v_sp_eta;
1268  v_sp_eta.reserve(convertedSpacePoints.size());
1269  std::vector<float> v_sp_r;
1270  v_sp_r.reserve(convertedSpacePoints.size());
1271  std::vector<float> v_sp_phi;
1272  v_sp_phi.reserve(convertedSpacePoints.size());
1273  std::vector<int> v_sp_layer;
1274  v_sp_layer.reserve(convertedSpacePoints.size());
1275  std::vector<bool> v_sp_isPix;
1276  v_sp_isPix.reserve(convertedSpacePoints.size());
1277  std::vector<bool> v_sp_isSct;
1278  v_sp_isSct.reserve(convertedSpacePoints.size());
1279  std::vector<int> v_sp_usedTrkId;
1280  v_sp_usedTrkId.reserve(convertedSpacePoints.size());
1281 
1282  for(const auto& sp : convertedSpacePoints) {
1283  bool isPix = sp.isPixel();
1284  bool isSct = sp.isSCT();
1285  if( ! isPix && ! isSct ) continue;
1286  const Trk::SpacePoint* osp = sp.offlineSpacePoint();
1287 
1288  int usedTrack_id = -1;
1289  int usedTrack_id_first = sp_map_used_id(osp->clusterList().first);
1290  if (usedTrack_id_first != -1) {
1291  usedTrack_id = usedTrack_id_first;
1292  }
1293  int usedTrack_id_second = sp_map_used_id(osp->clusterList().second);
1294  if (usedTrack_id_second != -1) {
1295  usedTrack_id = usedTrack_id_second;
1296  }
1297 
1298  //
1299  n_sp++;
1300  if( usedTrack_id != -1 ) n_sp_usedByTrk++;
1301  int layer = sp.layer();
1302  float sp_r = sp.r();
1303 
1304  const Amg::Vector3D& pos_sp = osp->globalPosition();//Go back to globalPosition to get the non-shifted spacepoint positions
1305  float sp_eta = pos_sp.eta();
1306  float sp_phi = pos_sp.phi();
1307 
1308  v_sp_eta.push_back(sp_eta);
1309  v_sp_r.push_back(sp_r);
1310  v_sp_phi.push_back(sp_phi);
1311  v_sp_layer.push_back(layer);
1312  v_sp_isPix.push_back(isPix);
1313  v_sp_isSct.push_back(isSct);
1314  v_sp_usedTrkId.push_back(usedTrack_id);
1315 
1316  ATH_MSG_VERBOSE("+++ SP eta / phi / layer / ixPix / usedTrack_id = " << sp_eta << " / " << sp_phi << " / " << layer << " / " << isPix << " / " << usedTrack_id);
1317 
1318  }
1319  ATH_MSG_DEBUG("Nr of SPs / all = " << n_sp << " / " << convertedSpacePoints.size());
1320  ATH_MSG_DEBUG("Nr of SPs used by selected tracks = " << n_sp_usedByTrk);
1321 
1322  // Seed
1323  std::vector<float> v_seeds_eta;
1324  std::vector<float> v_seeds_phi;
1325  std::vector<int16_t> v_seeds_type;
1326 
1327  if( m_doHitDV_Seeding ) {
1328 
1329  // add L1 Jet seeds
1330  const unsigned int L1JET_ET_CUT = 27; // Mapping from legacy J30, make configurable?
1331 
1332  auto jetRoiCollectionHandle = SG::makeHandle( m_jetRoiCollectionKey, ctx );
1333  const DataVector<xAOD::jFexSRJetRoI> *jetRoiCollection = jetRoiCollectionHandle.cptr();
1334  if (!jetRoiCollectionHandle.isValid()){
1335  ATH_MSG_ERROR("ReadHandle for DataVector<xAOD::jFexSRJetRoI> key:" << m_jetRoiCollectionKey.key() << " isn't Valid");
1336  return StatusCode::FAILURE;
1337  }
1338  for (size_t size=0; size<jetRoiCollection->size(); ++size){
1339  const xAOD::jFexSRJetRoI* jetRoI = jetRoiCollection->at(size);
1340  if( jetRoI == nullptr ) continue;
1341  // Good seed
1342  if( jetRoI->et() >= L1JET_ET_CUT ) {
1343  v_seeds_eta.push_back(jetRoI->eta());
1344  v_seeds_phi.push_back(jetRoI->phi());
1345  v_seeds_type.push_back(0); // L1_J:0
1346  }
1347  }
1348  ATH_MSG_DEBUG("Nr of L1_J" << L1JET_ET_CUT << " seeds = " << v_seeds_eta.size());
1349 
1350  // space-point based (unseeded mode)
1351  std::vector<float> v_spseeds_eta;
1352  std::vector<float> v_spseeds_phi;
1353  ATH_CHECK( findSPSeeds(ctx, v_sp_eta, v_sp_phi, v_sp_layer, v_sp_usedTrkId, v_spseeds_eta, v_spseeds_phi) );
1354  ATH_MSG_DEBUG("Nr of SP seeds = " << v_spseeds_eta.size());
1355  for(size_t idx=0; idx<v_spseeds_eta.size(); ++idx) {
1356  v_seeds_eta.push_back(v_spseeds_eta[idx]);
1357  v_seeds_phi.push_back(v_spseeds_phi[idx]);
1358  v_seeds_type.push_back(1); // SP: 1
1359  }
1360  ATH_MSG_DEBUG("Nr of SP + L1_J" << L1JET_ET_CUT << " seeds = " << v_seeds_eta.size());
1361  }
1362 
1363  // fill objects
1364 
1365  // seeds
1366  const int N_MAX_SEEDS = 200;
1367  int n_seeds = std::min(N_MAX_SEEDS,(int)v_seeds_eta.size());
1368  hitDVSeedsContainer.reserve(n_seeds);
1369  for(auto iSeed=0; iSeed < n_seeds; ++iSeed) {
1370  HitDVSeed seed;
1371  seed.eta = v_seeds_eta[iSeed];
1372  seed.phi = v_seeds_phi[iSeed];
1373  seed.type = v_seeds_type[iSeed];
1374  hitDVSeedsContainer.push_back(seed);
1375  }
1376 
1377  // track
1378  const float TRKCUT_DELTA_R_TO_SEED = 1.0;
1379  hitDVTrksContainer.reserve(v_dvtrk_pt.size());
1380  for(unsigned int iTrk=0; iTrk<v_dvtrk_pt.size(); ++iTrk) {
1381  float trk_eta = v_dvtrk_eta[iTrk];
1382  float trk_phi = v_dvtrk_phi[iTrk];
1383  if( m_doHitDV_Seeding ) {
1384  bool isNearSeed = false;
1385  for (unsigned int iSeed=0; iSeed<v_seeds_eta.size(); ++iSeed) {
1386  float seed_eta = v_seeds_eta[iSeed];
1387  float seed_phi = v_seeds_phi[iSeed];
1388  float dR2 = deltaR2(trk_eta,trk_phi,seed_eta,seed_phi);
1389  if( dR2 <= TRKCUT_DELTA_R_TO_SEED*TRKCUT_DELTA_R_TO_SEED ) { isNearSeed = true; break; }
1390  }
1391  if( ! isNearSeed ) continue;
1392  }
1393  HitDVTrk hitDVTrk;
1394  hitDVTrk.id = v_dvtrk_id[iTrk];
1395  hitDVTrk.pt = v_dvtrk_pt[iTrk];
1396  hitDVTrk.eta = v_dvtrk_eta[iTrk];
1397  hitDVTrk.phi = v_dvtrk_phi[iTrk];
1398  hitDVTrk.n_hits_inner = v_dvtrk_n_hits_inner[iTrk];
1399  hitDVTrk.n_hits_pix = v_dvtrk_n_hits_pix[iTrk];
1400  hitDVTrk.n_hits_sct = v_dvtrk_n_hits_sct[iTrk];
1401  hitDVTrk.a0beam = v_dvtrk_a0beam[iTrk];
1402 
1403  hitDVTrksContainer.push_back(hitDVTrk);
1404  }
1405 
1406  // space points
1407  const float SPCUT_DELTA_R_TO_SEED = 1.0;
1408  const size_t n_sp_max = std::min<size_t>(100000, v_sp_eta.size());
1409  size_t n_sp_stored = 0;
1410 
1411  hitDVSPsContainer.reserve(n_sp_max);
1412 
1413  for(size_t iSp=0; iSp<v_sp_eta.size(); ++iSp) {
1414  if( m_doHitDV_Seeding ) {
1415  const float sp_eta = v_sp_eta[iSp];
1416  const float sp_phi = v_sp_phi[iSp];
1417  bool isNearSeed = false;
1418  for (size_t iSeed=0; iSeed<v_seeds_eta.size(); ++iSeed) {
1419  const float seed_eta = v_seeds_eta[iSeed];
1420  const float seed_phi = v_seeds_phi[iSeed];
1421  const float dR2 = deltaR2(sp_eta, sp_phi, seed_eta, seed_phi);
1422  if( dR2 <= SPCUT_DELTA_R_TO_SEED*SPCUT_DELTA_R_TO_SEED ) { isNearSeed = true; break; }
1423  }
1424  if( ! isNearSeed ) continue;
1425  }
1426  if( n_sp_stored >= n_sp_max ) break;
1427  HitDVSpacePoint hitDVSP;
1428  hitDVSP.eta = v_sp_eta[iSp];
1429  hitDVSP.r = v_sp_r[iSp];
1430  hitDVSP.phi = v_sp_phi[iSp];
1431  hitDVSP.layer = v_sp_layer[iSp];
1432  hitDVSP.isPix = v_sp_isPix[iSp];
1433  hitDVSP.isSct = v_sp_isSct[iSp];
1434  hitDVSP.usedTrkId = v_sp_usedTrkId[iSp];
1435  hitDVSPsContainer.push_back(hitDVSP);
1436  ++n_sp_stored;
1437  }
1438  ATH_MSG_DEBUG("Nr of SPs stored = " << n_sp_stored);
1439 
1440  return StatusCode::SUCCESS;
1441 }

◆ findJetSeeds()

StatusCode TrigHitDVHypoAlg::findJetSeeds ( const xAOD::JetContainer jetsContainer,
const float  cutJetPt,
const float  cutJetEta,
std::vector< float > &  jetSeeds_pt,
std::vector< float > &  jetSeeds_eta,
std::vector< float > &  jetSeeds_phi 
) const
private

Definition at line 698 of file TrigHitDVHypoAlg.cxx.

700 {
701  std::vector<float> mnt_jet_pt;
702  std::vector<float> mnt_jet_eta;
703  auto mon_jet_pt = Monitored::Collection("jet_pt", mnt_jet_pt);
704  auto mon_jet_eta = Monitored::Collection("jet_eta", mnt_jet_eta);
705  auto monitorIt = Monitored::Group( m_monTool, mon_jet_pt, mon_jet_eta );
706 
707  ATH_MSG_VERBOSE("looking for jet seed with pt cut=" << cutJetPt << ", eta cut=" << cutJetEta);
708  for ( const xAOD::Jet* jet : *jetsContainer ) {
709  float jet_pt = static_cast<float>(jet->pt() / Gaudi::Units::GeV );
710  if( jet_pt < cutJetPt ) {
711  ATH_MSG_VERBOSE("Fails jet pt cut, pt = " << jet_pt);
712  continue;
713  }
714  mnt_jet_pt.push_back(jet_pt);
715  float jet_eta = static_cast<float>(jet->eta());
716  mnt_jet_eta.push_back(jet_eta);
717  if( std::fabs(jet_eta) > cutJetEta ) {
718  ATH_MSG_VERBOSE("Fails jet eta cut, eta = " << jet_eta);
719  continue;
720  }
721  float jet_phi = static_cast<float>(jet->phi());
722  jetSeeds_pt.push_back(jet_pt);
723  jetSeeds_eta.push_back(jet_eta);
724  jetSeeds_phi.push_back(jet_phi);
725  }
726  ATH_MSG_VERBOSE("nr of jet seeds=" << jetSeeds_eta.size());
727 
728  return StatusCode::SUCCESS;
729 }

◆ findSPSeeds() [1/2]

StatusCode TrigHitDVHypoAlg::findSPSeeds ( const EventContext &  ctx,
const std::vector< HitDVSpacePoint > &  spsContainer,
std::vector< float > &  seeds_eta,
std::vector< float > &  seeds_phi 
) const
private

Definition at line 734 of file TrigHitDVHypoAlg.cxx.

736 {
737  seeds_eta.clear();
738  seeds_phi.clear();
739 
740  const int NBINS_ETA = 50;
741  const float ETA_MIN = -2.5;
742  const float ETA_MAX = 2.5;
743 
744  const int NBINS_PHI = 80;
745  const float PHI_MIN = -4.0;
746  const float PHI_MAX = 4.0;
747 
748  char hname[64];
749 
750  unsigned int slotnr = ctx.slot();
751  unsigned int subSlotnr = ctx.subSlot();
752 
753  sprintf(hname,"hitdv_s%u_ss%u_ly6_h2_nsp",slotnr,subSlotnr);
754  std::unique_ptr<TH2F> ly6_h2_nsp = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
755  sprintf(hname,"hitdv_s%u_ss%u_ly7_h2_nsp",slotnr,subSlotnr);
756  std::unique_ptr<TH2F> ly7_h2_nsp = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
757 
758  sprintf(hname,"hitdv_s%u_ss%u_ly6_h2_nsp_notrk",slotnr,subSlotnr);
759  std::unique_ptr<TH2F> ly6_h2_nsp_notrk = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
760  sprintf(hname,"hitdv_s%u_ss%u_ly7_h2_nsp_notrk",slotnr,subSlotnr);
761  std::unique_ptr<TH2F> ly7_h2_nsp_notrk = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
762 
763  for ( const auto& spData : spsContainer ) {
764  int16_t sp_layer = spData.layer;
765  float sp_eta = spData.eta;
766  int ilayer = getSPLayer(sp_layer,sp_eta);
767  if( ilayer<6 ) continue;
768 
769  int sp_trkid = (int)spData.usedTrkId;
770  bool isUsedByTrk = (sp_trkid != -1);
771  float sp_phi = spData.phi;
772 
773  bool fill_out_of_pi = false;
774  float sp_phi2 = 0;
775  if( sp_phi < 0 ) {
776  sp_phi2 = 2*TMath::Pi() + sp_phi;
777  if( sp_phi2 < PHI_MAX ) fill_out_of_pi = true;
778  }
779  else {
780  sp_phi2 = -2*TMath::Pi() + sp_phi;
781  if( PHI_MIN < sp_phi2 ) fill_out_of_pi = true;
782  }
783  if( ilayer==6 ) {
784  ly6_h2_nsp->Fill(sp_eta,sp_phi);
785  if( fill_out_of_pi ) ly6_h2_nsp->Fill(sp_eta,sp_phi2);
786  if( ! isUsedByTrk ) ly6_h2_nsp_notrk->Fill(sp_eta,sp_phi);
787  if( ! isUsedByTrk && fill_out_of_pi) ly6_h2_nsp_notrk->Fill(sp_eta,sp_phi2);
788  }
789  if( ilayer==7 ) {
790  ly7_h2_nsp->Fill(sp_eta,sp_phi);
791  if( fill_out_of_pi ) ly7_h2_nsp->Fill(sp_eta,sp_phi2);
792  if( ! isUsedByTrk ) ly7_h2_nsp_notrk->Fill(sp_eta,sp_phi);
793  if( ! isUsedByTrk && fill_out_of_pi) ly7_h2_nsp_notrk->Fill(sp_eta,sp_phi2);
794  }
795  }
796 
797  ATH_MSG_VERBOSE("looking for ly6/ly6 doublet seeds");
798 
799  // (idx, sort/weight, eta, phi)
800  std::vector<std::tuple<int,float,float,float>> QT;
801 
802  for(int ly6_ieta=1; ly6_ieta<=NBINS_ETA; ly6_ieta++) {
803  float ly6_eta = (ly6_h2_nsp->GetXaxis()->GetBinLowEdge(ly6_ieta) + ly6_h2_nsp->GetXaxis()->GetBinUpEdge(ly6_ieta))/2.0;
804  for(int ly6_iphi=1; ly6_iphi<=NBINS_PHI; ly6_iphi++) {
805  float ly6_phi = (ly6_h2_nsp->GetYaxis()->GetBinLowEdge(ly6_iphi) + ly6_h2_nsp->GetYaxis()->GetBinUpEdge(ly6_iphi))/2.0;
806 
807  float ly6_nsp = ly6_h2_nsp ->GetBinContent(ly6_ieta,ly6_iphi);
808  float ly6_nsp_notrk = ly6_h2_nsp_notrk->GetBinContent(ly6_ieta,ly6_iphi);
809  float ly6_frac = ( ly6_nsp > 0 ) ? ly6_nsp_notrk / ly6_nsp : 0;
810  if( ly6_nsp < 10 || ly6_frac < 0.85 ) continue;
811 
812  float ly7_frac_max = 0;
813  float ly7_eta_max = 0;
814  float ly7_phi_max = 0;
815  for(int ly7_ieta=std::max(1,ly6_ieta-1); ly7_ieta<std::min(NBINS_ETA,ly6_ieta+1); ly7_ieta++) {
816  for(int ly7_iphi=std::max(1,ly6_iphi-1); ly7_iphi<=std::min(NBINS_PHI,ly6_iphi+1); ly7_iphi++) {
817  float ly7_nsp = ly7_h2_nsp ->GetBinContent(ly7_ieta,ly7_iphi);
818  float ly7_nsp_notrk = ly7_h2_nsp_notrk->GetBinContent(ly7_ieta,ly7_iphi);
819  float ly7_frac = ( ly7_nsp > 0 ) ? ly7_nsp_notrk / ly7_nsp : 0;
820  if( ly7_nsp < 10 ) continue;
821  if( ly7_frac > ly7_frac_max ) {
822  ly7_frac_max = ly7_frac;
823  ly7_eta_max = (ly7_h2_nsp->GetXaxis()->GetBinLowEdge(ly7_ieta) + ly7_h2_nsp->GetXaxis()->GetBinUpEdge(ly7_ieta))/2.0;
824  ly7_phi_max = (ly7_h2_nsp->GetXaxis()->GetBinLowEdge(ly7_iphi) + ly7_h2_nsp->GetXaxis()->GetBinUpEdge(ly7_iphi))/2.0;
825  }
826  }
827  }
828  if( ly7_frac_max < 0.85 ) continue;
829  //
830  float wsum = ly6_frac + ly7_frac_max;
831  float weta = (ly6_eta*ly6_frac + ly7_eta_max*ly7_frac_max) / wsum;
832  float wphi = (ly6_phi*ly6_frac + ly7_phi_max*ly7_frac_max) / wsum;
833  float w = wsum / 2.0;
834  QT.push_back(std::make_tuple(-1,w,weta,wphi));
835  }
836  }
837  ATH_MSG_VERBOSE("nr of ly6/ly7 doublet candidate seeds=" << QT.size() << ", doing clustering...");
838 
839  // sort
840  std::sort(QT.begin(), QT.end(),
841  [](const std::tuple<int,float,float,float>& lhs, const std::tuple<int,float,float,float>& rhs) {
842  return std::get<1>(lhs) > std::get<1>(rhs); } );
843 
844  // clustering
845  const double CLUSTCUT_DIST_SQUARED = 0.04; // const double CLUSTCUT_DIST = 0.2;
846  const double CLUSTCUT_SEED_FRAC = 0.9;
847 
848  std::vector<float> seeds_wsum;
849 
850  for(unsigned int i=0; i<QT.size(); i++) {
851  float phi = std::get<3>(QT[i]);
852  float eta = std::get<2>(QT[i]);
853  float w = std::get<1>(QT[i]);
854  if(i==0) {
855  seeds_eta.push_back(w*eta); seeds_phi.push_back(w*phi);
856  seeds_wsum.push_back(w);
857  continue;
858  }
859  const int IDX_INITIAL = 100;
860  float dist2_min = 100.0;
861  int idx_min = IDX_INITIAL;
862  for(unsigned j=0; j<seeds_eta.size(); j++) {
863  float ceta = seeds_eta[j]/seeds_wsum[j];
864  float cphi = seeds_phi[j]/seeds_wsum[j];
865  // intentionally calculate in this way as phi is defined beyond -Pi/Pi (no boundary)
866  float deta = std::fabs(ceta-eta);
867  float dphi = std::fabs(cphi-phi);
868  float dist2 = dphi*dphi+deta*deta;
869  if( dist2 < dist2_min ) {
870  dist2_min = dist2;
871  idx_min = j;
872  }
873  }
874  int match_idx = IDX_INITIAL;
875  if( idx_min != IDX_INITIAL ) {
876  if( dist2_min < CLUSTCUT_DIST_SQUARED ) { match_idx = idx_min; }
877  }
878  if( match_idx == IDX_INITIAL ) {
879  if( w > CLUSTCUT_SEED_FRAC && dist2_min > CLUSTCUT_DIST_SQUARED ) {
880  seeds_eta.push_back(w*eta); seeds_phi.push_back(w*phi);
881  seeds_wsum.push_back(w);
882  }
883  continue;
884  }
885  float new_eta = seeds_eta[match_idx] + w*eta;
886  float new_phi = seeds_phi[match_idx] + w*phi;
887  float new_wsum = seeds_wsum[match_idx] + w;
888  seeds_eta[match_idx] = new_eta;
889  seeds_phi[match_idx] = new_phi;
890  seeds_wsum[match_idx] = new_wsum;
891  }
892  QT.clear();
893  for(unsigned int i=0; i<seeds_eta.size(); i++) {
894  float eta = seeds_eta[i] / seeds_wsum[i];
895  float phi = seeds_phi[i] / seeds_wsum[i];
896  seeds_eta[i] = eta;
897  seeds_phi[i] = phi;
898  if( phi < -TMath::Pi() ) phi = 2*TMath::Pi() + phi;
899  if( phi > TMath::Pi() ) phi = -2*TMath::Pi() + phi;
900  seeds_phi[i] = phi;
901  }
902  ATH_MSG_VERBOSE("after clustering, nr of seeds = " << seeds_eta.size());
903 
904  // delete overlap (can happen at phi=-Pi/Pi bounadry)
905  std::vector<unsigned int> idx_to_delete;
906  for(unsigned int i=0; i<seeds_eta.size(); i++) {
907  if( std::find(idx_to_delete.begin(),idx_to_delete.end(),i) != idx_to_delete.end() ) continue;
908  float eta_i = seeds_eta[i];
909  float phi_i = seeds_phi[i];
910  for(unsigned int j=i+1; j<seeds_eta.size(); j++) {
911  if( std::find(idx_to_delete.begin(),idx_to_delete.end(),j) != idx_to_delete.end() ) continue;
912  float eta_j = seeds_eta[j];
913  float phi_j = seeds_phi[j];
914  float dR2 = deltaR2(eta_i,phi_i,eta_j,phi_j);
915  if( dR2 < CLUSTCUT_DIST_SQUARED ) idx_to_delete.push_back(j);
916  }
917  }
918  ATH_MSG_VERBOSE("nr of duplicated seeds to be removed = " << idx_to_delete.size());
919  if( idx_to_delete.size() > 0 ) {
920  std::sort(idx_to_delete.begin(),idx_to_delete.end());
921  for(unsigned int j=idx_to_delete.size(); j>0; j--) {
922  unsigned int idx = idx_to_delete[j-1];
923  seeds_eta.erase(seeds_eta.begin()+idx);
924  seeds_phi.erase(seeds_phi.begin()+idx);
925  }
926  }
927 
928  ATH_MSG_VERBOSE("nr of ly6/ly7 seeds=" << seeds_eta.size());
929 
930  // return
931  return StatusCode::SUCCESS;
932 }

◆ findSPSeeds() [2/2]

StatusCode TrigHitDVHypoAlg::findSPSeeds ( const EventContext &  ctx,
const std::vector< float > &  v_sp_eta,
const std::vector< float > &  v_sp_phi,
const std::vector< int > &  v_sp_layer,
const std::vector< int > &  v_sp_usedTrkId,
std::vector< float > &  seeds_eta,
std::vector< float > &  seeds_phi 
) const
private

Definition at line 967 of file TrigHitDVHypoAlg.cxx.

971 {
972  const int NBINS_ETA = 50;
973  const float ETA_MIN = -2.5;
974  const float ETA_MAX = 2.5;
975 
976  const int NBINS_PHI = 80;
977  const float PHI_MIN = -4.0;
978  const float PHI_MAX = 4.0;
979 
980  char hname[64];
981 
982  unsigned int slotnr = ctx.slot();
983  unsigned int subSlotnr = ctx.subSlot();
984 
985  sprintf(hname,"ftf_s%u_ss%u_ly6_h2_nsp",slotnr,subSlotnr);
986  std::unique_ptr<TH2F> ly6_h2_nsp = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
987  sprintf(hname,"ftf_s%u_ss%u_ly7_h2_nsp",slotnr,subSlotnr);
988  std::unique_ptr<TH2F> ly7_h2_nsp = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
989 
990  sprintf(hname,"ftf_s%u_ss%u_ly6_h2_nsp_notrk",slotnr,subSlotnr);
991  std::unique_ptr<TH2F> ly6_h2_nsp_notrk = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
992  sprintf(hname,"ftf_s%u_ss%u_ly7_h2_nsp_notrk",slotnr,subSlotnr);
993  std::unique_ptr<TH2F> ly7_h2_nsp_notrk = std::make_unique<TH2F>(hname,hname,NBINS_ETA,ETA_MIN,ETA_MAX,NBINS_PHI,PHI_MIN,PHI_MAX);
994 
995  for(unsigned int iSeed=0; iSeed<v_sp_eta.size(); ++iSeed) {
996 
997  int sp_layer = v_sp_layer[iSeed];
998  float sp_eta = v_sp_eta[iSeed];
999  int ilayer = getSPLayer(sp_layer,sp_eta);
1000  if( ilayer<6 ) continue;
1001 
1002  int sp_trkid = v_sp_usedTrkId[iSeed];
1003  bool isUsedByTrk = (sp_trkid != -1);
1004  float sp_phi = v_sp_phi[iSeed];
1005 
1006  bool fill_out_of_pi = false;
1007  float sp_phi2 = 0;
1008  if( sp_phi < 0 ) {
1009  sp_phi2 = 2*TMath::Pi() + sp_phi;
1010  if( sp_phi2 < PHI_MAX ) fill_out_of_pi = true;
1011  }
1012  else {
1013  sp_phi2 = -2*TMath::Pi() + sp_phi;
1014  if( PHI_MIN < sp_phi2 ) fill_out_of_pi = true;
1015  }
1016  if( ilayer==6 ) {
1017  ly6_h2_nsp->Fill(sp_eta,sp_phi);
1018  if( fill_out_of_pi ) ly6_h2_nsp->Fill(sp_eta,sp_phi2);
1019  if( ! isUsedByTrk ) ly6_h2_nsp_notrk->Fill(sp_eta,sp_phi);
1020  if( ! isUsedByTrk && fill_out_of_pi) ly6_h2_nsp_notrk->Fill(sp_eta,sp_phi2);
1021  }
1022  if( ilayer==7 ) {
1023  ly7_h2_nsp->Fill(sp_eta,sp_phi);
1024  if( fill_out_of_pi ) ly7_h2_nsp->Fill(sp_eta,sp_phi2);
1025  if( ! isUsedByTrk ) ly7_h2_nsp_notrk->Fill(sp_eta,sp_phi);
1026  if( ! isUsedByTrk && fill_out_of_pi) ly7_h2_nsp_notrk->Fill(sp_eta,sp_phi2);
1027  }
1028  }
1029 
1030  ATH_MSG_VERBOSE("looking for ly6/ly6 doublet seeds");
1031 
1032  // (idx, sort/weight, eta, phi)
1033  std::vector<std::tuple<int,float,float,float>> QT;
1034 
1035  for(int ly6_ieta=1; ly6_ieta<=NBINS_ETA; ly6_ieta++) {
1036  float ly6_eta = (ly6_h2_nsp->GetXaxis()->GetBinLowEdge(ly6_ieta) + ly6_h2_nsp->GetXaxis()->GetBinUpEdge(ly6_ieta))/2.0;
1037  for(int ly6_iphi=1; ly6_iphi<=NBINS_PHI; ly6_iphi++) {
1038  float ly6_phi = (ly6_h2_nsp->GetYaxis()->GetBinLowEdge(ly6_iphi) + ly6_h2_nsp->GetYaxis()->GetBinUpEdge(ly6_iphi))/2.0;
1039 
1040  float ly6_nsp = ly6_h2_nsp ->GetBinContent(ly6_ieta,ly6_iphi);
1041  float ly6_nsp_notrk = ly6_h2_nsp_notrk->GetBinContent(ly6_ieta,ly6_iphi);
1042  float ly6_frac = ( ly6_nsp > 0 ) ? ly6_nsp_notrk / ly6_nsp : 0;
1043  if( ly6_nsp < 10 || ly6_frac < 0.85 ) continue;
1044 
1045  float ly7_frac_max = 0;
1046  float ly7_eta_max = 0;
1047  float ly7_phi_max = 0;
1048  for(int ly7_ieta=std::max(1,ly6_ieta-1); ly7_ieta<std::min(NBINS_ETA,ly6_ieta+1); ly7_ieta++) {
1049  for(int ly7_iphi=std::max(1,ly6_iphi-1); ly7_iphi<=std::min(NBINS_PHI,ly6_iphi+1); ly7_iphi++) {
1050  float ly7_nsp = ly7_h2_nsp ->GetBinContent(ly7_ieta,ly7_iphi);
1051  float ly7_nsp_notrk = ly7_h2_nsp_notrk->GetBinContent(ly7_ieta,ly7_iphi);
1052  float ly7_frac = ( ly7_nsp > 0 ) ? ly7_nsp_notrk / ly7_nsp : 0;
1053  if( ly7_nsp < 10 ) continue;
1054  if( ly7_frac > ly7_frac_max ) {
1055  ly7_frac_max = ly7_frac;
1056  ly7_eta_max = (ly7_h2_nsp->GetXaxis()->GetBinLowEdge(ly7_ieta) + ly7_h2_nsp->GetXaxis()->GetBinUpEdge(ly7_ieta))/2.0;
1057  ly7_phi_max = (ly7_h2_nsp->GetXaxis()->GetBinLowEdge(ly7_iphi) + ly7_h2_nsp->GetXaxis()->GetBinUpEdge(ly7_iphi))/2.0;
1058  }
1059  }
1060  }
1061  if( ly7_frac_max < 0.85 ) continue;
1062  //
1063  float wsum = ly6_frac + ly7_frac_max;
1064  float weta = (ly6_eta*ly6_frac + ly7_eta_max*ly7_frac_max) / wsum;
1065  float wphi = (ly6_phi*ly6_frac + ly7_phi_max*ly7_frac_max) / wsum;
1066  float w = wsum / 2.0;
1067  QT.push_back(std::make_tuple(-1,w,weta,wphi));
1068  }
1069  }
1070  ATH_MSG_VERBOSE("nr of ly6/ly7 doublet candidate seeds=" << QT.size() << ", doing clustering...");
1071 
1072  // sort
1073  std::sort(QT.begin(), QT.end(),
1074  [](const std::tuple<int,float,float,float>& lhs, const std::tuple<int,float,float,float>& rhs) {
1075  return std::get<1>(lhs) > std::get<1>(rhs); } );
1076 
1077  // clustering
1078  const double CLUSTCUT_DIST_SQUARED = 0.04; // const double CLUSTCUT_DIST = 0.2;
1079  const double CLUSTCUT_SEED_FRAC = 0.9;
1080 
1081  std::vector<float> seeds_wsum;
1082 
1083  for(unsigned int i=0; i<QT.size(); i++) {
1084  float phi = std::get<3>(QT[i]);
1085  float eta = std::get<2>(QT[i]);
1086  float w = std::get<1>(QT[i]);
1087  if(i==0) {
1088  seeds_eta.push_back(w*eta); seeds_phi.push_back(w*phi);
1089  seeds_wsum.push_back(w);
1090  continue;
1091  }
1092  const int IDX_INITIAL = 100;
1093  float dist2_min = 100.0;
1094  int idx_min = IDX_INITIAL;
1095  for(unsigned j=0; j<seeds_eta.size(); j++) {
1096  float ceta = seeds_eta[j]/seeds_wsum[j];
1097  float cphi = seeds_phi[j]/seeds_wsum[j];
1098  // intentionally calculate in this way as phi is defined beyond -Pi/Pi (no boundary)
1099  float deta = std::fabs(ceta-eta);
1100  float dphi = std::fabs(cphi-phi);
1101  float dist2 = dphi*dphi+deta*deta;
1102  if( dist2 < dist2_min ) {
1103  dist2_min = dist2;
1104  idx_min = j;
1105  }
1106  }
1107  int match_idx = IDX_INITIAL;
1108  if( idx_min != IDX_INITIAL ) {
1109  if( dist2_min < CLUSTCUT_DIST_SQUARED ) { match_idx = idx_min; }
1110  }
1111  if( match_idx == IDX_INITIAL ) {
1112  if( w > CLUSTCUT_SEED_FRAC && dist2_min > CLUSTCUT_DIST_SQUARED ) {
1113  seeds_eta.push_back(w*eta); seeds_phi.push_back(w*phi);
1114  seeds_wsum.push_back(w);
1115  }
1116  continue;
1117  }
1118  float new_eta = seeds_eta[match_idx] + w*eta;
1119  float new_phi = seeds_phi[match_idx] + w*phi;
1120  float new_wsum = seeds_wsum[match_idx] + w;
1121  seeds_eta[match_idx] = new_eta;
1122  seeds_phi[match_idx] = new_phi;
1123  seeds_wsum[match_idx] = new_wsum;
1124  }
1125  QT.clear();
1126  for(unsigned int i=0; i<seeds_eta.size(); i++) {
1127  float eta = seeds_eta[i] / seeds_wsum[i];
1128  float phi = seeds_phi[i] / seeds_wsum[i];
1129  seeds_eta[i] = eta;
1130  if( phi < -TMath::Pi() ) phi = 2*TMath::Pi() + phi;
1131  if( phi > TMath::Pi() ) phi = -2*TMath::Pi() + phi;
1132  seeds_phi[i] = phi;
1133  }
1134  ATH_MSG_VERBOSE("after clustering, nr of seeds = " << seeds_eta.size());
1135 
1136  // delete overlap (can happen at phi=-Pi/Pi bounadry)
1137  std::vector<unsigned int> idx_to_delete;
1138  for(unsigned int i=0; i<seeds_eta.size(); i++) {
1139  if( std::find(idx_to_delete.begin(),idx_to_delete.end(),i) != idx_to_delete.end() ) continue;
1140  float eta_i = seeds_eta[i];
1141  float phi_i = seeds_phi[i];
1142  for(unsigned int j=i+1; j<seeds_eta.size(); j++) {
1143  if( std::find(idx_to_delete.begin(),idx_to_delete.end(),j) != idx_to_delete.end() ) continue;
1144  float eta_j = seeds_eta[j];
1145  float phi_j = seeds_phi[j];
1146  float dR2 = deltaR2(eta_i,phi_i,eta_j,phi_j);
1147  if( dR2 < CLUSTCUT_DIST_SQUARED ) idx_to_delete.push_back(j);
1148  }
1149  }
1150  ATH_MSG_VERBOSE("nr of duplicated seeds to be removed = " << idx_to_delete.size());
1151  if( idx_to_delete.size() > 0 ) {
1152  std::sort(idx_to_delete.begin(),idx_to_delete.end());
1153  for(unsigned int j=idx_to_delete.size(); j>0; j--) {
1154  unsigned int idx = idx_to_delete[j-1];
1155  seeds_eta.erase(seeds_eta.begin()+idx);
1156  seeds_phi.erase(seeds_phi.begin()+idx);
1157  }
1158  }
1159 
1160  ATH_MSG_VERBOSE("nr of ly6/ly7 seeds=" << seeds_eta.size());
1161 
1162  // return
1163  return StatusCode::SUCCESS;
1164 }

◆ getSPLayer()

int TrigHitDVHypoAlg::getSPLayer ( int  layer,
float  eta 
) const
private

Definition at line 332 of file TrigHitDVHypoAlg.cxx.

333 {
334  float abseta = std::fabs(eta);
335 
336  // if Pixel/SCT barrel, layer number is as it is
337  if( 0<=layer && layer <=7 ) {
338  ATH_MSG_VERBOSE("layer=" << layer << ", eta=" << abseta);
339  return layer;
340  }
341 
342  // for Pixel/SCT endcap, assign layer number of 0-7 depending on eta range
343 
344  int base = 0;
345 
346  //
347  const float PixBR6limit = 1.29612;
348  const float PixBR5limit = 1.45204;
349  const float PixBR4limit = 1.64909;
350  const float PixBR3limit = 1.90036;
351  const float PixBR2limit = 2.2146;
352 
353  // Pixel Endcap #1
354  base = 8;
355  if( layer==base || layer==(base+12) ) {
356  ATH_MSG_VERBOSE("Pix EC1, eta=" << abseta);
357  if( abseta > PixBR2limit ) return 2;
358  return 3;
359  }
360 
361  // Pixel Endcap #2
362  base = 9;
363  if( layer==base || layer==(base+12) ) {
364  ATH_MSG_VERBOSE("Pix EC2, eta=" << abseta);
365  if( abseta > PixBR2limit ) return 2;
366  return 3;
367  }
368 
369  // Pixel Endcap #3
370  base = 10;
371  if( layer==base || layer==(base+12) ) {
372  ATH_MSG_VERBOSE("Pix EC3, eta=" << abseta);
373  return 3;
374  }
375 
376  // SCT Endcap #1
377  base = 11;
378  if( layer==base || layer==(base+12) ) {
379  ATH_MSG_VERBOSE("Sct EC1, eta=" << abseta);
380  if( abseta < PixBR6limit ) return 7;
381  else if( abseta < PixBR5limit ) return 6;
382  return 5;
383  }
384 
385  // SCT Endcap #2
386  base = 12;
387  if( layer==base || layer==(base+12) ) {
388  ATH_MSG_VERBOSE("Sct EC2, eta=" << abseta);
389  if( abseta < PixBR5limit ) return 7;
390  else if( abseta < PixBR4limit ) return 6;
391  return 4;
392  }
393 
394  // SCT Endcap #3
395  base = 13;
396  if( layer==base || layer==(base+12) ) {
397  ATH_MSG_VERBOSE("Sct EC3, eta=" << abseta);
398  if( abseta < PixBR4limit ) return 7;
399  return 5;
400  }
401 
402  // SCT Endcap #4
403  base = 14;
404  if( layer==base || layer==(base+12) ) {
405  ATH_MSG_VERBOSE("Sct EC4, eta=" << abseta);
406  if( abseta < PixBR4limit ) return 6;
407  else if( abseta < PixBR3limit ) return 6;
408  return 4;
409  }
410 
411  // SCT Endcap #5
412  base = 15;
413  if( layer==base || layer==(base+12) ) {
414  ATH_MSG_VERBOSE("Sct EC5, eta=" << abseta);
415  if( abseta < PixBR3limit ) return 7;
416  return 5;
417  }
418 
419  // SCT Endcap #6
420  base = 16;
421  if( layer==base || layer==(base+12) ) {
422  ATH_MSG_VERBOSE("Sct EC6, eta=" << abseta);
423  if( abseta < PixBR3limit ) return 6;
424  return 4;
425  }
426 
427  // SCT Endcap #7
428  base = 17;
429  if( layer==base || layer==(base+12) ) {
430  ATH_MSG_VERBOSE("Sct EC7, eta=" << abseta);
431  if( abseta < PixBR3limit ) return 7;
432  return 5;
433  }
434 
435  // SCT Endcap #8
436  base = 18;
437  if( layer==base || layer==(base+12) ) {
438  ATH_MSG_VERBOSE("Sct EC8, eta=" << abseta);
439  if( abseta < PixBR3limit ) return 7;
440  return 6;
441  }
442 
443  // SCT Endcap #9
444  base = 19;
445  if( layer==base || layer==(base+12) ) {
446  ATH_MSG_VERBOSE("Sct EC9, eta=" << abseta);
447  return 7;
448  }
449 
450  return 0;
451 }

◆ hypoBaseOutputProcessing()

StatusCode HypoBase::hypoBaseOutputProcessing ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &  outputHandle,
MSG::Level  lvl = MSG::DEBUG 
) const
protectedinherited

Base class function to be called once slice specific code has finished. Handles debug printing and validation.

Definition at line 33 of file HypoBase.cxx.

33  {
34 
35  ATH_CHECK( printDebugInformation(outputHandle, lvl) );
36 
37  if (m_runtimeValidation) {
38  ATH_CHECK( runtimeValidation(outputHandle, msg()) );
39  }
40 
41  return StatusCode::SUCCESS;
42 }

◆ initialize()

StatusCode TrigHitDVHypoAlg::initialize ( )
overridevirtual

Definition at line 55 of file TrigHitDVHypoAlg.cxx.

56 {
57  m_tools_lowest_jetEt = 1000;
59  CHECK( m_hypoTools.retrieve() );
60  for ( auto & tool: m_hypoTools ) {
61  ATH_MSG_VERBOSE( "+++++ Hypo Tool name: " << tool->name() );
62  std::cmatch results;
63  if( std::regex_search(tool->name().c_str(),results,std::regex("hitdvjet(\\d+)_(\\w+)_")) ) {
64  std::string sth = results[1].str();
65  std::string swp = results[2].str();
66  ATH_MSG_VERBOSE( " thres = " << sth << ", wp = " << swp );
67  int thres = std::stoi(sth);
68  if( thres < m_tools_lowest_jetEt ) m_tools_lowest_jetEt = thres;
69  if( swp == "loose" && m_tools_loosest_wp >= 1 ) m_tools_loosest_wp = 1;
70  if( swp == "medium" && m_tools_loosest_wp >= 2 ) m_tools_loosest_wp = 2;
71  if( swp == "tight" && m_tools_loosest_wp >= 3 ) m_tools_loosest_wp = 3;
72  }
73  }
74  ATH_MSG_DEBUG( "Lowest jetEt used in hypo tools = " << m_tools_lowest_jetEt << " (GeV)" );
75  ATH_MSG_DEBUG( "Loosest WP used in hypo tools = " << m_tools_loosest_wp << " (loose=1,medium=2,tight=3)");
76  // loose : eta<2.0, SP seed=true, BDT eff=0.9
77  // medium: eta<2.0, SP seed=false, BDT eff=0.75
78  // tight : eta<1.0, SP seed=false, BDT eff=0.75
79 
81  CHECK( m_hitDVKey.initialize());
82  CHECK( m_tracksKey.initialize());
85 
86  if ( !m_monTool.empty() ) CHECK( m_monTool.retrieve() );
87 
89  ATH_CHECK(m_spacePointTool.retrieve() );
90 
91  // MVAUtils BDT initialisation
92  // could make this configurable as a property
93  std::string weightfile[2];
94  weightfile[0] = PathResolver::find_calib_file("TrigHitDVHypo/HitDV.BDT.weights.0eta1.v22a.root");
95  weightfile[1] = PathResolver::find_calib_file("TrigHitDVHypo/HitDV.BDT.weights.1eta2.v22a.root");
96  for (unsigned int i=0; i<2; ++i) {
97  std::unique_ptr<TFile> rootFile(TFile::Open(weightfile[i].c_str(), "READ"));
98  if (!rootFile) {
99  ATH_MSG_ERROR("Can not open BDT root file: " << weightfile[i] );
100  return StatusCode::FAILURE;
101  }
102  std::unique_ptr<TTree> tree((TTree*)rootFile->Get("BDT"));
103  if (!tree) {
104  ATH_MSG_ERROR("Can not find BDT tree in file: " << weightfile[i]);
105  return StatusCode::FAILURE;
106  }
107  ATH_MSG_INFO("Loading BDT tree from file: " << weightfile[i]);
108  m_bdt_eta[i] = std::make_unique<MVAUtils::BDT>(tree.get());
109  }
110 
111  return StatusCode::SUCCESS;
112 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::isClonable
overridevirtualinherited

Specify if the algorithm is clonable.

Reentrant algorithms are clonable.

Definition at line 68 of file AthCommonReentrantAlgorithm.cxx.

52 {
53  // Reentrant algorithms are clonable.
54  return true;
55 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ printBangs()

void HypoBase::printBangs ( MsgStream &  msg)
staticprivateinherited

Print header line.

Definition at line 388 of file HypoBase.cxx.

388  {
389  msg << MSG::ERROR << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << endmsg;
390 }

◆ printDebugInformation()

StatusCode HypoBase::printDebugInformation ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &  outputHandle,
MSG::Level  lvl 
) const
privateinherited

Common base function to print information on chains passed by objects considered in the hypo.

Definition at line 404 of file HypoBase.cxx.

404  {
405  if (msgLvl(lvl)) {
406  msg() << lvl;
407  msg() << "Exiting with " << outputHandle->size() <<" Decision objects" << endmsg;
408  size_t count = 0;
409  for (const Decision* d : *outputHandle){
410  DecisionIDContainer objDecisions;
411  decisionIDs( d, objDecisions );
412  msg() << "Number of positive decisions for Decision object #" << count++ << ": " << objDecisions.size() << endmsg;
413  for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
414  msg() << " --- Passes: " << HLT::Identifier( id ) << endmsg;
415  }
416  }
417  }
418  return StatusCode::SUCCESS;
419 }

◆ printErrorHeader()

void HypoBase::printErrorHeader ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg 
)
staticprivateinherited

A problem was found, print common output data.

Definition at line 393 of file HypoBase.cxx.

395 {
396  printBangs(msg);
397  msg << MSG::ERROR << "! RUNTIME TRIGGER NAVIGATION VALIDATION ERROR" << endmsg;
398  msg << MSG::ERROR << "! Caused by Decision with index:" << (*dEL)->index() << endmsg;
399  msg << MSG::ERROR << "! From collection:" << dEL.dataID() << endmsg;
400  msg << MSG::ERROR << "! " << **dEL << endmsg;
401 }

◆ recursiveValidateGraph()

StatusCode HypoBase::recursiveValidateGraph ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg,
bool  onlyValidateOneStep,
bool  runTwoConversion,
size_t  callDepth,
std::set< const TrigCompositeUtils::Decision * > &  fullyExploredFrom 
)
staticprivateinherited

Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1.

Definition at line 69 of file HypoBase.cxx.

75 {
76  if (onlyValidateOneStep && callDepth > 0) {
77  if ((*dEL)->name() == hypoAlgNodeName()) {
78  // Validation is called from HypoAlg nodes. So if we have reached the _previous_ HypoAlg node, then we have already
79  // validated back from here in the past. Can stop at this point.
80  return StatusCode::SUCCESS;
81  }
82  }
83 
84  // Check logical flow at this place in the graph
85  if ((*dEL)->name() == hypoAlgNodeName()) {
86  // Check that all Hypo Decisions produced here satisfy the more-strict all-parent logical flow
87  if ( validateLogicalFlow(dEL, msg, kRequireAll).isFailure() ) {
88  return StatusCode::FAILURE;
89  }
90  } else {
91  // (looser requirement of one-valid-parent-with-decision than we had when we knew that d corresponded to a HypoAlg output)
92  if ( validateLogicalFlow(dEL, msg, kRequireOne).isFailure() ) {
93  return StatusCode::FAILURE;
94  }
95  }
96 
97  // Check my IDs
98  if ( validateDecisionIDs(dEL, msg).isFailure() ) {
99  return StatusCode::FAILURE;
100  }
101  if ( validateDuplicatedDecisionID(dEL, msg).isFailure() ) {
102  return StatusCode::FAILURE;
103  }
104 
105  // Check my linking
106  if( validateParentLinking(dEL, msg, runTwoConversion).isFailure() ) {
107  return StatusCode::FAILURE;
108  }
109  if ( validateHasLinks(dEL, msg).isFailure() ) {
110  return StatusCode::FAILURE;
111  }
112 
113  // Continue upstream
114  const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
115  for (const ElementLink<DecisionContainer>& seed : seeds) {
116  if (fullyExploredFrom.count( (*seed) ) == 1) {
117  continue; // Already fully explored from this seed and up
118  }
119  if ( not seed.isValid() ) {
120  msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
121  return StatusCode::FAILURE;
122  }
123  if ( recursiveValidateGraph(seed, msg, onlyValidateOneStep, runTwoConversion, callDepth + 1, fullyExploredFrom).isFailure() ) {
124  return StatusCode::FAILURE;
125  }
126  }
127 
128  fullyExploredFrom.insert( *dEL );
129  return StatusCode::SUCCESS;
130 }

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ runtimeValidation()

StatusCode HypoBase::runtimeValidation ( SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &  outputHandle,
MsgStream &  msg,
bool  onlyValidateOneStep = true,
bool  runTwoConversion = false 
)
staticinherited

Executes all individual runtime tests.

Definition at line 45 of file HypoBase.cxx.

49 {
50  // Detailed checks on the output container of this HypoAlg
51  std::set<const Decision*> fullyExploredFrom; // Cache used to avoid exploring regions of the graph more than once
52  for (const Decision* d : *outputHandle) {
53  const DecisionContainer* dContainer = dynamic_cast<const DecisionContainer*>( d->container() );
54  const ElementLink<DecisionContainer> dEL = ElementLink<DecisionContainer>(*dContainer, d->index());
55  if (not dEL.isValid()) {
56  msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
57  return StatusCode::FAILURE;
58  }
59  // Check that we can reach L1 along all navigation paths up from each Decision
60  // and validate these Decisions on the way up too.
61  if (recursiveValidateGraph(dEL, msg, onlyValidateOneStep, runTwoConversion, 0, fullyExploredFrom).isFailure()) {
62  return StatusCode::FAILURE;
63  }
64  }
65  return StatusCode::SUCCESS;
66 }

◆ selectSeedsNearby()

StatusCode TrigHitDVHypoAlg::selectSeedsNearby ( const std::vector< HitDVSeed > &  hitDVSeedsContainer,
std::vector< float > &  jetSeeds_eta,
std::vector< float > &  jetSeeds_phi,
std::vector< float > &  jetSeeds_pt 
) const
private

Definition at line 937 of file TrigHitDVHypoAlg.cxx.

939 {
940  std::vector<unsigned int> idx_to_delete;
941  for(unsigned int idx=0; idx<jetSeeds_eta.size(); ++idx) {
942  const float DR_SQUARED_CUT_TO_FTFSEED = 0.09; // const float DR_CUT_TO_FTFSEED = 0.3;
943  float eta = jetSeeds_eta[idx];
944  float phi = jetSeeds_phi[idx];
945  float dR2min = 9999;
946  for ( const auto& seed : hitDVSeedsContainer ) {
947  float dR2 = deltaR2(eta,phi,seed.eta,seed.phi);
948  if( dR2 < dR2min ) dR2min = dR2;
949  }
950  if( dR2min > DR_SQUARED_CUT_TO_FTFSEED ) idx_to_delete.push_back(idx);
951  }
952  if( idx_to_delete.size() > 0 ) {
953  std::sort(idx_to_delete.begin(),idx_to_delete.end());
954  for(unsigned int j=idx_to_delete.size(); j>0; j--) {
955  unsigned int idx = idx_to_delete[j-1];
956  jetSeeds_eta.erase(jetSeeds_eta.begin()+idx);
957  jetSeeds_phi.erase(jetSeeds_phi.begin()+idx);
958  if( jetSeeds_pt.size() > 0 ) jetSeeds_pt.erase(jetSeeds_pt.begin()+idx);
959  }
960  }
961  return StatusCode::SUCCESS;
962 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool  state,
const EventContext &  ctx 
) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100  {
101  execState( ctx ).setFilterPassed( state );
102  }

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext &  ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77 {
78  return BaseAlg::sysExecute (ctx);
79 }

◆ sysInitialize()

StatusCode HypoBase::sysInitialize ( )
overridevirtualinherited

initialise this base class

Reimplemented from AthCommonReentrantAlgorithm< Gaudi::Algorithm >.

Definition at line 24 of file HypoBase.cxx.

24  {
25  CHECK( AthReentrantAlgorithm::sysInitialize() ); // initialise base class
26  CHECK( m_input.initialize() );
27  ATH_MSG_DEBUG("HypoBase::sysInitialize() Will consume decision: " << m_input.key() );
28  CHECK( m_output.initialize() );
29  ATH_MSG_DEBUG("HypoBase::sysInitialize() And produce decision: " << m_output.key() );
30  return StatusCode::SUCCESS;
31 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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  }

◆ validateDecisionIDs()

StatusCode HypoBase::validateDecisionIDs ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg 
)
staticprivateinherited

Ensure that all present IDs correspond to configured chains.

Definition at line 207 of file HypoBase.cxx.

209 {
210  // All numeric IDs must correspond to a know, configured, HLT chain
211  DecisionIDContainer decisionIDSet;
212  decisionIDs(*dEL, decisionIDSet);
213  for (const DecisionID id : decisionIDSet) {
214  const std::string chain = HLT::Identifier( id ).name();
215  if (!isChainId(chain) and !isLegId(chain)) {
216  printErrorHeader(dEL, msg);
217  msg << MSG::ERROR << "! Decision contains an ID which does not correspond to a configured chain or a configured chain-leg: " << HLT::Identifier( id ) << endmsg;
218  msg << MSG::ERROR << "! SOLUTION: Locate the producer of the collection, investigate how this bad ID could have been added." << endmsg;
219  printBangs(msg);
220  return StatusCode::FAILURE;
221  }
222  }
223  return StatusCode::SUCCESS;
224 }

◆ validateDuplicatedDecisionID()

StatusCode HypoBase::validateDuplicatedDecisionID ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg 
)
staticprivateinherited

Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.

Definition at line 227 of file HypoBase.cxx.

229 {
230  // Persistent vector storage does not guarantee against duplicate entries
231  DecisionIDContainer decisionIDSet;
232  decisionIDs(*dEL, decisionIDSet);
233  if (decisionIDSet.size() != (*dEL)->decisions().size()) {
234  printErrorHeader(dEL, msg);
235  msg << MSG::ERROR << "! Decision contains duplicate DecisionIDs." << endmsg;
236  msg << MSG::ERROR << "! SOLUTION: If combining DecisionIDs from multiple parents, de-duplicate the internal std::vector<DecisionID> of 'Decision* d' with:" << endmsg;
237  msg << MSG::ERROR << "! TrigCompositeUtils::insertDecisionIDs(DecisionIDContainer(), d);" << endmsg;
238  printBangs(msg);
239  return StatusCode::FAILURE;
240  }
241  return StatusCode::SUCCESS;
242 }

◆ validateHasLinks()

StatusCode HypoBase::validateHasLinks ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg 
)
staticprivateinherited

Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.

Definition at line 336 of file HypoBase.cxx.

338 {
339  const std::string& name = (*dEL)->name();
340  if (name == hypoAlgNodeName()) {
341 
342  // Check that I have a "feature"
343  if ((*dEL)->hasObjectLink( featureString() )) {
344  return StatusCode::SUCCESS;
345  }
346  printErrorHeader(dEL, msg);
347  msg << MSG::ERROR << "! Decision has no '" << featureString() << "' ElementLink." << endmsg;
348  msg << MSG::ERROR << "! Every Decision created by a HypoAlg must correspond to some physics object, and be linked to the object." << endmsg;
349  msg << MSG::ERROR << "! SOLUTION: Ensure that all produced Decision objects are assigned their feature:" << endmsg;
350  msg << MSG::ERROR << "! SOLUTION: decision->setObjectLink<MY_FEATURE_CONTANER_TYPE>(featureString(), MY_FEATURE_ELEMENT_LINK);" << endmsg;
351  printBangs(msg);
352  return StatusCode::FAILURE;
353 
354  } else if (name == inputMakerNodeName()) {
355 
356  // This requirement is dropped for empty input makers to avoid unnecessary graph clutter.
357  bool exempt = false;
358  if ((*dEL)->hasDetail<int32_t>("isEmpty") and (*dEL)->getDetail<int32_t>("isEmpty") == 1) {
359  exempt = true;
360  }
361 
362  if (not (*dEL)->hasObjectLink( roiString() ) and not exempt) {
363  printErrorHeader(dEL, msg);
364  msg << MSG::ERROR << "! Decision has no '" << roiString() << "' ElementLink." << endmsg;
365  msg << MSG::ERROR << "! Every Decision created by a InputMaker must link to the ROI which reconstruction will run on for that Decision object in this Step." << endmsg;
366  msg << MSG::ERROR << "! It can be the FullScan ROI created by the HLTSeeding (FSNOSEED) if no other suitable ROI exists." << endmsg;
367  msg << MSG::ERROR << "! SOLUTION: Check the configuration of InputMakerForRoI or EventViewCreatorAlgorithm responsible for creating this Decision Object" << endmsg;
368  msg << MSG::ERROR << "! SOLUTION: The algorithm must have an ROITool which must attach an '"<< roiString() <<"' link to each Decision Object" << endmsg;
369  printBangs(msg);
370  }
371 
372  } else if (name == hltSeedingNodeName()) {
373 
374  if (not (*dEL)->hasObjectLink( initialRoIString() )) {
375  printErrorHeader(dEL, msg);
376  msg << MSG::ERROR << "! Decision has no '" << initialRoIString() << "' ElementLink." << endmsg;
377  msg << MSG::ERROR << "! Every Decision created by the HLTSeeding must link to the initial ROI which caused it to be created." << endmsg;
378  msg << MSG::ERROR << "! This includes the Decision Object created to represent the Full-Scan/NoSeed (FSNOSEED) ROI." << endmsg;
379  msg << MSG::ERROR << "! SOLUTION: Check the configuration of the HLTSeeding tool responsible for creating this Decision Object" << endmsg;
380  printBangs(msg);
381  }
382 
383  }
384  return StatusCode::SUCCESS;
385 }

◆ validateLogicalFlow()

StatusCode HypoBase::validateLogicalFlow ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg,
const LogicalFlowCheckMode  mode 
)
staticprivateinherited

Ensure that all DecisionIDs have propagated correctly from their parent.

Definition at line 245 of file HypoBase.cxx.

248 {
249  // Do not need to validate for L1 Decisions as these have no parents
250  if ((*dEL)->name() == hltSeedingNodeName()) {
251  return StatusCode::SUCCESS;
252  }
253 
254  // Get all my passed DecisionIDs
255  DecisionIDContainer decisionIDSet;
256  decisionIDs(*dEL, decisionIDSet);
257  const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
258  for (const DecisionID id : decisionIDSet) {
259  // For each chain that I'm passing, check how many of my parents were also passing the chain
260  size_t parentsWithDecision = 0;
261  for (const ElementLink<DecisionContainer>& seed : seeds) {
262  if ( not seed.isValid() ) {
263  msg << MSG::ERROR << "Invalid seed element link in recursiveValidateGraph" << endmsg;
264  return StatusCode::FAILURE;
265  }
266  DecisionIDContainer seedIDSet;
267  decisionIDs(*seed, seedIDSet);
268  // Id may be a chain-ID (represents a whole chain) or a leg-ID (represents just a single leg of a multi-leg chain)
269  // Is ID is in this parent's set of passed IDs?
270  // Or, (if ID is a leg-ID) is the chain-ID of leg-ID in the parent's set of passed IDs?
271  if (passed(id, seedIDSet) or passed(getIDFromLeg(id).numeric(), seedIDSet)) {
272  ++parentsWithDecision;
273  }
274  else{ // Or, for each of the seed IDs, if the seed ID is a leg-ID, is the seed chain-ID of the seed leg-ID the same as ID?
275  for (auto sid: seedIDSet){
276  if (getIDFromLeg(sid).numeric() == id){
277  ++parentsWithDecision;
278  break;
279  }
280  }
281  }
282  }
283 
284  if (mode == kRequireOne && parentsWithDecision == 0) {
285  // InputMakers may merge multiple of their input collections in order to run reconstruction on a common set of ROI (for example)
286  // So the DecisionIDs may have come from any one or more of the inputs. But zero is not allowed.
287  printErrorHeader(dEL, msg);
288  msg << MSG::ERROR << "! This Decision object is not respecting logical flow of DecisionIDs for chain: " << HLT::Identifier( id ) << endmsg;
289  msg << MSG::ERROR << "! This chain's DecisionID can not be found in any parents of this Decision object:" << endmsg;
290  size_t seed_n = 0;
291  for (const ElementLink<DecisionContainer>& seed : seeds) {
292  msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
293  msg << MSG::ERROR << "! " << **seed << endmsg;
294  DecisionIDContainer objDecisions;
295  decisionIDs(*seed, objDecisions);
296  for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
297  msg << "! --- Passing in parent #" << seed_n << ": " << HLT::Identifier( id ) << endmsg;
298  }
299  ++seed_n;
300  }
301  msg << MSG::ERROR << "! SOLUTION: Ensure that the producer of this Decision object only adds DecisionIDs"
302  " which were present in at least one of its parents." << endmsg;
303  printBangs(msg);
304  return StatusCode::FAILURE;
305  } else if (mode == kRequireAll && parentsWithDecision != seeds.size()) {
306  // HypoAlgs may form a new physics object from multiple objects in the previous step
307  // (think a BPhysics object whose parents are two Decisions which each correspond to a different L1 MU RoI,
308  // both ROI need to be in active state for the chain, if the chain's HypoTool considers the BPhysics object)
309  // This case requires *all* of the physics objects which are being combined together to be active for the chain
310  // in order to preserve logical flow
311  printErrorHeader(dEL, msg);
312  msg << MSG::ERROR << "! This Decision object is not respecting logical flow of DecisionIDs for chain: " << HLT::Identifier( id ) << endmsg;
313  msg << MSG::ERROR << "! As this Decision object represents the output of a HypoAlg, it must respect logical flow on all "
314  << seeds.size() << " of its parent(s):" << endmsg;
315  size_t seed_n = 0;
316  for (const ElementLink<DecisionContainer>& seed : seeds) {
317  msg << MSG::ERROR << "! Index:" << (*seed)->index() << " from collection:" << seed.dataID() << endmsg;
318  msg << MSG::ERROR << "! " << **seed << endmsg;
319  DecisionIDContainer objDecisions;
320  decisionIDs(*seed, objDecisions);
321  for (const TrigCompositeUtils::DecisionID id : objDecisions ) {
322  msg << "! --- Passing in parent #" << seed_n << ": " << HLT::Identifier( id ) << endmsg;
323  }
324  ++seed_n;
325  }
326  msg << MSG::ERROR << "! SOLUTION: Ensure that the HypoTool responsible for " << HLT::Identifier( id )
327  << " in this HypoAlg only runs if this ID is present in all parent decisions." << endmsg;
328  printBangs(msg);
329  return StatusCode::FAILURE;
330  }
331  }
332  return StatusCode::SUCCESS;
333 }

◆ validateParentLinking()

StatusCode HypoBase::validateParentLinking ( const ElementLink< TrigCompositeUtils::DecisionContainer > &  dEL,
MsgStream &  msg,
bool  runTwoConversion 
)
staticprivateinherited

Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTSeeding.

Definition at line 133 of file HypoBase.cxx.

136 {
137  const std::vector<ElementLink<DecisionContainer>> seeds = (*dEL)->objectCollectionLinks<DecisionContainer>(seedString());
138  // All Decision object must have at least one parent, unless they are the initial set of objects created by the HLTSeeding
139  const std::string& name = (*dEL)->name();
140  if (seeds.size() == 0 && name != hltSeedingNodeName()) {
141  printErrorHeader(dEL, msg);
142  msg << MSG::ERROR << "! Decision has zero parents. This is only allowed for the initial Decisions created by the HLTSeeding." << endmsg;
143  msg << MSG::ERROR << "! SOLUTION: Attach parent Decision(s) with TrigCompositeUtils::linkToPrevious" << endmsg;
144  printBangs(msg);
145  return StatusCode::FAILURE;
146  }
147 
148  if (name == hltSeedingNodeName()) {
149  if (seeds.size() > 0) {
150  printErrorHeader(dEL, msg);
151  msg << MSG::ERROR << "! Decision has parents. This is not allowed for the initial Decisions created by the HLTSeeding." << endmsg;
152  msg << MSG::ERROR << "! SOLUTION: Check HLTSeeding, no where should it be adding a parent link." << endmsg;
153  printBangs(msg);
154  return StatusCode::FAILURE;
155  }
156  return StatusCode::SUCCESS;
157  }
158 
159  static const std::set<std::string> expectedParentsFilter = {hypoAlgNodeName(), comboHypoAlgNodeName(), hltSeedingNodeName()};
160  static const std::set<std::string> expectedParentsInputMaker = {filterNodeName()};
161  static const std::set<std::string> expectedParentsHypoAlg = {inputMakerNodeName()};
162  static const std::set<std::string> expectedParentsComboHypoAlg = {hypoAlgNodeName(), inputMakerNodeName(), hltSeedingNodeName()}; // TODO check hltSeedingNodeName(), needed for newJO
163  static const std::set<std::string> expectedParentsSummaryFilter = {hypoAlgNodeName(), comboHypoAlgNodeName(), hltSeedingNodeName()};
164  static const std::set<std::string> expectedParentsSummaryPassed = {"SF"}; // TODO change to summaryFilterNodeName() when merged
165 
166  const std::set<std::string>* expectedParentsPtr = nullptr;
167  if (name == filterNodeName()) {
168  expectedParentsPtr = &expectedParentsFilter;
169  } else if (name == inputMakerNodeName() and !runTwoConversion) {
170  expectedParentsPtr = &expectedParentsInputMaker;
171  } else if (name == inputMakerNodeName() and runTwoConversion) {
172  expectedParentsPtr = &expectedParentsFilter; // We don't have Filter nodes in the R2->R3 conversion
173  } else if (name == hypoAlgNodeName()) {
174  expectedParentsPtr = &expectedParentsHypoAlg;
175  } else if (name == comboHypoAlgNodeName()) {
176  expectedParentsPtr = &expectedParentsComboHypoAlg;
177  } else if (name == "SF") { // TODO change to summaryFilterNodeName() when merged
178  expectedParentsPtr = &expectedParentsSummaryFilter;
179  } else if (name == "HLTPassRaw") { // TODO change to summaryPassNodeNameString() when merged
180  expectedParentsPtr = &expectedParentsSummaryPassed;
181  } else {
182  printErrorHeader(dEL, msg);
183  msg << MSG::ERROR << "! Invalid Node name '" << name << "'." << endmsg;
184  msg << MSG::ERROR << "! SOLUTION: Find the alg which made a node with this name. Allowed named may be found in TrigCompositeUtils.h, See:'Constant string literals used within the HLT'." << endmsg;
185  printBangs(msg);
186  return StatusCode::FAILURE;
187  }
188 
189  for (const ElementLink<DecisionContainer>& seed : seeds) {
190  if (expectedParentsPtr->count( (*seed)->name() ) == 0) {
191  printErrorHeader(dEL, msg);
192  msg << MSG::ERROR << "! Invalid linking from node with name '" << name << "' to one with name '"<< (*seed)->name() << "'." << endmsg;
193  msg << MSG::ERROR << "! Allowed seed names are:" << endmsg;
194  for (const std::string& allowed : *expectedParentsPtr) {
195  msg << MSG::ERROR << "! " << allowed << endmsg;
196  }
197  msg << MSG::ERROR << "! SOLUTION: Find where this invalid parent was added and correct it." << endmsg;
198  printBangs(msg);
199  return StatusCode::FAILURE;
200  }
201  }
202 
203  return StatusCode::SUCCESS;
204 }

Member Data Documentation

◆ m_bdt_eta

std::unique_ptr<MVAUtils::BDT> TrigHitDVHypoAlg::m_bdt_eta[2]
private

Definition at line 112 of file TrigHitDVHypoAlg.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> TrigHitDVHypoAlg::m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" }
private

Definition at line 125 of file TrigHitDVHypoAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doHitDV_Seeding

bool TrigHitDVHypoAlg::m_doHitDV_Seeding = true
private

Definition at line 122 of file TrigHitDVHypoAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_hitDVKey

SG::WriteHandleKey<xAOD::TrigCompositeContainer> TrigHitDVHypoAlg::m_hitDVKey {this, "HitDV", "HLT_HitDV", ""}
private

Definition at line 78 of file TrigHitDVHypoAlg.h.

◆ m_hitDVLinkName

Gaudi::Property<std::string> TrigHitDVHypoAlg::m_hitDVLinkName {this, "hitDVLinkName", "HitDVSeedLink", "Name of the link to HitDVContainer. Used by ViewCreatorROITool."}
private

Definition at line 91 of file TrigHitDVHypoAlg.h.

◆ m_hypoTools

ToolHandleArray< TrigHitDVHypoTool > TrigHitDVHypoAlg::m_hypoTools {this, "HypoTools", {}, "Tools to perform selection"}
private

Definition at line 74 of file TrigHitDVHypoAlg.h.

◆ m_input

SG::ReadHandleKey<TrigCompositeUtils::DecisionContainer> HypoBase::m_input { this, "HypoInputDecisions", "UNSPECIFIED_INPUT", "Input Decision (implicit)" }
privateinherited

input decisions

Definition at line 101 of file HypoBase.h.

◆ m_isMC

Gaudi::Property<bool> TrigHitDVHypoAlg::m_isMC {this, "isMC", false, "Real data or MC"}
private

Definition at line 86 of file TrigHitDVHypoAlg.h.

◆ m_jetRoiCollectionKey

SG::ReadHandleKey<xAOD::jFexSRJetRoIContainer> TrigHitDVHypoAlg::m_jetRoiCollectionKey {this, "jFexSRJetRoI", "", ""}
private

Definition at line 124 of file TrigHitDVHypoAlg.h.

◆ m_jetSeed_etaMax

Gaudi::Property<float> TrigHitDVHypoAlg::m_jetSeed_etaMax {this, "jetSeed_etaMin", 2.0, "Maximum eta for jet seed"}
private

Definition at line 89 of file TrigHitDVHypoAlg.h.

◆ m_jetSeed_ptMin

Gaudi::Property<float> TrigHitDVHypoAlg::m_jetSeed_ptMin {this, "jetSeed_ptMin", 50.0, "Minimum pT for jet seed"}
private

Definition at line 88 of file TrigHitDVHypoAlg.h.

◆ m_jetsKey

SG::ReadHandleKey< xAOD::JetContainer > TrigHitDVHypoAlg::m_jetsKey {this, "Jets", "HLT_AntiKt4EMTopoJets_subjesIS", ""}
private

Definition at line 77 of file TrigHitDVHypoAlg.h.

◆ m_lumiBlockMuTool

ToolHandle<ILumiBlockMuTool> TrigHitDVHypoAlg::m_lumiBlockMuTool
private

Definition at line 82 of file TrigHitDVHypoAlg.h.

◆ m_lumiDataKey

SG::ReadCondHandleKey<LuminosityCondData> TrigHitDVHypoAlg::m_lumiDataKey {this, "LuminosityCondDataKey", "LuminosityCondData", ""}
private

Definition at line 84 of file TrigHitDVHypoAlg.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigHitDVHypoAlg::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 97 of file TrigHitDVHypoAlg.h.

◆ m_output

SG::WriteHandleKey<TrigCompositeUtils::DecisionContainer> HypoBase::m_output { this, "HypoOutputDecisions", "UNSPECIFIED_OUTPUT", "Ouput Decision" }
privateinherited

output decisions

Definition at line 103 of file HypoBase.h.

◆ m_runtimeValidation

Gaudi::Property<bool> HypoBase::m_runtimeValidation { this, "RuntimeValidation", false, "Enable detailed runtime validation of HypoAlg output, and upstream Decisions." }
privateinherited

Enabling of detailed validation checks for use during development.

Definition at line 105 of file HypoBase.h.

◆ m_spacePointTool

ToolHandle<ITrigSpacePointConversionTool> TrigHitDVHypoAlg::m_spacePointTool {this, "SpacePointProviderTool", "TrigSpacePointConversionTool"}
private

Definition at line 73 of file TrigHitDVHypoAlg.h.

◆ m_tools_loosest_wp

int TrigHitDVHypoAlg::m_tools_loosest_wp = 0
private

Definition at line 116 of file TrigHitDVHypoAlg.h.

◆ m_tools_lowest_jetEt

int TrigHitDVHypoAlg::m_tools_lowest_jetEt = 1000
private

Definition at line 115 of file TrigHitDVHypoAlg.h.

◆ m_tracksKey

SG::ReadHandleKey< TrackCollection> TrigHitDVHypoAlg::m_tracksKey {this, "HitDVTracks", "HLT_IDTrkTrack_FS_FTF", ""}
private

Definition at line 79 of file TrigHitDVHypoAlg.h.

◆ m_useBeamSpot

bool TrigHitDVHypoAlg::m_useBeamSpot = true
private

Definition at line 119 of file TrigHitDVHypoAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
Trk::SpacePoint::clusterList
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:127
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
HitDVSpacePoint::isPix
bool isPix
Definition: TrigHitDVHypoAlg.h:58
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
base
std::string base
Definition: hcg.cxx:78
PathResolver::find_calib_file
static std::string find_calib_file(const std::string &logical_file_name)
Definition: PathResolver.cxx:384
TrigHitDVHypoAlg::m_bdt_eta
std::unique_ptr< MVAUtils::BDT > m_bdt_eta[2]
Definition: TrigHitDVHypoAlg.h:112
Trk::SpacePoint
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:35
HitDVTrk::n_hits_inner
int16_t n_hits_inner
Definition: TrigHitDVHypoAlg.h:47
xAOD::jFexSRJetRoI_v1
Class describing properties of a LVL1 jFEX global Trigger Object (TOB) in the xAOD format.
Definition: jFexSRJetRoI_v1.h:23
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
trackInfo::ptGeV
float ptGeV
Definition: TrigInDetUtils.h:15
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
trackInfo::n_hits_inner
int n_hits_inner
Definition: TrigInDetUtils.h:14
HitDVSpacePoint::r
float r
Definition: TrigHitDVHypoAlg.h:55
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
PlotCalibFromCool.dv
dv
Definition: PlotCalibFromCool.py:762
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
FTF::isGoodTrackUTT
bool isGoodTrackUTT(const Trk::Track *track, trackInfo &theTrackInfo, const float shift_x, const float shift_y, float trkcut_ptgev)
Definition: TrigInDetUtils.cxx:4
TrigHitDVHypoAlg::m_spacePointTool
ToolHandle< ITrigSpacePointConversionTool > m_spacePointTool
Definition: TrigHitDVHypoAlg.h:73
TrigCompositeUtils::hltSeedingNodeName
const std::string & hltSeedingNodeName()
Definition: TrigCompositeUtilsRoot.cxx:892
xAOD::TrigComposite
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:16
Trk::SpacePoint::globalPosition
virtual const Amg::Vector3D & globalPosition() const override final
Interface method to get the global Position.
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:146
TrigL2MuonSA::N_LAYER
constexpr int N_LAYER
Definition: MuonRoad.h:17
HitDVSpacePoint
Definition: TrigHitDVHypoAlg.h:53
dqt_zlumi_pandas.hname
string hname
Definition: dqt_zlumi_pandas.py:279
TrigCompositeUtils::newDecisionIn
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
Definition: TrigCompositeUtilsRoot.cxx:46
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
hist_file_dump.d
d
Definition: hist_file_dump.py:143
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:904
CxxUtils::wrapToPi
T wrapToPi(T phi)
Wrap angle in radians to [-pi, pi].
Definition: phihelper.h:24
tree
TChain * tree
Definition: tile_monitor.h:30
TrigHitDVHypoAlg::m_jetRoiCollectionKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jetRoiCollectionKey
Definition: TrigHitDVHypoAlg.h:124
AthCommonDataStore::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 > renounce(T &h)
Definition: AthCommonDataStore.h:380
python.TrigCompositeUtils.isLegId
def isLegId(chainName)
Definition: DecisionHandling/python/TrigCompositeUtils.py:18
skel.it
it
Definition: skel.GENtoEVGEN.py:407
M_PI
#define M_PI
Definition: ActiveFraction.h:11
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TrigHitDVHypoAlg::m_useBeamSpot
bool m_useBeamSpot
Definition: TrigHitDVHypoAlg.h:119
DataVector::get
const T * get(size_type n) const
Access an element, as an rvalue.
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
HypoBase::decisionInput
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
Definition: HypoBase.cxx:16
TrigHitDVHypoAlg::m_tools_loosest_wp
int m_tools_loosest_wp
Definition: TrigHitDVHypoAlg.h:116
TrigHitDVHypoAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigHitDVHypoAlg.h:97
HypoBase::printBangs
static void printBangs(MsgStream &msg)
Print header line.
Definition: HypoBase.cxx:388
TrigCompositeUtils::comboHypoAlgNodeName
const std::string & comboHypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:908
TrigCompositeUtils::createAndStore
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Definition: TrigCompositeUtilsRoot.cxx:30
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
TrigRoiDescriptor
nope - should be used for standalone also, perhaps need to protect the class def bits #ifndef XAOD_AN...
Definition: TrigRoiDescriptor.h:56
xAOD::jFexSRJetRoI_v1::eta
float eta() const
xAOD::jFexSRJetRoI_v1::phi
float phi() const
FTF::getBeamSpotShift
void getBeamSpotShift(float &shift_x, float &shift_y, const InDet::BeamSpotData &beamSpotHandle)
Definition: TrigInDetUtils.cxx:30
HitDVTrk::phi
float phi
Definition: TrigHitDVHypoAlg.h:46
HitDVTrk::pt
float pt
Definition: TrigHitDVHypoAlg.h:44
HypoBase::kRequireAll
@ kRequireAll
Definition: HypoBase.h:54
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trk::SpacePoint::r
double r() const
returns the r value of the SpacePoint's position (in cylindrical coordinates).
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePoint.h:137
HitDVSeed
Definition: TrigHitDVHypoAlg.h:36
xAOD::int16_t
setScaleOne setStatusOne setSaturated int16_t
Definition: gFexGlobalRoI_v1.cxx:55
HypoBase::decisionOutput
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
Definition: HypoBase.cxx:20
XMLtoHeader.count
count
Definition: XMLtoHeader.py:85
HitDVTrk::a0beam
float a0beam
Definition: TrigHitDVHypoAlg.h:50
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TrigHitDVHypoAlg::m_jetSeed_etaMax
Gaudi::Property< float > m_jetSeed_etaMax
Definition: TrigHitDVHypoAlg.h:89
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TrigHitDVHypoTool::HitDVHypoInfo
Definition: TrigHitDVHypoTool.h:33
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
HitDVTrk::n_hits_pix
int16_t n_hits_pix
Definition: TrigHitDVHypoAlg.h:48
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
HypoBase::recursiveValidateGraph
static StatusCode recursiveValidateGraph(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool onlyValidateOneStep, bool runTwoConversion, size_t callDepth, std::set< const TrigCompositeUtils::Decision * > &fullyExploredFrom)
Execute all checks on one node in the graph, d, then recursive call self on all parent nodes up to L1...
Definition: HypoBase.cxx:69
trackInfo::eta
float eta
Definition: TrigInDetUtils.h:15
TrigHitDVHypoAlg::deltaR2
float deltaR2(float, float, float, float) const
Definition: TrigHitDVHypoAlg.cxx:323
AthCommonReentrantAlgorithm::extraOutputDeps
virtual const DataObjIDColl & extraOutputDeps() const override
Return the list of extra output dependencies.
Definition: AthCommonReentrantAlgorithm.cxx:89
HitDVSpacePoint::phi
float phi
Definition: TrigHitDVHypoAlg.h:56
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TrigHitDVHypoAlg::m_doHitDV_Seeding
bool m_doHitDV_Seeding
Definition: TrigHitDVHypoAlg.h:122
trackInfo::n_hits_pix
int n_hits_pix
Definition: TrigInDetUtils.h:14
AthCommonDataStore
Definition: AthCommonDataStore.h:52
Generate_dsid_ranseed.seed
seed
Definition: Generate_dsid_ranseed.py:10
perfmonmt-refit.idx_min
idx_min
Definition: perfmonmt-refit.py:83
TrigHitDVHypoAlg::selectSeedsNearby
StatusCode selectSeedsNearby(const std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< float > &jetSeeds_eta, std::vector< float > &jetSeeds_phi, std::vector< float > &jetSeeds_pt) const
Definition: TrigHitDVHypoAlg.cxx:937
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HitDVTrk::n_hits_sct
int16_t n_hits_sct
Definition: TrigHitDVHypoAlg.h:49
lumiFormat.i
int i
Definition: lumiFormat.py:85
HypoBase::validateDuplicatedDecisionID
static StatusCode validateDuplicatedDecisionID(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that no space is being wasted by duplicated DecisionIDs in any Decision objects.
Definition: HypoBase.cxx:227
TrigCompositeUtils::initialRoIString
const std::string & initialRoIString()
Definition: TrigCompositeUtilsRoot.cxx:868
HypoBase::hypoBaseOutputProcessing
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
Definition: HypoBase.cxx:33
HypoBase::m_runtimeValidation
Gaudi::Property< bool > m_runtimeValidation
Enabling of detailed validation checks for use during development.
Definition: HypoBase.h:105
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
checkxAOD.frac
frac
Definition: Tools/PyUtils/bin/checkxAOD.py:259
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:548
HypoBase::m_input
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_input
input decisions
Definition: HypoBase.h:101
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
AthCommonReentrantAlgorithm::sysExecute
virtual StatusCode sysExecute(const EventContext &ctx) override
Execute an algorithm.
Definition: AthCommonReentrantAlgorithm.cxx:76
TrigHitDVHypoAlg::m_lumiBlockMuTool
ToolHandle< ILumiBlockMuTool > m_lumiBlockMuTool
Definition: TrigHitDVHypoAlg.h:82
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
makeComparison.rootFile
rootFile
Definition: makeComparison.py:27
Preparation.mode
mode
Definition: Preparation.py:107
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
add-xsec-uncert-quadrature-N.results
dictionary results
Definition: add-xsec-uncert-quadrature-N.py:39
HypoBase::validateLogicalFlow
static StatusCode validateLogicalFlow(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, const LogicalFlowCheckMode mode)
Ensure that all DecisionIDs have propagated correctly from their parent.
Definition: HypoBase.cxx:245
HypoBase::validateDecisionIDs
static StatusCode validateDecisionIDs(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure that all present IDs correspond to configured chains.
Definition: HypoBase.cxx:207
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
trackInfo::n_hits_sct
int n_hits_sct
Definition: TrigInDetUtils.h:14
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigHitDVHypoAlg::doMonitor
StatusCode doMonitor(const xAOD::TrigCompositeContainer *) const
Definition: TrigHitDVHypoAlg.cxx:456
TrigHitDVHypoAlg::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrigHitDVHypoAlg.h:125
trackInfo
Definition: TrigInDetUtils.h:13
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
Trk::PrepRawData
Definition: PrepRawData.h:62
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
keylayer_zslicemap.isPix
isPix
Definition: keylayer_zslicemap.py:127
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
TrigCompositeUtils::isChainId
bool isChainId(const HLT::Identifier &chainIdentifier)
Recognise whether the HLT identifier corresponds to a whole chain.
Definition: TrigCompositeUtilsRoot.cxx:212
TrigHitDVHypoAlg::findJetSeeds
StatusCode findJetSeeds(const xAOD::JetContainer *, const float, const float, std::vector< float > &, std::vector< float > &, std::vector< float > &) const
Definition: TrigHitDVHypoAlg.cxx:698
trackInfo::a0beam
float a0beam
Definition: TrigInDetUtils.h:15
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
TrigHitDVHypoAlg::m_tracksKey
SG::ReadHandleKey< TrackCollection > m_tracksKey
Definition: TrigHitDVHypoAlg.h:79
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
HitDVTrk::eta
float eta
Definition: TrigHitDVHypoAlg.h:45
TrigHitDVHypoAlg::m_jetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_jetsKey
Definition: TrigHitDVHypoAlg.h:77
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigHitDVHypoAlg::calculateBDT
StatusCode calculateBDT(const std::vector< HitDVSpacePoint > &, const std::vector< HitDVTrk > &, const std::vector< float > &, const std::vector< float > &, const std::vector< float > &, const float &, const int, xAOD::TrigCompositeContainer *, int &) const
Definition: TrigHitDVHypoAlg.cxx:555
TrigHitDVHypoAlg::m_hitDVKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_hitDVKey
Definition: TrigHitDVHypoAlg.h:78
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigHitDVHypoAlg::m_lumiDataKey
SG::ReadCondHandleKey< LuminosityCondData > m_lumiDataKey
Definition: TrigHitDVHypoAlg.h:84
TrigHitDVHypoAlg::m_isMC
Gaudi::Property< bool > m_isMC
Definition: TrigHitDVHypoAlg.h:86
TrigCompositeUtils::filterNodeName
const std::string & filterNodeName()
Definition: TrigCompositeUtilsRoot.cxx:896
HitDVSpacePoint::layer
int16_t layer
Definition: TrigHitDVHypoAlg.h:57
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
TrigCompositeUtils::seedString
const std::string & seedString()
Definition: TrigCompositeUtilsRoot.cxx:888
a
TList * a
Definition: liststreamerinfos.cxx:10
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
h
HypoBase::printDebugInformation
StatusCode printDebugInformation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl) const
Common base function to print information on chains passed by objects considered in the hypo.
Definition: HypoBase.cxx:404
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
HypoBase::validateParentLinking
static StatusCode validateParentLinking(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg, bool runTwoConversion)
Ensure that the Decision has at least one valid parent, unless it is a initial Decision from the HLTS...
Definition: HypoBase.cxx:133
TrigHitDVHypoAlg::m_jetSeed_ptMin
Gaudi::Property< float > m_jetSeed_ptMin
Definition: TrigHitDVHypoAlg.h:88
HitDVSpacePoint::eta
float eta
Definition: TrigHitDVHypoAlg.h:54
TrigHitDVHypoAlg::findSPSeeds
StatusCode findSPSeeds(const EventContext &, const std::vector< HitDVSpacePoint > &, std::vector< float > &, std::vector< float > &) const
Definition: TrigHitDVHypoAlg.cxx:734
HypoBase::HypoBase
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition: HypoBase.cxx:10
TrigCompositeUtils::allFailed
bool allFailed(const Decision *d)
return true if there is no positive decision stored
Definition: TrigCompositeUtilsRoot.cxx:103
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
HLT::Identifier::name
std::string name() const
reports human redable name if it is enabled or, empty string
Definition: HLTIdentifier.cxx:14
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:629
HypoBase::m_output
SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > m_output
output decisions
Definition: HypoBase.h:103
HitDVSpacePoint::usedTrkId
int16_t usedTrkId
Definition: TrigHitDVHypoAlg.h:60
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthCommonReentrantAlgorithm.cxx:107
TrigCompositeUtils::roiString
const std::string & roiString()
Definition: TrigCompositeUtilsRoot.cxx:876
Trk::jet_phi
@ jet_phi
Definition: JetVtxParamDefs.h:28
Trk::phi
@ phi
Definition: ParamDefs.h:75
TrigRoiDescriptor
Athena::TPCnvVers::Current TrigRoiDescriptor
Definition: TrigSteeringEventTPCnv.cxx:68
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
HypoBase::runtimeValidation
static StatusCode runtimeValidation(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MsgStream &msg, bool onlyValidateOneStep=true, bool runTwoConversion=false)
Executes all individual runtime tests.
Definition: HypoBase.cxx:45
TrigCompositeUtils::getIDFromLeg
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
Definition: TrigCompositeUtilsRoot.cxx:180
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigHitDVHypoAlg::m_hypoTools
ToolHandleArray< TrigHitDVHypoTool > m_hypoTools
Definition: TrigHitDVHypoAlg.h:74
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
TrigHitDVHypoAlg::findHitDV
StatusCode findHitDV(const EventContext &ctx, const std::vector< TrigSiSpacePointBase > &convertedSpacePoints, const DataVector< Trk::Track > &tracks, std::vector< HitDVSeed > &hitDVSeedsContainer, std::vector< HitDVTrk > &hitDVTrksContainer, std::vector< HitDVSpacePoint > &hitDVSPContainer) const
Definition: TrigHitDVHypoAlg.cxx:1166
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:537
AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
Definition: AthCommonReentrantAlgorithm.h:114
HypoBase::validateHasLinks
static StatusCode validateHasLinks(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
Ensure all Decisions have the named ElementLink graph edges which they are required to by spec.
Definition: HypoBase.cxx:336
TrigHitDVHypoAlg::m_tools_lowest_jetEt
int m_tools_lowest_jetEt
Definition: TrigHitDVHypoAlg.h:115
HitDVTrk::id
int id
Definition: TrigHitDVHypoAlg.h:43
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
HypoBase::printErrorHeader
static void printErrorHeader(const ElementLink< TrigCompositeUtils::DecisionContainer > &dEL, MsgStream &msg)
A problem was found, print common output data.
Definition: HypoBase.cxx:393
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
HitDVSpacePoint::isSct
bool isSct
Definition: TrigHitDVHypoAlg.h:59
HypoBase::kRequireOne
@ kRequireOne
Require all DecisionIDs to be present in at least one of my parent Decision objects.
Definition: HypoBase.h:53
HitDVTrk
Definition: TrigHitDVHypoAlg.h:42
TrigCompositeUtils::inputMakerNodeName
const std::string & inputMakerNodeName()
Definition: TrigCompositeUtilsRoot.cxx:900
fitman.k
k
Definition: fitman.py:528
TrigHitDVHypoAlg::getSPLayer
int getSPLayer(int, float) const
Definition: TrigHitDVHypoAlg.cxx:332
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
xAOD::jFexSRJetRoI_v1::et
unsigned int et() const
Methods that require combining results or applying scales.
Definition: jFexSRJetRoI_v1.cxx:138
Identifier
Definition: IdentifierFieldParser.cxx:14