From 3cd7ad44def923a91a869483a8f9462e911c56eb Mon Sep 17 00:00:00 2001 From: Sean Dobbs Date: Mon, 7 Sep 2020 12:24:02 -0400 Subject: [PATCH] Fix for getting accidental scaling factor errors from MC data --- libraries/DSelector/DAnalysisUtilities.cc | 7 +++++-- libraries/DSelector/DAnalysisUtilities.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/DSelector/DAnalysisUtilities.cc b/libraries/DSelector/DAnalysisUtilities.cc index 4e55b45..292ba5f 100644 --- a/libraries/DSelector/DAnalysisUtilities.cc +++ b/libraries/DSelector/DAnalysisUtilities.cc @@ -863,7 +863,7 @@ double DAnalysisUtilities::Get_AccidentalScalingFactor(int locRunNumber, double return locHodoscopeLoFactor; } -double DAnalysisUtilities::Get_AccidentalScalingFactorError(int locRunNumber, double locBeamEnergy) +double DAnalysisUtilities::Get_AccidentalScalingFactorError(int locRunNumber, double locBeamEnergy, bool locIsMC) { //CCDB environment must be setup!! @@ -894,7 +894,10 @@ double DAnalysisUtilities::Get_AccidentalScalingFactorError(int locRunNumber, do // Guess we have to go to the CCDB... //Pipe the current constant into this function ostringstream locCommandStream; - locCommandStream << "ccdb dump ANALYSIS/accidental_scaling_factor -r " << locRunNumber; + if (locIsMC) + locCommandStream << "ccdb dump ANALYSIS/accidental_scaling_factor -v mc -r " << locRunNumber; + else + locCommandStream << "ccdb dump ANALYSIS/accidental_scaling_factor -r " << locRunNumber; FILE* locInputFile = gSystem->OpenPipe(locCommandStream.str().c_str(), "r"); if(locInputFile == NULL) { cerr << "Could not load ANALYSIS/accidental_scaling_factor from CCDB !" << endl; diff --git a/libraries/DSelector/DAnalysisUtilities.h b/libraries/DSelector/DAnalysisUtilities.h index 19f6daf..d0a42c5 100644 --- a/libraries/DSelector/DAnalysisUtilities.h +++ b/libraries/DSelector/DAnalysisUtilities.h @@ -28,7 +28,7 @@ class DAnalysisUtilities bool Get_CoherentPeak(int locRunNumber, double& locCoherentPeak, bool locIsPolarizedFlag) const; //RCDB environment must be setup!! double Get_BeamBunchPeriod(int locRunNumber); //CCDB environment must be setup!! double Get_AccidentalScalingFactor(int locRunNumber, double locBeamEnergy, bool locIsMC = false); //CCDB environment must be setup!! - double Get_AccidentalScalingFactorError(int locRunNumber, double locBeamEnergy); //CCDB environment must be setup!! + double Get_AccidentalScalingFactorError(int locRunNumber, double locBeamEnergy, bool locIsMC = false); //CCDB environment must be setup!! double Get_DeltaT_RF(int locRunNumber, const TLorentzVector locBeamX4_Measured, const DParticleCombo* locParticleComboWrapper); //CCDB environment must be setup!! int Get_RelativeBeamBucket(int locRunNumber, const TLorentzVector locBeamX4_Measured, const DParticleCombo* locParticleComboWrapper); //CCDB environment must be setup!!