Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
slic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SLIC_software
slic
Commits
cd0c75de
Commit
cd0c75de
authored
8 years ago
by
JeremyMcCormick
Browse files
Options
Downloads
Patches
Plain Diff
add LCIO compatibility preprocessor macros
parent
8053420f
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CMakeLists.txt
+22
-0
22 additions, 0 deletions
CMakeLists.txt
include/StdHepGenerator.hh
+13
-0
13 additions, 0 deletions
include/StdHepGenerator.hh
src/StdHepGenerator.cc
+4
-1
4 additions, 1 deletion
src/StdHepGenerator.cc
src/TrackSummary.cc
+2
-0
2 additions, 0 deletions
src/TrackSummary.cc
with
41 additions
and
1 deletion
CMakeLists.txt
+
22
−
0
View file @
cd0c75de
...
...
@@ -102,6 +102,28 @@ ELSE()
# include directories
INCLUDE_DIRECTORIES
(
${
XERCES_INCLUDE_DIR
}
${
LCIO_INCLUDE_DIRS
}
${
Geant4_INCLUDE_DIRS
}
${
GDML_INCLUDE_DIR
}
${
LCDD_INCLUDE_DIR
}
${
HEPPDT_INCLUDE_DIR
}
)
# check for LCStdHepRdrNew class in LCIO
IF
(
EXISTS
"
${
LCIO_INCLUDE_DIRS
}
/UTIL/LCStdHepRdrNew.h"
)
ADD_DEFINITIONS
(
-DHAVE_STDHEPRDRNEW_H
)
ENDIF
()
# check if MCParticle implementation has endpoint momentum
SET
(
CMAKE_REQUIRED_INCLUDES
${
LCIO_INCLUDE_DIRS
}
)
INCLUDE
(
CheckCXXSourceCompiles
)
CHECK_CXX_SOURCE_COMPILES
(
"
#include
\"
EVENT/MCParticle.h
\"
int main() {
EVENT::MCParticle* p;
p->getMomentumAtEndpoint();
return 0;
}
"
MCPARTICLE_HAS_MOMENTUMATENDPOINT
)
IF
(
MCPARTICLE_HAS_MOMENTUMATENDPOINT
)
ADD_DEFINITIONS
(
-DMCPARTICLE_HAS_MOMENTUMATENDPOINT
)
ENDIF
()
# libraries
TARGET_LINK_LIBRARIES
(
slic
${
XERCES_LIBRARY
}
${
Geant4_LIBRARIES
}
${
GDML_LIBRARY
}
${
LCDD_LIBRARY
}
${
HEPPDT_LIBRARIES
}
${
LCIO_LIBRARIES
}
slicPlugins
)
...
...
This diff is collapsed.
Click to expand it.
include/StdHepGenerator.hh
+
13
−
0
View file @
cd0c75de
...
...
@@ -5,7 +5,11 @@
#include
"MCParticleManager.hh"
// LCIO
#if HAVE_LCSTDHEPRDRNEW_H
#include
"UTIL/LCStdHepRdrNew.h"
#else
#include
"UTIL/LCStdHepRdr.h"
#endif
#include
"EVENT/MCParticle.h"
#include
"IMPL/LCCollectionVec.h"
...
...
@@ -16,7 +20,12 @@
// STL
#include
<set>
#if HAVE_LCSTDHEPRDRNEW_H
using
UTIL
::
LCStdHepRdrNew
;
#else
using
UTIL
::
LCStdHepRdr
;
#endif
using
EVENT
::
MCParticle
;
using
EVENT
::
LCCollection
;
using
IMPL
::
LCCollectionVec
;
...
...
@@ -60,7 +69,11 @@ public:
LCCollectionVec
*
getCurrentParticleCollection
();
private:
#if HAVE_LCSTDHEPRDRNEW_H
LCStdHepRdrNew
*
_reader
;
#else
LCStdHepRdr
*
_reader
;
#endif
LCCollectionVec
*
_particles
;
};
...
...
This diff is collapsed.
Click to expand it.
src/StdHepGenerator.cc
+
4
−
1
View file @
cd0c75de
...
...
@@ -9,7 +9,6 @@
// Geant4
#include
"G4SystemOfUnits.hh"
using
UTIL
::
LCStdHepRdrNew
;
using
EVENT
::
MCParticle
;
using
EVENT
::
LCCollection
;
using
IMPL
::
MCParticleImpl
;
...
...
@@ -18,7 +17,11 @@ namespace slic {
StdHepGenerator
::
StdHepGenerator
(
G4String
eventFile
)
:
_particles
(
0
)
{
#if HAVE_LCSTDHEPRDRNEW_H
_reader
=
new
LCStdHepRdrNew
(
eventFile
.
data
());
#else
_reader
=
new
LCStdHepRdr
(
eventFile
.
data
());
#endif
}
StdHepGenerator
::~
StdHepGenerator
()
{
...
...
This diff is collapsed.
Click to expand it.
src/TrackSummary.cc
+
2
−
0
View file @
cd0c75de
...
...
@@ -227,11 +227,13 @@ void TrackSummary::buildMCParticle() {
_mcparticle
->
setTime
(
_globalTime
);
/* Set momentum at endpoint. */
#ifdef MCPARTICLE_HAS_MOMENTUMATENDPOINT
float
momentumAtEndpoint
[
3
];
momentumAtEndpoint
[
0
]
=
_momentumAtEndpoint
(
0
)
/
GeV
;
momentumAtEndpoint
[
1
]
=
_momentumAtEndpoint
(
1
)
/
GeV
;
momentumAtEndpoint
[
2
]
=
_momentumAtEndpoint
(
2
)
/
GeV
;
_mcparticle
->
setMomentumAtEndpoint
(
momentumAtEndpoint
);
#endif
/* Set up to date. */
_mcParticleIsUpToDate
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment