Skip to content

Commit 3fae53a

Browse files
authored
Merge pull request #92 from hscheid/master
Cmake fixes for OSX
2 parents 9f220bd + c5820e2 commit 3fae53a

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
1616
include(FindPackageHandleStandardArgs)
1717
find_package(fmt REQUIRED)
1818
find_package(ROOT REQUIRED)
19-
find_package(Delphes REQUIRED)
2019
find_package(FairLogger REQUIRED)
2120
find_package(FairRoot REQUIRED)
2221
find_package(AliceO2 REQUIRED)
22+
find_package(Delphes REQUIRED)
2323

2424
include("${ROOT_DIR}/RootMacros.cmake")
2525

cmake/FindDelphes.cmake

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ find_path(Delphes_INCLUDE_DIR
99
PATH_SUFFIXES "include")
1010

1111
find_library(Delphes_LIBRARY
12-
NAMES libDelphes.so
12+
NAMES libDelphes.so libDelphes.dylib
1313
HINTS ${DELPHES_ROOT}/lib
1414
ENV LD_LIBRARY_PATH)
1515

@@ -31,6 +31,5 @@ if(${Delphes_FOUND})
3131
INTERFACE_LINK_LIBRARIES "${Delphes_LIBRARIES}"
3232
)
3333
endif()
34-
35-
endif()
3634

35+
endif()

