Skip to content
Snippets Groups Projects
Commit 605bc906 authored by de Séréville Nicolas's avatar de Séréville Nicolas
Browse files

+ Add security in case NMR object is null

parent da847983
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,10 @@ RootFileName ...@@ -7,6 +7,10 @@ RootFileName
% /scratch/gypaos/data/al27pp/oct2015/midas/root/R50_0.root % /scratch/gypaos/data/al27pp/oct2015/midas/root/R50_0.root
% /scratch/gypaos/data/al27pp/oct2015/midas/root/R131_0_test.root % /scratch/gypaos/data/al27pp/oct2015/midas/root/R131_0_test.root
% /scratch/gypaos/data/al27pp/oct2015/midas/root/R108_0_test.root % /scratch/gypaos/data/al27pp/oct2015/midas/root/R108_0_test.root
/scratch/gypaos/data/al27pp/oct2015/midas/root/R74_0.root % /scratch/gypaos/data/al27pp/oct2015/midas/root/R74_0.root
% /scratch/gypaos/data/al27pp/oct2015/midas/root/R72_0.root % /scratch/gypaos/data/al27pp/oct2015/midas/root/R72_0.root
/scratch/gypaos/data/al27pp/oct2015/midas/root/R113_0.root
/scratch/gypaos/data/al27pp/oct2015/midas/root/R114_0.root
/scratch/gypaos/data/al27pp/oct2015/midas/root/R115_0.root
/scratch/gypaos/data/al27pp/oct2015/midas/root/R116_0.root
POSITION 6.21221e-01 1.73257e-05 POSITION 6.21491e-01 4.21269e-05
...@@ -58,14 +58,14 @@ TSplitPolePhysics::TSplitPolePhysics() ...@@ -58,14 +58,14 @@ TSplitPolePhysics::TSplitPolePhysics()
m_RunStart(2015, 10, 6, 0, 0, 0), m_RunStart(2015, 10, 6, 0, 0, 0),
m_RunStop(2015, 10, 7, 0, 0, 0), m_RunStop(2015, 10, 7, 0, 0, 0),
m_RunLength(0), m_RunLength(0),
m_FrequenceClock(2.03), m_FrequenceClock(2.0516),
m_TickMin(0), m_TickMin(0),
m_TickMax(0), m_TickMax(0),
m_RunNumber(0), m_RunNumber(0),
m_CurrentRunNumber(0), m_CurrentRunNumber(0),
m_CurrentNMR(new TSplitPoleNMR), m_CurrentNMR(new TSplitPoleNMR),
m_MagneticFieldCorrection(0), m_MagneticFieldCorrection(0),
m_TimeDelay(6500), m_TimeDelay(3657),
m_LargeField(0), m_LargeField(0),
m_NmrFilePath("./") m_NmrFilePath("./")
{ {
...@@ -330,15 +330,26 @@ void TSplitPolePhysics::BuildSimplePhysicalEvent() ...@@ -330,15 +330,26 @@ void TSplitPolePhysics::BuildSimplePhysicalEvent()
} }
// Correct for magnetic field variation // Correct for magnetic field variation
fAbsoluteTick = m_RunStart.AsDouble() + m_PreTreatedData->GetTick()/m_FrequenceClock; fAbsoluteTick = m_RunStart.AsDouble() + m_PreTreatedData->GetTick()/m_FrequenceClock;
if (m_MagneticFieldCorrection) { // check if NMR pointer exist
fBrho = m_PreTreatedData->GetPlasticG() * m_CurrentNMR->EvalB(fAbsoluteTick); if (m_CurrentNMR) {
// check if magnetic field correction needed
if (m_MagneticFieldCorrection) {
fBrho = m_PreTreatedData->GetPlasticG() * m_CurrentNMR->EvalB(fAbsoluteTick);
}
else {
if (!isSameRun) {
cout << "\t\033[1;31mSplitPole Warning!!! run " << m_CurrentRunNumber << " will use mean magnetic field value "
<< m_CurrentNMR->GetMean() << " T.m.\033[0m" << endl;
}
fBrho = m_PreTreatedData->GetPlasticG() * m_CurrentNMR->GetMean();
}
} }
else { else {
fBrho = -1;
if (!isSameRun) { if (!isSameRun) {
cout << "\tSplitPole Warning!!! run " << m_CurrentRunNumber << " will use mean magnetic field value " cout << "\t\033[1;31mSplitPole Warning!!! run " << m_CurrentRunNumber << " no associated magnetic field...\033[0m" << endl;
<< m_CurrentNMR->GetMean() << " T.m." << endl;
} }
fBrho = m_PreTreatedData->GetPlasticG() * m_CurrentNMR->GetMean();
} }
} }
...@@ -374,7 +385,7 @@ void TSplitPolePhysics::ReadAnalysisConfig() ...@@ -374,7 +385,7 @@ void TSplitPolePhysics::ReadAnalysisConfig()
{ {
bool ReadingStatus = false; bool ReadingStatus = false;
cout << "\t/////////// Reading ConfigSplitPole.dat file ///////////" << endl; cout << "\t\033[1;35m/////////// Reading ConfigSplitPole.dat file ///////////" << endl;
// path to file // path to file
string FileName = "./configs/ConfigSplitPole.dat"; string FileName = "./configs/ConfigSplitPole.dat";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment