Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -100,7 +100,7 @@ int main(int argc,char** argv) {
|
||||
#ifdef G4ANALYSIS_USE
|
||||
G4cout << G4endl << G4endl << G4endl
|
||||
<< " User Environment " << G4endl
|
||||
<< " Using AIDA 2.2 analysis " << G4endl;
|
||||
<< " Using AIDA 3.2.1 analysis " << G4endl;
|
||||
#else
|
||||
G4cout << G4endl << G4endl << G4endl
|
||||
<< " User Environment " << G4endl
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
global tree, hf
|
||||
|
||||
tree = tf.create("gamma_2000.his",1,1,"hbook")
|
||||
tree.thisown=1
|
||||
hf = af.createHistogramFactory(tree)
|
||||
|
||||
# ... and load them into memory:
|
||||
hEsource = tree.findH1D("10")
|
||||
hDeposit = tree.findH1D("20")
|
||||
hNuclearDep = tree.findH1D("30")
|
||||
hNumberPhLow = tree.findH1D("40")
|
||||
hNumberPhHigh = tree.findH1D("50")
|
||||
hPhArrivalTime = tree.findH1D("60")
|
||||
|
||||
# set plotter to 3*2 zones
|
||||
pl.createRegions(3,2)
|
||||
|
||||
# ... and plot the histograms
|
||||
pl.plot(hEsource ) ; pl.show() ; pl.next()
|
||||
pl.plot(hDeposit ) ; pl.show() ; pl.next()
|
||||
pl.plot(hNuclearDep ) ; pl.show() ; pl.next()
|
||||
pl.plot(hNumberPhLow ) ; pl.show() ; pl.next()
|
||||
pl.plot(hNumberPhHigh ) ; pl.show() ; pl.next()
|
||||
pl.plot(hPhArrivalTime) ; pl.show() ; pl.next()
|
||||
|
||||
wait()
|
||||
|
||||
# reset number of zones
|
||||
pl.createRegions(2,1)
|
||||
|
||||
# helper function
|
||||
def nplot(tup, col, cut, xmin, xmax, nbins=100):
|
||||
global hf
|
||||
h1 = hf.create1D("1000000","temp hist", nbins, xmin, xmax)
|
||||
colId = tup.findColumn(col)
|
||||
bNextRow=tup.start() # Looping over the tuple entries
|
||||
while bNextRow:
|
||||
h1.fill(tup.getFloat(colId))
|
||||
bNextRow=tup.next() # Retrieving the subsequent row
|
||||
pl.plot(h1) ; pl.show() ; pl.next()
|
||||
tree.rm("1000000")
|
||||
return
|
||||
|
||||
# get the primary ntuple from the NtupleManager
|
||||
nt1 = tree.findTuple("3" )
|
||||
|
||||
# plot a few quantities using the shortcut
|
||||
nplot(nt1,"tot_e" ,"",0.,20.)
|
||||
nplot(nt1,"xe_time","",0.,100.)
|
||||
|
||||
# prompt user for <return>
|
||||
wait()
|
||||
|
||||
# get the secondaries ntuple and plot a few attributes from it
|
||||
nt2 = tree.findTuple("2" )
|
||||
nplot(nt2, "xpos", "", 0., 50)
|
||||
nplot(nt2, "zpos", "", 0., 100.)
|
||||
|
||||
pl.write("pmtpos.ps", "ps")
|
||||
|
||||
tree.commit()
|
||||
tree.close()
|
||||
del tree
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ $Id:
|
||||
|
||||
Category History file
|
||||
---------------------
|
||||
28.05.2003 - S. Guatelli (DMX-V06-01-00)
|
||||
Migrated to AIDA 3.2.1 and PI 1.2.1
|
||||
|
||||
02.12.2003 - G.Cosmo (DMX-V05-02-01)
|
||||
Migrated to new hadronic processes for release 6.0.
|
||||
|
||||
@@ -164,70 +164,22 @@ allow forward compatibility should the GPS change.
|
||||
|
||||
ANALYSIS:
|
||||
|
||||
In order to use the AIDA 3 compliant analysis set the environment variable
|
||||
In order to use the AIDA 3.2.1 compliant analysis set the environment variable
|
||||
G4ANALYSIS_USE before building. If a previous build exists a gmake clean has
|
||||
to be executed.
|
||||
|
||||
setenv G4ANALYSIS_USE 1
|
||||
|
||||
To link with anaphe, first execute the anaphe installation script
|
||||
(example for CERN installation):
|
||||
|
||||
source /afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.5/scripts/setupAnaphe.csh
|
||||
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.5/scripts
|
||||
|
||||
[Have a look at the Anaphe web page, http://cern.ch/anaphe for more info]
|
||||
|
||||
then gmake
|
||||
|
||||
The program should then produce hbook histogram files as well as interactively
|
||||
two summary pages from QPLOTTER - outputing with postscript summary1.ps and
|
||||
summary2.ps
|
||||
The program should then produce hbook histogram files
|
||||
|
||||
In addition a lizard python script is included for reference:
|
||||
start lizard:
|
||||
lizard
|
||||
exe("DMX.py")
|
||||
|
||||
Subsequent runs will require source of anaphe_start.sh
|
||||
|
||||
source anaphe_start.sh
|
||||
|
||||
before executing DMX
|
||||
|
||||
|
||||
NB: When running the program the output histogram file has to be "new"
|
||||
therefore if it has the same name as an existing file the program will crash.
|
||||
|
||||
|
||||
See http://cern.ch/anaphe for more information about ANAPHE/Lizard
|
||||
|
||||
AIDA 2.2 information is available at http://www.aida.org
|
||||
|
||||
Using AIDA 2.2 interfaces three different analysis packages can be utilised:
|
||||
Using AIDA 3.2.1 interfaces three different analysis packages can be utilised:
|
||||
Java Analysis Studio (JAS)
|
||||
OpenScientist
|
||||
Anaphe/Lizard
|
||||
|
||||
At cern instead of executing the anaphe script see below:
|
||||
|
||||
[
|
||||
AT CERN the following has to be executed in order to pick-up anaphe:
|
||||
|
||||
execute the following lines _before_ gmake,
|
||||
select the Anaphe version you want to use (4.0.1-sec for RH61 "old" compiler,
|
||||
4.0.1 for RH61, new compiler (gcc-2.95.2)):
|
||||
export PATH=$PATH:/afs/cern.ch/sw/lhcxx/specific/redhat61/egcs_1.1.2/4.0.1-sec/bin
|
||||
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.1-sec/install/sharedstart.sh
|
||||
(for the new compiler, use (sh derivates):
|
||||
export PATH=$PATH:/afs/cern.ch/sw/lhcxx/specific/redhat61/gcc-2.95.2/4.0.1/bin
|
||||
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.1/install/sharedstart.sh)
|
||||
or, for [t]csh fans (still "old" compiler):
|
||||
|
||||
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/specific/redhat61/egcs_1.1.2/4.0.1-sec/bin
|
||||
source /afs/cern.ch/sw/lhcxx/share/LHCXX/4.0.1-sec/install/sharedstart.csh
|
||||
]
|
||||
PI
|
||||
|
||||
Please for more information look at http://aida.freehep.org
|
||||
|
||||
SEEDS:
|
||||
|
||||
@@ -262,9 +214,6 @@ BooleanProcessor: boolean operation failed
|
||||
This is a "feature" of the visualisation of boolean volumes, but does not
|
||||
affect functionality/performance so can be ignored.
|
||||
|
||||
|
||||
|
||||
|
||||
NB:
|
||||
If using explicit libraries (?) i.e. non-shared then compilation time with
|
||||
neutrons in physics list is very long (>5 minutes) - check this.............
|
||||
|
||||
@@ -53,23 +53,23 @@
|
||||
#include "AIDA/IHistogram2D.h"
|
||||
#include "AIDA/IHistogram3D.h"
|
||||
|
||||
#include "AIDA/IPlotterFactory.h"
|
||||
#include "AIDA/IPlotterRegion.h"
|
||||
#include "AIDA/IPlotter.h"
|
||||
// #include "AIDA/IPlotterFactory.h"
|
||||
// #include "AIDA/IPlotterRegion.h"
|
||||
// #include "AIDA/IPlotter.h"
|
||||
|
||||
#include "AIDA/ITupleFactory.h"
|
||||
#include "AIDA/ITuple.h"
|
||||
|
||||
#include "AIDA/IManagedObject.h"
|
||||
|
||||
# include "AIDA/IFitter.h"
|
||||
# include "AIDA/IFitResult.h"
|
||||
# include "AIDA/IFitData.h"
|
||||
# include "AIDA/IRangeSet.h"
|
||||
# include "AIDA/IFitParameterSettings.h"
|
||||
# include "AIDA/IFunctionFactory.h"
|
||||
# include "AIDA/IFunction.h"
|
||||
# include "AIDA/IFitFactory.h"
|
||||
// # include "AIDA/IFitter.h"
|
||||
// # include "AIDA/IFitResult.h"
|
||||
// # include "AIDA/IFitData.h"
|
||||
// # include "AIDA/IRangeSet.h"
|
||||
// # include "AIDA/IFitParameterSettings.h"
|
||||
// # include "AIDA/IFunctionFactory.h"
|
||||
// # include "AIDA/IFunction.h"
|
||||
// # include "AIDA/IFitFactory.h"
|
||||
|
||||
namespace AIDA {
|
||||
class IAnalysisFactory;
|
||||
@@ -79,16 +79,15 @@ namespace AIDA {
|
||||
class ITuple;
|
||||
class IHistogram1D;
|
||||
class IHistogram2D;
|
||||
class IPlotter;
|
||||
class IFitter;
|
||||
class IFitResult;
|
||||
class IFitData;
|
||||
class IRangeSet;
|
||||
class IFitParameterSettings;
|
||||
class IFunctionFactory;
|
||||
class IFunction;
|
||||
class IFitFactory;
|
||||
|
||||
//class IPlotter;
|
||||
// class IFitter;
|
||||
//class IFitResult;
|
||||
//class IFitData;
|
||||
//class IRangeSet;
|
||||
//class IFitParameterSettings;
|
||||
//class IFunctionFactory;
|
||||
//class IFunction;
|
||||
//class IFitFactory;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,8 +145,21 @@ private:
|
||||
// Quantities for the ntuple
|
||||
|
||||
|
||||
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;
|
||||
|
||||
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;
|
||||
|
||||
G4int i; G4double x; G4double y; G4double z;
|
||||
|
||||
@@ -161,8 +173,6 @@ private:
|
||||
AIDA::ITree *tree;
|
||||
AIDA::IHistogramFactory *hf;
|
||||
AIDA::ITupleFactory *tpf;
|
||||
AIDA::IPlotterFactory *pf;
|
||||
AIDA::IPlotter *plotter;
|
||||
AIDA::ITuple *ntuple1;
|
||||
AIDA::ITuple *ntuple2;
|
||||
AIDA::ITuple *ntuple3;
|
||||
@@ -183,13 +193,12 @@ private:
|
||||
AIDA::IHistogram1D* hPositronEdep;
|
||||
AIDA::IHistogram1D* hOtherEdep;
|
||||
|
||||
AIDA::IFunctionFactory *funFact;
|
||||
AIDA::IFitFactory *fitFact;
|
||||
AIDA::IFunction *exponFun;
|
||||
AIDA::IFunction *gaussFun;
|
||||
AIDA::IFitter *e_fitter;
|
||||
AIDA::IFitResult *fitResult;
|
||||
|
||||
//AIDA::IFunctionFactory *funFact;
|
||||
//AIDA::IFitFactory *fitFact;
|
||||
//AIDA::IFunction *exponFun;
|
||||
//AIDA::IFunction *gaussFun;
|
||||
//AIDA::IFitter *e_fitter;
|
||||
///AIDA::IFitResult *fitResult;
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -42,12 +42,12 @@ DMXAnalysisManager* DMXAnalysisManager::instance = 0;
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
DMXAnalysisManager::DMXAnalysisManager() :
|
||||
af(0), tree(0), hf(0), tpf(0), pf(0),
|
||||
plotter(0), ntuple1(0), ntuple2(0), ntuple3(0), ntuple4(0),
|
||||
af(0), tree(0), hf(0), tpf(0),
|
||||
ntuple1(0), ntuple2(0), ntuple3(0), ntuple4(0),
|
||||
hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0),
|
||||
hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0),
|
||||
hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0),
|
||||
funFact(0),fitFact(0),exponFun(0),gaussFun(0),e_fitter(0),fitResult(0)
|
||||
hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0)
|
||||
//,funFact(0),fitFact(0),exponFun(0),gaussFun(0),e_fitter(0),fitResult(0)
|
||||
{
|
||||
// tree is created and booked inside book()
|
||||
;
|
||||
@@ -56,9 +56,12 @@ DMXAnalysisManager::DMXAnalysisManager() :
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
DMXAnalysisManager::~DMXAnalysisManager()
|
||||
{
|
||||
Finish();
|
||||
}
|
||||
{
|
||||
delete tpf;
|
||||
delete hf;
|
||||
delete tree;
|
||||
delete af;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -70,7 +73,7 @@ DMXAnalysisManager* DMXAnalysisManager::getInstance()
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
void DMXAnalysisManager::book(G4String histogramfile, G4bool plotevent)
|
||||
void DMXAnalysisManager::book(G4String histogramfile, G4bool)
|
||||
|
||||
{
|
||||
// histoManager->selectStore("DMX.his");
|
||||
@@ -82,7 +85,7 @@ void DMXAnalysisManager::book(G4String histogramfile, G4bool plotevent)
|
||||
|
||||
|
||||
//parameters for the TreeFactory
|
||||
G4bool fileExists = false;
|
||||
G4bool fileExists = true;
|
||||
G4bool readOnly = false;
|
||||
|
||||
AIDA::ITreeFactory * tf = af->createTreeFactory();
|
||||
@@ -102,27 +105,27 @@ void DMXAnalysisManager::book(G4String histogramfile, G4bool plotevent)
|
||||
ntuple1 = tpf->create( "1", "Particle Source Energy",
|
||||
"double energy" );
|
||||
|
||||
assert(ntuple1);
|
||||
// assert(ntuple1);
|
||||
|
||||
// ---- secondary ntuple ------
|
||||
|
||||
ntuple2 = tpf->create( "2", "Scintillation Hits Info",
|
||||
"float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,1stpart,1stparte,gamma,neutron,posi,elec,other,seed1,seed2" );
|
||||
|
||||
assert(ntuple2);
|
||||
//assert(ntuple2);
|
||||
|
||||
// ---- tertiary ntuple ------
|
||||
|
||||
ntuple3 = tpf->create( "3", "PMT Hits Info",
|
||||
"float event, hits, xpos, ypos, zpos" );
|
||||
|
||||
assert(ntuple3);
|
||||
//assert(ntuple3);
|
||||
|
||||
// ---- extra ntuple ------
|
||||
ntuple4 = tpf->create( "4", "Particles energy type",
|
||||
"float energy, NameIdx" );
|
||||
|
||||
assert(ntuple4);
|
||||
//assert(ntuple4);
|
||||
|
||||
|
||||
// Creating an 1-dimensional histogram in the root directory of the tree
|
||||
@@ -161,42 +164,42 @@ void DMXAnalysisManager::book(G4String histogramfile, G4bool plotevent)
|
||||
|
||||
delete tf;
|
||||
|
||||
// Creating the plotter factory
|
||||
pf = af->createPlotterFactory();
|
||||
// // Creating the plotter factory
|
||||
// pf = af->createPlotterFactory();
|
||||
|
||||
if(pf && plotevent) {
|
||||
plotter = pf->create();
|
||||
if(plotter) {
|
||||
plotter->show();
|
||||
plotter->setParameter("pageTitle","DMX Output Summary");
|
||||
}
|
||||
delete pf;
|
||||
}
|
||||
// if(pf && plotevent) {
|
||||
// plotter = pf->create();
|
||||
// if(plotter) {
|
||||
// plotter->show();
|
||||
// plotter->setParameter("pageTitle","DMX Output Summary");
|
||||
// }
|
||||
// delete pf;
|
||||
// }
|
||||
|
||||
// create fitting factories ..
|
||||
|
||||
G4cout << " creating fit factories " << G4endl;
|
||||
// G4cout << " creating fit factories " << G4endl;
|
||||
|
||||
funFact = af->createFunctionFactory(*tree);
|
||||
fitFact = af->createFitFactory();
|
||||
// funFact = af->createFunctionFactory(*tree);
|
||||
// fitFact = af->createFitFactory();
|
||||
|
||||
G4cout << " creating Exponential Function " << G4endl;
|
||||
exponFun = funFact->createFunctionByName("Exponential","E");
|
||||
G4cout << " created " << G4endl;
|
||||
// G4cout << " creating Exponential Function " << G4endl;
|
||||
// exponFun = funFact->createFunctionByName("Exponential","E");
|
||||
// G4cout << " created " << G4endl;
|
||||
|
||||
G4cout << " creating Gaussian Function " << G4endl;
|
||||
gaussFun = funFact->createFunctionByName("Gaussian","G");
|
||||
G4cout << " created " << G4endl;
|
||||
// G4cout << " creating Gaussian Function " << G4endl;
|
||||
// gaussFun = funFact->createFunctionByName("Gaussian","G");
|
||||
// G4cout << " created " << G4endl;
|
||||
|
||||
// assert(exponFun);
|
||||
|
||||
// e_fitter = fitFact->createFitter("Chi2","","printLevel=-1 errorUP=1.0");
|
||||
G4cout << " creating fitter " << G4endl;
|
||||
e_fitter = fitFact->createFitter();
|
||||
// // e_fitter = fitFact->createFitter("Chi2","","printLevel=-1 errorUP=1.0");
|
||||
// G4cout << " creating fitter " << G4endl;
|
||||
// e_fitter = fitFact->createFitter();
|
||||
|
||||
// assert(e_fitter);
|
||||
// // assert(e_fitter);
|
||||
|
||||
G4cout << " Created e_fitter " << G4endl;
|
||||
// G4cout << " Created e_fitter " << G4endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -212,25 +215,19 @@ void DMXAnalysisManager::Finish()
|
||||
{
|
||||
|
||||
// Committing the transaction with the tree
|
||||
std::cout << "Committing..." << std::endl;
|
||||
G4cout << "Committing..." << G4endl;
|
||||
// write all histograms to file
|
||||
tree->commit();
|
||||
|
||||
std::cout << "Closing the tree..." << std::endl;
|
||||
G4cout << "Closing the tree..." << G4endl;
|
||||
|
||||
// close (will again commit)
|
||||
tree->close();
|
||||
|
||||
// extra delete as objects are created in book() method rather than during
|
||||
// initialisation of class
|
||||
delete pf;
|
||||
delete tpf;
|
||||
delete hf;
|
||||
delete tree;
|
||||
delete af;
|
||||
delete plotter;
|
||||
delete funFact;
|
||||
delete fitFact;
|
||||
//delete funFact;
|
||||
//delete fitFact;
|
||||
|
||||
}
|
||||
|
||||
@@ -240,74 +237,74 @@ void DMXAnalysisManager::PulseTimeFit()
|
||||
|
||||
// created fitter factory then fitter
|
||||
|
||||
if(!plotter) plotter = pf->create();
|
||||
if(plotter) {
|
||||
plotter->show();
|
||||
plotter->setParameter("pageTitle","DMX Fitting");
|
||||
}
|
||||
// if(!plotter) plotter = pf->create();
|
||||
// if(plotter) {
|
||||
// plotter->show();
|
||||
// plotter->setParameter("pageTitle","DMX Fitting");
|
||||
// }
|
||||
|
||||
G4cout << " Started Pulse Time Fit " << G4endl;
|
||||
int i;
|
||||
for (i = 0; i < 2 ; ++i)
|
||||
G4cout << "\n Fit Parameters: " << i << ":\t"
|
||||
<< exponFun->parameterNames()[i] << G4endl;
|
||||
// first fit to time histogram:
|
||||
exponFun->setParameter("amp", 3.);
|
||||
exponFun->setParameter("slope", -0.03);
|
||||
G4cout << " parameters set " << G4endl;
|
||||
// G4cout << " Started Pulse Time Fit " << G4endl;
|
||||
// int i;
|
||||
// for (i = 0; i < 2 ; ++i)
|
||||
// G4cout << "\n Fit Parameters: " << i << ":\t"
|
||||
// << exponFun->parameterNames()[i] << G4endl;
|
||||
// // first fit to time histogram:
|
||||
// exponFun->setParameter("amp", 3.);
|
||||
// exponFun->setParameter("slope", -0.03);
|
||||
// G4cout << " parameters set " << G4endl;
|
||||
|
||||
fitResult = e_fitter->fit(*hPhArrival,*exponFun);
|
||||
// fitResult = e_fitter->fit(*hPhArrival,*exponFun);
|
||||
|
||||
G4cout << " Fit Completed " << G4endl;
|
||||
G4cout << " chi2/ndf is: " << fitResult->quality() << " / "
|
||||
<< fitResult->ndf() << G4endl;
|
||||
// G4cout << " Fit Completed " << G4endl;
|
||||
// G4cout << " chi2/ndf is: " << fitResult->quality() << " / "
|
||||
// << fitResult->ndf() << G4endl;
|
||||
|
||||
// retrieve fitted parameters and errors and print them
|
||||
// // retrieve fitted parameters and errors and print them
|
||||
|
||||
for (i = 0; i < 2 ; ++i)
|
||||
G4cout << fitResult->fittedParameterNames()[i] << " = "
|
||||
<< fitResult->fittedParameters()[i] << " +/- "
|
||||
<< fitResult->errors()[i];
|
||||
// for (i = 0; i < 2 ; ++i)
|
||||
// G4cout << fitResult->fittedParameterNames()[i] << " = "
|
||||
// << fitResult->fittedParameters()[i] << " +/- "
|
||||
// << fitResult->errors()[i];
|
||||
|
||||
// plot function with its annotation and then histogram
|
||||
// // plot function with its annotation and then histogram
|
||||
|
||||
plotter->currentRegion().plot(*exponFun,"[0,100] annotation");
|
||||
plotter->currentRegion().plot(*hPhArrival, "overlay");
|
||||
plotter->refresh();
|
||||
plotter->writeToFile("ExponentialFit.ps","ps");
|
||||
// plotter->currentRegion().plot(*exponFun,"[0,100] annotation");
|
||||
// plotter->currentRegion().plot(*hPhArrival, "overlay");
|
||||
// plotter->refresh();
|
||||
// plotter->writeToFile("ExponentialFit.ps","ps");
|
||||
|
||||
|
||||
for (i = 0; i < 3 ; ++i)
|
||||
G4cout << "\n Fit Parameters: " << i << ":\t"
|
||||
<< gaussFun->parameterNames()[i] << G4endl;
|
||||
// first fit to time histogram:
|
||||
gaussFun->setParameter("mean", 50.);
|
||||
gaussFun->setParameter("sigma", 10.);
|
||||
gaussFun->setParameter("amp", 2.);
|
||||
G4cout << " parameters set " << G4endl;
|
||||
// for (i = 0; i < 3 ; ++i)
|
||||
// G4cout << "\n Fit Parameters: " << i << ":\t"
|
||||
// << gaussFun->parameterNames()[i] << G4endl;
|
||||
// // first fit to time histogram:
|
||||
// gaussFun->setParameter("mean", 50.);
|
||||
// gaussFun->setParameter("sigma", 10.);
|
||||
// gaussFun->setParameter("amp", 2.);
|
||||
// G4cout << " parameters set " << G4endl;
|
||||
|
||||
fitResult = e_fitter->fit(*hAvPhArrival,*gaussFun);
|
||||
// fitResult = e_fitter->fit(*hAvPhArrival,*gaussFun);
|
||||
|
||||
G4cout << " Fit Completed " << G4endl;
|
||||
G4cout << " chi2/ndf is: " << fitResult->quality() << " / "
|
||||
<< fitResult->ndf() << G4endl;
|
||||
// G4cout << " Fit Completed " << G4endl;
|
||||
// G4cout << " chi2/ndf is: " << fitResult->quality() << " / "
|
||||
// << fitResult->ndf() << G4endl;
|
||||
|
||||
// retrieve fitted parameters and errors and print them
|
||||
// // retrieve fitted parameters and errors and print them
|
||||
|
||||
for (i = 0; i < 3 ; ++i)
|
||||
G4cout << fitResult->fittedParameterNames()[i] << " = "
|
||||
<< fitResult->fittedParameters()[i] << " +/- "
|
||||
<< fitResult->errors()[i];
|
||||
// for (i = 0; i < 3 ; ++i)
|
||||
// G4cout << fitResult->fittedParameterNames()[i] << " = "
|
||||
// << fitResult->fittedParameters()[i] << " +/- "
|
||||
// << fitResult->errors()[i];
|
||||
|
||||
// plot function with its annotation and then histogram
|
||||
// // plot function with its annotation and then histogram
|
||||
|
||||
plotter->createRegions(1,1);
|
||||
plotter->currentRegion().plot(*gaussFun,"[0,100] annotation");
|
||||
plotter->currentRegion().plot(*hAvPhArrival, "overlay");
|
||||
plotter->refresh();
|
||||
plotter->writeToFile("TimeConstantFit.ps","ps");
|
||||
// plotter->createRegions(1,1);
|
||||
// plotter->currentRegion().plot(*gaussFun,"[0,100] annotation");
|
||||
// plotter->currentRegion().plot(*hAvPhArrival, "overlay");
|
||||
// plotter->refresh();
|
||||
// plotter->writeToFile("TimeConstantFit.ps","ps");
|
||||
|
||||
G4cout << " Fit finished " << G4endl;
|
||||
// G4cout << " Fit finished " << G4endl;
|
||||
|
||||
}
|
||||
|
||||
@@ -338,28 +335,28 @@ void DMXAnalysisManager::analyseScintHits(G4int event_id, G4double energy_pri, G
|
||||
|
||||
hAvPhArrival->fill(aveTimePmtHits/ns);
|
||||
|
||||
AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );
|
||||
// AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );
|
||||
|
||||
// Fill the ntuple
|
||||
ntuple->fill( ntuple->findColumn( "Event" ), (G4float) event_id );
|
||||
ntuple->fill( ntuple->findColumn( "e_prim" ), (G4float) energy_pri/keV );
|
||||
ntuple->fill( ntuple->findColumn( "tot_e" ), (G4float) totEnergy );
|
||||
ntuple->fill( ntuple->findColumn( "s_hits" ), (G4float) S_hits );
|
||||
ntuple->fill( ntuple->findColumn( "xe_time" ), (G4float) firstLXeHitTime );
|
||||
ntuple->fill( ntuple->findColumn( "num_ph" ), (G4float) P_hits );
|
||||
ntuple->fill( ntuple->findColumn( "avphtime"), (G4float) aveTimePmtHits );
|
||||
ntuple->fill( ntuple->findColumn( "1stpart" ), (G4float) firstparticleIndex);
|
||||
ntuple->fill( ntuple->findColumn( "1stparte"), (G4float) firstParticleE );
|
||||
ntuple->fill( ntuple->findColumn( "gamma" ), (G4float) gamma_ev );
|
||||
ntuple->fill( ntuple->findColumn( "neutron" ), (G4float) neutron_ev );
|
||||
ntuple->fill( ntuple->findColumn( "posi" ), (G4float) positron_ev );
|
||||
ntuple->fill( ntuple->findColumn( "elec" ), (G4float) electron_ev );
|
||||
ntuple->fill( ntuple->findColumn( "other" ), (G4float) other_ev );
|
||||
ntuple->fill( ntuple->findColumn( "seed1" ), (G4float) seed1 );
|
||||
ntuple->fill( ntuple->findColumn( "seed2" ), (G4float) seed2 );
|
||||
ntuple2->fill( ntuple2->findColumn( "Event" ), (G4float) event_id );
|
||||
ntuple2->fill( ntuple2->findColumn( "e_prim" ), (G4float) energy_pri/keV );
|
||||
ntuple2->fill( ntuple2->findColumn( "tot_e" ), (G4float) totEnergy );
|
||||
ntuple2->fill( ntuple2->findColumn( "s_hits" ), (G4float) S_hits );
|
||||
ntuple2->fill( ntuple2->findColumn( "xe_time" ), (G4float) firstLXeHitTime );
|
||||
ntuple2->fill( ntuple2->findColumn( "num_ph" ), (G4float) P_hits );
|
||||
ntuple2->fill( ntuple2->findColumn( "avphtime"), (G4float) aveTimePmtHits );
|
||||
ntuple2->fill( ntuple2->findColumn( "1stpart" ), (G4float) firstparticleIndex);
|
||||
ntuple2->fill( ntuple2->findColumn( "1stparte"), (G4float) firstParticleE );
|
||||
ntuple2->fill( ntuple2->findColumn( "gamma" ), (G4float) gamma_ev );
|
||||
ntuple2->fill( ntuple2->findColumn( "neutron" ), (G4float) neutron_ev );
|
||||
ntuple2->fill( ntuple2->findColumn( "posi" ), (G4float) positron_ev );
|
||||
ntuple2->fill( ntuple2->findColumn( "elec" ), (G4float) electron_ev );
|
||||
ntuple2->fill( ntuple2->findColumn( "other" ), (G4float) other_ev );
|
||||
ntuple2->fill( ntuple2->findColumn( "seed1" ), (G4float) seed1 );
|
||||
ntuple2->fill( ntuple2->findColumn( "seed2" ), (G4float) seed2 );
|
||||
|
||||
//Values of attributes are prepared; store them to the nTuple:
|
||||
ntuple->addRow();
|
||||
ntuple2->addRow();
|
||||
|
||||
}
|
||||
|
||||
@@ -374,38 +371,31 @@ void DMXAnalysisManager::analysePMTHits(G4int event, G4int i, G4double x, G4doub
|
||||
h1stPMTHit->fill(x,y);
|
||||
}
|
||||
|
||||
AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") );
|
||||
//AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") );
|
||||
// Fill the secondaries ntuple
|
||||
ntuple->fill( ntuple->findColumn( "event" ), (G4float) event );
|
||||
ntuple->fill( ntuple->findColumn( "hits" ), (G4float) i );
|
||||
ntuple->fill( ntuple->findColumn( "xpos" ), (G4float) x );
|
||||
ntuple->fill( ntuple->findColumn( "ypos" ), (G4float) y );
|
||||
ntuple->fill( ntuple->findColumn( "zpos" ), (G4float) z );
|
||||
ntuple3->fill( ntuple3->findColumn( "event" ), (G4float) event );
|
||||
ntuple3->fill( ntuple3->findColumn( "hits" ), (G4float) i );
|
||||
ntuple3->fill( ntuple3->findColumn( "xpos" ), (G4float) x );
|
||||
ntuple3->fill( ntuple3->findColumn( "ypos" ), (G4float) y );
|
||||
ntuple3->fill( ntuple3->findColumn( "zpos" ), (G4float) z );
|
||||
|
||||
// NEW: Values of attributes are prepared; store them to the nTuple:
|
||||
ntuple->addRow(); // check for returning true ...
|
||||
ntuple3->addRow(); // check for returning true ...
|
||||
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void DMXAnalysisManager::analysePrimaryGenerator(G4double energy)
|
||||
{
|
||||
|
||||
AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );
|
||||
// AIDA::ITuple * ntuple1 = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );
|
||||
// Fill energy ntple:
|
||||
ntuple->fill( ntuple->findColumn( "energy" ), energy );
|
||||
ntuple1->fill( ntuple1->findColumn( "energy" ), energy );
|
||||
|
||||
// NEW: Values of attributes are prepared; store them to the nTuple:
|
||||
ntuple->addRow(); // check for returning true ...
|
||||
ntuple1->addRow(); // check for returning true ...
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void DMXAnalysisManager::analyseParticleSource(G4double energy, G4String name)
|
||||
{
|
||||
|
||||
@@ -436,24 +426,23 @@ void DMXAnalysisManager::HistTime(G4double time)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void DMXAnalysisManager::PlotHistosInter(G4int flag)
|
||||
void DMXAnalysisManager::PlotHistosInter(G4int)
|
||||
{
|
||||
// The plotter is updated only if there are some hits in the event
|
||||
if(!flag) return;
|
||||
// Set the plotter ; set the number of regions and attach histograms
|
||||
// to plot for each region.
|
||||
// It is done here, since then EndOfRun set regions
|
||||
// for paper output.
|
||||
if(plotter) {
|
||||
plotter->currentRegion().plot(*hNumPhLow);
|
||||
plotter->refresh();
|
||||
}
|
||||
// // The plotter is updated only if there are some hits in the event
|
||||
// if(!flag) return;
|
||||
// // Set the plotter ; set the number of regions and attach histograms
|
||||
// // to plot for each region.
|
||||
// // It is done here, since then EndOfRun set regions
|
||||
// // for paper output.
|
||||
// if(plotter) {
|
||||
// plotter->currentRegion().plot(*hNumPhLow);
|
||||
// plotter->refresh();
|
||||
// }
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
void DMXAnalysisManager::PlotHistos(G4bool interactive)
|
||||
void DMXAnalysisManager::PlotHistos(G4bool)
|
||||
{
|
||||
|
||||
/*
|
||||
if(!plotter) plotter = pf->create();
|
||||
plotter->show();
|
||||
plotter->setParameter("pageTitle","DMX Output Summary");
|
||||
@@ -492,12 +481,7 @@ void DMXAnalysisManager::PlotHistos(G4bool interactive)
|
||||
G4cout << "Press <ENTER> to exit" << G4endl;
|
||||
G4cin.get();
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -255,14 +255,14 @@ void DMXEventAction::EndOfEventAction(const G4Event* evt) {
|
||||
<< G4BestUnit(aveTimePmtHits,"Time") << G4endl;
|
||||
G4cout << " Number of PMT hits (photoelectron equivalent): "
|
||||
<< P_hits << G4endl;
|
||||
#ifdef G4ANALYSIS_USE
|
||||
//#ifdef G4ANALYSIS_USE
|
||||
// plot histograms, interactively:
|
||||
G4bool plotevent=runAct->Getplotevent();
|
||||
if(plotevent) {
|
||||
DMXAnalysisManager* analysis = DMXAnalysisManager::getInstance();
|
||||
analysis->PlotHistosInter(P_hits);
|
||||
}
|
||||
#endif
|
||||
//G4bool plotevent=runAct->Getplotevent();
|
||||
//if(plotevent) {
|
||||
// DMXAnalysisManager* analysis = DMXAnalysisManager::getInstance();
|
||||
// analysis->PlotHistosInter(P_hits);
|
||||
//}
|
||||
//#endif
|
||||
}
|
||||
// write out (x,y,z) of PMT hits
|
||||
if (savePmtFlag)
|
||||
|
||||
@@ -94,8 +94,6 @@ void DMXRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
analysis->book(savehistFile, plotevent);
|
||||
// analysis->PlotHistosInit();
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -105,8 +103,8 @@ void DMXRunAction::EndOfRunAction(const G4Run*)
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
DMXAnalysisManager* analysis = DMXAnalysisManager::getInstance();
|
||||
analysis->PlotHistos(interactplot);
|
||||
analysis->PulseTimeFit();
|
||||
//analysis->PlotHistos(interactplot);
|
||||
//analysis->PulseTimeFit();
|
||||
analysis->Finish();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -172,5 +172,5 @@ void DMXSteppingAction::UserSteppingAction(const G4Step* fStep)
|
||||
}
|
||||
|
||||
}
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user