- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/underground_physics/src/DMXAnalysisManager.cc
r807 r1337 35 35 // 17 June 2002 Alex Howard Successfully Modified to AIDA 2.2 36 36 // 17 November 2002 Alex Howard Migrated to AIDA 3.0 and added fitting 37 // 22 October 2009 Luciano Pandola Changed variables names for ntuple2 38 // (avoid problem with columns) and some 39 // clean-up (e.g. remove ntuple4) 37 40 // 38 41 // ------------------------------------------------------------------- … … 46 49 47 50 DMXAnalysisManager::DMXAnalysisManager() : 48 af(0), t ree(0), hf(0), tpf(0),49 ntuple1(0), ntuple2(0), ntuple3(0), ntuple4(0),51 af(0), tf(0),tree(0), hf(0), tpf(0), 52 ntuple1(0), ntuple2(0), ntuple3(0), 50 53 hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0), 51 54 hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0), 52 55 hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0) 53 56 //,funFact(0),fitFact(0),exponFun(0),gaussFun(0),e_fitter(0),fitResult(0) 54 { 55 // tree is created and booked inside book() 56 ; 57 } 57 {;} 58 58 59 59 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 60 60 61 61 DMXAnalysisManager::~DMXAnalysisManager() 62 { 63 delete tpf; 64 delete hf; 65 delete tree; 66 delete af; 67 } 62 {;} 68 63 69 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 92 87 G4bool readOnly = false; 93 88 94 AIDA::ITreeFactory *tf = af->createTreeFactory();89 tf = af->createTreeFactory(); 95 90 96 91 tree = tf->create(histogramfile, "hbook", readOnly, fileExists); … … 109 104 "double energy" ); 110 105 111 // assert(ntuple1);112 113 106 // ---- secondary ntuple ------ 114 107 115 108 ntuple2 = tpf->create( "2", "Scintillation Hits Info", 116 "float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,1stpart,1stparte,gamma,neutron,posi,elec,other,seed1,seed2" ); 117 118 //assert(ntuple2); 109 "float Event,e_prim,tot_e,s_hits,xe_time,num_ph,avphtime,firstpart,firstparte,gamma,neutron,posi,elec,other,seed1,seed2" ); 119 110 120 111 // ---- tertiary ntuple ------ … … 122 113 ntuple3 = tpf->create( "3", "PMT Hits Info", 123 114 "float event, hits, xpos, ypos, zpos" ); 124 125 //assert(ntuple3);126 127 // ---- extra ntuple ------128 ntuple4 = tpf->create( "4", "Particles energy type",129 "float energy, NameIdx" );130 131 //assert(ntuple4);132 133 115 134 116 // Creating an 1-dimensional histogram in the root directory of the tree … … 165 147 166 148 hOtherEdep = hf->createHistogram1D("95","Other Ener Deposit/keV", 1000,0.,1000.); 167 168 delete tf;169 149 170 150 // // Creating the plotter factory … … 204 184 205 185 // G4cout << " Created e_fitter " << G4endl; 186 return; 206 187 207 188 } … … 210 191 211 192 void DMXAnalysisManager::Init() 212 { 213 } 193 {;} 214 194 215 195 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... … … 227 207 // close (will again commit) 228 208 tree->close(); 209 210 211 delete tpf; 212 delete hf; 213 delete tree; 214 delete tf; 215 delete af; 229 216 230 217 // extra delete as objects are created in book() method rather than during … … 339 326 hAvPhArrival->fill(aveTimePmtHits/ns); 340 327 341 // AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );342 343 328 // Fill the ntuple 344 329 ntuple2->fill( ntuple2->findColumn( "Event" ), (G4float) event_id ); 345 ntuple2->fill( ntuple2->findColumn( "e_prim" ), (G4float) energy_pri/keV);330 ntuple2->fill( ntuple2->findColumn( "e_prim" ), (G4float) (energy_pri/keV) ); 346 331 ntuple2->fill( ntuple2->findColumn( "tot_e" ), (G4float) totEnergy ); 347 332 ntuple2->fill( ntuple2->findColumn( "s_hits" ), (G4float) S_hits ); … … 349 334 ntuple2->fill( ntuple2->findColumn( "num_ph" ), (G4float) P_hits ); 350 335 ntuple2->fill( ntuple2->findColumn( "avphtime"), (G4float) aveTimePmtHits ); 351 ntuple2->fill( ntuple2->findColumn( " 1stpart" ), (G4float) firstparticleIndex);352 ntuple2->fill( ntuple2->findColumn( " 1stparte"), (G4float) firstParticleE );336 ntuple2->fill( ntuple2->findColumn( "firstpart" ), (G4float) firstparticleIndex); 337 ntuple2->fill( ntuple2->findColumn( "firstparte"), (G4float) firstParticleE ); 353 338 ntuple2->fill( ntuple2->findColumn( "gamma" ), (G4float) gamma_ev ); 354 339 ntuple2->fill( ntuple2->findColumn( "neutron" ), (G4float) neutron_ev ); … … 361 346 //Values of attributes are prepared; store them to the nTuple: 362 347 ntuple2->addRow(); 363 364 348 } 365 349 … … 375 359 } 376 360 377 //AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") ); 378 // Fill the secondaries ntuple 361 // Fill the ntuple 379 362 ntuple3->fill( ntuple3->findColumn( "event" ), (G4float) event ); 380 363 ntuple3->fill( ntuple3->findColumn( "hits" ), (G4float) i ); … … 384 367 385 368 // NEW: Values of attributes are prepared; store them to the nTuple: 386 ntuple3->addRow(); // check for returning true ...369 ntuple3->addRow(); 387 370 388 371 } … … 391 374 { 392 375 393 // AIDA::ITuple * ntuple1 = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );394 376 // Fill energy ntple: 395 377 ntuple1->fill( ntuple1->findColumn( "energy" ), energy ); 396 378 397 379 // NEW: Values of attributes are prepared; store them to the nTuple: 398 ntuple1->addRow(); // check for returning true ...380 ntuple1->addRow(); 399 381 400 382 }
Note: See TracChangeset
for help on using the changeset viewer.