Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22: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 //
0030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 
0033 #include "HistoManager.hh"
0034 
0035 #include "G4UnitsTable.hh"
0036 
0037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0038 
0039 HistoManager::HistoManager()
0040 {
0041   Book();
0042 }
0043 
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0045 
0046 void HistoManager::Book()
0047 {
0048   // Create or get analysis manager
0049   //
0050   G4AnalysisManager* analysis = G4AnalysisManager::Instance();
0051 
0052   analysis->SetDefaultFileType("root");
0053   analysis->SetFileName(fFileName);
0054   analysis->SetVerboseLevel(1);
0055   analysis->SetActivation(true);  // enable inactivation of histos, nTuples
0056 
0057   // Default values (to be reset via /analysis/h1/set command)
0058   G4int nbins = 100;
0059   G4double vmin = 0.;
0060   G4double vmax = 100.;
0061 
0062   // Create all histograms as inactivated
0063   // as we have not yet set nbins, vmin, vmax
0064   //
0065   ////analysis->SetHistoDirectoryName("histo");
0066   ////analysis->SetFirstHistoId(1);
0067 
0068   G4int id = analysis->CreateH1("H10", "Energy deposit (MeV) in the target", nbins, vmin, vmax);
0069   analysis->SetH1Activation(id, false);
0070 
0071   id = analysis->CreateH1("H11", "Energy deposit (MeV) in the detector", nbins, vmin, vmax);
0072   analysis->SetH1Activation(id, false);
0073 
0074   id = analysis->CreateH1("H12", "Total energy (MeV) in target and detector", nbins, vmin, vmax);
0075   analysis->SetH1Activation(id, false);
0076 
0077   id = analysis->CreateH1("H13", "Coincidence spectrum (MeV) between the target and detector",
0078                           nbins, vmin, vmax);
0079   analysis->SetH1Activation(id, false);
0080 
0081   id =
0082     analysis->CreateH1("H14", "Anti-coincidence spectrum (MeV) in the traget", nbins, vmin, vmax);
0083   analysis->SetH1Activation(id, false);
0084 
0085   id =
0086     analysis->CreateH1("H15", "Anti-coincidence spectrum (MeV) in the detector", nbins, vmin, vmax);
0087   analysis->SetH1Activation(id, false);
0088 
0089   id = analysis->CreateH1("H16", "Decay emission spectrum (0 - 10 MeV)", nbins, vmin, vmax);
0090   analysis->SetH1Activation(id, false);
0091 
0092   id = analysis->CreateH1("H17", "Decay emission spectrum (0 - 1 MeV)", nbins, vmin, vmax);
0093   analysis->SetH1Activation(id, false);
0094 
0095   id = analysis->CreateH1("H18", "Decay emission spectrum (0 - 0.1 MeV)", nbins, vmin, vmax);
0096   analysis->SetH1Activation(id, false);
0097 
0098   // nTuples
0099   //
0100   ////analysis->SetNtupleDirectoryName("ntuple");
0101   ////analysis->SetFirstNtupleId(1);
0102   //
0103   analysis->CreateNtuple("T1", "Emitted Particles");
0104   analysis->CreateNtupleDColumn("PID");  // column 0
0105   analysis->CreateNtupleDColumn("Energy");  // column 1
0106   analysis->CreateNtupleDColumn("Time");  // column 2
0107   analysis->CreateNtupleDColumn("Weight");  // column 3
0108   analysis->FinishNtuple();
0109 
0110   analysis->CreateNtuple("T2", "RadioIsotopes");
0111   analysis->CreateNtupleDColumn("PID");  // column 0
0112   analysis->CreateNtupleDColumn("Time");  // column 1
0113   analysis->CreateNtupleDColumn("Weight");  // column 2
0114   analysis->FinishNtuple();
0115 
0116   analysis->CreateNtuple("T3", "Energy depositions");
0117   analysis->CreateNtupleDColumn("Energy");  // column 0
0118   analysis->CreateNtupleDColumn("Time");  // column 1
0119   analysis->CreateNtupleDColumn("Weight");  // column 2
0120   analysis->FinishNtuple();
0121 
0122   analysis->CreateNtuple("RDecayProducts", "All Products of RDecay");
0123   analysis->CreateNtupleDColumn("PID");  // column 0
0124   analysis->CreateNtupleDColumn("Z");  // column 1
0125   analysis->CreateNtupleDColumn("A");  // column 2
0126   analysis->CreateNtupleDColumn("Energy");  // column 3
0127   analysis->CreateNtupleDColumn("Time");  // column 4
0128   analysis->CreateNtupleDColumn("Weight");  // column 5
0129   analysis->FinishNtuple();
0130 
0131   analysis->SetNtupleActivation(false);
0132 }
0133 
0134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......