40 energy(0), hcalE(0), ecalE(0), timeHist(0), lateralProfile(0),
60 G4cout <<
"********************************************" <<
G4endl
61 <<
"* o/p file ccal" <<
G4endl
62 <<
"********************************************" <<
G4endl
70 for (
int i=0;i<28;i++)
72 sprintf(tupleid,
"hcal%d",i);
75 for (
int i=0; i<49; i++)
77 sprintf(tupleid,
"ecal%d",i);
92 char id[5], ntupletag[50];
94 for (
int i = 0; i<28; i++) {
95 sprintf(
id,
"h%d",i+100);
96 sprintf(ntupletag,
"Energy Deposit in Hcal Layer%d in GeV",i);
97 G4int histoID = analysisManager->
CreateH1(
id,ntupletag, 100, 0., 1.0);
102 for (
int i = 0; i<49; i++)
104 sprintf(
id,
"h%d",i+200);
105 sprintf(ntupletag,
"Energy Deposit in Ecal Tower%d in GeV",i);
106 G4int histoID = analysisManager->
CreateH1(
id,ntupletag, 100, 0., 1.0);
111 energy = analysisManager->
CreateH1(
"h4000",
"Total energy deposited in GeV",
116 sprintf(
id,
"h%d",i+300);
117 sprintf(ntupletag,
"Time slice %d nsec energy profile in GeV",i);
118 G4int histoID = analysisManager->
CreateH1(
id,ntupletag,100, 0., 100.0);
124 for (
int i = 0; i<70; i++) {
125 sprintf(
id,
"h%d",i+500);
126 sprintf(ntupletag,
"Lateral energy profile at %d cm in GeV",i);
127 G4int histoID = analysisManager->
CreateH1(
id, ntupletag, 100, 0., 10.0);
135 analysisManager->
CreateH1(
"h902",
"Time Profile in Sensitive+Passive",
142 delete G4AnalysisManager::Instance();
162 G4double totalFilledEnergyHcal = 0.0;
163 for (
int i=0; i<28; i++) {
168 G4cout <<
"Fill Hcal histo " << i <<
" with " << x <<
G4endl;
169 totalFilledEnergyHcal += x;
175 "CCalAnalysis::InsertEnergyHcal: Total filled Energy Hcal histo "
176 << totalFilledEnergyHcal <<
G4endl;
185 G4double totalFilledEnergyEcal = 0.0;
187 for (
G4int i=0; i<49; i++) {
192 G4cout <<
"Fill Ecal histo " << i <<
" with " << x <<
G4endl;
193 totalFilledEnergyEcal += x;
198 "CCalAnalysis::InsertEnergyEcal: Total filled Energy Ecal histo "
199 << totalFilledEnergyEcal <<
G4endl;
207 G4double totalFilledProfileHcal = 0.0;
209 for (
G4int i=0; i<70; i++) {
214 G4cout <<
"Fill Profile Hcal histo " << i <<
" with " << x <<
G4endl;
215 totalFilledProfileHcal += x;
219 G4cout <<
"CCalAnalysis::InsertLateralProfile: Total filled Profile Hcal"
220 <<
" histo " << totalFilledProfileHcal <<
G4endl;
229 G4AnalysisManager::Instance()->FillH1(
energy,x);
231 G4cout <<
"CCalAnalysis::InsertEnergy: Fill Total energy Hcal histo with "
241 G4double totalFilledTimeProfile = 0.0;
248 G4cout <<
"Fill Time slice histo " << j <<
" with " << x <<
G4endl;
249 totalFilledTimeProfile += x;
255 G4cout <<
"Fill Time profile histo 1 with " << t <<
" " << x <<
G4endl;
258 G4cout <<
"CCalAnalysis::InsertTime: Total filled Time profile histo "
259 << totalFilledTimeProfile <<
G4endl;
270 G4cout <<
"CCalAnalysis:: Fill Time Profile with Hit " << hit
271 <<
" Edeposit " << edep <<
" Gev at " << time <<
" ns" <<
G4endl;
277 float x,
float y,
float z,
float edep,
278 float edec,
float edhc)
282 for (
int i=0; i<28; i++)
287 for (
int i=0; i<49; i++)
G4bool SetFirstHistoId(G4int firstId)
void setNtuple(float *hcalE, float *ecalE, float elab, float x, float y, float z, float edep, float edec, float edhc)
G4int CreateH1(const G4String &name, const G4String &title, G4int nbins, G4double xmin, G4double xmax, const G4String &unitName="none", const G4String &fcnName="none", const G4String &binSchemeName="linear")
void SetVerboseLevel(G4int verboseLevel)
void InsertEnergyHcal(float *)
G4int CreateNtuple(const G4String &name, const G4String &title)
G4bool OpenFile(const G4String &fileName="")
void InsertEnergyEcal(float *)
G4bool FillNtupleFColumn(G4int id, G4float value)
G4GLOB_DLL std::ostream G4cout
void InsertEnergy(float v)
void InsertLateralProfile(float *)
void EndOfEvent(G4int flag)
G4bool SetFirstNtupleId(G4int firstId)
Defines the format which is used for the output file default is a ROOT file. Comment the g4root and u...
G4double energy(const ThreeVector &p, const G4double m)
G4bool FillH1(G4int id, G4double value, G4double weight=1.0)
static CCalAnalysis * getInstance()
G4int CreateNtupleFColumn(const G4String &name)
static CCalAnalysis * instance
tools::histo::h1d * GetH1(G4int id, G4bool warn=true, G4bool onlyIfActive=true) const
void InsertTimeProfile(int, double, double)