-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a small downstream project for testing
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
project(DownstreamProjectUsingLCIO) | ||
|
||
find_package(LCIO REQUIRED) | ||
|
||
# Make sure that the LCIO version is set and usableas a version | ||
if (${LCIO_VERSION} VERSION_GREATER "0.0.0") | ||
message(STATUS "Found LCIO version " ${LCIO_VERSION}) | ||
else() | ||
message(FATAL_ERROR "Cannot determine LCIO_VERSION") | ||
endif() | ||
|
||
add_executable(lcio_test_program lcio_test_program.cpp) | ||
target_link_libraries(lcio_test_program PRIVATE LCIO::lcio) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "EVENT/LCEvent.h" | ||
#include "IMPL/LCCollectionVec.h" | ||
#include "IMPL/LCEventImpl.h" | ||
#include "IMPL/MCParticleImpl.h" | ||
#include "MT/LCWriter.h" | ||
|
||
int main() { | ||
auto mcp = new IMPL::MCParticleImpl(); | ||
mcp->setPDG(11); | ||
|
||
auto coll = new IMPL::LCCollectionVec(EVENT::LCIO::MCPARTICLE); | ||
coll->addElement(mcp); | ||
|
||
auto event = new IMPL::LCEventImpl(); | ||
event->addCollection(coll, "mcps"); | ||
|
||
auto writer = MT::LCWriter(); | ||
writer.open("test.slcio"); | ||
writer.writeEvent(event); | ||
|
||
return 0; | ||
} |