Skip to content

Restructuring #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Aug 14, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ include(GNUInstallDirs)
set(CMAKE_INSTALL_LIBDIR lib)
set(CMAKE_INSTALL_INCLUDEDIR include)

ROOT_STANDARD_LIBRARY_PACKAGE(RAMCore
ROOT_STANDARD_LIBRARY_PACKAGE(ramcore
HEADERS
inc/ttree/RAMRecord.h
inc/ttree/Utils.h
inc/ttree/CigarOps.h
inc/rntuple/RAMNTupleRecord.h
inc/RAMCore/SamParser.h
inc/RAMCore/SamToTTree.h
inc/RAMCore/SamToNTuple.h
inc/ramcore/SamParser.h
inc/ramcore/SamToTTree.h
inc/ramcore/SamToNTuple.h
SOURCES
src/ttree/RAMRecord.cxx
src/rntuple/RAMNTupleRecord.cxx
src/RAMCore/SamParser.cxx
src/RAMCore/SamToTTree.cxx
src/RAMCore/SamToNTuple.cxx
src/ramcore/SamParser.cxx
src/ramcore/SamToTTree.cxx
src/ramcore/SamToNTuple.cxx
LINKDEF
inc/ttree/LinkDef.h
DEPENDENCIES
Expand All @@ -46,7 +46,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(RAMCore
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

target_include_directories(RAMCore
target_include_directories(ramcore
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
Expand Down
6 changes: 3 additions & 3 deletions inc/RAMCore/SamParser.h → inc/ramcore/SamParser.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef RAMCORE_SAMPARSER_H
#define RAMCORE_SAMPARSER_H
#ifndef ramcore_SAMPARSER_H
#define ramcore_SAMPARSER_H

#include <string>
#include <vector>
#include <functional>
#include <cstdio>

namespace RAMCore {
namespace ramcore {

struct SamRecord {
std::string qname;
Expand Down
4 changes: 2 additions & 2 deletions inc/RAMCore/SamToNTuple.h → inc/ramcore/SamToNTuple.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RAMCORE_SAMTONTUPLE_H
#define RAMCORE_SAMTONTUPLE_H
#ifndef ramcore_SAMTONTUPLE_H
#define ramcore_SAMTONTUPLE_H

#include <cstdint>

Expand Down
4 changes: 2 additions & 2 deletions inc/RAMCore/SamToTTree.h → inc/ramcore/SamToTTree.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RAMCORE_SAMTOTREE_H
#define RAMCORE_SAMTOTREE_H
#ifndef ramcore_SAMTOTREE_H
#define ramcore_SAMTOTREE_H

#include <Rtypes.h>

Expand Down
4 changes: 2 additions & 2 deletions src/RAMCore/SamParser.cxx → src/ramcore/SamParser.cxx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "RAMCore/SamParser.h"
#include "ramcore/SamParser.h"
#include <cstring>
#include <cstdlib>

namespace RAMCore {
namespace ramcore {

void StripCRLF(char* str) {
size_t len = strlen(str);
Expand Down
8 changes: 4 additions & 4 deletions src/RAMCore/SamToNTuple.cxx → src/ramcore/SamToNTuple.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "RAMCore/SamToNTuple.h"
#include "RAMCore/SamParser.h"
#include "ramcore/SamToNTuple.h"
#include "ramcore/SamParser.h"
#include "rntuple/RAMNTupleRecord.h"

#include <ROOT/RNTupleModel.hxx>
Expand Down Expand Up @@ -41,7 +41,7 @@ void samtoramntuple(const char *datafile,
TList headers;
headers.SetName("headers");

RAMCore::SamParser parser;
ramcore::SamParser parser;

auto header_callback = [&headers](const std::string& tag, const std::string& content) {
headers.Add(new TNamed(tag.c_str(), content.c_str()));
Expand All @@ -58,7 +58,7 @@ void samtoramntuple(const char *datafile,
}
};

auto record_callback = [&](const RAMCore::SamRecord& sam_record, size_t record_num) {
auto record_callback = [&](const ramcore::SamRecord& sam_record, size_t record_num) {
RAMNTupleRecord r;
r.SetBit(quality_policy);

Expand Down
8 changes: 4 additions & 4 deletions src/RAMCore/SamToTTree.cxx → src/ramcore/SamToTTree.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "RAMCore/SamToTTree.h"
#include "RAMCore/SamParser.h"
#include "ramcore/SamToTTree.h"
#include "ramcore/SamParser.h"
#include "ttree/RAMRecord.h"
#include "ttree/Utils.h"

Expand Down Expand Up @@ -45,13 +45,13 @@ void samtoram(const char *datafile,
headers->SetName("headers");
tree->GetUserInfo()->Add(headers);

RAMCore::SamParser parser;
ramcore::SamParser parser;

auto header_callback = [&headers](const std::string& tag, const std::string& content) {
headers->Add(new TNamed(tag.c_str(), content.c_str()));
};

auto record_callback = [&](const RAMCore::SamRecord& sam_record, size_t record_num) {
auto record_callback = [&](const ramcore::SamRecord& sam_record, size_t record_num) {

r->SetQNAME(sam_record.qname.c_str());
r->SetFLAG(sam_record.flag);
Expand Down
8 changes: 4 additions & 4 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function(add_ramcore_test test_name)
add_executable(${test_name} ${ARGN})

target_link_libraries(${test_name} PRIVATE
RAMCore
ramcore
ROOT::Core
ROOT::Tree
ROOT::ROOTNTuple
Expand All @@ -16,11 +16,11 @@ function(add_ramcore_test test_name)
add_test(NAME ${test_name} COMMAND ${test_name})
endfunction()

add_ramcore_test(RAMCoreTests RAMCoreTests.cxx)
add_ramcore_test(ramcoretests ramcoretests.cxx)

if(EXISTS ${CMAKE_SOURCE_DIR}/test/samexample.sam)
configure_file(${CMAKE_SOURCE_DIR}/test/samexample.sam
${CMAKE_CURRENT_BINARY_DIR}/samexample.sam
COPYONLY)
${CMAKE_CURRENT_BINARY_DIR}/samexample.sam
COPYONLY)
endif()

8 changes: 4 additions & 4 deletions test/RAMCoreTests.cxx → test/ramcoretests.cxx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <gtest/gtest.h>
#include "RAMCore/SamToTTree.h"
#include "RAMCore/SamToNTuple.h"
#include "ramcore/SamToTTree.h"
#include "ramcore/SamToNTuple.h"
#include <TFile.h>
#include <TTree.h>
#include <ROOT/RNTupleReader.hxx>
#include <cstdio>

class RAMCoreTest : public ::testing::Test {
class ramcoreTest : public ::testing::Test {
protected:
void SetUp() override {

Expand All @@ -21,7 +21,7 @@ class RAMCoreTest : public ::testing::Test {
}
};

TEST_F(RAMCoreTest, ConversionProducesEqualEntries) {
TEST_F(ramcoreTest, ConversionProducesEqualEntries) {
const char* samFile = "samexample.sam";
const char* ttreeFile = "test_ttree.root";
const char* rntupleFile = "test_rntuple.root";
Expand Down
4 changes: 2 additions & 2 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ROOT_EXECUTABLE(samtoram
samtoram.cxx
LIBRARIES
RAMCore
ramcore
ROOT::Core
ROOT::Tree
)

ROOT_EXECUTABLE(samtoramntuple
samtoramntuple.cxx
LIBRARIES
RAMCore
ramcore
ROOT::Core
ROOT::ROOTNTuple
)
Expand Down
2 changes: 1 addition & 1 deletion tools/samtoram.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "RAMCore/SamToTTree.h"
#include "ramcore/SamToTTree.h"
#include "ttree/RAMRecord.h"
#include <Compression.h>
#include <cstdio>
Expand Down
2 changes: 1 addition & 1 deletion tools/samtoramntuple.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "RAMCore/SamToNTuple.h"
#include "ramcore/SamToNTuple.h"
#include "rntuple/RAMNTupleRecord.h"
#include <iostream>
#include <string>
Expand Down