Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 08:29:42

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file HistoManager.cc
0027 /// \brief Implementation of the HistoManager class
0028 
0029 #include "HistoManager.hh"
0030 
0031 #include "G4UnitsTable.hh"
0032 
0033 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0034 
0035 HistoManager::HistoManager()
0036 {
0037   Book();
0038 }
0039 
0040 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0041 
0042 void HistoManager::Book()
0043 {
0044   // Create or get analysis manager
0045   //
0046   G4AnalysisManager* analysis = G4AnalysisManager::Instance();
0047 
0048   analysis->SetDefaultFileType("root");
0049   analysis->SetFileName(fFileName);
0050   analysis->SetVerboseLevel(1);
0051   analysis->SetActivation(true);  // enable inactivation of histos, nTuples
0052 
0053   // Default values (to be reset via /analysis/h1/set command)
0054   G4int nbins = 100;
0055   G4double vmin = 0.;
0056   G4double vmax = 100.;
0057 
0058   // Create all histograms as inactivated
0059   // as we have not yet set nbins, vmin, vmax
0060   //
0061   ////analysis->SetHistoDirectoryName("histo");
0062   ////analysis->SetFirstHistoId(1);
0063 
0064   G4int id = analysis->CreateH1("H10", "Energy deposit (MeV) in the target", nbins, vmin, vmax);
0065   analysis->SetH1Activation(id, false);
0066 
0067   id = analysis->CreateH1("H11", "Energy deposit (MeV) in the detector", nbins, vmin, vmax);
0068   analysis->SetH1Activation(id, false);
0069 
0070   id = analysis->CreateH1("H12", "Total energy (MeV) in target and detector", nbins, vmin, vmax);
0071   analysis->SetH1Activation(id, false);
0072 
0073   id = analysis->CreateH1("H13", "Coincidence spectrum (MeV) between the target and detector",
0074                           nbins, vmin, vmax);
0075   analysis->SetH1Activation(id, false);
0076 
0077   id =
0078     analysis->CreateH1("H14", "Anti-coincidence spectrum (MeV) in the traget", nbins, vmin, vmax);
0079   analysis->SetH1Activation(id, false);
0080 
0081   id =
0082     analysis->CreateH1("H15", "Anti-coincidence spectrum (MeV) in the detector", nbins, vmin, vmax);
0083   analysis->SetH1Activation(id, false);
0084 
0085   id = analysis->CreateH1("H16", "Decay emission spectrum (0 - 10 MeV)", nbins, vmin, vmax);
0086   analysis->SetH1Activation(id, false);
0087 
0088   id = analysis->CreateH1("H17", "Decay emission spectrum (0 - 1 MeV)", nbins, vmin, vmax);
0089   analysis->SetH1Activation(id, false);
0090 
0091   id = analysis->CreateH1("H18", "Decay emission spectrum (0 - 0.1 MeV)", nbins, vmin, vmax);
0092   analysis->SetH1Activation(id, false);
0093 
0094   // nTuples
0095   //
0096   ////analysis->SetNtupleDirectoryName("ntuple");
0097   ////analysis->SetFirstNtupleId(1);
0098   //
0099   analysis->CreateNtuple("T1", "Emitted Particles");
0100   analysis->CreateNtupleDColumn("PID");  // column 0
0101   analysis->CreateNtupleDColumn("Energy");  // column 1
0102   analysis->CreateNtupleDColumn("Time");  // column 2
0103   analysis->CreateNtupleDColumn("Weight");  // column 3
0104   analysis->FinishNtuple();
0105 
0106   analysis->CreateNtuple("T2", "RadioIsotopes");
0107   analysis->CreateNtupleDColumn("PID");  // column 0
0108   analysis->CreateNtupleDColumn("Time");  // column 1
0109   analysis->CreateNtupleDColumn("Weight");  // column 2
0110   analysis->FinishNtuple();
0111 
0112   analysis->CreateNtuple("T3", "Energy depositions");
0113   analysis->CreateNtupleDColumn("Energy");  // column 0
0114   analysis->CreateNtupleDColumn("Time");  // column 1
0115   analysis->CreateNtupleDColumn("Weight");  // column 2
0116   analysis->FinishNtuple();
0117 
0118   analysis->CreateNtuple("RDecayProducts", "All Products of RDecay");
0119   analysis->CreateNtupleDColumn("PID");  // column 0
0120   analysis->CreateNtupleDColumn("Z");  // column 1
0121   analysis->CreateNtupleDColumn("A");  // column 2
0122   analysis->CreateNtupleDColumn("Energy");  // column 3
0123   analysis->CreateNtupleDColumn("Time");  // column 4
0124   analysis->CreateNtupleDColumn("Weight");  // column 5
0125   analysis->FinishNtuple();
0126 
0127   analysis->SetNtupleActivation(false);
0128 }
0129 
0130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......