00001 #ifndef EVENT_LCEVENTIMPL_H
00002 #define EVENT_LCEVENTIMPL_H 1
00003
00004 #include <string>
00005 #include <map>
00006 #include <set>
00007 #include "EVENT/LCEvent.h"
00008 #include "EVENT/LCCollection.h"
00009
00010 #include "EVENT/LCIO.h"
00011 #include "LCIOTypes.h"
00012 #include "AccessChecked.h"
00013 #include "LCParametersImpl.h"
00014
00015 namespace IMPL{
00016
00017
00018
00019 typedef std::map<std::string,EVENT::LCCollection*> LCCollectionMap ;
00020 typedef std::set<EVENT::LCCollection*> LCCollectionSet ;
00021
00022
00031 class LCEventImpl : public EVENT::LCEvent, public AccessChecked {
00032
00033 public:
00034 LCEventImpl() ;
00038
00039
00042 virtual ~LCEventImpl() ;
00043
00046 virtual int getRunNumber() const ;
00047
00050 virtual int getEventNumber() const ;
00051
00054 virtual const std::string & getDetectorName() const ;
00055
00058 virtual EVENT::long64 getTimeStamp() const ;
00059
00062 virtual double getWeight() const ;
00063
00066 virtual const std::vector<std::string> * getCollectionNames() const;
00067
00072 virtual EVENT::LCCollection * getCollection(const std::string & name) const
00073 ;
00074
00083 virtual EVENT::LCCollection * takeCollection(const std::string & name) const
00084 ;
00085
00093 virtual void addCollection(EVENT::LCCollection * col, const std::string & name)
00094 ;
00095
00101 virtual void removeCollection(const std::string & name) ;
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00131 virtual const EVENT::LCParameters & getParameters() const { return _params ; }
00132
00135 virtual EVENT::LCParameters & parameters() { return _params ; }
00136
00137
00140 void setRunNumber( int rn ) ;
00141
00144 void setEventNumber( int en ) ;
00145
00148 void setDetectorName(const std::string& dn ) ;
00149
00152 void setTimeStamp(EVENT::long64 ts) ;
00153
00156 void setWeight(double w) ;
00157
00158 protected:
00159 void setAccessMode( int accessMode ) ;
00160
00164 bool validateCollectionName( const char* name ) ;
00165
00166
00167
00168
00169 protected:
00170 int _runNumber ;
00171 int _eventNumber ;
00172 EVENT::long64 _timeStamp ;
00173 std::string _detectorName ;
00174
00175
00176 mutable LCCollectionMap _colMap{} ;
00177 mutable std::vector<std::string> _colNames{} ;
00178
00179 LCParametersImpl _params{} ;
00180
00181
00182 mutable LCCollectionSet _notOwned{} ;
00183
00184
00185 };
00186
00187 }
00188
00189 #endif