Skip to content

Commit

Permalink
Merge pull request #224 from eic/221-generate-detectors-and-algorithm…
Browse files Browse the repository at this point in the history
…s-flags-in-usable-formats

221 generate detectors and algorithms flags in usable formats
  • Loading branch information
DraTeots authored Oct 16, 2022
2 parents f45c99f + c57030f commit 2c89d3a
Show file tree
Hide file tree
Showing 40 changed files with 2,367 additions and 393 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,5 @@ lib/

/tests
/build

src/tools/default_values_table/__pycache__/
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 CMake : ${JANA_DIR}")
message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 includes: ${JANA_INCLUDE_DIR}")
message(STATUS "${CMAKE_PROJECT_NAME}: JANA2 library : ${JANA_LIBRARY}")

# DD4Hep is required for the most of the part
find_package(DD4hep REQUIRED)

# Set it ON for additional CMake printout
set(EICRECON_VERBOSE_CMAKE OFF)
Expand Down
4 changes: 0 additions & 4 deletions src/benchmarks/reconstruction/tracking_efficiency/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ eicrecon
-PTracking:CentralTrackerSourceLinker:LogLevel=info
-PCKFTracking:Trajectories:LogLevel=info
-Ptracking_efficiency:LogLevel=debug
-Ppodio:output_include_collections="ReconstructedParticles,TrackParameters,MCParticles"
-Ppodio:output_file=/home/romanov/work/data/eicrecon_test/tracking_test_gun.edm4eic.root
-Pdd4hep:xml_files=/home/romanov/eic/soft/detector/main/compiled/epic/share/epic/epic_tracking_only.xml
-Phistsfile=/home/romanov/work/data/eicrecon_test/tracking_test_gun.ana.root
Expand Down Expand Up @@ -70,9 +69,6 @@ export DETECTOR="epic_tracking_only"
# This makes tracking output data and input MC particles to be written to the output
-Ppodio:output_include_collections="ReconstructedParticles,TrackParameters,MCParticles"

# This sets file path containing output tree
-Ppodio:output_file=/home/romanov/work/data/eicrecon_test/tracking_test_gun.edm4eic.root

# There is a centralized file where plugins can save their histograms:
-Phistsfile=/home/romanov/work/data/eicrecon_test/tracking_test_gun.ana.root

Expand Down
16 changes: 8 additions & 8 deletions src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelRecHits.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ class CalorimeterHit_factory_EcalBarrelRecHits : public JFactoryT<edm4eic::Calor
u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there)

// app->SetDefaultParameter("BEMC:tag", m_input_tag);
app->SetDefaultParameter("BEMC:capacityADC", m_capADC);
app->SetDefaultParameter("BEMC:dynamicRangeADC", m_dyRangeADC);
app->SetDefaultParameter("BEMC:pedestalMean", m_pedMeanADC);
app->SetDefaultParameter("BEMC:pedestalSigma", m_pedSigmaADC);
app->SetDefaultParameter("BEMC:resolutionTDC", m_resolutionTDC);
app->SetDefaultParameter("BEMC:thresholdFactor", m_thresholdFactor);
app->SetDefaultParameter("BEMC:thresholdValue", m_thresholdValue);
app->SetDefaultParameter("BEMC:samplingFraction", m_sampFrac);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:capacityADC", m_capADC);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:dynamicRangeADC", m_dyRangeADC);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:pedestalMean", m_pedMeanADC);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:pedestalSigma", m_pedSigmaADC);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:resolutionTDC", m_resolutionTDC);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:thresholdFactor", m_thresholdFactor);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:thresholdValue", m_thresholdValue);
app->SetDefaultParameter("BEMC:EcalBarrelRecHits:samplingFraction", m_sampFrac);
m_geoSvc = app->template GetService<JDD4hep_service>(); // TODO: implement named geometry service?

std::string tag=this->GetTag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ class ProtoCluster_factory_EcalBarrelIslandProtoClusters : public JFactoryT<edm4
u_dimScaledLocalDistXY={1.8,1.8};// from ATHENA reconstruction.py


app->SetDefaultParameter("BEMC:splitCluster", m_splitCluster);
app->SetDefaultParameter("BEMC:minClusterHitEdep", m_minClusterHitEdep);
app->SetDefaultParameter("BEMC:minClusterCenterEdep", m_minClusterCenterEdep);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:splitCluster", m_splitCluster);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:minClusterHitEdep", m_minClusterHitEdep);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:minClusterCenterEdep", m_minClusterCenterEdep);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:sectorDist", m_sectorDist);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:localDistXY", u_localDistXY);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:localDistXZ", u_localDistXZ);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:localDistYZ", u_localDistYZ);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:globalDistRPhi", u_globalDistRPhi);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:globalDistEtaPhi", u_globalDistEtaPhi);
app->SetDefaultParameter("BEMC:EcalBarrelIslandProtoClusters:dimScaledLocalDistXY", u_dimScaledLocalDistXY);
//app->SetDefaultParameter("BEMC:inputHitCollection", m_inputHitCollection);
//app->SetDefaultParameter("BEMC:outputProtoClusterCollection", m_outputProtoCollection);
app->SetDefaultParameter("BEMC:sectorDist", m_sectorDist);
app->SetDefaultParameter("BEMC:localDistXY", u_localDistXY);
app->SetDefaultParameter("BEMC:localDistXZ", u_localDistXZ);
app->SetDefaultParameter("BEMC:localDistYZ", u_localDistYZ);
app->SetDefaultParameter("BEMC:globalDistRPhi", u_globalDistRPhi);
app->SetDefaultParameter("BEMC:globalDistEtaPhi", u_globalDistEtaPhi);
app->SetDefaultParameter("BEMC:dimScaledLocalDistXY", u_dimScaledLocalDistXY);
m_geoSvc = app->template GetService<JDD4hep_service>();

