lcsim/src/org/lcsim/recon/muon
diff -u -r1.24 -r1.25
--- BarrelCalSegmentFinder.java 9 Aug 2006 22:46:59 -0000 1.24
+++ BarrelCalSegmentFinder.java 13 Sep 2006 21:46:44 -0000 1.25
@@ -3,7 +3,6 @@
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import org.lcsim.event.*;
-import java.io.*;
import java.util.*;
import org.lcsim.util.step.TrackStepper; // C.M. Stepper
import org.lcsim.recon.cluster.util.Samplexmlclass;
@@ -14,10 +13,11 @@
import org.lcsim.geometry.segmentation.SegmentationBase;
import org.lcsim.geometry.util.IDEncoder;
import org.lcsim.geometry.util.IDDescriptor;
-import org.lcsim.geometry.layer.LayerSlice;
import org.lcsim.recon.cluster.util.CalHitMapMgr;
import org.lcsim.geometry.layer.*;
import org.lcsim.geometry.Layered;
+import org.lcsim.geometry.LayeredSubdetector;
+import org.lcsim.geometry.Subdetector;
/**
* @author Rich Markeloff,
* Modified by Caroline Milstene - January-02-04 - To include the electromagnetic calorimeter
@@ -37,11 +37,8 @@
// Modified to use the Stepper.class in org.lcsim.util.step,
// whenever the Swimmer class was used and in between
// elements as well- C. Milstene-January-02-04
-// NEXT to be done: finish to debugg at 2GeV/c
-// : apply to higher energy singles
-// NEXT to be done: call stepper with subdetetorName and detector layer info
-// to calculate the number of steps within the stepper- material conditions
// moved from stepperConditions to a StepperCondition.Class in util/step directory
+// NEXT to be done: finish to debugg at 2GeV/c
//
public class BarrelCalSegmentFinder extends SegmentFinder
{
@@ -58,8 +55,8 @@
String a_nam = det.getHeader().getDetectorName();
calsub = (CylindricalBarrelCalorimeter)det.getSubdetectors().get(subdetName);
-
Layering layers = ((Layered) calsub).getLayering();
+
rmin = calsub.getInnerRadius();
rmax = calsub.getOuterRadius();
@@ -80,13 +77,14 @@
phiNNCut = 3; // 3;
thetaNNCut = 2; // 2;
}
-
-
- //The purpose of this statement is to specify the xml file the data should be read from
- String filename = "C:\\work\\LCDetectors\\detectors\\" + a_nam +"\\compact.xml";
- File f = new File(filename);
- xmlReader.declarefile(f);
- xmlReader.SystemInfo(subdetName);
+ Subdetector subDet = aDet.getSubdetector(subdetName);
+ int nLayers = ((Layered) subDet).getLayering().getLayerCount();
+ SegmentationBase base = ((SegmentationBase) subDet.getIDDecoder());
+// //The purpose of this statement is to specify the xml file the data should be read from
+// String filename = "C:\\work\\LCDetectors\\detectors\\" + a_nam +"\\compact.xml";
+// File f = new File(filename);
+// xmlReader.declarefile(f);
+// xmlReader.SystemInfo(subdetName);
String readoutseg = xmlReader.getReadoutID();
System.out.println(" BCF: Readoutseg ===" + readoutseg);
@@ -101,10 +99,10 @@
int sys = 0;
if(debug)System.out.println("BCSF constructor: subdetName="+subdetName);
sys = xmlReader.getSystemID();
- encoder.setValue("system", sys);
- encoder.setValue("barrel", 0);
+// encoder.setValue("system", sys);
+// encoder.setValue("barrel", 0);
// set system/barrel bits in Segmentation object
- segm.setID(encoder.getID());
+// segm.setID(encoder.getID());
}
@@ -206,6 +204,8 @@
{// Record Last Layer and Info at Break
Hep3Vector v =new BasicHep3Vector(rpVect[0],rpVect[1],rpVect[2]);
hitPos.add(v);
+ long virtualID = segm.findCellContainingXYZ( rpVect );
+ cellList.add(virtualID);
}
double rr=stpr.partR(rpVect);
@@ -371,7 +371,6 @@
hitList.add(hit);
nhitsTotal++;
}
-
// now check for the neighbors
segm.setID(cellid);
int iphi = segm.getValue("phi");
@@ -387,8 +386,6 @@
}
ilay = segm.getLayer();
long[] neighs = segm.getNeighbourIDs(0, thetaNNCut, phiNNCut );
-// System.out.println("VirtualID="+MyTools.printID(cellid)
-// +", #neighbors="+neighs.length+" "+thetaNNCut+" "+phiNNCut);
for(int i=0; i<neighs.length; ++i)
{
hit = calHits.get(neighs[i]);