lcsim/src/org/lcsim/recon/muon
diff -u -r1.18 -r1.19
--- BarrelCalSegmentFinder.java 8 Jan 2006 15:18:55 -0000 1.18
+++ BarrelCalSegmentFinder.java 27 Jan 2006 20:33:31 -0000 1.19
@@ -1,20 +1,19 @@
package org.lcsim.recon.muon;
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.Hep3Vector;
import org.lcsim.event.*;
import java.util.*;
import org.lcsim.util.step.TrackStepper; // C.M. Stepper
import org.lcsim.util.step.DeDx;
import org.lcsim.util.aida.AIDA;
import org.lcsim.geometry.Detector;
-import org.lcsim.geometry.FieldMap;
import org.lcsim.geometry.subdetector.CylindricalBarrelCalorimeter;
import org.lcsim.geometry.segmentation.SegmentationBase;
import org.lcsim.geometry.util.IDEncoder;
-import org.lcsim.geometry.segmentation.ProjectiveCylinder;
import org.lcsim.geometry.util.IDDescriptor;
import org.lcsim.geometry.layer.LayerSlice;
import org.lcsim.recon.cluster.util.CalHitMapMgr;
-import org.lcsim.recon.cluster.directedtree.MyTools;
// Muon Segment Finder for barrel calorimeter
// Modified to include the EM Calorimeter- C.Milstene
@@ -72,8 +71,8 @@
thetaNNCut = 2; // 2;
}
else if(subdetName.equals(hcalSubdetName)) {
- phiNNCut = 3; // 3;
- thetaNNCut = 2; // 2;
+ phiNNCut = 0; // 3;
+ thetaNNCut = 0; // 2;
}
@@ -126,7 +125,7 @@
{
// Then do the Tracker up to r=rmin
double[] field = det.getFieldMap().getField(rpVect); // C.M.-June-03
- System.out.println("BField: ("+field[0]+", "+field[1]+", "+field[2]+")");
+ // System.out.println("BField: ("+field[0]+", "+field[1]+", "+field[2]+")");
BField = field[2];
xNumSteps=Math.abs(r-stpr.partR());
stepConditions = steprConditions(xNumSteps,BField,0.);
@@ -136,7 +135,7 @@
System.out.println("Tracker r=" +r+" zmax="+zmax);
System.out.println("Barrel:out of Tracker");
rpVect = stpr.getNewRp();
- System.out.println("swimOnly -Stepper pos ENTRY of:("+subdetName+" "+rpVect[0]+"; "+rpVect[1]+"; "+rpVect[2]+"), r="+stpr.partR());
+ System.out.println("Stepper pos ENTRY of:("+subdetName+" "+rpVect[0]+"; "+rpVect[1]+"; "+rpVect[2]+"), r="+stpr.partR());
}
@@ -158,7 +157,7 @@
xNumSteps = 10.*dr;
stepConditions = steprConditions(xNumSteps,BField,meanDEdxPerLay(subdetName));
- System.out.println("Barrel:MeanDEdxPerLay="+meanDEdxPerLay(subdetName));
+ //System.out.println("Barrel:MeanDEdxPerLay="+meanDEdxPerLay(subdetName));
// Forms a muon segment by looking for calorimeter hits that match
// cells which the track passes through
// Begin by finding intersection of track with innermost layer
@@ -174,6 +173,8 @@
// the track passes through
while ((Math.abs(rpVect[2]) < zmax )&& (nr < nLayers))
{
+ Hep3Vector v = new BasicHep3Vector(rpVect[0],rpVect[1],rpVect[2]);
+ hitPos.add(v);
//-- replace with a more general way: findCellContainingXYZ. GL051211
// Add cell to list
// System.out.println("BCSF.findSegment: ("+rpVect[0]+"; "+rpVect[1]+"; "+rpVect[2]+"), rho="+stpr.partR());
@@ -181,16 +182,16 @@
// System.out.println(" virtual cell: layer="+nr+", iphi="+iphi+", itheta="+itheta);
// more general way
- long virtualID = segm.findCellContainingXYZ( rpVect );
+// long virtualID = segm.findCellContainingXYZ( rpVect );
// this works for projective geometries only
// assert cellid == virtualID
// : "*** virtual cell problem: "
// +" cellID="+MyTools.printID(cellid)
// +", virtualID="+MyTools.printID(virtualID);
- System.out.println("adding virtual hit: ID="
- +MyTools.printID(virtualID));
- cellList.add(virtualID);
+// System.out.println("adding virtual hit: ID="
+// +MyTools.printID(virtualID));
+// cellList.add(virtualID);
if(stpr.getStopTkELow()) break;
if(nr!=(nLayers-1)) r = r + dr;
@@ -204,13 +205,21 @@
}
// Save number of layers track passed through
numLayersHit = nr;
- System.out.println("swimOnly -Stepper pos EXIT of:("+subdetName+" "+rpVect[0]+"; "+rpVect[1]+"; "+rpVect[2]+"), r="+stpr.partR());
+
+ System.out.println("Stepper pos EXIT of:("+subdetName+" "+rpVect[0]+"; "+rpVect[1]+"; "+rpVect[2]+"), r="+stpr.partR());
rpVect= stpr.getNewRp();
+ if((nr==nLayers)|| (rpVect[2]>=zmax))
+ {
+ Hep3Vector v = new BasicHep3Vector(rpVect[0],rpVect[1],rpVect[2]);
+ hitPos.add(v);
+ }
+
double rr=stpr.partR();
// Now match the cells on this list to calorimeter hits
// System.out.println("Names: subdetName=<"+subdetName+">"
// +", EcalSubdetName="+ecalSubdetName
// +", HcalSubdetName="+hcalSubdetName);
+/*
if(subdetName.equals(hcalSubdetName)) //C.M.-27Jan03
{
// HistogramFolder.setDefaultFolder("/HDCal");
@@ -225,6 +234,7 @@
matchHitsFast(segm, dataMgr.getCollHitMap(ecalHitmapName) );
// HistogramFolder.setDefaultFolder(".."); // C.M.-27Jan03- Folder
}
+ */
}
@@ -233,6 +243,7 @@
// Erase lists of hits and cells
hitList.removeAllElements();
cellList.removeAllElements();
+
}
public void setPhiNNCut(int cut)
@@ -305,11 +316,19 @@
{
return(hitList.elements());
}
+ public Enumeration getHitsPos()
+ {
+ return(hitPos.elements());
+ }
public int getNHits()
{
return(hitList.size());
}
+ public int getNHitsPos()
+ {
+ return(hitPos.size());
+ }
//----------------------------------------------------------C.M. Step Conditions
public double[] steprConditions(double theXNumSteps,double theField,double theMeanDEdx)
{
@@ -336,7 +355,7 @@
matterDEdx += e1; // sum energy loss per material
//System.out.println(" DedxPerMateriel (GeV/cm) ="+dedx.getDeDx(mat)+" thickness(mm)="+tthk+ " element="+i);
}
- System.out.println(" MeanDedxPerLay (GeV) ="+matterDEdx);
+ // System.out.println(" MeanDedxPerLay (GeV) ="+matterDEdx);
return matterDEdx;
}
@@ -461,7 +480,6 @@
protected int numLayersHit;
protected Vector<Long> cellList = new Vector<Long>(); // list of cell indices
protected TrackStepper stpr = new TrackStepper(); //C.M.-Stepper Instance
- protected double [] rstep = new double[3];
protected double [] stepConditions = new double[3];
protected Map<String, Double> materials;
private int phiNNCut;