| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

QueriableStepAction.h

Go to the documentation of this file.
00001 #ifndef QUERIABLESTEPACTION_H
00002 #define QUERIABLESTEPACTION_H
00003 
00004 #include "GiGa/GiGaStepActionBase.h"
00005 #include "G4DataHelpers/INeutronCaptureInfo.h"
00006 #include "RuleParser/Queriable.h"
00007 #include "Event/SimProcess.h"
00008 #include <map>
00009 
00010 namespace RuleParser{
00011   class Rule;
00012   class ParameterList;
00013 }
00014 
00015 class ITouchableToDetectorElement;
00016 class IHistoryKeeper;
00017 class IDetectorElement;
00018 class ILVolume;
00019 class IPVolume;
00020 class G4Step;
00021 class G4Track;
00022 class G4StepPoint;
00023 class G4HistoryUserTrackInfo;
00024 
00028 // Inherit from GiGaBase to pick up Services.
00029 
00030 class QueriableStepAction: public RuleParser::Queriable,  public GiGaStepActionBase
00031 {
00032 public:
00033   QueriableStepAction( const std::string& type   , 
00034                      const std::string& name   , 
00035                      const IInterface*  parent ) ;
00036   virtual ~QueriableStepAction() {};
00037   
00038   virtual StatusCode         initialize ();
00039   virtual StatusCode         finalize   ();
00040 
00041   virtual void UserSteppingAction(const G4Step*) =0 ;  // NB This is a mix-in object!
00042 
00045   virtual StatusCode  GetTrackParameterList(RuleParser::ParameterList&);
00046   virtual StatusCode  GetVertexParameterList(RuleParser::ParameterList&);
00047   
00049   void Reset(const G4Step*, const G4Track*, const G4StepPoint*);
00050   
00051   // Things for evaluating selection rules:
00052   virtual void      queryParam(int id,double&      output) const;
00053   virtual void      queryParam(int id,std::string& output) const;
00054 
00055   // Things for above, or for filling the track:
00056   const IDetectorElement*       getDetectorElement()      const;
00057   int                           getDetectorElementMatch() const;
00058   const ILVolume*               getLogicalVolume()        const;
00059   const IPVolume*               getPhysicalVolume()       const;
00060   const DayaBay::SimProcess&    getProcess()              const;
00061   double                        getQuenchedEnergy()       const;
00062   const G4HistoryUserTrackInfo* getUserTrackInfo()        const;
00063   unsigned int                  getDetectorId()            const;
00064   unsigned int                  getDetectorId(const IDetectorElement*) const;
00065   
00066 protected:
00067   // Configuration:
00068   std::vector<std::string> m_DetectorElementSearchPath;
00069   std::string              m_TouchableToDetelem_name;
00070   std::vector<std::string> m_IdParameterNames;
00071     
00072   // This is temporary storage for a single processing call.
00073   const G4Step*                    mCurrentStep;
00074   const G4Track*                   mCurrentTrack;
00075   const G4StepPoint*               mCurrentStepPoint; // Pre or post, depends on what we're doing.
00076   ITouchableToDetectorElement*     mTouchToDetElem;  
00077 
00078   // Things that are difficult to calculate, and are therefore cached in case
00079   // the user references them twice.
00080   mutable const IDetectorElement*  mDetElement;
00081   mutable int                      mDetElementMatch;
00082   mutable const ILVolume*          mLogicVolume;
00083   mutable const IPVolume*          mPhysVolume;
00084   mutable DayaBay::SimProcess      mProcess;
00085   mutable double                   mQuenchedEnergy;
00086   mutable G4HistoryUserTrackInfo*  mUserTrackInfo;
00087   mutable unsigned int             mDetectorId;
00088   typedef std::map<const IDetectorElement*,unsigned int> DetectorIdCache_t;
00089   mutable DetectorIdCache_t        mDetectorIdCache;
00090 
00091 
00092  protected:
00093    enum EParamIds {
00094      kPar_Unknown = 0
00095      , kPar_START_VERTEX
00097      // Applies to end-of-step (Vertex) only
00098      , kPar_Step_dE                    // double
00099      , kPar_Step_dE_Ion                // double
00100      , kPar_Step_qdE                   // double
00101      , kPar_Step_dx                    // double
00102      , kPar_Step_dt                    // double
00103      , kPar_Step_dAngle                // double
00104      , kPar_capTargetZ                 // int
00105      , kPar_capTargetA                 // int | No correct A info. 8/2008 Wei
00106      
00107      , kPar_Step_E_weighted_x          // double
00108      , kPar_Step_E_weighted_y          // double
00109      , kPar_Step_E_weighted_z          // double
00110      , kPar_Step_E_weighted_t          // double
00111      , kPar_Step_qE_weighted_x         // double
00112      , kPar_Step_qE_weighted_y         // double
00113      , kPar_Step_qE_weighted_z         // double
00114      , kPar_Step_qE_weighted_t         // double
00115 
00116      , kPar_IsStopping                 // int
00117      , kPar_IsStarting                 // int
00118      , kPar_StepNumber                 // int
00119 
00120      , kPar_VolumeChanged              // int as bool
00121      , kPar_MaterialChanged            // int as bool
00122 
00124      // Both Vertex and Track:
00125      , kPar_START_TRACK
00126      , kPar_t                          // double   |
00127      , kPar_x                          // double   |
00128      , kPar_y                          // double   |
00129      , kPar_z                          // double   |
00130      , kPar_r                          // double   |
00131      , kPar_local_x                    // double   |
00132      , kPar_local_y                    // double   |
00133      , kPar_local_z                    // double   | all of these guys refer to prepoint for tracks
00134      , kPar_local_r                    // double   | or postpoint for vertices.
00135      , kPar_LogicalVolumeName          // string
00136      , kPar_MaterialName               // string
00137      , kPar_DetectorElement            // custom
00138      , kPar_DetectorElementName        // string           
00139      , kPar_DetectorElementMatch       // int
00140      , kPar_NicheId                    // int
00141      , kPar_DetectorId                 // int
00142      , kPar_SiteId                     // int
00143      , kPar_Site                       // int
00144      , kPar_AD                         // int
00145      , kPar_momentum                   // double   |
00146      , kPar_TotEnergy                  // double   |
00147      , kPar_KineticEnergy              // double   |
00148      , kPar_vx                         // double   |
00149      , kPar_vy                         // double   |
00150      , kPar_vz                         // double   |
00151      , kPar_local_vx                   // double   |
00152      , kPar_local_vy                   // double   |
00153      , kPar_local_vz                   // double   |
00154      , kPar_ProcessType                // int      |
00155      , kPar_ProcessName                // string   |
00156 
00157      , kPar_Pdg                        // int 
00158      , kPar_Charge                    // int
00159      , kPar_TrackId                    // int
00160      , kPar_CreatorPdg                 // int
00161      , kPar_AncestorPdg                // int
00162      , kPar_mass                       // double
00163      , kPar_ParticleName               // string
00164      , kPar_Prescale                   // custom
00165      , kPar_CreatorProcessName         // string
00166      , kPar_END_VERTEX
00167      , kPar_END_QUERIABLE
00168    }; 
00169    
00170   private:
00171     QueriableStepAction (); 
00172     QueriableStepAction           ( const QueriableStepAction& ); 
00173     QueriableStepAction& operator=( const QueriableStepAction& ); 
00174     INeutronCaptureInfo* m_capinfo; // A Gaudi Tool passing n-cap info around
00175     
00176     // Configuration for Birks constant
00177     double  m_BirksConstant1;
00178     double  m_BirksConstant2;
00179 };
00180 
00181 
00182 
00183 #endif /* QUERIABLESTEPACTION_HH */
00184 
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:54:53 2011 for Historian by doxygen 1.4.7