00001 #ifndef EventNavigator_H
00002 #define EventNavigator_H
00003
00004 #include <map>
00005
00006 #include "GaudiKernel/Kernel.h"
00007 #include "GaudiKernel/StreamBuffer.h"
00008 #include "GaudiKernel/DataObject.h"
00009
00010 #include "EventModel/EventModel.h"
00011
00012
00013 #include "McTruth/McParticle.h"
00014 #include "McTruth/MdcMcHit.h"
00015 #include "McTruth/EmcMcHit.h"
00016 #include "McTruth/TofMcHit.h"
00017 #include "McTruth/MucMcHit.h"
00018
00019
00020 #include "MdcRecEvent/RecMdcTrack.h"
00021 #include "MdcRecEvent/RecMdcKalTrack.h"
00022 #include "MdcRecEvent/RecMdcHit.h"
00023
00024
00025 #include "EmcRecEventModel/RecEmcShower.h"
00026
00027
00028 class RecBTofTrack;
00029 class RecBTofHit;
00030 class RecETofTrack;
00031 class RecETofHit;
00032
00033
00034 class RecMucTrack;
00035 class RecMucHit;
00036
00037
00038 class MdcDigi;
00039
00040 class BesNavigatorInit;
00041
00042
00043
00044 typedef std::multimap <int, int> IndexMap;
00045 typedef std::vector < pair<const Event::McParticle*,int> > McParticleVectorP;
00046 typedef std::vector < pair<const RecMdcTrack*,int> > RecMdcTrackVectorP;
00047 typedef std::vector < pair<const RecMdcKalTrack*,int> > RecMdcKalTrackVectorP;
00048 typedef std::vector < pair<const RecEmcShower*,int> > RecEmcShowerVectorP;
00049 typedef std::vector <const Event::McParticle*> McParticleVector;
00050 typedef std::vector <const RecMdcTrack*> RecMdcTrackVector;
00051 typedef std::vector <const RecMdcKalTrack*> RecMdcKalTrackVector;
00052 typedef std::vector <const Event::MdcMcHit*> MdcMcHitVector;
00053 typedef std::vector <const RecMdcHit*> RecMdcHitVector;
00054 typedef std::vector <const MdcDigi*> MdcDigiVector;
00055 typedef std::vector <const Event::EmcMcHit*> EmcMcHitVector;
00056 typedef std::vector <const RecEmcShower*> RecEmcShowerVector;
00057
00058 static const CLID CLID_EventNavigator = 5101;
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 class EventNavigator : public DataObject {
00073
00074 public:
00075
00076 EventNavigator() : DataObject()
00077 {
00078 m_mdcCut = 7;
00079 }
00080
00081 virtual ~EventNavigator() {}
00082
00084 virtual const CLID& clID() const { return EventNavigator::classID(); }
00085 static const CLID& classID() { return CLID_EventNavigator; }
00086
00087 void Print();
00088
00089
00090
00091 void setMdcCut( int cut ) { m_mdcCut = cut; };
00092
00093
00094 const Event::McParticle* getMcParticle ( int id ) { return m_mcParticleId[id]; };
00095
00096 const RecMdcTrack* getMdcTrack ( int id ) { return m_mdcTrackId[id]; };
00097 const RecMdcKalTrack* getMdcKalTrack ( int id ) { return m_mdcKalTrackId[id]; };
00098
00099
00100 MdcMcHitVector getMdcMcHits ( int id );
00101
00102 const RecMdcHit* getMdcRecHit ( int id ) { return m_mdcRecHitId[id]; };
00103 const MdcDigi* getMdcDigi ( int id ) { return m_mdcDigiId[id]; };
00104
00105 RecEmcShowerVector getEmcRecShowers ( int id );
00106 EmcMcHitVector getEmcMcHits ( int id );
00107
00108
00109 IndexMap& getMcMdcMcHitsIdx(){return m_mcMdcMcHitsIdx;}
00110 IndexMap& getMcMdcTracksIdx(){return m_mcMdcTracksIdx;}
00111 IndexMap& getMcEmcMcHitsIdx(){return m_mcEmcMcHitsIdx;}
00112 IndexMap& getMcEmcRecShowersIdx(){return m_mcEmcRecShowersIdx;}
00113 void setMcMdcMcHitsIdx(IndexMap& map){m_mcMdcMcHitsIdx=map;}
00114 void setMcMdcTracksIdx(IndexMap& map){m_mcMdcTracksIdx=map;}
00115 void setMcEmcMcHitsIdx(IndexMap& map){m_mcEmcMcHitsIdx=map;}
00116 void setMcEmcRecShowersIdx(IndexMap& map){m_mcEmcRecShowersIdx=map;}
00117
00118
00119
00120 McParticleVector& getMcParticles ( const RecMdcTrack* key );
00121 McParticleVector& getMcParticles ( const RecMdcKalTrack* key );
00122 McParticleVector& getMcParticles ( const RecEmcShower* key );
00123
00124 int getMcParticleRelevance( const RecMdcTrack* key, const Event::McParticle* value );
00125 int getMcParticleRelevance( const RecMdcKalTrack* key, const Event::McParticle* value );
00126 int getMcParticleRelevance( const RecEmcShower* key, const Event::McParticle* value );
00127
00128
00129 RecMdcTrackVector& getMdcTracks ( const Event::McParticle* key );
00130 RecMdcKalTrackVector& getMdcKalTracks ( const Event::McParticle* key );
00131
00132
00133 RecEmcShowerVector& getEmcRecShowers ( const Event::McParticle* key );
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 friend class BesNavigatorInit;
00147
00148 protected:
00149
00150
00151 void addIdLink ( int id, Event::McParticle* ptr ) { m_mcParticleId[id] = ptr; };
00152
00153
00154 void addIdLink ( int id, RecMdcTrack* ptr ) {
00155 m_mdcTrackId[id] = ptr;
00156 };
00157
00158 void addIdLink ( int id, RecMdcKalTrack* ptr ) {
00159 m_mdcKalTrackId[id] = ptr;
00160 };
00161
00162 void addIdLink ( unsigned int id, RecEmcShower* ptr ) {
00163 m_emcRecShowerId.insert(pair<int, RecEmcShower*>(id,ptr));
00164 };
00165
00166
00167
00168 void addLink( const Event::McParticle* key, const RecMdcTrack* value );
00169
00170
00171 void addLink( const RecMdcTrack* key, const Event::McParticle* value );
00172
00173
00174 void addLink( const Event::McParticle* key, const RecMdcKalTrack* value );
00175
00176
00177 void addLink( const RecMdcKalTrack* key, const Event::McParticle* value );
00178
00179
00180 void addLink( const RecEmcShower* key, const Event::McParticle* value );
00181
00182
00183 void addLink( const Event::McParticle* key, const RecEmcShower* value );
00184
00185 private:
00186
00187 std::map <int, const Event::McParticle*> m_mcParticleId;
00188
00189
00190 std::map <int, const RecMdcTrack*> m_mdcTrackId;
00191 std::map <int, const RecMdcKalTrack*> m_mdcKalTrackId;
00192 std::map <int, const MdcDigi*> m_mdcDigiId;
00193 std::multimap <unsigned int, const Event::MdcMcHit*> m_mdcMcHitId;
00194 std::map <unsigned int, const RecMdcHit*> m_mdcRecHitId;
00195
00196
00197
00198 std::map <int, RecMdcTrackVector> m_mdcTracksWrtMcParticle;
00199 std::map <int, McParticleVector> m_mcParticlesWrtMdcTrack;
00200 std::map <int, RecMdcKalTrackVector> m_mdcKalTracksWrtMcParticle;
00201 std::map <int, McParticleVector> m_mcParticlesWrtMdcKalTrack;
00202
00203
00204 std::map <int, RecMdcTrackVectorP> m_mdcTracksWrtMcParticleP;
00205 std::map <int, McParticleVectorP> m_mcParticlesWrtMdcTrackP;
00206 std::map <int, RecMdcKalTrackVectorP> m_mdcKalTracksWrtMcParticleP;
00207 std::map <int, McParticleVectorP> m_mcParticlesWrtMdcKalTrackP;
00208
00209
00210 std::multimap <unsigned int, const RecEmcShower*> m_emcRecShowerId;
00211 std::multimap <unsigned int, const Event::EmcMcHit*> m_emcMcHitId;
00212
00213
00214 std::map <int, McParticleVector> m_mcParticlesWrtRecShower;
00215 std::map <int, RecEmcShowerVector> m_emcRecShowersWrtMcHit;
00216 std::map <int, RecEmcShowerVector> m_emcRecShowersWrtMcParticle;
00217 std::map <int, EmcMcHitVector> m_emcMcHitsWrtRecShower;
00218
00219 std::map <int, RecEmcShowerVectorP> m_emcRecShowersWrtMcParticleP;
00220 std::map <int, McParticleVectorP> m_mcParticlesWrtRecEmcShowerP;
00221
00222
00223 IndexMap m_mcMdcTracksIdx;
00224 IndexMap m_mcMdcMcHitsIdx;
00225 IndexMap m_mcEmcRecShowersIdx;
00226 IndexMap m_mcEmcMcHitsIdx;
00227
00228 int m_mdcCut;
00229 };
00230
00231 #endif // EventNavigator_H
00232