ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Trig::TrigConfBunchCrossingTool Class Referenceabstract

The trigger config implementation of IBunchCrossingTool. More...

#include <TrigConfBunchCrossingTool.h>

Inheritance diagram for Trig::TrigConfBunchCrossingTool:
Collaboration diagram for Trig::TrigConfBunchCrossingTool:

Public Types

enum  BeamType { Beam1 = 0, Beam2 = 1, Crossing = 2 }
 Types of the return values of the bcIntensity function. More...
 
enum  BunchCrossingType {
  Empty = 0, FirstEmpty = 1, MiddleEmpty = 2, Single = 100,
  Front = 200, Middle = 201, Tail = 202, Unpaired = 300
}
 Simplified type for a given bunch crossing. More...
 
enum  BunchDistanceType { NanoSec, BunchCrossings, FilledBunches }
 Enumeration specifying the units in which to expect the bunch distance type. More...
 
enum  BunchFillType {
  CollidingBunch = 0, UnpairedBunch = 1, EmptyBunch = 2, UnpairedBeam1 = 3,
  UnpairedBeam2 = 4
}
 Enumeration specifying what kind of bunch to use in the gap functions. More...
 
typedef unsigned int bcid_type
 Declare the interface that this class provides. More...
 
typedef unsigned int configid_type
 Declare the interface that this class provides. More...
 

Public Member Functions

virtual void print () const =0
 Print the state of the tool. More...
 
virtual void print () const
 Print the state of the tool. More...
 
virtual StatusCode sysInitialize ()
 Function initialising the tool in the correct way in Athena. More...
 
virtual StatusCode initialize ()
 Dummy implementation of the initialisation function. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode 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
 
virtual std::vector< int > configuredBCIDs () const
 Function providing the BCIDs of the configured colliding bunches. More...
 
virtual std::vector< int > configuredUnpairedBCIDsBeam1 () const
 Function providing the BCIDs of the configured unpaired bunches. More...
 
virtual std::vector< int > configuredUnpairedBCIDsBeam2 () const
 Function providing the BCIDs of the configured unpaired bunches. More...
 

Protected Member Functions

virtual StatusCode beginEvent ()
 Function called when a new event is loaded. More...
 
