From 3a3570a305df51af7454bb56ecab06dbc4501c88 Mon Sep 17 00:00:00 2001 From: matta <matta@npt> Date: Wed, 10 Feb 2010 08:20:50 +0000 Subject: [PATCH] * Fixing things with the calibration manager - Little test has been performed and things seems to work correctly --- NPAnalysis/e530/pipo.txt | 2 ++ NPAnalysis/e530/src/Analysis.cc | 7 +------ .../CalibrationManager/CalibrationManager.cxx | 18 +++++++++++------- NPLib/MUST2/TMust2Physics.cxx | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/NPAnalysis/e530/pipo.txt b/NPAnalysis/e530/pipo.txt index e69de29bb..853f2240a 100644 --- a/NPAnalysis/e530/pipo.txt +++ b/NPAnalysis/e530/pipo.txt @@ -0,0 +1,2 @@ +CalibrationFilePath + /home/Adrien/Desktop/NPTool/NPTool.dev.CalibMust2/NPAnalysis/e530/calibPipo.txt diff --git a/NPAnalysis/e530/src/Analysis.cc b/NPAnalysis/e530/src/Analysis.cc index 8ecfe8998..c0b02c5d5 100644 --- a/NPAnalysis/e530/src/Analysis.cc +++ b/NPAnalysis/e530/src/Analysis.cc @@ -39,17 +39,12 @@ int main(int argc,char** argv) // Ask the detector manager to load the parameter added by the detector in the calibrationfileName myCalibration->LoadParameterFromFile() ; ///////////////////////////////////////////////////////////////////////////////////////////////////// - - // Attach more branch to the output - + // Attach more branch to the output // Get the formed Chained Tree and Treat it TChain* Chain = RootInput:: getInstance() -> GetChain() ; - - - TMust2Physics* M2 = (TMust2Physics*) myDetector -> m_Detector["MUST2"] ; cout << " ///////// Starting Analysis ///////// "<< endl << endl ; diff --git a/NPLib/CalibrationManager/CalibrationManager.cxx b/NPLib/CalibrationManager/CalibrationManager.cxx index 15c4b3cef..737c31d59 100644 --- a/NPLib/CalibrationManager/CalibrationManager.cxx +++ b/NPLib/CalibrationManager/CalibrationManager.cxx @@ -59,15 +59,17 @@ CalibrationManager::CalibrationManager(string configFileName) return; } - else { + else + { + cout << "Reading list of file from :" << configFileName << endl; while (!inputConfigFile.eof()) { getline(inputConfigFile, lineBuffer); // search for token giving the list of Root files to treat - if ( lineBuffer.compare(0, 12, "CalibrationFilePath") == 0 ) { + if ( lineBuffer.compare(0, 19, "CalibrationFilePath") == 0 ) { while (!inputConfigFile.eof()) { inputConfigFile >> dataBuffer; - + // ignore comment Line if (dataBuffer.compare(0, 1, "%") == 0) { inputConfigFile.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); @@ -77,11 +79,12 @@ CalibrationManager::CalibrationManager(string configFileName) AddFile(dataBuffer); cout << "Adding file " << dataBuffer << " to Calibration" << endl; } - } - } - } + } + } + } + } + cout << "/////////////////////////////////" << endl; } - cout << "/////////////////////////////////" << endl;} ////////////////////////////////////////////////////////////////// CalibrationManager::~CalibrationManager() @@ -178,6 +181,7 @@ double CalibrationManager::ApplyCalibration(string ParameterPath , double RawVal // The vector size give the degree of calibration // We just apply the coeff and returned the calibrated value + for(unsigned int i = 0 ; i < Coeff.size() ; i++) { CalibratedValue += Coeff[i]*pow(RawValue, (double)i); diff --git a/NPLib/MUST2/TMust2Physics.cxx b/NPLib/MUST2/TMust2Physics.cxx index fbc27b9c7..07243af1b 100644 --- a/NPLib/MUST2/TMust2Physics.cxx +++ b/NPLib/MUST2/TMust2Physics.cxx @@ -40,7 +40,7 @@ using namespace LOCAL; ClassImp(TMust2Physics) /////////////////////////////////////////////////////////////////////////// TMust2Physics::TMust2Physics() - { + { EventMultiplicity = 0 ; EventData = new TMust2Data ; EventPhysics = this ; -- GitLab