Commit 5b022b26 authored by Chad Lantz's avatar Chad Lantz
Browse files

Added additional comments for doxygen

parent 44914768
/** @file Containers.cpp
/** @ingroup ana
* @file Containers.cpp
* @brief Implementation of Containers class.
*
*
......
/** @file DataReader.cxxs
* @brief Implementation of DataReader.
/** @defgroup ana Analysis
* @ingroup ana
* @file DataReader.cpp
* @brief Implementation of DataReader.
*
* Function definitions for DataReader are provided.
* This class reads a rootfile with raw waveforms
......
/** @file Detector.cpp
/** @ingroup ana
* @file Detector.cpp
* @brief Implementation of Detector.
*
* Function definitions for Detector are provided.
* This is the mother class for detectors.
* Function definitions for Detector are provided.
* This is the mother class for detectors.
* Methods common to all detectors are implemented here.
*
* @author Chad Lantz, Riccardo Longo
* @bug No known bugs.
*/
#include "Detector.h"
#include "Containers.h"
#include <vector>
/** @brief Default Constructor for Detector.
*/
Detector::Detector( ){
......@@ -34,10 +35,10 @@ Detector::~Detector( ){
* Returns a pointer to the Channel stored in m_Elements with the
* requested row and column.
* If the requested element is not found, return a warning message and a NULL pointer.
*
*
*/
Channel* Detector::GetElement(int row, int column){
for(int i=0; i < (int)m_Element.size(); i++){
if(row == m_Element[i]->mapping_row && column == m_Element[i]->mapping_column){
return m_Element[i];
......@@ -45,7 +46,7 @@ Channel* Detector::GetElement(int row, int column){
}
std::cerr << " WARNING: Element (" << row << "," << column << ") not found! " << std::endl;
return nullptr;
}
/** @brief Get the properties of a detector element
......@@ -53,16 +54,16 @@ Channel* Detector::GetElement(int row, int column){
* Returns a pointer to the Channel stored in m_Elements with the
* requested channel name.
* If the requested element is not found, return a warning message and a NULL pointer.
*
*
*/
Channel* Detector::GetElement(std::string _name){
for(int i=0; i < (int)m_Element.size(); i++){
if(!_name.compare(m_Element.at(i)->name)) return m_Element[i];
}
std::cerr << " WARNING: Element (" << _name << ") not found! " << std::endl;
return nullptr;
}
/**
......@@ -106,13 +107,3 @@ void Detector::FillHistograms(){
} // End loop over samples in each channel
}
}
/** @file EventTimer.cxx
/** @ingroup ana
* @file EventTimer.cpp
* @brief Implementation of EventTimer.
*
* Function definitions for EventTimer are provided.
* Function definitions for EventTimer are provided.
* This class is a reimplementation of TTimer with
* a new notify method for JZCaPA
*
......@@ -32,20 +33,20 @@ EventTimer::EventTimer(Long_t milliSec, DataReader* obj, Bool_t mode)
*
*/
EventTimer::~EventTimer(){
}
/** @brief Notify when timer times out.
*
* Calls the update method from the object pointer
* The timer is always reset. To stop the timer
* The timer is always reset. To stop the timer
* call TurnOff().
*/
Bool_t EventTimer::Notify(){
Timeout(); // emit Timeout() signal
if (m_object) m_object->UpdateConsole( m_rate );
Reset();
return kTRUE;
}
\ No newline at end of file
}
/** @file RPD.cpp
/** @ingroup ana
* @file RPD.cpp
* @brief Implementation of RPD.
*
* Function definitions for RPD are provided.
......
/** @file RPDAnalysis.cxx
/** @ingroup ana
* @file RPDAnalysis.cpp
* @brief Implementation of RPDAnalysis.
*
*
......
/** @file Visualizer.cpp
/** @ingroup ana
* @file Visualizer.cpp
* @brief Implementation of Visualizer class.
*
*
......
/** @file WFAnalysis.cxx
/** @ingroup ana
* @file WFAnalysis.cpp
* @brief Implementation of WFAnalysis.
*
* Function definitions for WFAnalysis are provided.
......
/** @file XMLSettingsReader.cpp
/** @ingroup ana
* @file XMLSettingsReader.cpp
* @brief Implementation of XMLSettingsReader.
*
* Function definitions for XMLSettingsReader are provided.
......@@ -238,6 +239,3 @@ bool XMLSettingsReader::parseFile(std::string _fileName){
return true;
}
/** @file ZDC.cpp
/** @ingroup ana
* @file ZDC.cpp
* @brief Implementation of ZDC.
*
* Function definitions for ZDC are provided.
......
/** @file ZDCAnalysis.cxx
/** @ingroup ana
* @file ZDCAnalysis.cpp
* @brief Implementation of ZDCAnalysis.
*
*
* Function definitions for ZDCAnalysis are provided.
*
* Function definitions for ZDCAnalysis are provided.
* This class is the main class for the ZDC analysis.
* The analysis is done on both ZDCs simultaneously
*
*
*
* @author Chad Lantz
* @bug No known bugs.
*/
#include "ZDCAnalysis.h"
#include "ZDC.h"
#include "Containers.h"
......@@ -34,7 +35,7 @@ ZDCAnalysis::~ZDCAnalysis( ){
/** @brief Initialization method for ZDCAnalysis
*
* Can add other things here that you would
* Can add other things here that you would
* perhaps not put into the constructor.
* I.e. a TTree, some tools. Etc.
*
......@@ -72,7 +73,7 @@ void ZDCAnalysis::Initialize( std::vector < Detector* > _vDet ){
* @return none
*/
void ZDCAnalysis::SetupHistograms( ){
//TH1D
hChargeRatio = new TH1D("ChargeZDC2_over_ChargeZDC1","Q_{ZDC2}/Q_{ZDC1}",100,0,5);
//hChargeRatio->SetCanExtend(TH1::kXaxis);
......@@ -81,23 +82,23 @@ void ZDCAnalysis::SetupHistograms( ){
hPeakRatio = new TH1D("PeakZDC2_over_PeakZDC1","Peak_{ZDC2}/Peak_{ZDC1}",100,0,5);
//hPeakRatio->SetCanExtend(TH1::kXaxis);
hCharge1 = new TH1D("ZDC1_Charge","Q_{ZDC1} (pC)",200,0,200);
hCharge2 = new TH1D("ZDC2_Charge","Q_{ZDC2} (pC)",200,0,200);
hPeak1 = new TH1D("ZDC1_Peak","Peak_{ZDC1}",200,0,1000);
hPeak2 = new TH1D("ZDC2_Peak","Peak_{ZDC2}",200,0,1000);
hDpeak1 = new TH1D("ZDC1_Diff_Peak","#frac{#partial V}{#partial t}_{max ZDC1}",200,0,4500);
hDpeak2 = new TH1D("ZDC2_Diff_Peak","#frac{#partial V}{#partial t}_{max ZDC2}",200,0,4500);
hDpeak2 = new TH1D("ZDC2_Diff_Peak","#frac{#partial V}{#partial t}_{max ZDC2}",200,0,4500);
hArrival1 = new TH1D("ZDC1_Arrival_time","Peak Center_{ZDC1} (ns)",150,240,390);
hArrival2 = new TH1D("ZDC2_Arrival_time","Peak Center_{ZDC2} (ns)",150,240,390);
hToF = new TH1D("Time_of_Flight","Peak_Center_{ZDC1-ZDC2} (ns)",30,-15,15);
//TH2D
......@@ -106,7 +107,7 @@ void ZDCAnalysis::SetupHistograms( ){
hPeak = new TH2D("ZDC_Peak_Correlation", "ZDC Peak Correlation", 100, 0, 1000, 100, 0, 1000);
//hPeak->SetCanExtend(TH1::kAllAxes);
hDpeak = new TH2D("ZDC_Diff_Peak_Correlation", "ZDC Diff Peak Correlation", 200, 0, 5000, 200, 0, 5000);
hChargePeakZDC1 = new TH2D("ZDC1_ChargePeakCorrelation","Q_{ZDC1} (pC) vs Peak_{ZDC1}",50,0,200,50,0,1000);
......@@ -114,10 +115,10 @@ void ZDCAnalysis::SetupHistograms( ){
hChargePeakZDC2 = new TH2D("ZDC2_ChargePeakCorrelation","Q_{ZDC2} (pC) vs Peak_{ZDC2}",50,0,200,50,0,1000);
//hChargePeakZDC2->SetCanExtend(TH1::kAllAxes);
}
......@@ -128,7 +129,7 @@ void ZDCAnalysis::SetupHistograms( ){
*/
void ZDCAnalysis::SetBranches( TTree* _tree ){
m_AnalysisTree = _tree;
m_AnalysisTree->Branch("zdc1_Charge", &zdc1->Charge, "zdc1->Charge/D" );
m_AnalysisTree->Branch("zdc1_Peak_max", &zdc1->Peak_max, "zdc1->Peak_max/D" );
m_AnalysisTree->Branch("zdc1_Diff_max", &zdc1->Diff_max, "zdc1->Diff_max/D" );
......@@ -136,7 +137,7 @@ void ZDCAnalysis::SetBranches( TTree* _tree ){
m_AnalysisTree->Branch("zdc1_Peak_time", &zdc1->Peak_time, "zdc1->Peak_Peak_time/D" );
m_AnalysisTree->Branch("zdc1_Diff_Peak_center", &zdc1->Diff_Peak_center, "zdc1->Diff_Peak_center/I" );
m_AnalysisTree->Branch("zdc1_Diff_Peak_time", &zdc1->Diff_Peak_time, "zdc1->Diff_Peak_Peak_time/D" );
m_AnalysisTree->Branch("zdc2_Charge", &zdc2->Charge, "zdc2->Charge/D" );
m_AnalysisTree->Branch("zdc2_Peak_max", &zdc2->Peak_max, "zdc2->Peak_max/D" );
m_AnalysisTree->Branch("zdc2_Diff_max", &zdc2->Diff_max, "zdc2->Diff_max/D" );
......@@ -144,7 +145,7 @@ void ZDCAnalysis::SetBranches( TTree* _tree ){
m_AnalysisTree->Branch("zdc2_Peak_time", &zdc2->Peak_time, "zdc2->Peak_Peak_time/D" );
m_AnalysisTree->Branch("zdc2_Diff_Peak_center", &zdc2->Diff_Peak_center, "zdc2->Diff_Peak_center/I" );
m_AnalysisTree->Branch("zdc2_Diff_Peak_time", &zdc2->Diff_Peak_time, "zdc2->Diff_Peak_Peak_time/D" );
}
/** @brief Analyze Events method for ZDCAnalysis
......@@ -152,7 +153,7 @@ void ZDCAnalysis::SetBranches( TTree* _tree ){
*
*/
void ZDCAnalysis::AnalyzeEvent( ){
//If neither ZDC was saturated
if(zdc1->Peak_max<750.0 && zdc2->Peak_max<750.0 && zdc1->was_hit && zdc2->was_hit){
......@@ -164,13 +165,13 @@ void ZDCAnalysis::AnalyzeEvent( ){
hChargePeakZDC1->Fill(zdc1->Charge,zdc1->Peak_max);
hChargePeakZDC2->Fill(zdc2->Charge,zdc2->Peak_max);
hCharge2->Fill(zdc2->Charge);
hChargeSum->Fill(zdc1->Charge + zdc2->Charge);
hToF->Fill(zdc2->Diff_Peak_time - zdc1->Diff_Peak_time);
}
//If ZDC1 wasn't saturated
if( zdc1->Peak_max<900.0 && zdc1->was_hit){
//if( zdc1->was_hit){
......@@ -179,7 +180,7 @@ void ZDCAnalysis::AnalyzeEvent( ){
hDpeak1->Fill(zdc1->Diff_max);
hArrival1->Fill(zdc1->Diff_Peak_time);
}
//If ZDC1 wasn't saturated
if( zdc2->Peak_max<900.0 && zdc2->was_hit ){
//if( zdc2->was_hit ){
......@@ -188,7 +189,7 @@ void ZDCAnalysis::AnalyzeEvent( ){
hDpeak2->Fill(zdc2->Diff_max);
hArrival2->Fill(zdc2->Diff_Peak_time);
}
}
/** @brief Finalize method for ZDCAnalysis
......@@ -196,10 +197,10 @@ void ZDCAnalysis::AnalyzeEvent( ){
*
*/
void ZDCAnalysis::Finalize( ){
std::string output = std::getenv("JZCaPA");
output += "/results/";
TCanvas *c = new TCanvas("ZDCAnalysis","ZDCAnalysis",800,600);
c->cd();
......@@ -226,34 +227,7 @@ void ZDCAnalysis::Finalize( ){
m_viz->DrawPlot(hToF,"Time of Flight (ns)","Counts","ZDC_ToF.png","");
m_viz->DrawPlot(hChargeSum,"Q_{total} (pC)","Counts","ZDC_Qtot.png","");
m_viz->DrawPlot(hDpeak,"#frac{#partial V}{#partial t}_{max ZDC1}","#frac{#partial V}{#partial t}_{max ZDC2}","ZDC_Dpeak_corr.png","COLZ");
delete c;
}
delete c;
}
......@@ -22,8 +22,9 @@
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
/// \ingroup mc
/// \file ActionInitialization.cc
/// \brief Implementation of the ActionInitialization class
#include "ActionInitialization.hh"
......
......@@ -23,12 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
/// \ingroup mc
/// \file AnalysisManager.hh
/// \brief Definition of the AnalysisManager class
/// \author Chad Lantz
/// \date 16 April 2020
#include "AnalysisManager.hh"
#include "DetectorConstruction.hh"
#include "SteppingAction.hh"
......
......@@ -22,7 +22,156 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Author: Michael Phipps
// Author: Chad Lantz
/** \ingroup mc
\file DetectorConstruction.cc
\class DetectorConstruction
\brief Detector Construction
DetectorConstruction is responsible for coordinating the placement of detectors in the scene.
There are two ways in which geometry can be placed. The method is set in geometry.mac via the
/Detector/ForcePosition command which is false by default, but can be set to true by the user for manual placement.
- Manual Placement (ForcePosition == true) uses UI commands in geometry.mac to:
- Create the world volume
- Create detectors
- Specify detector geometry and physical material
- Specify detector placement
-Auto placement (ForcePosition == false) uses prototype detector geometry and materials (hard coded)
and placement from the 2018 test beam which is gathered from the Alignment file contained in the Utils folder.
Alternate alignments can be specified with the /Detector/ConfigFile command in geometry.mac.
## Sequence of events for manual placement
- DetectorConstruction::Construct is called by G4RunManager
- Geometry stores are cleared if for some reason Construct has been called before
- geometry.mac is executed, within which
- The world volume is created via /Detector/SetWorldDimensions (Mandatory)
- Detectors are added (object created) via the /Detector/ZDC/Add or /Detector/RPD/Add commands
- Detector parameters are passed to the detector objects via the relevant UI command
- ManualConstruction is called which loops over all added detectors and calls Construct for each.
Additionally, the ZDC absorbers are added to a region for physics parameterization
- DetectorConstruction::ConstructSDandField is called by G4RunManager, within which
- The ZDC absorber region shower parameterization is declared
- ConstructSDandField is called for each detector added by the user
## Sequence of events for manual placement
- DetectorConstruction::Construct is called by G4RunManager
- Geometry stores are cleared if for some reason Construct has been called before
- geometry.mac is executed, within which
- ForcePosition is set to true
- An alignment file is chosen (or left as default)
- A TestBeam run number is chosen to be simulated
- ConstructSPSTestBeam is called during which,
- Parameters specific to the SPS test area are set
- The world volume is constructed
- The configuration and alignment files are loaded. Configuration determines
which detectors are to be used. Alignment determines the position. The information
from each is then translated from the SPS/Desy table coordinate system to something we can use.
- Detectors are constructed with parameters corresponding to the detectors tested in 2018
- The ZDC absorbers are added to a region for physics parameterization
- A lead target is constructed if specified by the config file
- A lead block is constructed in front of the detectors if specified by the config file
- DetectorConstruction::ConstructSDandField is called by G4RunManager, within which
- The magnetic field from the Goliath magnet is constructed
- The ZDC absorber region shower parameterization is declared
- ConstructSDandField is called for each detector added by the user
# UI commands and their functions
## Commands for the world
- <b>/Detector/Optical</b> true/false
- Optical (Cherenkov) photons are killed in the world volume if false
- <b>/Detector/Overlaps</b> true/false
- Check geometry for overlaps if true
- <b>/Detector/PI0</b> true/false
- I'm not sure, ask Aric
- <b>/Detector/RunNumber</b> num
- The TestBeam run to be simulated
- <b>/Detector/PrintDebugStatement</b> string
- Prints the string to help debug errors
- <b>/Detector/ForcePosition</b> true/false
- Detectors will be constructed according to UI commands if true
- <b>/Detector/ConfigFile</b> file name
- Chooses the Alignment file (I should probably change the name of the command)
- <b>/Detector/SetWorldDimensions</b> x y z unit
- Sets the dimensions of the world volume AND constructs it. Dimensions are full length, not half
## Commands common to both detector types (XXX is either ZDC or RPD)
- <b>/Detector/XXX/Add</b>
- Add a new XXX type detector numbering starts at 1
- <b>/Detector/XXX/Duplicate</b> num
- Make another detector based on XXX num (eg ZDC 1)
- <b>/Detector/XXX/SetCurrent</b> num
- Set the XXX type detector number num as the current detector being referred to
any subsequent /Detector/XXX/command commands will be applied to XXX num
- <b>/Detector/XXX/Optical</b> true/false
- Optical (Cherenkov) are killed upon creation in this detector. Selectable on a per detector basis
- <b>/Detector/XXX/Position</b> x y z unit
- Set the position of the detector
- <b>/Detector/XXX/HousingThickness</b> thickness unit
- Set the housing (case) thickness of the detector
- <b>/Detector/XXX/ReducedTree</b> true/false
- Sets the ouput tree to have fewer branches for large productions on a per detector basis
- <b>/Detector/XXX/CheckOverlaps</b> false
- Check the individual detector geometry for overlaps
## ZDC commands
- <b>/Detector/ZDC/AbsorberDimensions</b> x y z unit
- Set the tungsten absorber dimensions
- <b>/Detector/ZDC/nAbsorbers</b> num
- Set the number of absorbers in this ZDC (stacked in Z)
- <b>/Detector/ZDC/GapThickness</b> gap unit
- Set the distance between absorbers
- <b>/Detector/ZDC/SteelAbsorberHeight</b> height unit
- Set the height of the steel absorbers which are placed above the tungsten absorbers
- <b>/Detector/ZDC/HousingMaterial</b> aluminum/steel
- Chose between aluminum and steel housing material
- <b>/Detector/ZDC/AbsorberMaterial</b> composite/pure
- Chose between nickel tungsten composite or pure tungsten absorber material
## RPD commands
- <b>/Detector/RPD/FiberDiameters</b> core cladding buffer unit
- Set the core, cladding, and buffer diameters of the optical fibers
- <b>/Detector/RPD/FiberPitchX</b> distance unit
- Set the center to center distance of fibers in x
- <b>/Detector/RPD/FiberPitchZ distance</b> unit
- Set the center to center distance of fibers in z
- <b>/Detector/RPD/TileSize</b> size unit
- Set the side length of the RPD tiles. Tiles are always square
- <b>/Detector/RPD/MinWallThickness</b> thickness unit
- Set the minimum allowable thickness of the aluminum material between adjacent fibers
- <b>/Detector/RPD/FiberReadoutDistance</b> distance unit
- Set the distance between the top of the top tile and the top of the fiber (PMT window)
- <b>/Detector/RPD/RPDtype</b> panflute/CMS
- Chose between the the panflute prototype design and the CMS design
*/
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
......
......@@ -23,11 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \ingroup mc
/// \file DetectorMessenger.cc
/// \brief Implementation of the DetectorMessenger class
/// \author Chad Lantz
/// \date 16 April 2020
#include "DetectorMessenger.hh"
#include "G4OpticalSurface.hh"
......
......@@ -23,11 +23,13 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \ingroup mc
/// \file RunAction.cc
/// \brief Implementation of the RunAction class
/// \author Chad Lantz
/// \date 16 April 2020
#include "EventAction.hh"
#include "FiberHit.hh"
#include "FiberSD.hh"
......
......@@ -23,12 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \ingroup mc
/// \file FiberHit.cc
/// \author Michael Phipps
//
// $Id: FiberHit.cc,v 1.10 2006/06/29 17:48:24 gunter Exp $
// GEANT4 tag $Name: geant4-08-01-patch-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "FiberHit.hh"
#include "G4UnitsTable.hh"
......