48 DMXAnalysisManager* DMXAnalysisManager::instance = 0;
52 DMXAnalysisManager::DMXAnalysisManager() :
53 af(0), tf(0),
tree(0),
hf(0), tpf(0),
55 hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0),
56 hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0),
57 hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0)
63 DMXAnalysisManager::~DMXAnalysisManager()
68 DMXAnalysisManager* DMXAnalysisManager::getInstance()
70 if (instance == 0) instance =
new DMXAnalysisManager();
84 af = AIDA_createAnalysisFactory();
91 tf = af->createTreeFactory();
93 tree = tf->create(histogramfile,
"hbook", readOnly, fileExists);
100 hf = af->createHistogramFactory( *
tree );
101 tpf = af->createTupleFactory(*
tree );
105 ntuple1 = tpf->create(
"1",
"Particle Source Energy",
110 ntuple2 = tpf->create(
"2",
"Scintillation Hits Info",
111 "float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,firstpart,firstparte,gamma,neutron,posi,elec,other,seed1,seed2" );
115 ntuple3 = tpf->create(
"3",
"PMT Hits Info",
116 "float event, hits, xpos, ypos, zpos" );
120 hEsourcep =
hf->createHistogram1D(
"10",
"Source Energy /keV", 1000,0.,10000.);
122 hEdepp =
hf->createHistogram1D(
"20",
"Energy Deposit /keV", 1000,0.,1000.);
124 hEdepRecoil =
hf->createHistogram1D(
"30",
"Nuclear Recoil Edep /keV", 100,0.,100.);
126 hNumPhLow =
hf->createHistogram1D(
"40",
"Number of Photons - LowE", 200,0.,200.);
128 hNumPhHigh =
hf->createHistogram1D(
"50",
"Number of Photons - HighE", 100,0.,10000.);
130 hAvPhArrival =
hf->createHistogram1D(
"60",
"Average Photon Arrival/ns", 200,0.,200.);
132 hPhArrival =
hf->createHistogram1D(
"61",
"1st event Photon Arrival", 200,0.,200.);
135 hPMTHits =
hf->createHistogram2D(
"70",
"PMT Hit Pattern",
136 300 ,-30.,30.,300,-30.,30.);
138 h1stPMTHit =
hf->createHistogram2D(
"71",
"1st event PMT Hit Pattern",
139 300 ,-30.,30.,300,-30.,30.);
142 hGammaEdep =
hf->createHistogram1D(
"91",
"Gamma Energy Deposit/keV", 1000,0.,1000.);
144 hNeutronEdep =
hf->createHistogram1D(
"92",
"Neutron Ener Deposit/keV", 1000,0.,1000.);
146 hElectronEdep =
hf->createHistogram1D(
"93",
"Electron Ener Deposit/keV",1000,0.,1000.);
148 hPositronEdep =
hf->createHistogram1D(
"94",
"Positron Ener Deposit/keV",1000,0.,1000.);
150 hOtherEdep =
hf->createHistogram1D(
"95",
"Other Ener Deposit/keV", 1000,0.,1000.);
194 void DMXAnalysisManager::Init()
199 void DMXAnalysisManager::Finish()
227 void DMXAnalysisManager::PulseTimeFit()
305 void DMXAnalysisManager::analyseScintHits(
G4int event_id,
G4double energy_pri,
G4double totEnergy,
G4int S_hits,
G4double firstLXeHitTime,
G4int P_hits,
G4double aveTimePmtHits,
G4String firstparticleName,
G4double firstParticleE,
G4bool gamma_ev,
G4bool neutron_ev,
G4bool positron_ev,
G4bool electron_ev,
G4bool other_ev,
long seed1,
long seed2)
309 G4int firstparticleIndex = 0;
310 if(firstparticleName ==
"gamma") firstparticleIndex = 1;
311 if(firstparticleName ==
"neutron") firstparticleIndex = 2;
312 if(firstparticleName ==
"electron") firstparticleIndex = 3;
313 if(firstparticleName ==
"positron") firstparticleIndex = 4;
314 if(firstparticleName ==
"other") {
315 firstparticleIndex = 5;
316 hEdepRecoil->fill(totEnergy);
319 hNumPhLow->fill(P_hits,10.);
321 hNumPhHigh->fill(P_hits);
324 hEsourcep->fill( energy_pri/
keV );
326 hEdepp->fill( totEnergy/
keV );
328 hAvPhArrival->fill(aveTimePmtHits/
ns);
357 hPMTHits->fill(x/
mm, y/
mm);
360 h1stPMTHit->fill(x,y);
389 if(name ==
"gamma") {
390 hGammaEdep->fill(energy/
keV);
392 if(name ==
"neutron") {
393 hNeutronEdep->fill(energy/
keV);
395 if(name ==
"electron") {
396 hElectronEdep->fill(energy/
keV);
398 if(name ==
"positron") {
399 hPositronEdep->fill(energy/
keV);
401 if(name ==
"other") {
402 hOtherEdep->fill(energy/
keV);
409 void DMXAnalysisManager::HistTime(
G4double time)
411 hPhArrival->fill(time/
ns);
416 void DMXAnalysisManager::PlotHistosInter(
G4int)
430 void DMXAnalysisManager::PlotHistos(
G4bool)