lcsim/src/org/lcsim/contrib/SteveMagill
diff -u -r1.4 -r1.5
--- TrackMipClusterDriver.java 29 May 2008 22:35:07 -0000 1.4
+++ TrackMipClusterDriver.java 6 Jun 2008 18:40:50 -0000 1.5
@@ -62,8 +62,8 @@
private String _nameExt;
private String[] _hitcollnames;
private boolean trmipD = false;
- private boolean trmipRes = false;
- private SpacePoint trackspacept;
+// private boolean trmipRes = false;
+// private SpacePoint trackspacept;
private double zField;
// private String[] _hitmapnames;
@@ -212,8 +212,8 @@
double htr = Math.sqrt(htpos[0]*htpos[0]+htpos[1]*htpos[1]);
double celltheta = Math.atan(htr/htpos[2]);
if (celltheta<0) celltheta+=Math.PI;
- celectheta[nhitbLayer[nlay]][nlay] = celltheta;
- celecphi[nhitbLayer[nlay]][nlay] = cellphi;
+ celectheta[nhitecLayer[nlay]][nlay] = celltheta;
+ celecphi[nhitecLayer[nlay]][nlay] = cellphi;
celecID[nhitecLayer[nlay]][nlay] = cID;
celechit[nhitecLayer[nlay]][nlay] = chit;
nhitecLayer[nlay]++;
@@ -233,8 +233,8 @@
double htr = Math.sqrt(htpos[0]*htpos[0]+htpos[1]*htpos[1]);
double celltheta = Math.atan(htr/htpos[2]);
if (celltheta<0) celltheta+=Math.PI;
- celectheta[nhitbLayer[nlay]][nlay] = celltheta;
- celecphi[nhitbLayer[nlay]][nlay] = cellphi;
+ celectheta[nhitecLayer[nlay]][nlay] = celltheta;
+ celecphi[nhitecLayer[nlay]][nlay] = cellphi;
celecID[nhitecLayer[nlay]][nlay] = cID;
celechit[nhitecLayer[nlay]][nlay] = chit;
nhitecLayer[nlay]++;
@@ -271,8 +271,9 @@
if (i >= _numbemlayers) dmin = _dminH;
if (distance < dmin)
{
- if (i < _numbemlayers) celbden[j][i] += 0.0026/distance; // default is 0.0026
- if (i > _numbemlayers-1) celbden[j][i] += 0.0054/distance; // default was 0.0052, try 0.0062
+// if (i < _numbemlayers) celbden[j][i] += 0.0026/distance; // default is 0.0026
+// if (i > _numbemlayers-1) celbden[j][i] += 0.0054/distance; // default was 0.0052, try 0.0062
+ celbden[j][i]++; //just add 1 to density per hit in window
if (trmipD)
{
if (i == 0) aida.cloud1D("Distance between EM B CAL hits layer 0").fill(distance);
@@ -317,8 +318,9 @@
if (i >= _numecemlayers) dmin = _dminH;
if (distance < dmin)
{
- if (i < _numecemlayers) celecden[j][i] += 0.0028/distance; // default was 0.0017, try 0.0026
- if (i > _numecemlayers-1) celecden[j][i] += 0.0085/distance; // default was 0.0042, try 0.0062
+// if (i < _numecemlayers) celecden[j][i] += 0.0028/distance; // default was 0.0017, try 0.0026
+// if (i > _numecemlayers-1) celecden[j][i] += 0.0085/distance; // default was 0.0042, try 0.0062
+ celecden[j][i]++; //just add 1 to density per hit in window
if (trmipD)
{
if (i == 0) aida.cloud1D("Distance between EM EC CAL hits layer 0").fill(distance);
@@ -356,7 +358,7 @@
// also, need a map linking tracks to mip clusters for future use and map linking IL to track
Map<Track, BasicCluster> trkmipmap = new HashMap<Track, BasicCluster>();
Map<BasicCluster, Integer> clusILmap = new HashMap<BasicCluster, Integer>();
- Map<Track, SpacePoint> trkposmap = new HashMap<Track, SpacePoint>();
+// Map<Track, SpacePoint> trkposmap = new HashMap<Track, SpacePoint>();
// Make hitmaps that contain mip hits
HitMap embhitmap = (HitMap) (event.get("EMBarrhitmap"));
HitMap hadbhitmap = (HitMap) (event.get("HADBarrhitmap"));
@@ -391,9 +393,11 @@
// tswim.setTrack(trp3, tror3, trq); // deprecated
tswim.setTrack(trp3, trorsp, trq);
double torad = tswim.getDistanceToRadius(BRadii[0]); // this is midpoint of first active layer of EM Barrel Cal
- double toz = tswim.getDistanceToZ(ECZs[0]); // this is midpoint of first active layer of EM Endcap Cal
+ double toz = 0.;
+ if (trp[2]>0) toz = tswim.getDistanceToZ(ECZs[0]); // this is midpoint of first active layer of EM Endcap Cal
+ if (trp[2]<0) toz = tswim.getDistanceToZ(-ECZs[0]); // other endcap
// if distance to radius is less than distance to z, use barrel hit collection, else use endcap
- if (torad < Math.abs(toz)) // in Barrel
+ if (torad<Math.abs(toz)) // in Barrel
{
if (trmipD) aida.cloud1D("Track pT B Tracks").fill(trpt);
boolean nointeraction = true;
@@ -484,7 +488,9 @@
int ntcmatch = 0;
long[] layerid = new long[200];
CalorimeterHit[] layerHit = new CalorimeterHit[200];
- double drad = tswim.getDistanceToZ(ECZs[j]);
+ double drad = 0.;
+ if (trp[2]>0) drad = tswim.getDistanceToZ(ECZs[j]);
+ if (trp[2]<0) drad = tswim.getDistanceToZ(-ECZs[j]);
SpacePoint trackSP = tswim.getPointAtLength(drad);
double trectheta = Math.atan(trackSP.rxy()/trackSP.z());
if (trectheta<0) trectheta+=Math.PI;
@@ -551,7 +557,7 @@
mipclusters.add(mipclus);
trkmipmap.put(itrack, mipclus);
clusILmap.put(mipclus, IntLay[jt]);
- trkposmap.put(itrack, trackspacept);
+// trkposmap.put(itrack, trackspacept);
jt++; // increment track index
}
if (trmipD) aida.cloud1D("Total Track Momentum").fill(TotTrP);
@@ -570,7 +576,7 @@
if (mipclusters.size() > 0) event.put(_nameExt, mipclusters);
event.put("TrackMipMap",trkmipmap);
event.put("MipClusILMap",clusILmap);
- event.put("TrackPosMap",trkposmap);
+// event.put("TrackPosMap",trkposmap);
}
public void setClusterNameExtension(String ext)
{