diff --git a/.gitignore b/.gitignore index 939ba91..edeef8c 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ EventBuilder* *.pcm *.root -Mapper \ No newline at end of file +Mapper +anasenMS \ No newline at end of file diff --git a/Analyzer.h b/Analyzer.h index 64b359d..d04e81f 100644 --- a/Analyzer.h +++ b/Analyzer.h @@ -6,7 +6,7 @@ #include #include -#include "ClassDet.h" +#include "Armory/ClassDet.h" class Analyzer : public TSelector { public : diff --git a/ANASEN_model.C b/Armory/ANASEN_model.C similarity index 100% rename from ANASEN_model.C rename to Armory/ANASEN_model.C diff --git a/ClassAnasen.h b/Armory/ClassAnasen.h similarity index 100% rename from ClassAnasen.h rename to Armory/ClassAnasen.h diff --git a/ClassDet.h b/Armory/ClassDet.h similarity index 100% rename from ClassDet.h rename to Armory/ClassDet.h diff --git a/ClassTransfer.h b/Armory/ClassTransfer.h similarity index 100% rename from ClassTransfer.h rename to Armory/ClassTransfer.h diff --git a/Isotope.h b/Armory/Isotope.h similarity index 93% rename from Isotope.h rename to Armory/Isotope.h index 6deb3ea..d44cdc9 100644 --- a/Isotope.h +++ b/Armory/Isotope.h @@ -48,7 +48,7 @@ public: double CalSp2(int a, int z); // this is for (a,z) nucleus removal double CalBeta(double T){ - double Etot = Mass + T; + // double Etot = Mass + T; double gamma = 1 + T/Mass; double beta = sqrt(1 - 1 / gamma / gamma ) ; return beta; @@ -115,17 +115,17 @@ private: }; -void Isotope::SetIso(int a, int z){ +inline void Isotope::SetIso(int a, int z){ this->A = a; this->Z = z; FindMassByAZ(a,z); } -void Isotope::SetIsoByName(string name){ +inline void Isotope::SetIsoByName(string name){ FindMassByName(name); } -void Isotope::FindMassByAZ(int A, int Z){ +inline void Isotope::FindMassByAZ(int A, int Z){ string line; int lineNum=0; int list_A, list_Z; @@ -190,7 +190,7 @@ void Isotope::FindMassByAZ(int A, int Z){ } } -void Isotope::FindMassByName(string name){ +inline void Isotope::FindMassByName(string name){ // done seperate the Mass number and the name if( name == "n" ) { @@ -302,7 +302,7 @@ void Isotope::FindMassByName(string name){ } } -double Isotope::CalSp(int Np, int Nn){ +inline double Isotope::CalSp(int Np, int Nn){ Isotope nucleusD(A - Np - Nn, Z - Np); if( nucleusD.Mass != -404){ @@ -312,7 +312,7 @@ double Isotope::CalSp(int Np, int Nn){ } } -double Isotope::CalSp2(int a, int z){ +inline double Isotope::CalSp2(int a, int z){ Isotope nucleusD(A - a , Z - z); Isotope nucleusS(a,z); @@ -323,7 +323,7 @@ double Isotope::CalSp2(int a, int z){ } } -int Isotope::TwoJ(int nShell){ +inline int Isotope::TwoJ(int nShell){ switch(nShell){ case 0: return 1; break; // 0s1/2 @@ -360,7 +360,7 @@ int Isotope::TwoJ(int nShell){ return 0; } -string Isotope::Orbital(int nShell){ +inline string Isotope::Orbital(int nShell){ switch(nShell){ case 0: return "0s1 "; break; // @@ -397,14 +397,14 @@ string Isotope::Orbital(int nShell){ return "nan"; } -void Isotope::ListShell(){ +inline void Isotope::ListShell(){ if( Mass < 0 ) return; int n = A-Z; int p = Z; - int k = min(n,p); + int k = std::min(n,p); int nMagic = 0; for( int i = 0; i < 7; i++){ if( magic(i) < k && k <= magic(i+1) ){ @@ -422,7 +422,7 @@ void Isotope::ListShell(){ printf("------------------ Core:%3s, inner Core:%3s \n", (core2.Name).c_str(), (core1.Name).c_str()); printf(" || "); - int t = max(n,p); + int t = std::max(n,p); int nShell = 0; do{ int occ = TwoJ(nShell)+1; @@ -495,8 +495,7 @@ void Isotope::ListShell(){ } - -void Isotope::Print(){ +inline void Isotope::Print(){ if (Mass > 0){ diff --git a/Makefile b/Armory/Makefile similarity index 69% rename from Makefile rename to Armory/Makefile index 21030f1..538e49e 100644 --- a/Makefile +++ b/Armory/Makefile @@ -10,7 +10,7 @@ COPTS = -fPIC -DLINUX -g -O0 -Wall -std=c++17 -lpthread ROOTLIBS = `root-config --cflags --glibs` -ALL = Mapper +ALL = Mapper AnasenMS ######################################################################### @@ -19,6 +19,10 @@ all : $(ALL) clean : /bin/rm -f $(OBJS) $(ALL) -Mapper : Mapper.cpp mapping.h ClassDet.h +Mapper : Mapper.cpp ../mapping.h ClassDet.h @echo "--------- making Mapper" $(CC) $(COPTS) -o Mapper Mapper.cpp $(ROOTLIBS) + +AnasenMS : ClassAnasen.h anasenMS.cpp Isotope.h constant.h + @echo "--------- making ANASEN Monte Carlo" + $(CC) $(COPTS) -o anasenMS anasenMS.cpp $(ROOTLIBS) \ No newline at end of file diff --git a/Mapper.cpp b/Armory/Mapper.cpp similarity index 99% rename from Mapper.cpp rename to Armory/Mapper.cpp index 9128d3e..087ff4a 100644 --- a/Mapper.cpp +++ b/Armory/Mapper.cpp @@ -7,7 +7,7 @@ #include #include -#include "mapping.h" +#include "../mapping.h" #include "ClassDet.h" //=============================== diff --git a/anasenMS.C b/Armory/anasenMS.cpp similarity index 95% rename from anasenMS.C rename to Armory/anasenMS.cpp index c6145b3..40304c7 100644 --- a/anasenMS.C +++ b/Armory/anasenMS.cpp @@ -14,9 +14,14 @@ // find out the CalTrack and the real track // find out the Q-value uncertaintly -void anasenMS(){ +int main(int argc, char **argv){ - const int numEvent = 100000; + printf("=========================================\n"); + printf("=== ANASEN Monte Carlo ===\n"); + printf("=========================================\n"); + + int numEvent = 1000000; + if( argc >= 2 ) numEvent = atoi(argv[1]); //Reaction TransferReaction transfer; @@ -219,4 +224,6 @@ void anasenMS(){ printf("=============== done. saved as %s. count(hit==1) : %d\n", saveFileName.Data(), count); + return 0; + } \ No newline at end of file diff --git a/constant.h b/Armory/constant.h similarity index 100% rename from constant.h rename to Armory/constant.h diff --git a/mass20.txt b/Armory/mass20.txt similarity index 100% rename from mass20.txt rename to Armory/mass20.txt