Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
np
nptool
Commits
ec8435af
Commit
ec8435af
authored
Oct 15, 2020
by
Adrien Matta
☠
Browse files
* changing a few things around in NPXml
parent
debdf1e6
Pipeline
#87092
passed with stages
in 12 minutes and 36 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
84 deletions
+87
-84
NPLib/Core/CMakeLists.txt
NPLib/Core/CMakeLists.txt
+1
-1
NPLib/Core/NPXmlParser.cxx
NPLib/Core/NPXmlParser.cxx
+3
-3
NPLib/Core/NPXmlParser.h
NPLib/Core/NPXmlParser.h
+82
-79
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
+1
-1
No files found.
NPLib/Core/CMakeLists.txt
View file @
ec8435af
...
...
@@ -4,4 +4,4 @@ add_custom_command(OUTPUT NPDeltaSpectraDict.cxx COMMAND ${CMAKE_BINARY_DIR}/sc
add_custom_command
(
OUTPUT NPVDetectorDict.cxx COMMAND
${
CMAKE_BINARY_DIR
}
/scripts/build_dict.sh NPVDetector.h NPVDetectorDict.cxx NPVDetector.rootmap libNPCore.so NPCoreLinkdef.h
)
add_library
(
NPCore SHARED NPCore.cxx NPRandom.cxx NPVAnalysis.cxx NPAnalysisFactory.cxx NPCalibrationManager.cxx NPOptionManager.cxx RootOutput.cxx RootInput.cxx TAsciiFile.cxx TAsciiFileDict.cxx NPDeltaSpectraDict.cxx NPDetectorManager.cxx NPVDetector.cxx NPVDetectorDict.cxx NPVSpectra.cxx NPDetectorFactory.cxx NPSpectraServer.cxx NPInputParser.cxx NPImage.cxx NPElog.cxx NPDeltaSpectra.cxx NPXmlParser.cxx
)
target_link_libraries
(
NPCore
${
ROOT_LIBRARIES
}
-lXMLIO
)
install
(
FILES NPCore.h NPVAnalysis.h NPAnalysisFactory.h NPRandom.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 NPXmlParser.
cxx
DESTINATION
${
CMAKE_INCLUDE_OUTPUT_DIRECTORY
}
)
install
(
FILES NPCore.h NPVAnalysis.h NPAnalysisFactory.h NPRandom.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 NPXmlParser.
h
DESTINATION
${
CMAKE_INCLUDE_OUTPUT_DIRECTORY
}
)
NPLib/Core/NPXmlParser.cxx
View file @
ec8435af
...
...
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <iostream>
using
namespace
NPL
;
using
namespace
NPL
::
XML
;
////////////////////////////////////////////////////////////////////////////////
block
::
block
(){};
block
::~
block
(){};
...
...
@@ -121,8 +121,8 @@ void XmlParser::LoadNode(TXMLEngine* xml, XMLNodePointer_t node, Int_t level){
}
//////////////////////////////////////////////////////////////////////////////////
std
::
vector
<
NPL
::
block
*>
XmlParser
::
GetAllBlocksWithName
(
std
::
string
name
){
std
::
vector
<
NPL
::
block
*>
res
;
std
::
vector
<
NPL
::
XML
::
block
*>
XmlParser
::
GetAllBlocksWithName
(
std
::
string
name
){
std
::
vector
<
NPL
::
XML
::
block
*>
res
;
auto
it
=
m_blocks
.
find
(
name
);
if
(
it
!=
m_blocks
.
end
()){
...
...
NPLib/Core/NPXmlParser.h
View file @
ec8435af
...
...
@@ -7,6 +7,7 @@
#include "TXMLEngine.h"
namespace
NPL
{
/////////////////////
namespace
XML
{
class
parameter
{
public:
parameter
();
...
...
@@ -38,6 +39,7 @@ namespace NPL{
};
/////////////////////
// Use for Riken data conversion only
class
Channel
{
public:
Channel
();
...
...
@@ -85,7 +87,7 @@ namespace NPL{
std
::
string
m_name
;
std
::
set
<
parameter
>
m_parameters
;
};
}
/////////////////////
class
XmlParser
{
public:
...
...
@@ -99,23 +101,24 @@ namespace NPL{
void
LoadNode
(
TXMLEngine
*
xml
,
XMLNodePointer_t
node
,
Int_t
level
);
public:
// access by channel id
block
*
GetBlock
(
Channel
c
){
// this is used by mrdc to convert ridf file into nptool root file
XML
::
block
*
GetBlock
(
XML
::
Channel
c
){
auto
it
=
m_Channels
.
find
(
c
);
if
(
it
!=
m_Channels
.
end
())
return
it
->
second
;
else
return
NULL
;
};
void
SetBlock
(
const
Channel
&
c
,
block
*
b
){
void
SetBlock
(
const
XML
::
Channel
&
c
,
XML
::
block
*
b
){
m_Channels
[
c
]
=
b
;
}
public:
std
::
vector
<
block
*>
GetAllBlocksWithName
(
std
::
string
name
)
;
std
::
vector
<
XML
::
block
*>
GetAllBlocksWithName
(
std
::
string
name
)
;
std
::
vector
<
std
::
string
>
GetAllBlocksName
();
private:
std
::
map
<
std
::
string
,
std
::
vector
<
block
>>
m_blocks
;
std
::
map
<
Channel
,
block
*>
m_Channels
;
std
::
map
<
std
::
string
,
std
::
vector
<
XML
::
block
>>
m_blocks
;
std
::
map
<
XML
::
Channel
,
XML
::
block
*>
m_Channels
;
};
...
...
NPLib/Detectors/Samurai/TSamuraiFDC2Physics.cxx
View file @
ec8435af
...
...
@@ -411,7 +411,7 @@ void TSamuraiFDC2Physics::ReadConfiguration(NPL::InputParser parser){
///////////////////////////////////////////////////////////////////////////
void
TSamuraiFDC2Physics
::
AddDC
(
string
name
,
NPL
::
XmlParser
&
xml
){
std
::
vector
<
NPL
::
block
*>
b
=
xml
.
GetAllBlocksWithName
(
name
);
std
::
vector
<
NPL
::
XML
::
block
*>
b
=
xml
.
GetAllBlocksWithName
(
name
);
// FDC2 case
if
(
name
==
"SAMURAIFDC2"
){
unsigned
int
det
=
2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment