00001
00002
00003 #ifndef TRIGBUNCHCROSSINGTOOL_LHCBUNCHCROSSINGTOOL_H
00004 #define TRIGBUNCHCROSSINGTOOL_LHCBUNCHCROSSINGTOOL_H
00005
00006
00007 #include <vector>
00008
00009
00010 #include "GaudiKernel/ServiceHandle.h"
00011 #include "GaudiKernel/IIncidentSvc.h"
00012 #include "AthenaKernel/IIOVDbSvc.h"
00013 #include "AthenaKernel/IOVSvcDefs.h"
00014
00015
00016 #include "TrigBunchCrossingTool/BunchCrossingToolBase.h"
00017 #include "BunchCrossingConfProviderBase.h"
00018
00019
00020 namespace coral {
00021 class AttributeList;
00022 class Blob;
00023 }
00024
00025 namespace Trig {
00026
00046 class LHCBunchCrossingTool : public BunchCrossingToolBase,
00047 public BunchCrossingConfProviderBase {
00048
00049 public:
00051 LHCBunchCrossingTool( const std::string& type, const std::string& name,
00052 const IInterface* parent );
00053
00055 virtual StatusCode initialize();
00056
00058 virtual configid_type configID() const;
00059
00061 virtual std::vector< float > configuredIntensitiesBeam1() const;
00063 virtual std::vector< float > configuredIntensitiesBeam2() const;
00065 virtual std::vector< float > configuredUnpairedIntensitiesBeam1() const;
00067 virtual std::vector< float > configuredUnpairedIntensitiesBeam2() const;
00068
00069 private:
00071 StatusCode update( IOVSVC_CALLBACK_ARGS );
00073 std::vector< int > decodeColliding( const coral::AttributeList& attr );
00075 std::vector< int > decodeUnpaired1( const coral::AttributeList& attr );
00077 std::vector< int > decodeUnpaired2( const coral::AttributeList& attr );
00079 std::vector< float >
00080 decodeCollIntBeam1( const coral::AttributeList& attr ) const;
00082 std::vector< float >
00083 decodeCollIntBeam2( const coral::AttributeList& attr ) const;
00085 std::vector< float >
00086 decodeUnpairedIntBeam1( const coral::AttributeList& attr ) const;
00088 std::vector< float >
00089 decodeUnpairedIntBeam2( const coral::AttributeList& attr ) const;
00090
00092 template< typename TYPE >
00093 std::vector< double > decodeIntV0( const coral::Blob& ints,
00094 const std::vector< bool >& mask,
00095 bool state ) const;
00097 template< typename TYPE >
00098 std::vector< double > decodeIntV1( const coral::Blob& ints,
00099 const std::vector< int >& bcids ) const;
00101 template< typename TYPE >
00102 std::vector< double > decodeIntV2( const coral::Blob& ints,
00103 const std::vector< int >& bcids ) const;
00104
00105 int m_intChannel;
00106
00107 configid_type m_id;
00108 bool m_intValid;
00109
00110 ServiceHandle< IIncidentSvc > m_incidentSvc;
00111 ServiceHandle< IIOVDbSvc > m_iovSvc;
00112
00114 unsigned int m_beam1Bunches;
00116 unsigned int m_beam2Bunches;
00118 unsigned int m_luminousBunches;
00119
00121 std::vector< bool > m_beam1Colliding;
00123 std::vector< bool > m_beam2Colliding;
00124
00126 std::vector< int > m_filledBunches;
00128 std::vector< int > m_unpairedBunches1;
00130 std::vector< int > m_unpairedBunches2;
00132 std::vector< float > m_filledIntBeam1;
00134 std::vector< float > m_filledIntBeam2;
00136 std::vector< float > m_unpairedIntBeam1;
00138 std::vector< float > m_unpairedIntBeam2;
00139
00140 };
00141
00142 }
00143
00144 #endif // TRIGBUNCHCROSSINGTOOL_LHCBUNCHCROSSINGTOOL_H