lcsim/src/org/lcsim/contrib/uiowa/MuonFinder
diff -u -r1.7 -r1.8
--- MipTrackMap.java 11 Oct 2008 01:01:04 -0000 1.7
+++ MipTrackMap.java 17 Oct 2008 00:32:04 -0000 1.8
@@ -229,7 +229,7 @@
}
public List<Cluster> createMIPMuDet(Set<CalorimeterHit> muhits){
- if(debug) System.out.println("total number of muon= " + muhits.size());
+ removeUpperSensitiveLayer(muhits);
hitsInTree = new HitMap(muhits);
List<Cluster> muonmip = new Vector<Cluster>();
@@ -262,7 +262,14 @@
Hep3Vector subhitPosUnit = VecOp.unit(subhitPos);
double cos = VecOp.dot(hitPosUnit, subhitPosUnit);
sortedHitbyAng.put(cos,subhit);
- aida.cloud1D("muon/cos between hits from IP").fill(cos);
+ if(debug){
+ double cosfromIP = Math.abs(hitPos.z()/hitPos.magnitude());
+ if(cosfromIP < 0.8) {
+ aida.cloud1D("muon/cos between barrel hits from IP").fill(cos);
+ }else {
+ aida.cloud1D("muon/cos between endcap hits from IP").fill(cos);
+ }
+ }
if(cos > 0.96) {
Set<CalorimeterHit> subhits = sortedHitbyPos.get(subhitPos.magnitude());
@@ -340,10 +347,6 @@
}
}
- if (m_removePoorQualityMips) {
- removePoorQualityMips(muonmip);
- }
-
return muonmip;
}
@@ -456,10 +459,38 @@
else exam = 0; // if number of neighbour is none, set to zero and start again from 0
if(debug){
- Hep3Vector v = hitPosition(hit);
+ Hep3Vector cellv = hitPosition(hit);
+ Hep3Vector v = new BasicHep3Vector(hit.getPosition());
int p = (int) (v.magnitude());
- System.out.println(" hit: pos=" + p + " , " + count[0] + " hits in 3x3, " + count[1] + " hits in 5x5 " + count[2] + " hits in 7x7 " + count[3] + " hits in 9x9 " + id.getLayer() + " layer of " + hit.getSubdetector().getName());
+ int r = (int) Math.sqrt(v.x()*v.x() + v.y()*v.y());
+ int z = (int) v.z();
+ int cellp = (int) (cellv.magnitude());
+ int cellr = (int) Math.sqrt(cellv.x()*cellv.x() + cellv.y()*cellv.y());
+ int cellz = (int) cellv.z();
+ System.out.println(" hit : p= " + p +" r=" + r + " , z " + z + " " + count[0] + " hits in 3x3, " + count[1] + " at " + id.getLayer() + " layer of " + hit.getSubdetector().getName());
+ System.out.println(" cell: p= " + cellp +" r=" + cellr + " , z " + cellz);
}
+
+ }
+
+ protected void removeUpperSensitiveLayer(Set<CalorimeterHit> muhits){
+ Set<CalorimeterHit> upperhits = new HashSet<CalorimeterHit>();
+ for(CalorimeterHit hit : muhits){
+ String subdetName = hit.getSubdetector().getName();
+ Hep3Vector cellv = hitPosition(hit);
+ Hep3Vector v = new BasicHep3Vector(hit.getPosition());
+ int p = (int) (v.magnitude());
+ int r = (int) Math.sqrt(v.x()*v.x() + v.y()*v.y());
+ int z = (int) v.z();
+ int cellp = (int) (cellv.magnitude());
+ int cellr = (int) Math.sqrt(cellv.x()*cellv.x() + cellv.y()*cellv.y());
+ int cellz = (int) cellv.z();
+ boolean upper = true;
+ if(subdetName.contains("MuonEndcap")) upper = Math.abs(z) > Math.abs(cellz);
+ if(subdetName.contains("MuonBarrel")) upper = r > cellr;
+ if(upper) upperhits.add(hit);
+ }
+ muhits.removeAll(upperhits);
}
//give the vector of hit