Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 60 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#----------------------------------------------------------------------------
# Adding a variable to use root through out the G4 project.
#
set(mytarget detectionSystems) # equivalent to "name := myexample" in G4 GNUmakefiles
set(useROOT true ) # use true or false (or comment to set to false)
set(myROOTclassDir dataRootClass ) # directory of the root classes
set(myROOTclass true ) # comment if none (please see http://root.cern.ch/phpBB3//viewtopic.php?t=6172)
set(myROOTS3class TS3Data.cpp ) # comment if none
set(myROOTFragmentclass TFragment.cpp ) # comment if none
set(myROOTTigFragmentclass TTigFragment.cpp) # comment if none
set(myROOTSpiceclass TSpiceData.cpp ) # comment if none
set(myROOTGriffclass TGriffinData.cpp) # comment if none
#set(myROOTNewclass TNewData.cpp) # comment if none

set(mytarget detectionSystems) # equivalent to "name := myexample" in G4 GNUmakefiles
set(useROOT true ) # use true or false (or comment to set to false)
set(myROOTclassDir dataRootClass ) # directory of the root classes
set(myROOTclass true ) # comment if none (please see http://root.cern.ch/phpBB3//viewtopic.php?t=6172)
set(myROOTS3class TS3Data.cpp ) # comment if none
set(myROOTSpiceclass TSpiceData.cpp ) # comment if none
set(myROOTPacesclass TPacesData.cpp ) # comment if none
set(myROOTNewclass TNewData.cpp) # comment if none
set(myROOTSceptarclass TSceptarData.cpp) # comment if none
set(myROOTGriffclass TGriffinData.cpp ) # comment if none
set(myROOTHistoryclass THistoryData.cpp ) # comment if none
set(myROOTFragmentclass TFragment.cpp ) # comment if none
set(myROOTTigFragmentclass TTigFragment.cpp) # comment if none
#set(myROOTNewclass TNewData.cpp) # comment if none

