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

Add implicit conversions in LCIO->EDM4hep #41

Merged
merged 2 commits into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ StatusCode Lcio2EDM4hepTool::convertCollections(
if (coll_type_str == "ReconstructedParticle") {
convertPut<edm4hep::ReconstructedParticleCollection>(
m_lcio2edm_params[i+1], m_lcio2edm_params[i], lcio_converter, id_table);
// Get associated collection. Name hardcoded in k4LCIOConverter
convertPut<edm4hep::ParticleIDCollection>(
"ParticleID_EXT", "ParticleID_EXT", lcio_converter, id_table);
convertPut<edm4hep::VertexCollection>(
"Vertex_EXT", "Vertex_EXT", lcio_converter, id_table);
} else if (coll_type_str == "ParticleID") {
convertPut<edm4hep::ParticleIDCollection>(
m_lcio2edm_params[i+1], m_lcio2edm_params[i], lcio_converter, id_table);
Expand All @@ -115,8 +120,7 @@ StatusCode Lcio2EDM4hepTool::convertCollections(
} else if (coll_type_str == "SimCalorimeterHit") {
convertPut<edm4hep::SimCalorimeterHitCollection>(
m_lcio2edm_params[i+1], m_lcio2edm_params[i], lcio_converter, id_table);
// Get associated collections
// This collection name is hardcoded in k4LCIOConverter
// Get associated collection. Name hardcoded in k4LCIOConverter
convertPut<edm4hep::CaloHitContributionCollection>(
"CaloHitContribution_EXT", "CaloHitContribution_EXT", lcio_converter, id_table);
} else if (coll_type_str == "RawCalorimeterHit") {
Expand All @@ -128,6 +132,9 @@ StatusCode Lcio2EDM4hepTool::convertCollections(
} else if (coll_type_str == "Cluster") {
convertPut<edm4hep::ClusterCollection>(
m_lcio2edm_params[i+1], m_lcio2edm_params[i], lcio_converter, id_table);
// Get associated collection. Name hardcoded in k4LCIOConverter
convertPut<edm4hep::ParticleIDCollection>(
"ParticleID_EXT", "ParticleID_EXT", lcio_converter, id_table);
} else {
error() << coll_type_str << ": conversion type not supported." << endmsg;
}
Expand Down
6 changes: 3 additions & 3 deletions test/gaudi_opts/test_k4MarlinWrapper1.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os

from Gaudi.Configuration import *

Expand Down Expand Up @@ -35,9 +36,8 @@
proc1 = MarlinProcessorWrapper("InitDD4hep")
proc1.OutputLevel = DEBUG
proc1.ProcessorType = "InitializeDD4hep"
proc1.Parameters = {#"EncodingStringParameter", "GlobalTrackerReadoutID", END_TAG,
#"DD4hepXMLFile", "/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc62-opt/lcgeo/HEAD/CLIC/compact/CLIC_o3_v13/CLIC_o3_v13.xml", END_TAG,
"DD4hepXMLFile": ["/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc62-opt/lcgeo/HEAD/CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml"],
proc1.Parameters = {#"EncodingStringParameter": ["GlobalTrackerReadoutID"],
"DD4hepXMLFile": [os.path.join(os.environ.get('LCGEO'), 'CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml')]
}
algList.append(proc1)

Expand Down
4 changes: 2 additions & 2 deletions test/gaudi_opts/test_k4MarlinWrapper2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os

from Gaudi.Configuration import *

Expand Down Expand Up @@ -36,8 +37,7 @@
proc1.OutputLevel = DEBUG
proc1.ProcessorType = "InitializeDD4hep"
proc1.Parameters = {#"EncodingStringParameter": ["GlobalTrackerReadoutID"],
#"DD4hepXMLFile": ["/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc62-opt/lcgeo/HEAD/CLIC/compact/CLIC_o3_v13/CLIC_o3_v13.xml"],
"DD4hepXMLFile": ["/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc62-opt/lcgeo/HEAD/CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml"],
"DD4hepXMLFile": [os.path.join(os.environ.get('LCGEO'), 'CLIC/compact/CLIC_o2_v04/CLIC_o2_v04.xml')]
}
algList.append(proc1)

Expand Down
2 changes: 1 addition & 1 deletion test/inputFiles/testConverterConstants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<constants>
<constant name="DetectorModel" value="CLIC_o2_v04" />
<constant name="MyCompact" value="compact" />
<constant name="DD4hepXMLFile_subPath" value="/cvmfs/clicdp.cern.ch/iLCSoft/builds/nightly/x86_64-slc6-gcc62-opt/lcgeo/HEAD/CLIC/${MyCompact}/${DetectorModel}/${DetectorModel}.xml" />
<constant name="DD4hepXMLFile_subPath" value="/cvmfs/sw.hsf.org/spackages/linux-centos7-x86_64/gcc-8.3.0/lcgeo-0.16.6-vbidketl5esynx6pmkrdnqrnfyf3m2vf/share/lcgeo/compact/CLIC/${MyCompact}/${DetectorModel}/${DetectorModel}.xml" />
<constant name="MyResTest">0.003</constant>
<constant name="MyResTest2">003</constant>
<constant name="MyResTest3">0.</constant>
Expand Down