00001
00002
00003 #ifndef TRIGBUNCHCROSSINGTOOL_MCBUNCHCROSSINGTOOL_H
00004 #define TRIGBUNCHCROSSINGTOOL_MCBUNCHCROSSINGTOOL_H
00005
00006
00007 #include "GaudiKernel/ServiceHandle.h"
00008 #include "GaudiKernel/IIncidentSvc.h"
00009 #include "AthenaKernel/IOVSvcDefs.h"
00010
00011
00012 #include "TrigBunchCrossingTool/BunchCrossingToolBase.h"
00013 #include "BunchCrossingConfProviderBase.h"
00014
00015 namespace Trig {
00016
00033 class MCBunchCrossingTool : public BunchCrossingToolBase,
00034 public BunchCrossingConfProviderBase {
00035
00036 public:
00038 MCBunchCrossingTool( const std::string& type, const std::string& name,
00039 const IInterface* parent );
00040
00042 virtual StatusCode initialize();
00043
00045 virtual bool isFilled( bcid_type bcid ) const;
00047 virtual bool isBeam1( bcid_type bcid = 0 ) const;
00049 virtual bool isBeam2( bcid_type bcid = 0 ) const;
00051 virtual float bcIntensity( bcid_type bcid,
00052 BeamType type = Crossing ) const;
00054 virtual BunchCrossingType bcType( bcid_type bcid ) const;
00056 virtual int gapBeforeBunch( bcid_type bcid,
00057 BunchDistanceType dtype = NanoSec,
00058 BunchFillType ftype = CollidingBunch ) const;
00060 virtual int gapAfterBunch( bcid_type bcid,
00061 BunchDistanceType dtype = NanoSec,
00062 BunchFillType ftype = CollidingBunch ) const;
00064 virtual std::vector< bool > bunchesInFront( bcid_type bcid,
00065 int bunches = 10 ) const;
00067 virtual std::vector< bool > bunchesAfter( bcid_type bcid,
00068 int bunches = 10 ) const;
00070 virtual std::vector< float > bunchIntInFront( bcid_type bcid,
00071 int bunches = 10,
00072 BeamType type = Crossing ) const;
00074 virtual std::vector< float > bunchIntAfter( bcid_type bcid,
00075 int bunches = 10,
00076 BeamType type = Crossing ) const;
00077
00079 virtual unsigned int numberOfFilledBunches() const;
00080
00082 virtual configid_type configID() const;
00084 virtual std::vector< int > configuredBCIDs() const;
00086 virtual std::vector< float > configuredIntensitiesBeam1() const;
00088 virtual std::vector< float > configuredIntensitiesBeam2() const;
00089
00090 private:
00092 StatusCode update( IOVSVC_CALLBACK_ARGS );
00094 static std::vector< float > tokenize( const std::string& pattern );
00095
00097 float m_minBunchIntensity;
00098
00100 bool m_isConfigured;
00102 configid_type m_id;
00103
00105 ServiceHandle< IIncidentSvc > m_incidentSvc;
00106
00107 };
00108
00109 }
00110
00111 #endif // TRIGBUNCHCROSSINGTOOL_MCBUNCHCROSSINGTOOL_H