ParticlePropertySvc.h
Go to the documentation of this file.00001
00002
00003
00004
00005 #ifndef PARTICLEPROPERTYSVC_PARTICLEPROPERTYSVC_H
00006 #define PARTICLEPROPERTYSVC_PARTICLEPROPERTYSVC_H
00007
00008
00009
00010
00011
00012 #include <map>
00013 #include <set>
00014
00015
00016
00017 #include "GaudiKernel/Service.h"
00018 #include "GaudiKernel/SvcFactory.h"
00019 #include "GaudiKernel/IParticlePropertySvc.h"
00020
00021 class IFileAccess;
00022
00023
00075 class ParticlePropertySvc: public extends1<Service,IParticlePropertySvc>
00076 {
00077 public:
00078
00079 typedef ParticleProperty* mapped_type;
00080 typedef std::map< int, mapped_type > MapID ;
00081 typedef std::map< std::string, mapped_type > MapName ;
00082 typedef std::map< int, mapped_type > MapStdHepID ;
00083 typedef std::map< int, mapped_type > MapPythiaID ;
00084 typedef IParticlePropertySvc::VectPP VectPP;
00085 typedef IParticlePropertySvc::const_iterator const_iterator;
00086 typedef IParticlePropertySvc::iterator iterator;
00087 typedef std::set<ParticleProperty*> Set ;
00088
00089
00091 virtual StatusCode initialize();
00093 virtual StatusCode finalize();
00106 virtual StatusCode push_back
00107 ( const std::string& particle ,
00108 int geantId ,
00109 int jetsetId ,
00110 double charge ,
00111 double mass ,
00112 double tlife ,
00113 const std::string& evtName ,
00114 int pythiaId ,
00115 double maxWidth ) ;
00121 virtual StatusCode push_back( ParticleProperty* pp );
00123 virtual const_iterator begin() const { return m_vectpp.begin() ; }
00125 virtual const_iterator end () const { return m_vectpp.end() ; }
00127 virtual int size() const { return m_vectpp.size() ; };
00129 virtual ParticleProperty* find( int geantId )
00130 { return m_idmap[ geantId ] ; }
00132 virtual ParticleProperty* find( const std::string& name )
00133 { return m_namemap[ name ] ; }
00135 virtual ParticleProperty* findByStdHepID( int stdHepId )
00136 { return m_stdhepidmap[ stdHepId ] ; }
00138 virtual ParticleProperty* findByPythiaID( int pythiaID )
00139 { return m_pythiaidmap[ pythiaID ]; }
00141 virtual StatusCode erase( int geantId )
00142 { return erase ( find ( geantId ) ) ; }
00144 virtual StatusCode erase( const std::string& name )
00145 { return erase ( find ( name ) ) ; }
00147 virtual StatusCode eraseByStdHepID( int stdHepId )
00148 { return erase( findByStdHepID ( stdHepId ) ) ; }
00153 ParticlePropertySvc
00154 ( const std::string& name , ISvcLocator* svc );
00156 virtual ~ParticlePropertySvc();
00157 protected:
00163 const ParticleProperty* anti
00164 ( const ParticleProperty* pp ) const ;
00169 StatusCode setAntiParticles() ;
00171 StatusCode rebuild() ;
00173 StatusCode erase ( const ParticleProperty* pp ) ;
00175 StatusCode parse ( const std::string& file ) ;
00176
00177 StatusCode parse();
00178
00179 StatusCode addParticles() ;
00180
00181 bool diff
00182 ( const ParticleProperty* o ,
00183 const ParticleProperty* n ,
00184 const MSG::Level l = MSG::DEBUG ) const ;
00185 private:
00186 typedef std::vector<std::string> Files ;
00187 typedef std::vector<std::string> Particles ;
00188
00189 std::string m_filename;
00190 Files m_other ;
00191
00192 Particles m_particles ;
00193
00194 VectPP m_vectpp;
00195 MapID m_idmap;
00196 MapName m_namemap;
00197 MapStdHepID m_stdhepidmap;
00198 MapPythiaID m_pythiaidmap;
00199
00200
00201 Set m_owned ;
00202 std::set<std::string> m_replaced ;
00203
00204 IFileAccess *m_fileAccess;
00205 };
00206
00207
00208
00209
00210 #endif
00211
00212
00213