00001 //************************************************************************* 00002 //* * 00003 //* class BFieldCutter GenParticle Selector * 00004 //* * 00005 //* Select GenParticles above pt threshold to reach barrel calorimeter * 00006 //* Threshold is determined by the magnetic field and GenParticle charge * 00007 //* * 00008 //************************************************************************* 00009 #ifndef HEPMCHELPER_BFIELDCUTTER_H 00010 #define HEPMCHELPER_BFIELDCUTTER_H 00011 00012 #ifndef HEPMCHELPER_IMCSELECTOR_H 00013 #include "AtlfastUtils/HepMC_helper/IMCselector.h" 00014 #endif 00015 00016 #ifndef ALTFAST_CHARGESERVICE_H 00017 #include "AtlfastEvent/ChargeService.h" 00018 #endif 00019 00020 #ifndef CLHEP_UNITS_SYSTEMOFUNITS_H 00021 #include "CLHEP/Units/SystemOfUnits.h" 00022 #define CLHEP_UNITS_SYSTEMOFUNITS_H 00023 #endif 00024 00025 namespace HepMC_helper{ 00026 00027 class BFieldCutter: public IMCselector { 00028 public: 00029 00030 BFieldCutter(bool fieldOn){ 00031 try{ 00032 m_chargeService = new Atlfast::ChargeService(); 00033 }catch(std::string errMsg){ 00034 throw errMsg; 00035 }catch(...){ 00036 throw; 00037 } 00038 m_ptCut = (fieldOn)? 0.5*GeV:0.0*GeV; 00039 } 00040 00041 IMCselector* create() const; 00042 bool operator()( const Particle* const )const; 00043 bool operator()( const Particle& p ) const; 00044 00045 private: 00046 double m_ptCut; 00047 Atlfast::ChargeService* m_chargeService; 00048 }; 00049 }//namespace 00050 #endif