From 31e0c9685151dd10e2271a3d75f9a65c84fe441a Mon Sep 17 00:00:00 2001
From: Miguel Arratia <miguela@ucr.edu>
Date: Wed, 9 Jun 2021 22:39:15 +0000
Subject: [PATCH] for debug hcal_clustering.py with XY merger

---
 benchmarks/clustering/barrel_clusters.sh            | 4 ++--
 benchmarks/clustering/options/hcal_clustering.py    | 9 ++++++---
 benchmarks/clustering/scripts/gen_central_pions.cxx | 2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/benchmarks/clustering/barrel_clusters.sh b/benchmarks/clustering/barrel_clusters.sh
index dfa40e3d..28f92415 100644
--- a/benchmarks/clustering/barrel_clusters.sh
+++ b/benchmarks/clustering/barrel_clusters.sh
@@ -15,7 +15,7 @@ print_env.sh
 export JUGGLER_DETECTOR_PATH=${DETECTOR_PATH}
 
 if [[ ! -n  "${JUGGLER_N_EVENTS}" ]] ; then 
-  export JUGGLER_N_EVENTS=100
+  export JUGGLER_N_EVENTS=1
 fi
 
 if [[ ! -n "${CB_EMCAL_SAMP_FRAC}" ]] ; then
@@ -31,7 +31,7 @@ export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
 echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
 echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
 
-root -b -q "benchmarks/clustering/scripts/gen_central_electrons.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
+root -b -q "benchmarks/clustering/scripts/gen_central_pions.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
 
 ### run geant4 simulations
 npsim --runType batch \
diff --git a/benchmarks/clustering/options/hcal_clustering.py b/benchmarks/clustering/options/hcal_clustering.py
index 28df2ac6..986c976a 100644
--- a/benchmarks/clustering/options/hcal_clustering.py
+++ b/benchmarks/clustering/options/hcal_clustering.py
@@ -87,13 +87,16 @@ hcal_reco = HCalReconstruction("hcal_reco",
         OutputLevel=DEBUG)
 
 #clusters
-xymerger = CalorimeterHitsMerger("hcal_xy_merger",                             
+xymerger = CalorimeterHitsMerger("hcal_xy_merger",                            # 
           fields=["layer", "slice"],
+          fieldRefNumbers=[0,0],
           inputHitCollection="RecHcalBarrelHits",
-          outputHitCollection="RecHcalBarrelHitsXY")
+          outputHitCollection="RecHcalBarrelHitsXY",
+          OutputLevel=DEBUG)                       
+          
 
 hcal_barrel_cluster = IslandCluster("hcal_barrel_cluster", 
-        inputHitCollection="RecHcalBarrelHitsXY", 
+        inputHitCollection="RecHcalBarrelHits", 
         outputClusterCollection="HcalBarrelClusters",
         minClusterCenterEdep=30*units.MeV, 
         groupRange=2.0,
diff --git a/benchmarks/clustering/scripts/gen_central_pions.cxx b/benchmarks/clustering/scripts/gen_central_pions.cxx
index 80aa4fcb..897bb814 100644
--- a/benchmarks/clustering/scripts/gen_central_pions.cxx
+++ b/benchmarks/clustering/scripts/gen_central_pions.cxx
@@ -39,7 +39,7 @@ void gen_central_pions(int n_events = 100,
         FourVector(0.0, 0.0, 0.0, 0.938), 2212, 4);
 
     // Define momentum
-    Double_t p     = r1->Uniform(100.0, 100.1);
+    Double_t p     = r1->Uniform(20.0, 20.1);
     Double_t phi   = r1->Uniform(0.0, 0.25 * M_PI);
     Double_t costh = r1->Uniform(cos_theta_min, cos_theta_max);
     Double_t th    = std::acos(costh);
-- 
GitLab