Skip to content
Snippets Groups Projects
Commit 1116b500 authored by Alexander Kiselev's avatar Alexander Kiselev
Browse files

Work in progress changes to IRT code

parent b81136f5
No related branches found
No related tags found
1 merge request!8merge integration development branch `irt-init-v02`
...@@ -142,7 +142,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec ...@@ -142,7 +142,7 @@ static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetec
// Get access to the readout structure decoder; may want to simply call desc.readout("DRICHHits"); // Get access to the readout structure decoder; may want to simply call desc.readout("DRICHHits");
const auto &rdspecs = desc.readouts(); const auto &rdspecs = desc.readouts();
if (rdspecs.size() != 1) { if (rdspecs.size() != 1) {
printout(FATAL,"DRich_geo","Expect a single readout structure in XML file"); printout(FATAL,"ERich_geo","Expect a single readout structure in XML file");
return det; return det;
} //if } //if
// Do not mess up with casting of (*desc.readouts().begin()).second; just call desc.readout(); // Do not mess up with casting of (*desc.readouts().begin()).second; just call desc.readout();
......
...@@ -3,49 +3,42 @@ cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) ...@@ -3,49 +3,42 @@ cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(EVALUATION) project(EVALUATION)
set(IRTEVAL_LIB IRTEVAL)
SET(READER_EXE reader) SET(READER_EXE reader)
SET(DREADER_EXE dreader)
SET(EVALUATION_EXE evaluation) SET(EVALUATION_EXE evaluation)
SET( IRTEVAL_SRC
G__IRTEVAL.cxx
)
# Well, it is assumed that includes are available in /usr/local/include/dd4pod; # Well, it is assumed that includes are available in /usr/local/include/dd4pod;
SET( READER_SRC SET( READER_SRC
${PROJECT_SOURCE_DIR}/source/reader.cc ${PROJECT_SOURCE_DIR}/source/reader.cc
G__evaluation.cxx
) )
# FIXME: split the CINT library part off;
SET( EVALUATION_SRC SET( EVALUATION_SRC
${PROJECT_SOURCE_DIR}/source/evaluation.cc ${PROJECT_SOURCE_DIR}/source/evaluation.cc
G__evaluation.cxx
) )
# FIXME: split the CINT library part off; SET(EVALUATION_ROOTMAP ${CMAKE_CURRENT_BINARY_DIR}/lib${IRTEVAL_LIB}_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/lib${IRTEVAL_LIB}.rootmap )
SET( DREADER_SRC
${PROJECT_SOURCE_DIR}/source/dreader.cc
G__evaluation.cxx ROOT_GENERATE_DICTIONARY(G__${IRTEVAL_LIB} eicd/CherenkovPdgHypothesis.h eicd/CherenkovParticleIDData.h dd4pod/PhotoMultiplierHitData.h dd4pod/Geant4ParticleData.h LINKDEF include/evaluationLinkDef.h)
)
SET(EVALUATION_ROOTMAP ${CMAKE_CURRENT_BINARY_DIR}/libevaluation_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/libevaluation.rootmap )
ROOT_GENERATE_DICTIONARY(G__evaluation eicd/CherenkovPdgHypothesis.h eicd/CherenkovParticleIDData.h dd4pod/PhotoMultiplierHitData.h dd4pod/Geant4ParticleData.h LINKDEF include/evaluationLinkDef.h)
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
ADD_EXECUTABLE( ${READER_EXE} ${READER_SRC} ) ADD_EXECUTABLE( ${READER_EXE} ${READER_SRC} )
TARGET_LINK_LIBRARIES(${READER_EXE} ${ROOT_LIBRARIES} DD4pod IRT) TARGET_LINK_LIBRARIES(${READER_EXE} ${ROOT_LIBRARIES} DD4pod IRT IRTEVAL)
#ADD_EXECUTABLE( ${DREADER_EXE} ${DREADER_SRC} )
#TARGET_LINK_LIBRARIES(${DREADER_EXE} ${ROOT_LIBRARIES} DD4pod IRT)
ADD_EXECUTABLE( ${EVALUATION_EXE} ${EVALUATION_SRC} ) ADD_EXECUTABLE( ${EVALUATION_EXE} ${EVALUATION_SRC} )
TARGET_LINK_LIBRARIES(${EVALUATION_EXE} ${ROOT_LIBRARIES} DD4pod IRT) TARGET_LINK_LIBRARIES(${EVALUATION_EXE} ${ROOT_LIBRARIES} DD4pod IRT IRTEVAL)
ADD_LIBRARY( ${IRTEVAL_LIB} SHARED ${IRTEVAL_SRC} G__evaluation.cxx)
TARGET_LINK_LIBRARIES(${IRTEVAL_LIB} ${ROOT_LIBRARIES} DD4pod )
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
INSTALL(FILES ${EVALUATION_ROOTMAP} DESTINATION bin) INSTALL(FILES ${EVALUATION_ROOTMAP} DESTINATION lib)
install(TARGETS ${READER_EXE} DESTINATION bin) install(TARGETS ${READER_EXE} DESTINATION bin)
#install(TARGETS ${DREADER_EXE} DESTINATION bin)
install(TARGETS ${EVALUATION_EXE} DESTINATION bin) install(TARGETS ${EVALUATION_EXE} DESTINATION bin)
install(TARGETS ${IRTEVAL_LIB} DESTINATION lib)
...@@ -95,9 +95,10 @@ int main(int argc, char** argv) ...@@ -95,9 +95,10 @@ int main(int argc, char** argv)
if (abs(option.pdg) == 11) continue; if (abs(option.pdg) == 11) continue;
if (!best || option.weight > best->weight) best = &option; if (!best || option.weight > best->weight) best = &option;
printf("radiator %3d (pdg %5d): npe %5d, weight %7.2f\n", printf("radiator %3d (pdg %5d): weight %7.2f, npe %7.2f\n",
option.radiator, option.pdg, option.npe, option.weight); option.radiator, option.pdg, option.weight, option.npe);
} //for } //for
printf("\n");
// Check whether the true PDG got a highest score; // Check whether the true PDG got a highest score;
if (!best || best->pdg != mctrack.pdgID) false_assignment_stat++; if (!best || best->pdg != mctrack.pdgID) false_assignment_stat++;
......
// ROOT // ROOT
//#include "TH1D.h"
//#include <TCanvas.h>
#include "TTree.h" #include "TTree.h"
#include "TFile.h" #include "TFile.h"
#include <TRandom.h> #include <TRandom.h>
...@@ -13,8 +15,8 @@ ...@@ -13,8 +15,8 @@
#include <CherenkovDetectorCollection.h> #include <CherenkovDetectorCollection.h>
// Optionally: mimic low wave length cutoff and average QE x Geometric sensor efficiency; // Optionally: mimic low wave length cutoff and average QE x Geometric sensor efficiency;
//#define _WAVE_LENGTH_CUTOFF_ (350.0) #define _WAVE_LENGTH_CUTOFF_ (350.0)
//#define _AVERAGE_PDE_ ( 0.30) #define _AVERAGE_PDE_ ( 0.30)
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
...@@ -53,12 +55,14 @@ int main(int argc, char** argv) ...@@ -53,12 +55,14 @@ int main(int argc, char** argv)
exit(0); exit(0);
} //if } //if
//auto gas = detector->GetRadiator("GasVolume"); //auto np = new TH1D("np", "Photon count", 50, 0, 50);
auto gas = detector->GetRadiator("GasVolume");
auto aerogel = detector->GetRadiator("Aerogel"); auto aerogel = detector->GetRadiator("Aerogel");
//auto acrylic = detector->GetRadiator("Filter"); //auto acrylic = detector->GetRadiator("Filter");
// Assume the reference value was close enough in ERich_geo.cpp; since QE was not accounted, // Assume the reference value was close enough in ERich_geo.cpp; since QE was not accounted,
// this may not be true; // this may not be true;
//gas ->m_AverageRefractiveIndex = gas ->n(); gas ->m_AverageRefractiveIndex = gas ->n();
aerogel->m_AverageRefractiveIndex = aerogel->n(); aerogel->m_AverageRefractiveIndex = aerogel->n();
//acrylic->m_AverageRefractiveIndex = acrylic->n(); //acrylic->m_AverageRefractiveIndex = acrylic->n();
...@@ -178,5 +182,8 @@ int main(int argc, char** argv) ...@@ -178,5 +182,8 @@ int main(int argc, char** argv)
printf("%d false out of %lld\n", false_assignment_stat, t->GetEntries()); printf("%d false out of %lld\n", false_assignment_stat, t->GetEntries());
//auto cv = new TCanvas("cv", "", 800, 600);
//cv->cd(1); np->Draw();
return 0; return 0;
} // main() } // main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment