Skip to content
Snippets Groups Projects
Commit 641193a7 authored by Adrien Matta's avatar Adrien Matta :skull_crossbones:
Browse files

* Adding first version of Delta Spectra for smart online update

parent ab259f33
No related branches found
No related tags found
No related merge requests found
add_custom_command(OUTPUT TAsciiFileDict.cxx COMMAND ../scripts/build_dict.sh TAsciiFile.h TAsciiFileDict.cxx TAsciiFile.rootmap libNPCore.so)
add_custom_command(OUTPUT NPVDetectorDict.cxx COMMAND ../scripts/build_dict.sh NPVDetector.h NPVDetectorDict.cxx NPVDetector.rootmap libNPCore.so NPCoreLinkdef.h)
add_library(NPCore SHARED NPCore.cxx NPVAnalysis.cxx NPAnalysisFactory.cxx NPCalibrationManager.cxx NPOptionManager.cxx RootOutput.cxx RootInput.cxx TAsciiFile.cxx TAsciiFileDict.cxx NPDetectorManager.cxx NPVDetector.cxx NPVDetectorDict.cxx NPVSpectra.cxx NPDetectorFactory.cxx NPSpectraServer.cxx NPInputParser.cxx NPImage.cxx NPElog.cxx)
add_library(NPCore SHARED NPCore.cxx NPVAnalysis.cxx NPAnalysisFactory.cxx NPCalibrationManager.cxx NPOptionManager.cxx RootOutput.cxx RootInput.cxx TAsciiFile.cxx TAsciiFileDict.cxx NPDetectorManager.cxx NPVDetector.cxx NPVDetectorDict.cxx NPVSpectra.cxx NPDetectorFactory.cxx NPSpectraServer.cxx NPInputParser.cxx NPImage.cxx NPElog.cxx NPDeltaSpectra.cxx)
target_link_libraries(NPCore ${ROOT_LIBRARIES})
install(FILES NPCore.h NPVAnalysis.h NPAnalysisFactory.h NPCalibrationManager.h NPOptionManager.h RootInput.h RootOutput.h TAsciiFile.h NPDetectorManager.h NPVDetector.h NPGlobalSystemOfUnits.h NPPhysicalConstants.h NPSystemOfUnits.h NPVSpectra.h NPDetectorFactory.h NPSpectraServer.h NPInputParser.h NPImage.h NPElog.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
install(FILES NPCore.h NPVAnalysis.h NPAnalysisFactory.h NPCalibrationManager.h NPOptionManager.h RootInput.h RootOutput.h TAsciiFile.h NPDetectorManager.h NPVDetector.h NPGlobalSystemOfUnits.h NPPhysicalConstants.h NPSystemOfUnits.h NPVSpectra.h NPDetectorFactory.h NPSpectraServer.h NPInputParser.h NPImage.h NPElog.h NPDeltaSpectra.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
/*****************************************************************************
* Copyright (C) 2009-2016 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien Matta contact address: matta@lpccaen.in2p3.fr *
* *
* Creation Date : 11 May 2017 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This Class hold the record of pas filling of an histo server *
* It is used in Online module to guarantee a faster Histo Sync *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include "NPDeltaSpectra.h"
////////////////////////////////////////////////////////////////////////////////
void NPL::DeltaSpectra::Fill(std::string name, double valx){
m_Delta[name].first.push_back(valx);
}
////////////////////////////////////////////////////////////////////////////////
void NPL::DeltaSpectra::Fill(std::string name,double valx,double valy){
m_Delta[name].first.push_back(valx);
m_Delta[name].second.push_back(valy);
}
////////////////////////////////////////////////////////////////////////////////
void NPL::DeltaSpectra::Clear(){
m_Delta.clear();
}
#ifndef NPDELTASPECTRA_H
#define NPDELTASPECTRA_H
/*****************************************************************************
* Copyright (C) 2009-2016 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien Matta contact address: matta@lpccaen.in2p3.fr *
* *
* Creation Date : 11 May 2017 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This Class hold the record of pas filling of an histo server *
* It is used in Online module to guarantee a faster Histo Sync *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
*****************************************************************************/
#include<string>
#include<map>
#include<vector>
#include<algorithm>
namespace NPL{
class DeltaSpectra{
public:
DeltaSpectra(){};
~DeltaSpectra(){};
private:
// Hold the record of Filling
std::map<std::string , std::pair<std::vector<double> ,std::vector<double> > > m_Delta;
public:
// Record a Fill for TH1
void Fill(std::string name, double valx);
// Record a Fill for TH2
void Fill(std::string name, double valx, double valy);
// Erase all recorded data (typically called after a client update)
void Clear();
// Fill in the spectra using there name and the internal data
void UpdateLocalSpectra();
};
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment