00001
00002
00003 #ifndef TRIGBUNCHCROSSINGTOOL_D3PDBUNCHCROSSINGTOOL_H
00004 #define TRIGBUNCHCROSSINGTOOL_D3PDBUNCHCROSSINGTOOL_H
00005
00006
00007 #include <string>
00008 #include <map>
00009 #include <vector>
00010
00011
00012 #include <Rtypes.h>
00013
00014
00015 #include "TrigBunchCrossingTool/BunchCrossingToolBase.h"
00016 #include "TrigBunchCrossingTool/BunchConfig.h"
00017
00018
00019 class TTree;
00020
00021 namespace Trig {
00022
00044 class D3PDBunchCrossingTool : public BunchCrossingToolBase {
00045
00047 ASG_TOOL_CLASS( D3PDBunchCrossingTool, Trig::IBunchCrossingTool )
00048
00049 public:
00051 D3PDBunchCrossingTool( const std::string& name =
00052 "D3PDBunchCrossingTool" );
00053
00056
00058 StatusCode cacheConfig( ::TTree* metaTree, bool clearCache = true );
00059
00062 StatusCode loadConfig( UInt_t configID );
00064 bool isAvailable( UInt_t configID ) const;
00065
00067
00070
00072 virtual bool isFilled( bcid_type bcid ) const;
00074 virtual bool isInTrain( bcid_type bcid ) const;
00076 virtual bool isUnpaired( bcid_type bcid ) const;
00078 virtual bool isBeam1( bcid_type bcid ) const;
00080 virtual bool isBeam2( bcid_type bcid ) const;
00082 virtual float bcIntensity( bcid_type bcid,
00083 BeamType type = Crossing ) const;
00085 virtual BunchCrossingType bcType( bcid_type bcid ) const;
00087 virtual std::vector< bool > bunchesInFront( bcid_type bcid,
00088 int bunches = 10 ) const;
00090 virtual std::vector< bool > bunchesAfter( bcid_type bcid,
00091 int bunches = 10 ) const;
00093 virtual std::vector< float > bunchIntInFront( bcid_type bcid,
00094 int bunches = 10,
00095 BeamType type = Crossing ) const;
00097 virtual std::vector< float > bunchIntAfter( bcid_type bcid,
00098 int bunches = 10,
00099 BeamType type = Crossing ) const;
00101 virtual int gapBeforeBunch( bcid_type bcid,
00102 BunchDistanceType dtype = NanoSec,
00103 BunchFillType ftype = CollidingBunch ) const;
00105 virtual int gapAfterBunch( bcid_type bcid,
00106 BunchDistanceType dtype = NanoSec,
00107 BunchFillType ftype = CollidingBunch ) const;
00108
00110 virtual unsigned int numberOfFilledBunches() const;
00111
00113
00114 private:
00116 StatusCode cacheConfigV1( ::TTree* metaTree, bool clearCache );
00118 StatusCode cacheConfigV2( ::TTree* metaTree, bool clearCache );
00119
00123 std::map< UInt_t, Trig::BunchConfig > m_cache;
00124
00126 bool m_configLoaded;
00128 UInt_t m_currentID;
00130 bool m_validConfig;
00131
00132 };
00133
00134 }
00135
00136 #endif // TRIGBUNCHCROSSINGTOOL_D3PDBUNCHCROSSINGTOOL_H