diff --git a/Inputs/DetectorConfiguration/W1.detector b/Inputs/DetectorConfiguration/W1.detector index 860401f3b0f254c434b034588204b3c55202e1ab..bf59637e844e8e609e5bafcd70895ca509fdcb6e 100644 --- a/Inputs/DetectorConfiguration/W1.detector +++ b/Inputs/DetectorConfiguration/W1.detector @@ -2,7 +2,7 @@ GeneralTarget %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Target - THICKNESS= 0.001 + THICKNESS= 10 RADIUS= 7.5 MATERIAL= CD2 X= 0 diff --git a/Inputs/DetectorConfiguration/e530.detector b/Inputs/DetectorConfiguration/e530.detector index 083261fa028177c5b9e0e8ee7f141f88554d6d5a..c2afc60588e09b07ca87a7bd7e6a061063481d1a 100644 --- a/Inputs/DetectorConfiguration/e530.detector +++ b/Inputs/DetectorConfiguration/e530.detector @@ -25,7 +25,7 @@ Target ANGLE= 0 X= 0 Y= 0 - Z= -50 + Z= 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% AnnularS1 Z= -158.7 diff --git a/Inputs/EventGenerator/132Sndp.reaction b/Inputs/EventGenerator/132Sndp.reaction index dc220bd6c9449b5f4e4c328b719f0265535a8373..3da1777b7da2c56f49120b1174a1616bf2b9590d 100644 --- a/Inputs/EventGenerator/132Sndp.reaction +++ b/Inputs/EventGenerator/132Sndp.reaction @@ -8,7 +8,7 @@ Transfert Light= 1H Heavy= 133Sn ExcitationEnergyLight= 0.0 - ExcitationEnergyHeavy= 5.0 + ExcitationEnergyHeavy= 0.0 BeamEnergy= 1320 BeamEnergySpread= 0 SigmaX= 0 diff --git a/NPAnalysis/Gaspard/src/Analysis.cc b/NPAnalysis/Gaspard/src/Analysis.cc index 9289bfaea409098eca6a803fd17e1abc1e70d9ff..89f73c390bea21bb36143df61bdd9309f04e5234 100644 --- a/NPAnalysis/Gaspard/src/Analysis.cc +++ b/NPAnalysis/Gaspard/src/Analysis.cc @@ -52,7 +52,7 @@ int main(int argc,char** argv) GaspardTracker* GPDTrack = (GaspardTracker*) myDetector->m_Detector["GASPARD"]; // Get the input TChain and treat it - TChain* chain = RootInput:: getInstance() -> GetChain(); + TChain* chain = RootInput:: getInstance()->GetChain(); // Connect TInitialConditions branch TInitialConditions *initCond = 0; @@ -64,11 +64,6 @@ int main(int argc,char** argv) chain->SetBranchAddress("InteractionCoordinates", &interCoord); chain->SetBranchStatus("InteractionCoordinates", 0); - // Analysis is here! - int nentries = chain->GetEntries(); - cout << "/////////// Loop information ///////////" << endl; - cout << "Number of entries to be analysed: " << nentries << endl; - // Default initialization double XTarget = 0; double YTarget = 0; @@ -78,9 +73,26 @@ int main(int argc,char** argv) // random generator TRandom3 *gene = new TRandom3(); + // 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; + // Loop on all events for (int i = 0; i < nentries; i ++) { - if (i%10000 == 0 && i!=0) cout << "\r" << i << " analyzed events" << flush; + 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 << "\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); // Treat Gaspard event diff --git a/NPAnalysis/Template/RunToTreat.txt b/NPAnalysis/Template/RunToTreat.txt index 008354fd1b9fa2d1c15477a463be1e2bf76a6b7e..698f27aa2f5d83de671b3370b1ef6ccf2a561d21 100644 --- a/NPAnalysis/Template/RunToTreat.txt +++ b/NPAnalysis/Template/RunToTreat.txt @@ -1,4 +1,4 @@ TTreeName SimulatedTree RootFileName - ../../Outputs/Simulation/mySimul.root + ../../Outputs/Simulation/myResult.root diff --git a/NPAnalysis/Template/src/Analysis.cc b/NPAnalysis/Template/src/Analysis.cc index e5b365dbe84772d80c01262856538f675e096aa1..dc93cb4a19d553f9f296cfda43b11b5a432888bc 100644 --- a/NPAnalysis/Template/src/Analysis.cc +++ b/NPAnalysis/Template/src/Analysis.cc @@ -2,59 +2,69 @@ using namespace std; -int main(int argc,char** argv) -{ - - NPOptionManager* myOptionManager = NPOptionManager::getInstance(argc,argv) ; - string detectorfileName = myOptionManager->GetDetectorFilePath() ; - string reactionfileName = myOptionManager->GetCalibrationFilePath() ; - string calibrationfileName = myOptionManager->GetCalibrationFilePath() ; - string runToReadfileName = myOptionManager->GetRunToReadFilePath() ; - - // First of All instantiate RootInput and Output - // Detector will be attached later - RootInput:: getInstance(runToReadfileName) ; - RootOutput::getInstance("Analysis/Template_AnalyzedData", "AnalyzedTree") ; - - // Instantiate a Reaction - NPL::Reaction* myReaction = new Reaction ; - myReaction -> ReadConfigurationFile(reactionfileName) ; - - // Instantiate the detector using a file - NPA::DetectorManager* myDetector = new DetectorManager ; - myDetector -> ReadConfigurationFile(detectorfileName) ; - - // Instantiate the Calibration Manger using a file - CalibrationManager* myCalibration = CalibrationManager::getInstance(calibrationfileName) ; - - // Get the formed Chained Tree and Treat it - TChain* Chain = RootInput:: getInstance() -> GetChain() ; - int i; - for ( i = 0 ; i < Chain -> GetEntries() ; i ++ ) - { - if( i%10000 == 0 && i!=0) cout << "\r Event Analyzed:" << i << flush; - Chain -> GetEntry(i); - - myDetector -> ClearEventPhysics() ; - myDetector -> BuildPhysicalEvent() ; - - /************************************************ - - Put your code here - - ************************************************/ - RootOutput::getInstance()->GetTree()->Fill() ; - } - cout << "A total of " << i << " event has been annalysed " << endl ; - - RootOutput::getInstance()->Destroy(); - return 0 ; -} +int main(int argc, char** argv) +{ + // Parse command line + NPOptionManager* myOptionManager = NPOptionManager::getInstance(argc, argv); + string detectorfileName = myOptionManager->GetDetectorFile(); + string reactionfileName = myOptionManager->GetCalibrationFile(); + string calibrationfileName = myOptionManager->GetCalibrationFile(); + string runToReadfileName = myOptionManager->GetRunToReadFile(); + + // First of All instantiate RootInput and Output + // Detector will be attached later + RootInput:: getInstance(runToReadfileName); + RootOutput::getInstance("Analysis/Template_AnalyzedData", "AnalyzedTree"); + + // Instantiate a Reaction + NPL::Reaction* myReaction = new Reaction(); + myReaction->ReadConfigurationFile(reactionfileName); + + // Instantiate the detector using a file + NPA::DetectorManager* myDetector = new DetectorManager(); + myDetector->ReadConfigurationFile(detectorfileName); + + // Instantiate the Calibration Manger using a file + CalibrationManager* myCalibration = CalibrationManager::getInstance(calibrationfileName); + + // Get the formed Chained Tree and Treat it + TChain* Chain = RootInput:: getInstance() -> GetChain(); + + // 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 << "\r Progression:" << percent*100 << " % \t | \t Remaining time : ~" << TimeToWait <<"s"<< flush; + } + else if (i == nentries-1) cout << "\r Progression:" << " 100% " <<endl; -double ThetaCalculation (TVector3 A , TVector3 B) - { - double Theta = acos( (A.Dot(B)) / (A.Mag()*B.Mag()) ) ; - return Theta ; - } + // get data + Chain -> GetEntry(i); + myDetector->ClearEventPhysics(); + myDetector->BuildPhysicalEvent(); + + /************************************************ + + Put your code here + + ************************************************/ + RootOutput::getInstance()->GetTree()->Fill(); + } + + cout << "A total of " << nentries << " event has been annalysed " << endl ; + + RootOutput::getInstance()->Destroy(); + return 0 ; +} diff --git a/NPAnalysis/must2/RunToTreat.txt b/NPAnalysis/must2/RunToTreat.txt index 28febc902cda5cc9564bfa3cbf50f3590b97aa2d..467f8c6b33f238f5cfd618e4b240aecdb2f88b73 100644 --- a/NPAnalysis/must2/RunToTreat.txt +++ b/NPAnalysis/must2/RunToTreat.txt @@ -1,6 +1,5 @@ TTreeName SimulatedTree RootFileName -% ../../Outputs/Simulation/myResult.root - ../../Outputs/Simulation/dummy.root + ../../Outputs/Simulation/myResult.root % ../../Outputs/Simulation/fe60dp_1mg.root diff --git a/NPSimulation/include/W1.hh b/NPSimulation/include/W1.hh index 57eaf8dec747a1268d1a41af8bdcb2bdeefcb58d..af8fe7f0d2f7c247f7721ba22fc20aaedd66dc88 100644 --- a/NPSimulation/include/W1.hh +++ b/NPSimulation/include/W1.hh @@ -151,9 +151,8 @@ private: namespace W1SQUARE { // Energy/Time resolutions for the different layers - const G4double EnergyResolution = 0; // = 52keV of Resolution // Unit is MeV/2.35 -// const G4double ResoFirstStage = 0.0106 ;// = 52keV of Resolution // Unit is MeV/2.35 - const G4double TimeResolution = 0.638; // 1.5 ns (FWHM) + const G4double EnergyResolution = 12.8e-3; // 30 keV FWHM + const G4double TimeResolution = 0.638; // 1.5 ns (FWHM) // Geometry const G4double FaceFront = 50*mm;