Commit ae8aa4bd authored by John Derek Chapman's avatar John Derek Chapman Committed by Graeme Stewart
Browse files

src/DigitizationAlg.cxx, src/PileUpToolsAlg.cxx, TestPileUpTool.cxx - use...

src/DigitizationAlg.cxx, src/PileUpToolsAlg.cxx, TestPileUpTool.cxx - use auto& rather than auto in for loops to avoid unnecessary copies. Tagging PileUpComps-00-16-02 (PileUpComps-00-16-02)

	* Tagging PileUpComps-00-16-02
	* src/DigitizationAlg.cxx, src/PileUpToolsAlg.cxx,
	TestPileUpTool.cxx - use auto& rather than auto in for loops to
	avoid unnecessary copies.

2016-08-15  scott snyder  <snyder@bnl.gov>

	* Tagging PileUpComps-00-16-01.
	* Fix clang warnings: missing override keywords.

2016-07-13  John Chapman  <John.Chapman@cern.ch>

	* Tagging PileUpComps-00-16-00
	* src/PileUpEventLoopMgr.cxx (nextEvent): allow for hard-scatter
	EventType to have multiple mc_event_weights. ATLASSIM-2504,
	ATLASSIM-2989. Merging in changes from PileUpComps-00-12-12-02.

2016-07-05  John Chapman  <John.Chapman@cern.ch>

