Skip to content

Commit

Permalink
Updte califa root geometries in R3BCalifaGeometry.cxx
Browse files Browse the repository at this point in the history
Califa: Added R3BCalifaCrystalCal2Cluster task in the test

Minor change

Removed gtest from califa/geobase/CMakeLists.txt

Solved problem with califa/test/CMakeLists.txt

Reordering califa/test/CMakeLists.txt

Again califa/test/CMakeLists.txt

Update field/R3BFieldCreator.cxx

Undoing PR 745

minor change

minor change

Minor change again

Minor change again

Minor change again

Added again geometry/califa_v2019.11.geo.root

test

test

test final

Removed again geometry/califa_v2019.11.geo.root

test cmake

test cmake

Final

last test

Update

Update
  • Loading branch information
jose-luis-rs committed Jan 14, 2023
1 parent 8d045fb commit de1bd47
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 62 deletions.
30 changes: 14 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,32 @@ execute_process(
if( "${FairRoot_VERSION}" VERSION_LESS 18.2.1 )
Message(FATAL_ERROR "Incompatible FairRoot version detected: ${FairRoot_VERSION}. R3BRoot requires FairRoot v18.2.1 or later")
else()
message(info "You seem to be using FairRoot ${FairRoot_VERSION}.")
message(STATUS "You seem to be using FairRoot ${FairRoot_VERSION}.")
endif()

# added a variable to point to r3broot path in the system
set(R3BROOTPATH ${CMAKE_INSTALL_PREFIX})

# Load some basic macros which are needed later on
include(FairMacros)
include(R3BMacros)
include(WriteConfigFile_r3b)
include(WriteEnvCache)
include(Dart)
include(CheckCompiler)

if(SIMPATH)
set(CMAKE_PREFIX_PATH ${SIMPATH} ${CMAKE_PREFIX_PATH})
endif()

find_package2(PUBLIC ROOT VERSION 6.10.00 REQUIRED)
# Load some basic macros which are needed later on
include(FairMacros)

find_package2(PUBLIC ROOT VERSION 6.10.00 REQUIRED)
if("${ROOT_vmc_FOUND}" MATCHES "no")
find_package2(PUBLIC VMC REQUIRED)
set(VMCLIB VMCLibrary)
else()
set(VMCLIB VMC)
endif()

include(R3BMacros)
include(WriteConfigFile_r3b)
include(WriteEnvCache)
include(Dart)
include(CheckCompiler)
include(ROOTMacros) # This is from FR, see https://github.com/FairRootGroup/FairRoot/issues/1221

find_package2(PUBLIC FairLogger VERSION 1.2.0 REQUIRED)
Expand All @@ -110,12 +110,10 @@ foreach(dep IN LISTS FairLogger_PACKAGE_DEPENDENCIES)
endforeach()

if( "${FairRoot_VERSION}" VERSION_GREATER 18.6.4 )
add_definitions(-DACTIVATEOVERRIDE)

# find_package2(PUBLIC FairMQ VERSION 1.4.0)

if( "${FairRoot_VERSION}" VERSION_GREATER_EQUAL 18.6.4 )
add_definitions(-DACTIVATEOVERRIDE)
endif()

find_package2(PUBLIC DDS)

#If(FAIRSOFT_EXTERN)
Expand Down Expand Up @@ -412,7 +410,6 @@ if(NOT MODULE)
endif (Atima_FOUND)
set(ENV{VMCWORKDIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(passive)
add_subdirectory(califa)
add_subdirectory(xball)
add_subdirectory(dch)
add_subdirectory(gfi)
Expand All @@ -435,7 +432,6 @@ if(NOT MODULE)
add_subdirectory(music)
add_subdirectory(r3bdata)
add_subdirectory(field)
add_subdirectory(macros)
add_subdirectory(r3bgen)
add_subdirectory(lumon)
add_subdirectory(evtvis)
Expand All @@ -447,6 +443,7 @@ if(NOT MODULE)
add_subdirectory(analysis)
add_subdirectory(tracker_rene)
add_subdirectory(pdc)
add_subdirectory(califa)
add_subdirectory(rpc)
add_subdirectory(alpide)
add_subdirectory(mwpc)
Expand All @@ -470,6 +467,7 @@ if(NOT MODULE)
if(WITH_ASYEOS)
add_subdirectory(asyeos)
endif(WITH_ASYEOS)
add_subdirectory(macros)
endif(NOT MODULE)

# add_subdirectory(gconfig)
Expand Down
26 changes: 6 additions & 20 deletions califa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,12 @@ ${FAIRROOT_LIBRARY_DIR}

link_directories( ${LINK_DIRECTORIES})

set(SRCS
#Put here your sourcefiles
./sim/R3BCalifa.cxx
./sim/R3BCalifaDigitizer.cxx
./pars/R3BCalifaContFact.cxx
./pars/R3BCalifaGeometry.cxx
./pars/R3BCalifaMappingPar.cxx
./pars/R3BCalifaCrystalCalPar.cxx
./pars/R3BCalifaTotCalPar.cxx
./pars/R3BCalifaClusterPar.cxx
./pars/R3BCalifaCrystalPars4Sim.cxx
./calibration/R3BCalifaMapped2CrystalCalPar.cxx
./calibration/R3BCalifaCrystalCal2TotCalPar.cxx
./calibration/R3BCalifaMapped2CrystalCal.cxx
./calibration/R3BCalifaCrystalCal2Cluster.cxx
./calibration/R3BCalifaCrystalCal2CrystalCalPID.cxx
./online/R3BCalifaOnlineSpectra.cxx
./online/R3BCalifaJulichOnlineSpectra.cxx
./online/R3BCalifaDemoOnlineSpectra.cxx
./ana/R3BCalifaCrystalCalDataAnalysis.cxx
file(GLOB SRCS
./sim/*.cxx
./pars/*.cxx
./online/*.cxx
./calibration/*.cxx
./ana/*.cxx
)

# fill list of header files from list of source files
Expand Down
4 changes: 2 additions & 2 deletions califa/calibration/R3BCalifaCrystalCal2Cluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ R3BCalifaCrystalCal2Cluster::R3BCalifaCrystalCal2Cluster()
: FairTask("R3B CALIFA CrystalCal to Hit Finder")
, fCrystalCalData(NULL)
, fCalifaClusterData(NULL)
, fGeometryVersion(2021) // BARREL+iPhos
, fGeometryVersion(2021) // Half BARREL+iPhos
, fThreshold(0.) // no threshold
, fDRThreshold(15000) // in keV, for real data (15000 = 15MeV)
, fDeltaPolar(0.25)
Expand All @@ -52,7 +52,7 @@ R3BCalifaCrystalCal2Cluster::R3BCalifaCrystalCal2Cluster()
, fCalifaGeo(NULL)
, fNbCrystalsGammaRange(2432) // during 2019 it was 5000
, fOnline(kFALSE)
, fRand(0)
, fRand(kFALSE)
, fRandFile("")
{
SetSquareWindowAlg(fDeltaPolar, fDeltaAzimuthal);
Expand Down
14 changes: 9 additions & 5 deletions califa/pars/R3BCalifaGeometry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,24 @@ bool R3BCalifaGeometry::Init(Int_t version)
break;

case 2020:
// Full BARREL+iPhos version
geoPath += "califa_2020.geo.root";
// Half BARREL+ 6 IPHOS sectors
geoPath += "califa_v2019.11.geo.root";
fNumCrystals = 4864;
break;

case 2021:
// s455 Experiment: Half Barrel + Full IPHOS
geoPath += "califa_2021_s455.geo.root";
geoPath += "califa_v2021.3.geo.root";
fNumCrystals = 4864;
break;

default:
R3BLOG(error, "Unsupported geometry version: " << version);
return kFALSE;
// Full Barrel + Full IPHOS
geoPath += "califa_full.geo.root";
fNumCrystals = 4864;
R3BLOG(warn,
"Unsupported geometry version: " << version << ", so standard full configuration will be used.");
// return kFALSE;
}

if (gGeoManager && strcmp(gGeoManager->GetTopVolume()->GetName(), "cave") == 0)
Expand Down
6 changes: 2 additions & 4 deletions califa/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# or submit itself to any jurisdiction. #
##############################################################################

cmake_minimum_required(VERSION 3.0)

enable_testing()
set(PROJECT_TEST_NAME CalifaUnitTests)
set(GTEST_ROOT ${SIMPATH})
Expand All @@ -27,9 +25,9 @@ include_directories(
${BASE_INCLUDE_DIRECTORIES}
${R3BROOT_SOURCE_DIR}/r3bbase
${R3BROOT_SOURCE_DIR}/r3bdata
${R3BROOT_SOURCE_DIR}/r3bdata/alpideData
${R3BROOT_SOURCE_DIR}/califa
${R3BROOT_SOURCE_DIR}/r3bdata/califaData
${R3BROOT_SOURCE_DIR}/califa/sim
${R3BROOT_SOURCE_DIR}/califa/calibration
${R3BROOT_SOURCE_DIR}/califa/pars
)

Expand Down
8 changes: 7 additions & 1 deletion califa/test/testCalifaSimulation.C
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ void testCalifaSimulation(const int nbevents = 100)
run->AddModule(cave);

// Geometry: Califa
run->AddModule(new R3BCalifa("califa_full.geo.root", {0., 0., 0.}));
auto calsim = new R3BCalifa("califa_full.geo.root", {0., 0., 0.});
calsim->SelectGeometryVersion(0);
run->AddModule(calsim);

// Digitizer: Califa
auto califaDig = new R3BCalifaDigitizer();
run->AddTask(califaDig);

auto califaCal2Cluster = new R3BCalifaCrystalCal2Cluster();
califaCal2Cluster->SetCrystalThreshold(0.0001); // 100 keV
run->AddTask(califaCal2Cluster);

// Init
run->Init();
Expand Down
1 change: 1 addition & 0 deletions field/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ${BASE_INCLUDE_DIRECTORIES}

set(INCLUDE_DIRECTORIES
${R3BROOT_SOURCE_DIR}/field
${R3BROOT_SOURCE_DIR}/r3bbase
)

include_directories( ${INCLUDE_DIRECTORIES})
Expand Down
27 changes: 16 additions & 11 deletions field/R3BFieldCreator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,26 @@
******************************************************************************/

#include "R3BFieldCreator.h"

#include "R3BAladinFieldMap.h"
#include "R3BFieldConst.h"
#include "R3BGladFieldMap.h"
#include "R3BLogger.h"

#include "FairRunAna.h"
#include "FairRuntimeDb.h"

#include <iostream>

using std::cerr;
using std::cout;
using std::endl;

static R3BFieldCreator gR3BFieldCreator;

R3BFieldCreator::R3BFieldCreator()
: FairFieldFactory()
, fFieldPar(nullptr)
{
fCreator = this;
fFieldPar = 0;
}

R3BFieldCreator::~R3BFieldCreator() {}

void R3BFieldCreator::SetParm()
{
FairRunAna* Run = FairRunAna::Instance();
Expand All @@ -48,21 +45,29 @@ FairField* R3BFieldCreator::createFairField()

if (!fFieldPar)
{
cerr << "-E- No field parameters available!" << endl;
R3BLOG(error, "No field parameters available!");
}
else
{
// Instantiate correct field type
Int_t fType = fFieldPar->GetType();
if (fType == 0)
{
fMagneticField = new R3BFieldConst(fFieldPar);
}
else if (fType == 1)
{
fMagneticField = new R3BAladinFieldMap(fFieldPar);
}
else if (fType == 2)
{
fMagneticField = new R3BGladFieldMap(fFieldPar);
}
else
cerr << "-W- FairRunAna::GetField: Unknown field type " << fType << endl;
cout << "New field at " << fMagneticField << ", type " << fType << endl;
{
R3BLOG(error, "GetField: Unknown field type " << fType);
}
R3BLOG(info, "New field at " << fMagneticField << ", type " << fType);
// Initialise field
if (fMagneticField)
{
Expand All @@ -73,4 +78,4 @@ FairField* R3BFieldCreator::createFairField()
return fMagneticField;
}

ClassImp(R3BFieldCreator)
ClassImp(R3BFieldCreator);
Binary file added geometry/califa_full.geo.root
Binary file not shown.
2 changes: 1 addition & 1 deletion r3bbase/BaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
#pragma link C++ class R3BModule+;
#pragma link C++ class R3BDetector+;
#pragma link C++ class R3BEventHeader+;
#pragma link C++ class R3BEventHeaderPropagator+;
#pragma link C++ class R3BWhiterabbitPropagator+;
#pragma link C++ class R3BDataPropagator+;
#pragma link C++ class R3BFileSource+;
#pragma link C++ class R3BEventHeaderPropagator+;
#pragma link C++ class R3BLogger+;
#pragma link C++ class R3BTcutPar+;
#pragma link C++ class R3BTsplinePar+;
Expand Down
2 changes: 1 addition & 1 deletion r3bbase/R3BEventHeaderPropagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <Rtypes.h>

#include "R3BEventHeader.h"
#include "R3BFileSource.h"
class R3BFileSource;

class R3BEventHeaderPropagator : public FairTask
{
Expand Down
1 change: 0 additions & 1 deletion twim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ file(GLOB SRCS
./ana/*.cxx
)


# fill list of header files from list of source files
# by exchanging the file extension
CHANGE_FILE_EXTENSION(*.cxx *.h HEADERS "${SRCS}")
Expand Down

0 comments on commit de1bd47

Please sign in to comment.