Commit 4b4860bf authored by Jens Kroeger's avatar Jens Kroeger
Browse files

AnalysisTimingATLASpix: fix seg fault when not providing row correction file -...

AnalysisTimingATLASpix: fix seg fault when not providing row correction file - bug in if conditions introduced in MR \!281

(cherry picked from commit de4a357f)
parent f8a4ddc0
......@@ -448,7 +448,9 @@ void AnalysisTimingATLASpix::initialise() {
gTimeCorrelationVsRow->SetTitle("gTimeCorrelationVsRow");
gTimeCorrelationVsRow->GetXaxis()->SetTitle("row");
gTimeCorrelationVsRow->GetYaxis()->SetTitle("time correlation peak [ns]");
}
if(m_pointwise_correction_row) {
int nBinsToT = hTrackCorrelationTimeVsTot_rowCorr->GetNbinsY();
gTimeCorrelationVsTot_rowCorr = new TGraphErrors(nBinsToT);
gTimeCorrelationVsTot_rowCorr->SetName("gTimeCorrelationVsTot_rowCorr");
......@@ -800,6 +802,7 @@ void AnalysisTimingATLASpix::finalise() {
} // for(iBin)
/// TIME WALK CORRECTION on top of ROW CORRECTION: ///
if(m_pointwise_correction_row) {
fitOption = "q"; // set to "" if you want terminal output
binMax = 0;
timePeak = 0.;
......@@ -840,7 +843,8 @@ void AnalysisTimingATLASpix::finalise() {
// SAME FOR SINGLE-PIXEL CLUSTERS:
nBinsToT = hTrackCorrelationTimeVsTot_rowCorr_1px->GetNbinsY();
for(int iBin = 0; iBin < nBinsToT; iBin++) {
TH1D* hTemp = hTrackCorrelationTimeVsTot_rowCorr_1px->ProjectionX("timeCorrelationInOneTotBin", iBin, iBin + 1);
TH1D* hTemp =
hTrackCorrelationTimeVsTot_rowCorr_1px->ProjectionX("timeCorrelationInOneTotBin", iBin, iBin + 1);
// if(hTemp->GetEntries() < 500) { // too few entries to fit
if(hTemp->GetEntries() < 1000) { // too few entries to fit
......@@ -872,7 +876,8 @@ void AnalysisTimingATLASpix::finalise() {
// SAME FOR MULTI-PIXEL CLUSTERS:
nBinsToT = hTrackCorrelationTimeVsTot_rowCorr_npx->GetNbinsY();
for(int iBin = 0; iBin < nBinsToT; iBin++) {
TH1D* hTemp = hTrackCorrelationTimeVsTot_rowCorr_npx->ProjectionX("timeCorrelationInOneTotBin", iBin, iBin + 1);
TH1D* hTemp =
hTrackCorrelationTimeVsTot_rowCorr_npx->ProjectionX("timeCorrelationInOneTotBin", iBin, iBin + 1);
// if(hTemp->GetEntries() < 500) { // too few entries to fit
if(hTemp->GetEntries() < 1000) { // too few entries to fit
......@@ -918,11 +923,14 @@ void AnalysisTimingATLASpix::finalise() {
fitOption = "q"; // set to "q" = quiet for suppressed terminial output
hTrackCorrelationTime_example->Fit("fPeak", fitOption.c_str(), "", timePeak - timeInt, timePeak + timeInt);
delete fPeak;
}
gTimeCorrelationVsRow->Write();
if(m_pointwise_correction_row) {
gTimeCorrelationVsTot_rowCorr->Write();
gTimeCorrelationVsTot_rowCorr_1px->Write();
gTimeCorrelationVsTot_rowCorr_npx->Write();
}
} // if(m_calcCorrections)
LOG(INFO) << "matched/total tracks: " << matched_tracks << "/" << total_tracks;
......
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