diff --git a/NPAnalysis/EXL/Analysis.cxx b/NPAnalysis/EXL/Analysis.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6f3bcc162ffdfafcdf333c2e386b02dd67ba8410 --- /dev/null +++ b/NPAnalysis/EXL/Analysis.cxx @@ -0,0 +1,128 @@ +#include "Analysis.h" +using namespace std; + +int main(int argc, char** argv) +{ + +/*---------------------------------Initialisation---------------------------------------*/ + +//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); + +//Get the formed Chained Tree and Treat it +TChain* Chain = RootInput:: getInstance() -> GetChain(); + +//Attach new branch +InitOutputBranch(); + +//Instantiate some Reaction +NPL::Reaction* Reaction_e582 = new Reaction; +Reaction_e582->ReadConfigurationFile("40Ca.reaction"); + +//Get TExlPhysics pointer +TExlPhysics *Exl = (TExlPhysics*) myDetector -> GetDetector("EXL") ; + +/*----------------------------------Reading events-------------------------------*/ + +//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%50000==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 +ReInitValue(); +Chain -> GetEntry(i); + +//Make Physical Tree +Exl->ClearEventPhysics(); +Exl->BuildPhysicalEvent(); + +//Get the usefull Data for EXL +if(Exl->EXL_Energy.size()>0) +{ + for(unsigned int countExl = 0 ; countExl < Exl->EXL_Energy.size() ; countExl++) + { + //Usefull data + if(Exl->CrystalNumber[countExl]<18) + { + EXL_Number.push_back(Exl->CrystalNumber[countExl]); + EXL_Energy.push_back(Exl->EXL_Energy[countExl]/1000);//Calibration in keV, results in MeV + //EXL Energy Doppler correction : 1+2->3*+4 and 3*->3+gamma (3 is moving => Doppler effect) + TVector3 ExlPosition(Exl->GetPositionOfInteraction(Exl->CrystalNumber[countExl]-1)); + P3Vector = TVector3(0,0,1); + Theta = ExlPosition.Angle(P3Vector); + Beta = 0.30; + EXL_Energy_corr.push_back(Exl->DopplerCorrection(Exl->EXL_Energy[countExl]/1000, Theta, Beta)); + } + } +} + +//Fill Physical Tree +RootOutput::getInstance()->GetTree()->Fill(); +} + +cout << "A total of " << nentries << " event has been analysed " << endl ; + +RootOutput::getInstance()->Destroy(); +RootInput::getInstance()->Destroy(); +NPOptionManager::getInstance()->Destroy(); + +return 0; +} + +void InitOutputBranch() +{ + RootOutput::getInstance()->GetTree()->Branch("EXL_Energy_corr", &EXL_Energy_corr,"EXL_Energy_corr/D"); +} + +void ReInitValue() +{ + EXL_Number.clear(); + EXL_Energy.clear(); + EXL_Energy_corr.clear(); + Theta = -1000; + Beta = -1000; +} diff --git a/NPAnalysis/EXL/Analysis.h b/NPAnalysis/EXL/Analysis.h new file mode 100644 index 0000000000000000000000000000000000000000..c55c78f546cadfc6a16a705dd287899bc5f88307 --- /dev/null +++ b/NPAnalysis/EXL/Analysis.h @@ -0,0 +1,117 @@ +// 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> +#include <TSystem.h> +#include <TBranch.h> +#include <TH1F.h> +#include <TTree.h> +#include <TGraph.h> +#include <TSpectrum.h> +#include <TObject.h> + +// NPL +#include "RootInput.h" +#include "RootOutput.h" +#include "NPReaction.h" +#include "TInitialConditions.h" +#include "TExlPhysics.h" + +// Use CLHEP System of unit and Physical Constant +#include "CLHEP/Units/GlobalSystemOfUnits.h" +#include "CLHEP/Units/PhysicalConstants.h" + +/*------------------Function-----------------------------*/ + +void InitOutputBranch(); +void ReInitValue(); + +/*--------------------------Variables--------------------*/ + +vector <int> EXL_Number; +vector <double> EXL_Energy; +vector <double> EXL_Energy_corr; +double Theta = -1000; +double Beta = -1000; +TVector3 P3Vector; + +///////////////////////////////////////////////////////////////////////////////////////////////// +// -----------------------------------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/EXL/Calibration.txt b/NPAnalysis/EXL/Calibration.txt new file mode 100644 index 0000000000000000000000000000000000000000..64dcc5d03d94657b4c75ede5d4ac2c6f9a5bab0c --- /dev/null +++ b/NPAnalysis/EXL/Calibration.txt @@ -0,0 +1,3 @@ +CalibrationFilePath + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/EXL/macros/Calibration/Energy/Calibration/Calibration_no_CT_run0018-52.cal + diff --git a/NPAnalysis/EXL/Makefile b/NPAnalysis/EXL/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..2b175ac4b0375e32f02c758e33da2ad7954014fc --- /dev/null +++ b/NPAnalysis/EXL/Makefile @@ -0,0 +1,31 @@ +# include same architecture file than for NPLib +# so that consistency is ensured +include $(NPTOOL)/NPLib/Makefile.arch + +# additional libraries +LIBRARY = `$(NPTOOL)/NPLib/liblist` +LIBRARY += -L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) + +PROGRAMS = Analysis + +all: $(PROGRAMS) + +Analysis: Analysis.o + $(LD) $(LDFLAGS) $^ $(LIBS) $(LIBRARY) -lSpectrum $(OutPutOpt) $@ + @echo "$@ done" + + +# rule for creating .o from .cxx +.SUFFIXES: .$(SrcSuf) +.$(SrcSuf).$(ObjSuf): + $(CXX) $(CXXFLAGS) $(INCLUDE) -c $< + +# some cleaning +clean: + rm -rf *.o + +distclean: + make clean; rm $(PROGRAMS) + +# dependences +Analysis.o: Analysis.cxx Analysis.h diff --git a/NPAnalysis/EXL/RunToTreat.txt b/NPAnalysis/EXL/RunToTreat.txt new file mode 100644 index 0000000000000000000000000000000000000000..a9a6804607d9a897d6132c43a6f495478d10b0b6 --- /dev/null +++ b/NPAnalysis/EXL/RunToTreat.txt @@ -0,0 +1,11 @@ +TTreeName + AutoTree +RootFileName + /vol0/Laurent/Data/Data_e582_converties/run_0186.01Jun11_08h35m31s.root + + + + + + + diff --git a/NPAnalysis/Speg/Analysis.cxx b/NPAnalysis/Speg/Analysis.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0f24b225ee87b3abef5ca2fc69ab8538dd6d3ba6 --- /dev/null +++ b/NPAnalysis/Speg/Analysis.cxx @@ -0,0 +1,189 @@ +#include "Analysis.h" +using namespace std; + +int main(int argc, char** argv) +{ + +/*---------------------------------Initialisation---------------------------------------*/ + +//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); + +//Get the formed Chained Tree and Treat it +TChain* Chain = RootInput:: getInstance() -> GetChain(); + +//Attach new branch +InitOutputBranch(); + +//Instantiate some Reaction +NPL::Reaction* Reaction_e582 = new Reaction; +Reaction_e582->ReadConfigurationFile("40Ca.reaction"); + +//Get TSpegPhysics pointer +TSpegPhysics *Speg = (TSpegPhysics*) myDetector -> GetDetector("SPEG") ; + +/*----------------------------------Reading events-------------------------------*/ + +//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%50000==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 +ReInitValue(); +Chain -> GetEntry(i); + +//Make Physical Tree +Speg->ClearEventPhysics(); +Speg->BuildPhysicalEvent(); + +//Get the usefull Data for SPEG +mass1 = Reaction_e582->GetNucleus1()->Mass(); +mass2 = Reaction_e582->GetNucleus2()->Mass(); +mass3 = Reaction_e582->GetNucleus3()->Mass(); +mass4 = Reaction_e582->GetNucleus4()->Mass(); +T1 = Reaction_e582->GetBeamEnergy(); +if(Speg->X_FocalPlan.size()==1 && Speg->Phi_FocalPlan.size() == Speg->X_FocalPlan.size()) +{ + for(unsigned int countSpeg = 0 ; countSpeg < Speg->X_FocalPlan.size() ; countSpeg++) + { + //Usefull data + Thetafoc = Speg->Theta_FocalPlan[countSpeg]; + Phifoc = Speg->Phi_FocalPlan[countSpeg]; + Time_Plastic_Right = Speg->Time_Plastic_Right; + Khi2 = Speg->Khi2; + Z = Speg->Z[countSpeg]; + M_over_Q = Speg->M_over_Q[countSpeg]; + ThetaSPEG = acos(cos(Thetafoc*Pi/180)*cos(Phifoc*Pi/180)); + PhiSPEG = atan2(tan(Phifoc*Pi/180),sin(Thetafoc*Pi/180)); + ExcitationEnergy_4 = Speg->X_FocalPlan[countSpeg]; + + //Nucleus3 kinetic energy calculation + Energy_3 = GetSPEG_Energy(ExcitationEnergy_4,ThetaSPEG); + + //Some Physics results + GetPhysicsResults(Energy_3, ThetaSPEG, PhiSPEG, ExcitationEnergy_4); + } +} + +//Fill Physical Tree +RootOutput::getInstance()->GetTree()->Fill(); +} + +cout << "A total of " << nentries << " event has been analysed " << endl ; + +RootOutput::getInstance()->Destroy(); +RootInput::getInstance()->Destroy(); +NPOptionManager::getInstance()->Destroy(); + +return 0; +} + +//Reaction : 1+2->3+4 (1=beam, 2=target=40Ca, 3=Nucleus in SPEG, 4=Excited Target) +//Nucleus3 kinetic energy calculation +double GetSPEG_Energy(double E4ex, double ThetaSPEG) +{ + A = pow(T1+mass1+mass2,2)+(-(T1+mass1)*(T1+mass1)+mass1*mass1)*cos(ThetaSPEG)*cos(ThetaSPEG); + Q = (mass4+E4ex)*(mass4+E4ex)-mass3*mass3-mass2*mass2-mass1*mass1; + B = Q*(T1+mass1+mass2)-2*(T1+mass1)*mass2*(T1+mass1+mass2); + C = Q*Q/4+(T1+mass1)*(T1+mass1)*mass2*mass2-(T1+mass1)*mass2*Q+((T1+mass1)*(T1+mass1)*mass3*mass3-mass1*mass1*mass3*mass3)*cos(ThetaSPEG)*cos(ThetaSPEG); + delta = B*B-4*A*C; + T3 = (-B+sqrt(delta))/(2*A)-mass3; + return(T3); +} + +//Reaction : 1+2->3+4 (1=beam, 2=target=40Ca, 3=Nucleus in SPEG, 4=Excited Target) +void GetPhysicsResults(double T3, double ThetaSPEG, double PhiSPEG, double E4ex) +{ + //Analytic relativistic kinematic calculation + P1 = sqrt(2*mass1*T1+T1*T1); + P1Vector = TVector3(0,0,P1); + P3 = sqrt(2*mass3*T3+T3*T3); + P3Vector = TVector3(-P3*cos(PhiSPEG)*sin(ThetaSPEG),P3*sin(PhiSPEG)*sin(ThetaSPEG),P3*cos(ThetaSPEG));//The SPEG coordinate is different to the NPTOOL coordinate + P4Vector = P1Vector-P3Vector; + P4 = P4Vector.Mag(); + T4 = sqrt(mass4*mass4+P4*P4)-mass4; + Theta_4 = P4Vector.Angle(P1Vector); + Phi_4 = P4Vector.Phi(); +} + +void InitOutputBranch() +{ + RootOutput::getInstance()->GetTree()->Branch("Energy_3", &Energy_3,"Energy_3/D"); + RootOutput::getInstance()->GetTree()->Branch("ThetaSPEG", &ThetaSPEG,"ThetaSPEG/D"); + RootOutput::getInstance()->GetTree()->Branch("PhiSPEG", &PhiSPEG,"PhiSPEG/D"); + RootOutput::getInstance()->GetTree()->Branch("ExcitationEnergy_4", &ExcitationEnergy_4,"ExcitationEnergy_4/D"); + RootOutput::getInstance()->GetTree()->Branch("Energy_4", &T4,"T4/D"); + RootOutput::getInstance()->GetTree()->Branch("Theta_4", &Theta_4,"Theta_4/D"); + RootOutput::getInstance()->GetTree()->Branch("Phi_4", &Phi_4,"Phi_4/D"); +} + +void ReInitValue() +{ + Thetafoc = -1000; + Phifoc = -1000; + M_over_Q = -1000; + Z = -1000; + ThetaSPEG = -1000; + PhiSPEG = -1000; + Time_Plastic_Right = -1000; + Khi2 = -1000; + Energy_3 = -1000; + ExcitationEnergy_4 = -1000; + Energy_4 = -1000; + Theta_4 = -1000; + Phi_4 = -1000; + A = -1000; + B = -1000; + C = -1000; + Q = -1000; + delta = -1000; + T3 = -1000; + P3 = -1000; + T4 = -1000; + P4 = -1000; + P1 = -1000; +} diff --git a/NPAnalysis/Speg/Analysis.h b/NPAnalysis/Speg/Analysis.h new file mode 100644 index 0000000000000000000000000000000000000000..58ac7f65b6496f385ea643d84a8be81719149dd9 --- /dev/null +++ b/NPAnalysis/Speg/Analysis.h @@ -0,0 +1,146 @@ +// 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> +#include <TSystem.h> +#include <TBranch.h> +#include <TH1F.h> +#include <TTree.h> +#include <TGraph.h> +#include <TSpectrum.h> +#include <TObject.h> + +// NPL +#include "RootInput.h" +#include "RootOutput.h" +#include "NPReaction.h" +#include "TInitialConditions.h" +#include "TSpegPhysics.h" + +// Use CLHEP System of unit and Physical Constant +#include "CLHEP/Units/GlobalSystemOfUnits.h" +#include "CLHEP/Units/PhysicalConstants.h" + +/*------------------Function-----------------------------*/ + +void InitOutputBranch(); +void ReInitValue(); +double GetSPEG_Energy(double E4ex, double ThetaSPEG); +void GetPhysicsResults(double T3, double ThetaSPEG, double PhiSPEG, double E4ex); + +/*--------------------------Variables--------------------*/ + +double mass1 = -1000; +double mass2 = -1000; +double mass3 = -1000; +double mass4 = -1000; +double Thetafoc = -1000; +double Phifoc = -1000; +double M_over_Q = -1000; +double Z = -1000; +double ThetaSPEG = -1000; +double PhiSPEG = -1000; +double Time_Plastic_Right = -1000; +double Khi2 = -1000; +double Energy_3 = -1000; +double ExcitationEnergy_4 = -1000; +double Energy_4 = -1000; +double Theta_4 = -1000; +double Phi_4 = -1000; +double Pi = 3.141592654; +double T1 = -1000; +double P1 = -1000; +double T3 = -1000; +double P3 = -1000; +double T4 = -1000; +double P4 = -1000; +double A = -1000; +double B = -1000; +double C = -1000; +double Q = -1000; +double delta = -1000; + +TVector3 P1Vector; +TVector3 P3Vector; +TVector3 P4Vector; + +///////////////////////////////////////////////////////////////////////////////////////////////// +// -----------------------------------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/Speg/Calibration.txt b/NPAnalysis/Speg/Calibration.txt new file mode 100644 index 0000000000000000000000000000000000000000..4aeeb26c37eadeb0b79444d8c3285fbd13dea475 --- /dev/null +++ b/NPAnalysis/Speg/Calibration.txt @@ -0,0 +1,18 @@ +CalibrationFilePath + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/Cal_SPEG_Plastic_Right.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/Cal_SPEG_Plastic_Left.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/dsp11new.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/dsp12new.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/dsp21new.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/dsp22new.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/SPEG_DC_S11.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/SPEG_DC_S12.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/SPEG_DC_S21.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/SPEG_DC_S22.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Correction/Correction/Correction_xfoc_tfoc.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Correction/Correction/Correction_xfoc_phifoc.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/Cal_SPEG_xfoc.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Correction/Correction/Correction_theta.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Correction/Correction/Correction_phi.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/Cal_SPEG_theta.cal + /vol0/Laurent/NPTool/NPAnalysis/Analyse_e582/SPEG/macros/Calibration/Calibration/Cal_SPEG_phi.cal diff --git a/NPAnalysis/Speg/Makefile b/NPAnalysis/Speg/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..2b175ac4b0375e32f02c758e33da2ad7954014fc --- /dev/null +++ b/NPAnalysis/Speg/Makefile @@ -0,0 +1,31 @@ +# include same architecture file than for NPLib +# so that consistency is ensured +include $(NPTOOL)/NPLib/Makefile.arch + +# additional libraries +LIBRARY = `$(NPTOOL)/NPLib/liblist` +LIBRARY += -L$(CLHEP_LIB_DIR) -l$(CLHEP_LIB) + +PROGRAMS = Analysis + +all: $(PROGRAMS) + +Analysis: Analysis.o + $(LD) $(LDFLAGS) $^ $(LIBS) $(LIBRARY) -lSpectrum $(OutPutOpt) $@ + @echo "$@ done" + + +# rule for creating .o from .cxx +.SUFFIXES: .$(SrcSuf) +.$(SrcSuf).$(ObjSuf): + $(CXX) $(CXXFLAGS) $(INCLUDE) -c $< + +# some cleaning +clean: + rm -rf *.o + +distclean: + make clean; rm $(PROGRAMS) + +# dependences +Analysis.o: Analysis.cxx Analysis.h diff --git a/NPAnalysis/Speg/RunToTreat.txt b/NPAnalysis/Speg/RunToTreat.txt new file mode 100644 index 0000000000000000000000000000000000000000..3ea335df93d6457c7792a3fca7f923a60c224b9d --- /dev/null +++ b/NPAnalysis/Speg/RunToTreat.txt @@ -0,0 +1,14 @@ +TTreeName + AutoTree +RootFileName + /vol0/Laurent/Data/Data_e582_converties/run_0186.01Jun11_08h35m31s.root + /vol0/Laurent/Data/Data_e582_converties/run_0187.01Jun11_08h43m36s.root + /vol0/Laurent/Data/Data_e582_converties/run_0188.01Jun11_09h13m57s.root + /vol0/Laurent/Data/Data_e582_converties/run_0189.01Jun11_09h44m37s.root + /vol0/Laurent/Data/Data_e582_converties/run_0190.01Jun11_10h08m49s.root + + + + + + diff --git a/NPAnalysis/Speg/configs/ConfigSPEG.dat b/NPAnalysis/Speg/configs/ConfigSPEG.dat new file mode 100644 index 0000000000000000000000000000000000000000..25304f7d9ae2cbdcf60caf73c6cf0112bf68ac16 --- /dev/null +++ b/NPAnalysis/Speg/configs/ConfigSPEG.dat @@ -0,0 +1,6 @@ +ConfigSPEG +% CORRECTION COEF + CORRECTION_COEF_DC_11 SPEGSTRIP_58 0.927592782 + CORRECTION_COEF_DC_12 SPEGSTRIP_17 1.4119115 + CORRECTION_COEF_DC_21 SPEGSTRIP_36 0.6185790 + diff --git a/NPLib/Speg/Makefile b/NPLib/Speg/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..802f09175ac15d5baacab794b4349608316462d8 --- /dev/null +++ b/NPLib/Speg/Makefile @@ -0,0 +1,59 @@ +include ../Makefile.arch + +#------------------------------------------------------------------------------ +SHARELIB = libSpegDCData.so libSpegCHIOData.so \ + libSpegPlasticData.so \ + libSpegPhysics.so + +all: $(SHARELIB) +#------------------------------------------------------------------------------ +############### Detector ############## + +## SpegDC ## +libSpegDCData.so: TSpegDCData.o TSpegDCDataDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +TSpegDCDataDict.cxx: TSpegDCData.h + rootcint -f $@ -c $^ + +## SpegCHIO ## +libSpegCHIOData.so: TSpegCHIOData.o TSpegCHIODataDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +TSpegCHIODataDict.cxx: TSpegCHIOData.h + rootcint -f $@ -c $^ + +## SpegPlastic ## +libSpegPlasticData.so: TSpegPlasticData.o TSpegPlasticDataDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +TSpegPlasticDataDict.cxx: TSpegPlasticData.h + rootcint -f $@ -c $^ + +libSpegPhysics.so: TSpegPhysics.o TSpegPhysicsDict.o + $(LD) $(SOFLAGS) $^ $(OutPutOpt) $@ + +TSpegPhysicsDict.cxx: TSpegPhysics.h + rootcint -f $@ -c $^ +# dependances +TSpegDCData.o: TSpegDCData.cxx TSpegDCData.h +TSpegCHIOData.o: TSpegCHIOData.cxx TSpegCHIOData.h +TSpegPlasticData.o: TSpegPlasticData.cxx TSpegPlasticData.h +TSpegPhysics.o: TSpegPhysics.cxx TSpegPhysics.h +####################################### + +############# Clean and More ########## +clean: + @rm -f core *~ *.o *Dict* + +distclean: + make clean; rm -f *.so + +.SUFFIXES: .$(SrcSuf) + +### + +.$(SrcSuf).$(ObjSuf): + $(CXX) $(CXXFLAGS) $(INCLUDE) -c $< + + diff --git a/NPLib/Speg/TSpegCHIOData.cxx b/NPLib/Speg/TSpegCHIOData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9eb8219c293886d2e90e6636500c608f33fba802 --- /dev/null +++ b/NPLib/Speg/TSpegCHIOData.cxx @@ -0,0 +1,57 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds Speg Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include <iostream> +using namespace std; + +#include "TSpegCHIOData.h" + + +ClassImp(TSpegCHIOData) + +TSpegCHIOData::TSpegCHIOData() +{ + // Default constructor + Clear(); +} + + + +TSpegCHIOData::~TSpegCHIOData() +{ +} + + + +void TSpegCHIOData::Clear() +{ + fSpeg_CHIO_Energy.clear(); +} + + + +void TSpegCHIOData::Dump() const +{ + cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event XXXXXXXXXXXXXXXXX" << endl; + + + for (UShort_t i = 0; i < fSpeg_CHIO_Energy.size(); i++) + cout << " Energy: " << fSpeg_CHIO_Energy[i] << endl; +} diff --git a/NPLib/Speg/TSpegCHIOData.h b/NPLib/Speg/TSpegCHIOData.h new file mode 100644 index 0000000000000000000000000000000000000000..a8d870da2f955f721e76d7b9babfddf87ea469fb --- /dev/null +++ b/NPLib/Speg/TSpegCHIOData.h @@ -0,0 +1,55 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds Speg Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#ifndef __SPEGCHIODATA__ +#define __SPEGCHIODATA__ + +#include <vector> + +#include "TObject.h" + + + +class TSpegCHIOData : public TObject { + private: + + vector<UShort_t> fSpeg_CHIO_Energy; + + public: + TSpegCHIOData(); + virtual ~TSpegCHIOData(); + + void Clear(); + void Clear(const Option_t*) {}; + void Dump() const; + + ///////////////////// SETTERS //////////////////////// + + void SetSpegCHIOEnergy(UShort_t Energy) {fSpeg_CHIO_Energy.push_back(Energy);} + + ///////////////////// GETTERS //////////////////////// + + UShort_t GetSpegCHIOEnergy(Int_t i) {return fSpeg_CHIO_Energy.at(i);} + UShort_t GetMultSpegCHIOEnergy() {return fSpeg_CHIO_Energy.size();} + + ClassDef(TSpegCHIOData,1) // SpegCHIOData structure +}; + +#endif diff --git a/NPLib/Speg/TSpegDCData.cxx b/NPLib/Speg/TSpegDCData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f7326e816ade8e2db007f869a1e3f504909b191b --- /dev/null +++ b/NPLib/Speg/TSpegDCData.cxx @@ -0,0 +1,175 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds SPEG Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include <iostream> +using namespace std; + +#include "TSpegDCData.h" + + +ClassImp(TSpegDCData) + +TSpegDCData::TSpegDCData() +{ + // Default constructor + Clear(); +} + + + +TSpegDCData::~TSpegDCData() +{ +} + + + +void TSpegDCData::Clear() +{ + // Strips from CDM 11 + fSpeg_DC_Strip11_DetNbr.clear(); + fSpeg_DC_Strip11_StripNbr.clear(); + fSpeg_DC_Strip11_Energy.clear(); + // Strips from CDM 12 + fSpeg_DC_Strip12_DetNbr.clear(); + fSpeg_DC_Strip12_StripNbr.clear(); + fSpeg_DC_Strip12_Energy.clear(); + // Strips from CDM 21 + fSpeg_DC_Strip21_DetNbr.clear(); + fSpeg_DC_Strip21_StripNbr.clear(); + fSpeg_DC_Strip21_Energy.clear(); + // Strips from CDM 22 + fSpeg_DC_Strip22_DetNbr.clear(); + fSpeg_DC_Strip22_StripNbr.clear(); + fSpeg_DC_Strip22_Energy.clear(); + // Efil11 + fSpeg_DC_Efil11_DetNbr.clear(); + fSpeg_DC_Efil11_Energy.clear(); + // Efil12 + fSpeg_DC_Efil12_DetNbr.clear(); + fSpeg_DC_Efil12_Energy.clear(); + // Efil21 + fSpeg_DC_Efil21_DetNbr.clear(); + fSpeg_DC_Efil21_Energy.clear(); + // Efil22 + fSpeg_DC_Efil22_DetNbr.clear(); + fSpeg_DC_Efil22_Energy.clear(); + + // Tplfil11 + fSpeg_DC_Tplfil11_DetNbr.clear(); + fSpeg_DC_Tplfil11_Time.clear(); + // Tplfil12 + fSpeg_DC_Tplfil12_DetNbr.clear(); + fSpeg_DC_Tplfil12_Time.clear(); + // Tplfil21 + fSpeg_DC_Tplfil21_DetNbr.clear(); + fSpeg_DC_Tplfil21_Time.clear(); + // Tplfil22 + fSpeg_DC_Tplfil22_DetNbr.clear(); + fSpeg_DC_Tplfil22_Time.clear(); + + // TEMPS fil11 + fSpeg_DC_Tfil11_DetNbr.clear(); + fSpeg_DC_Tfil11_Time.clear(); + // TEMPS fil12 + fSpeg_DC_Tfil12_DetNbr.clear(); + fSpeg_DC_Tfil12_Time.clear(); + // TEMPS fil21 + fSpeg_DC_Tfil21_DetNbr.clear(); + fSpeg_DC_Tfil21_Time.clear(); + // TEMPS fil22 + fSpeg_DC_Tfil22_DetNbr.clear(); + fSpeg_DC_Tfil22_Time.clear(); +} + + + +void TSpegDCData::Dump() const +{ + cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event XXXXXXXXXXXXXXXXX" << endl; + + // Strips from CDM 11 + cout << "SpegDC_Strip11_Mult = " << fSpeg_DC_Strip11_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Strip11_DetNbr.size(); i++) + cout << "Det_Strip1: " << fSpeg_DC_Strip11_DetNbr[i] << " Strip_Strip1: " << fSpeg_DC_Strip11_StripNbr[i] << " Energy_Strip11: " << fSpeg_DC_Strip11_Energy[i] << endl; + // Strips from CDM 12 + cout << "SpegDC_Strip12_Mult = " << fSpeg_DC_Strip12_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Strip12_DetNbr.size(); i++) + cout << "Det_Strip12: " << fSpeg_DC_Strip12_DetNbr[i] << " Strip_Strip12: " << fSpeg_DC_Strip12_StripNbr[i] << " Energy_Strip12: " << fSpeg_DC_Strip12_Energy[i] << endl; + // Strips from CDM 21 + cout << "SpegDC_Strip21_Mult = " << fSpeg_DC_Strip21_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Strip21_DetNbr.size(); i++) + cout << "Det_Strip21: " << fSpeg_DC_Strip21_DetNbr[i] << " Strip_Strip21: " << fSpeg_DC_Strip21_StripNbr[i] << " Energy_Strip21: " << fSpeg_DC_Strip21_Energy[i] << endl; + // Strips from CDM 22 + cout << "SpegDC_Strip22_Mult = " << fSpeg_DC_Strip22_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Strip22_DetNbr.size(); i++) + cout << "Det_Strip22: " << fSpeg_DC_Strip22_DetNbr[i] << " Strip_Strip22: " << fSpeg_DC_Strip22_StripNbr[i] << " Energy_Strip22: " << fSpeg_DC_Strip22_Energy[i] << endl; + + // Efil11 + cout << "SpegDC_Efil11_Mult = " << fSpeg_DC_Efil11_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Efil11_DetNbr.size(); i++) + cout << "DetNbr11: " << fSpeg_DC_Efil11_DetNbr[i] << " Energy11: " << fSpeg_DC_Efil11_Energy[i] << endl; + // Efil12 + cout << "SpegDC_Efil12_Mult = " << fSpeg_DC_Efil12_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Efil12_DetNbr.size(); i++) + cout << "DetNbr12: " << fSpeg_DC_Efil12_DetNbr[i] << " Energy12: " << fSpeg_DC_Efil12_Energy[i] << endl; + // Efil21 + cout << "SpegDC_Efil21_Mult = " << fSpeg_DC_Efil21_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Efil21_DetNbr.size(); i++) + cout << "DetNbr21: " << fSpeg_DC_Efil21_DetNbr[i] << " Energy21: " << fSpeg_DC_Efil21_Energy[i] << endl; + // Efil22 + cout << "SpegDC_Efil22_Mult = " << fSpeg_DC_Efil22_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Efil22_DetNbr.size(); i++) + cout << "DetNbr22: " << fSpeg_DC_Efil22_DetNbr[i] << " Energy22: " << fSpeg_DC_Efil22_Energy[i] << endl; + + // Tplfil11 + cout << "SpegDC_Tplfil11_Mult = " << fSpeg_DC_Tplfil11_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tplfil11_DetNbr.size(); i++) + cout << "DetNbr11: " << fSpeg_DC_Tplfil11_DetNbr[i] << " Time11: " << fSpeg_DC_Tplfil11_Time[i] << endl; + // Tplfil12 + cout << "SpegDC_Tplfil12_Mult = " << fSpeg_DC_Tplfil12_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tplfil12_DetNbr.size(); i++) + cout << "DetNbr12: " << fSpeg_DC_Tplfil12_DetNbr[i] << " Time12: " << fSpeg_DC_Tplfil12_Time[i] << endl; + // Tplfil21 + cout << "SpegDC_Tplfil21_Mult = " << fSpeg_DC_Tplfil21_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tplfil21_DetNbr.size(); i++) + cout << "DetNbr21: " << fSpeg_DC_Tplfil21_DetNbr[i] << " Time21: " << fSpeg_DC_Tplfil21_Time[i] << endl; + // Tplfil22 + cout << "SpegDC_Tplfil22_Mult = " << fSpeg_DC_Tplfil22_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tplfil22_DetNbr.size(); i++) + cout << "DetNbr22: " << fSpeg_DC_Tplfil22_DetNbr[i] << " Time22: " << fSpeg_DC_Tplfil22_Time[i] << endl; + + // TEMPS fil11 + cout << "SpegDC_Tfil11_Mult = " << fSpeg_DC_Tfil11_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tfil11_DetNbr.size(); i++) + cout << "DetNbr11: " << fSpeg_DC_Tfil11_DetNbr[i] << " Time11: " << fSpeg_DC_Tfil11_Time[i] << endl; + // TEMPS fil12 + cout << "SpegDC_Tfil12_Mult = " << fSpeg_DC_Tfil12_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tfil12_DetNbr.size(); i++) + cout << "DetNbr12: " << fSpeg_DC_Tfil12_DetNbr[i] << " Time12: " << fSpeg_DC_Tfil12_Time[i] << endl; + // TEMPS fil21 + cout << "SpegDC_Tfil21_Mult = " << fSpeg_DC_Tfil21_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tfil21_DetNbr.size(); i++) + cout << "DetNbr21: " << fSpeg_DC_Tfil21_DetNbr[i] << " Time21: " << fSpeg_DC_Tfil21_Time[i] << endl; + // TEMPS fil22 + cout << "SpegDC_Tfil22_Mult = " << fSpeg_DC_Tfil22_DetNbr.size() << endl; + for (UShort_t i = 0; i < fSpeg_DC_Tfil22_DetNbr.size(); i++) + cout << "DetNbr22: " << fSpeg_DC_Tfil22_DetNbr[i] << " Time22: " << fSpeg_DC_Tfil22_Time[i] << endl; +} diff --git a/NPLib/Speg/TSpegDCData.h b/NPLib/Speg/TSpegDCData.h new file mode 100644 index 0000000000000000000000000000000000000000..82716f994683ac09988ef63334dd9727a5f282fd --- /dev/null +++ b/NPLib/Speg/TSpegDCData.h @@ -0,0 +1,254 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds SPEG Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#ifndef __SPEGDCDATA__ +#define __SPEGDCDATA__ + +#include <vector> + +#include "TObject.h" + + + +class TSpegDCData : public TObject { + private: + // Strips for CDM 11 + vector<UShort_t> fSpeg_DC_Strip11_DetNbr; + vector<UShort_t> fSpeg_DC_Strip11_StripNbr; + vector<UShort_t> fSpeg_DC_Strip11_Energy; + + // Strips for CDM 12 + vector<UShort_t> fSpeg_DC_Strip12_DetNbr; + vector<UShort_t> fSpeg_DC_Strip12_StripNbr; + vector<UShort_t> fSpeg_DC_Strip12_Energy; + + // Strips for CDM 21 + vector<UShort_t> fSpeg_DC_Strip21_DetNbr; + vector<UShort_t> fSpeg_DC_Strip21_StripNbr; + vector<UShort_t> fSpeg_DC_Strip21_Energy; + + // Strips for CDM 22 + vector<UShort_t> fSpeg_DC_Strip22_DetNbr; + vector<UShort_t> fSpeg_DC_Strip22_StripNbr; + vector<UShort_t> fSpeg_DC_Strip22_Energy; + + // EFil11 + vector<UShort_t> fSpeg_DC_Efil11_DetNbr; + vector<UShort_t> fSpeg_DC_Efil11_Energy; + + // EFil12 + vector<UShort_t> fSpeg_DC_Efil12_DetNbr; + vector<UShort_t> fSpeg_DC_Efil12_Energy; + + // EFil21 + vector<UShort_t> fSpeg_DC_Efil21_DetNbr; + vector<UShort_t> fSpeg_DC_Efil21_Energy; + + // EFil22 + vector<UShort_t> fSpeg_DC_Efil22_DetNbr; + vector<UShort_t> fSpeg_DC_Efil22_Energy; + + // Tplfil11 + vector<UShort_t> fSpeg_DC_Tplfil11_DetNbr; + vector<UShort_t> fSpeg_DC_Tplfil11_Time; + + // Tplfil12 + vector<UShort_t> fSpeg_DC_Tplfil12_DetNbr; + vector<UShort_t> fSpeg_DC_Tplfil12_Time; + + // Tplfil21 + vector<UShort_t> fSpeg_DC_Tplfil21_DetNbr; + vector<UShort_t> fSpeg_DC_Tplfil21_Time; + + // Tplfil22 + vector<UShort_t> fSpeg_DC_Tplfil22_DetNbr; + vector<UShort_t> fSpeg_DC_Tplfil22_Time; + + // TEMPS fil11 + vector<UShort_t> fSpeg_DC_Tfil11_DetNbr; + vector<UShort_t> fSpeg_DC_Tfil11_Time; + + // TEMPS fil12 + vector<UShort_t> fSpeg_DC_Tfil12_DetNbr; + vector<UShort_t> fSpeg_DC_Tfil12_Time; + + // TEMPS fil21 + vector<UShort_t> fSpeg_DC_Tfil21_DetNbr; + vector<UShort_t> fSpeg_DC_Tfil21_Time; + + // TEMPS fill22 + vector<UShort_t> fSpeg_DC_Tfil22_DetNbr; + vector<UShort_t> fSpeg_DC_Tfil22_Time; + + public: + TSpegDCData(); + virtual ~TSpegDCData(); + + void Clear(); + void Clear(const Option_t*) {}; + void Dump() const; + + ///////////////////// SETTERS //////////////////////// + // Strips for CDM 11 + void SetSpegDCDetNbr11(UShort_t DetNbr11) {fSpeg_DC_Strip11_DetNbr.push_back(DetNbr11);} + void SetSpegDCStripNbr11(UShort_t StripNbr11) {fSpeg_DC_Strip11_StripNbr.push_back(StripNbr11);} + void SetSpegDCEnergy11(UShort_t Energy11) {fSpeg_DC_Strip11_Energy.push_back(Energy11);} + + // Strips for CDM 12 + void SetSpegDCDetNbr12(UShort_t DetNbr12) {fSpeg_DC_Strip12_DetNbr.push_back(DetNbr12);} + void SetSpegDCStripNbr12(UShort_t StripNbr12) {fSpeg_DC_Strip12_StripNbr.push_back(StripNbr12);} + void SetSpegDCEnergy12(UShort_t Energy12) {fSpeg_DC_Strip12_Energy.push_back(Energy12);} + + // Strips for CDM 21 + void SetSpegDCDetNbr21(UShort_t DetNbr21) {fSpeg_DC_Strip21_DetNbr.push_back(DetNbr21);} + void SetSpegDCStripNbr21(UShort_t StripNbr21) {fSpeg_DC_Strip21_StripNbr.push_back(StripNbr21);} + void SetSpegDCEnergy21(UShort_t Energy21) {fSpeg_DC_Strip21_Energy.push_back(Energy21);} + + // Strips for CDM 22 + void SetSpegDCDetNbr22(UShort_t DetNbr22) {fSpeg_DC_Strip22_DetNbr.push_back(DetNbr22);} + void SetSpegDCStripNbr22(UShort_t StripNbr22) {fSpeg_DC_Strip22_StripNbr.push_back(StripNbr22);} + void SetSpegDCEnergy22(UShort_t Energy22) {fSpeg_DC_Strip22_Energy.push_back(Energy22);} + + // E fil11 + void SetSpegDCEfilDetNbr11(UShort_t DetNbr11) {fSpeg_DC_Efil11_DetNbr.push_back(DetNbr11);} + void SetSpegDCEfilEnergy11(UShort_t Energy11) {fSpeg_DC_Efil11_Energy.push_back(Energy11);} + + // E fil12 + void SetSpegDCEfilDetNbr12(UShort_t DetNbr12) {fSpeg_DC_Efil12_DetNbr.push_back(DetNbr12);} + void SetSpegDCEfilEnergy12(UShort_t Energy12) {fSpeg_DC_Efil12_Energy.push_back(Energy12);} + + // E fil21 + void SetSpegDCEfilDetNbr21(UShort_t DetNbr21) {fSpeg_DC_Efil21_DetNbr.push_back(DetNbr21);} + void SetSpegDCEfilEnergy21(UShort_t Energy21) {fSpeg_DC_Efil21_Energy.push_back(Energy21);} + + // E fil22 + void SetSpegDCEfilDetNbr22(UShort_t DetNbr22) {fSpeg_DC_Efil22_DetNbr.push_back(DetNbr22);} + void SetSpegDCEfilEnergy22(UShort_t Energy22) {fSpeg_DC_Efil22_Energy.push_back(Energy22);} + + // Tplfil11 + void SetSpegDCTplfilDetNbr11(UShort_t DetNbr11) {fSpeg_DC_Tplfil11_DetNbr.push_back(DetNbr11);} + void SetSpegDCTplfilTime11(UShort_t Time11) {fSpeg_DC_Tplfil11_Time.push_back(Time11);} + + // Tplfil12 + void SetSpegDCTplfilDetNbr12(UShort_t DetNbr12) {fSpeg_DC_Tplfil12_DetNbr.push_back(DetNbr12);} + void SetSpegDCTplfilTime12(UShort_t Time12) {fSpeg_DC_Tplfil12_Time.push_back(Time12);} + + // Tplfil21 + void SetSpegDCTplfilDetNbr21(UShort_t DetNbr21) {fSpeg_DC_Tplfil21_DetNbr.push_back(DetNbr21);} + void SetSpegDCTplfilTime21(UShort_t Time21) {fSpeg_DC_Tplfil21_Time.push_back(Time21);} + + // Tplfil22 + void SetSpegDCTplfilDetNbr22(UShort_t DetNbr22) {fSpeg_DC_Tplfil22_DetNbr.push_back(DetNbr22);} + void SetSpegDCTplfilTime22(UShort_t Time22) {fSpeg_DC_Tplfil22_Time.push_back(Time22);} + + // TEMPS fil11 + void SetSpegDCTfilDetNbr11(UShort_t DetNbr11) {fSpeg_DC_Tfil11_DetNbr.push_back(DetNbr11);} + void SetSpegDCTfilTime11(UShort_t Time11) {fSpeg_DC_Tfil11_Time.push_back(Time11);} + + // TEMPS fil12 + void SetSpegDCTfilDetNbr12(UShort_t DetNbr12) {fSpeg_DC_Tfil12_DetNbr.push_back(DetNbr12);} + void SetSpegDCTfilTime12(UShort_t Time12) {fSpeg_DC_Tfil12_Time.push_back(Time12);} + + // TEMPS fil21 + void SetSpegDCTfilDetNbr21(UShort_t DetNbr21) {fSpeg_DC_Tfil21_DetNbr.push_back(DetNbr21);} + void SetSpegDCTfilTime21(UShort_t Time21) {fSpeg_DC_Tfil21_Time.push_back(Time21);} + + // TEMPS fil22 + void SetSpegDCTfilDetNbr22(UShort_t DetNbr22) {fSpeg_DC_Tfil22_DetNbr.push_back(DetNbr22);} + void SetSpegDCTfilTime22(UShort_t Time22) {fSpeg_DC_Tfil22_Time.push_back(Time22);} + + ///////////////////// GETTERS //////////////////////// + // Strips for CDM 11 + UShort_t GetSpegDCMultStrip11() {return fSpeg_DC_Strip11_DetNbr.size();} + UShort_t GetSpegDCDetNbr11(Int_t i) {return fSpeg_DC_Strip11_DetNbr.at(i);} + UShort_t GetSpegDCStripNbr11(Int_t i) {return fSpeg_DC_Strip11_StripNbr.at(i);} + UShort_t GetSpegDCEnergy11(Int_t i) {return fSpeg_DC_Strip11_Energy.at(i);} + // Strips for CDM 12 + UShort_t GetSpegDCMultStrip12() {return fSpeg_DC_Strip12_DetNbr.size();} + UShort_t GetSpegDCDetNbr12(Int_t i) {return fSpeg_DC_Strip12_DetNbr.at(i);} + UShort_t GetSpegDCStripNbr12(Int_t i) {return fSpeg_DC_Strip12_StripNbr.at(i);} + UShort_t GetSpegDCEnergy12(Int_t i) {return fSpeg_DC_Strip12_Energy.at(i);} + // Strips for CDM 21 + UShort_t GetSpegDCMultStrip21() {return fSpeg_DC_Strip21_DetNbr.size();} + UShort_t GetSpegDCDetNbr21(Int_t i) {return fSpeg_DC_Strip21_DetNbr.at(i);} + UShort_t GetSpegDCStripNbr21(Int_t i) {return fSpeg_DC_Strip21_StripNbr.at(i);} + UShort_t GetSpegDCEnergy21(Int_t i) {return fSpeg_DC_Strip21_Energy.at(i);} + // Strips for CDM 22 + UShort_t GetSpegDCMultStrip22() {return fSpeg_DC_Strip22_DetNbr.size();} + UShort_t GetSpegDCDetNbr22(Int_t i) {return fSpeg_DC_Strip22_DetNbr.at(i);} + UShort_t GetSpegDCStripNbr22(Int_t i) {return fSpeg_DC_Strip22_StripNbr.at(i);} + UShort_t GetSpegDCEnergy22(Int_t i) {return fSpeg_DC_Strip22_Energy.at(i);} + + // E fil11 + UShort_t GetSpegDCEfilMult11() {return fSpeg_DC_Efil11_DetNbr.size();} + UShort_t GetSpegDCEfilDetNbr11(Int_t i) {return fSpeg_DC_Efil11_DetNbr.at(i);} + UShort_t GetSpegDCEfilEnergy11(Int_t i) {return fSpeg_DC_Efil11_Energy.at(i);} + // E fil12 + UShort_t GetSpegDCEfilMult12() {return fSpeg_DC_Efil12_DetNbr.size();} + UShort_t GetSpegDCEfilDetNbr12(Int_t i) {return fSpeg_DC_Efil12_DetNbr.at(i);} + UShort_t GetSpegDCEfilEnergy12(Int_t i) {return fSpeg_DC_Efil12_Energy.at(i);} + // E fil21 + UShort_t GetSpegDCEfilMult21() {return fSpeg_DC_Efil21_DetNbr.size();} + UShort_t GetSpegDCEfilDetNbr21(Int_t i) {return fSpeg_DC_Efil21_DetNbr.at(i);} + UShort_t GetSpegDCEfilEnergy21(Int_t i) {return fSpeg_DC_Efil21_Energy.at(i);} + // E fil22 + UShort_t GetSpegDCEfilMult22() {return fSpeg_DC_Efil22_DetNbr.size();} + UShort_t GetSpegDCEfilDetNbr22(Int_t i) {return fSpeg_DC_Efil22_DetNbr.at(i);} + UShort_t GetSpegDCEfilEnergy22(Int_t i) {return fSpeg_DC_Efil22_Energy.at(i);} + + // Tplfil11 + UShort_t GetSpegDCTplfilMult11() {return fSpeg_DC_Tplfil11_DetNbr.size();} + UShort_t GetSpegDCTplfilDetNbr11(Int_t i) {return fSpeg_DC_Tplfil11_DetNbr.at(i);} + UShort_t GetSpegDCTplfilTime11(Int_t i) {return fSpeg_DC_Tplfil11_Time.at(i);} + // Tplfil12 + UShort_t GetSpegDCTplfilMult12() {return fSpeg_DC_Tplfil12_DetNbr.size();} + UShort_t GetSpegDCTplfilDetNbr12(Int_t i) {return fSpeg_DC_Tplfil12_DetNbr.at(i);} + UShort_t GetSpegDCTplfilTime12(Int_t i) {return fSpeg_DC_Tplfil12_Time.at(i);} + // Tplfil21 + UShort_t GetSpegDCTplfilMult21() {return fSpeg_DC_Tplfil21_DetNbr.size();} + UShort_t GetSpegDCTplfilDetNbr21(Int_t i) {return fSpeg_DC_Tplfil21_DetNbr.at(i);} + UShort_t GetSpegDCTplfilTime21(Int_t i) {return fSpeg_DC_Tplfil21_Time.at(i);} + // Tplfil22 + UShort_t GetSpegDCTplfilMult22() {return fSpeg_DC_Tplfil22_DetNbr.size();} + UShort_t GetSpegDCTplfilDetNbr22(Int_t i) {return fSpeg_DC_Tplfil22_DetNbr.at(i);} + UShort_t GetSpegDCTplfilTime22(Int_t i) {return fSpeg_DC_Tplfil22_Time.at(i);} + + // TEMPS fil11 + UShort_t GetSpegDCTfilMult11() {return fSpeg_DC_Tfil11_DetNbr.size();} + UShort_t GetSpegDCTfilDetNbr11(Int_t i) {return fSpeg_DC_Tfil11_DetNbr.at(i);} + UShort_t GetSpegDCTfilTime11(Int_t i) {return fSpeg_DC_Tfil11_Time.at(i);} + // TEMPS fil12 + UShort_t GetSpegDCTfilMult12() {return fSpeg_DC_Tfil12_DetNbr.size();} + UShort_t GetSpegDCTfilDetNbr12(Int_t i) {return fSpeg_DC_Tfil12_DetNbr.at(i);} + UShort_t GetSpegDCTfilTime12(Int_t i) {return fSpeg_DC_Tfil12_Time.at(i);} + // TEMPS fil21 + UShort_t GetSpegDCTfilMult21() {return fSpeg_DC_Tfil21_DetNbr.size();} + UShort_t GetSpegDCTfilDetNbr21(Int_t i) {return fSpeg_DC_Tfil21_DetNbr.at(i);} + UShort_t GetSpegDCTfilTime21(Int_t i) {return fSpeg_DC_Tfil21_Time.at(i);} + // TEMPS fil22 + UShort_t GetSpegDCTfilMult22() {return fSpeg_DC_Tfil22_DetNbr.size();} + UShort_t GetSpegDCTfilDetNbr22(Int_t i) {return fSpeg_DC_Tfil22_DetNbr.at(i);} + UShort_t GetSpegDCTfilTime22(Int_t i) {return fSpeg_DC_Tfil22_Time.at(i);} + + ClassDef(TSpegDCData,1) // SpegDCData structure +}; + +#endif diff --git a/NPLib/Speg/TSpegPhysics.cxx b/NPLib/Speg/TSpegPhysics.cxx new file mode 100644 index 0000000000000000000000000000000000000000..dba1e83bca82bc8896044723d0b92e409232e921 --- /dev/null +++ b/NPLib/Speg/TSpegPhysics.cxx @@ -0,0 +1,1695 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : October 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold the SPEG Spectrometer Physics * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// NPL +#include "TSpegPhysics.h" +#include "../include/RootOutput.h" +#include "../include/RootInput.h" + +// STL +#include <iostream> +#include <fstream> +#include "TROOT.h" +#include "TSystem.h" +#include "TFile.h" +#include "TString.h" +#include "TTree.h" +#include "TChain.h" +#include "TBranch.h" +#include "TH1F.h" +#include "TF1.h" +#include <vector> +#include <cmath> +#include <stdio.h> +#include <math.h> +#include <stdlib.h> +#include <time.h> +#include <sstream> +#include <limits> +#include <TRandom1.h> +#include <TRandom2.h> +#include <TRandom3.h> + +using namespace std; + +// tranform an integer to a string +string itoa(int value) +{ + char buffer [33]; + sprintf(buffer,"%d",value); + return buffer; +} + +ClassImp(TSpegPhysics) +/////////////////////////////////////////////////////////////////////////// +TSpegPhysics::TSpegPhysics() + { + EventDCData = new TSpegDCData ; + EventCHIOData = new TSpegCHIOData ; + EventPlasticData = new TSpegPlasticData ; + EventPhysics = this ; + } + +/////////////////////////////////////////////////////////////////////////// +TSpegPhysics::~TSpegPhysics() + {} + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::Clear() + { + Q_S11.clear() ; + Q_S12.clear() ; + Q_S21.clear() ; + Q_S22.clear() ; + Charge.clear(); + Strip_S11.clear() ; + Strip_S12.clear() ; + Strip_S21.clear() ; + Strip_S22.clear() ; + Strip.clear(); + M_over_Q.clear() ; + Z.clear(); + X_FocalPlan.clear(); + Y_FocalPlan.clear(); + Theta_FocalPlan.clear(); + Phi_FocalPlan.clear(); + cor_xfoc_thetafoc.clear(); + cor_xfoc_phifoc.clear(); + cor_theta.clear(); + cor_phi.clear(); + correction_theta_with_Brho.clear(); + correction_phi_with_Brho.clear(); + cal_theta.clear(); + cal_phi.clear(); + calibration_theta_with_Brho.clear(); + calibration_phi_with_Brho.clear(); + for(int l=0; l<4; l++) + { + Tab_xij[l]=0; + Tab_yij[l]=0; + } + } + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::ReadConfiguration(string Path) + { + + ifstream ConfigFile ; + ConfigFile.open(Path.c_str()) ; + string LineBuffer ; + string DataBuffer ; + + bool check_nmesx = false ; + bool check_nomx = false ; + bool check_zxx = false ; + bool check_ievx = false ; + bool check_dx = false ; + bool check_x0 = false ; + bool check_etalx = false ; + bool check_ievdx = false ; + bool check_zx = false ; + bool check_fx = false ; + bool check_nax = false ; + bool check_fax = false ; + bool check_zax = false ; + bool check_nbx = false ; + bool check_fbx = false ; + bool check_zbx = false ; + bool check_ichix = false ; + bool check_fchix = false ; + bool check_nfx = false ; + bool check_nfocx = false ; + bool check_zfocx = false ; + bool check_ffx = false ; + bool check_zfx = false ; + bool ReadingStatus1 = false ; + + bool check_nmesy = false ; + bool check_zyy = false ; + bool check_ievy = false ; + bool check_dy = false ; + bool check_y0 = false ; + bool check_etaly = false ; + bool check_ievdy = false ; + bool check_zy = false ; + bool check_fy = false ; + bool check_nay = false ; + bool check_fay = false ; + bool check_zay = false ; + bool check_nby = false ; + bool check_fby = false ; + bool check_zby = false ; + bool check_ichiy = false ; + bool check_fchiy = false ; + bool check_nfy = false ; + bool check_nfocy = false ; + bool check_zfocy = false ; + bool check_ffy = false ; + bool check_zfy = false ; + bool ReadingStatus2 = false ; + + bool check_alpha0 = false ; + bool check_alpha1 = false ; + bool check_alpha2 = false ; + bool check_alpha3 = false ; + bool check_tema = false ; + bool check_temb = false ; + bool check_tcora = false ; + bool check_tcorb = false ; + bool check_cmsurqa = false ; + bool check_cmsurqb = false ; + bool check_za = false ; + bool check_zb = false ; + bool check_degree_of_calibration_angle_with_Brho = false ; + bool check_degree_of_correction_angle_with_Brho = false ; + bool ReadingStatus3 = false ; + + while (!ConfigFile.eof()) + { + + getline(ConfigFile, LineBuffer); + + // If line is a Start Up SPEG bloc, Reading toggle to true + if (LineBuffer.compare(0, 5, "dotrx") == 0) + { + cout << "///" << endl ; + cout << "dotrx found : " << endl ; + ReadingStatus1 = true ; + } + + // Else don't toggle to Reading Block Status + else {ReadingStatus1 = false ;} + + // Reading Block + while(ReadingStatus1) + { + // Pickup Next Word + ConfigFile >> DataBuffer ; + + // Comment Line + if (DataBuffer.compare(0, 1, "%") == 0) { ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} + + // Finding another dotrx (safety), toggle out + else if (DataBuffer.compare(0, 5, "dotrx") == 0) { + cout << "WARNING: Another dotrx is find before standard sequence of Token, Error may occured in SPEG definition" << endl ; + ReadingStatus1 = false ; + } + else if (DataBuffer=="nmesx=") { + check_nmesx = true ; + ConfigFile >> DataBuffer ; + nmesx=atof(DataBuffer.c_str()); + cout << "nmesx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nomx=") { + check_nomx = true ; + ConfigFile >> DataBuffer ; + cout << "nomx: " << DataBuffer << endl; + } + else if (DataBuffer=="zx=") { + check_zxx = true ; + ConfigFile >> DataBuffer ; + Vector_zx.push_back(atof(DataBuffer.c_str())); + cout << "zx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="iev=") { + check_ievx = true ; + ConfigFile >> DataBuffer ; + Vector_nievcx.push_back(atof(DataBuffer.c_str())); + cout << "nievcx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="dx=") { + check_dx = true ; + ConfigFile >> DataBuffer ; + Vector_sigx.push_back(atof(DataBuffer.c_str())); + cout << "sigx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="x0=") { + check_x0 = true ; + ConfigFile >> DataBuffer ; + Vector_x0f.push_back(atof(DataBuffer.c_str())); + cout << "x0f: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="etalx=") { + check_etalx = true ; + ConfigFile >> DataBuffer ; + Vector_etalx.push_back(atof(DataBuffer.c_str())); + cout << "etalx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ievd=") { + check_ievdx = true ; + ConfigFile >> DataBuffer ; + Vector_iedevx.push_back(atof(DataBuffer.c_str())); + cout << "iedevx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="z=") { + check_zx = true ; + ConfigFile >> DataBuffer ; + Vector_zdevx.push_back(atof(DataBuffer.c_str())); + cout << "zdevx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="f=") { + check_fx = true ; + ConfigFile >> DataBuffer ; + Vector_fdevx.push_back(atof(DataBuffer.c_str())); + cout << "fdevx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nax=") { + check_nax = true ; + ConfigFile >> DataBuffer ; + nax=atof(DataBuffer.c_str()); + cout << "nax: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fax=") { + check_fax = true ; + ConfigFile >> DataBuffer ; + fax=atof(DataBuffer.c_str()); + cout << "fax: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zax=") { + check_zax = true ; + ConfigFile >> DataBuffer ; + zax=atof(DataBuffer.c_str()); + cout << "zax: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nbx=") { + check_nbx = true ; + ConfigFile >> DataBuffer ; + nbx=atof(DataBuffer.c_str()); + cout << "nbx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fbx=") { + check_fbx = true ; + ConfigFile >> DataBuffer ; + fbx=atof(DataBuffer.c_str()); + cout << "fbx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zbx=") { + check_zbx = true ; + ConfigFile >> DataBuffer ; + zbx=atof(DataBuffer.c_str()); + cout << "zbx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ichix=") { + check_ichix = true ; + ConfigFile >> DataBuffer ; + ichix=atof(DataBuffer.c_str()); + cout << "ichix: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fchix=") { + check_fchix = true ; + ConfigFile >> DataBuffer ; + fchix=atof(DataBuffer.c_str()); + cout << "fchix: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nfx=") { + check_nfx = true ; + ConfigFile >> DataBuffer ; + nfx=atof(DataBuffer.c_str()); + cout << "nfx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nfoc=") { + check_nfocx = true ; + ConfigFile >> DataBuffer ; + anfocx=atof(DataBuffer.c_str()); + cout << "anfocx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zfoc=") { + check_zfocx = true ; + ConfigFile >> DataBuffer ; + zfocx=atof(DataBuffer.c_str()); + cout << "zfocx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ffx=") { + check_ffx = true ; + ConfigFile >> DataBuffer ; + ffx=atof(DataBuffer.c_str()); + cout << "ffx: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zfx=") { + check_zfx = true ; + ConfigFile >> DataBuffer ; + zfx=atof(DataBuffer.c_str()); + cout << "zfx: " << atof(DataBuffer.c_str()) << endl; + } + +/////////////////////////////////////////////////// + // If no Detector Token and no comment, toggle out + else + {ReadingStatus1 = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;} + + ///////////////////////////////////////////////// + // If All necessary information there, toggle out + + if (check_nomx && check_zxx && check_ievx && check_dx && check_x0 && check_etalx && check_ievdx && check_zx && check_fx && check_nax && check_fax && check_zax && check_nbx && check_fbx &&check_zbx &&check_ichix && check_fchix && check_nfx && check_nfocx && check_zfocx && check_ffx && check_zfx) + { + + // Reinitialisation of Check Boolean + check_nomx =false ; + check_zxx =false ; + check_ievx =false ; + check_dx =false ; + check_x0 =false ; + check_etalx =false ; + check_ievdx =false ; + check_zx =false ; + check_fx =false ; + check_nax =false ; + check_fax =false ; + check_zax =false ; + check_nbx =false ; + check_fbx =false ; + check_zbx =false ; + check_ichix =false ; + check_fchix =false ; + check_nfx =false ; + check_nfocx =false ; + check_zfocx =false ; + check_ffx =false ; + check_zfx =false ; + ReadingStatus1 =false ; + cout << "///"<< endl ; + } + } + +// If line is a Start Up SPEG bloc, Reading toggle to true + if (LineBuffer.compare(0, 5, "dotry") == 0) + { + cout << "///" << endl ; + cout << "dotry found : " << endl ; + ReadingStatus2 = true ; + } + + // Else don't toggle to Reading Block Status + else ReadingStatus2 = false ; + + // Reading Block + while(ReadingStatus2) + { + // Pickup Next Word + ConfigFile >> DataBuffer ; + + // Comment Line + if (DataBuffer.compare(0, 1, "%") == 0) { ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} + + // Finding another dotry (safety), toggle out + else if (DataBuffer.compare(0, 5, "dotry") == 0) { + cout << "WARNING: Another dotry is find before standard sequence of Token, Error may occured in SPEG definition" << endl ; + ReadingStatus2 = false ; + } + + else if (DataBuffer=="nmesy=") { + check_nmesy = true ; + ConfigFile >> DataBuffer ; + nmesy=atof(DataBuffer.c_str()); + cout << "nmesy: " << atof(DataBuffer.c_str()) << endl; + } + + else if (DataBuffer=="zy=") { + check_zyy = true ; + ConfigFile >> DataBuffer ; + Vector_zy.push_back(atof(DataBuffer.c_str())); + cout << "zy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="iev=") { + check_ievy = true ; + ConfigFile >> DataBuffer ; + Vector_nievcy.push_back(atof(DataBuffer.c_str())); + cout << "nievcy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="dy=") { + check_dy = true ; + ConfigFile >> DataBuffer ; + Vector_sigy.push_back(atof(DataBuffer.c_str())); + cout << "sigy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="y0=") { + check_y0 = true ; + ConfigFile >> DataBuffer ; + Vector_y0f.push_back(atof(DataBuffer.c_str())); + cout << "y0f: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="etaly=") { + check_etaly = true ; + ConfigFile >> DataBuffer ; + Vector_etaly.push_back(atof(DataBuffer.c_str())); + cout << "etaly: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ievd=") { + check_ievdy = true ; + ConfigFile >> DataBuffer ; + Vector_iedevy.push_back(atof(DataBuffer.c_str())); + cout << "iedevy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="z=") { + check_zy = true ; + ConfigFile >> DataBuffer ; + Vector_zdevy.push_back(atof(DataBuffer.c_str())); + cout << "zdevy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="f=") { + check_fy = true ; + ConfigFile >> DataBuffer ; + Vector_fdevy.push_back(atof(DataBuffer.c_str())); + cout << "fdevy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nay=") { + check_nay = true ; + ConfigFile >> DataBuffer ; + nay=atof(DataBuffer.c_str()); + cout << "nay: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fay=") { + check_fay = true ; + ConfigFile >> DataBuffer ; + fay=atof(DataBuffer.c_str()); + cout << "fay: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zay=") { + check_zay = true ; + ConfigFile >> DataBuffer ; + zay=atof(DataBuffer.c_str()); + cout << "zay: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nby=") { + check_nby = true ; + ConfigFile >> DataBuffer ; + nby=atof(DataBuffer.c_str()); + cout << "nby: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fby=") { + check_fby = true ; + ConfigFile >> DataBuffer ; + fby=atof(DataBuffer.c_str()); + cout << "fby: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zby=") { + check_zby = true ; + ConfigFile >> DataBuffer ; + zby=atof(DataBuffer.c_str()); + cout << "zby: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ichiy=") { + check_ichiy = true ; + ConfigFile >> DataBuffer ; + ichiy=atof(DataBuffer.c_str()); + cout << "ichiy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="fchiy=") { + check_fchiy = true ; + ConfigFile >> DataBuffer ; + fchiy=atof(DataBuffer.c_str()); + cout << "fchiy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nfy=") { + check_nfy = true ; + ConfigFile >> DataBuffer ; + nfy=atof(DataBuffer.c_str()); + cout << "nfy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="nfoc=") { + check_nfocy = true ; + ConfigFile >> DataBuffer ; + anfocy=atof(DataBuffer.c_str()); + cout << "nfoc: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zfoc=") { + check_zfocy = true ; + ConfigFile >> DataBuffer ; + zfocy=atof(DataBuffer.c_str()); + cout << "zfoc: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="ffy=") { + check_ffy = true ; + ConfigFile >> DataBuffer ; + ffy=atof(DataBuffer.c_str()); + cout << "ffy: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zfy=") { + check_zfy = true ; + ConfigFile >> DataBuffer ; + zfy=atof(DataBuffer.c_str()); + cout << "zfy: " << atof(DataBuffer.c_str()) << endl; + } + +/////////////////////////////////////////////////// + // If no Detector Token and no comment, toggle out + else + {ReadingStatus2 = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;} + + ///////////////////////////////////////////////// + // If All necessary information there, toggle out + + if (check_zyy && check_ievy && check_dy && check_y0 && check_etaly && check_ievdy && check_zy && check_fy && check_nay && check_fay && check_zay && check_nby && check_fby &&check_zby &&check_ichiy && check_fchiy && check_nfy && check_nfocy && check_zfocy && check_ffy && check_zfy) + { + + // Reinitialisation of Check Boolean + check_zyy =false ; + check_ievy =false ; + check_dy =false ; + check_y0 =false ; + check_etaly =false ; + check_ievdy =false ; + check_zy =false ; + check_fy =false ; + check_nay =false ; + check_fay =false ; + check_zay =false ; + check_nby =false ; + check_fby =false ; + check_zby =false ; + check_ichiy =false ; + check_fchiy =false ; + check_nfy =false ; + check_nfocy =false ; + check_zfocy =false ; + check_ffy =false ; + check_zfy =false ; + ReadingStatus2 =false ; + cout << "///"<< endl ; + } + + } + // If line is a Start Up SPEG bloc, Reading toggle to true + if (LineBuffer.compare(0, 11, "Coefficient") == 0) + { + cout << "///" << endl ; + cout << "Coefficient found : " << endl ; + ReadingStatus3 = true ; + } + + // Else don't toggle to Reading Block Status + else ReadingStatus3 = false ; + + // Reading Block + while(ReadingStatus3) + { + // Pickup Next Word + ConfigFile >> DataBuffer ; + + // Comment Line + if (DataBuffer.compare(0, 1, "%") == 0) { ConfigFile.ignore ( std::numeric_limits<std::streamsize>::max(), '\n' );} + + // Finding another Coefficient (safety), toggle out + else if (DataBuffer.compare(0, 11, "Coefficient") == 0) { + cout << "WARNING: Another Coefficient is find before standard sequence of Token, Error may occured in SPEG definition" << endl ; + ReadingStatus3 = false ; + } + + else if (DataBuffer=="alpha0=") { + check_alpha0 = true ; + ConfigFile >> DataBuffer ; + alpha[0]=atof(DataBuffer.c_str()); + cout << "alpha0: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="alpha1=") { + check_alpha1 = true ; + ConfigFile >> DataBuffer ; + alpha[1]=atof(DataBuffer.c_str()); + cout << "alpha1: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="alpha2=") { + check_alpha2 = true ; + ConfigFile >> DataBuffer ; + alpha[2]=atof(DataBuffer.c_str()); + cout << "alpha2: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="alpha3=") { + check_alpha3 = true ; + ConfigFile >> DataBuffer ; + alpha[3]=atof(DataBuffer.c_str()); + cout << "alpha3: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="tema=") { + check_tema = true ; + ConfigFile >> DataBuffer ; + tema=atof(DataBuffer.c_str()); + cout << "tema: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="temb=") { + check_temb = true ; + ConfigFile >> DataBuffer ; + temb=atof(DataBuffer.c_str()); + cout << "temb: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="tcora=") { + check_tcora = true ; + ConfigFile >> DataBuffer ; + tcora=atof(DataBuffer.c_str()); + cout << "tcora: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="tcorb=") { + check_tcorb = true ; + ConfigFile >> DataBuffer ; + tcorb=atof(DataBuffer.c_str()); + cout << "tcorb: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="cmsurqa=") { + check_cmsurqa = true ; + ConfigFile >> DataBuffer ; + cmsurqa=atof(DataBuffer.c_str()); + cout << "cmsurqa: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="cmsurqb=") { + check_cmsurqb = true ; + ConfigFile >> DataBuffer ; + cmsurqb=atof(DataBuffer.c_str()); + cout << "cmsurqb: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="za=") { + check_za = true ; + ConfigFile >> DataBuffer ; + za=atof(DataBuffer.c_str()); + cout << "za: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="zb=") { + check_zb = true ; + ConfigFile >> DataBuffer ; + zb=atof(DataBuffer.c_str()); + cout << "zb: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="degree_of_calibration_angle_with_Brho=") { + check_degree_of_calibration_angle_with_Brho = true ; + ConfigFile >> DataBuffer ; + degree_of_calibration_angle_with_Brho=atof(DataBuffer.c_str()); + cout << "Degree of calibration angle with Brho: " << atof(DataBuffer.c_str()) << endl; + } + else if (DataBuffer=="degree_of_correction_angle_with_Brho=") { + check_degree_of_correction_angle_with_Brho = true ; + ConfigFile >> DataBuffer ; + degree_of_correction_angle_with_Brho=atof(DataBuffer.c_str()); + cout << "Degree of correction angle with Brho: " << atof(DataBuffer.c_str()) << endl; + } + +/////////////////////////////////////////////////// + // If no Detector Token and no comment, toggle out + else + {ReadingStatus3 = false; cout << "Wrong Token Sequence: Getting out " << DataBuffer << endl ;} + + ///////////////////////////////////////////////// + // If All necessary information there, toggle out + + if (check_alpha0 && check_alpha1 && check_alpha2 && check_alpha3 && check_tema && check_temb && check_tcora && check_tcorb && check_cmsurqa && check_cmsurqb && check_za && check_zb && check_degree_of_calibration_angle_with_Brho && check_degree_of_correction_angle_with_Brho) + { + + // Reinitialisation of Check Boolean + check_alpha0 = false ; + check_alpha1 = false ; + check_alpha2 = false ; + check_alpha3 = false ; + check_tema = false ; + check_temb = false ; + check_tcora = false ; + check_tcorb = false ; + check_cmsurqa = false ; + check_cmsurqb = false ; + check_za = false ; + check_zb = false ; + check_degree_of_calibration_angle_with_Brho = false; + check_degree_of_correction_angle_with_Brho= false; + ReadingStatus3 =false ; + cout << "///"<< endl ; + } + + } + } + ReadAnalysisConfig(); +} + +/////////////////////////////////////////////// +void TSpegPhysics::ReadAnalysisConfig() +{ + bool ReadingStatus = false; + bool_CORRECTION_COEF_DC_11 = false; + bool_CORRECTION_COEF_DC_12 = false; + bool_CORRECTION_COEF_DC_21 = false; + bool_CORRECTION_COEF_DC_22 = false; + for(int l=0; l<128; l++) + { + m_BadStrip_SPEG_DC11[l] = 0; + m_BadStrip_SPEG_DC12[l] = 0; + m_BadStrip_SPEG_DC21[l] = 0; + m_BadStrip_SPEG_DC22[l] = 0; + m_CorrectionCoef_SPEG_DC11[l]=0; + m_CorrectionCoef_SPEG_DC12[l]=0; + m_CorrectionCoef_SPEG_DC21[l]=0; + m_CorrectionCoef_SPEG_DC22[l]=0; + } + + // path to file + string FileName = "./configs/ConfigSPEG.dat"; + + // open analysis config file + ifstream AnalysisConfigFile; + AnalysisConfigFile.open(FileName.c_str()); + + if (!AnalysisConfigFile.is_open()) { + cout << " No ConfigSPEG.dat found: Default parameter loaded for Analayis " << FileName << endl; + return; + } + cout << " Loading user parameter for Analysis from ConfigSPEG.dat " << endl; + + // Save it in a TAsciiFile + TAsciiFile* asciiConfig = RootOutput::getInstance()->GetAsciiFileAnalysisConfig(); + asciiConfig->AppendLine("%%% ConfigSPEG.dat %%%"); + asciiConfig->Append(FileName.c_str()); + asciiConfig->AppendLine(""); + // read analysis config file + string LineBuffer,DataBuffer,whatToDo; + while (!AnalysisConfigFile.eof()) { + // Pick-up next line + getline(AnalysisConfigFile, LineBuffer); + + // search for "header" + if (LineBuffer.compare(0, 10, "ConfigSPEG") == 0) ReadingStatus = true; + + // loop on tokens and data + while (ReadingStatus ) { + + whatToDo=""; + AnalysisConfigFile >> whatToDo; + + // Search for comment symbol (%) + if (whatToDo.compare(0, 1, "%") == 0) { + AnalysisConfigFile.ignore(numeric_limits<streamsize>::max(), '\n' ); + } + else if (whatToDo == "CORRECTION_COEF_DC_11") { + AnalysisConfigFile >> DataBuffer; + cout << whatToDo << " " << DataBuffer; + int channel = -1; + bool_CORRECTION_COEF_DC_11 = true; + if (DataBuffer.compare(4,6,"STRIP_") == 0) { + channel = atoi(DataBuffer.substr(10).c_str()); + m_BadStrip_SPEG_DC11[channel-1] = channel; + cout << endl; + cout << "Bad strip : " << channel; + AnalysisConfigFile >> DataBuffer; + m_CorrectionCoef_SPEG_DC11[channel-1] = atof(DataBuffer.c_str()); + cout << " | Correction coefficient : " << m_CorrectionCoef_SPEG_DC11[channel-1] << endl; + } + } + + else if (whatToDo == "CORRECTION_COEF_DC_12") { + AnalysisConfigFile >> DataBuffer; + cout << whatToDo << " " << DataBuffer; + int channel = -1; + bool_CORRECTION_COEF_DC_12 = true; + if (DataBuffer.compare(4,6,"STRIP_") == 0) { + channel = atoi(DataBuffer.substr(10).c_str()); + m_BadStrip_SPEG_DC12[channel-1] = channel; + cout << endl; + cout << "Bad strip : " << channel; + AnalysisConfigFile >> DataBuffer; + m_CorrectionCoef_SPEG_DC12[channel-1] = atof(DataBuffer.c_str()); + cout << " | Correction coefficient : " << m_CorrectionCoef_SPEG_DC12[channel-1] << endl; + } + } + + else if (whatToDo == "CORRECTION_COEF_DC_21") { + AnalysisConfigFile >> DataBuffer; + cout << whatToDo << " " << DataBuffer; + int channel = -1; + bool_CORRECTION_COEF_DC_21 = true; + if (DataBuffer.compare(4,6,"STRIP_") == 0) { + channel = atoi(DataBuffer.substr(10).c_str()); + m_BadStrip_SPEG_DC21[channel-1] = channel; + cout << endl; + cout << "Bad strip : " << channel; + AnalysisConfigFile >> DataBuffer; + m_CorrectionCoef_SPEG_DC21[channel-1] = atof(DataBuffer.c_str()); + cout << " | Correction coefficient : " << m_CorrectionCoef_SPEG_DC21[channel-1] << endl; + } + } + + else if (whatToDo == "CORRECTION_COEF_DC_22") { + AnalysisConfigFile >> DataBuffer; + cout << whatToDo << " " << DataBuffer; + int channel = -1; + bool_CORRECTION_COEF_DC_22 = true; + if (DataBuffer.compare(4,6,"STRIP_") == 0) { + channel = atoi(DataBuffer.substr(10).c_str()); + m_BadStrip_SPEG_DC22[channel-1] = channel; + cout << endl; + cout << "Bad strip : " << channel; + AnalysisConfigFile >> DataBuffer; + m_CorrectionCoef_SPEG_DC22[channel-1] = atof(DataBuffer.c_str()); + cout << " | Correction coefficient : " << m_CorrectionCoef_SPEG_DC22[channel-1] << endl; + } + } + + else {ReadingStatus = false;} + + } + } +} + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::AddParameterToCalibrationManager() + { + CalibrationManager* Cal = CalibrationManager::getInstance(); + Cal->AddParameter("SPEG", "_PLASTIC_RIGHT","SPEG_PLASTIC_RIGHT") ; + CalibrationManager* Cal1 = CalibrationManager::getInstance(); + Cal1->AddParameter("SPEG", "_PLASTIC_LEFT","SPEG_PLASTIC_LEFT") ; + CalibrationManager* Cal2 = CalibrationManager::getInstance(); + Cal2->AddParameter("SPEG", "_xfoc","SPEG_xfoc") ; + CalibrationManager* Cal3 = CalibrationManager::getInstance(); + Cal3->AddParameter("SPEG", "_xfoc_cor_theta","SPEG_xfoc_cor_theta") ; + CalibrationManager* Cal4 = CalibrationManager::getInstance(); + Cal4->AddParameter("SPEG", "_xfoc_cor_phi","SPEG_xfoc_cor_phi") ; + CalibrationManager* Cal5 = CalibrationManager::getInstance(); + for(int i = 0 ; i < degree_of_calibration_angle_with_Brho+1 ; i++) + { + Cal5->AddParameter("SPEG", "_tfoc_calibration_with_Brho_"+itoa(i),"SPEG_tfoc_calibration_with_Brho_"+itoa(i)) ; + Cal5->AddParameter("SPEG", "_phifoc_calibration_with_Brho_"+itoa(i),"SPEG_phifoc_calibration_with_Brho_"+itoa(i)) ; + } + CalibrationManager* Cal6 = CalibrationManager::getInstance(); + for(int i = 0 ; i < degree_of_correction_angle_with_Brho+1 ; i++) + { + Cal6->AddParameter("SPEG", "_tfoc_correction_with_Brho_"+itoa(i),"SPEG_tfoc_correction_with_Brho_"+itoa(i)) ; + Cal6->AddParameter("SPEG", "_phifoc_correction_with_Brho_"+itoa(i),"SPEG_phifoc_correction_with_Brho_"+itoa(i)) ; + } + CalibrationManager* Cal7 = CalibrationManager::getInstance(); + for(int i = 0 ; i < 128 ; i++) + { + Cal7->AddParameter("SPEG", "_DC_S11_decal_"+itoa(i+1),"SPEG_DC_S11_decal_"+itoa(i+1)) ; + Cal7->AddParameter("SPEG", "_DC_S12_decal_"+itoa(i+1),"SPEG_DC_S12_decal_"+itoa(i+1)) ; + Cal7->AddParameter("SPEG", "_DC_S21_decal_"+itoa(i+1),"SPEG_DC_S21_decal_"+itoa(i+1)) ; + Cal7->AddParameter("SPEG", "_DC_S22_decal_"+itoa(i+1),"SPEG_DC_S22_decal_"+itoa(i+1)) ; + } + CalibrationManager* Cal8 = CalibrationManager::getInstance(); + for(int i = 0 ; i < 128 ; i++) + { + Cal8->AddParameter("SPEG", "_DC_S11_"+itoa(i+1),"SPEG_DC_S11_"+itoa(i+1)) ; + Cal8->AddParameter("SPEG", "_DC_S12_"+itoa(i+1),"SPEG_DC_S12_"+itoa(i+1)) ; + Cal8->AddParameter("SPEG", "_DC_S21_"+itoa(i+1),"SPEG_DC_S21_"+itoa(i+1)) ; + Cal8->AddParameter("SPEG", "_DC_S22_"+itoa(i+1),"SPEG_DC_S22_"+itoa(i+1)) ; + } + } + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::InitializeRootInputRaw() + { + TChain* inputChain = RootInput::getInstance()->GetChain() ; + inputChain->SetBranchStatus ( "SPEG_DC" , true ) ; + inputChain->SetBranchStatus ( "fSpeg_*" , true ) ; + inputChain->SetBranchAddress( "SPEG_DC" , &EventDCData ) ; + inputChain->SetBranchStatus ( "Speg_CHIO" , true ) ; + inputChain->SetBranchStatus ( "fSpeg_*" , true ) ; + inputChain->SetBranchAddress( "Speg_CHIO" , &EventCHIOData ) ; + inputChain->SetBranchStatus ( "Speg_PLASTIC" , true ) ; + inputChain->SetBranchStatus ( "fSpeg_*" , true ) ; + inputChain->SetBranchAddress( "Speg_PLASTIC" , &EventPlasticData ) ; + } +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::InitializeRootInputPhysics() + { + TChain* inputChain = RootInput::getInstance()->GetChain(); + inputChain->SetBranchStatus ( "Speg", true ); + inputChain->SetBranchStatus ( "Q_S11", true ); + inputChain->SetBranchStatus ( "Q_S12", true ); + inputChain->SetBranchStatus ( "Q_S21", true ); + inputChain->SetBranchStatus ( "Q_S22", true ); + inputChain->SetBranchStatus ( "Strip_S11", true ); + inputChain->SetBranchStatus ( "Strip_S12", true ); + inputChain->SetBranchStatus ( "Strip_S21", true ); + inputChain->SetBranchStatus ( "Strip_S22", true ); + inputChain->SetBranchStatus ( "M_over_Q", true ); + inputChain->SetBranchStatus ( "Z", true ); + inputChain->SetBranchStatus ( "X_FocalPlan", true ); + inputChain->SetBranchStatus ( "Y_FocalPlan", true ); + inputChain->SetBranchStatus ( "Theta_FocalPlan", true ); + inputChain->SetBranchStatus ( "Phi_FocalPlan", true ); + inputChain->SetBranchStatus ( "Time_Plastic_Right", true ); + inputChain->SetBranchStatus ( "Time_Plastic_Left", true ); + inputChain->SetBranchStatus ( "SPEG_CHIO_anode", true ); + inputChain->SetBranchStatus ( "Khi2", true ); + inputChain->SetBranchAddress( "Speg", &EventPhysics ); + } +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::InitializeRootOutput() + { + TTree* outputTree = RootOutput::getInstance()->GetTree() ; + outputTree->Branch( "Speg" , "TSpegPhysics" , &EventPhysics ) ; + } + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::BuildPhysicalEvent() + { + BuildSimplePhysicalEvent() ; + } + +/////////////////////////////////////////////////////////////////////////// +void TSpegPhysics::BuildSimplePhysicalEvent() +{ + +int number_strip = 128;//Number of DC strip +int number_strips_plan = 4;//Number of strips plan +double pi = 3.14159265358979312;//Pi + +/*-------------Read (lectrx) parameters for trajectory calculation for Drift Chamber of SPEG-------*/ + +for(int l=0;l<number_strips_plan;l++) +{ + Vector_sigx2.push_back((Vector_sigx[l]*Vector_etalx[l]/2.35)*(Vector_sigx[l]*Vector_etalx[l]/2.35)); +} +if(anfocx<0.000001) +{ + tanfox=1e8; +} +else +{ + tanfox=1./tan(0.01745*anfocx); +} + +for(int l=0;l<number_strips_plan;l++) +{ + Vector_sigy2.push_back((Vector_sigy[l]*Vector_etaly[l]/2.35)*(Vector_sigy[l]*Vector_etaly[l]/2.35)); +} + +if(anfocy<0.000001) +{ + tanfoy=1e8; +} +else +{ + tanfoy=1./tan(0.01745*anfocy); +} + +//b matrix calculation for x +bx11=0; +bx12=0; +bx21=0; +bx22=0; +for(int i=0; i<nmesx; i++) +{ + bx11=bx11+Vector_zx[i]*Vector_zx[i]/Vector_sigx2[i]; + bx12=bx12+Vector_zx[i]/Vector_sigx2[i]; + bx22=bx22+1./Vector_sigx2[i]; +} +bx21=bx12; + +//Inverse b matrix calculation +det=bx11*bx22-bx12*bx21; +if(det==0) +{ + ax11=0; + ax12=0; + ax21=0; + ax22=0; +} +else +{ + ax11=bx22/det; + ax22=bx11/det; + ax21=-bx12/det; + ax12=-bx21/det; +} +//b matrix calculation for y +by11=0; +by12=0; +by21=0; +by22=0; +for(int i=0; i<nmesy; i++) +{ + by11=by11+Vector_zy[i]*Vector_zy[i]/Vector_sigy2[i]; + by12=by12+Vector_zy[i]/Vector_sigy2[i]; + by22=by22+1./Vector_sigy2[i]; +} +by21=by12; + +//Inverse b matrix calculation +det=by11*by22-by12*by21; +if(det==0) +{ + ay11=0; + ay12=0; + ay21=0; + ay22=0; +} +else +{ + ay11=by22/det; + ay22=by11/det; + ay21=-by12/det; + ay12=-by21/det; +} + +/*------------------------Subroutine Multi (multiplicity of the DC)--------------------------*/ + + //Value of the qmax overflow + seuil_haut = 3500; + //Strips steps = 6mm (inter strip = 0.54) + pas = 6; + //Strips size (true size = 5.46) + a1_1 = 6; + //Gravity center calculation for SPEG calibration + x11 = 0; x12 = 0; x21 = 0; x22 = 0; + //Y in the Drift chamber + y11 = 0; y12 = 0; y21 = 0; y22 = 0; + //Z (charge) + z = 0; + //variables SECHS methode + x_c = 0; + for(int k=0;k<number_strips_plan;k++) + { + //Centroides + x3cg[k] = 0; + xg[k] = 0; + xsh[k] = 0; + + //Charges and three strips max touched number + qmax[k] = 0;//Three strips the most touched for each plan (=4) + imax[k] = 0;//Number of the most touched three strips for each plan (=4) + } + + //Time DC + if(EventDCData->GetSpegDCTfilMult11()>0) + { + for(int j=0;j<EventDCData->GetSpegDCTplfilMult11();j++) + { + y11 = EventDCData->GetSpegDCTfilTime11(j)+gRandom->Uniform(0,1)-0.5; + } + } + if(EventDCData->GetSpegDCTfilMult12()>0) + { + for(int j=0;j<EventDCData->GetSpegDCTplfilMult12();j++) + { + y12 = EventDCData->GetSpegDCTfilTime12(j)+gRandom->Uniform(0,1)-0.5; + } + } + if(EventDCData->GetSpegDCTfilMult21()>0) + { + for(int j=0;j<EventDCData->GetSpegDCTplfilMult21();j++) + { + y21 = EventDCData->GetSpegDCTfilTime21(j)+gRandom->Uniform(0,1)-0.5; + } + } + if(EventDCData->GetSpegDCTfilMult22()>0) + { + for(int j=0;j<EventDCData->GetSpegDCTplfilMult22();j++) + { + y22 = EventDCData->GetSpegDCTfilTime22(j)+gRandom->Uniform(0,1)-0.5; + } + } + + //Anode CHIO + if(EventCHIOData->GetMultSpegCHIOEnergy()>0) + { + for(int j=0;j<EventCHIOData->GetMultSpegCHIOEnergy();j++) + { + SPEG_CHIO_anode = EventCHIOData->GetSpegCHIOEnergy(j); + } + } + + //Time PLASTIC values + SPEG_PLASTIC_tplg = EventPlasticData->GetTimeLeft(); + SPEG_PLASTIC_tpld = EventPlasticData->GetTimeRight(); + //Calibration TPLD and TPLG + Time_Plastic_Right = (CalibrationManager::getInstance()->ApplyCalibration("SPEG/_PLASTIC_RIGHT", EventPlasticData->GetTimeRight())); + Time_Plastic_Left = (CalibrationManager::getInstance()->ApplyCalibration("SPEG/_PLASTIC_LEFT", EventPlasticData->GetTimeLeft())); + + //First plan touched + if(EventDCData->GetSpegDCMultStrip11()>0) + { + for(int j=0;j<EventDCData->GetSpegDCMultStrip11();j++) + { + if((EventDCData->GetSpegDCStripNbr11(j))>0 && (EventDCData->GetSpegDCStripNbr11(j))<=number_strip && (EventDCData->GetSpegDCEnergy11(j))<seuil_haut) + { + Strip_S11.push_back(EventDCData->GetSpegDCStripNbr11(j)); + if(bool_CORRECTION_COEF_DC_11 && EventDCData->GetSpegDCStripNbr11(j)==m_BadStrip_SPEG_DC11[EventDCData->GetSpegDCStripNbr11(j)-1]) + { + Q_S11.push_back((EventDCData->GetSpegDCEnergy11(j)+gRandom->Uniform(0,1)-0.5)*m_CorrectionCoef_SPEG_DC11[EventDCData->GetSpegDCStripNbr11(j)-1]); + } + else + { + Q_S11.push_back((CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S11_"+itoa(EventDCData->GetSpegDCStripNbr11(j)),(CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S11_decal_"+itoa(EventDCData->GetSpegDCStripNbr11(j)), EventDCData->GetSpegDCEnergy11(j)))))+gRandom->Uniform(0,1)-0.5); + } + } + } + } + Strip.push_back(Strip_S11); + Charge.push_back(Q_S11); + + //Second plan touched + if(EventDCData->GetSpegDCMultStrip12()>0) + { + for(int j=0;j<EventDCData->GetSpegDCMultStrip12();j++) + { + if((EventDCData->GetSpegDCStripNbr12(j))>0 && (EventDCData->GetSpegDCStripNbr12(j))<=number_strip && (EventDCData->GetSpegDCEnergy12(j))<seuil_haut) + { + Strip_S12.push_back(EventDCData->GetSpegDCStripNbr12(j)); + if(bool_CORRECTION_COEF_DC_12 && EventDCData->GetSpegDCStripNbr12(j)==m_BadStrip_SPEG_DC12[EventDCData->GetSpegDCStripNbr12(j)-1]) + { + Q_S12.push_back((EventDCData->GetSpegDCEnergy12(j)+gRandom->Uniform(0,1)-0.5)*m_CorrectionCoef_SPEG_DC12[EventDCData->GetSpegDCStripNbr12(j)-1]); + } + else + { + Q_S12.push_back((CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S12_"+itoa(EventDCData->GetSpegDCStripNbr12(j)),(CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S12_decal_"+itoa(EventDCData->GetSpegDCStripNbr12(j)), EventDCData->GetSpegDCEnergy12(j)))))+gRandom->Uniform(0,1)-0.5); + } + } + } + } + Strip.push_back(Strip_S12); + Charge.push_back(Q_S12); + + //Third plan touched (the geometry of the chamber is different) + if(EventDCData->GetSpegDCMultStrip21()>0) + { + for(int j=0;j<EventDCData->GetSpegDCMultStrip21();j++) + { + if((EventDCData->GetSpegDCStripNbr21(j))>0 && (EventDCData->GetSpegDCStripNbr21(j))<=number_strip && (EventDCData->GetSpegDCEnergy21(j))<seuil_haut) + { + Strip_S21.push_back(129-EventDCData->GetSpegDCStripNbr21(j)); + if(bool_CORRECTION_COEF_DC_21 && 129-EventDCData->GetSpegDCStripNbr21(j)==m_BadStrip_SPEG_DC21[129-EventDCData->GetSpegDCStripNbr21(j)-1]) + { + Q_S21.push_back((EventDCData->GetSpegDCEnergy21(j)+gRandom->Uniform(0,1)-0.5)*m_CorrectionCoef_SPEG_DC21[129-EventDCData->GetSpegDCStripNbr21(j)-1]); + } + else + { + Q_S21.push_back((CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S21_"+itoa(129-EventDCData->GetSpegDCStripNbr21(j)),(CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S21_decal_"+itoa(EventDCData->GetSpegDCStripNbr21(j)), EventDCData->GetSpegDCEnergy21(j)))))+gRandom->Uniform(0,1)-0.5); + } + } + } + } + Strip.push_back(Strip_S21); + Charge.push_back(Q_S21); + + //Fourth plan touched (the geometry of the chamber is different) + if(EventDCData->GetSpegDCMultStrip22()>0) + { + for(int j=0;j<EventDCData->GetSpegDCMultStrip22();j++) + { + if((EventDCData->GetSpegDCStripNbr22(j))>0 && (EventDCData->GetSpegDCStripNbr22(j))<=number_strip && (EventDCData->GetSpegDCEnergy22(j))<seuil_haut) + { + Strip_S22.push_back(129-EventDCData->GetSpegDCStripNbr22(j)); + if(bool_CORRECTION_COEF_DC_22 && 129-EventDCData->GetSpegDCStripNbr22(j)==m_BadStrip_SPEG_DC22[129-EventDCData->GetSpegDCStripNbr22(j)-1]) + { + Q_S22.push_back((EventDCData->GetSpegDCEnergy22(j)+gRandom->Uniform(0,1)-0.5)*m_CorrectionCoef_SPEG_DC22[129-EventDCData->GetSpegDCStripNbr22(j)-1]); + } + else + { + Q_S22.push_back((CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S22_"+itoa(129-EventDCData->GetSpegDCStripNbr22(j)),(CalibrationManager::getInstance()->ApplyCalibration("SPEG/_DC_S22_decal_"+itoa(EventDCData->GetSpegDCStripNbr22(j)), EventDCData->GetSpegDCEnergy22(j)))))+gRandom->Uniform(0,1)-0.5); + } + } + } + } + Strip.push_back(Strip_S22); + Charge.push_back(Q_S22); + + //Loop over the strips plan (=4) + for(int k=0;k<number_strips_plan;k++) + { + //Variables SECHS methode + q_c = 0;//Central charge + q_r = 0;//Right charge (right of the q_c) + q_l = 0;//Left charge (left of the q_c) + i_c = 0;//Central strip + i_l = 0;//Left strip (left of the central strip) + i_r = 0;//Left strip (left of the central strip) + + //Event validation test : more than 3 strips touched + if((int)Strip[k].size()>=number_strips_plan-1 && Strip.size()==Charge.size()) + { + qmax[k]=1; + imax[k]=0; + //Multiplicity loop + for(unsigned int j=1;j<Strip[k].size();j++) + { + if(Charge[k][j]>qmax[k] && Strip[k][j]>3 && Strip[k][j]<126 && Charge[k][j]!=Charge[k].back()) + { + qmax[k] = Charge[k][j]; + imax[k] = Strip[k][j]; + q_c = qmax[k]; + i_c = imax[k]; + x_c = (imax[k]-0.5)*pas; + + //Inversion of the chamber 3 and 4 numerotation + if(k<2) + { + if(Strip[k][j-1]==(Strip[k][j]-1)) { + q_l = Charge[k][j-1]; + i_l = Strip[k][j-1]; + } + if(Strip[k][j+1]==(Strip[k][j]+1)) + { + q_r = Charge[k][j+1]; + i_r = Strip[k][j+1]; + } + } + else + { + if(Strip[k][j-1]==(Strip[k][j]+1)) + { + q_l = Charge[k][j+1]; + i_l = Strip[k][j-1]; + } + if(Strip[k][j+1]==(Strip[k][j]-1)) + { + q_r = Charge[k][j-1]; + i_r = Strip[k][j+1]; + } + } + } + } + + //Continuity and limits check + if(q_c>q_r && q_c>q_l && q_r>0 && q_l>0 && q_c>0 && i_l!=0 && i_c!=0 && i_r !=0) + { + //Gravity center with 3 points (XCOG) calculation + x3cg[k] =pas*(alpha[k]*(q_r - q_l)/(q_c + q_l + q_r)+imax[k]-0.5); + //Gaussian center with 3 points + xg[k] = 0.5*((log(q_c/q_l)*(pas*(i_r-0.5)*pas*(i_r-0.5)-pas*(i_c-0.5)*pas*(i_c-0.5))-log(q_c/q_r)*(pas*(i_l-0.5)*pas*(i_l-0.5)-pas*(i_c-0.5)*pas*(i_c-0.5)))/(log(q_c/q_l)*(pas*(i_r-0.5)-pas*(i_c-0.5))-log(q_c/q_r)*(pas*(i_l-0.5)-pas*(i_c-0.5)))); + //Gravity center with 3 points (SECHS) calculation (K.LAU et al., NIM A 366 (1995) 298-309) + temp = 0.5*(sqrt(q_c/q_l)+sqrt(q_c/q_r)); + cosih = log(temp + sqrt(temp*temp - 1.)); + a3 = (pi*a1_1)/cosih; + temp2 = 0.5*(sqrt(q_c/q_l)-sqrt(q_c/q_r)); + sinuh = sinh((pi*a1_1)/a3); + temp3 = temp2/sinuh; + a2 = (a3/pi)*0.5*(log((1.+temp3)/(1.-temp3))); + //Calculated position value : we add the position of the most strip touched + xsh[k] = x_c + a2; + } + } + } + x11 = xsh[0]; + x12 = xsh[1]; + x21 = xsh[2]; + x22 = xsh[3]; + + //Conversion : mm->channel, 700 mm*40->28000 channel, 25 µm per channel with alpha coefficient taken into account + x11 = x11 * 40.; + x12 = x12 * 40.; + x21 = x21 * 40.; + x22 = x22 * 40.; + x3cg[0] = x3cg[0] * 40.; + x3cg[1] = x3cg[1] * 40.; + x3cg[2] = x3cg[2]* 40.; + x3cg[3] = x3cg[3] * 40.; + xg[0] = xg[0]*40; + xg[1] = xg[1]*40; + xg[2] = xg[2]*40; + xg[3] = xg[3]*40; + Tab_xij[0]=x11; + Tab_xij[1]=x12; + Tab_xij[2]=x21; + Tab_xij[3]=x22; + Tab_yij[0]=y11; + Tab_yij[1]=y12; + Tab_yij[2]=y21; + Tab_yij[3]=y22; + +/*----------------------------------Subroutine Caltrx (reconstruction of the trajectory)---------------------*/ + //xij!=0 + if(Tab_xij[0]>0 && Tab_xij[1]>0 && Tab_xij[2]>0 && Tab_xij[3]>0) + { + b1=0; + b2=0; + for(int k=0;k<nmesx;k++) + { + Vector_x.push_back((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)); + b1 = b1+Vector_x.at(k)*Vector_zx.at(k)/Vector_sigx2.at(k); + b2 = b2+Vector_x.at(k)/Vector_sigx2.at(k); + } + ax = b1*ax11+b2*ax12; + bx = b1*ax21+b2*ax22; + //xfoc=(ax*zfocx+bx)*ffx+zfx; + //Calculation with the angle + xfoc=(ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx)*ffx+zfx; + tfoc=ax*fax+zax; + xPL=(ax*328.3+bx)*ffx+zfx; + + //Khi2 calculation + Khi2=0; + for(int k=0;k<nmesx;k++) + { + xt=ax*Vector_zx.at(k)+bx; + Khi2=Khi2+((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt)*((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt); + } + Khi2=Khi2/2; + + //Desallocation memory + Vector_x.clear(); + } + + //x11==0 + else if(Tab_xij[1]>0 && Tab_xij[2]>0 && Tab_xij[3]>0) + { + b1=0; + b2=0; + for(int k=1;k<nmesx;k++) + { + Vector_x.push_back((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)); + b1 = b1+Vector_x.at(k-1)*Vector_zx.at(k)/Vector_sigx2.at(k); + b2 = b2+Vector_x.at(k-1)/Vector_sigx2.at(k); + } + ax = b1*ax11+b2*ax12; + bx = b1*ax21+b2*ax22; + //xfoc=(ax*zfocx+bx)*ffx+zfx; + //Calculation with the angle + xfoc=(ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx)*ffx+zfx; + tfoc=ax*fax+zax; + + //Khi2 calculation + Khi2=0; + for(int k=1;k<nmesx;k++) + { + xt=ax*Vector_zx.at(k)+bx; + Khi2=Khi2+((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt)*((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt); + } + Khi2=Khi2/1; + + //Desallocation memory + Vector_x.clear(); + } + //x12==0 + else if(Tab_xij[0]>0 && Tab_xij[2]>0 && Tab_xij[3]>0) + { + b1=0; + b2=0; + + Vector_x.push_back((Tab_xij[0]-Vector_x0f.at(0))*Vector_etalx.at(0)); + b1 = b1+Vector_x.at(0)*Vector_zx.at(0)/Vector_sigx2.at(0); + b2 = b2+Vector_x.at(0)/Vector_sigx2.at(0); + for(int k=2;k<nmesx;k++) + { + Vector_x.push_back((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)); + b1 = b1+Vector_x.at(k-1)*Vector_zx.at(k)/Vector_sigx2.at(k); + b2 = b2+Vector_x.at(k-1)/Vector_sigx2.at(k); + } + ax = b1*ax11+b2*ax12; + bx = b1*ax21+b2*ax22; + //xfoc=(ax*zfocx+bx)*ffx+zfx; + //Calculation with the angle + xfoc=(ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx)*ffx+zfx; + tfoc=ax*fax+zax; + + //Khi2 calculation + Khi2=0; + xt=ax*Vector_zx.at(0)+bx; + Khi2=((Tab_xij[0]-Vector_x0f.at(0))*Vector_etalx.at(0)-xt)*((Tab_xij[0]-Vector_x0f.at(0))*Vector_etalx.at(0)-xt); + for(int k=2;k<nmesx;k++) + { + xt=ax*Vector_zx.at(k)+bx; + Khi2=Khi2+((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt)*((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt); + } + Khi2=Khi2/1; + + //Desallocation memory + Vector_x.clear(); + } + //x21==0 + else if(Tab_xij[0]>0 && Tab_xij[1]>0 && Tab_xij[3]>0) + { + b1=0; + b2=0; + + for(int k=0;k<nmesx-2;k++) + { + Vector_x.push_back((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)); + b1 = b1+Vector_x.at(k)*Vector_zx.at(k)/Vector_sigx2.at(k); + b2 = b2+Vector_x.at(k)/Vector_sigx2.at(k); + } + Vector_x.push_back((Tab_xij[3]-Vector_x0f.at(3))*Vector_etalx.at(3)); + b1 = b1+Vector_x.at(2)*Vector_zx.at(3)/Vector_sigx2.at(3); + b2 = b2+Vector_x.at(2)/Vector_sigx2.at(3); + ax = b1*ax11+b2*ax12; + bx = b1*ax21+b2*ax22; + //xfoc=(ax*zfocx+bx)*ffx+zfx; + //Calculation with the angle + xfoc=(ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx)*ffx+zfx; + tfoc=ax*fax+zax; + + //Khi2 calculation + Khi2=0; + for(int k=0;k<nmesx-2;k++) + { + xt=ax*Vector_zx.at(k)+bx; + Khi2=Khi2+((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt)*((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt); + } + xt=ax*Vector_zx.at(3)+bx; + Khi2=Khi2+((Tab_xij[3]-Vector_x0f.at(3))*Vector_etalx.at(3)-xt)*((Tab_xij[3]-Vector_x0f.at(3))*Vector_etalx.at(3)-xt); + Khi2=Khi2/1; + + //Desallocation memory + Vector_x.clear(); + } + //x22==0 + else if(Tab_xij[0]>0 && Tab_xij[1]>0 && Tab_xij[2]>0) + { + b1=0; + b2=0; + for(int k=0;k<nmesx-1;k++) + { + Vector_x.push_back((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)); + b1 = b1+Vector_x.at(k)*Vector_zx.at(k)/Vector_sigx2.at(k); + b2 = b2+Vector_x.at(k)/Vector_sigx2.at(k); + } + ax = b1*ax11+b2*ax12; + bx = b1*ax21+b2*ax22; + //xfoc=(ax*zfocx+bx)*ffx+zfx; + //Calculation with the angle + xfoc=(ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx)*ffx+zfx; + tfoc=ax*fax+zax; + + //Khi2 calculation + Khi2=0; + for(int k=0;k<nmesx-1;k++) + { + xt=ax*Vector_zx.at(k)+bx; + Khi2=Khi2+((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt)*((Tab_xij[k]-Vector_x0f.at(k))*Vector_etalx.at(k)-xt); + } + Khi2=Khi2/1; + + //Desallocation memory + Vector_x.clear(); + } + else + { + xfoc=-1000; + tfoc=-1000; + } + +/*----------------------------------Subroutine Caltry (reconstruction of the trajectory)---------------------*/ + + b1=0; + b2=0; + for(int k=0;k<nmesy;k++) + { + Vector_y.push_back((Tab_yij[k]-Vector_y0f[k])*Vector_etaly[k]); + b1 = b1+Vector_y[k]*Vector_zy[k]/Vector_sigy2[k]; + b2 = b2+Vector_y[k]/Vector_sigy2[k]; + } + ay = b1*ay11+b2*ay12; + by = b1*ay21+b2*ay22; + phifoc=ay*fay+zay; + yfoc=(ay*(tanfoy*zfocy+by)/(tanfoy-ay)+by)*ffy+zfy; + Y_FocalPlan.push_back(yfoc); + + //Desallocation memory + Vector_y.clear(); + +/*--------------xfoc correction and calibration--------------------*/ + + if(xfoc>0 && tfoc>0) + { + //Correction of xfoc by thetafoc and phifoc + cor_xfoc_thetafoc=(CalibrationManager::getInstance()->GetCalibration("SPEG/_xfoc_cor_theta")); + cor_xfoc_phifoc=(CalibrationManager::getInstance()->GetCalibration("SPEG/_xfoc_cor_phi")); + + xfoc_cor_thetafoc=xfoc; + for(unsigned int n = 0 ; n < cor_xfoc_thetafoc.size() ; n++) + { + xfoc_cor_thetafoc -= cor_xfoc_thetafoc[n]*pow(tfoc,n); + } + + xfoc_cor_phifoc=xfoc_cor_thetafoc; + for(unsigned int n = 0 ; n < cor_xfoc_phifoc.size() ; n++) + { + xfoc_cor_phifoc -= cor_xfoc_phifoc[n]*pow(phifoc,n); + } + + //Calibration of xfoc + xfoc_calibrated = (CalibrationManager::getInstance()->ApplyCalibration("SPEG/_xfoc",xfoc_cor_phifoc)); + X_FocalPlan.push_back(xfoc_calibrated); + +/*--------------Angle correction and calibration--------------------*/ + + //thetafoc Correction + thetafoc_cor=tfoc; + for(int n = 0 ; n < degree_of_correction_angle_with_Brho+1 ; n++) + { + param_theta = 0; + cor_theta = (CalibrationManager::getInstance()->GetCalibration("SPEG/_tfoc_correction_with_Brho_"+itoa(n))); + for(unsigned int l=0; l<cor_theta.size() ; l++) + { + param_theta += cor_theta[l]*pow(xfoc_cor_phifoc,l); + } + correction_theta_with_Brho.push_back(param_theta); + thetafoc_cor -= correction_theta_with_Brho[n]*pow(phifoc,n); + } + + //phifoc Correction + phifoc_cor=phifoc; + for(int n = 0 ; n < degree_of_correction_angle_with_Brho+1 ; n++) + { + param_phi = 0; + cor_phi = (CalibrationManager::getInstance()->GetCalibration("SPEG/_phifoc_correction_with_Brho_"+itoa(n))); + for(unsigned int l=0; l<cor_phi.size() ; l++) + { + param_phi += cor_phi[l]*pow(xfoc_cor_phifoc,l); + } + correction_phi_with_Brho.push_back(param_phi); + phifoc_cor -= correction_phi_with_Brho[n]*pow(tfoc,n); + } + + //Calibration of tfoc + tfoc_calibrated = 0; + for(int n = 0 ; n < degree_of_calibration_angle_with_Brho+1 ; n++) + { + param_theta = 0; + cal_theta = (CalibrationManager::getInstance()->GetCalibration("SPEG/_tfoc_calibration_with_Brho_"+itoa(n))); + for(unsigned int l=0; l<cal_theta.size() ; l++) + { + param_theta += cal_theta[l]*pow(xfoc_cor_phifoc,l); + } + calibration_theta_with_Brho.push_back(param_theta); + tfoc_calibrated += calibration_theta_with_Brho[n]*pow(thetafoc_cor,n); + } + if(cal_theta.size()==0) + { + Theta_FocalPlan.push_back(tfoc); + } + else + { + Theta_FocalPlan.push_back(tfoc_calibrated); + } + + //Calibration of phifoc + phifoc_calibrated = 0; + for(int n = 0 ; n < degree_of_calibration_angle_with_Brho+1 ; n++) + { + param_phi = 0; + cal_phi = (CalibrationManager::getInstance()->GetCalibration("SPEG/_phifoc_calibration_with_Brho_"+itoa(n))); + for(unsigned int l=0; l<cal_phi.size() ; l++) + { + param_phi += cal_phi[l]*pow(xfoc_cor_phifoc,l); + } + calibration_phi_with_Brho.push_back(param_phi); + phifoc_calibrated += calibration_phi_with_Brho[n]*pow(phifoc_cor,n); + } + if(cal_phi.size()==0) + { + Phi_FocalPlan.push_back(phifoc); + } + else + { + Phi_FocalPlan.push_back(phifoc_calibrated); + } + } + else + { + Theta_FocalPlan.push_back(-1000); + X_FocalPlan.push_back(-1000); + } + +/*-----------------------------------Subroutine Aberration---------------------------------------------------*/ +/* + //Xfoc and yfoc calculation, position in the focal plan in centimeter + double xfoc_aber=ax*(tanfox*zfocx+bx)/(tanfox-ax)+bx; + xfoc_aber=xfoc_aber-8.04; + double yfoc_aber=ay*(tanfoy*zfocy+by)/(tanfoy-ay)+by; + //ax=theta angle in the focal plan in radian calculated in caltrx + //ay=phi angle in the focal plan in radian calculated in caltry + double thetafoc_aber=ax*1000.; + double phifoc_aber=ay*1000.; + //Theta, delta calculation in first order + double theta1=(0.076817*(xfoc_aber-0.2862)-8.1842556*(thetafoc_aber+0.1965))/10.086875; + double delta1=(1.2323786*(xfoc_aber-0.2862)+0.0010068*(thetafoc_aber+0.1965))/10.086875; + if(delta1<-10.) + { + delta1=-10.; + } + if(delta1>10) + { + delta1=10.; + } + //Phi calculation in first order. We calculate phi1 with yfoc or phifoc in respect with phi/phi = phisphi and with y/phi = =ysphi + double phisphi=-0.15515+0.044196*delta1-7.8E-5*delta1*delta1; + double ysphi=0.0280218+0.021471*delta1+5.3E-6*delta1*delta1; + if(phisphi!=0 && ysphi!=0) + { + phia1=phifoc_aber/phisphi; + phib1=yfoc_aber/ysphi; + sigmaphi1=1./phisphi; + sigmay1=1./ysphi; + phi1=(phia1/(sigmaphi1*sigmaphi1)+phib1/(sigmay1*sigmay1))/(1./(sigmaphi1*sigmaphi1)+1./(sigmay1*sigmay1)); + //Theta, delta calculation in second order + xa=xfoc_aber-0.2862-0.00002*theta1*theta1+4.4E-5*phi1*phi1+0.12862*delta1*delta1; + xb=thetafoc_aber+0.1965+0.002298*theta1*theta1-4.96E-5*phi1*phi1-0.0221*delta1*delta1+0.02441*theta1*delta1; + theta2=(0.076817*xa-8.1842556*xb)/10.086875; + delta2=(1.2323786*xa+0.0010068*xb)/10.086875; + if(delta2<-10) + { + delta2=-10.; + } + if(delta2>10) + { + delta2=10.; + } + } + //Phi calculation in second order + double phi2= phi1+(8.13E-3-1.E-3*delta2-8.5E-4*delta2*delta2)*phi1*theta2+(-1.61E-4-1.38E-5*delta2+7.93E-6*delta2*delta2)*phi1*theta2*theta2; + //Phi calculation in first order, correction of phi/phi in second order + double help=(1.26-0.036*delta2-0.031*delta2*delta2); + if(help!=0) + { + phi2=phi2/help; + } + //Transformation of mradian and centimeter in channel + delta1=delta1+0.98; + delta2=delta2+0.98; + delta1=delta1*1500.+15000.; + delta2=delta2*1500.+15000.; + theta1=theta1*50.+5750.; + theta2=theta2*50.+5750.; + phi1=phi1*50.+3750.; + phi2=phi2*50.+3750.; */ + +/*-----------------------------------Corrected parameters calculation-----------------------------*/ + + if(xfoc>0 && tfoc>0) + { + //Time + tem = (tema-SPEG_PLASTIC_tpld+gRandom->Uniform(0,1)-0.5)*temb; + //Theta foc corrected + tcor = tem*(tcora*(tfoc-tcorb)+1); + //Correction compared to xfoc => m/q corrected + cmsurq = (cmsurqa*(xfoc-cmsurqb)+1)*tcor; + M_over_Q.push_back(cmsurq); + //Charge z calculated with anode signal and theta corrected + if(tcor>0 && SPEG_CHIO_anode>0) + { + z = (sqrt(SPEG_CHIO_anode)/pow(tcor,za))*zb; + Z.push_back(z); + } + } +} diff --git a/NPLib/Speg/TSpegPhysics.h b/NPLib/Speg/TSpegPhysics.h new file mode 100644 index 0000000000000000000000000000000000000000..111436d3af9d1f088006df9f3c3718d6462b538e --- /dev/null +++ b/NPLib/Speg/TSpegPhysics.h @@ -0,0 +1,321 @@ +#ifndef __SpegPhysics__ +#define __SpegPhysics__ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : October 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class hold the SPEG Spectrometer Physics * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ + +// STL +#include <vector> +#include <sstream> +#include <iostream> +#include <cmath> +#include <stdlib.h> +#include <limits> +using namespace std ; + +// ROOT +#include "TObject.h" +#include "TVector2.h" +#include "TVector3.h" + +// NPL +#include "TSpegDCData.h" +#include "TSpegCHIOData.h" +#include "TSpegPlasticData.h" +#include "../include/VDetector.h" +#include "../include/CalibrationManager.h" + +class TSpegPhysics : public TObject, public NPA::VDetector +{ + public: // Constructor and Destructor + TSpegPhysics(); + ~TSpegPhysics(); + + public: + void Clear(); + void Clear(const Option_t*) {}; + + public: // Main Data + vector <double> Q_S11; + vector <double> Q_S12; + vector <double> Q_S21; + vector <double> Q_S22; + vector <vector<double> > Charge;//! + vector <int> Strip_S11; + vector <int> Strip_S12; + vector <int> Strip_S21; + vector <int> Strip_S22; + vector <vector <int> > Strip;//! + vector<double> M_over_Q; + vector<double> Z; + vector<double> X_FocalPlan; + vector<double> Y_FocalPlan; + vector<double> Theta_FocalPlan; + vector<double> Phi_FocalPlan; + double Time_Plastic_Right; + double Time_Plastic_Left; + double xfoc_cor_thetafoc;//! + double xfoc_cor_phifoc;//! + double thetafoc_cor;//! + double phifoc_cor;//! + double xfoc_calibrated;//! + double tfoc_calibrated;//! + double phifoc_calibrated;//! + + public : + //Variables for the first token which have parameters for trajectory calculation for Drift Chamber of SPEG + int nax;//! + int nbx;//! + int ichix;//! + int nfx;//! + int nmesx;//! + double fax;//! + double zax;//! + double fbx;//! + double zbx;//! + double fchix;//! + double anfocx;//! + double zfocx;//! + double ffx;//! + double zfx;//! + double tanfox;//! + vector <double> Vector_zx;//! + vector <int> Vector_nievcx;//! + vector <double> Vector_sigx;//! + vector <double> Vector_x0f;//! + vector <double> Vector_etalx;//! + vector <int> Vector_iedevx;//! + vector <double> Vector_zdevx;//! + vector <double> Vector_fdevx;//! + vector <double> Vector_sigx2;//! + + //Variables for the second token which have parameters for trajectory calculation for Drift Chamber of SPEG + int nay;//! + int nby;//! + int ichiy;//! + int nfy;//! + int nmesy;//! + double fay;//! + double zay;//! + double fby;//! + double zby;//! + double fchiy;//! + double anfocy;//! + double zfocy;//! + double ffy;//! + double zfy;//! + double tanfoy;//! + vector <string> Vector_nomy;//! + vector <double> Vector_zy;//! + vector <int> Vector_nievcy;//! + vector <double> Vector_sigy;//! + vector <double> Vector_y0f;//! + vector <double> Vector_etaly;//! + vector <int> Vector_iedevy;//! + vector <double> Vector_zdevy;//! + vector <double> Vector_fdevy;//! + vector <double> Vector_sigy2;//! + + //Variables for the third token (Correction for the channel normalisation (COG Methode)) + double alpha[4];//! + //Correction value + double tema;//! + double temb;//! + double tcora;//! + double tcorb;//! + double cmsurqa;//! + double cmsurqb;//! + double za;//! + double zb;//! + + //Declaration of some variables + double seuil_haut;//! + double pas;//! + double a1_1;//! + double x11;//! + double x12;//! + double x21;//! + double x22;//! + double xPL;//! + double y11;//! + double y12;//! + double y21;//! + double y22;//! + double z;//! + double x_c;//! + double x3cg[4];//! + double xg[4];//! + double xsh[4];//! + double Tab_xij[4];//! + double Tab_yij[4];//! + double qmax[4];//! + int imax[4];//! + double SPEG_CHIO_anode; + double phia1;//! + double phib1;//! + double sigmaphi1;//! + double sigmay1;//! + double phi1;//! + double xa;//! + double xb;//! + double theta2;//! + double delta2;//! + double x1;//! + double x2;//! + double xt;//! + double yt;//! + double xfoc;//! + double yfoc;//! + double tfoc;//! + double phifoc;//! + double Khi2; + double bx11;//! + double bx12;//! + double bx21;//! + double bx22;//! + double det;//! + double ax11;//! + double ax12;//! + double ax21;//! + double ax22;//! + double by11;//! + double by12;//! + double by21;//! + double by22;//! + double ay11;//! + double ay12;//! + double ay21;//! + double ay22;//! + double SPEG_PLASTIC_tplg;//! + double SPEG_PLASTIC_tpld;//! + double q_c;//! + double q_r;//! + double q_l;//! + int i_c;//! + int i_l;//! + int i_r;//! + double temp;//! + double cosih;//! + double a3;//! + double temp2;//! + double sinuh;//! + double temp3;//! + double a2;//! + double b1;//! + double b2;//! + double ax;//! + double bx;//! + double dx;//! + double ay;//! + double by;//! + double dy;//! + double tem;//! + double tcor;//! + double cmsurq;//! + double param_theta;//! + double param_phi;//! + int degree_of_calibration_angle_with_Brho;//! + int degree_of_correction_angle_with_Brho;//! + vector <double> cor_xfoc_thetafoc;//! + vector <double> cor_xfoc_phifoc;//! + vector <double> cor_theta;//! + vector <double> cor_phi;//! + vector <double> correction_theta_with_Brho;//! + vector <double> correction_phi_with_Brho;//! + vector <double> cal_theta;//! + vector <double> cal_phi;//! + vector <double> calibration_theta_with_Brho;//! + vector <double> calibration_phi_with_Brho;//! + vector <double> Vector_x;//! + vector <double> Vector_y;//! + + public: // inherrited from VDetector + // Read stream at ConfigFile to pick-up parameters of detector (Position,...) using Token + void ReadConfiguration(string); + + + // Add Parameter to the CalibrationManger + void AddParameterToCalibrationManager(); + + // Activated associated Branches and link it to the private member DetectorData address + // In this method mother Branches (Detector) AND daughter leaf (fDetector_parameter) have to be activated + void InitializeRootInputRaw() ; + + // Activated associated Branches and link it to the private member DetectorPhysics address + // In this method mother Branches (Detector) AND daughter leaf (parameter) have to be activated + void InitializeRootInputPhysics() ; + + // Create associated branches and associated private member DetectorPhysics address + void InitializeRootOutput(); + + // This method is called at each event read from the Input Tree. Aime is to build treat Raw dat in order to extract physical parameter. + void BuildPhysicalEvent(); + + // Same as above, but only the simplest event and/or simple method are used (low multiplicity, faster algorythm but less efficient ...). + // This method aimed to be used for analysis performed during experiment, when speed is requiered. + // NB: This method can eventually be the same as BuildPhysicalEvent. + void BuildSimplePhysicalEvent(); + + // Same as above but for online analysis + void BuildOnlinePhysicalEvent() {BuildPhysicalEvent();}; + + // Give and external TSpegDCData object to TSpegPhysics. Needed for online analysis for example. + void SetRawDCDataPointer(TSpegDCData* rawDCDataPointer) {EventDCData = rawDCDataPointer;} + + // Give and external TSpegCHIOData object to TSpegPhysics. Needed for online analysis for example. + void SetRawCHIODataPointer(TSpegCHIOData* rawCHIODataPointer) {EventCHIOData = rawCHIODataPointer;} + + // Give and external TSpegPlasticData object to TSpegPhysics. Needed for online analysis for example. + void SetRawPlasticDataPointer(TSpegPlasticData* rawPlasticDataPointer) {EventPlasticData = rawPlasticDataPointer;} + + // Those two method all to clear the Event Physics or Data + void ClearEventPhysics() {Clear();} + void ClearEventDCData() {EventDCData->Clear();} + void ClearEventCHIOData() {EventCHIOData->Clear();} + void ClearEventPlasticData() {EventPlasticData->Clear();} + + // Read Config + void ReadAnalysisConfig(); + + private : + int m_BadStrip_SPEG_DC11[128];//! + int m_BadStrip_SPEG_DC12[128];//! + int m_BadStrip_SPEG_DC21[128];//! + int m_BadStrip_SPEG_DC22[128];//! + double m_CorrectionCoef_SPEG_DC11[128];//! + double m_CorrectionCoef_SPEG_DC12[128];//! + double m_CorrectionCoef_SPEG_DC21[128];//! + double m_CorrectionCoef_SPEG_DC22[128];//! + bool bool_CORRECTION_COEF_DC_11;//! + bool bool_CORRECTION_COEF_DC_12;//! + bool bool_CORRECTION_COEF_DC_21;//! + bool bool_CORRECTION_COEF_DC_22;//! + + private: // Root Input and Output tree classes + TSpegDCData* EventDCData ;//! + TSpegCHIOData* EventCHIOData ;//! + TSpegPlasticData* EventPlasticData ;//! + TSpegPhysics* EventPhysics ;//! + + ClassDef(TSpegPhysics,1) // SpegPhysics structure +}; + +#endif diff --git a/NPLib/Speg/TSpegPlasticData.cxx b/NPLib/Speg/TSpegPlasticData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..635cfc4760233a5299fb78af9176d604ff0188e6 --- /dev/null +++ b/NPLib/Speg/TSpegPlasticData.cxx @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds SPEG Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#include <iostream> +using namespace std; + +#include "TSpegPlasticData.h" + + +ClassImp(TSpegPlasticData) + +TSpegPlasticData::TSpegPlasticData() +{ + // Default constructor + Clear(); +} + + + +TSpegPlasticData::~TSpegPlasticData() +{ +} + + + +void TSpegPlasticData::Clear() +{ + fSpeg_Plastic_Energy_Left = 0; + fSpeg_Plastic_Energy_Right = 0; + fSpeg_Plastic_Time_Left = 0; + fSpeg_Plastic_Time_Right = 0; +} + + + +void TSpegPlasticData::Dump() const +{ + cout << "XXXXXXXXXXXXXXXXXXXXXXXX New Event XXXXXXXXXXXXXXXXX" << endl; + + // Speg Plastic + // (E) + cout << "Speg_Plastic_Energy_Left = " << fSpeg_Plastic_Energy_Left << endl; + cout << "Speg_Plastic_Energy_Right = " << fSpeg_Plastic_Energy_Right << endl; + cout << "Speg_Plastic_Time_Left = " << fSpeg_Plastic_Time_Left << endl; + cout << "Speg_Plastic_Time_Right = " << fSpeg_Plastic_Time_Right << endl; +} diff --git a/NPLib/Speg/TSpegPlasticData.h b/NPLib/Speg/TSpegPlasticData.h new file mode 100644 index 0000000000000000000000000000000000000000..10938f5e796805a1da92602015d0e390171dfafa --- /dev/null +++ b/NPLib/Speg/TSpegPlasticData.h @@ -0,0 +1,64 @@ +/***************************************************************************** + * Copyright (C) 2009-2010 this file is part of the NPTool Project * + * * + * For the licensing terms see $NPTOOL/Licence/NPTool_Licence * + * For the list of contributors see $NPTOOL/Licence/Contributors * + *****************************************************************************/ + +/***************************************************************************** + * Original Author: L. Lefebvre contact address: lefebvrl@ipno.in2p3.fr * + * * + * Creation Date : June 2011 * + * Last update : * + *---------------------------------------------------------------------------* + * Decription: * + * This class holds SPEG Raw data * + * * + *---------------------------------------------------------------------------* + * Comment: * + * * + * * + *****************************************************************************/ +#ifndef __SPEGPLASTICDATA__ +#define __SPEGPLASTICDATA__ + +#include <vector> + +#include "TObject.h" + + + +class TSpegPlasticData : public TObject { + private: + // ADC + UShort_t fSpeg_Plastic_Energy_Left; + UShort_t fSpeg_Plastic_Energy_Right; + UShort_t fSpeg_Plastic_Time_Left; + UShort_t fSpeg_Plastic_Time_Right; + + public: + TSpegPlasticData(); + virtual ~TSpegPlasticData(); + + void Clear(); + void Clear(const Option_t*) {}; + void Dump() const; + + ///////////////////// GETTERS //////////////////////// + // (E) + UShort_t GetEnergyLeft() {return fSpeg_Plastic_Energy_Left;} + UShort_t GetEnergyRight() {return fSpeg_Plastic_Energy_Right;} + UShort_t GetTimeLeft() {return fSpeg_Plastic_Time_Left;} + UShort_t GetTimeRight() {return fSpeg_Plastic_Time_Right;} + + ///////////////////// SETTERS //////////////////////// + // (E) + void SetEnergyLeft(UShort_t E) {fSpeg_Plastic_Energy_Left = E;} + void SetEnergyRight(UShort_t E) {fSpeg_Plastic_Energy_Right = E;} + void SetTimeLeft(UShort_t E) {fSpeg_Plastic_Time_Left = E;} + void SetTimeRight(UShort_t E) {fSpeg_Plastic_Time_Right = E;} + + ClassDef(TSpegPlasticData,1) // SpegPlasticData structure +}; + +#endif