10 const int bcidi=
static_cast<int>(bcid);
11 const auto it=std::find_if(
m_trains.begin(),
m_trains.end(),[&bcidi](
const bunchTrain_t& bt){return (bt.m_first<=bcidi && bt.m_last>=bcidi);});
46 const int dist=bcid-bt->
m_first;
58 msg << MSG::ERROR <<
"BunchDistanceType not understood!" <<
endmsg;
71 const int dist=bt->
m_last-bcid;
83 msg << MSG::ERROR <<
"BunchDistanceType not understood!" <<
endmsg;
97 return std::pair<unsigned,unsigned>(0,0);
123 for (
int idx=from;idx<to;++idx) {
Replaces the BunchCrossing AlgTool used in run1/2.
std::pair< unsigned, unsigned > bunchTrainPopulation(const bcid_type bcid) const
Get colliding and total bcids in a train.
std::vector< bunchTrain_t > m_trains
int distanceFromFront(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the front of the train.
static constexpr int m_BUNCH_SPACING
const bunchTrain_t * findTrain(const bcid_type bcid) const
Helper method to find the train of a bcid (nullptr if bcd is not in a train)
std::bitset< m_MAX_BCID > m_beam1
BunchDistanceType
Enumeration specifying the units in which to expect the bunch distance type.
@ BunchCrossings
Distance in units of 25 nanoseconds.
@ FilledBunches
Distance in units of filled bunches (depends on filling scheme)
@ NanoSec
Distance in nanoseconds.
static constexpr int m_MAX_BCID
BunchCrossingType bcType(const bcid_type bcid) const
Convenience function for the type of the specific bunch crossing.
unsigned int numberOfUnpairedBunches() const
Get the number of unpaired bunches in the current configuration.
bool isInTrain(const bcid_type bcid) const
Function deciding if a given bunch crossing is in a filled train.
std::bitset< m_MAX_BCID > m_luminous
int distanceFromTail(const bcid_type bcid, const BunchDistanceType type=NanoSec) const
The distance of the specific bunch crossing from the tail of the train.
int gapBeforeBunch(bcid_type bcid=0, BunchDistanceType type=NanoSec) const
Get the distance of the specified bunch crossing to the preceeding filled bunch.
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
std::bitset< m_MAX_BCID > m_beam2
int gapAfterBunch(bcid_type bcid=0, BunchDistanceType type=NanoSec) const
Get the distance of the specified bunch crossing to the next filled bunch.
bool isUnpaired(const bcid_type bcid) const
Function deciding if a given bunch crossing has an unpaired bunch.
int gapBeforeTrain(bcid_type bcid=0, BunchDistanceType type=NanoSec) const
Gap before the train this BCID is in.
unsigned countColliding(int from, int to) const
Helper method to count colliding bunches in the range from-to.
int gapAfterTrain(bcid_type bcid=0, BunchDistanceType type=NanoSec) const
Gap after the train this BCID is in.
BunchCrossingType
Enumeration type for a given bunch crossing.
@ Unpaired
This is an unpaired bunch (either beam1 or beam2)
@ FirstEmpty
The first empty bunch after 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.
@ Empty
An empty bunch far away from filled bunches.
@ Tail
The BCID belongs to the last few bunces in a train.
@ MiddleEmpty
An empty BCID in the middle of a train.
static const int m_headTailLength
singleton-like access to IMessageSvc via open function and helper
IMessageSvc * getMessageSvc(bool quiet=false)
unsigned m_nColl
Last BCID of this train.
int m_last
First BCID of this train.