diff --git a/NPAnalysis/e628/Analysis b/NPAnalysis/e628/Analysis deleted file mode 100755 index 3138112caa7c4f7fda0464ade61011ab76749be6..0000000000000000000000000000000000000000 Binary files a/NPAnalysis/e628/Analysis and /dev/null differ diff --git a/NPAnalysis/e628/Analysis.cxx b/NPAnalysis/e628/Analysis.cxx deleted file mode 100644 index 2aa4edd55a780db45172aa28a0f08d78df872a92..0000000000000000000000000000000000000000 --- a/NPAnalysis/e628/Analysis.cxx +++ /dev/null @@ -1,123 +0,0 @@ -#include "Analysis.h" -#include<bitset> -using namespace std; -#include "TTriggerData.h" - -int main(int argc, char** argv){ - // command line parsing - NPOptionManager* myOptionManager = NPOptionManager::getInstance(argc,argv); - - // Instantiate RootInput - string runToReadfileName = myOptionManager->GetRunToReadFile(); - RootInput:: getInstance(runToReadfileName); - - // if input files are not given, use those from TAsciiFile - if (myOptionManager->IsDefault("DetectorConfiguration")) { - string name = RootInput::getInstance()->DumpAsciiFile("DetectorConfiguration"); - myOptionManager->SetDetectorFile(name); - } - - // get input files from NPOptionManager - string detectorfileName = myOptionManager->GetDetectorFile(); - string calibrationfileName = myOptionManager->GetCalibrationFile(); - string OutputfileName = myOptionManager->GetOutputFile(); - - // Instantiate RootOutput - RootOutput::getInstance("Analysis/"+OutputfileName, "AnalysedTree"); - - // Instantiate the detector using a file - NPA::DetectorManager* myDetector = new DetectorManager(); - myDetector->ReadConfigurationFile(detectorfileName); - double EGammaDC[4]; - RootOutput::getInstance()->GetTree()->Branch("EGammaDC", &EGammaDC,"EGammaDC[4]/D"); - double GATCONF[16]; - RootOutput::getInstance()->GetTree()->Branch("GATCONF",&GATCONF,"GATCONF[16]/I"); - float beta=0.18441; //This beta is used in "EGammaDC" ----- the beta used in "DopplerCorrectedEnergy" is definded in ./config/beta.txt !!!!!!!!! - - // Get the formed Chained Tree and Treat it - TChain* Chain = RootInput:: getInstance() -> GetChain(); - TExogamPhysics *Exo = (TExogamPhysics*) myDetector -> GetDetector("EXOGAM") ; - - // Branching Gatconf - TTriggerData* trigger = new TTriggerData(); - Chain->SetBranchStatus("TRIG", true); - Chain->SetBranchStatus("fTRIG_1", true); - Chain->SetBranchStatus("fTRIG_2", false); - Chain->SetBranchStatus("fTRIG_3", false); - Chain->SetBranchStatus("fTRIG_4", false); - Chain->SetBranchStatus("fTRIG_5", false); - Chain->SetBranchAddress("TRIG", &trigger); - // Get number of events to treat - cout << endl << "///////// Starting Analysis ///////// "<< endl; - int nentries = Chain->GetEntries(); - cout << " Number of Event to be treated : " << nentries << endl; - clock_t begin = clock(); - clock_t end = begin; - - // main loop on entries - for (int i = 0; i < nentries; i++) { - if (i%10000 == 0 && i!=0) { - cout.precision(5); - end = clock(); - double TimeElapsed = (end-begin) / CLOCKS_PER_SEC; - double percent = (double)i/nentries; - double TimeToWait = (TimeElapsed/percent) - TimeElapsed; - cout << " "<< flush; - cout << "\r Progression:" << percent*100 << " % \t | \t Remaining time : ~" << TimeToWait <<"s"<< flush; - } - else if (i == nentries-1) cout << "\r Progression:" << " 100% " <<endl; - - // get data - Chain -> GetEntry(i); - int gatconf_integer = trigger->GetTRIG1(); - // Create a bitset of 16 bit, - // each bit is set to one if the corresponding GMT entry has been fired - bitset<16> gatconf(gatconf_integer); - - // Fill the GATCONF array: - for(unsigned int i = 0 ; i < 16 ; i++) - GATCONF[i]=gatconf[i]; - - - - // example of usage: - // Let say I want to perform an action if TiaraBarrel has been fired - // and that Tiara Barrel is wired to entry 8 of GATCONF - // Then I just have to take the entry 8th element (index 7) of the Gatconf - // array - if(GATCONF[7]) - cout<<"Entry 8 of GMT has been fired" << endl; - - myDetector->ClearEventPhysics(); - myDetector->BuildPhysicalEvent(); - - /************************************************/ - - for(int i=0; i<4; i++) - EGammaDC[i]=0; - - for(int i=0; i<Exo->TotalEnergy_lab.size(); i++){ - float mytheta=Exo->GetSegmentAngleTheta(Exo->CloverNumber[i], Exo->CristalNumber[i], Exo->SegmentNumber[i]); - float myphi=Exo->GetSegmentAnglePhi(Exo->CloverNumber[i], Exo->CristalNumber[i], Exo->SegmentNumber[i]); - //myv(Exo->TotalEnergy_lab[i]*sin(mytheta)*sin(myphi),Exo->TotalEnergy_lab[i]*sin(mytheta)*cos(myphi) , Exo->TotalEnergy_lab[i]*cos(mytheta),(Exo->TotalEnergy_lab)[i]); - //cout<<Exo->TotalEnergy_lab[i]<<endl; - EGammaDC[i]=Exo->TotalEnergy_lab[i]*(1-beta*cos(mytheta*TMath::DegToRad()))/sqrt(1-beta*beta); - //TVector3 boost= imp4.BoostVector(); - //myv.Boost(-boost); - //DopplerCorrectedEnergy.push_back(myv.T()); - //h_DopplerCorrectedEnergy->Fill(myv.T()); - } - - /************************************************/ - - RootOutput::getInstance()->GetTree()->Fill(); - } - - cout << "A total of " << nentries << " event has been annalysed " << endl ; - - RootOutput::getInstance()->Destroy(); - RootInput::getInstance()->Destroy(); - NPOptionManager::getInstance()->Destroy(); - - return 0 ; -} diff --git a/NPAnalysis/e628/Analysis.h b/NPAnalysis/e628/Analysis.h deleted file mode 100644 index d5ca8c305a8f3b7d788651234860e30edb569327..0000000000000000000000000000000000000000 --- a/NPAnalysis/e628/Analysis.h +++ /dev/null @@ -1,124 +0,0 @@ -// You can use this file to declare your spectra, file, energy loss , ... and whatever you want. -// This way you can remove all unnecessary declaration in the main programm. -// In order to help debugging and organizing we use Name Space. - -///////////////////////////////////////////////////////////////////////////////////////////////// -// -------------------------------------- VARIOUS INCLUDE --------------------------------------- - -// NPA -#include "DetectorManager.h" -#include "NPOptionManager.h" - -// STL C++ -#include <iostream> -#include <fstream> -#include <sstream> -#include <string> -#include <cmath> -#include <cstdlib> - -// ROOT -#include <TROOT.h> -#include <TChain.h> -#include <TFile.h> -#include <TLeaf.h> -#include <TVector3.h> -#include <TRandom.h> - -// NPL -#include "RootInput.h" -#include "RootOutput.h" -#include "NPReaction.h" -#include "TInitialConditions.h" -#include "TPlasticData.h" -#include "TMust2Data.h" -#include "TMust2Physics.h" -#include "TExogamPhysics.h" -#include "TSSSDPhysics.h" -#include "TPlasticPhysics.h" -#include "GaspardTracker.h" - -// Use CLHEP System of unit and Physical Constant -#include "NPGlobalSystemOfUnits.h" -#include "NPPhysicalConstants.h" - - -// ---------------------------------------------------------------------------------------------- -double ThetaCalculation (TVector3 A , TVector3 B) ; -///////////////////////////////////////////////////////////////////////////////////////////////// -// ----------------------------------- DOUBLE, INT, BOOL AND MORE ------------------------------- -namespace VARIABLE - { - // Declare your Variable here: - - double X1,Y1,Z1 ; - int N1,N2 = 0 ; - bool check= false ; - - // A Usefull Simple Random Generator - TRandom Rand; - } - -using namespace VARIABLE ; -// ---------------------------------------------------------------------------------------------- - - - -///////////////////////////////////////////////////////////////////////////////////////////////// -// -----------------------------------GRAPH------------------------------------------------------ -#include <TObject.h> -#include <TH1.h> -#include <TH1F.h> -#include <TH2.h> -#include <TH2F.h> -#include <TGraph2D.h> - -namespace GRAPH - { - // Declare your Spectra here: - - TH1F *myHist1D = new TH1F("Hist1D","Histogramm 1D ; x ; count", 1000 , -5 , 5 ) ; - - TH2F *myHist2D = new TH2F("Hist2D","Histogramm 2D ; x ; y ", 128 , 1 , 128 , 128 , 1 , 128 ) ; - - } - -using namespace GRAPH ; -// -------------------------------------------------------------------------------------------- - - - -/////////////////////////////////////////////////////////////////////////////////////////////// -// -----------------------------------CUT------------------------------------------------------ -#include <TCutG.h> -namespace CUT - { - // Declare your Cut here: - - } - -using namespace CUT ; -// -------------------------------------------------------------------------------------------- - - - -//////////////////////////////////////////////////////////////////////////////////////////////// -// -----------------------------------ENERGY LOSS---------------------------------------------- -#include "NPEnergyLoss.h" -using namespace NPL ; -namespace ENERGYLOSS - { - - // Declare your Energy loss here : - /* EnergyLoss ProtonTarget = EnergyLoss ( "CD2.txt" , - 100 , - 1, - 1 ); - */ - } - -using namespace ENERGYLOSS ; -// ---------------------------------------------------------------------------------------------- -///////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/NPAnalysis/e628/Analysis.o b/NPAnalysis/e628/Analysis.o deleted file mode 100644 index 99a3bb88acdbc22e86397c660b0628c0b2d5b827..0000000000000000000000000000000000000000 Binary files a/NPAnalysis/e628/Analysis.o and /dev/null differ diff --git a/NPLib/VDetector/DetectorManager.cxx b/NPLib/VDetector/DetectorManager.cxx index 1b88707861cb547d611edf89c3dbf8d007264827..0b28af5d03207b14784b6aa94d6294dc69ec7d6a 100644 --- a/NPLib/VDetector/DetectorManager.cxx +++ b/NPLib/VDetector/DetectorManager.cxx @@ -50,6 +50,9 @@ #include "TSpegPhysics.h" #include "TExlPhysics.h" #include "TTacPhysics.h" +#include "TSiLiPhysics.h" +#include "TSiResPhysics.h" +#include "TLaBr3Physics.h" #include "TChio_digPhysics.h" #include "TChio_anPhysics.h" #include "NPOptionManager.h" @@ -84,9 +87,12 @@ void DetectorManager::ReadConfigurationFile(string Path) { Bool_t ChateauCristal = false; Bool_t Exogam = false; Bool_t ScintillatorPlastic = false; + Bool_t SiLi = false; + Bool_t SiRes = false; + Bool_t LaBr3 = false; Bool_t IonisationChamber = false; Bool_t Trifoil = false; - Bool_t Charissa = false; + Bool_t Charissa = false; Bool_t GeneralTarget = false; Bool_t GPDTracker = false; Bool_t HYD2Tracker = false; @@ -401,7 +407,61 @@ void DetectorManager::ReadConfigurationFile(string Path) { AddDetector("Plastic", myDetector); #endif } + //////////////////////////////////////////// + ///////////// Search for LaBr3 /////////// + //////////////////////////////////////////// + else if (LineBuffer.compare(0, 5, "LaBr3") == 0 && LaBr3 == false) { +#ifdef INC_PLASTIC + LaBr3 = true; + cout << "//////// Plastic ////////" << endl << endl; + + // Instantiate the new array as a VDetector Object + VDetector* myDetector = new TLaBr3Physics(); + // Read Position of Telescope + ConfigFile.close(); + myDetector->ReadConfiguration(Path); + ConfigFile.open(Path.c_str()); + // Add array to the VDetector Vector + AddDetector("LaBr3", myDetector); +#endif + } //////////////////////////////////////////// + ///////////// Search for SiLi /////////// + //////////////////////////////////////////// + else if (LineBuffer.compare(0, 4, "SiLi") == 0 && SiLi == false) { +#ifdef INC_PLASTIC + SiLi = true; + cout << "//////// Plastic ////////" << endl << endl; + + // Instantiate the new array as a VDetector Object + VDetector* myDetector = new TSiLiPhysics(); + // Read Position of Telescope + ConfigFile.close(); + myDetector->ReadConfiguration(Path); + ConfigFile.open(Path.c_str()); + + // Add array to the VDetector Vector + AddDetector("SiLi", myDetector); +#endif + } //////////////////////////////////////////// + ///////////// Search for SiRes /////////// + //////////////////////////////////////////// + else if (LineBuffer.compare(0, 5, "SiRes") == 0 && SiRes == false) { +#ifdef INC_PLASTIC + SiRes = true; + cout << "//////// Plastic ////////" << endl << endl; + + // Instantiate the new array as a VDetector Object + VDetector* myDetector = new TSiResPhysics(); + // Read Position of Telescope + ConfigFile.close(); + myDetector->ReadConfiguration(Path); + ConfigFile.open(Path.c_str()); + + // Add array to the VDetector Vector + AddDetector("SiRes", myDetector); +#endif + } /////////////////////////////////////////////////////// ///////////// Search for Ionisation Chamber /////////// ///////////////////////////////////////////////////////