00001 //---------------------------------------------------------------------------// 00002 //Description: Deal with persistency 00003 //Author: Wu Chen(wuchen@mail.ihep.ac.cn) 00004 //Created: 17 Oct, 2012 00005 //Comment: 00006 //---------------------------------------------------------------------------// 00007 00008 #ifndef MyAnalysisSvc_h 00009 #define MyAnalysisSvc_h 1 00010 00011 #include "myglobals.hh" 00012 00013 class G4Step; 00014 class G4Event; 00015 class G4Track; 00016 class G4Run; 00017 00018 class MyAnalysisSvcMessenger; 00019 class MyRoot; 00020 class EventHeaderSvc; 00021 class MyDetectorManager; 00022 class McTruthSvc; 00023 class ProcessCountingSvc; 00024 class MyTriggerSvc; 00025 class PrimaryGeneratorAction; 00026 class MyProcessManager; 00027 00028 class MyAnalysisSvc 00029 { 00030 public: 00031 MyAnalysisSvc(); 00032 virtual ~MyAnalysisSvc(); 00033 00034 static MyAnalysisSvc* GetMyAnalysisSvc(); 00035 void set_out_card(G4String filename); 00036 00037 void set_PrintModulo(int i){fPrintModulo = i;}; 00038 00039 void set_ofile_name(G4String& val){ ofile_name = val; }; 00040 void set_tree_name(G4String& val){ tree_name = val; }; 00041 void set_run_name(G4String& val){ run_name = val; }; 00042 00043 void set_minT(double val){m_minT=val;}; 00044 void set_maxT(double val){m_maxT=val;}; 00045 00046 void ReadOutputCard(G4String filename); 00047 int GetRunID(){return run_num;}; 00048 00049 void BeginOfRunAction(); 00050 void EndOfRunAction(const G4Run*); 00051 void PreUserTrackingAction(const G4Track*); 00052 void PostUserTrackingAction(const G4Track*); 00053 void BeginOfEventAction(); 00054 void EndOfEventAction(const G4Event*); 00055 void InitialStepAction(const G4Step*); 00056 void SteppingAction(const G4Step*); 00057 void ASDI(G4String); 00058 void PSDI(G4String); 00059 00060 private: 00061 static MyAnalysisSvc* fMyAnalysisSvc; 00062 MyAnalysisSvcMessenger* pMyAnalysisSvcMessenger; 00063 00064 G4String out_card; 00065 G4String run_name; 00066 G4String ofile_name; 00067 G4String tree_name; 00068 int run_num; 00069 int fAutoSave; 00070 int fCircular; 00071 int fVerbose; 00072 int fPrintModulo; 00073 00074 double m_minT; 00075 double m_maxT; 00076 00077 clock_t t_begin; 00078 clock_t t_end; 00079 double event_start_time; 00080 00081 MyRoot* pMyRoot; 00082 EventHeaderSvc* pEventHeaderSvc; 00083 MyDetectorManager* pMyDetectorManager; 00084 McTruthSvc* pMcTruthSvc; 00085 ProcessCountingSvc* pProcessCountingSvc; 00086 MyTriggerSvc* pMyTriggerSvc; 00087 PrimaryGeneratorAction* pPrimaryGeneratorAction; 00088 MyProcessManager* pMyProcessManager; 00089 }; 00090 00091 #endif