65 exrdmAnalysisManager::exrdmAnalysisManager()
66 : fVerbose(0), fNEvt1(-1), fNEvt2(-2),
67 fHistEMax (15.0*
MeV), fHistEMin (0.),fHistNBin(100),
77 exrdmAnalysisManager::~exrdmAnalysisManager()
82 #ifdef G4ANALYSIS_USE_ROOT
99 "Energy deposit (MeV) in the traget",fHistNBin,fHistEMin,fHistEMax,
MeV);
101 "Energy deposit (MeV) in the detector",fHistNBin,fHistEMin,fHistEMax,
MeV);
103 "Total energy spectrum (MeV) of the traget and detector",fHistNBin,
104 fHistEMin,fHistEMax,
MeV);
106 "Coincidence spectrum (MeV) between the traget and detector",fHistNBin,
107 fHistEMin,fHistEMax,
MeV);
109 "Anti-coincidence spectrum (MeV) in the traget",fHistNBin,
110 fHistEMin,fHistEMax,
MeV);
112 "Anti-coincidence spectrum (MeV) in the detector",fHistNBin,
113 fHistEMin,fHistEMax,
MeV);
115 "Decay emission spectrum (MeV)",fHistNBin,fHistEMin,fHistEMax,
MeV);
118 fHisto->
AddTuple(
"T1",
"Emitted Particles",
119 "double PID, Energy, Time, Weight" );
120 fHisto->
AddTuple(
"T2",
"RadioIsotopes",
"double PID, Time, Weight" );
121 fHisto->
AddTuple(
"T3",
"Energy Depositions",
"double Energy, Time, Weight" );
122 fHisto->
AddTuple(
"RDecayProducts",
"All Products of RDecay",
123 "double PID, Z, A, Energy, Time, Weight" );
131 G4cout <<
"exrdmAnalysisManager: Histograms are booked and the run has been started" <<
G4endl;
134 pTable->
FindProcess(
"RadioactiveDecay",
"GenericIon");
135 if (rDecay != NULL) {
137 std::vector<G4RadioactivityTable*> theTables =
139 for (
size_t i = 0 ; i < theTables.size(); i++) {
140 theTables[i]->GetTheMap()->clear();
141 G4cout <<
" Clear the radioactivity map: 0, new size = "
142 << theTables[i]->GetTheMap()->size() <<
G4endl;
154 G4cout <<
"exrdmAnalysisManager: Histograms have been saved!" <<
G4endl;
161 pTable->
FindProcess(
"RadioactiveDecay",
"GenericIon");
162 if (rDecay != NULL) {
165 std::ofstream outfile (fileName, std::ios::out );
166 std::vector<G4RadioactivityTable*> theTables =
168 for (
size_t i = 0 ; i < theTables.size(); i++) {
170 outfile <<
"Radioactivities in decay window no. " << i <<
G4endl;
172 "Z \tA \tE \tActivity (decays/window) \tError (decays/window) "
174 map<G4ThreeVector,G4TwoVector> *aMap = theTables[i]->GetTheMap();
175 map<G4ThreeVector,G4TwoVector>::iterator iter;
176 for(iter=aMap->begin(); iter != aMap->end(); iter++) {
177 rate = iter->second.x()/
nevent;
178 error = std::sqrt(iter->second.y())/nevent;
179 if ( rate < 0.) rate = 0.;
180 outfile << iter->first.x() <<
"\t"<< iter->first.y() <<
"\t"
181 << iter->first.z() <<
"\t" << rate <<
"\t" << error <<
G4endl;
202 G4double TarE = fEdepo[0].GetEnergy();
203 G4double Time = fEdepo[0].GetTime();
204 G4double TarW = fEdepo[0].GetEnergy()*fEdepo[0].GetWeight();
214 for (
size_t i = 1; i < fEdepo.size(); i++) {
215 if (std::fabs((fEdepo[i].GetTime()- Time)/
second) <= fPulseWidth) {
216 if ( fEdepo[i].GetEnergy() > 0. ) {
217 TarE += fEdepo[i].GetEnergy();
218 TarW += fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
220 DetE -= fEdepo[i].GetEnergy();
221 DetW -= fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
225 if (TarE || DetE) ComW = (TarW+DetW)/(TarE+DetE);
226 if (TarE) TarW /= TarE;
227 if (DetE) DetW /= DetE;
229 if (TarE) fHisto->
FillHisto(0,TarE,TarW);
230 if (DetE) fHisto->
FillHisto(1,DetE,DetW);
231 if (TarE+DetE) fHisto->
FillHisto(2,DetE+TarE,ComW);
232 if (DetE >= fDetectorThresE && TarE >= fTargetThresE )
234 if (TarE >= fTargetThresE && DetE < fDetectorThresE)
236 if (TarE < fTargetThresE && DetE >= fDetectorThresE)
240 TarE = fEdepo[i].GetEnergy();
241 Time = fEdepo[i].GetTime();
242 TarW = fEdepo[i].GetEnergy()*fEdepo[i].GetWeight();
254 if (TarE || DetE) ComW = (TarW+DetW)/(TarE+DetE);
255 if (TarE) TarW /= TarE;
256 if (DetE) DetW /= DetE;
258 if (TarE) fHisto->
FillHisto(0,TarE,TarW);
259 if (DetE) fHisto->
FillHisto(1,DetE,DetW);
260 if (TarE+DetE) fHisto->
FillHisto(2,DetE+TarE,ComW);
261 if (DetE >= fDetectorThresE && TarE >= fTargetThresE )
263 if (TarE >= fTargetThresE && DetE < fDetectorThresE)
265 if (TarE < fTargetThresE && DetE >= fDetectorThresE)
278 G4cout <<
"exrdmAnalysisManager::AddEnergy: e(keV)= " << edep/
keV
279 <<
" weight = " << weight <<
" time (s) = " << time/
second
297 G4cout <<
"exrdmAnalysisManager::AddParticle: " << pid
314 G4cout <<
"exrdmAnalysisManager::AddIsotope: " << pid