44 #include "AIDA/IHistogram1D.h"
45 #include "AIDA/IHistogram2D.h"
47 #include "AIDA/IManagedObject.h"
48 #include "AIDA/IAnalysisFactory.h"
49 #include "AIDA/IHistogramFactory.h"
50 #include "AIDA/ITupleFactory.h"
51 #include "AIDA/ITreeFactory.h"
52 #include "AIDA/ITree.h"
53 #include "AIDA/ITuple.h"
55 PurgMagAnalysisManager* PurgMagAnalysisManager::instance = 0;
60 PurgMagAnalysisManager::PurgMagAnalysisManager() :
61 aFact(0), theTree(0), tupFact(0)
66 aFact = AIDA_createAnalysisFactory();
68 AIDA::ITreeFactory *treeFact = aFact->createTreeFactory();
73 std::string fileName=
"purgmag.hbk";
74 theTree = treeFact->create(fileName,
"hbook",
false,
true);
78 tupFact = aFact->createTupleFactory ( *theTree );
84 PurgMagAnalysisManager::~PurgMagAnalysisManager()
102 PurgMagAnalysisManager* PurgMagAnalysisManager::getInstance()
104 if (instance == 0) instance =
new PurgMagAnalysisManager;
111 void PurgMagAnalysisManager::book()
115 std::string options =
"";
118 std::string columnNames1 =
"double ex; double ey; double ez; double ee; double epx; double epy; double epz";
119 if (tupFact)
ntuple1 = tupFact->create(
"1",
"1",columnNames1, options);
124 std::string columnNames2 =
"double gx; double gy; double gz; double ge; double gpx; double gpy; double gpz";
125 if (tupFact)
ntuple2 = tupFact->create(
"2",
"2",columnNames2, options);
130 std::string columnNames3 =
"double px; double py; double pz; double pe; double ppx; double ppy; double ppz";
131 if (tupFact)
ntuple3 = tupFact->create(
"3",
"3",columnNames3, options);
147 G4cout <<
"N-tuple 1 is zero " <<
"\n";
151 int iex =
ntuple1->findColumn(
"ex" );
152 int iey =
ntuple1->findColumn(
"ey" );
153 int iez =
ntuple1->findColumn(
"ez" );
154 int iee =
ntuple1->findColumn(
"ee" );
155 int iepx =
ntuple1->findColumn(
"epx" );
156 int iepy =
ntuple1->findColumn(
"epy" );
157 int iepz =
ntuple1->findColumn(
"epz" );
179 G4cout <<
"N-tuple 2 is zero" <<
"\n";
183 int igx =
ntuple2->findColumn(
"gx" );
184 int igy =
ntuple2->findColumn(
"gy" );
185 int igz =
ntuple2->findColumn(
"gz" );
186 int ige =
ntuple2->findColumn(
"ge" );
187 int igpx =
ntuple2->findColumn(
"gpx" );
188 int igpy =
ntuple2->findColumn(
"gpy" );
189 int igpz =
ntuple2->findColumn(
"gpz" );
211 G4cout <<
"N-tuple 3 is zero" <<
"\n";
215 int ipx =
ntuple3->findColumn(
"px" );
216 int ipy =
ntuple3->findColumn(
"py" );
217 int ipz =
ntuple3->findColumn(
"pz" );
218 int ipe =
ntuple3->findColumn(
"pe" );
219 int ippx =
ntuple3->findColumn(
"ppx" );
220 int ippy =
ntuple3->findColumn(
"ppy" );
221 int ippz =
ntuple3->findColumn(
"ppz" );
235 void PurgMagAnalysisManager::finish()