Skip to content
Snippets Groups Projects
Commit f5316ee7 authored by GIRARD ALCINDOR Valérian's avatar GIRARD ALCINDOR Valérian
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
.DS_Store 0 → 100644
File added
cmake_minimum_required (VERSION 3.0)
project(zdd CXX)
set(CMAKE_BUILD_TYPE Release)
include(CMakePackageConfigHelpers)
set(CMAKE_BINARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin )
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib )
set(CMAKE_INCLUDE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include )
set(CMAKE_INSTALL_LIBDIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} )
### nptool ###
find_package(nptool QUIET)
include_directories($ENV{NPTOOL}/include)
include_directories($ENV{NPTOOL_HOME}/$ENV{NPTOOL_ENV}/include)
link_directories($ENV{NPTOOL}/lib)
link_directories(../install/lib)
link_directories($ENV{NPTOOL_HOME}/$ENV{NPTOOL_ENV}/lib)
### ROOT ###
# find package
find_package(ROOT QUIET)
if(${ROOT_FOUND})
message(STATUS "ROOT found: ${ROOT_VERSION}" )
# use this definition to isolate ROOT dependent code
add_compile_definitions(ROOT_FOUND)
# add usefull root fonction for dictionnary definition
include(${ROOT_USE_FILE})
# add include directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
else()
message(STATUS "ROOT not found: compiling with no ROOT support" )
endif()
### GEANT4 ###
find_package(Geant4 QUIET)
if(${Geant4_FOUND})
message(STATUS "Geant4 found: ${Geant4_VERSION}" )
# use this definition to isolate Geant4 dependent code
add_compile_definitions(Geant4_FOUND)
# add usefull root fonction for dictionnary definition
include(${Geant4_USE_FILE})
# add include directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
else()
message(STATUS "Geant4 not found: compiling with no Geant4 support" )
endif()
set (duplicate_include_dir ${CMAKE_CURRENT_SOURCE_DIR}/src PARENT_SCOPE)
include_directories("src")
add_subdirectory("src")
This is the ZDD detector plugin for the nptool framework
Package:
name: zdd
type: detector
groups: ganil germanium
url: https://gitlab.in2p3.fr//zdd
version: 0.1
author: Valerian Girard-Alcindor
mail: girard-alcindor@ijclab.in2p3.fr
description: zdd
dependencies: root
Plugin: https://gitlab.in2p3.fr/valerian.girard-alcindor/zdd
token: zdd
library: NPzdd
PluginCitation:
type: Detector
citation:
url:
PluginCitation:
type: Analysis
citation: something else
url: www.another-link.org
add_library(NPExogam SHARED ExogamDetector.cxx ExogamData.cxx ExogamPhysics.cxx)
target_link_libraries(NPExogam PUBLIC PUBLIC ROOT::RIO ROOT::Tree ROOT::Physics ROOT::Imt NPRoot nptool )
install(DIRECTORY ./ DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY} FILES_MATCHING PATTERN "*.h" )
ROOT_GENERATE_DICTIONARY(ExogamDict ExogamData.h ExogamPhysics.h LINKDEF Exogamlinkdef.hh MODULE NPExogam)
#include <iostream>
using namespace std;
#include "ExogamData.h"
exogam::ExogamData::ExogamData() {}
exogam::ExogamData::~ExogamData() {}
void exogam::ExogamData::Clear() {
}
void exogam::ExogamData::Dump() const {
}
#ifndef NPExogamData_H
#define NPExogamData_H
#include <vector>
namespace exogam {
class ExogamData {
private:
public:
ExogamData();
virtual ~ExogamData();
void Clear();
void Dump() const;
};
} // namespace exogam
#endif
#include "ExogamDetector.h"
#include "NPFunction.h"
#include "NPRootPlugin.h"
#include <iostream>
using namespace exogam;
using namespace std;
using namespace ROOT::Math;
////////////////////////////////////////////////////////////////////////////////
ExogamDetector::ExogamDetector() {
m_RawData = new exogam::ExogamData();
m_CalData = new exogam::ExogamData();
m_PhysicsData = new exogam::ExogamPhysics();
m_Cal.InitCalibration();
}
ExogamDetector::~ExogamDetector() {}
////////////////////////////////////////////////////////////////////////////////
void ExogamDetector::ReadConfiguration(nptool::InputParser parser) {
}
void ExogamDetector::BuildPhysicalEvent() {
}
void ExogamDetector::PreTreat() {
ClearPreTreatedData();
}
////////////////////////////////////////////////////////////////////////////////
void ExogamDetector::InitializeDataInputRaw(
std::shared_ptr<nptool::VDataInput> input) {
input->Attach("exogam", "exogam::ExogamData", &m_RawData);
}
////////////////////////////////////////////////////////////////////////////////
void ExogamDetector::InitializeDataInputPhysics(
std::shared_ptr<nptool::VDataInput> input) {
input->Attach("exogam", "exogam::ExogamPhysics", &m_PhysicsData);
}
////////////////////////////////////////////////////////////////////////////////
void ExogamDetector::InitializeDataOutputRaw(
std::shared_ptr<nptool::VDataOutput> output) {
output->Attach("exogam", "exogam::ExogamData", &m_RawData);
}
////////////////////////////////////////////////////////////////////////////////
void ExogamDetector::InitializeDataOutputPhysics(
std::shared_ptr<nptool::VDataOutput> output) {
output->Attach("exogam", "exogam::ExogamPhysics", &m_PhysicsData);
}
////////////////////////////////////////////////////////////////////////////////
extern "C" {
shared_ptr<nptool::VDetector> ConstructDetector() {
return make_shared<exogam::ExogamDetector>();
};
}
#ifndef ExogamDetector_h
#define ExogamDetector_h
#include <map>
#include <stdlib.h>
#include <vector>
#include "Math/Vector3D.h"
#include "ExogamData.h"
#include "ExogamPhysics.h"
#include "NPCalibrationManager.h"
#include "NPVDetector.h"
// ROOT
#include "TGraphErrors.h"
#include "TH1.h"
#include "TObject.h"
#include "TVector2.h"
#include "TVector3.h"
namespace exogam {
class ExogamDetector : public nptool::VDetector {
public: // Constructor and Destructor
ExogamDetector();
~ExogamDetector();
public: // Data member
exogam::ExogamData* m_RawData;
exogam::ExogamData* m_CalData;
exogam::ExogamPhysics* m_PhysicsData;
nptool::CalibrationManager m_Cal;
public: // inherrited from nptool::VPlugin
std::vector<std::string> GetDependencies() { return {"root"}; };
public: // inherrited from nptool::VDetector
// Read stream at ConfigFile to pick-up parameters of detector
// (Position,...) using Token
void ReadConfiguration(nptool::InputParser);
// Add Parameter to the CalibrationManger
void AddParameterToCalibrationManager(){};
// Activated associated Branches and link it to the private member
// DetectorData address In this method mother Branches (Detector) AND
// daughter leaf (fDetector_parameter) have to be activated
void InitializeDataInputRaw(std::shared_ptr<nptool::VDataInput>);
// Activated associated Branches and link it to the private member
// DetectorPhysics address In this method mother Branches (Detector) AND
// daughter leaf (parameter) have to be activated
void InitializeDataInputPhysics(std::shared_ptr<nptool::VDataInput>);
// Create associated branches and associated private member DetectorPhysics
// address
void InitializeDataOutputRaw(std::shared_ptr<nptool::VDataOutput>);
// Create associated branches and associated private member DetectorPhysics
// address
void InitializeDataOutputPhysics(std::shared_ptr<nptool::VDataOutput>);
// This method is called at each event read from the Input Tree. Aim is to
// build treat Raw dat in order to extract physical parameter.
void BuildPhysicalEvent();
// Remove bad channel, calibrate the data and apply threshold
void PreTreat();
void ClearPreTreatedData() { m_CalData->Clear(); }
// Those two method all to clear the Event Physics or Data
void ClearEventPhysics(){};
void ClearEventData(){};
// Method related to the TSpectra classes, aimed at providing a framework for
// online applications Instantiate the Spectra class and the histogramm
// throught it
void InitSpectra(){};
// Fill the spectra hold by the spectra class
void FillSpectra(){};
// Write the spectra to a file
void WriteSpectra(){};
// Used for Online mainly, perform check on the histo and for example change
// their color if issues are found
void CheckSpectra(){};
// Used for Online only, clear all the spectra hold by the Spectra class
void ClearSpectra(){};
// Used for interoperability with other framework
void SetRawDataPointer(void*){};
private:
private: // Parameter used in the analysis
};
} // namespace exogam
#endif
#include "ExogamPhysics.h"
#ifndef NPExogamPhysics_H
#define NPExogamPhysics_H
#include <vector>
namespace exogam {
class ExogamPhysics {
public:
ExogamPhysics(){};
~ExogamPhysics(){};
public:
void Clear();
void Dump() const;
};
} // namespace exogam
#endif
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class exogam::ExogamData;
#pragma link C++ class exogam::ExogamPhysics;
#endif
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