Skip to content
Snippets Groups Projects
Commit 775ac74b authored by matta's avatar matta
Browse files

* Change logic for calling Calibration Manager

 - Calibration Manager is now called inside the detector manager
 - Code is ligther in NPA without explicit call of the Calibration Manager

* Still a error message remain while launching the Template
 - Dont know where but he try to read the EG file somewhere inside the RootInput....
parent 04275504
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,6 @@ int main(int argc, char** argv)
myOptionManager->SetDetectorFile(name);
}
// get input files from NPOptionManager
string detectorfileName = myOptionManager->GetDetectorFile();
string calibrationfileName = myOptionManager->GetCalibrationFile();
......@@ -26,13 +24,10 @@ int main(int argc, char** argv)
// Instantiate RootOutput
RootOutput::getInstance("Analysis/"+OutputfileName, "AnalysedTree");
// Instantiate the Calibration Manger using a file
CalibrationManager* myCalibration = CalibrationManager::getInstance(calibrationfileName);
// Instantiate the detector using a file
NPA::DetectorManager* myDetector = new DetectorManager();
myDetector->ReadConfigurationFile(detectorfileName);
myCalibration->LoadParameterFromFile();
// Get the formed Chained Tree and Treat it
TChain* Chain = RootInput:: getInstance() -> GetChain();
......
......@@ -36,6 +36,11 @@ DetectorManager::~DetectorManager()
// Read stream at ConfigFile and pick-up Token declaration of Detector
void DetectorManager::ReadConfigurationFile(string Path)
{
// Instantiate the Calibration Manager
// All The detector will then add to it their parameter (see AddDetector)
CalibrationManager::getInstance(NPOptionManager::getInstance()->GetCalibrationFile());
////////General Reading needs////////
string LineBuffer;
string DataBuffer;
......@@ -331,9 +336,13 @@ void DetectorManager::ReadConfigurationFile(string Path)
ConfigFile.close();
// Now that the detector are all added, they can initialise their Branch to the Root I/O
InitializeRootInput();
InitializeRootOutput();
// The calibration Manager got all the parameter added, so it can load them from the calibration file
CalibrationManager::getInstance()->LoadParameterFromFile();
return;
}
......
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