Skip to content

Commit

Permalink
Fix for getting accidental scaling factor errors from MC data
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Dobbs committed Sep 7, 2020
1 parent 4b95767 commit 3cd7ad4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions libraries/DSelector/DAnalysisUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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!!

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion libraries/DSelector/DAnalysisUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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!!

Expand Down

0 comments on commit 3cd7ad4

Please sign in to comment.