/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 00010 #ifndef DIGITALIZEALG_H 00011 #define DIGITALIZEALG_H 00012 00013 #include "DybAlg/DybAlgorithm.h" 00014 00015 #include "Event/SimHeader.h" 00016 #include "Event/SimHit.h" 00017 #include "Event/ElecHeader.h" 00018 #include "Event/SimTrigHeader.h" 00019 #include "Event/SimReadoutHeader.h" 00020 #include "Event/SimReadout.h" 00021 00022 #include "ElecSim/IEsPulseTool.h" 00023 #include "ElecSim/IEsFrontEndTool.h" 00024 #include "TrigSim/ITsTriggerTool.h" 00025 #include "ReadoutSim/IROsReadoutTool.h" 00026 #include "ReadoutSim/IROsTriggerDataPackerTool.h" 00027 00028 #include "ROBufferSvc/IROBufferSvc.h" 00029 #include "PreElecSimSvc/IPreElecSimSvc.h" 00030 00031 #include <vector> 00032 00033 using namespace std; 00034 00035 class DigitalizeAlg : public DybAlgorithm<DayaBay::SimReadoutHeader> 00036 { 00037 public: 00038 DigitalizeAlg(const string& name, ISvcLocator* pSvcLocator); 00039 virtual ~DigitalizeAlg(); 00040 00041 virtual StatusCode initialize(); 00042 virtual StatusCode execute(); 00043 virtual StatusCode finalize(); 00044 00045 private: 00046 // List of detector names to include in digitalization 00047 vector<string> m_detectorNames; 00048 // Name of the PMT simulation tool 00049 string m_pmtToolName; 00050 // Name of the RPC simulation tool 00051 string m_rpcToolName; 00052 // Name of the PMT electronics sim tool 00053 string m_feeToolName; 00054 // Name of the RPC electronics sim tool 00055 string m_fecToolName; 00056 00057 //List of simulated detector IDs 00058 vector<DayaBay::Detector> m_detectors; 00059 //Tool for adding PMT effects to simulated hits 00060 IEsPulseTool* m_pmtTool; 00061 //Tool for adding RPC effects to simulated hits 00062 IEsPulseTool* m_rpcTool; 00063 //Tool for generating PMT Front-end electronics signals 00064 IEsFrontEndTool* m_feeTool; 00065 //Tool for generating RPC Front-end card signals 00066 IEsFrontEndTool* m_fecTool; 00067 00068 //Earliest and Latest 00069 TimeStamp m_hitEarliest; 00070 TimeStamp m_hitLatest; 00071 00072 //Triggering 00073 vector<string> m_trigToolNames; 00074 vector<ITsTriggerTool*> m_trigTools; 00075 00076 string m_trigFilterName; 00077 ITsTriggerTool* m_triggerSorter; 00078 00079 //Readoutering 00080 vector<string> m_roToolNames; 00081 vector<IROsReadoutTool*> m_roTools; 00082 00083 string m_roTrigPackName; 00084 IROsTriggerDataPackerTool* m_roTrigPackTool; 00085 00086 //Interface in FastMCProduction 00087 IROBufferSvc* m_roBufferSvc; 00088 IPreElecSimSvc* m_preElecSimSvc; 00089 00090 //ElecSim on SimHitHeader, produce ElecHeader 00091 StatusCode ElecSim(const SimHitHeader* shh, vector<const SimHeader*>& shs, ElecHeader*& eh); 00092 00093 //TrigSim on ElecHeader, produce TrigHeader 00094 StatusCode TrigSim(const ElecHeader& eh, SimTrigHeader*& th); 00095 00096 //ReadoutSim on ElecHeader and TrigHeader, produce SimReadoutHeader 00097 StatusCode ReadoutSim(const ElecHeader& eh, const SimTrigHeader& th, SimReadoutHeader*& srh); 00098 00099 //Get the next SimReadoutHeader 00100 StatusCode TrigExecute(const ElecHeader* eh, SimReadoutHeader*& srh); 00101 }; 00102 00103 #endif //DIGITALIZEALG_H