ATLAS Offline Software
Loading...
Searching...
No Matches
BunchCrossingToolBase.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TRIGBUNCHCROSSINGTOOL_BUNCHCROSSINGTOOLBASE_H
8#define TRIGBUNCHCROSSINGTOOL_BUNCHCROSSINGTOOLBASE_H
9
10// STL include(s):
11#include <set>
12#include <vector>
13#include <string>
14
15// Gaudi/Athena include(s):
17
18// Interface include(s):
20
21// Local include(s):
24
25namespace Trig {
26
42
43 public:
45 BunchCrossingToolBase( const std::string& name = "BunchCrossingToolBase" );
46
49
51 virtual bool isFilled( bcid_type bcid ) const;
52
54 virtual bool isInTrain( bcid_type bcid ) const;
55
57 virtual bool isUnpaired( bcid_type bcid ) const;
58
60 virtual bool isBeam1( bcid_type bcid ) const;
61
63 virtual bool isBeam2( bcid_type bcid ) const;
64
66 virtual float bcIntensity( bcid_type bcid,
67 BeamType type = Crossing ) const;
68
70 virtual BunchCrossingType bcType( bcid_type bcid ) const;
71
73 virtual int distanceFromFront( bcid_type bcid,
76 virtual int distanceFromTail( bcid_type bcid,
78
80 virtual int gapBeforeTrain( bcid_type bcid,
83 virtual int gapAfterTrain( bcid_type bcid,
85
87 virtual int gapBeforeBunch( bcid_type bcid,
89 BunchFillType ftype = CollidingBunch ) const;
91 virtual int gapAfterBunch( bcid_type bcid,
93 BunchFillType ftype = CollidingBunch ) const;
94
96 virtual std::vector< bool > bunchesInFront( bcid_type bcid,
97 int bunches = 10 ) const;
99 virtual std::vector< bool > bunchesAfter( bcid_type bcid = 0,
100 int bunches = 10 ) const;
101
103 virtual std::vector< float > bunchIntInFront( bcid_type bcid,
104 int bunches = 10,
105 BeamType type = Crossing ) const;
107 virtual std::vector< float > bunchIntAfter( bcid_type bcid,
108 int bunches = 10,
109 BeamType type = Crossing ) const;
110
112 virtual unsigned int numberOfFilledBunches() const;
114 virtual unsigned int numberOfUnpairedBunches() const;
116 virtual unsigned int numberOfBunchTrains() const;
118 virtual int bunchTrainSpacing( BunchDistanceType type = NanoSec ) const;
119
121
122 protected:
124 StatusCode loadSingleBunches( const std::vector< int >& bunches,
125 const std::vector< float >& bunch_int1 =
126 std::vector< float >(),
127 const std::vector< float >& bunch_int2 =
128 std::vector< float >() );
130 StatusCode loadBunchTrains( const std::vector< int >& bunches,
131 const std::vector< float >& bunch_int1 =
132 std::vector< float >(),
133 const std::vector< float >& bunch_int2 =
134 std::vector< float >() );
136 StatusCode loadUnpairedBunches( const std::vector< int >& beam1,
137 const std::vector< int >& beam2,
138 const std::vector< float >& bunch_int1 =
139 std::vector< float >(),
140 const std::vector< float >& bunch_int2 =
141 std::vector< float >() );
142
144 void printConfig() const;
145
148
150 std::set< Trig::BunchCrossing > m_filledBunches;
152 std::set< Trig::BunchCrossing > m_singleBunches;
154 std::set< Trig::BunchCrossing > m_unpairedBunches;
156 std::set< Trig::BunchTrain > m_bunchTrains;
157
159
162
169
171
172 private:
174 int bunchSpacing( const std::vector< int >& bunches ) const;
175
176 }; // class BunchCrossingToolBase
177
178} // namespace Trig
179
180#endif // TRIGBUNCHCROSSINGTOOL_BUNCHCROSSINGTOOLBASE_H
virtual BunchCrossingType bcType(bcid_type bcid) const
Get the type of the specific bunch crossing.
virtual bool isBeam1(bcid_type bcid) const
Function deciding if there was a bunch from "beam 1" in this bunch crossing.
std::set< Trig::BunchCrossing > m_singleBunches
Internal list of single bunches.
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.
virtual int gapBeforeBunch(bcid_type bcid, BunchDistanceType dtype=NanoSec, BunchFillType ftype=CollidingBunch) const
Gap before a particular bunch.
virtual std::vector< float > bunchIntInFront(bcid_type bcid, int bunches=10, BeamType type=Crossing) const
Function returning the intensities of the bunch crossings before the reference.
int bunchSpacing(const std::vector< int > &bunches) const
Get the apparent bunch spacing in the current configuration.
virtual unsigned int numberOfUnpairedBunches() const
Get the number of unpaired bunches in the current configuration.
virtual int gapBeforeTrain(bcid_type bcid, BunchDistanceType type=NanoSec) const
Gap before the train this BCID is in.
virtual bool isFilled(bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
virtual std::vector< float > bunchIntAfter(bcid_type bcid, int bunches=10, BeamType type=Crossing) const
Function returning the intensities of the bunch crossings after the reference.
virtual int gapAfterBunch(bcid_type bcid, BunchDistanceType dtype=NanoSec, BunchFillType ftype=CollidingBunch) const
Gap after a particular bunch.
virtual int distanceFromFront(bcid_type bcid, BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
virtual bool isUnpaired(bcid_type bcid) const
Function deciding if a given bunch crossing has an unpaired bunch.
BunchCrossingToolBase(const std::string &name="BunchCrossingToolBase")
Default constructor.
virtual unsigned int numberOfFilledBunches() const
Get the number of filled bunches in the current configuration.
std::set< Trig::BunchCrossing > m_unpairedBunches
Internal list of unpaired bunches.
virtual std::vector< bool > bunchesInFront(bcid_type bcid, int bunches=10) const
Function returning whether the previous bunches were filled, and how.
virtual int distanceFromTail(bcid_type bcid, BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the tail of the train.
virtual float bcIntensity(bcid_type bcid, BeamType type=Crossing) const
Function returning the "intensity" of a given bunch crossing.
virtual bool isBeam2(bcid_type bcid) const
Function deciding if there was a bunch from "beam 2" in this bunch crossing.
virtual unsigned int numberOfBunchTrains() const
Get the number of the bunch trains in the current configuration.
virtual int gapAfterTrain(bcid_type bcid, BunchDistanceType type=NanoSec) const
Gap after the train this BCID is in.
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.
void printConfig() const
Function printing the configuration of the tool.
int m_maxBunchSpacing
The maximum bunch spacing that the tool should consider.
virtual int bunchTrainSpacing(BunchDistanceType type=NanoSec) const
Get the bunch spacing in the trains.
std::set< Trig::BunchCrossing > m_filledBunches
List of colliding bunches.
int m_frontLength
Length of the "front" of a bunch train.
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.
virtual std::vector< bool > bunchesAfter(bcid_type bcid=0, int bunches=10) const
Function returning whether the following bunches were filled, and how.
std::set< Trig::BunchTrain > m_bunchTrains
Internal list of bunch trains.
virtual bool isInTrain(bcid_type bcid) const
Function deciding if a given bunch crossing is in a filled train.
int m_tailLength
Length of the "tail" of a bunch train.
Interface for all the bunch crossing tools.
BunchFillType
Enumeration specifying what kind of bunch to use in the gap functions.
@ CollidingBunch
The gap should be calculated wrt. the closest colling bunch.
unsigned int bcid_type
Declare the interface that this class provides.
BunchDistanceType
Enumeration specifying the units in which to expect the bunch distance type.
@ NanoSec
Distance in nanoseconds.
BunchCrossingType
Simplified type for a given bunch crossing.
BeamType
Types of the return values of the bcIntensity function.
@ Crossing
The returned intensity should describe the BC.
Base class for dual-use tools that provide file metadata access.
The common trigger namespace for trigger analysis tools.