std::string tag=this->GetTag();
Expand Down
24 changes: 12 additions & 12 deletions src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelRawHits.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ class RawCalorimeterHit_factory_EcalBarrelRawHits : public JFactoryT<edm4hep::Ra

// This is another option for exposing the data members as JANA configuration parameters.
// app->SetDefaultParameter("BEMC:tag", m_input_tag);
app->SetDefaultParameter("BEMC:energyResolutions",u_eRes);
app->SetDefaultParameter("BEMC:timeResolution", m_tRes);
app->SetDefaultParameter("BEMC:capacityADC", m_capADC);
app->SetDefaultParameter("BEMC:dynamicRangeADC", m_dyRangeADC);
app->SetDefaultParameter("BEMC:pedestalMean", m_pedMeanADC);
app->SetDefaultParameter("BEMC:pedestalSigma", m_pedSigmaADC);
app->SetDefaultParameter("BEMC:resolutionTDC", m_resolutionTDC);
app->SetDefaultParameter("BEMC:scaleResponse", m_corrMeanScale);
app->SetDefaultParameter("BEMC:signalSumFields", u_fields);
app->SetDefaultParameter("BEMC:fieldRefNumbers", u_refs);
app->SetDefaultParameter("BEMC:geoServiceName", m_geoSvcName);
app->SetDefaultParameter("BEMC:readoutClass", m_readout);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:energyResolutions",u_eRes);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:timeResolution", m_tRes);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:capacityADC", m_capADC);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:dynamicRangeADC", m_dyRangeADC);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:pedestalMean", m_pedMeanADC);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:pedestalSigma", m_pedSigmaADC);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:resolutionTDC", m_resolutionTDC);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:scaleResponse", m_corrMeanScale);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:signalSumFields", u_fields);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:fieldRefNumbers", u_refs);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:geoServiceName", m_geoSvcName);
app->SetDefaultParameter("BEMC:EcalBarrelRawHits:readoutClass", m_readout);

// Call Init for generic algorithm
std::string tag=this->GetTag();
Expand Down
24 changes: 12 additions & 12 deletions src/detectors/ZDC/ProtoCluster_factory_ZDCEcalIslandProtoClusters.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ class ProtoCluster_factory_ZDCEcalIslandProtoClusters : public JFactoryT<edm4eic
u_dimScaledLocalDistXY={50.0*dd4hep::mm, 50.0*dd4hep::mm};// from https://eicweb.phy.anl.gov/EIC/detectors/athena/-/blob/master/calibrations/ffi_zdc.json


app->SetDefaultParameter("ZDC:splitCluster", m_splitCluster);
app->SetDefaultParameter("ZDC:minClusterHitEdep", m_minClusterHitEdep);
app->SetDefaultParameter("ZDC:minClusterCenterEdep", m_minClusterCenterEdep);
//app->SetDefaultParameter("ZDC:inputHitCollection", m_inputHitCollection);
//app->SetDefaultParameter("ZDC:outputProtoClusterCollection", m_outputProtoCollection);
app->SetDefaultParameter("ZDC:sectorDist", m_sectorDist);
app->SetDefaultParameter("ZDC:localDistXY", u_localDistXY);
app->SetDefaultParameter("ZDC:localDistXZ", u_localDistXZ);
app->SetDefaultParameter("ZDC:localDistYZ", u_localDistYZ);
app->SetDefaultParameter("ZDC:globalDistRPhi", u_globalDistRPhi);
app->SetDefaultParameter("ZDC:globalDistEtaPhi", u_globalDistEtaPhi);
app->SetDefaultParameter("ZDC:dimScaledLocalDistXY", u_dimScaledLocalDistXY);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:splitCluster", m_splitCluster);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:minClusterHitEdep", m_minClusterHitEdep);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:minClusterCenterEdep", m_minClusterCenterEdep);
//app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:inputHitCollection", m_inputHitCollection);
//app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:outputProtoClusterCollection", m_outputProtoCollection);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:sectorDist", m_sectorDist);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:localDistXY", u_localDistXY);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:localDistXZ", u_localDistXZ);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:localDistYZ", u_localDistYZ);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:globalDistRPhi", u_globalDistRPhi);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:globalDistEtaPhi", u_globalDistEtaPhi);
app->SetDefaultParameter("ZDC:ZDCEcalIslandProtoClusters:dimScaledLocalDistXY", u_dimScaledLocalDistXY);
m_geoSvc = app->template GetService<JDD4hep_service>();

std::string tag=this->GetTag();
Expand Down
30 changes: 30 additions & 0 deletions src/examples/run_examples/full_flags_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
desc = """
This script is a simple demonstration of how to run eicrecon with available digitization/reconstruction flag
Currently this script is created manually (TODO automatic generation) so if flags here is outdated, please file an issue
python3 full_flags_run.py input_file.edm4hep.root output_name_no_ext
Script should successfully run and create files:
output_name_no_ext.edm4eic.root # with output flat tree
output_name_no_ext.ana.root # with histograms and other things filled by monitoring plugins
"""

import argparse

parser = argparse.ArgumentParser(description=desc)
parser.add_argument('input_file', help="Input file name")
parser.add_argument('output_base_name', help="Output files names (no file extensions here)")
args = parser.parse_args()

flags = [

]

# (!) NEXT WILL BE REPLACED BY TEMPLATE #
reco_parameters_flags = []




Loading

0 comments on commit 2c89d3a

Please sign in to comment.