00001
00002
00003
00004
00005
00006
00007
00008
00010 #ifndef DETSIM_H
00011 #define DETSIM_H
00012
00013 #ifndef JOBCMODULE_H
00014 #include "JobControl/JobCModule.h"
00015 #endif
00016
00017 #include "TArrayI.h"
00018
00019
00020 #include "TRandom.h"
00021
00022 class MomNavigator;
00023 class JobCommand;
00024 class RawDataBlock;
00025
00026 #include "RawData/RawChannelId.h"
00027 #include "Plex/PlexStripEndId.h"
00028 #include "Validity/VldContext.h"
00029 #include "TH1F.h"
00030 #include "TTree.h"
00031 #include "TFile.h"
00032
00033 class SimDigit;
00034 class SimDetector;
00035
00036
00037 class DetSim : public JobCModule
00038 {
00039 public:
00040 DetSim();
00041 ~DetSim();
00042
00043 JobCResult Get(MomNavigator *mom);
00044 JobCResult Ana(const MomNavigator *mom);
00045
00046 const Registry& DefaultConfig() const;
00047 void Config(const Registry& r);
00048 void Report();
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 private:
00064
00065
00066
00067 SimDetector* fDetector;
00068
00069 void InitWorkingArray(void);
00070 void AddToCrate( VldContext& context,
00071 const RawChannelId& rcid,
00072 Int_t iadc, Int_t itdc,
00073 Bool_t error = false,
00074 Int_t truth_info = 0
00075 );
00076 void PackVaDigit(Int_t &cptr, TArrayI& wcrate,
00077 const RawChannelId& rcid,
00078 Int_t iadc, Int_t itdc,
00079 Bool_t error = false,
00080 Int_t truth_info = 0
00081 );
00082
00083 void PackQieDigit(Int_t &cptr, TArrayI& wcrate,
00084 const RawChannelId& rcid,
00085 Int_t iadc, Int_t itdc,
00086 Bool_t error = false,
00087 Int_t truth_info = 0
00088 );
00089 RawDataBlock* FinalizeWorkingArray(VldContext& context);
00090
00091
00092
00093 Int_t fRandomSeed;
00094 TRandom *fRandom;
00095
00096 VldContext fContext;
00097
00098
00099 time_t fRunStartSecs;
00100
00101
00102
00103 Int_t ncrates;
00104 TArrayI *workingcrates;
00105 TArrayI *cratesizeused;
00106
00107 Int_t nwordsblock;
00108 TArrayI *workingarray;
00109
00110
00111 Int_t fRemoveFalseDigits;
00112 Int_t fBiggestSnarlOnly;
00113 SimFlag::SimFlag_t fContextSimFlag;
00114 Registry fDetectorConfiguration;
00115
00116
00117 TTree* fResultTree;
00118 TFile* fResultTreeFile;
00119
00120 ClassDef(DetSim,1);
00121 };
00122
00123 #endif // DETSIM_H
00124