00001
00002
00003 #ifndef XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H
00004 #define XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H
00005
00006
00007 extern "C" {
00008 # include <stdint.h>
00009 }
00010 #include <set>
00011 #include <vector>
00012 #include <string>
00013 #include <iosfwd>
00014
00015
00016 #include "AthContainers/AuxElement.h"
00017 #include "AthContainers/DataVector.h"
00018 #include "AthLinks/ElementLink.h"
00019
00020
00021 class StoreGateSvc;
00022
00024 namespace xAOD {
00025
00026
00027 class EventInfo_v1;
00028 typedef DataVector< EventInfo_v1 > EventInfoContainer_v1;
00029
00042 class EventInfo_v1 : public SG::AuxElement {
00043
00044 public:
00046 EventInfo_v1();
00047
00050
00052 uint32_t runNumber() const;
00054 void setRunNumber( uint32_t value );
00055
00057 unsigned long long eventNumber() const;
00059 void setEventNumber( unsigned long long value );
00060
00062 uint32_t lumiBlock() const;
00064 void setLumiBlock( uint32_t value );
00065
00067 uint32_t timeStamp() const;
00069 void setTimeStamp( uint32_t value );
00070
00072 uint32_t timeStampNSOffset() const;
00074 void setTimeStampNSOffset( uint32_t value );
00075
00077 uint32_t bcid() const;
00079 void setBCID( uint32_t value );
00080
00082 uint32_t detectorMask0() const;
00084 void setDetectorMask0( uint32_t value );
00086 uint32_t detectorMask1() const;
00088 void setDetectorMask1( uint32_t value );
00090 uint32_t detectorMask2() const;
00092 void setDetectorMask2( uint32_t value );
00094 uint32_t detectorMask3() const;
00096 void setDetectorMask3( uint32_t value );
00097
00099 uint64_t detectorMask() const;
00101 void setDetectorMask( uint32_t mask0, uint32_t mask1 );
00103 void setDetectorMask( uint64_t mask );
00105 uint64_t detectorMaskExt() const;
00107 void setDetectorMaskExt( uint32_t mask2, uint32_t mask3 );
00109 void setDetectorMaskExt( uint64_t mask );
00110
00112
00115
00117 typedef std::vector< std::pair< std::string, std::string > >
00118 DetDescrTags_t;
00119
00121 const DetDescrTags_t& detDescrTags() const;
00123 void setDetDescrTags( const DetDescrTags_t& value );
00124
00126 uint32_t mcChannelNumber() const;
00128 void setMCChannelNumber( uint32_t value );
00129
00131 unsigned long long mcEventNumber() const;
00133 void setMCEventNumber( unsigned long long value );
00134
00136 const std::vector< float >& mcEventWeights() const;
00138 void setMCEventWeights( const std::vector< float >& value );
00140 float mcEventWeight( size_t i = 0 ) const;
00141
00143 enum EventType {
00145 IS_SIMULATION = 1,
00147 IS_TESTBEAM = 2,
00149 IS_CALIBRATION = 4
00150 };
00151
00153 uint32_t eventTypeBitmask() const;
00155 void setEventTypeBitmask( uint32_t value );
00157 bool eventType( EventType type ) const;
00158
00160
00163
00165 uint32_t statusElement() const;
00167 void setStatusElement( uint32_t value );
00168
00170 uint32_t extendedLevel1ID() const;
00172 void setExtendedLevel1ID( uint32_t value );
00173
00175 uint16_t level1TriggerType() const;
00177 void setLevel1TriggerType( uint16_t value );
00178
00184 class StreamTag {
00185
00186 public:
00188 StreamTag( const std::string& name, const std::string& type,
00189 bool obeysLumiblock,
00190 const std::set< uint32_t >& robs = std::set< uint32_t >(),
00191 const std::set< uint32_t >& dets = std::set< uint32_t >() );
00192
00194 const std::string& name() const;
00196 const std::string& type() const;
00198 bool obeysLumiblock() const;
00200 const std::set< uint32_t >& robs() const;
00202 const std::set< uint32_t >& dets() const;
00203
00204 private:
00205 std::string m_name;
00206 std::string m_type;
00207
00208 bool m_obeysLumiblock;
00209 std::set< uint32_t > m_robs;
00210 std::set< uint32_t > m_dets;
00211
00212 };
00213
00215 const std::vector< StreamTag >& streamTags() const;
00217 void setStreamTags( const std::vector< StreamTag >& value );
00218
00220
00223
00226 float actualInteractionsPerCrossing() const;
00228 void setActualInteractionsPerCrossing( float value );
00229
00232 float averageInteractionsPerCrossing() const;
00234 void setAverageInteractionsPerCrossing( float value );
00235
00237 enum PileUpType {
00238 Unknown = 99,
00239 Signal = 0,
00240 MinimumBias = 1,
00241 Cavern = 2,
00242 HaloGas = 3,
00243 ZeroBias = 4
00244 };
00245
00251 class SubEvent {
00252
00253 public:
00255 SubEvent( uint16_t time, PileUpType type,
00256 const ElementLink< EventInfoContainer_v1 >& link );
00257
00259 uint16_t time() const;
00261 PileUpType type() const;
00263 const std::string& typeName() const;
00264
00266 const ElementLink< EventInfoContainer_v1 >& link() const;
00268 const EventInfo_v1* ptr() const;
00269
00270 private:
00271 uint16_t m_time;
00272 PileUpType m_type;
00273
00274 ElementLink< EventInfoContainer_v1 > m_link;
00275
00276 };
00277
00279 const std::vector< SubEvent >& subEvents() const;
00281 void setSubEvents( const std::vector< SubEvent >& value );
00282
00284
00287
00289 enum EventFlagSubDet {
00290 Pixel = 0,
00291 SCT = 1,
00292 TRT = 2,
00293 LAr = 3,
00294 Tile = 4,
00295 Muon = 5,
00296 ForwardDet = 6,
00297 Core = 7,
00298 Background = 8,
00299 Lumi = 9,
00300 nDets = 10
00301 };
00302
00304 enum EventFlagErrorState {
00305 NotSet = 0,
00306 Warning = 1,
00307 Error = 2
00308 };
00309
00311 enum BackgroundEventFlag {
00312 MBTSTimeDiffHalo = 0,
00313 MBTSTimeDiffCol = 1,
00314 LArECTimeDiffHalo = 2,
00315 LArECTimeDiffCol = 3,
00316 PixMultiplicityHuge = 4,
00317 PixSPNonEmpty = 5,
00318 SCTMultiplicityHuge = 6,
00319 SCTSPNonEmpty = 7,
00320 CSCTimeDiffHalo = 8,
00321 CSCTimeDiffCol = 9,
00322 BCMTimeDiffHalo = 10,
00323 BCMTimeDiffCol = 11,
00324 MuonTimingCol = 12,
00325 MuonTimingCosmic = 13,
00326 MBTSBeamVeto = 14,
00327 BCMBeamVeto = 15,
00328 LUCIDBeamVeto = 16,
00329 HaloMuonSegment = 17,
00330 HaloClusterShape = 18,
00331 HaloMuonOneSided = 19,
00332 HaloMuonTwoSided = 20,
00333 HaloTileClusterPattern = 21,
00334 BeamGasPixel = 22,
00335 CosmicStandAlone = 23,
00336 CosmicStandAloneTight = 24,
00337 CosmicCombined = 25,
00338 CosmicCombinedTight = 26,
00339 BkgdResvBit1 = 27,
00340 BkgdResvBit2 = 28,
00341 BkgdResvBit3 = 29,
00342 BkgdResvBit4 = 30,
00343 BkgdResvBit5 = 31,
00344 NBackgroundWords = 32
00345 };
00346
00348 uint32_t eventFlags( EventFlagSubDet subDet ) const;
00350 bool isEventFlagBitSet( EventFlagSubDet subDet, size_t bit ) const;
00351
00353 bool setEventFlags( EventFlagSubDet subDet, uint32_t flags );
00355 bool setEventFlagBit( EventFlagSubDet subDet, size_t bit,
00356 bool set = true );
00357
00359 EventFlagErrorState errorState( EventFlagSubDet subDet ) const;
00361 bool setErrorState( EventFlagSubDet subDet,
00362 EventFlagErrorState state );
00363
00365
00368
00370 float beamPosX() const;
00372 float beamPosY() const;
00374 float beamPosZ() const;
00376 void setBeamPos( float x, float y, float z );
00377
00379 float beamPosSigmaX() const;
00381 float beamPosSigmaY() const;
00383 float beamPosSigmaZ() const;
00385 void setBeamPosSigma( float x, float y, float z );
00386
00388 float beamPosSigmaXY() const;
00390 void setBeamPosSigmaXY( float value );
00391
00393 float beamTiltXZ() const;
00395 void setBeamTiltXZ( float value );
00396
00398 float beamTiltYZ() const;
00400 void setBeamTiltYZ( float value );
00401
00403 uint32_t beamStatus() const;
00405 void setBeamStatus( uint32_t value );
00406
00408
00411
00412 #if not defined(__GCCXML__) and not defined(__ROOTCLING__)
00414 StoreGateSvc* evtStore() const;
00416 void setEvtStore( StoreGateSvc* svc );
00417 #endif // not genreflex or rootcint/rootcling
00418
00420
00422 void toPersistent();
00424 void toTransient();
00425
00426 private:
00428 mutable std::vector< StreamTag > m_streamTags;
00430 mutable bool m_updateStreamTags;
00432 mutable std::vector< SubEvent > m_subEvents;
00434 mutable bool m_updateSubEvents;
00435
00436 #ifndef __GCCXML__
00439 StoreGateSvc* m_evtStore;
00440 #endif // not __GCCXML__
00441
00442 };
00443
00445 std::ostream& operator<< ( std::ostream& out, const xAOD::EventInfo_v1& ei );
00446
00447 }
00448
00449
00450 #include "xAODCore/BaseInfo.h"
00451 SG_BASE( xAOD::EventInfo_v1, SG::AuxElement );
00452
00453 #endif // XAODEVENTINFO_VERSIONS_EVENTINFO_V1_H