Commit in lcsim/src/org/lcsim/recon/pfa/structural on MAIN
TrackMipClusterDriver.java+32-351.2 -> 1.3
NonTrivialPFA.java+53-461.4 -> 1.5
ExampleGenerateLikelihood.java+3-11.1 -> 1.2
+88-82
3 modified files
Compatability with sidloi3 updates

lcsim/src/org/lcsim/recon/pfa/structural
TrackMipClusterDriver.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- TrackMipClusterDriver.java	15 Sep 2009 23:23:21 -0000	1.2
+++ TrackMipClusterDriver.java	7 May 2010 19:04:55 -0000	1.3
@@ -19,13 +19,16 @@
 import org.lcsim.event.Track;
 import org.lcsim.geometry.Detector;
 import org.lcsim.geometry.IDDecoder;
-import org.lcsim.geometry.subdetector.CylindricalCalorimeter;
 import org.lcsim.recon.cluster.util.BasicCluster;
 import org.lcsim.spacegeom.SpacePoint;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.util.hitmap.HitMap;
 import org.lcsim.util.swim.HelixSwimmer;
+import org.lcsim.geometry.compact.Subdetector;
+import org.lcsim.geometry.subdetector.*;
+import org.lcsim.recon.util.CalorimeterInformation;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
 
 public class TrackMipClusterDriver extends Driver
 {
@@ -41,24 +44,12 @@
    private  int _numbhadlayers;
    private int _numechadlayers;
 //    The EM calorimeter hits, by layer in barrel, endcap
-   private List[] _emBLayerHits;
-   private List[] _emECLayerHits;
-//    The HAD calorimeter hits, by layer in barrel, endcap
-   private List[] _hadBLayerHits;
-   private List[] _hadECLayerHits;
-//    The radii of the barrel calorimeter layers
-   private double[] _emBRadii;
-   private double[] _hadBRadii;
    private double[] BRadii = new double[100];
    private double[] ECZs = new double[100];
 //    modified Barrel helix swimmer for org.lcsim test
 //   private Helix[] _emBSwimmers; //EM
 //   private Helix[] _hadBSwimmers; //HAD
 //   Z extent of the central barrel calorimeters.
-   private double _embZ; //EM Barrel Z
-   private double[] _emecZ; //EM Endcap Z
-   private double _hadbZ; //HAD barrel z
-   private double[] _hadecZ; // HAD endcap z
    private double _dminE;
    private double _dminH;
    private double _dminTrC;
@@ -70,6 +61,7 @@
 //   private SpacePoint trackspacept;
    private double zField;
 //   private String[] _hitmapnames;
+   private CalorimeterInformation ci;
    
    public TrackMipClusterDriver(double dminE, double dminH, double dminTrC, double mincd)
    {
@@ -81,6 +73,7 @@
    
     protected void process(EventHeader event)
     {
+        if(ci == null)ci = CalorimeterInformation.instance();
         super.process(event);  // executes all added drivers
         
 //      Initialize things here
@@ -96,41 +89,45 @@
 //            System.out.println("B Field " + zField + " Tesla");
             
             //  Setup layer counts and distances for barrel, endcap
-            CylindricalCalorimeter emb = ((CylindricalCalorimeter) det.getSubdetectors().get("EMBarrel"));
-            _embZ = emb.getZMin();
-            _numbemlayers = emb.getLayering().getLayerCount();
-//            System.out.println("EM Barrel Layers " +_numbemlayers);
+            _numbemlayers = ci.getNLayers(CalorimeterType.EM_BARREL);
+            _numbhadlayers = ci.getNLayers(CalorimeterType.HAD_BARREL);
+            _numecemlayers = ci.getNLayers(CalorimeterType.EM_ENDCAP);
+            _numechadlayers = ci.getNLayers(CalorimeterType.HAD_ENDCAP);
+            Subdetector s = ci.getSubdetector(CalorimeterType.EM_BARREL);
+            double ebr0 = ci.getRMin(CalorimeterType.EM_BARREL);
+            if(s instanceof CylindricalBarrelCalorimeter)
+            {
+                ebr0 = 0.;
+            }
             for (int i=0; i<_numbemlayers; ++i)
             {
-                BRadii[i]=emb.getLayering().getDistanceToLayerSensorMid(i);
+                BRadii[i]= ebr0 + s.getLayering().getDistanceToLayerSensorMid(i);
 //                System.out.println("EM Barrel Layer Number " +i+ " EM Barrel Radius " + BRadii[i]);
             }
             
-            CylindricalCalorimeter emec = ((CylindricalCalorimeter) det.getSubdetectors().get("EMEndcap"));
-            _numecemlayers = emec.getLayering().getLayerCount();
-//            System.out.println("EM EC Layers " +_numecemlayers);
+            s = ci.getSubdetector(CalorimeterType.EM_ENDCAP);
             for (int i=0; i<_numecemlayers; ++i)
             {
-                ECZs[i] = emec.getLayering().getDistanceToLayerSensorMid(i);
+                ECZs[i] = s.getLayering().getDistanceToLayerSensorMid(i);
 //                System.out.println("EM Endcap Layer Number " +i+ " EM Endcap Z " +_emecZ[i]);
             }
 
-            CylindricalCalorimeter hadb = ((CylindricalCalorimeter) det.getSubdetectors().get("HADBarrel"));       
-            _hadbZ = hadb.getZMin();
-            _numbhadlayers = hadb.getLayering().getLayerCount();
-//            System.out.println("HAD Barrel Layers " +_numbhadlayers);   
+            s = ci.getSubdetector(CalorimeterType.HAD_BARREL);
+            ebr0 = ci.getRMin(CalorimeterType.HAD_BARREL);
+            if(s instanceof CylindricalBarrelCalorimeter)
+            {
+                ebr0 = 0.;
+            }
             for (int i=0; i<_numbhadlayers; ++i)
             {
-                BRadii[i+_numbemlayers]=hadb.getLayering().getDistanceToLayerSensorMid(i);
+                BRadii[i+_numbemlayers]= ebr0 + s.getLayering().getDistanceToLayerSensorMid(i);
 //                System.out.println("HAD Barrel Layer Number " +i+ " HAD Barrel Radius " + BRadii[i+_numbemlayers]);
             }
             
-            CylindricalCalorimeter hadec = ((CylindricalCalorimeter) det.getSubdetectors().get("HADEndcap"));       
-            _numechadlayers = hadec.getLayering().getLayerCount();
-//            System.out.println("HAD Endcap Layers " +_numechadlayers); 
+            s = ci.getSubdetector(CalorimeterType.HAD_ENDCAP);
             for (int i=0; i<_numechadlayers; ++i)
             {
-                ECZs[i+_numecemlayers] = hadec.getLayering().getDistanceToLayerSensorMid(i);
+                ECZs[i+_numecemlayers] = s.getLayering().getDistanceToLayerSensorMid(i);
 //                System.out.println("HAD Endcap Layer Number " +i+ " HAD Endcap Z " +_hadecZ[i]);
             }
         
@@ -161,7 +158,7 @@
             List<CalorimeterHit> chits = event.get(CalorimeterHit.class,_hitcollnames[i]);
             IDDecoder caldecoder = (IDDecoder) event.getMetaData(chits).getIDDecoder();                  
 //            System.out.println("Collection is " +_hitcollnames[i]);
-            if (_hitcollnames[i] == "EcalBarrDigiHits")
+            if (_hitcollnames[i] == ci.getDigiCollectionName(CalorimeterType.EM_BARREL))
             {
                 for (CalorimeterHit chit : chits)
                 {
@@ -182,7 +179,7 @@
                     nhitsEMB++;
                     nhitsBTotCAL++;
                 }
-            } else if (_hitcollnames[i] == "HcalBarrDigiHits")
+            } else if (_hitcollnames[i] == ci.getDigiCollectionName(CalorimeterType.HAD_BARREL))
             {
                 for (CalorimeterHit chit : chits)
                 {
@@ -203,7 +200,7 @@
                     nhitsHADB++;
                     nhitsBTotCAL++;
                 }
-            } else if (_hitcollnames[i] == "EcalEndcapDigiHits")
+            } else if (_hitcollnames[i] == ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP))
             {
                 for (CalorimeterHit chit : chits)
                 {
@@ -224,7 +221,7 @@
                     nhitsEMEC++;
                     nhitsECTotCAL++;
                 }
-            } else if (_hitcollnames[i] == "HcalEndcapDigiHits")
+            } else if (_hitcollnames[i] == ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP))
             {
                 for (CalorimeterHit chit : chits)
                 {

lcsim/src/org/lcsim/recon/pfa/structural
NonTrivialPFA.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- NonTrivialPFA.java	12 Dec 2008 21:49:52 -0000	1.4
+++ NonTrivialPFA.java	7 May 2010 19:04:55 -0000	1.5
@@ -1,7 +1,6 @@
 package org.lcsim.recon.pfa.structural;
 
 import java.util.*; 
-import hep.physics.vec.*;
 
 import org.lcsim.util.*;
 import org.lcsim.util.decision.*;
@@ -9,7 +8,6 @@
 import org.lcsim.mc.fast.tracking.MCFastTracking;
 import org.lcsim.event.*;
 import org.lcsim.event.util.*;
-import org.lcsim.event.base.*;
 import org.lcsim.digisim.DigiSimDriver;
 import org.lcsim.digisim.SimCalorimeterHitsDriver;
 import org.lcsim.recon.pfa.cheat.PerfectIdentifier;
@@ -21,15 +19,17 @@
 import org.lcsim.recon.cluster.structural.*;
 import org.lcsim.recon.cluster.structural.likelihood.*;
 import org.lcsim.recon.cluster.util.*;
-import org.lcsim.recon.cluster.analysis.*;
 import org.lcsim.recon.cluster.cheat.PerfectClusterer;
+import org.lcsim.recon.util.CalorimeterInformation;
+import org.lcsim.geometry.Calorimeter.CalorimeterType;
+
 
 /**
  * A Particle Flow Algorithm. Produces output in the form of
  * a List<ReconstructedParticle>, written to the event as
  * PFAReconstructedParticles.
  *
- * @version $Id: NonTrivialPFA.java,v 1.4 2008/12/12 21:49:52 jeremy Exp $
+ * @version $Id: NonTrivialPFA.java,v 1.5 2010/05/07 19:04:55 cassell Exp $
  * @author Mat Charles <[log in to unmask]>
  */
 
@@ -41,7 +41,7 @@
     public NonTrivialPFA() {
 	this(false);
     }
-
+    CalorimeterInformation ci;
     boolean m_useOldCalibration = false;
     boolean m_writeLikelihood = false;
     String m_writeLikelihoodFilename = "likelihood.bin";
@@ -56,29 +56,34 @@
 	    System.out.println("NonTrivialPFA called in regular reconstruction mode.");
 	}
 	
+	// Calibration
+	// -----------
+
+	// Run DigiSim
+	// -----------
+
+	{
+	    // CalHitMapDriver is needed by DigiSim
+	    add(new CalHitMapDriver());
+	    // DigiSim: SimCalHits -> RawCalHits
+	    DigiSimDriver digi = new org.lcsim.digisim.DigiSimDriver();
+	    add(digi);
+	    // RawCalHits -> SimCalorimeterHits
+	    add( new SimCalorimeterHitsDriver() );
+	}
+
+    }
+
+    public void process(EventHeader event) {
+        if(ci == null)
+        {
+            ci = CalorimeterInformation.instance();
 	// Book-keeping
 	// ------------
 
 	HitBookKeeper accountant = new HitBookKeeper();
 	accountant.setDebug(false);
 
-	// Calibration
-	// -----------
-
-	// Ron's calibrations
-	ClusterEnergyCalculator ronPhotonCalib = null;	
-	ClusterEnergyCalculator ronNeutralHadronCalib = null;
-	ClusterEnergyCalculator ronChargedHadronCalib = null;
-	if (m_useOldCalibration) {
-	    ronPhotonCalib = new PhotonClusterEnergyCalculator();
-	    ronNeutralHadronCalib = new DetailedNeutralHadronClusterEnergyCalculator();
-	    ronChargedHadronCalib = new DetailedNeutralHadronClusterEnergyCalculator();
-	} else {
-	    ronPhotonCalib = new QPhotonClusterEnergyCalculator();
-	    ronNeutralHadronCalib = new QNeutralHadronClusterEnergyCalculator();
-	    ronChargedHadronCalib = new QNeutralHadronClusterEnergyCalculator();
-	}
-
 	// Set up the MC lists
 	// -------------------
 
@@ -94,17 +99,18 @@
 	String mcListNameSim = "SimFinalStateParticles";
 	String mcListName = mcListNameGen;
 
-	// Run DigiSim
-	// -----------
-
-	{
-	    // CalHitMapDriver is needed by DigiSim
-	    add(new CalHitMapDriver());
-	    // DigiSim: SimCalHits -> RawCalHits
-	    DigiSimDriver digi = new org.lcsim.digisim.DigiSimDriver();
-	    add(digi);
-	    // RawCalHits -> SimCalorimeterHits
-	    add( new SimCalorimeterHitsDriver() );
+	// Ron's calibrations
+	ClusterEnergyCalculator ronPhotonCalib = null;
+	ClusterEnergyCalculator ronNeutralHadronCalib = null;
+	ClusterEnergyCalculator ronChargedHadronCalib = null;
+	if (m_useOldCalibration) {
+	    ronPhotonCalib = new PhotonClusterEnergyCalculator();
+	    ronNeutralHadronCalib = new DetailedNeutralHadronClusterEnergyCalculator();
+	    ronChargedHadronCalib = new DetailedNeutralHadronClusterEnergyCalculator();
+	} else {
+	    ronPhotonCalib = new QPhotonClusterEnergyCalculator();
+	    ronNeutralHadronCalib = new QNeutralHadronClusterEnergyCalculator();
+	    ronChargedHadronCalib = new QNeutralHadronClusterEnergyCalculator();
 	}
 
 	// Set up input hit lists
@@ -112,15 +118,18 @@
 
 	String eventHitMapEcal = "inputHitMapEcal";
 	String eventHitMapHcal = "inputHitMapHcal";
-	String[] eventHitCollections = {"EcalBarrDigiHits","EcalEndcapDigiHits","HcalBarrDigiHits","HcalEndcapDigiHits"};
+	String[] eventHitCollections = {ci.getDigiCollectionName(CalorimeterType.EM_BARREL),
+                                        ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP),
+                                        ci.getDigiCollectionName(CalorimeterType.HAD_BARREL),
+                                        ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP)};
 	{
 	    HitListToHitMapDriver hitmapEcal = new HitListToHitMapDriver();
-	    hitmapEcal.addInputList("EcalBarrDigiHits");
-	    hitmapEcal.addInputList("EcalEndcapDigiHits");
+	    hitmapEcal.addInputList(ci.getDigiCollectionName(CalorimeterType.EM_BARREL));
+	    hitmapEcal.addInputList(ci.getDigiCollectionName(CalorimeterType.EM_ENDCAP));
 	    hitmapEcal.setOutput(eventHitMapEcal);
 	    HitListToHitMapDriver hitmapHcal = new HitListToHitMapDriver();
-	    hitmapHcal.addInputList("HcalBarrDigiHits");
-	    hitmapHcal.addInputList("HcalEndcapDigiHits");
+	    hitmapHcal.addInputList(ci.getDigiCollectionName(CalorimeterType.HAD_BARREL));
+	    hitmapHcal.addInputList(ci.getDigiCollectionName(CalorimeterType.HAD_ENDCAP));
 	    hitmapHcal.setOutput(eventHitMapHcal);
 	    add(hitmapEcal);
 	    add(hitmapHcal);
@@ -158,12 +167,12 @@
 	    // Output: List<Track> saved as EventHeader.TRACKS
 	    add (new MCFastTracking());
 	    String fastMCTrackList = EventHeader.TRACKS;
-	    
+
 	    // Find tracks (cheating)
 	    String ronTrackList = "FSReconTracks";
 	    String ronMCList = "ReconFSParticles";
 	    add(new org.lcsim.recon.cheater.CheatReconDriver());
-	    
+
 	    // Choose which track list to use
 	    boolean useRonTrackList = true;
 	    if (useRonTrackList) {
@@ -226,10 +235,10 @@
 	    String prefix = "mipfinder__";
 	    boolean useFlexibleMIPFinder = false;
 	    if (useFlexibleMIPFinder) {
-		addFlexibleMIPFinder(prefix, eventHitMapEcalWithoutPhotons, eventMipsEcal, eventHitMapEcalWithoutMipsOrPhotons); 
+		addFlexibleMIPFinder(prefix, eventHitMapEcalWithoutPhotons, eventMipsEcal, eventHitMapEcalWithoutMipsOrPhotons);
 		addFlexibleMIPFinder(prefix, eventHitMapHcalWithoutMuons, eventMipsHcal, eventHitMapHcalWithoutMips);
 	    } else {
-		addMIPFinder(prefix, eventHitMapEcalWithoutPhotons, eventMipsEcal, eventHitMapEcalWithoutMipsOrPhotons); 
+		addMIPFinder(prefix, eventHitMapEcalWithoutPhotons, eventMipsEcal, eventHitMapEcalWithoutMipsOrPhotons);
 		addMIPFinder(prefix, eventHitMapHcalWithoutMuons, eventMipsHcal, eventHitMapHcalWithoutMips);
 	    }
 	    // Merge ECAL & HCAL lists
@@ -389,7 +398,7 @@
 	    // Make particle lists
 	    prefix = "photonmaker__";
 	    addPhotonParticleMaker(prefix, eventPhotonClustersWithFragments, eventLargePhotonParticleList, ronPhotonCalib);
-	    
+
 	    String[] mergeThese = { eventHadronParticles, eventLargePhotonParticleList, eventSmallPhotonParticles, eventMuonParticles } ;
 	    addMerger(mergeThese, eventOutputParticles);
 
@@ -412,9 +421,7 @@
 
 	// Make sure the book-keeping is OK:
 	add(accountant);
-    }
-
-    public void process(EventHeader event) {
+        }
         // Special handling of things that need per-event info.
 	// This probably belongs in its own driver.
 	if (m_evalWrapper != null) {

lcsim/src/org/lcsim/recon/pfa/structural
ExampleGenerateLikelihood.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- ExampleGenerateLikelihood.java	28 Mar 2008 17:10:31 -0000	1.1
+++ ExampleGenerateLikelihood.java	7 May 2010 19:04:55 -0000	1.2
@@ -1,6 +1,7 @@
 package org.lcsim.recon.pfa.structural;
 
 import org.lcsim.util.Driver;
+import org.lcsim.recon.util.CalInfoDriver;
 
 /**
  * A very simple wrapper class that can be used to generate
@@ -16,13 +17,14 @@
  * energy.
  *
  * @author Mat <[log in to unmask]>
- * @version $Id: ExampleGenerateLikelihood.java,v 1.1 2008/03/28 17:10:31 mcharles Exp $
+ * @version $Id: ExampleGenerateLikelihood.java,v 1.2 2010/05/07 19:04:55 cassell Exp $
  */
 
 public class ExampleGenerateLikelihood extends Driver
 {
     public ExampleGenerateLikelihood()
     {
+        add(new CalInfoDriver());
 	add(new org.lcsim.recon.pfa.structural.NonTrivialPFA(true));
     }
 }
CVSspam 0.2.8