Ignore:
Timestamp:
Sep 30, 2010, 2:47:17 PM (14 years ago)
Author:
garnier
Message:

tag geant4.9.4 beta 1 + modifs locales

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/advanced/underground_physics/src/DMXAnalysisManager.cc

    r807 r1337  
    3535// 17 June 2002 Alex Howard    Successfully Modified to AIDA 2.2
    3636// 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)
    3740//
    3841// -------------------------------------------------------------------
     
    4649
    4750DMXAnalysisManager::DMXAnalysisManager() :
    48   af(0), tree(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),
    5053  hEsourcep(0), hEdepp(0), hEdepRecoil(0), hNumPhLow(0), hNumPhHigh(0),
    5154  hAvPhArrival(0), hPhArrival(0), hPMTHits(0), h1stPMTHit(0),hGammaEdep(0),
    5255  hNeutronEdep(0), hElectronEdep(0), hPositronEdep(0), hOtherEdep(0)
    5356  //,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{;}
    5858
    5959//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
    6060
    6161DMXAnalysisManager::~DMXAnalysisManager()
    62 {
    63   delete tpf;
    64   delete hf;
    65   delete tree;
    66   delete af;
    67  }
     62{;}
    6863
    6964//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    9287  G4bool readOnly   = false;
    9388
    94   AIDA::ITreeFactory     * tf = af->createTreeFactory();
     89  tf = af->createTreeFactory();
    9590
    9691  tree = tf->create(histogramfile, "hbook", readOnly, fileExists);
     
    109104                             "double energy" );
    110105
    111   //  assert(ntuple1);
    112 
    113106  // ---- secondary ntuple ------   
    114107
    115108  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" );
    119110
    120111  // ---- tertiary ntuple ------   
     
    122113  ntuple3 = tpf->create( "3", "PMT Hits Info",
    123114                                "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 
    133115
    134116  // Creating an 1-dimensional histogram in the root directory of the tree
     
    165147
    166148  hOtherEdep    = hf->createHistogram1D("95","Other Ener Deposit/keV", 1000,0.,1000.);
    167  
    168   delete tf;
    169149
    170150 //  // Creating the plotter factory
     
    204184
    205185//   G4cout << " Created e_fitter " << G4endl;
     186  return;
    206187
    207188}
     
    210191
    211192void DMXAnalysisManager::Init()
    212 {
    213 }
     193{;}
    214194
    215195//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
     
    227207  // close (will again commit)
    228208  tree->close();
     209
     210 
     211  delete tpf;
     212  delete hf;
     213  delete tree;
     214  delete tf;
     215  delete af;
    229216
    230217  // extra delete as objects are created in book() method rather than during
     
    339326  hAvPhArrival->fill(aveTimePmtHits/ns);
    340327
    341   // AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("2") );
    342 
    343328 // Fill the ntuple
    344329  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)    );
    346331  ntuple2->fill( ntuple2->findColumn( "tot_e"   ), (G4float) totEnergy         );
    347332  ntuple2->fill( ntuple2->findColumn( "s_hits"  ), (G4float) S_hits            );
     
    349334  ntuple2->fill( ntuple2->findColumn( "num_ph"  ), (G4float) P_hits            );
    350335  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    );
    353338  ntuple2->fill( ntuple2->findColumn( "gamma"   ), (G4float) gamma_ev          );
    354339  ntuple2->fill( ntuple2->findColumn( "neutron" ), (G4float) neutron_ev        );
     
    361346  //Values of attributes are prepared; store them to the nTuple:
    362347  ntuple2->addRow();
    363 
    364348}
    365349
     
    375359  }
    376360
    377   //AIDA::ITuple * ntuple = dynamic_cast<AIDA::ITuple *> ( tree->find("3") );
    378   // Fill the secondaries ntuple
     361  // Fill the ntuple
    379362  ntuple3->fill( ntuple3->findColumn( "event" ), (G4float) event );
    380363  ntuple3->fill( ntuple3->findColumn( "hits"  ), (G4float) i     );
     
    384367
    385368  // NEW: Values of attributes are prepared; store them to the nTuple:
    386   ntuple3->addRow(); // check for returning true ...
     369  ntuple3->addRow();
    387370
    388371}
     
    391374{
    392375
    393   // AIDA::ITuple * ntuple1 = dynamic_cast<AIDA::ITuple *> ( tree->find("1") );
    394376  // Fill energy ntple:
    395377  ntuple1->fill( ntuple1->findColumn( "energy" ), energy );
    396378
    397379  // NEW: Values of attributes are prepared; store them to the nTuple:
    398   ntuple1->addRow(); // check for returning true ...
     380  ntuple1->addRow();
    399381
    400382}
Note: See TracChangeset for help on using the changeset viewer.