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
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 ;
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
00052 virtual void queryParam(int id,double& output) const;
00053 virtual void queryParam(int id,std::string& output) const;
00054
00055
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
00068 std::vector<std::string> m_DetectorElementSearchPath;
00069 std::string m_TouchableToDetelem_name;
00070 std::vector<std::string> m_IdParameterNames;
00071
00072
00073 const G4Step* mCurrentStep;
00074 const G4Track* mCurrentTrack;
00075 const G4StepPoint* mCurrentStepPoint;
00076 ITouchableToDetectorElement* mTouchToDetElem;
00077
00078
00079
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
00098 , kPar_Step_dE
00099 , kPar_Step_dE_Ion
00100 , kPar_Step_qdE
00101 , kPar_Step_dx
00102 , kPar_Step_dt
00103 , kPar_Step_dAngle
00104 , kPar_capTargetZ
00105 , kPar_capTargetA
00106
00107 , kPar_Step_E_weighted_x
00108 , kPar_Step_E_weighted_y
00109 , kPar_Step_E_weighted_z
00110 , kPar_Step_E_weighted_t
00111 , kPar_Step_qE_weighted_x
00112 , kPar_Step_qE_weighted_y
00113 , kPar_Step_qE_weighted_z
00114 , kPar_Step_qE_weighted_t
00115
00116 , kPar_IsStopping
00117 , kPar_IsStarting
00118 , kPar_StepNumber
00119
00120 , kPar_VolumeChanged
00121 , kPar_MaterialChanged
00122
00124
00125 , kPar_START_TRACK
00126 , kPar_t
00127 , kPar_x
00128 , kPar_y
00129 , kPar_z
00130 , kPar_r
00131 , kPar_local_x
00132 , kPar_local_y
00133 , kPar_local_z
00134 , kPar_local_r
00135 , kPar_LogicalVolumeName
00136 , kPar_MaterialName
00137 , kPar_DetectorElement
00138 , kPar_DetectorElementName
00139 , kPar_DetectorElementMatch
00140 , kPar_NicheId
00141 , kPar_DetectorId
00142 , kPar_SiteId
00143 , kPar_Site
00144 , kPar_AD
00145 , kPar_momentum
00146 , kPar_TotEnergy
00147 , kPar_KineticEnergy
00148 , kPar_vx
00149 , kPar_vy
00150 , kPar_vz
00151 , kPar_local_vx
00152 , kPar_local_vy
00153 , kPar_local_vz
00154 , kPar_ProcessType
00155 , kPar_ProcessName
00156
00157 , kPar_Pdg
00158 , kPar_Charge
00159 , kPar_TrackId
00160 , kPar_CreatorPdg
00161 , kPar_AncestorPdg
00162 , kPar_mass
00163 , kPar_ParticleName
00164 , kPar_Prescale
00165 , kPar_CreatorProcessName
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;
00175
00176
00177 double m_BirksConstant1;
00178 double m_BirksConstant2;
00179 };
00180
00181
00182
00183 #endif
00184