StatusCode loadSingleBunches (const std::vector< int > &bunches, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
 Interpret the configuration for single bunches. More...
 
StatusCode loadBunchTrains (const std::vector< int > &bunches, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
 Interpret the configuration for bunch trains. More...
 
StatusCode loadUnpairedBunches (const std::vector< int > &beam1, const std::vector< int > &beam2, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
 Interpret the configuration for unpaired bunches. More...
 
void printConfig () const
 Function printing the configuration of the tool. 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...
 

Static Protected Attributes

static const std::string BUNCH_CONFIG_INCIDENT_NAME = "BunchConfig"
 Type name for the incident that such tools should emit. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

virtual configid_type configID () const
 Unique identifier for the current configuration. More...
 
virtual std::vector< float > configuredIntensitiesBeam1 () const
 Override the default implementation because this tool doesn't provide this info. More...
 
virtual std::vector< float > configuredIntensitiesBeam2 () const
 Override the default implementation because this tool doesn't provide this info. More...
 
virtual std::vector< float > configuredUnpairedIntensitiesBeam1 () const
 Override the default implementation because this tool doesn't provide this info. More...
 
virtual std::vector< float > configuredUnpairedIntensitiesBeam2 () const
 Override the default implementation because this tool doesn't provide this info. More...
 
StatusCode loadConfig ()
 Make sure that the latest/correct configuration is loaded. More...
 
void printBunchGroups (const TrigConf::IILVL1ConfigSvc *svc) const
 Print the "raw" configuration for debugging. More...
 
int bunchSpacing (const std::vector< int > &bunches) const
 Get the apparent bunch spacing in the current configuration. 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

unsigned int m_bgId
 DB ID of the BunchGroups settings which was loaded last. More...
 
ServiceHandle< TrigConf::ILVL1ConfigSvcm_configSvc
 The config service handle. More...
 
ToolHandle< TrigConf::ITrigConfigToolm_configTool
 The config tool handle. More...
 
MetaStore_t m_inputMetaStore
 Object accessing the input metadata store. More...
 
MetaStore_t m_outputMetaStore
 Object accessing the output metadata store. More...
 
bool m_beginInputFileCalled
 Flag helping to discover when the tool misses the opening of the first input file. More...
 
bool m_useIncidents
 
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
 

Callback functions helping in metadata reading/writing

void setUseIncidents (const bool flag)
 
virtual void handle (const Incident &inc)
 Function receiving incidents from IncidentSvc/TEvent. More...
 
virtual StatusCode beginInputFile ()
 Function called when a new input file is opened. More...
 
virtual StatusCode endInputFile ()
 Function called when the currently open input file got completely processed. More...
 
virtual StatusCode metaDataStop ()
 Function called when the tool should write out its metadata. More...
 

Detailed Description

The trigger config implementation of IBunchCrossingTool.

This implementation should be used primarily to get information about the bunch pattern for data files. It retrieves the bunch pattern configuration using the trigger configuration service. So in principle it can itself get the configuration from a few different places. (Currently TrigConf::LVL1ConfigSvc and TrigConf::DSConfigSvc provide this information.)

It also acts as a bunch crossing configuration provider, implementing the Trig::IBunchCrossingConfProvider interface.

Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Revision
748399
Date
2016-05-19 16:55:47 +0200 (Thu, 19 May 2016)

Definition at line 47 of file TrigConfBunchCrossingTool.h.

Member Typedef Documentation

◆ bcid_type

typedef unsigned int Trig::IBunchCrossingTool::bcid_type
inherited

Declare the interface that this class provides.

Convenience type definition

Definition at line 47 of file IBunchCrossingTool.h.

◆ configid_type

typedef unsigned int Trig::IBunchCrossingConfProvider::configid_type
inherited

Declare the interface that this class provides.

Type for the unique identifier

Definition at line 60 of file IBunchCrossingConfProvider.h.

◆ MetaStore_t

Type of the metadata store object in Athena.

Definition at line 66 of file AsgMetadataTool.h.

◆ MetaStorePtr_t

Type of the metadata store pointer in standalone mode.

Definition at line 68 of file AsgMetadataTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ BeamType

Types of the return values of the bcIntensity function.

The different information sources provide the "bunch intensity" information in quite different ways, and the information can mean different things actually. This enumeration is used to specify what exact type of information the user is looking for.

Enumerator
Beam1 

The returned intensity should be for "beam 1".

Beam2 

The returned intensity should be for "beam 2".

Crossing 

The returned intensity should describe the BC.

Definition at line 118 of file IBunchCrossingTool.h.

118  {
119  Beam1 = 0,
120  Beam2 = 1,
121  Crossing = 2
122  };

◆ BunchCrossingType

Simplified type for a given bunch crossing.

This enumeration can specify what kind of bunch crossing one BCID belongs to. The types could easily be extended later on.

Enumerator
Empty 

An empty bunch far away from filled bunches.

FirstEmpty 

The first empty bunch after a train.

MiddleEmpty 

An empty BCID in the middle of a train.

Single 

This is a filled, single bunch (not in a train)

Front 

The BCID belongs to the first few bunches in a train.

Middle 

The BCID belongs to the middle bunches in a train.

Tail 

The BCID belongs to the last few bunces in a train.

Unpaired 

This is an unpaired bunch (either beam1 or beam2)

Definition at line 145 of file IBunchCrossingTool.h.

145  {
146  Empty = 0,
147  FirstEmpty = 1,
148  MiddleEmpty = 2,
149  Single = 100,
150  Front = 200,
151  Middle = 201,
152  Tail = 202,
153  Unpaired = 300
154  };

◆ BunchDistanceType

Enumeration specifying the units in which to expect the bunch distance type.

To make it clear for the following functions what units to interpret their return values in, it is possible to request their return values in different units.

Enumerator
NanoSec 

Distance in nanoseconds.

BunchCrossings 

Distance in units of 25 nanoseconds.

FilledBunches 

Distance in units of filled bunches (depends on filling scheme)

Definition at line 174 of file IBunchCrossingTool.h.

174  {
175  NanoSec,
179  };

◆ BunchFillType

Enumeration specifying what kind of bunch to use in the gap functions.

The following functions can be used to calculate the gap before and after a specific BCID to some other bunch type. The gap can actually be wrt. two different types of bunches. The user may be interested between the space of two filled bunches, the space between an unpaired bunch and the previous filled bunch, the space between two unpaired bunches, or the space between a filled bunch and the previous unpaired bunch.

The empty type is just put here for completeness. Maybe once we'll be using 25 ns spacing in the bunch trains, this will be a useful parameter as well.

This enumeration helps in answeing all of these questions.

Enumerator
CollidingBunch 

The gap should be calculated wrt. the closest colling bunch.

UnpairedBunch 

The gap should be calculated wrt. the closest unpaired bunch.

EmptyBunch 

The gap should be calculated wrt. the closest empty bunch.

UnpairedBeam1 

The gap should be calculated wrt.

the closest unpaired bunch from beam 1

UnpairedBeam2 

The gap should be calculated wrt.

the closest unpaired bunch from beam 2

Definition at line 274 of file IBunchCrossingTool.h.

274  {
276  CollidingBunch = 0,
278  UnpairedBunch = 1,
280  EmptyBunch = 2,
283  UnpairedBeam1 = 3,
286  UnpairedBeam2 = 4
287  };

Member Function Documentation

◆ bcIntensity()

float Trig::BunchCrossingToolBase::bcIntensity ( bcid_type  bcid,
BeamType  type = Crossing 
) const
virtualinherited

Function returning the "intensity" of a given bunch crossing.

Implements Trig::IBunchCrossingTool.

Definition at line 106 of file BunchCrossingToolBase.cxx.

107  {
108 
109  // Check if this is a colliding bunch:
110  std::set< BunchCrossing >::const_iterator itr;
111  if( ( itr = m_filledBunches.find( bcid ) ) != m_filledBunches.end() ) {
112  switch( type ) {
113  case Crossing:
114  if( itr->intensityBeam2() > 0.001 ) {
115  ATH_MSG_WARNING( "Crossing intensity not available, ask for "
116  << "separate beam intensities instead" );
117  return 0.0;
118  } else {
119  return itr->intensityBeam1();
120  }
121  case Beam1:
122  if( std::abs( itr->intensityBeam2() ) < 0.001 ) {
123  ATH_MSG_WARNING( "Separate beam intensities not available, ask "
124  << "for the crossing intensity instead" );
125  return 0.0;
126  } else {
127  return itr->intensityBeam1();
128  }
129  break;
130  case Beam2:
131  return itr->intensityBeam2();
132  break;
133  default:
134  ATH_MSG_ERROR( "Unknown intensity type requested (" << type
135  << ")" );
136  return -1.0;
137  }
138  }
139 
140  // Check if this is an unpaired bunch:
141  if( ( itr = m_unpairedBunches.find( bcid ) ) !=
142  m_unpairedBunches.end() ) {
143  switch( type ) {
144  case Beam1:
145  return itr->intensityBeam1();
146  break;
147  case Beam2:
148  return itr->intensityBeam2();
149  break;
150  case Crossing:
151  ATH_MSG_WARNING( "Crossing intensity requested for unpaired bunch ("
152  << "bcid=" << bcid << ")" );
153  return 0.0;
154  default:
155  ATH_MSG_ERROR( "Unknown intensity type requested (" << type
156  << ")" );
157  return -1.0;
158  }
159  }
160 
161  // If neither, then its intensity is 0.0 by definition:
162  return 0.0;
163  }

◆ bcType()

IBunchCrossingTool::BunchCrossingType Trig::BunchCrossingToolBase::bcType ( bcid_type  bcid) const
virtualinherited

Get the type of the specific bunch crossing.

Implements Trig::IBunchCrossingTool.

Definition at line 166 of file BunchCrossingToolBase.cxx.

166  {
167 
168  // First the obvious check:
169  if( ! isFilled( bcid ) ) {
170  // Check if it's an unpaired bunch:
171  if( isUnpaired( bcid ) ) {
172  return Unpaired;
173  }
174  // If the previous bunch crossing is the tail of a bunch train:
175  if( ! distanceFromTail( bcid - 1, BunchCrossings ) ) {
176  return FirstEmpty;
177  }
178  // Check if it's in the middle of a bunch train:
179  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
180  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
181  for( ; itr != end; ++itr ) {
182  if( itr->isInside( bcid ) ) {
183  return MiddleEmpty;
184  }
185  }
186  // If none of the above are true, it has to be a "simple" empty bunch:
187  return Empty;
188  }
189 
190  // Now we know that the bunch has to be a filled one...
191 
192  // If it's not in a train, it has to be a single filled bunch:
193  if( ! isInTrain( bcid ) ) return Single;
194 
195  // Let's check if it is close to the front of a bunch train:
197  if( ( distance >= 0 ) && ( distance <= m_frontLength ) ) {
198  return Front;
199  }
200  // Now let's check if it's close to the tail of a bunch train:
202  if( ( distance >= 0 ) && ( distance <= m_tailLength ) ) {
203  return Tail;
204  }
205 
206  // If none of the above are true, it has to be in the middle of a train:
207  return Middle;
208  }

◆ beginEvent()

StatusCode Trig::TrigConfBunchCrossingTool::beginEvent ( )
protectedvirtual

Function called when a new event is loaded.

Reimplemented from asg::AsgMetadataTool.

Definition at line 92 of file TrigConfBunchCrossingTool.cxx.

92  {
93 
94  // Simply call the function doing the heavy lifting:
95  ATH_CHECK( loadConfig() );
96 
97  // Return gracefully:
98  return StatusCode::SUCCESS;
99  }

◆ beginInputFile()

StatusCode asg::AsgMetadataTool::beginInputFile ( )
protectedvirtualinherited

Function called when a new input file is opened.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in AsgElectronEfficiencyCorrectionTool, TrigConf::xAODConfigTool, PMGTools::PMGTruthWeightTool, BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, Trig::TrigDecisionTool, xAODMaker::TriggerMenuMetaDataTool, xAODMaker::TruthMetaDataTool, Trig::xAODBunchCrossingTool, TauAnalysisTools::TauEfficiencyCorrectionsTool, and TauAnalysisTools::TauSmearingTool.

Definition at line 180 of file AsgMetadataTool.cxx.

180  {
181 
182  // Return gracefully:
183  return StatusCode::SUCCESS;
184  }

◆ bunchesAfter()

std::vector< bool > Trig::BunchCrossingToolBase::bunchesAfter ( bcid_type  bcid = 0,
int  bunches = 10 
) const
virtualinherited

Function returning whether the following bunches were filled, and how.

Implements Trig::IBunchCrossingTool.

Definition at line 734 of file BunchCrossingToolBase.cxx.

735  {
736 
737  // The only thing we have to be careful about is the bunches near the
738  // "turnover" region of the BCIDs. That's why I use the BunchCrossing
739  // class here:
740  std::vector< bool > result;
741  for( int i = 0; i < bunches; ++i ) {
742  result.push_back( isFilled( BunchCrossing( bcid ) +
743  BunchCrossing( i ) ) );
744  }
745 
746  return result;
747  }

◆ bunchesInFront()

std::vector< bool > Trig::BunchCrossingToolBase::bunchesInFront ( bcid_type  bcid,
int  bunches = 10 
) const
virtualinherited

Function returning whether the previous bunches were filled, and how.

Implements Trig::IBunchCrossingTool.

Definition at line 718 of file BunchCrossingToolBase.cxx.

719  {
720 
721  // The only thing we have to be careful about is the bunches near the
722  // "turnover" region of the BCIDs. That's why I use the BunchCrossing
723  // class here:
724  std::vector< bool > result;
725  for( int i = 0; i < bunches; ++i ) {
726  result.push_back( isFilled( BunchCrossing( bcid ) -
727  BunchCrossing( i ) ) );
728  }
729 
730  return result;
731  }

◆ bunchIntAfter()

std::vector< float > Trig::BunchCrossingToolBase::bunchIntAfter ( bcid_type  bcid,
int  bunches = 10,
BeamType  type = Crossing 
) const
virtualinherited

Function returning the intensities of the bunch crossings after the reference.

Implements Trig::IBunchCrossingTool.

Definition at line 781 of file BunchCrossingToolBase.cxx.

783  {
784 
785  std::vector< float > result;
786  for( int i = 0; i < bunches; ++i ) {
787  std::set< BunchCrossing >::const_iterator itr =
788  m_filledBunches.find( BunchCrossing( bcid ) + BunchCrossing( i ) );
789  if( itr != m_filledBunches.end() ) {
790  switch( type ) {
791  case Beam1:
792  case Crossing:
793  result.push_back( itr->intensityBeam1() );
794  break;
795  case Beam2:
796  result.push_back( itr->intensityBeam2() );
797  break;
798  default:
799  ATH_MSG_ERROR( "Unknown intensity type requested ("
800  << type << ")" );
801  return result;
802  }
803  } else {
804  result.push_back( 0.0 );
805  }
806  }
807 
808  return result;
809  }

◆ bunchIntInFront()

std::vector< float > Trig::BunchCrossingToolBase::bunchIntInFront ( bcid_type  bcid,
int  bunches = 10,
BeamType  type = Crossing 
) const
virtualinherited

Function returning the intensities of the bunch crossings before the reference.

Implements Trig::IBunchCrossingTool.

Definition at line 750 of file BunchCrossingToolBase.cxx.

752  {
753 
754  std::vector< float > result;
755  for( int i = 0; i < bunches; ++i ) {
756  std::set< BunchCrossing >::const_iterator itr =
757  m_filledBunches.find( BunchCrossing( bcid ) - BunchCrossing( i ) );
758  if( itr != m_filledBunches.end() ) {
759  switch( type ) {
760  case Beam1:
761  case Crossing:
762  result.push_back( itr->intensityBeam1() );
763  break;
764  case Beam2:
765  result.push_back( itr->intensityBeam2() );
766  break;
767  default:
768  ATH_MSG_ERROR( "Unknown intensity type requested ("
769  << type << ")" );
770  return result;
771  }
772  } else {
773  result.push_back( 0.0 );
774  }
775  }
776 
777  return result;
778  }

◆ bunchSpacing()

int Trig::BunchCrossingToolBase::bunchSpacing ( const std::vector< int > &  bunches) const
privateinherited

Get the apparent bunch spacing in the current configuration.

This function tries to figure out what's the right bunch spacing for the current configuration, before the code would try to properly interpret the configuration.

This allows us to set a "MaxBunchSpacing" property of a relatively large number, but still be able to interpret configurations with very small gaps between bunch trains. (Like the 8b4e 2017 configurations.)

Parameters
bunchesThe filled bunches in the current configuration
Returns
The apparent bunch spacing of the configuration in bunch crossings

Definition at line 1225 of file BunchCrossingToolBase.cxx.

1226  {
1227 
1228  // The maximum BC spacing to start from.
1229  const int maxSpacing = m_maxBunchSpacing / BunchCrossing::BUNCH_SPACING;
1230 
1231  // Iterate downwards from the maximum spacing, searching for the minimum
1232  // spacing with which bunches exist.
1233  int result = maxSpacing;
1234  for( ; result > 0; --result ) {
1235 
1236  // Test how many bunches have neighbors inside of the current window.
1237  const int nbunches =
1238  std::count_if( bunches.begin(), bunches.end(),
1239  count_bunch_neighbors( bunches, result ) );
1240  ATH_MSG_VERBOSE( "Number of bunches with " << result
1241  << " BC neighbors: " << nbunches );
1242 
1243  // If none of them do, then we're finished.
1244  if( ! nbunches ) {
1245  // If we're not at the max spacing anymore, then it means that in
1246  // the previous step there were still bunches with neighbors in this
1247  // window. That's the spacing we need then.
1248  //
1249  // But if we're still at the maximum spacing, then let's just keep
1250  // that as the final answer.
1251  if( result != maxSpacing ) {
1252  ++result;
1253  }
1254  break;
1255  }
1256  }
1257  // If we went down to 0, then the right answer is 1. This is just how this
1258  // algorithm works...
1259  if( result == 0 ) {
1260  result = 1;
1261  }
1262  ATH_MSG_DEBUG( "Bunch spacing: " << result << " BCs" );
1263 
1264  // Return the smallest spacing found:
1265  return result;
1266  }

◆ bunchTrainSpacing()

int Trig::BunchCrossingToolBase::bunchTrainSpacing ( BunchDistanceType  type = NanoSec) const
virtualinherited

Get the bunch spacing in the trains.

Implements Trig::IBunchCrossingTool.

Definition at line 827 of file BunchCrossingToolBase.cxx.

827  {
828 
829  // Check if there are bunch trains in the current configurations:
830  if( m_bunchTrains.size() ) {
831  switch( type ) {
832  case NanoSec:
833  return m_bunchTrains.begin()->spacing();
834  break;
835  case BunchCrossings:
836  return ( m_bunchTrains.begin()->spacing() /
838  break;
839  case FilledBunches:
840  ATH_MSG_ERROR( "Function should not be called with argument: "
841  "FilledBunches" );
842  return -1;
843  break;
844  default:
845  ATH_MSG_ERROR( "Function called with unknown argument: " << type );
846  return -1;
847  }
848  } else {
849  // Return -1 if there are no bunch trains in the configuration:
850  return -1;
851  }
852 
853  ATH_MSG_FATAL( "The code should never reach this line. Check the code!" );
854  return -1;
855  }

◆ configID()

IBunchCrossingConfProvider::configid_type Trig::TrigConfBunchCrossingTool::configID ( ) const
privatevirtual

Unique identifier for the current configuration.

This specialization of the function just returns the BGKey of the currently loaded configuration.

This is the simplest implementation for this function...

Implements Trig::IBunchCrossingConfProvider.

Definition at line 106 of file TrigConfBunchCrossingTool.cxx.

106  {
107 
108  return static_cast< configid_type >( m_bgId );
109  }

◆ configuredBCIDs()

std::vector< int > Trig::BunchCrossingConfProviderBase::configuredBCIDs ( ) const
virtualinherited

Function providing the BCIDs of the configured colliding bunches.

The implementation just loops over all the possible BCIDs and puts the IDs of the ones which are reported to be filled, into the output vector.

See also
BunchCrossingConfProviderBase::configuredIntensitiesBeam1()
BunchCrossingConfProviderBase::configuredIntensitiesBeam2()

Implements Trig::IBunchCrossingConfProvider.

Definition at line 28 of file BunchCrossingConfProviderBase.cxx.

28  {
29 
30  std::vector< int > bunches;
31  for( int i = 0; i < BunchCrossing::MAX_BCID; ++i ) {
32  if( isFilled( i ) ) {
33  bunches.push_back( i );
34  }
35  }
36 
37  return bunches;
38  }

◆ configuredIntensitiesBeam1()

std::vector< float > Trig::TrigConfBunchCrossingTool::configuredIntensitiesBeam1 ( ) const
privatevirtual

Override the default implementation because this tool doesn't provide this info.

This function will always return an empty vector, because this tool doesn't provide this sort of information.

While saving the default 1.0 values for all the filled bunches would have the same result right now, the tools may handle the absence of the intensity information in different ways in the future.

Returns
An empty vector

Reimplemented from Trig::BunchCrossingConfProviderBase.

Definition at line 121 of file TrigConfBunchCrossingTool.cxx.

121  {
122 
123  return std::vector< float >();
124  }

◆ configuredIntensitiesBeam2()

std::vector< float > Trig::TrigConfBunchCrossingTool::configuredIntensitiesBeam2 ( ) const
privatevirtual

Override the default implementation because this tool doesn't provide this info.

This function will always return an empty vector, because this tool doesn't provide this sort of information.

While saving the default 1.0 values for all the filled bunches would have the same result right now, the tools may handle the absence of the intensity information in different ways in the future.

Returns
An empty vector

Reimplemented from Trig::BunchCrossingConfProviderBase.

Definition at line 136 of file TrigConfBunchCrossingTool.cxx.

136  {
137 
138  return std::vector< float >();
139  }

◆ configuredUnpairedBCIDsBeam1()

std::vector< int > Trig::BunchCrossingConfProviderBase::configuredUnpairedBCIDsBeam1 ( ) const
virtualinherited

Function providing the BCIDs of the configured unpaired bunches.

The implementation just loops over all the possible BCIDs and puts the IDs of the ones which are reported to be unpaired, into the output vector.

See also
BunchCrossingConfProviderBase::configuredUnpairedIntensitiesBeam1()

Implements Trig::IBunchCrossingConfProvider.

Definition at line 88 of file BunchCrossingConfProviderBase.cxx.

88  {
89 
90  std::vector< int > bunches;
91  for( int i = 0; i < BunchCrossing::MAX_BCID; ++i ) {
92  if( isUnpaired( i ) && isBeam1( i ) ) {
93  bunches.push_back( i );
94  }
95  }
96 
97  return bunches;
98  }

◆ configuredUnpairedBCIDsBeam2()

std::vector< int > Trig::BunchCrossingConfProviderBase::configuredUnpairedBCIDsBeam2 ( ) const
virtualinherited

Function providing the BCIDs of the configured unpaired bunches.

The implementation just loops over all the possible BCIDs and puts the IDs of the ones which are reported to be unpaired, into the output vector.

See also
BunchCrossingConfProviderBase::configuredUnpairedIntensitiesBeam2()

Implements Trig::IBunchCrossingConfProvider.

Definition at line 108 of file BunchCrossingConfProviderBase.cxx.

108  {
109 
110  std::vector< int > bunches;
111  for( int i = 0; i < BunchCrossing::MAX_BCID; ++i ) {
112  if( isUnpaired( i ) && isBeam2( i ) ) {
113  bunches.push_back( i );
114  }
115  }
116 
117  return bunches;
118  }

◆ configuredUnpairedIntensitiesBeam1()

std::vector< float > Trig::TrigConfBunchCrossingTool::configuredUnpairedIntensitiesBeam1 ( ) const
privatevirtual

Override the default implementation because this tool doesn't provide this info.

This function will always return an empty vector, because this tool doesn't provide this sort of information.

While saving the default 1.0 values for all the unpaired bunches would have the same result right now, the tools may handle the absence of the intensity information in different ways in the future.

Returns
An empty vector

Reimplemented from Trig::BunchCrossingConfProviderBase.

Definition at line 151 of file TrigConfBunchCrossingTool.cxx.

151  {
152 
153  return std::vector< float >();
154  }

◆ configuredUnpairedIntensitiesBeam2()

std::vector< float > Trig::TrigConfBunchCrossingTool::configuredUnpairedIntensitiesBeam2 ( ) const
privatevirtual

Override the default implementation because this tool doesn't provide this info.

This function will always return an empty vector, because this tool doesn't provide this sort of information.

While saving the default 1.0 values for all the unpaired bunches would have the same result right now, the tools may handle the absence of the intensity information in different ways in the future.

Returns
An empty vector

Reimplemented from Trig::BunchCrossingConfProviderBase.

Definition at line 166 of file TrigConfBunchCrossingTool.cxx.

166  {
167 
168  return std::vector< float >();
169  }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ distanceFromFront()

int Trig::BunchCrossingToolBase::distanceFromFront ( bcid_type  bcid,
BunchDistanceType  type = NanoSec 
) const
virtualinherited

The distance of the specific bunch crossing from the front of the train.

This is one of the most tricky functions of this class.

When the user wants to ask the distance of a bunch crossing from the front of its train in units of nano seconds or bunch crossings, the main part of the logic is propagated to the algebra defined for the BunchCrossing class.

But when the user wants to know the distance in terms of filled bunches, the code has to treat 3 different bunch train configurations:

  • First is when the bunch train doesn't spread across the "BCID turnover". The code in this case just has to see how many steps it is from bunchtrain->begin().
  • If the bunch train spreads across the "BCID turnover", and the bcid is after BCID==0, the code has to count the filled bunches from bunchtrain->train_front() to bunchtrain->end(), plus the filled bunches from bunchtrain->begin() to the bcid in question.
  • If the bunch train spreads across the "BCID turnover", and the bcid is "before" BCID==0, the code has to count the filled bunches from bunchtrain->train_front() to the bcid in question.
Parameters
bcidThe bcid that should be checked
typeThe type of the requested return value
Returns
The distance of the bcid in question from the front of its bunch train

Implements Trig::IBunchCrossingTool.

Definition at line 239 of file BunchCrossingToolBase.cxx.

240  {
241 
242  // Look for this BCID in the list of bunch trains:
243  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
244  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
245  for( ; itr != end; ++itr ) {
246  BunchTrain::const_iterator element;
247  if( ( element = itr->find( bcid ) ) != itr->end() ) {
248  switch( type ) {
249 
250  case NanoSec:
251  return BunchCrossing::BUNCH_SPACING * ( BunchCrossing( bcid ) -
252  *( itr->train_front() ) );
253  break;
254  case BunchCrossings:
255  return ( BunchCrossing( bcid ) - *( itr->train_front() ) );
256  break;
257  case FilledBunches:
258  if( *( itr->train_front() ) > *( itr->train_back() ) ) {
259  if( BunchCrossing( bcid ) <= *( itr->train_back() ) ) {
260  return ( std::count_if( itr->begin(), element,
261  std::bind( std::not_equal_to< BunchCrossing >(),
262  *element, std::placeholders::_1 ) ) +
263  std::count_if( itr->train_front(), itr->end(),
264  std::bind( std::not_equal_to< BunchCrossing >(),
265  *element, std::placeholders::_1 ) ) );
266  } else {
267  return std::count_if( itr->train_front(), element,
268  std::bind( std::not_equal_to< BunchCrossing >(),
269  *element, std::placeholders::_1 ) );
270  }
271  } else {
272  return std::count_if( itr->begin(), element,
273  std::bind( std::not_equal_to< BunchCrossing >(),
274  *element, std::placeholders::_1 ) );
275  }
276  break;
277  default:
278  ATH_MSG_ERROR( "BunchDistanceType not understood!" );
279  return -1;
280  }
281  }
282  }
283 
284  // If the bunch crossing is not part of a train:
285  return -1;
286  }

◆ distanceFromTail()

int Trig::BunchCrossingToolBase::distanceFromTail ( bcid_type  bcid,
BunchDistanceType  type = NanoSec 
) const
virtualinherited

The distance of the specific bunch crossing from the tail of the train.

This is one of the most tricky functions of this class.

When the user wants to ask the distance of a bunch crossing from the tail of its train in units of nano seconds or bunch crossings, the main part of the logic is propagated to the algebra defined for the BunchCrossing class.

But when the user wants to know the distance in terms of filled bunches, the code has to treat 3 different bunch train configurations:

  • First is when the bunch train doesn't spread across the "BCID turnover". The code in this case just has to see how many steps it is from bunchtrain->end().
  • If the bunch train spreads across the "BCID turnover", and the bcid is "before" BCID==0, the code has to count the filled bunches from the bcid in question to bunchtrain->end(), plus the filled bunches from bunchtrain->begin() to bunchtrain->train_back().
  • If the bunch train spreads across the "BCID turnover", and the bcid is after BCID==0, the code has to count the filled bunches from the bcid in question to bunchtrain->train_back().
Parameters
bcidThe bcid that should be checked
typeThe type of the requested return value
Returns
The distance of the bcid in question from the tail of its bunch train

Implements Trig::IBunchCrossingTool.

Definition at line 316 of file BunchCrossingToolBase.cxx.

317  {
318 
319  // Look for this BCID in the list of bunch trains:
320  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
321  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
322  for( ; itr != end; ++itr ) {
323  BunchTrain::const_iterator element;
324  if( ( element = itr->find( bcid ) ) != itr->end() ) {
325  switch( type ) {
326 
327  case NanoSec:
328  return BunchCrossing::BUNCH_SPACING * ( *( itr->train_back() ) -
329  BunchCrossing( bcid ) );
330  break;
331  case BunchCrossings:
332  return ( *( itr->train_back() ) - BunchCrossing( bcid ) );
333  break;
334  case FilledBunches:
335  if( *( itr->train_front() ) > *( itr->train_back() ) ) {
336  if( BunchCrossing( bcid ) > *( itr->train_back() ) ) {
337  return ( std::count_if( element, itr->end(),
338  std::bind( std::not_equal_to< BunchCrossing >(),
339  *element, std::placeholders::_1 ) ) +
340  std::count_if( itr->begin(), ++( itr->train_back() ),
341  std::bind( std::not_equal_to< BunchCrossing >(),
342  *element, std::placeholders::_1 ) ) );
343  } else {
344  return std::count_if( element, ++( itr->train_back() ),
345  std::bind( std::not_equal_to< BunchCrossing >(),
346  *element, std::placeholders::_1 ) );
347  }
348  } else {
349  return std::count_if( element, itr->end(),
350  std::bind( std::not_equal_to< BunchCrossing >(),
351  *element, std::placeholders::_1 ) );
352  }
353  break;
354  default:
355  ATH_MSG_ERROR( "BunchDistanceType not understood!" );
356  return -1;
357  }
358  }
359  }
360 
361  // If the bunch crossing is not part of a train:
362  return -1;
363  }

◆ endInputFile()

StatusCode asg::AsgMetadataTool::endInputFile ( )
protectedvirtualinherited

Function called when the currently open input file got completely processed.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in BookkeeperTool, HFORSelectionTool, xAODMaker::FileMetaDataTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 188 of file AsgMetadataTool.cxx.

188  {
189 
190  // Return gracefully:
191  return StatusCode::SUCCESS;
192  }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ gapAfterBunch()

int Trig::BunchCrossingToolBase::gapAfterBunch ( bcid_type  bcid,
BunchDistanceType  dtype = NanoSec,
BunchFillType  ftype = CollidingBunch 
) const
virtualinherited

Gap after a particular bunch.

The function creates a smart BunchCrossing out of the BCID provided, then it goes looking for the next bunch crossing of the specified type.

Finally it just calculates the distance between the two bunch crossings in the requested units. It can return the size of the gap either in nanoseconds or in BCIDs (25 ns steps).

Parameters
bcidThe bcid that should be investigated
dtypeThe type of the requested return value
ftypeThe type of the previous bunch to consider
Returns
The gap after the specified bcid

Implements Trig::IBunchCrossingTool.

Definition at line 608 of file BunchCrossingToolBase.cxx.

610  {
611 
612  // Construct this "smart" BCID:
613  const BunchCrossing bunch( bcid );
614 
615  // Search for the first next bunch that fulfills the requirement:
616  BunchCrossing next_bunch( bunch );
617  ++next_bunch;
618  int loop_counter = 0;
619  switch( ftype ) {
620 
621  case CollidingBunch:
622  // There should always be filled bunches in the configuration, but
623  // let's make sure that we don't get into an endless loop:
624  while( ( ! isFilled( next_bunch ) ) &&
625  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
626  ++next_bunch;
627  ++loop_counter;
628  }
629  if( loop_counter == BunchCrossing::MAX_BCID ) {
630  ATH_MSG_ERROR( "Failed to calculate gap after BCID "
631  << bcid << " to a filled bunch! This shouldn't have "
632  << "happened!" );
633  return -1;
634  }
635  break;
636  case UnpairedBunch:
637  // There are no unpaired bunches in every configuration, so make sure
638  // we don't get into an endless loop:
639  while( ( ! isUnpaired( next_bunch ) ) &&
640  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
641  ++next_bunch;
642  ++loop_counter;
643  }
644  // Return "-1" if there are no unpaired bunches in the configuration:
645  if( loop_counter == BunchCrossing::MAX_BCID ) {
646  return -1;
647  }
648  break;
649  case UnpairedBeam1:
650  // There are no unpaired bunches from beam 1 in every configuration, so
651  // make sure we don't get into an endless loop:
652  while( ( ! ( isUnpaired( next_bunch ) && isBeam1( next_bunch ) ) ) &&
653  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
654  ++next_bunch;
655  ++loop_counter;
656  }
657  // Return "-1" if there are no unpaired bunches from beam 1 in the
658  // configuration:
659  if( loop_counter == BunchCrossing::MAX_BCID ) {
660  return -1;
661  }
662  break;
663  case UnpairedBeam2:
664  // There are no unpaired bunches from beam 2 in every configuration, so
665  // make sure we don't get into an endless loop:
666  while( ( ! ( isUnpaired( next_bunch ) && isBeam2( next_bunch ) ) ) &&
667  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
668  ++next_bunch;
669  ++loop_counter;
670  }
671  // Return "-1" if there are no unpaired bunches from beam 2 in the
672  // configuration:
673  if( loop_counter == BunchCrossing::MAX_BCID ) {
674  return -1;
675  }
676  break;
677  case EmptyBunch:
678  // There should always be empty bunches in the configuration, but let's
679  // make sure that we don't get into an endless loop:
680  while( ( isFilled( next_bunch ) || isUnpaired( next_bunch ) ) &&
681  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
682  ++next_bunch;
683  ++loop_counter;
684  }
685  if( loop_counter == BunchCrossing::MAX_BCID ) {
686  ATH_MSG_ERROR( "Failed to calculate gap after BCID "
687  << bcid << " to an empty bunch! This shouldn't have "
688  << "happened!" );
689  return -1;
690  }
691  break;
692  default:
693  ATH_MSG_ERROR( "Unknown bunch fill type specified: "
694  << ftype );
695  return -1;
696  }
697 
698  // Now return the results:
699  switch( dtype ) {
700 
701  case NanoSec:
702  return BunchCrossing::BUNCH_SPACING * bunch.gapTo( next_bunch );
703  break;
704  case BunchCrossings:
705  return bunch.gapTo( next_bunch );
706  break;
707  default:
708  ATH_MSG_ERROR( "You can only use NanoSec or BunchCrossings for type "
709  "for gapBeforeBunch" );
710  return -1;
711  }
712 
713  // This should actually never be reached:
714  return -1;
715  }

◆ gapAfterTrain()

int Trig::BunchCrossingToolBase::gapAfterTrain ( bcid_type  bcid,
BunchDistanceType  type = NanoSec 
) const
virtualinherited

Gap after the train this BCID is in.

The function first finds the train that the specified BCID is in.

Then it calculates the size of the gap after this train. It can return the size of the gap either in nanoseconds or in BCIDs (25 ns steps).

Parameters
bcidThe bcid whose train should be investigated
typeThe type of the requested return value
Returns
The gap after the train of the specified bcid

Implements Trig::IBunchCrossingTool.

Definition at line 429 of file BunchCrossingToolBase.cxx.

430  {
431 
432  // Find this BCID in the list of bunch trains:
433  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
434  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
435  std::set< BunchTrain >::const_iterator train = m_bunchTrains.end();
436  for( ; itr != end; ++itr ) {
437  if( itr->find( bcid ) != itr->end() ) {
438  train = itr;
439  break;
440  }
441  }
442 
443  // If we didn't find this BCID in a train, let's return right away:
444  if( train == end ) {
445  return -1;
446  }
447 
448  // Search for the first filled bunch before the front of this train:
449  BunchCrossing train_front = *( train->train_back() );
450  ++train_front;
451  while( ! isFilled( train_front ) ) {
452  ++train_front;
453  }
454 
455  // Now return the results:
456  switch( type ) {
457 
458  case NanoSec:
460  train_front.distance( *( train->train_back() ) );
461  break;
462  case BunchCrossings:
463  return train_front.distance( *( train->train_back() ) );
464  break;
465  default:
466  ATH_MSG_ERROR( "You can only use NanoSec or BunchCrossings for type "
467  "for gapAfterTrain" );
468  return -1;
469  }
470 
471  // This should actually never be reached:
472  return -1;
473  }

◆ gapBeforeBunch()

int Trig::BunchCrossingToolBase::gapBeforeBunch ( bcid_type  bcid,
BunchDistanceType  dtype = NanoSec,
BunchFillType  ftype = CollidingBunch 
) const
virtualinherited

Gap before a particular bunch.

The function creates a smart BunchCrossing out of the BCID provided, then it goes looking for the previous bunch crossing of the specified type.

Finally it just calculates the distance between the two bunch crossings in the requested units. It can return the size of the gap either in nanoseconds or in BCIDs (25 ns steps).

Parameters
bcidThe bcid that should be investigated
dtypeThe type of the requested return value
ftypeThe type of the previous bunch to consider
Returns
The gap before the specified bcid

Implements Trig::IBunchCrossingTool.

Definition at line 487 of file BunchCrossingToolBase.cxx.

489  {
490 
491  // Construct this "smart" BCID:
492  const BunchCrossing bunch( bcid );
493 
494  // Search for the first previous bunch that fulfills the requirement:
495  BunchCrossing prev_bunch( bunch );
496  --prev_bunch;
497  int loop_counter = 0;
498  switch( ftype ) {
499 
500  case CollidingBunch:
501  // There should always be filled bunches in the configuration, but
502  // let's make sure that we don't get into an endless loop:
503  while( ( ! isFilled( prev_bunch ) ) &&
504  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
505  --prev_bunch;
506  ++loop_counter;
507  }
508  if( loop_counter == BunchCrossing::MAX_BCID ) {
509  ATH_MSG_ERROR( "Failed to calculate gap before BCID "
510  << bcid << " to a filled bunch! This shouldn't have "
511  << "happened!" );
512  return -1;
513  }
514  break;
515  case UnpairedBunch:
516  // There are no unpaired bunches in every configuration, so make sure
517  // we don't get into an endless loop:
518  while( ( ! isUnpaired( prev_bunch ) ) &&
519  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
520  --prev_bunch;
521  ++loop_counter;
522  }
523  // Return "-1" if there are no unpaired bunches in the configuration:
524  if( loop_counter == BunchCrossing::MAX_BCID ) {
525  return -1;
526  }
527  break;
528  case UnpairedBeam1:
529  // There are no unpaired bunches from beam 1 in every configuration, so
530  // make sure we don't get into an endless loop:
531  while( ( ! ( isUnpaired( prev_bunch ) && isBeam1( prev_bunch ) ) ) &&
532  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
533  --prev_bunch;
534  ++loop_counter;
535  }
536  // Return "-1" if there are no unpaired bunches from beam 1 in the
537  // configuration:
538  if( loop_counter == BunchCrossing::MAX_BCID ) {
539  return -1;
540  }
541  break;
542  case UnpairedBeam2:
543  // There are no unpaired bunches from beam 2 in every configuration, so
544  // make sure we don't get into an endless loop:
545  while( ( ! ( isUnpaired( prev_bunch ) && isBeam2( prev_bunch ) ) ) &&
546  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
547  --prev_bunch;
548  ++loop_counter;
549  }
550  // Return "-1" if there are no unpaired bunches from beam 2 in the
551  // configuration:
552  if( loop_counter == BunchCrossing::MAX_BCID ) {
553  return -1;
554  }
555  break;
556  case EmptyBunch:
557  // There should always be empty bunches in the configuration, but let's
558  // make sure that we don't get into an endless loop:
559  while( ( isFilled( prev_bunch ) || isUnpaired( prev_bunch ) ) &&
560  ( loop_counter < BunchCrossing::MAX_BCID ) ) {
561  --prev_bunch;
562  ++loop_counter;
563  }
564  if( loop_counter == BunchCrossing::MAX_BCID ) {
565  ATH_MSG_ERROR( "Failed to calculate gap before BCID "
566  << bcid << " to an empty bunch! This shouldn't have "
567  << "happened!" );
568  return -1;
569  }
570  break;
571  default:
572  ATH_MSG_ERROR( "Unknown bunch fill type specified: "
573  << ftype );
574  return -1;
575  }
576 
577  // Now return the results:
578  switch( dtype ) {
579 
580  case NanoSec:
581  return BunchCrossing::BUNCH_SPACING * bunch.gapFrom( prev_bunch );
582  break;
583  case BunchCrossings:
584  return bunch.gapFrom( prev_bunch );
585  break;
586  default:
587  ATH_MSG_ERROR( "You can only use NanoSec or BunchCrossings for type "
588  "for gapBeforeBunch" );
589  return -1;
590  }
591 
592  // This should actually never be reached:
593  return -1;
594  }

◆ gapBeforeTrain()

int Trig::BunchCrossingToolBase::gapBeforeTrain ( bcid_type  bcid,
BunchDistanceType  type = NanoSec 
) const
virtualinherited

Gap before the train this BCID is in.

The function first finds the train that the specified BCID is in.

Then it calculates the size of the gap before this train. It can return the size of the gap either in nanoseconds or in BCIDs (25 ns steps).

Parameters
bcidThe bcid whose train should be investigated
typeThe type of the requested return value
Returns
The gap before the train of the specified bcid

Implements Trig::IBunchCrossingTool.

Definition at line 374 of file BunchCrossingToolBase.cxx.

375  {
376 
377  // Find this BCID in the list of bunch trains:
378  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
379  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
380  std::set< BunchTrain >::const_iterator train = m_bunchTrains.end();
381  for( ; itr != end; ++itr ) {
382  if( itr->find( bcid ) != itr->end() ) {
383  train = itr;
384  break;
385  }
386  }
387 
388  // If we didn't find this BCID in a train, let's return right away:
389  if( train == end ) {
390  return -1;
391  }
392 
393  // Search for the first filled bunch before the front of this train:
394  BunchCrossing train_tail = *( train->train_front() );
395  --train_tail;
396  while( ! isFilled( train_tail ) ) {
397  --train_tail;
398  }
399 
400  // Now return the results:
401  switch( type ) {
402 
403  case NanoSec:
405  train->train_front()->distance( train_tail );
406  break;
407  case BunchCrossings:
408  return train->train_front()->distance( train_tail );
409  break;
410  default:
411  ATH_MSG_ERROR( "You can only use NanoSec or BunchCrossings for type "
412  "for gapBeforeTrain" );
413  return -1;
414  }
415 
416  // This should actually never be reached:
417  return -1;
418  }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ handle()

void asg::AsgMetadataTool::handle ( const Incident &  inc)
protectedvirtualinherited

Function receiving incidents from IncidentSvc/TEvent.

Reimplemented in Trig::TrigDecisionTool.

Definition at line 130 of file AsgMetadataTool.cxx.

130  {
131 
132  // Tell the user what's happening:
133  ATH_MSG_VERBOSE( "Callback received with incident: " << inc.type() );
134 
135  // Call the appropriate member function:
136  if( inc.type() == IncidentType::BeginInputFile ) {
137  m_beginInputFileCalled = true;
138  if( beginInputFile().isFailure() ) {
139  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
140  throw std::runtime_error( "Couldn't call beginInputFile()" );
141  }
142  } else if( inc.type() == IncidentType::EndInputFile ) {
143  if( endInputFile().isFailure() ) {
144  ATH_MSG_FATAL( "Failed to call endInputFile()" );
145  throw std::runtime_error( "Couldn't call endInputFile()" );
146  }
147  } else if( inc.type() == IncidentType::BeginEvent ) {
148  // If the tool didn't catch the begin input file incident for the
149  // first input file of the job, then call the appropriate function
150  // now.
151  if( ! m_beginInputFileCalled ) {
152  m_beginInputFileCalled = true;
153  if( beginInputFile().isFailure() ) {
154  ATH_MSG_FATAL( "Failed to call beginInputFile()" );
155  throw std::runtime_error( "Couldn't call beginInputFile()" );
156  }
157  }
158  if( beginEvent().isFailure() ) {
159  ATH_MSG_FATAL( "Failed to call beginEvent()" );
160  throw std::runtime_error( "Couldn't call beginEvent()" );
161  }
162 
163  #ifdef XAOD_STANDALONE
164  } else if( inc.type() == IncidentType::MetaDataStop ) {
165  if( metaDataStop().isFailure() ) {
166  ATH_MSG_FATAL( "Failed to call metaDataStop()" );
167  throw std::runtime_error( "Couldn't call metaDataStop()" );
168  }
169 
170  #endif // XAOD_STANDALONE
171  } else {
172  ATH_MSG_WARNING( "Unknown incident type received in AsgMetaDataTool: " << inc.type() );
173  }
174 
175  return;
176  }

◆ initialize()

virtual StatusCode asg::AsgTool::initialize ( )
inlinevirtualinherited

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented in SimpleMuonTriggerScaleFactors, Trig::TrigMuonMatching, CP::MuonTriggerScaleFactors, Trig::TrigTauMatchingTool, IHIEventShapeMapTool, ST::SUSYObjDef_xAOD, InDetSecVtxTruthMatchTool, JetGrooming::RecSoftDrop, met::METMaker, AsgForwardElectronIsEMSelector, JetGrooming::JetTrimming, ORUtils::BaseOverlapTool, PMGTools::PMGSherpa22VJetsWeightTool, AsgElectronEfficiencyCorrectionTool, CP::ElectronChargeEfficiencyCorrectionTool, AsgForwardElectronLikelihoodTool, CorrectPFOTool, CP::IsolationCorrectionTool, TauAnalysisTools::TauTruthMatchingTool, EGammaAmbiguityTool, InDetVertexTruthMatchTool, AthOnnx::OnnxRuntimeSessionToolCPU, AthOnnx::OnnxRuntimeSessionToolCUDA, PuppiWeightTool, JetIsolationTool, JetBalancePFlowJvtTool, CP::FFJetSmearingTool, JetForwardPFlowJvtTool, MCTruthClassifier, InDet::InDetHardScatterSelectionTool, dRMatchingTool, xAOD::BPhysBlindingTool, CP::EgammaCalibrationAndSmearingTool, JetVertexTaggerTool, tauRecTools::TrackRNN, LVL1::L1CaloOfflineTriggerTowerTools, TauAnalysisTools::TauSelectionTool, JetRecTool, met::METAssociationTool, CP::TrackVertexAssociationTool, met::METRebuilder, met::METAssociator, xAOD::TrackIsolationTool, InDet::InDetTrackSelectionTool, egammaMVACalibTool, TrigConf::xAODConfigTool, JetCleaningTool, met::METCaloRegionsTool, ZDC::ZdcLEDAnalysisTool, CP::MuonCalibTool, LVL1::L1CaloCells2TriggerTowers, JetVertexFractionTool, LVL1BS::PpmByteStreamReadV1V2Tool, JetClusterer, JetForwardJvtToolBDT, CP::AsgFlagSelectionTool, TauTrackFinder, TauAnalysisTools::DiTauSelectionTool, JetClustererByVertex, JetBadChanCorrTool, xAOD::BPhysTrackVertexMapTool, JetModifiedMassDrop, xAOD::CaloIsolationTool, EnhancedBiasWeighter, BookkeeperTool, ZDC::RpdSubtractCentroidTool, InDet::InDetUsedInFitTrackDecoratorTool, CP::AsgPtEtaSelectionTool, TauAnalysisTools::BuildTruthTaus, top::EventSaverFlatNtuple, tauRecTools::TauTrackRNNClassifier, InDet::InDetSecVtxTrackSelectionTool, JetForwardJvtTool, JetPileupTag::JetVertexNNTagger, CP::EgammaIsGoodOQSelectionTool, CP::IsolationCloseByCorrectionTool, CP::MuonCalibIntScaleSmearTool, DiTauRecTools::DiTauIDVarCalculator, JetFinder, AsgElectronIsEMSelector, CP::MuonCalibIntHighpTSmearTool, CP::MuonCalibIntSagittaTool, DiTauRecTools::DiTauDiscriminantTool, met::METBuilderTool, CP::AsgMaskSelectionTool, ElectronPhotonVariableCorrectionBase, ECUtils::EventCleaningTool, TauAnalysisTools::TauTruthTrackMatchingTool, met::METSoftTermsTool, LVL1::L1CaloLArTowerEnergy, HiggsTruthCategoryTool, IDTPM::TrackRoiSelectionTool, TauAnalysisTools::CommonDiTauEfficiencyTool, HIJetConstituentSubtractionTool, JetTrackSumMomentsTool, JetGrooming::SoftDrop, HFORSelectionTool, JetQGTaggerVariableTool, JetTrackMomentsTool, met::METTruthTool, CP::BaseLinearFakeBkgTool, PMGTools::PMGSherpaVjetsSysTool, ClusterMatching::CaloClusterMatchingTool, AsgPhotonEfficiencyCorrectionTool, InDet::JetTrackFilterTool, asg::DataHandleTestTool, xAODMaker::FileMetaDataTool, CP::BaseFakeBkgTool, InDet::InclusiveTrackFilterTool, InDet::InDetTrackTruthFilterTool, HIJetClusterSubtractorTool, CP::MVATrackVertexAssociationTool, IDTPM::RoiSelectionTool, ElectronPhotonVariableCorrectionTool, JetCalibrationTool, JetCaloQualityTool, JetOriginCorrectionTool, InDet::InDetTrackBiasingTool, HIJetClusterIndexAssociationTool, TauWPDecorator, TrigGlobalEfficiencyCorrectionTool, ZdcRecChannelToolV2, IDTPM::TrackObjectSelectionTool, CP::LhoodMM_tools, FlavorTagDiscriminants::GNNTool, FlavorTagDiscriminants::MultifoldGNNTool, CP::MuonSelectionTool, TauAnalysisTools::CommonDiTauSmearingTool, JSSTaggerBase, ZDC::ZdcAnalysisTool, IDTPM::TrackQualitySelectionTool, AsgElectronLikelihoodTool, CP::JetQGTagger, CP::JetJvtEfficiency, LVL1::L1CaloFcal23Cells2RxMappingTool, ORUtils::OverlapRemovalTool, Analysis::JetQuarkLabel, Ringer::AsgRingerSelectorTool, InDet::InDetTrackSmearingTool, JetCopier, JetGrooming::JetGroomer, met::METPhotonAssociator, JetECPSFractionTool, JetPtAssociationTool, met::METElectronAssociator, met::METTauAssociator, PMGTools::PMGDecayProductsSelectionTool, WeightToolBase, HIJetDRAssociationTool, JetClusterMomentsTool, met::METJetAssocTool, TauVertexFinder, IDTPM::JsonPlotsDefReadTool, TauAnalysisTools::DiTauSmearingTool, JetDRTrackAssocTool, JetReclusterer, TauDecayModeNNClassifier, BDTVertexWeightCalculator, asg::UnitTestTool1, IDTPM::DeltaRMatchingToolBase< T, R >, AsgElectronSelectorTool, JetReclusteringTool, met::METMuonAssociator, TauPi0CreateROI, TauShotFinder, IDTPM::DeltaRMatchingToolBase< xAOD::TrackParticle, xAOD::TruthParticle >, IDTPM::DeltaRMatchingToolBase< xAOD::TruthParticle, xAOD::TrackParticle >, IDTPM::DeltaRMatchingToolBase< xAOD::TrackParticle >, ZdcRecChannelToolLucrod, PMGTools::PMGTruthWeightTool, JetVoronoiMomentsTool, Trig::MatchFromCompositeTool, asg::UnitTestTool3, IDTPM::TruthTrackMatchingTool, CP::ApplyFakeFactor, AsgElectronChargeIDSelectorTool, HIJetMaxOverMeanTool, PanTau::Tool_FeatureExtractor, TauElectronVetoVariables, CP::IsolationSelectionTool, WeightsAgregator, EL::UnitTestTool, FlavorTagDiscriminants::TrackClassifier, JetLArHVTool, ZDC::ZdcTrigValidTool, IDTPM::TrackTruthMatchingTool, HI::HIPileupTool, InDet::InDetTrackTruthOriginTool, JetHelper::VarTool, FlavorTagDiscriminants::DL2Tool, BTaggingSelectionTool, EnergyCorrelatorGeneralizedRatiosTool, EnergyCorrelatorGeneralizedTool, EnergyCorrelatorRatiosTool, EnergyCorrelatorTool, TauEleOverlapChecker, TauJetRNNEvaluator, asg::UnitTestTool2, JetTruthLabelingTool, ZDC::ZdcRecTool, HIJetConstituentModifierTool, TauCalibrateLC, TauGNNEvaluator, TauPi0ScoreCalculator, TauRecToolBase, Trig::TrigEgammaEmulationPrecisionElectronHypoTool, asg::UnitTestTool1A, PDFWeight, HIEventShapeJetIteration, HIJetSignificanceTool, CP::JetQGTaggerBDT, JetWidthTool, TauVertexVariables, Trig::TrigEgammaEmulationPrecisionPhotonHypoTool, Trig::TrigEgammaMatchingTool, Trig::R3IParticleRetrievalTool, IDTPM::TruthTrackQualitySelectionTool, JetPileupLabelingTool, JetFromPseudojet, JetTruthParticleSelectorTool, Trig::TrigEgammaEmulationBaseHypoTool, CP::ApplyE2YFakeRate, ParticleScaleFactorTool, InDet::InDetTrackSystematicsTool, JetCaloQualityToolFE, Trig::MatchingTool, Trig::R3MatchingTool, IDTPM::OfflineTrackQualitySelectionTool, JetParticleAssociation, Trig::TrigEgammaEmulationChain, Trig::TrigEgammaEmulationFastCaloHypoTool, AthOnnx::OnnxRuntimeInferenceTool, xAODtoHepMCTool, HIEventShapeMapTool, HI::HIVertexSelectionTool, JetHelper::HistoInput2D, TauVertexedClusterDecorator, Trig::IParticleRetrievalTool, CP::AsymptMatrixTool, HI::HIEventSelectionTool, FlavorTagDiscriminants::HbbTagTool, JetConstituentFrac, JetGroomMRatio, JetHelper::HistoInput1D, JetHelper::TextInputMCJES, ExtendTrackToLayerTool, Trig::TypedScoringTool, TrackTruthSelectionTool, HIUEModulatorTool, JSSWTopTaggerANN, CP::JvtEfficiencyToolBase, JetEMScaleMomTool, MvaTESVariableDecorator, TauAODLeptonRemovalTool, TauCombinedTES, ParticleJetDeltaRLabelTool, HIEventShapeSummaryTool, FlavorTagDiscriminants::BTagAugmenterTool, FlavorTagDiscriminants::VRJetOverlapDecoratorTool, JetCaloEnergies, ParticleJetGhostLabelTool, FlavorTagDiscriminants::BTagMuonAugmenterTool, MBTSTimeFilterTool, JSSWTopTaggerDNN, SmoothedTopTagger, MvaTESEvaluator, CP::IsolationLowPtPLVTool, Trig::DRScoringTool, Trig::EgammaDRScoringTool, SmoothedWZTagger, CP::FJvtEfficiencyTool, CP::JvtSelectionToolBase, CP::NNJvtSelectionTool, AthAsgExUnittestTool, CP::JvtSelectionTool, BTaggingSelectionJsonTool, CP::FJvtSelectionTool, CP::JvtEfficiencyTool, CP::NNJvtEfficiencyTool, BookkeeperDumperTool, TrigFastCalibWithRings, top::ScaleFactorRetriever, BTaggingEfficiencyTool, BTaggingTruthTaggingTool, MissingCellListTool, JetVoronoiDiagramHelpers::Diagram, FastJetInterfaceTool, met::METSystematicsTool, Trig::TrigEgammaEmulationToolMT, JetAttributeRatioSelector, top::GhostTrackSystematicsMaker, top::TopObjectSelection, BTaggingEigenVectorRecompositionTool, LVL1::TrigT1CaloLWHistogramToolV1, LVL1::TrigT1CaloLWHistogramTool, Trig::TrigDecisionTool, CP::PhotonPointingTool, met::METRecoTool, CP::PhotonVertexSelectionTool, top::KLFitterTool, ZdcByteStreamReadV1V2Tool, CP::PileupReweightingTool, top::JetObjectCollectionMaker, LVL1::L1CaloxAODOfflineTriggerTowerTools, RCJet, LVL1::TrigT1CaloMonErrorToolV1, met::METTrackFilterTool, LVL1::TrigT1CaloMonErrorTool, SoftKillerWeightTool, EventDensityTool, met::METSignificance, ParticleLevelRCJetObjectLoader, JetUncertaintiesTool, top::TopToolStore, CP::JetTileCorrectionTool, xAODMaker::TriggerMenuMetaDataTool, D3PD::D3PDMCTruthClassifier, top::ElectronInJetSubtractionCollectionMaker, top::MuonObjectCollectionMaker, JetConstituentModSequence, top::EgammaObjectCollectionMaker, HistoGroupBase, AsgPhotonIsEMSelector, JetAttributeSelector, top::ObjectCollectionMaker, TrackVertexAssociationTool, met::METRefinerTool, TauAnalysisTools::CommonSmearingTool, top::GlobalLeptonTriggerCalculator, top::ScaleFactorCalculator, top::TrackSystematicsMaker, top::ElectronScaleFactorCalculator, top::JetScaleFactorCalculator, top::MuonScaleFactorCalculator, PanTau::Tool_DetailsArranger, LVL1::L1CaloMonitoringCaloTool, top::EventSaverxAOD, LVL1::L1CaloTTIdTools, top::SoftMuonObjectCollectionMaker, top::TauObjectCollectionMaker, JetInputElRemovalTool, TauAnalysisTools::CommonEfficiencyTool, top::BTagScaleFactorCalculator, top::MissingETObjectCollectionMaker, PanTau::PanTauProcessor, xAODMaker::TruthMetaDataTool, top::PDFScaleFactorCalculator, top::PhotonScaleFactorCalculator, top::PseudoTopReco, EventShapeCopier, met::METJetTool, GoodRunsListSelectionTool, top::EventSaverxAODNext, top::FwdElectronScaleFactorCalculator, FSR::FsrPhotonTool, Trig::StaticBunchCrossingTool, ZMassConstraint::ConstraintFit, TauAnalysisTools::TauEfficiencyCorrectionsTool, PanTau::Tool_DecayModeDeterminator, PanTau::Tool_ModeDiscriminator, CP::ElectronLRTOverlapRemovalTool, HIClusterSubtraction, JetAttributeHisto, JetPseudojetCopier, met::METEgammaAssociator, Trig::xAODBunchCrossingTool, TauAnalysisTools::DiTauEfficiencyCorrectionsTool, TauAnalysisTools::DiTauTruthMatchingTool, TauAnalysisTools::TauSmearingTool, top::JetMETCPTools, met::METTruthAssociator, PanTau::Tool_InformationStore, HistoDefinitionTool, PanTau::Tool_InputConverter, JetBottomUpSoftDrop, JetRecursiveSoftDrop, PMGTools::PMGCrossSectionTool, JetSoftDrop, TrigEgammaMatchingToolMT, DiTauMassTools::MissingMassToolV2, top::TauScaleFactorCalculator, top::TriggerCPTools, JetConstituentsRetriever, VoronoiWeightTool, top::GhostTrackCPTools, JetCaloCellQualityTool, JetContainerHistoFiller, ChargedHadronSubtractionTool, JetTrackSelectionTool, met::METRegionsTool, met::METSoftAssociator, PanTau::Tool_TauConstituentGetter, top::EventCleaningSelection, ConstituentSubtractorTool, top::EgammaCPTools, top::OtherCPTools, top::TopEventMaker, JetHistoBase, JetSelectorAttributeRunII, JetSplitter, CaloClusterConstituentsOrigin, JetTrackSelectionTool2, SimpleJetTrackSelectionTool, CP::MuonLRTOverlapRemovalTool, top::FlavorTaggingCPTools, top::TauCPTools, HistosForJetSelection, JetPruner, JetToolRunner, JetUsedInFitTrackDecoratorTool, top::TrackCPTools, JetTrimmer, NSubjettinessRatiosTool, CP::MuonEfficiencyScaleFactors, top::PileupScaleFactorCalculator, top::MuonCPTools, JetConstitFourMomTool, NSubjettinessTool, ZdcDataAccessV2, JetPseudojetRetriever, LVL1BS::TrigT1CaloDataAccessV2, PanTau::Tool_TauConstituentSelector, CopyTruthParticles, top::IsolationCPTools, top::OverlapRemovalCPTools, ClusterAtEMScaleTool, CP::IsolationHelper, top::BoostedTaggingCPTools, AsgDeadHVCellRemovalTool, ConstitTimeCutTool, Analysis::JetConeLabeling, JetSelectorAttribute, HIJetUEMonitoring, HIEfficiencyResponseHistos, JetSubStructureMomentToolsBase, AsgHelloTool, CopyTruthJetParticles, LeadingJetsRelations, EfficiencyResponseHistos, and JetEventSelector.

Definition at line 133 of file AsgTool.h.

133 { return StatusCode::SUCCESS; }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ inputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::inputMetaStore ( ) const
inherited

Accessor for the input metadata store.

Definition at line 88 of file AsgMetadataTool.cxx.

88  {
89 
90 #ifdef XAOD_STANDALONE
91  return &m_inputMetaStore;
92 #else // XAOD_STANDALONE
93  return m_inputMetaStore;
94 #endif // XAOD_STANDALONE
95  }

◆ isBeam1()

bool Trig::BunchCrossingToolBase::isBeam1 ( bcid_type  bcid) const
virtualinherited

Function deciding if there was a bunch from "beam 1" in this bunch crossing.

Implements Trig::IBunchCrossingTool.

Definition at line 66 of file BunchCrossingToolBase.cxx.

66  {
67 
68  // Check if this is a filled bunch:
69  std::set< BunchCrossing >::const_iterator itr_fill =
70  m_filledBunches.find( bcid );
71  if( itr_fill != m_filledBunches.end() ) {
72  return true;
73  }
74 
75  // Check if this is an unpaired bunch with the bunch in beam 1:
76  std::set< BunchCrossing >::const_iterator itr_unp =
77  m_unpairedBunches.find( bcid );
78  if( ( itr_unp != m_unpairedBunches.end() ) &&
79  ( itr_unp->intensityBeam1() > 0.001 ) ) {
80  return true;
81  } else {
82  return false;
83  }
84  }

◆ isBeam2()

bool Trig::BunchCrossingToolBase::isBeam2 ( bcid_type  bcid) const
virtualinherited

Function deciding if there was a bunch from "beam 2" in this bunch crossing.

Implements Trig::IBunchCrossingTool.

Definition at line 86 of file BunchCrossingToolBase.cxx.

86  {
87 
88  // Check if this is a filled bunch:
89  std::set< BunchCrossing >::const_iterator itr_fill =
90  m_filledBunches.find( bcid );
91  if( itr_fill != m_filledBunches.end() ) {
92  return true;
93  }
94 
95  // Check if this is an unpaired bunch with the bunch in beam 1:
96  std::set< BunchCrossing >::const_iterator itr_unp =
97  m_unpairedBunches.find( bcid );
98  if( ( itr_unp != m_unpairedBunches.end() ) &&
99  ( itr_unp->intensityBeam2() > 0.001 ) ) {
100  return true;
101  } else {
102  return false;
103  }
104  }

◆ isFilled()

bool Trig::BunchCrossingToolBase::isFilled ( bcid_type  bcid) const
virtualinherited

The simplest query: Is the bunch crossing filled or not?

Implements Trig::IBunchCrossingTool.

Definition at line 32 of file BunchCrossingToolBase.cxx.

32  {
33 
34  // Check if this is a filled bunch crossing:
35  if( m_filledBunches.find( bcid ) != m_filledBunches.end() ) {
36  return true;
37  } else {
38  return false;
39  }
40  }

◆ isInTrain()

bool Trig::BunchCrossingToolBase::isInTrain ( bcid_type  bcid) const
virtualinherited

Function deciding if a given bunch crossing is in a filled train.

Implements Trig::IBunchCrossingTool.

Definition at line 42 of file BunchCrossingToolBase.cxx.

42  {
43 
44  // Look for this BCID in the list of bunch trains:
45  std::set< BunchTrain >::const_iterator itr = m_bunchTrains.begin();
46  std::set< BunchTrain >::const_iterator end = m_bunchTrains.end();
47  for( ; itr != end; ++itr ) {
48  if( itr->find( bcid ) != itr->end() ) {
49  return true;
50  }
51  }
52 
53  return false;
54  }

◆ isUnpaired()

bool Trig::BunchCrossingToolBase::isUnpaired ( bcid_type  bcid) const
virtualinherited

Function deciding if a given bunch crossing has an unpaired bunch.

Implements Trig::IBunchCrossingTool.

Definition at line 56 of file BunchCrossingToolBase.cxx.

56  {
57 
58  // Check if this is an unpaired bunch crossing:
59  if( m_unpairedBunches.find( bcid ) != m_unpairedBunches.end() ) {
60  return true;
61  } else {
62  return false;
63  }
64  }

◆ loadBunchTrains()

StatusCode Trig::BunchCrossingToolBase::loadBunchTrains ( const std::vector< int > &  bunches,
const std::vector< float > &  bunch_int1 = std::vector< float >(),
const std::vector< float > &  bunch_int2 = std::vector< float >() 
)
protectedinherited

Interpret the configuration for bunch trains.

This function takes care of identifying the bunch trains in the configuration.

The algorithm is quite simple. It starts off with all the filled bunches that have not been identified as single bunches by the loadSingleBunches(...) function. It takes the first available bunch crossing, then loops over the rest of them. When it finds a BC that's "close enough" to the current bunch train, then the bunch train is extended. From there on the algorithm continues with this extended bunch train. When the loop reaches the end of the available bunches, the created bunch train is added to the cache, and the algorithms starts again with the first still available bunch crossing.

The bunch intensity parameter is optional. If it's not specified, the code will assign an intensity of "1.0" to all the bunch crossings.

Parameters
bunchesThe filled bunch crossings
bunch_intThe "intensities" of the paired bunches
Returns
StatusCode::SUCCESS if the interpretation was successful, StatusCode::FAILURE otherwise

Definition at line 986 of file BunchCrossingToolBase.cxx.

989  {
990 
991  // Do a small sanity check:
992  if( ( ( bunches.size() != bunch_int1.size() ) && bunch_int1.size() ) ||
993  ( ( bunches.size() != bunch_int2.size() ) && bunch_int2.size() ) ) {
994  ATH_MSG_ERROR( "Received vectors of different sizes for the bunch "
995  "IDs and bunch intensities\n"
996  "Function can not work like this..." );
997  return StatusCode::FAILURE;
998  }
999  if( ! bunch_int1.size() ) {
1000  ATH_MSG_DEBUG( "Not using bunch intensity for the calculation" );
1001  }
1002  if( ( ! bunch_int2.size() ) && bunch_int1.size() ) {
1003  ATH_MSG_DEBUG( "Using 'bunch crossing intensity' for the "
1004  "calculation" );
1005  }
1006 
1007  //
1008  // Calculate the allowed maximum BCID separation between single bunches:
1009  //
1010  const int maxBCSpacing = bunchSpacing( bunches );
1011 
1012  // Reset the cache:
1013  m_bunchTrains.clear();
1014 
1015  //
1016  // Create a cache of the bunches which have not been identified as a
1017  // single bunch:
1018  //
1019  std::set< BunchCrossing > cache;
1020  std::vector< int >::const_iterator b_itr = bunches.begin();
1021  std::vector< int >::const_iterator b_end = bunches.end();
1022  std::vector< float >::const_iterator i1_itr = bunch_int1.begin();
1023  std::vector< float >::const_iterator i2_itr = bunch_int2.begin();
1024  for( ; b_itr != b_end; ++b_itr ) {
1025  if( std::find( m_singleBunches.begin(), m_singleBunches.end(),
1026  BunchCrossing( *b_itr ) ) == m_singleBunches.end() ) {
1027  cache.insert( BunchCrossing( *b_itr,
1028  ( float )( bunch_int1.size() ? *i1_itr :
1029  1.0 ),
1030  ( float )( bunch_int2.size() ? *i2_itr :
1031  0.0 ) ) );
1032  }
1033  if( bunch_int1.size() ) ++i1_itr;
1034  if( bunch_int2.size() ) ++i2_itr;
1035  }
1036 
1037  ATH_MSG_VERBOSE( "Bunches considered for trains: " << cache );
1038 
1039  //
1040  // Continue the loop until we have unassigned bunches:
1041  //
1042  while( cache.size() ) {
1043 
1044  // Create a new bunch train object:
1045  BunchTrain bt;
1046  bt.insert( *cache.begin() );
1047 
1048  // Try finding attachable bunches until no other attachable bunch can
1049  // be found:
1050  size_t prev_size = 0;
1051  while( prev_size != cache.size() ) {
1052 
1053  // Let's remember the size of the cache:
1054  prev_size = cache.size();
1055 
1056  // Find all the bunches that should be a part of this train:
1057  std::set< BunchCrossing >::const_iterator c_itr = cache.begin();
1058  std::set< BunchCrossing >::const_iterator c_end = cache.end();
1059  for( ; c_itr != c_end; ++c_itr ) {
1060  if( bt.distance( *c_itr ) <= maxBCSpacing ) {
1061  ATH_MSG_VERBOSE( "Adding BunchCrossing " << *c_itr
1062  << " to Bunch Train " << bt );
1063  bt.insert( *c_itr );
1064  }
1065  }
1066 
1067  // Now remove the selected bunches from the cache:
1068  BunchTrain::const_iterator itr = bt.begin();
1069  BunchTrain::const_iterator end = bt.end();
1070  for( ; itr != end; ++itr ) {
1071  cache.erase( *itr );
1072  }
1073  }
1074 
1075  // Finally, remember this train:
1076  if( ! bt.validate() ) {
1077  ATH_MSG_ERROR( "Found a strange bunch train: " << bt );
1078  ATH_MSG_ERROR( "Keeping in it the list of trains!" );
1079  }
1080  m_bunchTrains.insert( bt );
1081  }
1082 
1083  //
1084  // Check if the spacing in the bunch trains is the same. (It should be for
1085  // all real configurations.)
1086  //
1087  std::set< BunchTrain >::const_iterator train_itr = m_bunchTrains.begin();
1088  std::set< BunchTrain >::const_iterator train_end = m_bunchTrains.end();
1089  int spacing = -1;
1090  for( ; train_itr != train_end; ++train_itr ) {
1091  if( spacing < 0 ) {
1092  spacing = train_itr->spacing();
1093  continue;
1094  }
1095  if( train_itr->spacing() != spacing ) {
1096  ATH_MSG_WARNING( "The spacing seems to be different between the "
1097  "trains" );
1098  ATH_MSG_WARNING( "This should probably not happen" );
1099  }
1100  }
1101 
1102  ATH_MSG_DEBUG( "Bunch trains found: " << m_bunchTrains );
1103 
1104  return StatusCode::SUCCESS;
1105  }

◆ loadConfig()

StatusCode Trig::TrigConfBunchCrossingTool::loadConfig ( )
private

Make sure that the latest/correct configuration is loaded.

This function makes sure that the latest configuration from the TriggerDB is loaded.

It has to be called using some mechanism, which is the incident mechanism at the moment.

The function checks if the currently loaded configuration is the same as the most recent configuration available from the trigger configuration service. If it's not, then it loads the current configuration from the trigger config service.

Returns
StatusCode::SUCCESS if the operation wa successful, or StatusCode::FAILURE if it wasn't.

Definition at line 184 of file TrigConfBunchCrossingTool.cxx.

184  {
185 
186  // Decide where to take the configuration from:
187  TrigConf::IILVL1ConfigSvc* configSvc = 0;
188 #ifndef XAOD_STANDALONE
189  if (m_configTool.isSet()) {
190  configSvc = m_configTool.operator->();
191  } else {
192  configSvc = m_configSvc.operator->();
193  }
194 #else
195  configSvc = m_configTool.operator->();
196 #endif // not XAOD_STANDALONE
197 
198  // Check if the needed info is even there:
199  if( ! configSvc->bunchGroupSet() ) {
200  ATH_MSG_FATAL( "Trigger configuration service doesn't provide "
201  "BunchGroupSet information" );
202  return StatusCode::FAILURE;
203  }
204 
205  // Check if we already have the correct configuration:
206  if( configSvc->bunchGroupSet()->id() == m_bgId ) {
207  return StatusCode::SUCCESS;
208  }
209 
210  // Report to the user what we're doing:
211  ATH_MSG_INFO( "Updating tool configuration to BGKey #"
212  << configSvc->bunchGroupSet()->id() );
213 
214  // Print the configuration for debugging purposes, and remember which one
215  // we're processing:
216  m_bgId = configSvc->bunchGroupSet()->id();
217  printBunchGroups( configSvc );
218 
219  //
220  // Select the collision bunch group:
221  //
222  const std::vector< TrigConf::BunchGroup >& bgs =
223  configSvc->bunchGroupSet()->bunchGroups();
224  std::vector< TrigConf::BunchGroup >::const_iterator filled_bg =
225  bgs.begin();
226  ++filled_bg;
227  ATH_MSG_INFO( "Taking the second bunch group as the colliding bunch "
228  "group" );
229 
230  //
231  // Now interpret the information:
232  //
233  ATH_CHECK( loadSingleBunches( filled_bg->bunches() ) );
234  ATH_CHECK( loadBunchTrains( filled_bg->bunches() ) );
235 
236  //
237  // Select the unpaired bunches. The overlaps are taken care of by the
238  // base tool.
239  //
240  std::vector< int > unpaired;
241  // These are the "unpaired isolated" bunches:
242  if( bgs.size() > 4 ) {
243  unpaired.insert( unpaired.end(), bgs[ 4 ].bunches().begin(),
244  bgs[ 4 ].bunches().end() );
245  }
246  // These are the "unpaired non-isolated" bunches:
247  if( bgs.size() > 5 ) {
248  unpaired.insert( unpaired.end(), bgs[ 5 ].bunches().begin(),
249  bgs[ 5 ].bunches().end() );
250  }
251 
252  //
253  // Now interpret the information:
254  //
255  ATH_CHECK( loadUnpairedBunches( unpaired, unpaired ) );
256 
257  // Print the configuration to give some feedback to the user:
258  printConfig();
259 
260 #ifndef XAOD_STANDALONE
261  // Let everybody know that the configuration of the tool has changed:
262  ServiceHandle< IIncidentSvc > incidentSvc( "IncidentSvc", name() );
263  ATH_CHECK( incidentSvc.retrieve() );
264  incidentSvc->fireIncident( Incident( "BunchConfiguration update",
266 #endif // not XAOD_STANDALONE
267 
268  // Return gracefully:
269  return StatusCode::SUCCESS;
270  }

◆ loadSingleBunches()

StatusCode Trig::BunchCrossingToolBase::loadSingleBunches ( const std::vector< int > &  bunches,
const std::vector< float > &  bunch_int1 = std::vector< float >(),
const std::vector< float > &  bunch_int2 = std::vector< float >() 
)
protectedinherited

Interpret the configuration for single bunches.

This function takes care of selecting the single bunches from the paired bunches.

These will then not be taken into account in the train finding algorithm.

The bunch intensity parameter is optional. If it's not specified, the code will assign an intensity of "1.0" to all the bunch crossings.

Parameters
bunchesThe paired bunches
bunch_intThe "intensities" of the paired bunches
Returns
StatusCode::SUCCESS if the interpretation was successful, StatusCode::FAILURE otherwise

Definition at line 870 of file BunchCrossingToolBase.cxx.

873  {
874 
875  // Do a small sanity check:
876  if( ( ( bunches.size() != bunch_int1.size() ) && bunch_int1.size() ) ||
877  ( ( bunches.size() != bunch_int2.size() ) && bunch_int2.size() ) ) {
878  ATH_MSG_ERROR( "Received vectors of different sizes for the bunch "
879  "IDs and bunch intensities\n"
880  "Function can not work like this..." );
881  return StatusCode::FAILURE;
882  }
883  if( ! bunch_int1.size() ) {
884  ATH_MSG_DEBUG( "Not using bunch intensity for the calculation" );
885  }
886  if( ( ! bunch_int2.size() ) && bunch_int1.size() ) {
887  ATH_MSG_DEBUG( "Using 'bunch crossing intensity' for the "
888  "calculation" );
889  }
890 
891  //
892  // Calculate the allowed maximum BCID separation between single bunches:
893  //
894  const int maxBCSpacing = bunchSpacing( bunches );
895 
896  // Reset the cache:
897  m_filledBunches.clear();
898  m_singleBunches.clear();
899 
900  //
901  // Loop over the paired bunch crossings:
902  //
903  std::vector< int >::const_iterator b_itr = bunches.begin();
904  std::vector< int >::const_iterator b_end = bunches.end();
905  std::vector< float >::const_iterator i1_itr = bunch_int1.begin();
906  std::vector< float >::const_iterator i2_itr = bunch_int2.begin();
907  for( ; b_itr != b_end; ++b_itr ) {
908 
909  // Evaluate the intensity of this paired bunch:
910  const float intensity1 = bunch_int1.size() ? *i1_itr : 1.0;
911  const float intensity2 = bunch_int2.size() ? *i2_itr : 0.0;
912 
913  // It's definitely a filled bunch, so let's remember it as such:
914  m_filledBunches.insert( BunchCrossing( *b_itr, intensity1,
915  intensity2 ) );
916 
917  ATH_MSG_VERBOSE( "Evaluating bunch crossing: " << *b_itr );
918 
919  //
920  // This expression counts how many of the paired bunches fulfill:
921  //
922  // distance( ref_bcid, bcid ) <= maxBCSpacing
923  //
924  // Since the calculation takes the reference bcid into account as well,
925  // the count is always >= 1. I have to use the specialised
926  // distance(...) function, because a regular
927  //
928  // bcid - maxBCSpacing <= ref_bcid <= bcid + maxBCSpacing
929  //
930  // expression wouldn't give the correct answer at the "turnover" of the
931  // bcid numbering. (When evaluating bcid 1 and
932  // BunchCrossing::MAX_BCID.)
933  //
934  const int neighbours =
935  std::count_if( bunches.begin(), bunches.end(),
936  [ maxBCSpacing, &b_itr ]( int bunch ) {
937  return ( Trig::distance( bunch, *b_itr ) <=
938  maxBCSpacing );
939  } );
940 
941  //
942  // Now decide if we want to consider this bunch crossing as a single
943  // bunch or not:
944  //
945  ATH_MSG_VERBOSE( " Bunch neighbours: " << neighbours );
946  if( neighbours == 1 ) {
947  ATH_MSG_VERBOSE( " Bunch crossing " << *b_itr
948  << " seems to be a single bunch" );
949  m_singleBunches.insert( BunchCrossing( *b_itr, intensity1,
950  intensity2 ) );
951  }
952 
953  // Only step through the intensity vector(s) if it has some elements:
954  if( bunch_int1.size() ) ++i1_itr;
955  if( bunch_int2.size() ) ++i2_itr;
956  }
957 
958  //
959  // Finally some debugging message for the end:
960  //
961  ATH_MSG_DEBUG( "Single bunches found: " << m_singleBunches );
962 
963  return StatusCode::SUCCESS;
964  }

◆ loadUnpairedBunches()

StatusCode Trig::BunchCrossingToolBase::loadUnpairedBunches ( const std::vector< int > &  beam1,
const std::vector< int > &  beam2,
const std::vector< float > &  bunch_int1 = std::vector< float >(),
const std::vector< float > &  bunch_int2 = std::vector< float >() 
)
protectedinherited

Interpret the configuration for unpaired bunches.

This function just caches the unpaired bunches internally.

It doesn't have to do anything as fancy as the other two load functions, it just takes the BCIDs as they are.

Parameters
bunchesThe unpaired bunch crossings
bunch_intThe "intensities" of the unpaired bunches
Returns
StatusCode::SUCCESS if the caching was successful, StatusCode::FAILURE otherwise

Definition at line 1117 of file BunchCrossingToolBase.cxx.

1121  {
1122 
1123  // Do a small sanity check:
1124  if( ( ( beam1.size() != bunch_int1.size() ) && bunch_int1.size() ) ||
1125  ( ( beam2.size() != bunch_int2.size() ) && bunch_int2.size() ) ) {
1126  ATH_MSG_ERROR( "Received vectors of different sizes for the bunch "
1127  "IDs and bunch intensities\n"
1128  "Function can not work like this..." );
1129  return StatusCode::FAILURE;
1130  }
1131  if( ( ! bunch_int1.size() ) && ( ! bunch_int2.size() ) ) {
1132  ATH_MSG_DEBUG( "Not using bunch intensity for the calculation" );
1133  }
1134 
1135  // Reset the cache:
1136  m_unpairedBunches.clear();
1137 
1138  //
1139  // Add the unpaired bunches from beam 1:
1140  //
1141  std::vector< int >::const_iterator b_itr = beam1.begin();
1142  std::vector< int >::const_iterator b_end = beam1.end();
1143  std::vector< float >::const_iterator i_itr = bunch_int1.begin();
1144  for( ; b_itr != b_end; ++b_itr ) {
1145 
1146  // Evaluate the intensity of this unpaired bunch:
1147  const float intensity = bunch_int1.size() ? *i_itr : 1.0;
1148 
1149  // Nothing fancy to do, just put it in the cache:
1150  m_unpairedBunches.insert( BunchCrossing( *b_itr, intensity, 0.0 ) );
1151 
1152  // Only step through the intensity vector if it has some elements:
1153  if( bunch_int1.size() ) ++i_itr;
1154  }
1155 
1156  //
1157  // Add the unpaired bunches from beam 2:
1158  //
1159  b_itr = beam2.begin();
1160  b_end = beam2.end();
1161  i_itr = bunch_int2.begin();
1162  for( ; b_itr != b_end; ++b_itr ) {
1163 
1164  // Evaluate the intensity of this unpaired bunch:
1165  const float intensity = bunch_int2.size() ? *i_itr : 1.0;
1166 
1167  // Check if this BCID is already known as an unpaired BCID:
1169  m_unpairedBunches.find( *b_itr );
1170  if( itr != m_unpairedBunches.end() ) {
1171  // Modify the BCID not to correspond to a particular beam. Most
1172  // implementations don't treat beam 1 and beam 2 separately.
1173  BunchCrossing bc( *itr );
1174  bc.setIntensityBeam2( intensity );
1175  m_unpairedBunches.erase( itr );
1176  m_unpairedBunches.insert( bc );
1177  } else {
1178  // Nothing fancy to do, just put it in the cache:
1179  m_unpairedBunches.insert( BunchCrossing( *b_itr, 0.0, intensity ) );
1180  }
1181 
1182  // Only step through the intensity vector if it has some elements:
1183  if( bunch_int2.size() ) ++i_itr;
1184  }
1185 
1186  //
1187  // Finally some debugging message for the end:
1188  //
1189  ATH_MSG_DEBUG( "Unpaired bunches found: " << m_unpairedBunches );
1190 
1191  return StatusCode::SUCCESS;
1192  }

◆ metaDataStop()

StatusCode asg::AsgMetadataTool::metaDataStop ( )
protectedvirtualinherited

Function called when the tool should write out its metadata.

Dummy implementation that can be overridden by the derived tool.

Reimplemented in xAODMaker::FileMetaDataTool, BookkeeperTool, BookkeeperDumperTool, xAODMaker::TriggerMenuMetaDataTool, and xAODMaker::TruthMetaDataTool.

Definition at line 204 of file AsgMetadataTool.cxx.

204  {
205 
206  // Return gracefully:
207  return StatusCode::SUCCESS;
208  }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

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

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ numberOfBunchTrains()

unsigned int Trig::BunchCrossingToolBase::numberOfBunchTrains ( ) const
virtualinherited

Get the number of the bunch trains in the current configuration.

Implements Trig::IBunchCrossingTool.

Definition at line 821 of file BunchCrossingToolBase.cxx.

821  {
822 
823  return m_bunchTrains.size();
824  }

◆ numberOfFilledBunches()

unsigned int Trig::BunchCrossingToolBase::numberOfFilledBunches ( ) const
virtualinherited

Get the number of filled bunches in the current configuration.

Implements Trig::IBunchCrossingTool.

Definition at line 811 of file BunchCrossingToolBase.cxx.

811  {
812 
813  return m_filledBunches.size();
814  }

◆ numberOfUnpairedBunches()

unsigned int Trig::BunchCrossingToolBase::numberOfUnpairedBunches ( ) const
virtualinherited

Get the number of unpaired bunches in the current configuration.

Implements Trig::IBunchCrossingTool.

Definition at line 816 of file BunchCrossingToolBase.cxx.

816  {
817 
818  return m_unpairedBunches.size();
819  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ outputMetaStore()

AsgMetadataTool::MetaStorePtr_t asg::AsgMetadataTool::outputMetaStore ( ) const
inherited

Accessor for the output metadata store.

Definition at line 97 of file AsgMetadataTool.cxx.

97  {
98 
99 #ifdef XAOD_STANDALONE
100  return &m_outputMetaStore;
101 #else // XAOD_STANDALONE
102  return m_outputMetaStore;
103 #endif // XAOD_STANDALONE
104  }

◆ print() [1/2]

void asg::AsgTool::print ( ) const
virtualinherited

◆ print() [2/2]

virtual void asg::IAsgTool::print ( ) const
pure virtualinherited

◆ printBunchGroups()

void Trig::TrigConfBunchCrossingTool::printBunchGroups ( const TrigConf::IILVL1ConfigSvc svc) const
private

Print the "raw" configuration for debugging.

This function is only here for debugging.

It prints practically the full configuration information that the tool has to work with.

Definition at line 276 of file TrigConfBunchCrossingTool.cxx.

277  {
278 
279  // Skip the rest if nothing will be printed anyway:
280  if( ! msgLvl( MSG::VERBOSE ) ) return;
281 
282  // Print the information:
283  ATH_MSG_VERBOSE( "Printing BunchGroup configuration:" );
284  for( const auto& bg : svc->bunchGroupSet()->bunchGroups() ) {
285  ATH_MSG_VERBOSE( " BG \"" << bg.name() << "\": " << bg.bunches() );
286  }
287 
288  // Return gracefully:
289  return;
290  }

◆ printConfig()

void Trig::BunchCrossingToolBase::printConfig ( ) const
protectedinherited

Function printing the configuration of the tool.

This function is used to print the overall configuration in a format very similar to how atlas-runqery.cern.ch started showing this information recently.

Definition at line 1199 of file BunchCrossingToolBase.cxx.

1199  {
1200 
1201  ATH_MSG_INFO( "No. of coll. bunches : " << m_filledBunches.size() );
1202  ATH_MSG_INFO( "No. of unpaired bunches: " << m_unpairedBunches.size() );
1203  ATH_MSG_INFO( "No. of bunch trains : " << m_bunchTrains.size() );
1204  if( m_bunchTrains.size() ) {
1205  ATH_MSG_INFO( "Bunch spacing in trains: "
1206  << m_bunchTrains.begin()->spacing()
1207  << " ns" );
1208  }
1209 
1210  return;
1211  }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ setUseIncidents()

void asg::AsgMetadataTool::setUseIncidents ( const bool  flag)
inlineprotectedinherited

Definition at line 132 of file AsgMetadataTool.h.

133  {
135  }

◆ sysInitialize()

StatusCode asg::AsgMetadataTool::sysInitialize ( )
virtualinherited

Function initialising the tool in the correct way in Athena.

This function is used to set up the callbacks from IncidentSvc in Athena at the right time during initialisation, without the user having to do anything special in his/her code.

Reimplemented from AthCommonDataStore< AthCommonMsg< AlgTool > >.

Definition at line 110 of file AsgMetadataTool.cxx.

110  {
111 
112 #ifndef XAOD_STANDALONE
113  if (m_useIncidents) {
114  // Connect to the IncidentSvc:
115  ServiceHandle< IIncidentSvc > incSvc( "IncidentSvc", name() );
116  ATH_CHECK( incSvc.retrieve() );
117 
118  // Set up the right callbacks: don't rethrow exceptions, any failure and we should end
119  incSvc->addListener( this, IncidentType::BeginEvent, 0, false );
120  }
121  // Let the base class do its thing:
122  ATH_CHECK( AlgTool::sysInitialize() );
123 
124 #endif // not XAOD_STANDALONE
125 
126  // Return gracefully:
127  return StatusCode::SUCCESS;
128  }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ BUNCH_CONFIG_INCIDENT_NAME

const std::string Trig::BunchCrossingConfProviderBase::BUNCH_CONFIG_INCIDENT_NAME = "BunchConfig"
staticprotectedinherited

Type name for the incident that such tools should emit.

Definition at line 52 of file BunchCrossingConfProviderBase.h.

◆ m_beginInputFileCalled

bool asg::AsgMetadataTool::m_beginInputFileCalled
privateinherited

Flag helping to discover when the tool misses the opening of the first input file.

Definition at line 126 of file AsgMetadataTool.h.

◆ m_bgId

unsigned int Trig::TrigConfBunchCrossingTool::m_bgId
private

DB ID of the BunchGroups settings which was loaded last.

Definition at line 85 of file TrigConfBunchCrossingTool.h.

◆ m_bunchTrains

std::set< Trig::BunchTrain > Trig::BunchCrossingToolBase::m_bunchTrains
protectedinherited

Internal list of bunch trains.

Definition at line 156 of file BunchCrossingToolBase.h.

◆ m_configSvc

ServiceHandle< TrigConf::ILVL1ConfigSvc > Trig::TrigConfBunchCrossingTool::m_configSvc
private

The config service handle.

Definition at line 89 of file TrigConfBunchCrossingTool.h.

◆ m_configTool

ToolHandle< TrigConf::ITrigConfigTool > Trig::TrigConfBunchCrossingTool::m_configTool
private

The config tool handle.

Definition at line 93 of file TrigConfBunchCrossingTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_filledBunches

std::set< Trig::BunchCrossing > Trig::BunchCrossingToolBase::m_filledBunches
protectedinherited

List of colliding bunches.

Definition at line 150 of file BunchCrossingToolBase.h.

◆ m_frontLength

int Trig::BunchCrossingToolBase::m_frontLength
protectedinherited

Length of the "front" of a bunch train.

Definition at line 166 of file BunchCrossingToolBase.h.

◆ m_inputMetaStore

MetaStore_t asg::AsgMetadataTool::m_inputMetaStore
privateinherited

Object accessing the input metadata store.

Definition at line 119 of file AsgMetadataTool.h.

◆ m_maxBunchSpacing

int Trig::BunchCrossingToolBase::m_maxBunchSpacing
protectedinherited

The maximum bunch spacing that the tool should consider.

Definition at line 164 of file BunchCrossingToolBase.h.

◆ m_outputMetaStore

MetaStore_t asg::AsgMetadataTool::m_outputMetaStore
privateinherited

Object accessing the output metadata store.

Definition at line 121 of file AsgMetadataTool.h.

◆ m_singleBunches

std::set< Trig::BunchCrossing > Trig::BunchCrossingToolBase::m_singleBunches
protectedinherited

Internal list of single bunches.

Definition at line 152 of file BunchCrossingToolBase.h.

◆ m_tailLength

int Trig::BunchCrossingToolBase::m_tailLength
protectedinherited

Length of the "tail" of a bunch train.

Definition at line 168 of file BunchCrossingToolBase.h.

◆ m_unpairedBunches

std::set< Trig::BunchCrossing > Trig::BunchCrossingToolBase::m_unpairedBunches
protectedinherited

Internal list of unpaired bunches.

Definition at line 154 of file BunchCrossingToolBase.h.

◆ m_useIncidents

bool asg::AsgMetadataTool::m_useIncidents
privateinherited

Definition at line 128 of file AsgMetadataTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ForwardTracker::beam1
@ beam1
Definition: ForwardTrackerConstants.h:13
asg::AsgMetadataTool::beginEvent
virtual StatusCode beginEvent()
Function called when a new events is loaded.
Definition: AsgMetadataTool.cxx:196
get_generator_info.result
result
Definition: get_generator_info.py:21
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
Trig::TrigConfBunchCrossingTool::m_bgId
unsigned int m_bgId
DB ID of the BunchGroups settings which was loaded last.
Definition: TrigConfBunchCrossingTool.h:85
ForwardTracker::beam2
@ beam2
Definition: ForwardTrackerConstants.h:13
StandaloneBunchgroupHandler.bg
bg
Definition: StandaloneBunchgroupHandler.py:243
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
Trig::BunchCrossing::MAX_BCID
static const int MAX_BCID
The maximum number of bunches that can be in the LHC.
Definition: BunchCrossing.h:50
Trig::IBunchCrossingTool::isBeam1
virtual bool isBeam1(bcid_type bcid=0) const =0
Function deciding if there was a bunch from "beam 1" in this bunch crossing.
Trig::BunchCrossingToolBase::m_singleBunches
std::set< Trig::BunchCrossing > m_singleBunches
Internal list of single bunches.
Definition: BunchCrossingToolBase.h:152
PlotCalibFromCool.dtype
dtype
Definition: PlotCalibFromCool.py:495
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigConf::IILVL1ConfigSvc
Interface for all services/tools that provide LVL1 menu configuration information.
Definition: IILVL1ConfigSvc.h:36
Trig::BunchCrossingToolBase::isInTrain
virtual bool isInTrain(bcid_type bcid) const
Function deciding if a given bunch crossing is in a filled train.
Definition: BunchCrossingToolBase.cxx:42
Trig::distance
int distance(const BunchCrossing bc1, const BunchCrossing bc2)
I need this function only for technical reasons.
Definition: BunchCrossing.cxx:402
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
Trig::IBunchCrossingTool::Tail
@ Tail
The BCID belongs to the last few bunces in a train.
Definition: IBunchCrossingTool.h:152
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
TrigConf::IILVL1ConfigSvc::bunchGroupSet
virtual const BunchGroupSet * bunchGroupSet() const =0
Provides the LVL1 bunch group set.
Trig::BunchCrossingToolBase::bunchSpacing
int bunchSpacing(const std::vector< int > &bunches) const
Get the apparent bunch spacing in the current configuration.
Definition: BunchCrossingToolBase.cxx:1226
Trig::IBunchCrossingTool::Empty
@ Empty
An empty bunch far away from filled bunches.
Definition: IBunchCrossingTool.h:146
asg::AsgMetadataTool::m_beginInputFileCalled
bool m_beginInputFileCalled
Flag helping to discover when the tool misses the opening of the first input file.
Definition: AsgMetadataTool.h:126
asg::AsgMetadataTool::endInputFile
virtual StatusCode endInputFile()
Function called when the currently open input file got completely processed.
Definition: AsgMetadataTool.cxx:188
asg::AsgMetadataTool::m_outputMetaStore
MetaStore_t m_outputMetaStore
Object accessing the output metadata store.
Definition: AsgMetadataTool.h:121
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Trig::IBunchCrossingTool::Single
@ Single
This is a filled, single bunch (not in a train)
Definition: IBunchCrossingTool.h:149
Trig::IBunchCrossingTool::FilledBunches
@ FilledBunches
Distance in units of filled bunches (depends on filling scheme)
Definition: IBunchCrossingTool.h:178
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Trig::BunchCrossingToolBase::isBeam1
virtual bool isBeam1(bcid_type bcid) const
Function deciding if there was a bunch from "beam 1" in this bunch crossing.
Definition: BunchCrossingToolBase.cxx:66
Trig::IBunchCrossingTool::Unpaired
@ Unpaired
This is an unpaired bunch (either beam1 or beam2)
Definition: IBunchCrossingTool.h:153
Trig::BunchCrossingToolBase::m_filledBunches
std::set< Trig::BunchCrossing > m_filledBunches
List of colliding bunches.
Definition: BunchCrossingToolBase.h:150
Trig::BunchCrossingToolBase::m_tailLength
int m_tailLength
Length of the "tail" of a bunch train.
Definition: BunchCrossingToolBase.h:168
Trig::IBunchCrossingConfProvider::configid_type
unsigned int configid_type
Declare the interface that this class provides.
Definition: IBunchCrossingConfProvider.h:60
Trig::IBunchCrossingTool::UnpairedBunch
@ UnpairedBunch
The gap should be calculated wrt. the closest unpaired bunch.
Definition: IBunchCrossingTool.h:278
Trig::IBunchCrossingTool::Crossing
@ Crossing
The returned intensity should describe the BC.
Definition: IBunchCrossingTool.h:121
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
Trig::BunchCrossing::BUNCH_SPACING
static const int BUNCH_SPACING
Minimum spacing between the bunches, in nanoseconds.
Definition: BunchCrossing.h:48
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
Trig::IBunchCrossingTool::UnpairedBeam2
@ UnpairedBeam2
The gap should be calculated wrt.
Definition: IBunchCrossingTool.h:286
Trig::BunchCrossingToolBase::m_bunchTrains
std::set< Trig::BunchTrain > m_bunchTrains
Internal list of bunch trains.
Definition: BunchCrossingToolBase.h:156
Trig::BunchCrossingToolBase::m_unpairedBunches
std::set< Trig::BunchCrossing > m_unpairedBunches
Internal list of unpaired bunches.
Definition: BunchCrossingToolBase.h:154
Trig::IBunchCrossingTool::Beam2
@ Beam2
The returned intensity should be for "beam 2".
Definition: IBunchCrossingTool.h:120
Trig::TrigConfBunchCrossingTool::m_configSvc
ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc
The config service handle.
Definition: TrigConfBunchCrossingTool.h:89
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Trig::IBunchCrossingTool::UnpairedBeam1
@ UnpairedBeam1
The gap should be calculated wrt.
Definition: IBunchCrossingTool.h:283
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Trig::BunchCrossingToolBase::printConfig
void printConfig() const
Function printing the configuration of the tool.
Definition: BunchCrossingToolBase.cxx:1199
lumiFormat.i
int i
Definition: lumiFormat.py:92
Trig::IBunchCrossingTool::isUnpaired
virtual bool isUnpaired(bcid_type bcid=0) const =0
Function deciding if a given bunch crossing has an unpaired bunch.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trig::IBunchCrossingTool::FirstEmpty
@ FirstEmpty
The first empty bunch after a train.
Definition: IBunchCrossingTool.h:147
asg::AsgMetadataTool::beginInputFile
virtual StatusCode beginInputFile()
Function called when a new input file is opened.
Definition: AsgMetadataTool.cxx:180
master.flag
bool flag
Definition: master.py:29
Trig::BunchCrossingConfProviderBase::BUNCH_CONFIG_INCIDENT_NAME
static const std::string BUNCH_CONFIG_INCIDENT_NAME
Type name for the incident that such tools should emit.
Definition: BunchCrossingConfProviderBase.h:52
asg::AsgMetadataTool::metaDataStop
virtual StatusCode metaDataStop()
Function called when the tool should write out its metadata.
Definition: AsgMetadataTool.cxx:204
python.xAODType.dummy
dummy
Definition: xAODType.py:4
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trig::IBunchCrossingTool::CollidingBunch
@ CollidingBunch
The gap should be calculated wrt. the closest colling bunch.
Definition: IBunchCrossingTool.h:276
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
Trig::IBunchCrossingTool::BunchCrossings
@ BunchCrossings
Distance in units of 25 nanoseconds.
Definition: IBunchCrossingTool.h:176
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
Trig::IBunchCrossingTool::Front
@ Front
The BCID belongs to the first few bunches in a train.
Definition: IBunchCrossingTool.h:150
Trig::BunchCrossingToolBase::distanceFromTail
virtual int distanceFromTail(bcid_type bcid, BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the tail of the train.
Definition: BunchCrossingToolBase.cxx:316
Trig::IBunchCrossingTool::isFilled
virtual bool isFilled(bcid_type bcid=0) const =0
The simplest query: Is the bunch crossing filled or not?
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
TrigConf::BunchGroupSet::bunchGroups
const std::vector< BunchGroup > & bunchGroups() const
Definition: BunchGroupSet.h:27
Trig::IBunchCrossingTool::NanoSec
@ NanoSec
Distance in nanoseconds.
Definition: IBunchCrossingTool.h:175
Trig::BunchCrossingToolBase::distanceFromFront
virtual int distanceFromFront(bcid_type bcid, BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
Definition: BunchCrossingToolBase.cxx:239
Trig::IBunchCrossingTool::EmptyBunch
@ EmptyBunch
The gap should be calculated wrt. the closest empty bunch.
Definition: IBunchCrossingTool.h:280
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
asg::AsgMetadataTool::m_inputMetaStore
MetaStore_t m_inputMetaStore
Object accessing the input metadata store.
Definition: AsgMetadataTool.h:119
TrigConf::TrigConfData::id
unsigned int id() const
Definition: TrigConfData.h:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trig::BunchCrossingToolBase::isFilled
virtual bool isFilled(bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Definition: BunchCrossingToolBase.cxx:32
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
Trig::BunchCrossingToolBase::m_maxBunchSpacing
int m_maxBunchSpacing
The maximum bunch spacing that the tool should consider.
Definition: BunchCrossingToolBase.h:164
Trig::IBunchCrossingTool::isBeam2
virtual bool isBeam2(bcid_type bcid=0) const =0
Function deciding if there was a bunch from "beam 2" in this bunch crossing.
Trig::BunchCrossingToolBase::loadUnpairedBunches
StatusCode loadUnpairedBunches(const std::vector< int > &beam1, const std::vector< int > &beam2, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
Interpret the configuration for unpaired bunches.
Definition: BunchCrossingToolBase.cxx:1118
a
TList * a
Definition: liststreamerinfos.cxx:10
Trig::BunchCrossingToolBase::loadSingleBunches
StatusCode loadSingleBunches(const std::vector< int > &bunches, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
Interpret the configuration for single bunches.
Definition: BunchCrossingToolBase.cxx:871
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Trig::TrigConfBunchCrossingTool::loadConfig
StatusCode loadConfig()
Make sure that the latest/correct configuration is loaded.
Definition: TrigConfBunchCrossingTool.cxx:184
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
Trig::BunchCrossingToolBase::isUnpaired
virtual bool isUnpaired(bcid_type bcid) const
Function deciding if a given bunch crossing has an unpaired bunch.
Definition: BunchCrossingToolBase.cxx:56
Trig::IBunchCrossingTool::Beam1
@ Beam1
The returned intensity should be for "beam 1".
Definition: IBunchCrossingTool.h:119
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
Trig::IBunchCrossingTool::MiddleEmpty
@ MiddleEmpty
An empty BCID in the middle of a train.
Definition: IBunchCrossingTool.h:148
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Trig::IBunchCrossingTool::Middle
@ Middle
The BCID belongs to the middle bunches in a train.
Definition: IBunchCrossingTool.h:151
Trig::TrigConfBunchCrossingTool::printBunchGroups
void printBunchGroups(const TrigConf::IILVL1ConfigSvc *svc) const
Print the "raw" configuration for debugging.
Definition: TrigConfBunchCrossingTool.cxx:277
SG::DataProxy
Definition: DataProxy.h:44
Trig::BunchCrossingToolBase::loadBunchTrains
StatusCode loadBunchTrains(const std::vector< int > &bunches, const std::vector< float > &bunch_int1=std::vector< float >(), const std::vector< float > &bunch_int2=std::vector< float >())
Interpret the configuration for bunch trains.
Definition: BunchCrossingToolBase.cxx:987
Trig::TrigConfBunchCrossingTool::m_configTool
ToolHandle< TrigConf::ITrigConfigTool > m_configTool
The config tool handle.
Definition: TrigConfBunchCrossingTool.h:93
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
Trig::BunchCrossingToolBase::m_frontLength
int m_frontLength
Length of the "front" of a bunch train.
Definition: BunchCrossingToolBase.h:166
Trig::BunchCrossingToolBase::isBeam2
virtual bool isBeam2(bcid_type bcid) const
Function deciding if there was a bunch from "beam 2" in this bunch crossing.
Definition: BunchCrossingToolBase.cxx:86
ServiceHandle< IIncidentSvc >
asg::AsgMetadataTool::m_useIncidents
bool m_useIncidents
Definition: AsgMetadataTool.h:128