Skip to content
Snippets Groups Projects
Commit 66dfd0c6 authored by Viktor Klochkov's avatar Viktor Klochkov
Browse files

some bugs fixed

parent 8f6bc277
No related branches found
No related tags found
2 merge requests!9Template way,!7Config
Pipeline #2771 failed
cmake_minimum_required(VERSION 3.0)
project(AnalysisTree CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_BUILD_TYPE DEBUG)
set(PROJECT_VERSION 1.0)
......
......@@ -52,10 +52,24 @@ class Branch{
void AddFloatField(const std::string name) { floating_map_.insert ( std::pair<std::string,ShortInt_t>(name, floating_map_.size()) ); }
void AddIntegerField(const std::string name) { integer_map_.insert ( std::pair<std::string,ShortInt_t>(name, integer_map_.size()) ); }
void AddFloatField(const std::vector<std::string> sname) {
for (auto name : sname)
{
floating_map_.insert ( std::pair<std::string,ShortInt_t>(name, floating_map_.size()) );
}
}
void AddIntegerField(const std::vector<std::string> sname) {
for (auto name : sname)
{
integer_map_.insert ( std::pair<std::string, ShortInt_t>(name, floating_map_.size()) );
}
}
void SetType(ShortInt_t type) { type_ = type; }
ShortInt_t GetFloatingId(const std::string sField)
ShortInt_t GetFloatingId(const std::string sField) const
{
auto search = floating_map_.find(sField);
if (search != floating_map_.end()) {
......@@ -66,7 +80,7 @@ class Branch{
}
}
ShortInt_t GetIntegerId(const std::string sField)
ShortInt_t GetIntegerId(const std::string sField) const
{
auto search = integer_map_.find(sField);
if (search != integer_map_.end()) {
......@@ -77,7 +91,7 @@ class Branch{
}
}
ShortInt_t GetId(const std::string sField)
ShortInt_t GetId(const std::string sField) const
{
return GetFloatingId(sField) != -1 ? GetFloatingId(sField) : GetIntegerId(sField);
}
......
......@@ -3,7 +3,7 @@
#define ANALYSISTREE_BASECONTAINER_H
#include <memory>
#include <variant>
//#include <variant>
#include "IndexedObject.h"
#include "Constants.h"
......
......@@ -56,7 +56,8 @@ class EventHeader : public virtual IndexedObject {
protected:
std::array <Floating_t , 3> vtx_pos_{ {0., 0., 0.} };
// Integer_t run_id_{-1};
};
}
......
......@@ -48,7 +48,7 @@ class IndexedObject {
IndexedObject(const IndexedObject &indexedObject) = default;
IndexedObject(IndexedObject &&indexedObject) = default;
inline Integer_t GetID() const {
inline Integer_t GetId() const {
return id_;
}
......
......@@ -17,12 +17,12 @@ using namespace AnalysisTree::Test;
TEST(Test_AnalysisTreeCore, Test_ChannelizedDetector) {
AnalysisTree::Test::TestDetector testChannelizedDetector;
auto ch0 = testChannelizedDetector.AddChannel();
ASSERT_EQ(ch0->GetID(), 0);
ASSERT_EQ(ch0->GetId(), 0);
ASSERT_EQ(testChannelizedDetector.GetNumberOfChannels(), 1);
auto ch1 = testChannelizedDetector.AddChannel();
ASSERT_FALSE(ch0 == ch1);
ASSERT_EQ(ch1->GetID(), 1);
ASSERT_EQ(ch1->GetId(), 1);
ASSERT_EQ(testChannelizedDetector.GetNumberOfChannels(), 2);
// testChannelizedDetector.ClearChannels();
......
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