Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DetSim.h

Go to the documentation of this file.
00001 
00002 // $Id: DetSim.h,v 1.1 2005/05/04 15:20:49 minoscvs Exp $
00003 //
00004 // A JobControl Module applying
00005 // detector simulation and writing the output to the 
00006 // raw data blocks.
00007 //
00008 // n.tagg1@physics.ox.ac.uk
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 // use for random trigger bits
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   // These are not implemented by this module
00051   // void BeginJob();
00052   // void EndJob();
00053   // void BeginFile();
00054   // void EndFile();
00055   // void BeginRun();
00056   // void EndRun();
00057   // JobCResult Put(const MomNavigator *mom);
00058   // JobCResult Ana(const MomNavigator *mom);
00059   // void Help();
00060   
00061   // void Reset();
00062 
00063 private:
00064 
00065    // private methods for doing the work
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   // private data for doing the work
00092   
00093   Int_t                       fRandomSeed; 
00094   TRandom                     *fRandom; // random source for trigbits
00095   
00096   VldContext                  fContext; // Working variable.
00097 
00098   // Keeping track of event header data
00099   time_t                      fRunStartSecs;
00100 
00101   // these arrays float in size up to any highwater mark
00102   // in order to minimize allocating/deallocating space
00103   Int_t                       ncrates;
00104   TArrayI                     *workingcrates;  // array of pointers
00105   TArrayI                     *cratesizeused;  // active size of crate info
00106   
00107   Int_t                       nwordsblock;     // useful words in block
00108   TArrayI                     *workingarray;   // alloc size > nwordsblock
00109   
00110   // Configuration.
00111   Int_t                       fRemoveFalseDigits; // Allow 'bad' digits through. (e.g. digits not making through the trigger.)
00112   Int_t                       fBiggestSnarlOnly; // Only output 1 snarl; the biggest one.
00113   SimFlag::SimFlag_t          fContextSimFlag;  // What context to set the output to.
00114   Registry                    fDetectorConfiguration; // For DetSim.
00115   
00116   // Analysis
00117   TTree*                      fResultTree;
00118   TFile*                      fResultTreeFile;
00119   
00120   ClassDef(DetSim,1);
00121 };
00122 
00123 #endif // DETSIM_H
00124 

Generated on Mon Feb 15 11:06:37 2010 for loon by  doxygen 1.3.9.1