Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always convert EventHeader to lcio #162

Merged
merged 7 commits into from
Dec 5, 2023
Merged

Conversation

Zehvogel
Copy link
Contributor

BEGINRELEASENOTES

  • Modified the edm4hep to lcio converter to always convert theEventHeader to have event number etc. available in lcio.

ENDRELEASENOTES

Does anyone have a good idea for a test?

Resolves: #153

@Zehvogel
Copy link
Contributor Author

Unfortunately, I cannot reproduce the ci failure locally, for me all tests pass :/

@tmadlener
Copy link
Contributor

Is the EventHeader missing from here?

podioInput.collections = ["MCParticles"]

@Zehvogel
Copy link
Contributor Author

Is the EventHeader missing from here?

podioInput.collections = ["MCParticles"]

I guess so, lets see. Still puzzled why I don't get an error locally :D

@tmadlener
Copy link
Contributor

Maybe the better solution in this case would be to make sure that the PodioInput also reads the EventHeader collection?

@Zehvogel
Copy link
Contributor Author

hmpf yes I found why it does not error locally for me... the tests also need the install beforehand so if I click on run tests in my editor like a lazy person they run against the k4marlinwrapper from the environment e.g. nightlies

@Zehvogel
Copy link
Contributor Author

Maybe the better solution in this case would be to make sure that the PodioInput also reads the EventHeader collection?

I agree

@Zehvogel
Copy link
Contributor Author

Zehvogel commented Nov 14, 2023

Waiting for

@@ -38,7 +38,7 @@
)

podioInput = PodioInput("InputReader")
podioInput.collections = ["MCParticles"]
podioInput.collections = ["MCParticles", "EventHeader"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the EventHeader after merging key4hep/k4FWCore#160 ? If no, then I think we should remove it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be able to remove it and that was my plan for today :)

@tmadlener
Copy link
Contributor

It seems we still need it: https://github.com/key4hep/k4MarlinWrapper/actions/runs/6887433198/job/18734625662?pr=162#step:6:2428

I am not entirely sure why though, we pick up the latest version of k4FWCore.

@Zehvogel
Copy link
Contributor Author

Zehvogel commented Nov 16, 2023

I think I know why, I thought I tested it but as we set the collections to read after calling the constructor we just overwrite the list that has the EventHeaderName in it :(

@Zehvogel
Copy link
Contributor Author

so appending the collections works, not sure if this is really an improvement :/

@Zehvogel
Copy link
Contributor Author

I changed the steering files for the tests back again as key4hep/k4FWCore#161 made the change unnecessary.

@Zehvogel Zehvogel requested a review from tmadlener November 30, 2023 12:14
Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still like to have tests for this, but the "simplest" I can think of is to write a Marlin processor that we then run wrapped and check whether the contents of the EventHeader are as expected (first filling them with the EventHeaderCreator algorithm). The processor is almost trivial, but it introduces quite a bit of boiler plate...

@Zehvogel
Copy link
Contributor Author

anajob will print the real event numbers, so we could write out the lcio file and use a bit of ugly bash :D

        cout << "///////////////////////////////////" << endl;
        cout << "EVENT: " << evt->getEventNumber() << endl
            << "RUN: " << evt->getRunNumber() << endl
            << "DETECTOR: " << evt->getDetectorName() << endl
            << "COLLECTIONS: (see below)" << endl;
        cout << "///////////////////////////////////" << endl << endl;

@tmadlener
Copy link
Contributor

Ah yes, we could do something like

eventHeaderCreator = EventHeaderCreator("eventHeaderCreator", runNumber = 42)

output = MarlinProcessorWrapper("output")
output.ProcessorType = "LCIOOutputProcessor"
output.Parameters({"LCIOOutputFile": ["output.slcio"]})

(plus the usual gaudi boiler plate) and then run this for one event and do anajob output.slcio | grep "EVENT: 42" and fail if that fails.

@Zehvogel Zehvogel force-pushed the event-header branch 2 times, most recently from 76ec6e7 to d35fee9 Compare November 30, 2023 14:39
test/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@tmadlener tmadlener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thanks.

@tmadlener tmadlener enabled auto-merge (squash) December 1, 2023 07:42
test/CMakeLists.txt Outdated Show resolved Hide resolved
auto-merge was automatically disabled December 1, 2023 09:29

Head branch was pushed to by a user without write access

@Zehvogel
Copy link
Contributor Author

Zehvogel commented Dec 1, 2023

@jmcarcell looks like the doctests are failing because jupytext is now missing from the stack?

@tmadlener
Copy link
Contributor

Yeah, see key4hep/key4hep-spack#547

@tmadlener
Copy link
Contributor

As discussed today during the EDM4hep meeting we merge this now without the doctests until we have figured out how to address them properly.

@tmadlener tmadlener merged commit cacee63 into key4hep:main Dec 5, 2023
5 of 7 checks passed
jmcarcell added a commit that referenced this pull request Jan 8, 2024
… previous commit: Always convert EventHeader to lcio (#162)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always convert EventHeader collection
2 participants