From 1ee8677d75b56cb8c48015efe5c8572b21cf7cf3 Mon Sep 17 00:00:00 2001 From: Vardan Tadevosyan <tadevosn@jlab.org> Date: Wed, 28 Aug 2013 10:16:36 -0400 Subject: [PATCH] Implemented the clustering debug flag (Mark). --- examples/hodtest_mkj.C | 3 +- src/THcShower.cxx | 67 +++++++++++++++++++++--------------------- src/THcShower.h | 2 ++ 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/examples/hodtest_mkj.C b/examples/hodtest_mkj.C index 64c47cd..732a4ac 100644 --- a/examples/hodtest_mkj.C +++ b/examples/hodtest_mkj.C @@ -7,7 +7,8 @@ void hodtest_mkj(Int_t RunNumber=50017, Int_t MaxEventToReplay=5000) { if (RunNumber == 50017) { char* RunFileNamePattern="daq04_%d.log.0"; } else { - char* RunFileNamePattern="/cache/mss/hallc/daq04/raw/daq04_%d.log.0"; + // char* RunFileNamePattern="/cache/mss/hallc/daq04/raw/daq04_%d.log.0"; + char* RunFileNamePattern="/scratch/tadevosn/daq04_%d.log.0"; } gHcParms->Define("gen_run_number", "Run Number", RunNumber); gHcParms->AddString("g_ctp_database_filename", "DBASE/test.database"); diff --git a/src/THcShower.cxx b/src/THcShower.cxx index 060d725..ec35eac 100644 --- a/src/THcShower.cxx +++ b/src/THcShower.cxx @@ -161,6 +161,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date ) {"cal_num_neg_columns", &fNegCols, kInt}, {"cal_slop", &fSlop, kDouble}, {"cal_fv_test", &fvTest, kDouble}, + {"dbg_clusters_cal", &fdbg_clusters_cal, kInt}, {0} }; gHcParms->LoadParmValues((DBRequest*)&list, prefix); @@ -169,6 +170,7 @@ Int_t THcShower::ReadDatabase( const TDatime& date ) cout << "Number of neg. columns = " << fNegCols << endl; cout << "Slop parameter = " << fSlop << endl; cout << "Fiducial volum test flag = " << fvTest << endl; + cout << "Cluster debug flag = " << fdbg_clusters_cal << endl; BlockThick = new Double_t [fNLayers]; fNBlocks = new Int_t [fNLayers]; @@ -524,6 +526,7 @@ Int_t THcShower::CoarseProcess( TClonesArray& ) //tracks // // static const Double_t sqrt2 = TMath::Sqrt(2.); + if (fdbg_clusters_cal) cout << "THcShower::CoarseProcess called ---------------------------" <<endl; // ApplyCorrections(); @@ -573,37 +576,43 @@ Int_t THcShower::CoarseProcess( TClonesArray& ) //tracks //Print out hits before clustering. // fNhits = HitList.size(); - cout << "Total hits: " << fNhits << endl; - for (UInt_t i=0; i!=fNhits; i++) { - cout << "unclustered hit " << i << ": "; - (*(HitList.begin()+i))->show(); + + if (fdbg_clusters_cal) { + cout << "Total hits: " << fNhits << endl; + for (UInt_t i=0; i!=fNhits; i++) { + cout << "unclustered hit " << i << ": "; + (*(HitList.begin()+i))->show(); + } } THcShowerClusterList* ClusterList = new THcShowerClusterList; ClusterList->ClusterHits(HitList); + fNclust = (*ClusterList).NbClusters(); + //Print out the cluster list. // - fNclust = (*ClusterList).NbClusters(); - cout << "Cluster_list size: " << fNclust << endl; + if (fdbg_clusters_cal) { + cout << "Cluster_list size: " << fNclust << endl; - for (UInt_t i=0; i!=fNclust; i++) { + for (UInt_t i=0; i!=fNclust; i++) { - THcShowerCluster* cluster = (*ClusterList).ListedCluster(i); + THcShowerCluster* cluster = (*ClusterList).ListedCluster(i); - cout << "Cluster #" << i - <<": E=" << (*cluster).clE() - << " Epr=" << (*cluster).clEpr() - << " X=" << (*cluster).clX() - << " Z=" << (*cluster).clZ() - << " size=" << (*cluster).clSize() - << endl; + cout << "Cluster #" << i + <<": E=" << (*cluster).clE() + << " Epr=" << (*cluster).clEpr() + << " X=" << (*cluster).clX() + << " Z=" << (*cluster).clZ() + << " size=" << (*cluster).clSize() + << endl; + + for (UInt_t j=0; j!=(*cluster).clSize(); j++) { + THcShowerHit* hit = (*cluster).ClusteredHit(j); + cout << " hit #" << j << ": "; (*hit).show(); + } - for (UInt_t j=0; j!=(*cluster).clSize(); j++) { - THcShowerHit* hit = (*cluster).ClusteredHit(j); - cout << " hit #" << j << ": "; (*hit).show(); } - } @@ -612,9 +621,6 @@ Int_t THcShower::CoarseProcess( TClonesArray& ) //tracks if (fNclust != 0) { - // THcShowerCluster* MaxCluster; - // for (UInt_t i=0; i!=fNclust; i++) { - THcShowerCluster* MaxCluster = (*ClusterList).ListedCluster(0); fE = (*MaxCluster).clE(); @@ -636,19 +642,12 @@ Int_t THcShower::CoarseProcess( TClonesArray& ) //tracks fX = (*MaxCluster).clX(); } - cout << fEpr << " " << fE << " " << fX << " PrSh" << endl; - - /* - cout << "Cluster #" << i - <<": E=" << (*cluster).clE() - << " Epr=" << (*cluster).clEpr() - << " X=" << (*cluster).clX() - << " Z=" << (*cluster).clZ() - << " size=" << (*cluster).clSize() - << endl; - */ - + if (fdbg_clusters_cal) + cout << fEpr << " " << fE << " " << fX << " PrSh" << endl; + + if (fdbg_clusters_cal) cout << "THcShower::CoarseProcess return ---------------------------" <<endl; + return 0; } diff --git a/src/THcShower.h b/src/THcShower.h index 88270bf..7a6700c 100644 --- a/src/THcShower.h +++ b/src/THcShower.h @@ -110,6 +110,8 @@ public: Double_t fSlop; // Track to cluster vertical slop distance. Int_t fvTest; // fiducial volume test flag for tracking + Int_t fdbg_clusters_cal; // Shower debug flag + THcShowerPlane** fPlanes; // [fNLayers] Shower Plane objects TClonesArray* fTrackProj; // projection of track onto plane -- GitLab