Skip to content
Snippets Groups Projects
Commit dc87ceed authored by matta's avatar matta
Browse files

* Merge Modification

parent 201cb463
No related branches found
No related tags found
No related merge requests found
......@@ -5,23 +5,19 @@ using namespace std;
int main(int argc,char** argv)
{
// test if number of arguments is correct
if (argc != 4) {
cout <<
"you need to specify both a Reaction file and a Detector file such as : Analysis myReaction.reaction myDetector.detector runToRead.run"
<< endl;
return 0;
}
// get arguments
string reactionfileName = argv[1];
string detectorfileName = argv[2];
string runToReadfileName = argv[3];
NPOptionManager* myOptionManager = NPOptionManager::getInstance(argc,argv) ;
string reactionfileName = myOptionManager->GetReactionFilePath() ;
string detectorfileName = myOptionManager->GetDetectorFilePath() ;
string calibrationfileName = myOptionManager->GetCalibrationFilePath() ;
string runToReadfileName = myOptionManager->GetRunToReadFilePath() ;
string OutputfileName = myOptionManager->GetOutputFilePath() ;
// Instantiate RootInput and RootOutput singleton classes
RootInput:: getInstance(runToReadfileName);
// RootOutput::getInstance("Analysis/"+OutputfileName, "AnalyzedTree") ;
RootOutput::getInstance("Analysis/Gaspard_AnalyzedData", "AnalyzedTree");
// Initialize the reaction
NPL::Reaction* myReaction = new Reaction();
myReaction->ReadConfigurationFile(reactionfileName);
......@@ -38,7 +34,7 @@ int main(int argc,char** argv)
Double_t BeamEnergyNominal = myReaction->GetBeamEnergy() * MeV;
cout << "Nominal beam energy (MeV): " << BeamEnergyNominal << endl;
// Slow beam at target middle
Double_t BeamEnergy = BeamEnergyNominal - BeamTarget.Slow(BeamEnergyNominal, myDetector->GetTargetThickness()/2 * micrometer, 0);
Double_t BeamEnergy = BeamTarget.Slow(BeamEnergyNominal, myDetector->GetTargetThickness()/2 * micrometer, 0);
cout << "Middle-target beam energy (MeV): " << BeamEnergy << endl << endl;
// Set energy beam at target middle
myReaction->SetBeamEnergy(BeamEnergy);
......
......@@ -63,7 +63,7 @@ public:
// Getters to retrieve the (X,Y,Z) coordinates of a pixel defined by strips (X,Y)
double GetStripPositionX(int N ,int X ,int Y) { return m_StripPositionX[N-1-m_index["Annular"]][X-1][Y-1]; }
double GetStripPositionY(int N ,int X ,int Y) { return m_StripPositionY[N-1-m_index["Annular"]][X-1][Y-1]; }
double GetStripPositionZ(int N ,int X ,int Y) { cout << N << " " << X << " " << Y << " " << endl ; return m_StripPositionZ[N-1-m_index["Annular"]][X-1][Y-1]; }
double GetStripPositionZ(int N ,int X ,int Y) { return m_StripPositionZ[N-1-m_index["Annular"]][X-1][Y-1]; }
double GetNumberOfModule() { return m_NumberOfModule; }
private:
......
......@@ -41,7 +41,6 @@ ROOTLIBS := $(shell $(ROOTCONFIG) --libs)
ROOTGLIBS := $(shell $(ROOTCONFIG) --glibs)
HASTHREAD := $(shell $(ROOTCONFIG) --has-thread)
ROOTDICTTYPE := $(shell $(ROOTCONFIG) --dicttype)
NOSTUBS := $(shell $(ROOTCONFIG) --nostubs)
ROOTCINT := rootcint
ifeq ($(ARCH),linux)
......@@ -268,189 +267,41 @@ GLIBS = $(ROOTGLIBS) $(SYSLIBS)
INCLUDE = -I$(CLHEP_BASE_DIR)/include
#------------------------------------------------------------------------------
SHARELIB = CalibManager Vdetec InputOutputRoot InitCond InterCoord \
Must2All GaspardData AnnularS1Data PlasticData DummyDetectorData SSSDData\
Reaction EnergyLoss ParisData ShieldData
SHARELIB = SharedLib
FILLINC = FillIncludeDir
FILLLIB = FillLibraryDir
LIBLIST = liblistfile
all: $(SHARELIB)
rm -f ./include/*Dict.h
all: $(FILLINC) $(SHARELIB) $(FILLLIB) $(LIBLIST)
#------------------------------------------------------------------------------
############### Calibration ##############
############### fillinclib ##############
FillIncludeDir:
./scripts/fillincdir.sh
## CalibrationManager ##
CalibManager:
make -C ./CalibrationManager
cp ./CalibrationManager/*.so ./lib ; cp ./CalibrationManager/*.h ./include
FillLibraryDir:
./scripts/filllibdir.sh
ifeq ($(ARCH),macosx)
cd lib; ln -sf libCalibrationManager.so libCalibrationManager.dylib
./scripts/filllibmacdir.sh
endif
############### Detector ##############
############### liblist ##############
liblistfile:
./scripts/buildliblist.sh
## VDetector ##
Vdetec:
cp ./VDetector/*.h ./include
make -C ./VDetector
cp ./VDetector/*.so ./lib
ifeq ($(ARCH),macosx)
cd lib; ln -sf libVDetector.so libVDetector.dylib
endif
## MUST2 ##
Must2All:
make -C ./MUST2
cp ./MUST2/*.so ./lib ; cp ./MUST2/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libMust2Data.so libMust2Data.dylib
cd lib; ln -sf libMust2Physics.so libMust2Physics.dylib
endif
## SSSD ##
SSSDData:
make -C ./SSSD
cp ./SSSD/*.so ./lib ; cp ./SSSD/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libSSSDData.so libSSSDData.dylib
cd lib; ln -sf libSSSDPhysics.so libSSSDPhysics.dylib
endif
## AnnularS1 ##
AnnularS1Data:
make -C ./AnnularS1
cp ./AnnularS1/*.so ./lib ; cp ./AnnularS1/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libAnnularS1Data.so libAnnularS1Data.dylib
endif
## Gaspard ##
GaspardData:
make -C ./GASPARD
cp ./GASPARD/*.so ./lib ; cp ./GASPARD/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libGaspardData.so libGaspardData.dylib
cd lib; ln -sf libGaspardPhysics.so libGaspardPhysics.dylib
endif
## Plastic ##
PlasticData:
make -C ./Plastic
cp ./Plastic/*.so ./lib ; cp ./Plastic/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libPlasticData.so libPlasticData.dylib
cd lib; ln -sf libPlasticPhysics.so libPlasticPhysics.dylib
endif
## DUMMY Detector ##
DummyDetectorData:
make -C ./DummyDetector
cp ./DummyDetector/*.so ./lib ; cp ./DummyDetector/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libDummyDetectorData.so libDummyDetectorData.dylib
endif
## Paris Detector ##
ParisData:
make -C ./Paris
cp ./Paris/*.so ./lib ; cp ./Paris/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libParisData.so libParisData.dylib
cd lib; ln -sf libParisPhysics.so libParisPhysics.dylib
endif
## Paris Shield Detector ##
ShieldData:
make -C ./Shield
cp ./Shield/*.so ./lib ; cp ./Shield/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libShieldData.so libShieldData.dylib
cd lib; ln -sf libShieldPhysics.so libShieldPhysics.dylib
endif
############# Simulation ##############
## InitialConditions ##
InitCond:
make -C ./InitialConditions
cp ./InitialConditions/*.so ./lib ; cp ./InitialConditions/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libInitialConditions.so libInititalConditions.dylib
endif
## InteractionCoordinates ##
InterCoord:
make -C ./InteractionCoordinates
cp ./InteractionCoordinates/*.so ./lib ; cp ./InteractionCoordinates/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libInteractionCoordinates.so libInteractionCoordinates.dylib
endif
############# I/O Root File ############
InputOutputRoot:
make -C ./IORoot
cp ./IORoot/*.so ./lib ; cp ./IORoot/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libIORoot.so libIORoot.dylib
endif
############# Various Tools ############
## Reaction ##
Reaction:
make libReaction.so -C ./Tools
cp ./Tools/*.so ./lib ; cp ./Tools/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libReaction.so libReaction.dylib
endif
EnergyLoss:
make libEnergyLoss.so -C ./Tools
cp ./Tools/*.so ./lib ; cp ./Tools/*.h ./include
ifeq ($(ARCH),macosx)
cd lib; ln -sf libEnergyLoss.so libEnergyLoss.dylib
endif
#######################################
############### sharedlib ##############
SharedLib:
./scripts/makefile.sh
############# Clean and More ##########
clean:
make clean -C ./Tools
make clean -C ./IORoot
make clean -C ./VDetector
make clean -C ./CalibrationManager
make clean -C ./MUST2
make clean -C ./SSSD
make clean -C ./AnnularS1
make clean -C ./GASPARD
make clean -C ./InteractionCoordinates
make clean -C ./InitialConditions
make clean -C ./DummyDetector
make clean -C ./Plastic
make clean -C ./Paris
make clean -C ./Shield
./scripts/makefile.sh clean
distclean:
rm -f ./lib/*.so
ifeq ($(ARCH),macosx)
rm -f ./lib/*.dylib
endif
rm -f ./lib/*
rm -f ./include/*.h
make distclean -C ./Tools
make distclean -C ./IORoot
make distclean -C ./VDetector
make distclean -C ./CalibrationManager
make distclean -C ./MUST2
make distclean -C ./SSSD
make distclean -C ./AnnularS1
make distclean -C ./GASPARD
make distclean -C ./InteractionCoordinates
make distclean -C ./InitialConditions
make distclean -C ./DummyDetector
make distclean -C ./Plastic
make distclean -C ./Paris
make distclean -C ./Shield
rm -f liblist
./scripts/makefile.sh distclean
.SUFFIXES: .$(SrcSuf)
###
......
......@@ -232,6 +232,18 @@ void EnergyLoss::Print() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double EnergyLoss::EnergyLossCalulation( double Energy , // Energy of the detected particle
double TargetThickness , // Target Thickness at 0 degree
double Angle ) // Particle Angle
const
{
return(Energy - Slow(Energy,TargetThickness,Angle) ) ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double EnergyLoss::Slow( double Energy , // Energy of the detected particle
double TargetThickness , // Target Thickness at 0 degree
......
......@@ -83,12 +83,18 @@ namespace NPL
public : // Function to Slow down particle or reconstruct their initial energy
// Calculate Energy loss of a particle inside material
// Calculate Energy of a particle after crossing material
double Slow( double Energy , // Energy of the detected particle
double TargetThickness , // Target Thickness at 0 degree
double Angle ) // Particle Angle
const;
// Calculate Energy Loss of a particle inside a material
double EnergyLossCalulation( double Energy , // Energy of the detected particle
double TargetThickness , // Target Thickness at 0 degree
double Angle ) // Particle Angle
const;
// Evaluate Initial Energy of particle before crossing material knowing Angle, final Energy
// and Target Thickness.
double EvaluateInitialEnergy( double energy , // Energy of the detected particle
......
......@@ -39,7 +39,7 @@ NPOptionManager::NPOptionManager(int argc,char** argv)
// Default Setting
fReactionFileName = "myReaction.reaction" ;
fDetectorFileName = "myDetector.detector" ;
fOutputFileName = "myResult.root" ;
fOutputFileName = "myResult" ;
fRunToReadFileName = "RunToRead.txt" ;
fCalibrationFileName = "Calibration.txt" ;
......@@ -47,18 +47,28 @@ NPOptionManager::NPOptionManager(int argc,char** argv)
{
string argument = argv[i];
if(argument == "-H" || argument == "-h" || argument == "-help")
if(argument == "-H" || argument == "-h" || argument == "--help")
DisplayHelp();
else if(argument == "-R" && argc>=i+1 ) fReactionFileName = argv[i+1] ;
else if(argument == "--event-generator" && argc>=i+1 ) fReactionFileName = argv[i+1] ;
else if(argument == "-E" && argc>=i+1 ) fReactionFileName = argv[i+1] ;
else if(argument == "--detector" && argc>=i+1 ) fDetectorFileName = argv[i+1] ;
else if(argument == "-D" && argc>=i+1 ) fDetectorFileName = argv[i+1] ;
else if(argument == "-C" && argc>=i+1 ) fDetectorFileName = argv[i+1] ;
else if(argument == "--output" && argc>=i+1 ) fOutputFileName = argv[i+1] ;
else if(argument == "-O" && argc>=i+1 ) fOutputFileName = argv[i+1] ;
else if(argument == "-run" && argc>=i+1 ) fRunToReadFileName = argv[i+1] ;
else if(argument == "--run" && argc>=i+1 ) fRunToReadFileName = argv[i+1] ;
else if(argument == "-R" && argc>=i+1 ) fRunToReadFileName = argv[i+1] ;
else if(argument == "--cal" && argc>=i+1 ) fCalibrationFileName = argv[i+1] ;
else if(argument == "-cal" && argc>=i+1 ) fCalibrationFileName = argv[i+1] ;
else if(argument == "-C" && argc>=i+1 ) fCalibrationFileName = argv[i+1] ;
else ;
}
......@@ -70,10 +80,11 @@ void NPOptionManager::DisplayHelp()
{
cout << "----NPOptionManager Help----" << endl ;
cout << "List of Option " << endl ;
cout << "\t -C <arg>\t \t \t \t \t Set arg as the detector configuration file" << endl ;
cout << "\t -cal <arg>\t \t \t \t \t Set arg as the calibration file list" << endl ;
cout << "\t -H -h -help\t \t \t \t \t Display this help message" << endl ;
cout << "\t -O <arg>\t \t \t \t \t Set arg as the Output File Name (output tree)" << endl ;
cout << "\t -run <arg>\t \t \t \t \t Set arg as the run to read file list" << endl ;
cout << "\t --detector -D <arg>\t \t \t \t \t \t Set arg as the detector configuration file" << endl ;
cout << "\t --event-generator -E <arg>\t \t \t \t \t Set arg as the event generator file" << endl ;
cout << "\t --cal -C <arg>\t \t \t \t \t \t \t Set arg as the calibration file list" << endl ;
cout << "\t --help -H -h\t \t \t \t \t \t \t Display this help message" << endl ;
cout << "\t --output -O <arg>\t \t \t \t \t \t Set arg as the Output File Name (output tree)" << endl ;
cout << "\t --run -R <arg>\t \t \t \t \t \t \t Set arg as the run to read file list" << endl ;
cout << endl << endl ;
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment