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