Commit 3546b434 authored by Pierre Morfouace's avatar Pierre Morfouace
Browse files

* Updating sofia classes

parent 7d703cfe
......@@ -48,6 +48,7 @@ void TSofFissionFragment::Clear() {
fFF_AoQ.clear();
fFF_A.clear();
fFF_Beta.clear();
fFF_TOF.clear();
fFF_Gamma.clear();
fFF_Brho.clear();
......
......@@ -39,6 +39,7 @@ class TSofFissionFragment : public TObject {
vector<double> fFF_AoQ;
vector<double> fFF_A;
vector<double> fFF_Beta;
vector<double> fFF_TOF;
vector<double> fFF_Gamma;
vector<double> fFF_Brho;
double fFF_Zsum;
......@@ -71,6 +72,7 @@ class TSofFissionFragment : public TObject {
inline void SetAoQ(double val){fFF_AoQ.push_back(val);};//!
inline void SetA(double val){fFF_A.push_back(val);};//!
inline void SetBeta(double val){fFF_Beta.push_back(val);};//!
inline void SetTOF(double val){fFF_TOF.push_back(val);};//!
inline void SetGamma(double val){fFF_Gamma.push_back(val);};//!
inline void SetBrho(double val){fFF_Brho.push_back(val);};//!
......@@ -81,6 +83,7 @@ class TSofFissionFragment : public TObject {
inline double GetAoQ(int i) const {return fFF_AoQ[i];}//!
inline double GetA(int i) const {return fFF_A[i];}//!
inline double GetBeta(int i) const {return fFF_Beta[i];}//!
inline double GetTOF(int i) const {return fFF_TOF[i];}//!
inline double GetGamma(int i) const {return fFF_Gamma[i];}//!
inline double GetBrho(int i) const {return fFF_Brho[i];}//!
......
......@@ -127,7 +127,7 @@ void TSofTofWPhysics::BuildPhysicalEvent() {
double calpos = Cal->ApplyCalibration("SofTofW/TOFW"+NPL::itoa(p+1)+"_POSPAR",rawpos);
double rawtof = time_ns - m_StartTime;
double caltof = Cal->ApplyCalibration("SofTofW/TOFW"+NPL::itoa(p+1)+"_TOFPAR",rawtof) + m_TofAlignedValue;
PlasticNbr.push_back(p+1);
TimeNs.push_back(time_ns);
RawPosY.push_back(rawpos);
......@@ -180,11 +180,13 @@ void TSofTofWPhysics::PreTreat() {
// Energy
unsigned int mysize = m_EventData->GetMultiplicity();
for (UShort_t i = 0; i < mysize ; ++i) {
m_PreTreatedData->SetPlasticNbr(m_EventData->GetPlasticNbr(i));
m_PreTreatedData->SetPmt(m_EventData->GetPmt(i));
m_PreTreatedData->SetCoarseTime(m_EventData->GetCoarseTime(i));
m_PreTreatedData->SetFineTime(m_EventData->GetFineTime(i));
m_PreTreatedData->SetWhichFlag(m_EventData->GetWhichFlag(i));
if(m_EventData->GetWhichFlag(i)==1){
m_PreTreatedData->SetPlasticNbr(m_EventData->GetPlasticNbr(i));
m_PreTreatedData->SetPmt(m_EventData->GetPmt(i));
m_PreTreatedData->SetCoarseTime(m_EventData->GetCoarseTime(i));
m_PreTreatedData->SetFineTime(m_EventData->GetFineTime(i));
m_PreTreatedData->SetWhichFlag(m_EventData->GetWhichFlag(i));
}
}
}
......
......@@ -111,6 +111,7 @@ void TSofTwimPhysics::BuildPhysicalEvent() {
AnodeSecNbr.push_back(SectionNbr);
AnodeNbr.push_back(AnodeNumber);
AnodeEnergy.push_back(Energy);
AnodeDT.push_back(DT);
if(SectionNbr==1){
anode_energy_sec1.push_back(Energy);
......@@ -156,46 +157,51 @@ void TSofTwimPhysics::BuildPhysicalEvent() {
DTsec4 += anode_dt_sec4[i];
}
if(Esec1>0){
Esec1 = Esec1 / anode_energy_sec1.size();
Esec1 = Cal->ApplyCalibration("SofTwim/SEC1_ALIGN",Esec1);
if(Esec1>0 && anode_energy_sec1.size()==16){
if(abs(anode_energy_sec1[0] - anode_energy_sec1[15])<3000){
Esec1 = Esec1 / anode_energy_sec1.size();
Esec1 = Cal->ApplyCalibration("SofTwim/SEC1_ALIGN",Esec1);
DTsec1 = DTsec1 / anode_dt_sec1.size();
EnergySection.push_back(Esec1);
DriftTime.push_back(DTsec1);
SectionNbr.push_back(1);
DTsec1 = DTsec1 / anode_dt_sec1.size();
EnergySection.push_back(Esec1);
DriftTime.push_back(DTsec1);
SectionNbr.push_back(1);
}
}
if(Esec2>0){
Esec2 = Esec2 / anode_energy_sec2.size();
Esec2 = Cal->ApplyCalibration("SofTwim/SEC2_ALIGN",Esec2);
DTsec2 = DTsec2 / anode_dt_sec2.size();
EnergySection.push_back(Esec2);
DriftTime.push_back(DTsec2);
SectionNbr.push_back(2);
if(Esec2>0 && anode_energy_sec2.size()==16){
if(abs(anode_energy_sec2[0] - anode_energy_sec2[15])<3000){
Esec2 = Esec2 / anode_energy_sec2.size();
Esec2 = Cal->ApplyCalibration("SofTwim/SEC2_ALIGN",Esec2);
DTsec2 = DTsec2 / anode_dt_sec2.size();
EnergySection.push_back(Esec2);
DriftTime.push_back(DTsec2);
SectionNbr.push_back(2);
}
}
if(Esec3>0){
Esec3 = Esec3 / anode_energy_sec3.size();
Esec3 = Cal->ApplyCalibration("SofTwim/SEC3_ALIGN",Esec3);
if(Esec3>0 && anode_energy_sec3.size()==16){
if(abs(anode_energy_sec3[0] - anode_energy_sec3[15])<3000){
Esec3 = Esec3 / anode_energy_sec3.size();
Esec3 = Cal->ApplyCalibration("SofTwim/SEC3_ALIGN",Esec3);
DTsec3 = DTsec3 / anode_dt_sec3.size();
EnergySection.push_back(Esec3);
DriftTime.push_back(DTsec3);
SectionNbr.push_back(3);
DTsec3 = DTsec3 / anode_dt_sec3.size();
EnergySection.push_back(Esec3);
DriftTime.push_back(DTsec3);
SectionNbr.push_back(3);
}
}
if(Esec4>0){
Esec4 = Esec4 / anode_energy_sec4.size();
Esec4 = Cal->ApplyCalibration("SofTwim/SEC4_ALIGN",Esec4);
if(Esec4>0 && anode_energy_sec4.size()==16){
if(abs(anode_energy_sec4[0] - anode_energy_sec4[15])<3000){
Esec4 = Esec4 / anode_energy_sec4.size();
Esec4 = Cal->ApplyCalibration("SofTwim/SEC4_ALIGN",Esec4);
DTsec4 = DTsec4 / anode_dt_sec4.size();
EnergySection.push_back(Esec4);
DriftTime.push_back(DTsec4);
SectionNbr.push_back(4);
DTsec4 = DTsec4 / anode_dt_sec4.size();
EnergySection.push_back(Esec4);
DriftTime.push_back(DTsec4);
SectionNbr.push_back(4);
}
}
m_Beta = -1;
}
......@@ -319,6 +325,7 @@ void TSofTwimPhysics::Clear() {
AnodeNbr.clear();
AnodeSecNbr.clear();
AnodeEnergy.clear();
AnodeDT.clear();
}
......
......@@ -66,6 +66,7 @@ class TSofTwimPhysics : public TObject, public NPL::VDetector {
vector<int> AnodeNbr;
vector<int> AnodeSecNbr;
vector<double> AnodeEnergy;
vector<double> AnodeDT;
/// A usefull method to bundle all operation to add a detector
void AddDetector(TVector3 POS);
......
......@@ -54,7 +54,7 @@ void Analysis::Init(){
////////////////////////////////////////////////////////////////////////////////
void Analysis::TreatEvent(){
ReInitValue();
//cout << "************" << endl;
cout << "************" << endl;
BeamAnalysis();
unsigned int sofsci_size = SofSci->DetectorNbr.size();
......@@ -63,9 +63,10 @@ void Analysis::TreatEvent(){
SofTofW->SetTofAlignedValue(36);
SofTofW->SetStartTime(start_time);
SofTofW->BuildPhysicalEvent();
FissionFragmentAnalysis();
}
FissionFragmentAnalysis();
}
......@@ -73,9 +74,12 @@ void Analysis::TreatEvent(){
void Analysis::FissionFragmentAnalysis(){
unsigned int softofw_size = SofTofW->PlasticNbr.size();
unsigned int softwim_size = SofTwim->SectionNbr.size();
unsigned int sofat_size = SofAt->Energy.size();
double TOF_CC[2];
double Plastic[2];
double Plastic_left = -1;
double Plastic_right = -1;
double TOF_left = -1;
double TOF_right = -1;
double Esec[2];
......@@ -86,9 +90,9 @@ void Analysis::FissionFragmentAnalysis(){
double E2 = -1;
double E3 = -1;
double E4 = -1;
double L_CC = 8.;
double Beta_left;
double Beta_right;
double L_CC = 8.45;
double Beta_left = -1;
double Beta_right = -1;
double Beta_norm = 0.7;
for(int i = 0; i<2; i++){
......@@ -99,7 +103,7 @@ void Analysis::FissionFragmentAnalysis(){
}
if(softofw_size==2 && softwim_size==2){
if(softofw_size==2 && softwim_size==2 && sofat_size==4){
for(unsigned int i=0; i< softofw_size; i++){
TOF_CC[i] = SofTofW->CalTof[i];
Plastic[i] = SofTofW->PlasticNbr[i];
......@@ -120,35 +124,58 @@ void Analysis::FissionFragmentAnalysis(){
}
if(Plastic[0]<Plastic[1]){
Plastic_left = Plastic[0];
Plastic_right = Plastic[1];
TOF_left = TOF_CC[0];
TOF_right = TOF_CC[1];
}
else{
Plastic_left = Plastic[1];
Plastic_right = Plastic[0];
TOF_left = TOF_CC[1];
TOF_right = TOF_CC[0];
}
if(TOF_left != -1 && TOF_right != -1 && abs(Plastic[0]-Plastic[1]) != 1){
if(TOF_left != -1 && TOF_right != -1){
double velocity_left = L_CC/TOF_left;
double velocity_right = L_CC/TOF_right;
Beta_left = velocity_left * m/ns / NPUNITS::c_light;
Beta_right = velocity_right * m/ns / NPUNITS::c_light;
/*E1 = E1 / fcorr_z_beta[0]->Eval(Beta_left) * fcorr_z_beta[0]->Eval(Beta_norm);
E2 = E2 / fcorr_z_beta[1]->Eval(Beta_left) * fcorr_z_beta[1]->Eval(Beta_norm);
E3 = E3 / fcorr_z_beta[2]->Eval(Beta_right) * fcorr_z_beta[2]->Eval(Beta_norm);
E4 = E4 / fcorr_z_beta[3]->Eval(Beta_right) * fcorr_z_beta[3]->Eval(Beta_norm);
/*if(E1 != -1)
E1 = E1 / fcorr_z_beta[0]->Eval(Beta_left) * fcorr_z_beta[0]->Eval(Beta_norm);
if(E2 != -1)
E2 = E2 / fcorr_z_beta[1]->Eval(Beta_left) * fcorr_z_beta[1]->Eval(Beta_norm);
if(E3 != -1)
E3 = E3 / fcorr_z_beta[2]->Eval(Beta_right) * fcorr_z_beta[2]->Eval(Beta_norm);
if(E4 != -1)
E4 = E4 / fcorr_z_beta[3]->Eval(Beta_right) * fcorr_z_beta[3]->Eval(Beta_norm);
*/
double Zsum = E_left + E_right;
if(E1>0 && E2==-1)
E_left = E1;
if(E1==-1 && E2>0)
E_left = E2;
if(E3>0 && E4==-1)
E_right = E3;
if(E3==-1 && E4>0)
E_right = E4;
SofFF->SetBeta(Beta_left);
SofFF->SetBeta(Beta_right);
SofFF->SetZ(E1);
SofFF->SetZ(E2);
SofFF->SetZ(E3);
SofFF->SetZ(E4);
SofFF->SetZsum(Zsum);
double Zsum = E_left + E_right;
if(E_left != -1 && E_right != -1){
SofFF->SetTOF(TOF_left);
SofFF->SetTOF(TOF_right);
SofFF->SetBeta(Beta_left);
SofFF->SetBeta(Beta_right);
//SofFF->SetZ(E_left);
//SofFF->SetZ(E_right);
SofFF->SetZ(E1);
SofFF->SetZ(E2);
SofFF->SetZ(E3);
SofFF->SetZ(E4);
SofFF->SetZsum(Zsum);
}
}
}
......@@ -285,7 +312,8 @@ void Analysis::InitParameter(){
//fDCC = -30000;
fDCC = -10000;
fK_LS2 = -2.5e-8;
fBrho0 = 10.8183; // run401 -> 182Hg
fBrho0 = 10.8183; // 182Hg
//fBrho0 = 10.6814; // 180Hg
}
////////////////////////////////////////////////////////////////////////////////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment