lcsim-contrib/src/main/java/org/lcsim/contrib/mgraham/sATLASDigi
diff -u -r1.3 -r1.4
--- LOIEffFakeMG.java 20 Apr 2009 23:57:12 -0000 1.3
+++ LOIEffFakeMG.java 21 Apr 2009 23:54:40 -0000 1.4
@@ -93,6 +93,7 @@
Hep3Vector IP = new BasicHep3Vector(0., 0., 0.);
double bfield = event.getDetector().getFieldMap().getField(IP).z();
// dump SThit information
+
String[] input_hit_collections = {"VtxBarrHits", "VtxEndcapHits", "SCTShortBarrHits", "SCTLongBarrHits", "SCTShortEndcapHits", "SCTLongEndcapHits"};
for (String input : input_hit_collections) {
List<SimTrackerHit> sthits = event.getSimTrackerHits(input);
@@ -122,7 +123,8 @@
i++;
}
}
- List<HelicalTrackHit> hthits = event.get(HelicalTrackHit.class, "HelicalTrackHits");
+
+ List<HelicalTrackHit> hthits = event.get(HelicalTrackHit.class, "HelicalTrackHits");
for (HelicalTrackHit HelTrHit : hthits) {
}
@@ -528,6 +530,7 @@
List<Ignore> ignores = new ArrayList<Ignore>();
// select mc particles that fail on the z0 cut
+
ignores.add(Ignore.NoZ0Cut);
if (findable.isFindable(mcp, slist, ignores)) {
aida.histogram1D("Hits for z0 check failures", 20, 0., 20.).fill(nhits);
@@ -599,6 +602,7 @@
} else {
System.out.println("MC Particle is not findable with all ignores set!!");
}
+
}
return;
}
lcsim-contrib/src/main/java/org/lcsim/contrib/mgraham/sATLASDigi
diff -u -r1.2 -r1.3
--- FindableTrack.java 21 Apr 2009 20:20:54 -0000 1.2
+++ FindableTrack.java 21 Apr 2009 23:54:40 -0000 1.3
@@ -84,7 +84,9 @@
public boolean isFindable(MCParticle mcp, List<SeedStrategy> slist, List<Ignore> ignores) {
// We can't find neutral particles'
- if (mcp.getCharge() == 0) return false;
+ if (mcp.getCharge() == 0) {
+ return false;
+ }
// Find the helix parameters in the L3 convention used by org.lcsim
HelixParamCalculator helix = new HelixParamCalculator(mcp, _bfield);
@@ -96,22 +98,34 @@
for (SeedStrategy strat : slist) {
// Check the MC Particle's pT
- if (!CheckPT(helix, ignores, strat)) continue;
+ if (!CheckPT(helix, ignores, strat)) {
+ continue;
+ }
// Check the MC Particle's DCA
- if (!CheckDCA(helix, ignores, strat)) continue;
+ if (!CheckDCA(helix, ignores, strat)) {
+ continue;
+ }
// Check the MC Particle's Z0
- if (!CheckZ0(helix, ignores, strat)) continue;
+ if (!CheckZ0(helix, ignores, strat)) {
+ continue;
+ }
// Check that we have hits on the seed layers
- if (!CheckSeed(mcp, ignores, strat)) continue;
+ if (!CheckSeed(mcp, ignores, strat)) {
+ continue;
+ }
// Check that we have the required confirmation hits
- if (!CheckConfirm(mcp, ignores, strat)) continue;
+ if (!CheckConfirm(mcp, ignores, strat)) {
+ continue;
+ }
// Check for the minimum number of hits
- if (!CheckMinHits(mcp, ignores, strat)) continue;
+ if (!CheckMinHits(mcp, ignores, strat)) {
+ continue;
+ }
// Passed all the checks - track is findable
findable = true;
@@ -131,8 +145,14 @@
// Create the set of identifiers
for (SimTrackerHit simhit : hitlist) {
- String identifier = _ID.Identifier(getDetectorElement(simhit));
- if (!idset.contains(identifier)) idset.add(identifier);
+
+// String identifier = simhit.getDetectorElement();
+ String identifier_old = _ID.Identifier(getDetectorElement(simhit));
+ String identifier = _ID.Identifier(simhit);
+// if(!identifier.equals(identifier_old)) System.out.println("old identifier = "+identifier_old+ " new identifier = "+identifier);
+ if (!idset.contains(identifier)) {
+ idset.add(identifier);
+ }
}
return idset.size();
@@ -141,7 +161,9 @@
private boolean CheckPT(HelixParamCalculator helix, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoPTCut)) return true;
+ if (ignores.contains(Ignore.NoPTCut)) {
+ return true;
+ }
return helix.getMCTransverseMomentum() >= strat.getMinPT();
}
@@ -149,7 +171,9 @@
private boolean CheckDCA(HelixParamCalculator helix, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoDCACut)) return true;
+ if (ignores.contains(Ignore.NoDCACut)) {
+ return true;
+ }
return Math.abs(helix.getDCA()) <= strat.getMaxDCA();
}
@@ -157,7 +181,9 @@
private boolean CheckZ0(HelixParamCalculator helix, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoZ0Cut)) return true;
+ if (ignores.contains(Ignore.NoZ0Cut)) {
+ return true;
+ }
return Math.abs(helix.getZ0()) <= strat.getMaxZ0();
}
@@ -165,7 +191,9 @@
private boolean CheckSeed(MCParticle mcp, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoSeedCheck)) return true;
+ if (ignores.contains(Ignore.NoSeedCheck)) {
+ return true;
+ }
return HitCount(mcp, strat.getLayers(SeedType.Seed)) == 3;
}
@@ -173,7 +201,9 @@
private boolean CheckConfirm(MCParticle mcp, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoConfirmCheck)) return true;
+ if (ignores.contains(Ignore.NoConfirmCheck)) {
+ return true;
+ }
return HitCount(mcp, strat.getLayers(SeedType.Confirm)) >= strat.getMinConfirm();
}
@@ -181,7 +211,9 @@
private boolean CheckMinHits(MCParticle mcp, List<Ignore> ignores, SeedStrategy strat) {
// First see if we are skipping this check
- if (ignores.contains(Ignore.NoMinHitCut)) return true;
+ if (ignores.contains(Ignore.NoMinHitCut)) {
+ return true;
+ }
return HitCount(mcp, strat.getLayerList()) >= strat.getMinHits();
}
@@ -199,30 +231,39 @@
for (SimTrackerHit simhit : hitlist) {
// Get the detector element for this hit
- IDetectorElement de = getDetectorElement(simhit);
+// IDetectorElement de = getDetectorElement(simhit);
// Check names
- String detname_old = _ID.getName(de);
+// String detname_old = _ID.getName(de);
String detname_new = simhit.getSubdetector().getName();
- if (!detname_old.equals(detname_new)) {
- System.out.println("Detector name mismatch - old: "+detname_old+ " new: "+detname_new);
- }
- int layer_old = _ID.getLayer(de);
+ // if (!detname_old.equals(detname_new)) {
+ // System.out.println("Detector name mismatch - old: "+detname_old+ " new: "+detname_new);
+ // }
+ // int layer_old = _ID.getLayer(de);
int layer_new = simhit.getLayer();
- if (layer_old != layer_new) {
- System.out.println("Layer number mismatch - old: "+layer_old+" new: "+layer_new);
- }
- BarrelEndcapFlag be_old = _ID.getBarrelEndcapFlag(de);
+ // if (layer_old != layer_new) {
+ // System.out.println("Layer number mismatch - old: "+layer_old+" new: "+layer_new);
+ // }
+// BarrelEndcapFlag be_old = _ID.getBarrelEndcapFlag(de);
BarrelEndcapFlag be_new = simhit.getBarrelEndcapFlag();
- if (!be_old.equals(be_new)) {
- System.out.println("BarrelEndcapFlag mismatch - old: "+be_old+" new: "+be_new);
- }
+ // if (!be_old.equals(be_new)) {
+ // System.out.println("BarrelEndcapFlag mismatch - old: "+be_old+" new: "+be_new);
+ // }
// See if this hit is on the layer we are checking
- if (!lyr.getDetName().equals(_ID.getName(de))) continue;
- if (lyr.getLayer() != _ID.getLayer(de)) continue;
- if (!lyr.getBarrelEndcapFlag().equals(_ID.getBarrelEndcapFlag(de)))
+// if (!lyr.getDetName().equals(_ID.getName(de))) continue;
+// if (lyr.getLayer() != _ID.getLayer(de)) continue;
+// if (!lyr.getBarrelEndcapFlag().equals(_ID.getBarrelEndcapFlag(de)))
+// continue;
+ if (!lyr.getDetName().equals(detname_new)) {
continue;
+ }
+ if (lyr.getLayer() != layer_new) {
+ continue;
+ }
+ if (!lyr.getBarrelEndcapFlag().equals(be_new)) {
+ continue;
+ }
hitcount++;
break;
}