# http://www.cmake.org/cmake/help/cmake_tutorial.html
# http://www.cmake.org/cmake/help/cmake2.6docs.html
Expand Down Expand Up @@ -57,7 +61,7 @@ include_directories(${PROJECT_SOURCE_DIR}/include
#
if(useROOT)
if(myROOTclass)

if(myROOTFragmentclass)
message(" --- compiling Fragment --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictFragment.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTFragmentclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/Fragment_linkdef.h )
Expand All @@ -67,7 +71,7 @@ if(useROOT)
message(" --- compiling TigFragment --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictTigFragment.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTTigFragmentclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/TigFragment_linkdef.h )
endif(myROOTTigFragmentclass)

if(myROOTS3class)
message(" --- compiling S3 --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictS3.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTS3class} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/S3_linkdef.h )
Expand All @@ -78,11 +82,33 @@ if(useROOT)
EXECUTE_PROCESS(COMMAND rootcint -f dictSpice.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTSpiceclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/Spice_linkdef.h )
endif(myROOTSpiceclass)

if(myROOTPacesclass)
message(" --- compiling Paces --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictPaces.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTPacesclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/Paces_linkdef.h )
endif(myROOTPacesclass)

if(myROOTNewclass)
message(" --- compiling New --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictNew.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTNewclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/New_linkdef.h)
endif(myROOTNewclass)

if(myROOTSceptarclass)
message(" --- compiling Sceptar --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictSceptar.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTSceptarclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/Sceptar_linkdef.h)
endif(myROOTSceptarclass)

if(myROOTGriffclass)
message(" --- compiling Griffin --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictGriffin.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTGriffclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/Griffin_linkdef.h )
endif(myROOTGriffclass)

if(myROOTHistoryclass)
message(" --- compiling History --- ")
EXECUTE_PROCESS(COMMAND rootcint -f dictHistory.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTHistoryclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/History_linkdef.h )
endif(myROOTHistoryclass)



#if(myROOTNewclass)
#message(" --- compiling New --- ")
#EXECUTE_PROCESS(COMMAND rootcint -f dictNew.cxx -c ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/${myROOTNewclass} ${PROJECT_SOURCE_DIR}/${myROOTclassDir}/New_linkdef.h)
Expand Down Expand Up @@ -175,16 +201,36 @@ if(useROOT)
set(myROOTDict ${myROOTDict} dictSpice.cxx)
endif(myROOTSpiceclass)

if(myROOTPacesclass)
message(" --- Linking : dictPaces.cxx --- ")
set(myROOTDict ${myROOTDict} dictPaces.cxx)
endif(myROOTPacesclass)

if(myROOTGriffclass)
message(" --- Linking : dictGriffin.cxx --- ")
set(myROOTDict ${myROOTDict} dictGriffin.cxx)
endif(myROOTGriffclass)


if(myROOTHistoryclass)
message(" --- Linking : dictHistory.cxx --- ")
set(myROOTDict ${myROOTDict} dictHistory.cxx)
endif(myROOTHistoryclass)

if(myROOTNewclass)
message(" --- Linking : dictNew.cxx --- ")
set(myROOTDict ${myROOTDict} dictNew.cxx)
endif(myROOTNewclass)

if(myROOTSceptarclass)
message(" --- Linking : dictSceptar.cxx --- ")
set(myROOTDict ${myROOTDict} dictSceptar.cxx)
endif(myROOTSceptarclass)

#if(myROOTNewclass)
# message(" --- Linking : dictNew.cxx --- ")
#set(myROOTDict ${myROOTDict} dictNew.cxx)
#endif(myROOTNewclass)

# This will replace the semicolons in a cmake list ";" to spaces " "
foreach(arg ${myROOTDict})
set(myROOTDictSPACED "${myROOTDictSPACED} ${arg}")
Expand Down
3 changes: 3 additions & 0 deletions dataRootClass/History_linkdef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifdef __CINT__
#pragma link C++ class THistoryData ;
#endif
48 changes: 40 additions & 8 deletions dataRootClass/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ GLIBS = $(ROOTGLIBS) $(SYSLIBS)

# Specify Shared libraries
#-------------------------
#SHARELIB = libDetector.so libNewData.so libNew2Data.so

SHARELIB = libSpiceData.so libS3Data.so libGriffinData.so\
libFragment.so libTigFragment.so
#SHARELIB = libDetector.so libNewData.so libNew2Data.so (example)
SHARELIB = libSpiceData.so libS3Data.so libPacesData.so libGriffinData.so libNewData.so\
libHistoryData.so libFragment.so libTigFragment.so

all: $(SHARELIB)

Expand Down Expand Up @@ -62,6 +61,35 @@ libGriffinData.so: TGriffinData.o TGriffinDataDict.o
TGriffinDataDict.cpp: TGriffinData.h
rootcint -f $@ -c $^

# P A C E S
libPacesData.so: TPacesData.o TPacesDataDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@

TPacesDataDict.cpp: TPacesData.h
rootcint -f $@ -c $^

# N E W
libNewData.so: TNewData.o TNewDataDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@

TNewDataDict.cpp: TNewData.h
rootcint -f $@ -c $^

# S C E P T A R
libSceptarData.so: TSceptarData.o TSceptarDataDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@

TSceptarDataDict.cpp: TSceptarData.h
rootcint -f $@ -c $^

# H I S T O R Y
libHistoryData.so: THistoryData.o THistoryDataDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@

THistoryDataDict.cpp: THistoryData.h
rootcint -f $@ -c $^


# F R A G M E N T (G R S I S P O O N)
libFragment.so: TFragment.o TFragmentDict.o
$(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
Expand All @@ -76,7 +104,6 @@ libTigFragment.so: TTigFragment.o TTigFragmentDict.o
TTigFragmentDict.cpp: TTigFragment.h
rootcint -f $@ -c $^


#libNewData.so: TNewData.o TNewDataDict.o
# $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@
#
Expand All @@ -98,8 +125,13 @@ distclean:

# Manage dependancies
#-------------------------
TSpiceData.o: TSpiceData.cpp TSpiceData.h
TS3Data.o: TS3Data.cpp TS3Data.h
TPacesData.o: TPacesData.cpp TPacesData.h
TNewData.o: TNewData.cpp TNewData.h
TSceptarData.o: TSceptarData.cpp TSceptarData.h
TGriffinData.o: TGriffinData.cpp TGriffinData.h
THistoryData.o: THistoryData.cpp THistoryData.h
TFragment.o: TFragment.cpp TFragment.h
TTigFragment.o: TTigFragment.cpp TTigFragment.h
TSpiceData.o: TSpiceData.cpp TSpiceData.h
TS3Data.o: TS3Data.cpp TS3Data.h
TGriffinData.o: TGriffinData.cpp TGriffinData.h

3 changes: 0 additions & 3 deletions dataRootClass/New_lindef.h

This file was deleted.

3 changes: 3 additions & 0 deletions dataRootClass/Paces_linkdef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifdef __CINT__
#pragma link C++ class TPacesData ;
#endif
2 changes: 1 addition & 1 deletion dataRootClass/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To add another "Setter" class for another detector :
- Replace "New" by the name of your detector (the dictionary file must be the same)


- Finally, in ./src/RootManager.hh, add the header of the new class and use it
- Finally, in ./include/RootManager.hh, add the header of the new class and use it

e.g.

Expand Down
3 changes: 3 additions & 0 deletions dataRootClass/Sceptar_linkdef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#ifdef __CINT__
#pragma link C++ class TSceptarData ;
#endif
2 changes: 1 addition & 1 deletion dataRootClass/TFragment.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include"TFragment.h"

ClassImp(TFragment);
ClassImp(TFragment)

TFragment::TFragment()
{
Expand Down
4 changes: 2 additions & 2 deletions dataRootClass/TGriffinData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ ClassImp(TGriffinData)
TGriffinData::TGriffinData()
{
// Default constructor
Clear();
ClearVariables();
}

TGriffinData::~TGriffinData() {}


void TGriffinData::Clear()
void TGriffinData::ClearVariables()
{
fDetNbr.clear();
fPrimaryEnergy.clear();
Expand Down
4 changes: 2 additions & 2 deletions dataRootClass/TGriffinData.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class TGriffinData : public TObject {
TGriffinData();
virtual ~TGriffinData();

void Clear();
void ClearVariables();
void Dump() const;



///////////////////// GETTERS ////////////////////////
Int_t GetGriffinEDetectorNbr(Int_t i) {return fDetNbr.at(i);}
Int_t GetGriffinEMult(Int_t i) {return fDetNbr.size();}
Int_t GetGriffinEMult(Int_t) {return fDetNbr.size();}

TVector3 GetPositionFirstHit(Int_t i) {return fPositionFirstHit.at(i);}
Int_t GetEventNumber(void) {return fEventNumber;}
Expand Down
134 changes: 134 additions & 0 deletions dataRootClass/THistoryData.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*****************************************************************************
* Original Author: Mhd Moukaddam contact address: moukaddam@triumf.ca *
*---------------------------------------------------------------------------*
* Decription: This class stores selected information of the G4 simulation *
* to help in analysing the final simulated physics spectra. *
* Information such as, the number of generation in a cascade, *
* This class derives from TObject (ROOT) and its aim is to be *
* stored in the output TTree of the G4 simulation *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/

#include <iostream>
using namespace std;

#include "THistoryData.h"


ClassImp(THistoryData)

THistoryData::THistoryData() {
ClearVariables();
}

THistoryData::~THistoryData() {}


void THistoryData::ClearVariables(){

fHistoryPrimaryID.clear();
fHistoryPrimaryPdg.clear();
fHistoryPrimaryEnergy.clear();

fHistoryPrimaryPositionVertex.clear();
fHistoryPrimaryMomentumVertex.clear();
fHistoryPrimaryPosition1stImpact.clear();
fHistoryPrimaryMomentum1stImpact.clear();
fHistoryPrimaryVolume1stImpact.clear();

fHistoryParentID.clear();

fHistoryCurrentCreatorProcess.clear();
fHistoryCurrentID.clear();
fHistoryCurrentPdg.clear();
fHistoryCurrentEnergy.clear();
fHistoryCurrentTime.clear();
fHistoryCurrentVolume1stImpact.clear();

fHistoryCurrentPositionVertex.clear();
fHistoryCurrentPosition1stImpact.clear();
fHistoryCurrentPositionDetector.clear();
fHistoryCurrentPositionDeath.clear();

fHistoryCurrentMomentumVertex.clear();
fHistoryCurrentMomentum1stImpact.clear();
fHistoryCurrentMomentumDetector.clear();
fHistoryCurrentMomentumDeath.clear();

}


void THistoryData::Dump() const
{
cout << "XXXXXXXXXXXXXXXXXXXXXXXX HISTORY XXXXXXXXXXXXXXXXXXXXXXXX" << endl;

cout << "History_Mult = " <<fHistoryPrimaryID.size() << endl;

for (UShort_t i = 0; i < fHistoryPrimaryID.size(); i++)
cout << "Primary ID: " << fHistoryPrimaryID[i] << endl;

for (UShort_t i = 0; i < fHistoryPrimaryPdg.size(); i++)
cout << "Primary Pdg: " << fHistoryPrimaryPdg[i] << endl;

for (UShort_t i = 0; i < fHistoryPrimaryEnergy.size(); i++)
cout << "Primary Energy: " << fHistoryPrimaryEnergy[i] << endl;

for (UShort_t i = 0; i < fHistoryPrimaryPositionVertex.size(); i++)
cout << " History Primary Position Vertex : " << fHistoryPrimaryPositionVertex[i].X() << " " << fHistoryPrimaryPositionVertex[i].Y() << " " << fHistoryPrimaryPositionVertex[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryPrimaryMomentumVertex.size(); i++)
cout << " History Primary Momentum Vertex : " << fHistoryPrimaryMomentumVertex[i].X() << " " << fHistoryPrimaryMomentumVertex[i].Y() << " " << fHistoryPrimaryMomentumVertex[i].Z() << endl;

for (UShort_t i = 0; i < fHistoryPrimaryVolume1stImpact.size(); i++)
cout << " History Primary volume 1st Impact : " << fHistoryPrimaryVolume1stImpact[i] << endl;
for (UShort_t i = 0; i < fHistoryPrimaryPosition1stImpact.size(); i++)
cout << " History Primary Position 1st Impact : " << fHistoryPrimaryPosition1stImpact[i].X() << " " << fHistoryPrimaryPosition1stImpact[i].Y() << " " << fHistoryPrimaryPosition1stImpact[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryPrimaryMomentum1stImpact.size(); i++)
cout << " History Primary Momentum 1st Impact : " << fHistoryPrimaryMomentum1stImpact[i].X() << " " << fHistoryPrimaryMomentum1stImpact[i].Y() << " " << fHistoryPrimaryMomentum1stImpact[i].Z() << endl;

for (UShort_t i = 0; i < fHistoryCurrentCreatorProcess.size(); i++)
cout << "Current Creator Proc : " << fHistoryCurrentCreatorProcess[i] << endl;

for (UShort_t i = 0; i < fHistoryParentID.size(); i++)
cout << "Parent ID: " << fHistoryParentID[i] << endl;

for (UShort_t i = 0; i < fHistoryCurrentID.size(); i++)
cout << "Current ID: " << fHistoryCurrentID[i] << endl;

for (UShort_t i = 0; i < fHistoryCurrentPdg.size(); i++)
cout << "Current Pdg: " << fHistoryCurrentPdg[i] << endl;

for (UShort_t i = 0; i < fHistoryCurrentEnergy.size(); i++)
cout << "Current Energy: " << fHistoryCurrentEnergy[i] << endl;

for (UShort_t i = 0; i < fHistoryCurrentTime.size(); i++)
cout << "Current Energy: " << fHistoryCurrentTime[i] << endl;

for (UShort_t i = 0; i < fHistoryCurrentVolume1stImpact.size(); i++)
cout << " History Current volume 1st Impact : " << fHistoryCurrentVolume1stImpact[i] << endl;


for (UShort_t i = 0; i < fHistoryCurrentPositionVertex.size(); i++)
cout << " History Current Position Vertex : " << fHistoryCurrentPositionVertex[i].X() << " " << fHistoryCurrentPositionVertex[i].Y() << " " << fHistoryCurrentPositionVertex[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentPosition1stImpact.size(); i++)
cout << " History Current Position 1st Impact : " << fHistoryCurrentPosition1stImpact[i].X() << " " << fHistoryCurrentPosition1stImpact[i].Y() << " " << fHistoryCurrentPosition1stImpact[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentPositionDetector.size(); i++)
cout << " History Current Position Detector : " << fHistoryCurrentPositionDetector[i].X() << " " << fHistoryCurrentPositionDetector[i].Y() << " " << fHistoryCurrentPositionDetector[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentPositionDeath.size(); i++)
cout << " History Current Position Death : " << fHistoryCurrentPositionDeath[i].X() << " " << fHistoryCurrentPositionDeath[i].Y() << " " << fHistoryCurrentPositionDeath[i].Z() << endl;

for (UShort_t i = 0; i < fHistoryCurrentMomentumVertex.size(); i++)
cout << " History Current Momentum Vertex : " << fHistoryCurrentMomentumVertex[i].X() << " " << fHistoryCurrentMomentumVertex[i].Y() << " " << fHistoryCurrentMomentumVertex[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentMomentum1stImpact.size(); i++)
cout << " History Current Momentum 1st Impact : " << fHistoryCurrentMomentum1stImpact[i].X() << " " << fHistoryCurrentMomentum1stImpact[i].Y() << " " << fHistoryCurrentMomentum1stImpact[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentMomentumDetector.size(); i++)
cout << " History Current Momentum Detector : " << fHistoryCurrentMomentumDetector[i].X() << " " << fHistoryCurrentMomentumDetector[i].Y() << " " << fHistoryCurrentMomentumDetector[i].Z() << endl;
for (UShort_t i = 0; i < fHistoryCurrentMomentumDeath.size(); i++)
cout << " History Current Momentum Death : " << fHistoryCurrentMomentumDeath[i].X() << " " << fHistoryCurrentMomentumDeath[i].Y() << " " << fHistoryCurrentMomentumDeath[i].Z() << endl;




}
Loading