1 | /** |
---|
2 | * Author John Idarraga <idarraga@cern.ch> |
---|
3 | */ |
---|
4 | #ifndef AllPixRun_h |
---|
5 | #define AllPixRun_h 1 |
---|
6 | |
---|
7 | #include "G4Run.hh" |
---|
8 | |
---|
9 | #include "AllPixTrackerHit.hh" |
---|
10 | #include "AllPixRunAction.hh" |
---|
11 | #include "AllPixMedipix2Digit.hh" |
---|
12 | #include "AllPixDigitInterface.hh" |
---|
13 | |
---|
14 | #include <TROOT.h> |
---|
15 | #include <TFile.h> |
---|
16 | #include <TBranch.h> |
---|
17 | #include <TTree.h> |
---|
18 | #include <TChain.h> |
---|
19 | #include <TString.h> |
---|
20 | |
---|
21 | #include <vector> |
---|
22 | #include <string> |
---|
23 | #include <map> |
---|
24 | |
---|
25 | #include <iostream> |
---|
26 | #include <fstream> |
---|
27 | |
---|
28 | using namespace std; |
---|
29 | |
---|
30 | class FramesHandler; |
---|
31 | class WriteToNtuple; |
---|
32 | class SimpleHits; |
---|
33 | |
---|
34 | #ifdef _EUTELESCOPE |
---|
35 | #define __magic_trigger_cntr_ack 4 // 4 scintillators with 4 primary particle hits |
---|
36 | #endif |
---|
37 | |
---|
38 | class AllPixRun : public G4Run { |
---|
39 | |
---|
40 | public: |
---|
41 | |
---|
42 | AllPixRun(TString, TString); |
---|
43 | virtual ~AllPixRun(); |
---|
44 | |
---|
45 | virtual void RecordEvent(const G4Event*); |
---|
46 | void RecordHits(const G4Event*); |
---|
47 | void RecordDigits(const G4Event*); |
---|
48 | void SetLCIOBridgeFileDsc(ofstream * f, ofstream * fdut) |
---|
49 | { m_lciobridge_f = f; m_lciobridge_dut_f = fdut;}; |
---|
50 | |
---|
51 | // filling frames |
---|
52 | void FillFramesNtuple(const G4Run *); |
---|
53 | |
---|
54 | private: |
---|
55 | |
---|
56 | AllPixTrackerHitsCollection * m_hitsCollection; |
---|
57 | |
---|
58 | // Hits |
---|
59 | SimpleHits ** m_storableHits; |
---|
60 | |
---|
61 | // map index in frames handler to det Id |
---|
62 | map<int, int> m_detIdToIndex; |
---|
63 | |
---|
64 | // Frames ntuple --> not storing whole Digits |
---|
65 | // building frames from digits |
---|
66 | FramesHandler ** m_frames; |
---|
67 | TString m_datasetDigits; |
---|
68 | TString m_datasetHits; |
---|
69 | TString m_tempdir; |
---|
70 | |
---|
71 | // Information about ntuples |
---|
72 | |
---|
73 | // Same as number of digitizers |
---|
74 | G4int m_nOfDetectors; |
---|
75 | |
---|
76 | // Number of sensitive detectors. Can be more than the number of |
---|
77 | // digitizers if the user decides to have other volumes as SDs |
---|
78 | G4int m_nOfSD; |
---|
79 | |
---|
80 | // coming from AllPixRunAction |
---|
81 | ofstream * m_lciobridge_f; |
---|
82 | ofstream * m_lciobridge_dut_f; |
---|
83 | |
---|
84 | }; |
---|
85 | |
---|
86 | #endif |
---|