cmake/FindHepMC.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ find_path(HepMC_INCLUDE_DIR
1616
set(HepMC_INCLUDE_DIR ${HepMC_INCLUDE_DIR}/..)
1717

1818
find_library(HepMC_LIBRARIES
19-
NAMES libHepMC.so libHepMCfio.
19+
NAMES libHepMC.so libHepMCfio.so libHepMC.dylib libHepMCfio.dylib
2020
PATHS $ENV{HEPMC_ROOT}/lib)
2121

2222
find_package_handle_standard_args(HepMC
2323
REQUIRED_VARS HepMC_INCLUDE_DIR HepMC_LIBRARIES
2424
FAIL_MESSAGE "HepMC could not be found")
25-

cmake/FindPythia.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ find_path(Pythia_INCLUDE_DIR
1414
PATHS $ENV{PYTHIA_ROOT}/include)
1515

1616
set(Pythia_INCLUDE_DIR ${Pythia_INCLUDE_DIR}/..)
17-
17+
1818
find_library(Pythia_LIBRARIES
1919
NAMES libpythia8.so libpythia8.dylib
2020
PATHS $ENV{PYTHIA_ROOT}/lib)
2121

2222
find_package_handle_standard_args(Pythia
2323
REQUIRED_VARS Pythia_INCLUDE_DIR Pythia_LIBRARIES
2424
FAIL_MESSAGE "Pythia could not be found")
25-

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ root_generate_dictionary(G__DelphesO2 ${HEADERS} LINKDEF DelphesO2LinkDef.h)
4646
target_link_libraries(DelphesO2
4747
Delphes::Core
4848
ROOT::MathCore
49+
ROOT::RIO
50+
ROOT::EG
4951
AliceO2::DetectorsVertexing
5052
AliceO2::ReconstructionDataFormats
5153
AliceO2::GPUCommon

src/TOFLayer.cc

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ TOFLayer::hasTOF(const Track &track)
2727
{
2828
auto x = track.XOuter * 0.1; // [cm]
2929
auto y = track.YOuter * 0.1; // [cm]
30-
auto z = track.ZOuter * 0.1; // [cm]
30+
auto z = track.ZOuter * 0.1; // [cm]
3131
if (mType == kBarrel) {
3232
auto r = hypot(x, y);
3333
return (fabs(r - mRadius) < 0.001 && fabs(z) < mLength);
3434
}
35-
if (mType = kForward) {
35+
if (mType == kForward) {
3636
auto r = hypot(x, y);
3737
return (r > mRadiusIn) && (r < mRadius) && (fabs(fabs(z) - mLength) < 0.001);
3838
}
@@ -56,7 +56,7 @@ void
5656
TOFLayer::makePID(const Track &track, std::array<float, 5> &deltat, std::array<float, 5> &nsigma)
5757
{
5858
double pmass[5] = {0.00051099891, 0.10565800, 0.13957000, 0.49367700, 0.93827200};
59-
59+
6060
/** get info **/
6161
double tof = track.TOuter * 1.e9; // [ns]
6262
double etof = track.ErrorT * 1.e9; // [ns]
@@ -71,7 +71,7 @@ TOFLayer::makePID(const Track &track, std::array<float, 5> &deltat, std::array<f
7171
for (Int_t ipart = 0; ipart < 5; ++ipart) {
7272
double mass2 = pmass[ipart] * pmass[ipart];
7373
double texp = Lc / p * TMath::Sqrt(mass2 + p2);
74-
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
74+
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
7575
double sigma = TMath::Sqrt(etexp * etexp + etof * etof);
7676
deltat[ipart] = tof - texp;
7777
nsigma[ipart] = deltat[ipart] / sigma;
@@ -92,7 +92,7 @@ TOFLayer::eventTime(std::vector<Track *> &tracks, std::array<float, 2> &tzero)
9292

9393
int pid = track->PID;
9494
double mass = TDatabasePDG::Instance()->GetParticle(pid)->Mass();
95-
double mass2 = mass * mass;
95+
double mass2 = mass * mass;
9696
double tof = track->TOuter * 1.e9; // [ns]
9797
double etof = track->ErrorT * 1.e9; // [ns]
9898
double L = track->L * 0.1; // [cm]
@@ -102,7 +102,7 @@ TOFLayer::eventTime(std::vector<Track *> &tracks, std::array<float, 2> &tzero)
102102
double c = 29.9792458; // [cm/ns]
103103
double Lc = L / c;
104104
double texp = Lc / p * TMath::Sqrt(mass2 + p2);
105-
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
105+
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
106106
double sigma = TMath::Sqrt(etexp * etexp + etof * etof);
107107
double deltat = tof - texp;
108108

@@ -143,14 +143,14 @@ TOFLayer::eventTime(std::vector<Track *> &tracks, std::array<float, 2> &tzero)
143143

144144
sum = 0.;
145145
sumw = 0.;
146-
146+
147147
for (int jtrack = 0; jtrack < tracks.size(); ++jtrack) {
148148
if (itrack == jtrack) continue; // do not use self
149-
149+
150150
auto &track = tracks[jtrack];
151151
int pid = track->PID;
152152
double mass = TDatabasePDG::Instance()->GetParticle(pid)->Mass();
153-
double mass2 = mass * mass;
153+
double mass2 = mass * mass;
154154
double tof = track->TOuter * 1.e9; // [ns]
155155
double etof = track->ErrorT * 1.e9; // [ns]
156156
double L = track->L * 0.1; // [cm]
@@ -160,7 +160,7 @@ TOFLayer::eventTime(std::vector<Track *> &tracks, std::array<float, 2> &tzero)
160160
double c = 29.9792458; // [cm/ns]
161161
double Lc = L / c;
162162
double texp = Lc / p * TMath::Sqrt(mass2 + p2);
163-
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
163+
double etexp = Lc * mass2 / p2 / TMath::Sqrt(mass2 + p2) * ep;
164164
double sigma = TMath::Sqrt(etexp * etexp + etof * etof);
165165
double deltat = tof - texp;
166166
double w = 1. / (sigma * sigma);
@@ -174,18 +174,18 @@ TOFLayer::eventTime(std::vector<Track *> &tracks, std::array<float, 2> &tzero)
174174
sigma0[itrack] = std::sqrt(1. / sumw);
175175

176176
}
177-
177+
178178
for (int itrack = 0; itrack < tracks.size(); ++itrack) {
179179
auto &track = tracks[itrack];
180180
track->TOuter -= time0[itrack] * 1.e-9; // [s]
181181
track->ErrorT = std::hypot(track->ErrorT, sigma0[itrack] * 1.e-9);
182182
}
183-
183+
184184
return true;
185185
}
186186

187187
/*****************************************************************/
188188

189-
189+
190190
} /** namespace delphes **/
191191
} /** namespace o2 **/

0 commit comments

Comments
 (0)