LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  December 2016

HPS-SVN December 2016

Subject:

r4617 - in /java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster: ClusterEnergyCorrection.java ClusterRFTimeCorrDriver.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Fri, 9 Dec 2016 16:55:30 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (101 lines)

Author: [log in to unmask]
Date: Fri Dec  9 08:55:27 2016
New Revision: 4617

Log:
updated the energy mc smearing and rf time correction to avoid bug when cluster list has size 0

Modified:
    java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java
    java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterRFTimeCorrDriver.java

Modified: java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java
 =============================================================================
--- java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java	(original)
+++ java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterEnergyCorrection.java	Fri Dec  9 08:55:27 2016
@@ -25,9 +25,9 @@
     
     // Variables derived as the difference between data and mc noise in 
     // ecal cluster energy resolution.
-    static final double A = -0.0000981;
-    static final double B = 0.0013725;
-    static final double C = 0.00301;
+    static final double A = -0.00000981;
+    static final double B = 0.00013725;
+    static final double C = 0.000301;
     
     // Calculate the noise factor to smear the Ecal energy by
     private static double calcNoise(double energy){

Modified: java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterRFTimeCorrDriver.java
 =============================================================================
--- java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterRFTimeCorrDriver.java	(original)
+++ java/branches/branch-1116Fixes/ecal-recon/src/main/java/org/hps/recon/ecal/cluster/ClusterRFTimeCorrDriver.java	Fri Dec  9 08:55:27 2016
@@ -51,32 +51,34 @@
         double clT = parameter[0];
         double selectedClT = parameter[0];
         double rfT = parameter[0];
-        int seedX = 1;
-        int seedY = 1;
+        int seedX = 0;
+        int seedY = 0;
         int jj=0;
         //read in ecal clusters, choose the highest energy cluster in the trigger time window
         if (event.hasCollection(Cluster.class, "EcalClusters")){
-            while (foundTdiff==false){
-                jj++;
-            // Get the list of clusters in the event
+            // Get the list of clusters in the event   
             List<Cluster> cl = event.get(Cluster.class, "EcalClusters");
             // Sort the clusters as highest to lowest energy
             Comparator<Cluster> comparator = new ClusterUtilities.ClusterSeedComparator();            
-            ClusterUtilities.sort(cl,comparator, true,true);            
+            ClusterUtilities.sort(cl,comparator, true,true); 
+            int listSize = cl.size();   
+            while (foundTdiff==false){
+                if (listSize==0){break;}
+                //choose the highest seed energy cluster in the time window
+                for (Cluster cc : cl){
+                    clT = ClusterUtilities.getSeedHitTime(cc); 
+                    if (clT>parameter[1]-jj*10 && clT<parameter[2]+jj*10){
+                        foundTdiff = true;
+                        selectedClT = clT;
+                        seedX = ClusterUtilities.findSeedHit(cc).getIdentifierFieldValue("ix");
+                        seedY = ClusterUtilities.findSeedHit(cc).getIdentifierFieldValue("iy");
+                        break;
+                        }//end if
+                    }//end for
+                jj++;
+                }//end while
+        }//end if has clusters
         
-            //choose the highest seed energy cluster in the time window
-            for (Cluster cc : cl){
-                clT = ClusterUtilities.getSeedHitTime(cc);             
-                if (clT>parameter[1]-jj*10 && clT<parameter[2]+jj*10){
-                    foundTdiff = true;
-                    selectedClT = clT;
-                    seedX = ClusterUtilities.findSeedHit(cc).getIdentifierFieldValue("ix");
-                    seedY = ClusterUtilities.findSeedHit(cc).getIdentifierFieldValue("iy");
-                    break;
-                    }
-                }
-            }//end if cluster
-        }
         double jitter=0;
         //read in rf time
         if (event.hasCollection(GenericObject.class, "RFHits")) {
@@ -87,10 +89,8 @@
             jitter = ((rfT-selectedClT+400*2.004) % 2.004) - 1.002; 
             selectedClT-=jitter;
             }
-            
-        if (foundTdiff){
-            triggerTime.add(new TriggerTime(selectedClT, seedX,seedY));
-        }
+        
+        triggerTime.add(new TriggerTime(selectedClT, seedX,seedY));    
         event.put("TriggerTime", triggerTime, TriggerTime.class, 1);
         
     }//end process event

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use