...
(Long ChangeLog diff - truncated)
parent ff22c401
......@@ -11,108 +11,115 @@
#include "UtilityFuncs.h"
#include "ArrayBM.h"
ArrayBM::ArrayBM(const std::string& name,ISvcLocator* svc):
AthService(name,svc),
m_maxBunchCrossingPerOrbit(3564),
m_t0Offset(0),
m_intensityPatternProp(),
m_ipLength(1),
m_intensityPattern(new double[m_ipLength]),
m_biRandom(0),
m_atRndmGenSvc("AtRanluxGenSvc", name),
m_largestElementInPattern(1.0)
ArrayBM::ArrayBM(const std::string& name,ISvcLocator* svc)
: AthService(name,svc)
, m_maxBunchCrossingPerOrbit(3564)
, m_t0Offset(0)
, m_intensityPatternProp()
, m_ipLength(1)
, m_intensityPattern(new double[m_ipLength])
, m_biRandom(nullptr)
, m_atRndmGenSvc("AtRanluxGenSvc", name)
, m_largestElementInPattern(1.0)
{
declareProperty("MaxBunchCrossingPerOrbit", m_maxBunchCrossingPerOrbit, "The number of slots in each LHC beam. Default: 3564.");
declareProperty("IntensityPattern", m_intensityPatternProp,
"An array of floats containing the beam intensity distribution as a function of time in bins of 25ns. ArrayBM normalizes the distribution and uses it as a stencil to determine the relative intensity at each beam xing in the simulated range"
);
declareProperty("RandomSvc", m_atRndmGenSvc, "The random number service that will be used.");
"An array of floats containing the beam intensity distribution as a function of time in bins of 25ns. ArrayBM normalizes the distribution and uses it as a stencil to determine the relative intensity at each beam xing in the simulated range"
);
declareProperty("RandomSvc", m_atRndmGenSvc, "The random number service that will be used.");
m_intensityPattern[0]=1.0;
}
ArrayBM::~ArrayBM() {
delete [] m_intensityPattern;
ArrayBM::~ArrayBM()
{
delete [] m_intensityPattern;
delete m_biRandom;
}
StatusCode
ArrayBM::initialize() {
StatusCode sc(m_atRndmGenSvc.retrieve());
if (sc.isSuccess()) {
const std::vector<float>& rProp(m_intensityPatternProp.value());
std::vector<float>::const_iterator pBegin(rProp.begin());
std::vector<float>::const_iterator pEnd(rProp.end());
m_ipLength = rProp.size();
// Consistency checks
if (m_ipLength>m_maxBunchCrossingPerOrbit)
{
ATH_MSG_ERROR("IntensityPattern length (" << m_ipLength << "), exceeds the maximum number of bunch crossings per orbit (" << m_maxBunchCrossingPerOrbit << ").");
return StatusCode::FAILURE;
}
StatusCode ArrayBM::initialize()
{
ATH_CHECK(m_atRndmGenSvc.retrieve());
const std::vector<float>& rProp(m_intensityPatternProp.value());
std::vector<float>::const_iterator pBegin(rProp.begin());
std::vector<float>::const_iterator pEnd(rProp.end());
m_ipLength = rProp.size();
// Consistency checks
if (m_ipLength>m_maxBunchCrossingPerOrbit)
{
ATH_MSG_ERROR("IntensityPattern length (" << m_ipLength << "), exceeds the maximum number of bunch crossings per orbit (" << m_maxBunchCrossingPerOrbit << ").");
return StatusCode::FAILURE;
}
// Normalise the pattern so that the non-zero elements average to 1.0
float nonZeroElementCount(static_cast<float>(std::count_if(pBegin, pEnd, IsNonZero)));
if(nonZeroElementCount<1.0)
{
ATH_MSG_ERROR("IntensityPattern has no non-zero elements!");
return StatusCode::FAILURE;
}
float elementSum(static_cast<float>(std::accumulate(pBegin, pEnd,0.0)));
float denominator(elementSum/nonZeroElementCount);
// Normalise the pattern so that the non-zero elements average to 1.0
float nonZeroElementCount(static_cast<float>(std::count_if(pBegin, pEnd, IsNonZero)));
if(nonZeroElementCount<1.0)
{
ATH_MSG_ERROR("IntensityPattern has no non-zero elements!");
return StatusCode::FAILURE;
}
float elementSum(static_cast<float>(std::accumulate(pBegin, pEnd,0.0)));
float denominator(elementSum/nonZeroElementCount);
// Normalise the pattern so that the highest element value is 1.0
float maxElement(*(std::max_element(pBegin, pEnd)));
float inv_maxElement = maxElement != 0 ? 1. / maxElement : 1;
// Normalise the pattern so that the highest element value is 1.0
float maxElement(*(std::max_element(pBegin, pEnd)));
float inv_maxElement = maxElement != 0 ? 1. / maxElement : 1;
// Copy normalized intensity pattern from the property
delete [] m_intensityPattern;
m_intensityPattern = new double[m_ipLength];
for (unsigned int i=0; i<m_ipLength; ++i) {
if (rProp[i]<0.0) {
ATH_MSG_ERROR("All IntensityPattern elements must be >=0. Please fix element #" << i );
return StatusCode::FAILURE;
}
// Copy normalized intensity pattern from the property
delete [] m_intensityPattern;
m_intensityPattern = new double[m_ipLength];
for (unsigned int i=0; i<m_ipLength; ++i)
{
if (rProp[i]<0.0)
{
ATH_MSG_ERROR("All IntensityPattern elements must be >=0. Please fix element #" << i );
return StatusCode::FAILURE;
}
m_intensityPattern[i] = rProp[i] * inv_maxElement; // this ensures that the elements are all in the range [0,1]
}
// Will be used to convert values in the m_intensityPattern
// from having max value 1.0 to having mean value 1.0
m_largestElementInPattern = (maxElement/denominator);
// Will be used to convert values in the m_intensityPattern
// from having max value 1.0 to having mean value 1.0
m_largestElementInPattern = (maxElement/denominator);
//FIXME add a check that entry 0 is zero? In data, BCID=1 is always the first filled bunch.
delete m_biRandom;
//the engine is created if not there already
m_biRandom = new CLHEP::RandGeneral(*(m_atRndmGenSvc->GetEngine("BEAMINT")),
m_intensityPattern,
m_ipLength,
/*IntType=*/1); //discrete distribution
} else {
ATH_MSG_ERROR("Can not retrieve random stream");
}
return sc;
//FIXME add a check that entry 0 is zero? In data, BCID=1 is always the first filled bunch.
delete m_biRandom;
//the engine is created if not there already
m_biRandom = new CLHEP::RandGeneral(*(m_atRndmGenSvc->GetEngine("BEAMINT")),
m_intensityPattern,
m_ipLength,
/*IntType=*/1); //discrete distribution
return StatusCode::SUCCESS;
}
void
ArrayBM::selectT0() {
void ArrayBM::selectT0()
{
//m_biRandom->shoot() returns in range [0,1]
m_t0Offset = static_cast<unsigned int>(floor((m_biRandom->shoot() * m_ipLength)+0.5));
assert(m_intensityPattern[m_t0Offset % m_ipLength]>0.0); //just in case
ATH_MSG_DEBUG( "selectT0 offset for this event " << m_t0Offset );
return;
}
StatusCode
ArrayBM::queryInterface(const InterfaceID& riid, void** ppvInterface)
float ArrayBM::normFactor(int iXing) const
{
if ( IBeamIntensity::interfaceID().versionMatch(riid) ) {
*ppvInterface = (IBeamIntensity*)this;
} else {
// Interface is not directly available: try out the base class
return Service::queryInterface(riid, ppvInterface);
}
addRef();
return StatusCode::SUCCESS;
unsigned int index = static_cast<unsigned int>((((iXing + static_cast<int>(m_t0Offset)) % static_cast<int>(m_ipLength)) + static_cast<int>(m_ipLength) ) % static_cast<int>(m_ipLength));
//The array itself has max-value 1.0, but we want it to have mean value 1.0 (for filled bunch crossings), so we multiple by the m_largestElementInPattern.
ATH_MSG_VERBOSE("normFactor for BCID " << iXing
<< " (offset " << m_t0Offset
<< " index " << index
<< ") is = " << m_largestElementInPattern*m_intensityPattern[ index ]);
return m_largestElementInPattern*m_intensityPattern[ index ];
}
StatusCode ArrayBM::queryInterface(const InterfaceID& riid, void** ppvInterface)
{
if ( IBeamIntensity::interfaceID().versionMatch(riid) )
{
*ppvInterface = (IBeamIntensity*)this;
addRef();
return StatusCode::SUCCESS;
}
// Interface is not directly available: try out the base class
return AthService::queryInterface(riid, ppvInterface);
}
......@@ -8,43 +8,45 @@
#define PILEUPCOMPS_ARRAYBM 1
/** @file ArrayBM.h
* @brief A IBeamIntensity service configured with an intensity array
* The FloatArrayProperty describes the intensity pattern that is
* The FloatArrayProperty describes the intensity pattern that is
* repeated for the entire beam xing range.
*
* $Id: BkgStreamsCache.h,v 1.10 2008-08-28 01:11:06 calaf Exp $
* @author Paolo Calafiura - ATLAS Collaboration
*/
#include "PileUpTools/IBeamIntensity.h"
#include "AthenaBaseComps/AthService.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/Property.h"
template <class TYPE> class SvcFactory;
#include "PileUpTools/IBeamIntensity.h"
#include "AthenaBaseComps/AthService.h"
class IAtRndmGenSvc;
namespace CLHEP {
namespace CLHEP
{
class RandGeneral;
}
class ArrayBM : virtual public IBeamIntensity, public AthService {
class ArrayBM : virtual public IBeamIntensity, public AthService
{
public:
virtual ~ArrayBM();
virtual void selectT0();
virtual unsigned int getCurrentT0BunchCrossing() const { return m_t0Offset; }
virtual unsigned int getBeamPatternLength() const { return m_ipLength; }
virtual float largestElementInPattern() const { return m_largestElementInPattern; }
virtual float normFactor(int iXing) const {
unsigned int index = static_cast<unsigned int>((((iXing + static_cast<int>(m_t0Offset)) % static_cast<int>(m_ipLength)) + static_cast<int>(m_ipLength) ) % static_cast<int>(m_ipLength));
//The array itself has max-value 1.0, but we want it to have mean value 1.0 (for filled bunch crossings), so we multiple by the m_largestElementInPattern.
ATH_MSG_VERBOSE("normFactor for BCID " << iXing
<< " (offset " << m_t0Offset
<< " index " << index
<< ") is = " << m_largestElementInPattern*m_intensityPattern[ index ]);
return m_largestElementInPattern*m_intensityPattern[ index ];
}
virtual StatusCode initialize();
virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface );
protected:
friend class SvcFactory<ArrayBM>;
/// \name Constructor and Destructor
//@{
ArrayBM(const std::string& name,ISvcLocator* svc);
virtual ~ArrayBM();
//@}
/// \name AthService methods
//@{
virtual StatusCode initialize() override final;
virtual StatusCode queryInterface( const InterfaceID& riid, void** ppvInterface ) override final;
//@}
/// \name IBeamIntensity methods
//@{
virtual float normFactor(int iXing) const override final;
virtual float largestElementInPattern() const override final { return m_largestElementInPattern; }
virtual void selectT0() override final;
virtual unsigned int getCurrentT0BunchCrossing() const override final { return m_t0Offset; }
virtual unsigned int getBeamPatternLength() const override final { return m_ipLength; }
//@}
private:
/// max bunch crossings per orbit
unsigned int m_maxBunchCrossingPerOrbit;
......@@ -67,4 +69,3 @@ private:
float m_largestElementInPattern;
};
#endif
This diff is collapsed.
......@@ -21,7 +21,6 @@
#include "PileUpTools/PileUpStream.h"
#include "PileUpTools/IBkgStreamsCache.h"
#include "EventInfo/PileUpTimeEventIndex.h" /* needed for PileUpType */
#include "AthenaKernel/MsgStreamMember.h"
class ActiveStoreSvc;
class EventInfo;
......@@ -38,52 +37,52 @@ namespace CLHEP {
/** @class BkgStreamsCache
* @brief In-memory cache for pileup events
*/
class BkgStreamsCache :
virtual public IBkgStreamsCache,
virtual public AthAlgTool
class BkgStreamsCache :
virtual public IBkgStreamsCache,
virtual public AthAlgTool
{
public:
BkgStreamsCache( const std::string&, const std::string&, const IInterface*);
virtual ~BkgStreamsCache();
virtual StatusCode initialize();
virtual StatusCode finalize();
/**
@param nXings bunch Xings to be processed
@param firstStore id of first store in cache
virtual StatusCode initialize() override final;
virtual StatusCode finalize() override final;
/**
@param nXings bunch Xings to be processed
@param firstStore id of first store in cache
*/
virtual StatusCode setup(int firstXing,
unsigned int nXings,
unsigned int firstStore,
IBeamIntensity*);
unsigned int nXings,
unsigned int firstStore,
IBeamIntensity*) override final;
/// inform cache that we start overlaying a new event
virtual void newEvent();
/// reset scale factor at new run/lumiblk
virtual void resetEvtsPerXingScaleFactor(float sf);
virtual void newEvent() override final;
/// reset scale factor at new run/lumiblk
virtual void resetEvtsPerXingScaleFactor(float sf) override final;
/**
@brief Read input events in bkg stores and link them to overlay store
@param iXing offset to first xing number (=0 first Xing, =nXings for last xing)
@param overlaidEvent reference to resulting overlaid event
@param t0BinCenter time wrto t0 of current bin center in ns
@param t0BinCenter time wrto t0 of current bin center in ns
*/
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overlaidEvent,
int t0BinCenter);
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overlaidEvent,
int t0BinCenter) override final;
/**
@brief Read input events in bkg stores and link them to overlay store
@param iXing offset to first xing number (=0 first Xing, =nXings for last xing)
@param overlaidEvent reference to resulting overlaid event
@param t0BinCenter time wrto t0 of current bin center in ns
@param loadEventProxies should we load the event proxies or not.
@param t0BinCenter time wrto t0 of current bin center in ns
@param loadEventProxies should we load the event proxies or not.
@param BCID bunch-crossing ID of signal bunch crossing
*/
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overEvent,
int t0BinCenter, bool loadEventProxies, unsigned int /*BCID*/);
PileUpEventInfo& overEvent,
int t0BinCenter, bool loadEventProxies, unsigned int /*BCID*/) override final;
/// how many stores in this cache
virtual unsigned int nStores() const { return m_nStores; }
virtual unsigned int nStores() const override final { return m_nStores; }
virtual StatusCode queryInterface(const InterfaceID&, void**);
virtual StatusCode queryInterface(const InterfaceID&, void**) override final;
/// meant to be used (mainly) via m_f_collDistr
long collXing() { return m_collXing; }
......@@ -102,7 +101,7 @@ private:
unsigned int setNEvtsXing(unsigned int iXing);
unsigned int nEvtsXing(unsigned int iXing) const;
typedef std::vector<PileUpStream> StreamVector;
bool alreadyInUse(StreamVector::size_type iStream);
ActiveStoreSvc* p_activeStore;
......@@ -150,7 +149,7 @@ private:
/// function returning the number of bkg events per bunch crossing
/// after bunch structure modulation
boost::function1< unsigned int, unsigned int > m_f_numberOfBackgroundForBunchCrossing;
/// float scaling number of collisions per bunch crossing
/// float scaling number of collisions per bunch crossing
float m_collXingSF;
/// bool apply scaling number of collisions per bunch crossing ?
BooleanProperty m_ignoreSF;
......@@ -160,7 +159,7 @@ private:
IBeamIntensity* m_beamInt;
/// Force events used in the central bunch crossing to be refreshed
BooleanProperty m_forceReadForBC0;
};
#endif // PILEUPTOOLS_BKGSTREAMSCACHE_H
......@@ -40,52 +40,52 @@ namespace CLHEP {
/** @class BkgStreamsStepCache
* @brief In-memory cache for pileup events
*/
class BkgStreamsStepCache :
virtual public IBkgStreamsCache,
virtual public AthAlgTool
class BkgStreamsStepCache :
virtual public IBkgStreamsCache,
virtual public AthAlgTool
{
public:
BkgStreamsStepCache( const std::string&, const std::string&, const IInterface*);
virtual ~BkgStreamsStepCache();
virtual StatusCode initialize();
virtual StatusCode finalize();
/**
virtual StatusCode initialize() override final;
virtual StatusCode finalize() override final;
/**
@param nXings bunch Xings to be processed
@param firstStore id of first store in cache
@param firstStore id of first store in cache
*/
virtual StatusCode setup(int firstXing,
unsigned int nXings,
unsigned int firstStore,
IBeamIntensity*);
unsigned int nXings,
unsigned int firstStore,
IBeamIntensity*) override final;
/// inform cache that we start overlaying a new event
virtual void newEvent();
/// reset scale factor at new run/lumiblk
virtual void resetEvtsPerXingScaleFactor(float sf);
virtual void newEvent() override final;
/// reset scale factor at new run/lumiblk
virtual void resetEvtsPerXingScaleFactor(float sf) override final;
/**
@brief Read input events in bkg stores and link them to overlay store
@param iXing offset to first xing number (=0 first Xing, =nXings for last xing)
@param overlaidEvent reference to resulting overlaid event
@param t0BinCenter time wrto t0 of current bin center in ns
@param t0BinCenter time wrto t0 of current bin center in ns
*/
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overlaidEvent,
int t0BinCenter);
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overlaidEvent,
int t0BinCenter) override final;
/**
@brief Read input events in bkg stores and link them to overlay store
@param iXing offset to first xing number (=0 first Xing, =nXings for last xing)
@param overlaidEvent reference to resulting overlaid event
@param t0BinCenter time wrto t0 of current bin center in ns
@param t0BinCenter time wrto t0 of current bin center in ns
@param BCID bunch-crossing ID of signal bunch crossing
@param loadEventProxies should we load the event proxies or not.
@param loadEventProxies should we load the event proxies or not.
*/
virtual StatusCode addSubEvts(unsigned int iXing,
PileUpEventInfo& overEvent,
int t0BinCenter, bool loadEventProxies, unsigned int /*BCID*/);
PileUpEventInfo& overEvent,
int t0BinCenter, bool loadEventProxies, unsigned int /*BCID*/) override final;
/// how many stores in cache
virtual unsigned int nStores() const { return m_nStores; }
virtual unsigned int nStores() const override final { return m_nStores; }
virtual StatusCode queryInterface(const InterfaceID&, void**);
virtual StatusCode queryInterface(const InterfaceID&, void**) override final;
/// meant to be used (mainly) via f_collDistr
long collXing() { return m_collXing; }
......@@ -102,11 +102,11 @@ private:
/// get current (last asked) stream
PileUpStream* current();
/// apply m_beamInt normalization to random number of events
//unsigned int normEventsXing(unsigned int iXing) const;
//unsigned int normEventsXing(unsigned int iXing) const;
unsigned int setNEvtsXing(unsigned int iXing);
unsigned int nEvtsXing(unsigned int iXing) const;
typedef std::vector<PileUpStream> StreamVector;
bool alreadyInUse(StreamVector::size_type iStream);
ActiveStoreSvc* p_activeStore;
......@@ -114,7 +114,7 @@ private:
StreamVector m_streams;
std::vector<bool> m_usedStreams;
std::deque<StreamVector::size_type> m_streamUseOrder; //holds order in which events should be loaded
//we use a deque to easily pop early events off the front, pushing new events on to the back
//we use a deque to easily pop early events off the front, pushing new events on to the back
std::deque<StreamVector::size_type>::iterator m_useCursor; //will use to know which event to load next
bool m_firstEvent; //For very first event of job we need to setup a full set of event counts
unsigned int m_currentXing; //the xing of the current event being simulated
......@@ -160,7 +160,7 @@ private:
/// function returning the number of bkg events per bunch crossing
/// after bunch structure modulation
boost::function1< unsigned int, unsigned int > m_f_numberOfBackgroundForBunchCrossing;
/// float scaling number of collisions/xing
/// float scaling number of collisions/xing
float m_collXingSF;
/// bool apply scaling number of collisions/xing ?
BooleanProperty m_ignoreSF;
......@@ -171,4 +171,3 @@ private:
};
#endif // PILEUPTOOLS_BKGSTREAMSCACHE_H
......@@ -8,47 +8,42 @@
/////////////////////////////////////////////////////////////////////////////
DigitizationAlg::DigitizationAlg(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm(name, pSvcLocator), m_puTools()
DigitizationAlg::DigitizationAlg(const std::string& name, ISvcLocator* pSvcLocator)
: AthAlgorithm(name, pSvcLocator)
, m_puTools(/*this*/) // TODO make the PileUpTools private
{
declareProperty("PileUpTools", m_puTools, "IPileUpTools to be run for each event");
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode DigitizationAlg::initialize(){
StatusCode DigitizationAlg::initialize()
{
ATH_MSG_DEBUG ( "Initializing " << name() << " - package version " << PACKAGE_VERSION );
StatusCode sc(StatusCode::FAILURE);
//locate the PileupTools and initialize them
if (!(sc=m_puTools.retrieve()).isSuccess()) {
ATH_MSG_ERROR ("Could not retrieve PileUpTools");
}
return sc;
ATH_CHECK(m_puTools.retrieve());
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
StatusCode DigitizationAlg::execute() {
StatusCode DigitizationAlg::execute()
{
ATH_MSG_DEBUG ("in execute()");
ToolHandleArray<IPileUpTool>::iterator iPUT(m_puTools.begin());
ToolHandleArray<IPileUpTool>::iterator ePUT(m_puTools.end());
StatusCode sc(StatusCode::SUCCESS);
while (sc.isSuccess() && (iPUT != ePUT)) {
IPileUpTool& put(**iPUT);
ATH_MSG_VERBOSE( "Running IPileUpTool " << put.name() );
put.resetFilter(); // Reset the filter first
sc=put.processAllSubEvents();
++iPUT;
if (!put.filterPassed()){
ATH_MSG_VERBOSE( "Filter " << put.name() << " failed - will stop the event" );
this->setFilterPassed(false);
break;
for(auto& puToolHandle : m_puTools)
{
// Reset the filter first
puToolHandle->resetFilter();
ATH_CHECK(puToolHandle->processAllSubEvents());
// Check if the event was filtered out by the current PileUpTool.
if (!puToolHandle->filterPassed())
{
ATH_MSG_VERBOSE( "Filter " << puToolHandle->name() << " failed - will stop the event" );
this->setFilterPassed(false);
break;
}
}
}
return sc;
return StatusCode::SUCCESS;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
......
......@@ -9,37 +9,38 @@
#include "UtilityFuncs.h"
#include "FixedArrayBM.h"
FixedArrayBM::FixedArrayBM(const std::string& name,ISvcLocator* svc):
AthService(name,svc),
m_maxBunchCrossingPerOrbit(3564),
m_t0Offset(0),
m_allowEmptyT0BunchCrossing(false),
m_intensityPatternProp(),
m_ipLength(1),
m_intensityPattern(new double[m_ipLength]),
m_largestElementInPattern(1.0)
FixedArrayBM::FixedArrayBM(const std::string& name,ISvcLocator* svc)
: AthService(name,svc)
, m_maxBunchCrossingPerOrbit(3564)
, m_t0Offset(0)
, m_allowEmptyT0BunchCrossing(false)
, m_intensityPatternProp()
, m_ipLength(1)
, m_intensityPattern(new double[m_ipLength])
, m_largestElementInPattern(1.0)
{
declareProperty("MaxBunchCrossingPerOrbit", m_maxBunchCrossingPerOrbit, "The number of slots in each LHC beam. Default: 3564.");
declareProperty("T0Offset", m_t0Offset, "Offset of the T0 w.r.t. our intensity pattern" );
declareProperty("AllowEmptyT0BunchCrossing", m_allowEmptyT0BunchCrossing, "Allow the offset of the T0 to sit in an empty bunch crossing." );
declareProperty("IntensityPattern", m_intensityPatternProp,
"An array of floats containing the beam intensity distribution as a function of time in bins of 25ns. FixedArrayBM normalizes the distribution and uses it as a stencil to determine the relative intensity at each beam xing in the simulated range"