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

converMarlinSteeringToGaudi trips over processors with no parameters #222

Open
1 task done
dudarboh opened this issue Feb 18, 2025 · 5 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@dudarboh
Copy link

Check duplicate issues.

  • Checked for duplicates

Goal

Convert Marlin steering file with Marlin processors w/o any parameters to the runnable Gaudi option file w/o any hiccups.

Operating System and Version

ALMA9

compiler

doesn't matter

The version of the key4hep stack

nightlies

Package Version

nightlies

Reproducer

converMarlinSteeringToGaudi test.xml test.py

Input

<marlin>

    <constants>
    </constants>

    <execute>
        <processor name="MyCoolProcessor" />
        <processor name="MyCoolProcessor2" />
    </execute>

    <global>
        <parameter name="LCIOInputFiles">
            filename.slcio
        </parameter>
        <parameter name="MaxRecordNumber" value="0"/>
        <parameter name="SkipNEvents" value="0"/>
        <parameter name="SupressCheck" value="false"/>
        <parameter name="Verbosity" options="DEBUG0-4,MESSAGE0-4,WARNING0-4,ERROR0-4,SILENT"> MESSAGE </parameter>
        <parameter name="RandomSeed" value="1234567890" />
    </global>

    <processor name="MyCoolProcessor" type="CoolProcessor">
    </processor>

    <processor name="MyCoolProcessor2" type="CoolProcessor"/>

</marlin>

Output

from Gaudi.Configuration import *

from Configurables import LcioEvent, EventDataSvc, MarlinProcessorWrapper
from k4MarlinWrapper.parseConstants import *
algList = []
evtsvc = EventDataSvc()


CONSTANTS = {
}

parseConstants(CONSTANTS)

read = LcioEvent()
read.OutputLevel = INFO
read.Files = ["filename.slcio"]
algList.append(read)

MyCoolProcessor = MarlinProcessorWrapper("MyCoolProcessor")
MyCoolProcessor.ProcessorType = "CoolProcessor"
MyCoolProcessor.Parameters = 
                              }

MyCoolProcessor2 = MarlinProcessorWrapper("MyCoolProcessor2")
MyCoolProcessor2.ProcessorType = "CoolProcessor"
MyCoolProcessor2.Parameters = 
                               }

algList.append(MyCoolProcessor)
algList.append(MyCoolProcessor2)

from Configurables import ApplicationMgr
ApplicationMgr( TopAlg = algList,
                EvtSel = 'NONE',
                EvtMax   = 10,
                ExtSvc = [evtsvc],
                OutputLevel=INFO
              )

Additional context

The issue is easily fixable manually after the conversion by adding { to the parameters.

@dudarboh dudarboh added the bug Something isn't working label Feb 18, 2025
@tmadlener
Copy link
Contributor

Interesting that this happens. It's not obvious from the converter script where the Parameters = comes from:

lines.append("%s.Parameters = {" % proc.replace(".", "_"))

At least from this line the { should be there, but apparently isn't. We will have to check what is actually going on here.

@dudarboh
Copy link
Author

This line removes the {

@dudarboh
Copy link
Author

Maybe a separate minor issue but MaxRecordNumber is not propagated properly as well.
In the reproducible it is 0, i.e. all events, in the converted script it is 10

@tmadlener
Copy link
Contributor

In the reproducible it is 0, i.e. all events, in the converted script it is 10

Just as a side note: 0 events doesn't mean all events. It means 0 events. -1 is the token for all events.

@dudarboh
Copy link
Author

Well, in Marlin 0 events means all events, when converting to Gaudi it should become -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants