CMS 3D CMS Logo

FP420Test.h
Go to the documentation of this file.
1 #ifndef FP420Test_H
2 #define FP420Test_H
3 
4 // system include files
5 #include <vector>
6 #include <iostream>
7 #include <memory>
8 #include <string>
9 //
10 // user include files
14 
15 //
16 //
27 
29 
30 #include "G4VTouchable.hh"
31 #include <map>
32 #include <cmath>
33 #include <CLHEP/Random/Randomize.h>
34 
35 // ----------------------------------------------------------------
36 // Includes needed for Root ntupling
37 //
38 #include "TROOT.h"
39 #include "TFile.h"
40 #include "TH1.h"
41 #include "TH2.h"
42 #include "TProfile.h"
43 #include "TNtuple.h"
44 #include "TRandom.h"
45 #include "TLorentzVector.h"
46 #include "TUnixSystem.h"
47 #include "TSystem.h"
48 #include "TMath.h"
49 #include "TF1.h"
50 
51 #include <TObjArray.h>
52 #include <TObjString.h>
53 #include <TNamed.h>
54 
55 class Fp420AnalysisHistManager : public TNamed {
56 public:
57  Fp420AnalysisHistManager(const TString& managername);
58  ~Fp420AnalysisHistManager() override;
59 
60  TH1F* GetHisto(Int_t Number);
61  TH1F* GetHisto(const TObjString& histname);
62 
63  TH2F* GetHisto2(Int_t Number);
64  TH2F* GetHisto2(const TObjString& histname);
65 
66  void WriteToFile(const TString& fOutputFile, const TString& fRecreateFile);
67 
68 private:
69  void BookHistos();
70  void StoreWeights();
71  void HistInit(const char* name, const char* title, Int_t nbinsx, Axis_t xlow, Axis_t xup);
72  void HistInit(
73  const char* name, const char* title, Int_t nbinsx, Axis_t xlow, Axis_t xup, Int_t nbinsy, Axis_t ylow, Axis_t yup);
74 
75  const char* fTypeTitle;
76  TObjArray* fHistArray;
77  TObjArray* fHistNamesArray;
78 };
79 
81 
82 class BeginOfJob;
83 class BeginOfRun;
84 class EndOfRun;
85 class BeginOfEvent;
86 class EndOfEvent;
87 class BeginOfTrack;
88 class EndOfTrack;
89 class G4Step;
90 
91 /*
92 class ObserveBeginOfRun : private Observer<const BeginOfRun *>
93 {
94 public:
95  ObserveBeginOfRun();
96 private:
97  void update(const BeginOfRun * run);
98 };
99 
100 class ObserveEndOfRun : private Observer<const EndOfRun *>
101 {
102 public:
103  ObserveEndOfRun();
104 private:
105  void update(const EndOfRun * run);
106 };
107 
108 class ObserveBeginOfEvent : private Observer<const BeginOfEvent *>
109 {
110 public:
111  ObserveBeginOfEvent();
112 private:
113  void update(const BeginOfEvent * evt);
114 };
115 
116 class ObserveEndOfEvent : private Observer<const EndOfEvent *>
117 {
118 public:
119  ObserveEndOfEvent();
120 private:
121  void update(const EndOfEvent * evt);
122  // std::vector<FP420G4Hit> theStripHits;
123 };
124 
125 class ObserveBeginOfTrack : private Observer<const BeginOfTrack *>
126 {
127 public:
128  ObserveBeginOfTrack();
129 private:
130  void update(const BeginOfTrack * trk);
131 };
132 
133 class ObserveEndOfTrack : private Observer<const EndOfTrack *>
134 {
135 public:
136  ObserveEndOfTrack();
137 private:
138  void update(const EndOfTrack * trk);
139 };
140 
141 class ObserveStep : private Observer<const G4Step *>
142 {
143 public:
144  ObserveStep();
145 private:
146  void update(const G4Step * step);
147 };
148 */
149 //class FP420Test: public SimProducer,
150 class FP420Test : public SimWatcher,
151  public Observer<const BeginOfJob*>,
152  public Observer<const BeginOfRun*>,
153  public Observer<const EndOfRun*>,
154  public Observer<const BeginOfEvent*>,
155  public Observer<const BeginOfTrack*>,
156  public Observer<const G4Step*>,
157  public Observer<const EndOfTrack*>,
158  public Observer<const EndOfEvent*> {
159 public:
160  FP420Test(const edm::ParameterSet& p);
161  ~FP420Test() override;
162  //MyActions();
163  //MyActions();
164 private:
165  // observer classes
166  void update(const BeginOfJob* run) override;
167  void update(const BeginOfRun* run) override;
168  void update(const EndOfRun* run) override;
169  void update(const BeginOfEvent* evt) override;
170  void update(const BeginOfTrack* trk) override;
171  void update(const G4Step* step) override;
172  void update(const EndOfTrack* trk) override;
173  void update(const EndOfEvent* evt) override;
174 
175 private:
176  //UHB_Analysis* UserNtuples;
177 
178  int iev;
179  int itrk;
180  G4double entot0, tracklength0;
181 
182 private:
183  // Utilities to get detector levels during a step
184 
185  int detLevels(const G4VTouchable*) const;
186  G4String detName(const G4VTouchable*, int, int) const;
187  void detectorLevel(const G4VTouchable*, int&, int*, G4String*) const;
188 
189  double rinCalo, zinCalo;
192 
193  // SumEnerDeposit - all deposited energy on all steps ; SumStepl - length in steel !!!
195  // numofpart - # particles produced along primary track
197  // last point of the primary track
198  G4ThreeVector lastpo;
199 
200  // z:
201  double z1, z2, z3, z4, zD2, zD3;
202  int sn0, dn0, pn0, rn0;
203  int rn00;
204  double ZSiDet, z420;
206  double zBlade, gapBlade;
207 
208 private:
209  Float_t fp420eventarray[1];
213 
214  Fp420AnalysisHistManager* TheHistManager; //Histogram Manager of the analysis
215  std::string fDataLabel; // Data type label
216  std::string fOutputFile; // The output file name
217  std::string fRecreateFile; // Recreate the file flag, default="RECREATE"
218 
219  // // // // // // TObjString fHistType;
220  // TString fDataLabel; // Data type label
221  // TString fOutputFile; // The output file name
222  // TString fRecreateFile; // Recreate the file flag, default="RECREATE"
223 };
224 
225 #endif
FP420Test::zinibeg
double zinibeg
Definition: FP420Test.h:205
FP420Test::tracklength0
G4double tracklength0
Definition: FP420Test.h:180
Fp420AnalysisHistManager::BookHistos
void BookHistos()
Definition: FP420Test.cc:176
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
Observer
Definition: Observer.h:23
Fp420AnalysisHistManager::fTypeTitle
const char * fTypeTitle
Definition: FP420Test.h:75
FP420Test::gapBlade
double gapBlade
Definition: FP420Test.h:206
FP420Test::fDataLabel
std::string fDataLabel
Definition: FP420Test.h:215
BeginOfJob.h
step
step
Definition: StallMonitor.cc:94
Fp420AnalysisHistManager::fHistArray
TObjArray * fHistArray
Definition: FP420Test.h:76
FP420Test::~FP420Test
~FP420Test() override
Definition: FP420Test.cc:119
FP420Test::SumEnerDeposit
G4double SumEnerDeposit
Definition: FP420Test.h:194
FP420Test::lastpo
G4ThreeVector lastpo
Definition: FP420Test.h:198
FP420Test::itrk
int itrk
Definition: FP420Test.h:179
FP420Test::verbosity
int verbosity
Definition: FP420Test.h:191
FP420Test::detectorLevel
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: FP420Test.cc:773
EndOfTrack.h
HcalTBWriter_cfi.Number
Number
Definition: HcalTBWriter_cfi.py:19
EndOfEvent.h
EDAnalyzer.h
FP420Test
Definition: FP420Test.h:150
Fp420AnalysisHistManager::GetHisto2
TH2F * GetHisto2(Int_t Number)
Definition: FP420Test.cc:257
EndOfTrack
Definition: EndOfTrack.h:6
FP420Test::fp420eventarray
Float_t fp420eventarray[1]
Definition: FP420Test.h:209
Observer.h
BeginOfTrack.h
FP420Test::fRecreateFile
std::string fRecreateFile
Definition: FP420Test.h:217
MakerMacros.h
BeginOfRun.h
FP420Test::ZBoundDet
double ZBoundDet
Definition: FP420Test.h:205
FP420Test::rinCalo
double rinCalo
Definition: FP420Test.h:189
FP420Test::z2
double z2
Definition: FP420Test.h:201
SimWatcher.h
FP420Test::z3
double z3
Definition: FP420Test.h:201
FP420Test::z420
double z420
Definition: FP420Test.h:204
FP420Test::z1
double z1
Definition: FP420Test.h:201
FP420Test::entot0
G4double entot0
Definition: FP420Test.h:180
FP420Test::zD2
double zD2
Definition: FP420Test.h:201
BeginOfTrack
Definition: BeginOfTrack.h:6
FP420Test::fOutputFile
std::string fOutputFile
Definition: FP420Test.h:216
BeginOfJob
Definition: BeginOfJob.h:8
Fp420AnalysisHistManager::WriteToFile
void WriteToFile(const TString &fOutputFile, const TString &fRecreateFile)
Definition: FP420Test.cc:200
FP420Test::lastTrackID
int lastTrackID
Definition: FP420Test.h:190
EndOfEvent
Definition: EndOfEvent.h:6
FP420Test::pn0
int pn0
Definition: FP420Test.h:202
FP420Test::zBlade
double zBlade
Definition: FP420Test.h:206
FP420Test::ZSiStep
double ZSiStep
Definition: FP420Test.h:205
Fp420AnalysisHistManager::fHistNamesArray
TObjArray * fHistNamesArray
Definition: FP420Test.h:77
Fp420AnalysisHistManager::HistInit
void HistInit(const char *name, const char *title, Int_t nbinsx, Axis_t xlow, Axis_t xup)
Definition: FP420Test.cc:214
Fp420AnalysisHistManager::~Fp420AnalysisHistManager
~Fp420AnalysisHistManager() override
Definition: FP420Test.cc:161
FP420Test::sn0
int sn0
Definition: FP420Test.h:202
FP420Test::rn0
int rn0
Definition: FP420Test.h:202
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
FP420Test::zinCalo
double zinCalo
Definition: FP420Test.h:189
FP420Test::zD3
double zD3
Definition: FP420Test.h:201
FP420Test::ZSiDet
double ZSiDet
Definition: FP420Test.h:204
FP420Test::SumStepl
G4double SumStepl
Definition: FP420Test.h:194
BeginOfEvent.h
FP420Test::fp420eventntuple
TNtuple * fp420eventntuple
Definition: FP420Test.h:210
Fp420AnalysisHistManager::StoreWeights
void StoreWeights()
Definition: FP420Test.cc:289
BeginOfEvent
Definition: BeginOfEvent.h:6
BeginOfRun
Definition: BeginOfRun.h:6
EndOfRun
Definition: EndOfRun.h:6
Fp420AnalysisHistManager::GetHisto
TH1F * GetHisto(Int_t Number)
Definition: FP420Test.cc:241
SimWatcher
Definition: SimWatcher.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FP420Test::dn0
int dn0
Definition: FP420Test.h:202
EndOfRun.h
Fp420AnalysisHistManager::Fp420AnalysisHistManager
Fp420AnalysisHistManager(const TString &managername)
Definition: FP420Test.cc:144
Fp420AnalysisHistManager
Definition: FP420Test.h:55
writedatasetfile.run
run
Definition: writedatasetfile.py:27
Frameworkfwd.h
FP420Test::TheHistManager
Fp420AnalysisHistManager * TheHistManager
Definition: FP420Test.h:214
FP420Test::SumStepc
G4double SumStepc
Definition: FP420Test.h:194
FP420Test::rn00
int rn00
Definition: FP420Test.h:203
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
FP420G4Hit.h
FP420Test::whichevent
int whichevent
Definition: FP420Test.h:212
FP420Test::ZGapLDet
double ZGapLDet
Definition: FP420Test.h:205
ParameterSet.h
FP420Test::iev
int iev
Definition: FP420Test.h:178
FP420Test::z4
double z4
Definition: FP420Test.h:201
FP420Test::FP420Test
FP420Test(const edm::ParameterSet &p)
Definition: FP420Test.cc:51
FP420Test::detName
G4String detName(const G4VTouchable *, int, int) const
Definition: FP420Test.cc:763
FP420Test::numofpart
int numofpart
Definition: FP420Test.h:196
FP420Test::update
void update(const BeginOfJob *run) override
This routine will be called when the appropriate signal arrives.
Definition: FP420Test.cc:304
FP420NumberingScheme
Definition: FP420NumberingScheme.h:15
FP420Test::ZSiPlane
double ZSiPlane
Definition: FP420Test.h:205
FP420Test::fp420OutputFile
TFile fp420OutputFile
Definition: FP420Test.h:211
FP420Test::detLevels
int detLevels(const G4VTouchable *) const
Definition: FP420Test.cc:754