diff --git a/analysis/src/main/java/org/hps/analysis/MC/MCFullDetectorTruth.java b/analysis/src/main/java/org/hps/analysis/MC/MCFullDetectorTruth.java new file mode 100644 index 0000000000..1cb303aa83 --- /dev/null +++ b/analysis/src/main/java/org/hps/analysis/MC/MCFullDetectorTruth.java @@ -0,0 +1,524 @@ +package org.hps.analysis.MC; + +import hep.physics.vec.BasicHep3Vector; +import hep.physics.vec.Hep3Vector; +import hep.physics.vec.VecOp; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.hps.recon.tracking.CoordinateTransformations; +import org.hps.recon.tracking.TrackUtils; +import org.lcsim.event.MCParticle; +import org.lcsim.event.SimCalorimeterHit; +import org.lcsim.event.SimTrackerHit; +import org.lcsim.geometry.FieldMap; +import org.lcsim.util.swim.Trajectory; + +/** + * This is the tuple template driver + * Use this to add your code and variables to make a tuple + * Run the GeneralTupleDriver to output info into a text file + * Change the steering file to include this driver + * Run "makeTree.py" on text file to create a root tuple + * + * @author mrsolt on Aug 31, 2017 + */ + +public class MCFullDetectorTruth{ + + public static Map> BuildTrackerHitMap(List trackerHits){ + Map> trackerHitMap = new HashMap>(); + for (SimTrackerHit hit : trackerHits) { + MCParticle p = hit.getMCParticle(); + if (p == null) { + throw new RuntimeException("Tracker hit points to null MCParticle!"); + } + if (trackerHitMap.get(p) == null) { + trackerHitMap.put(p, new ArrayList()); + } + trackerHitMap.get(p).add(hit); + } + return trackerHitMap; + } + + public static Map>> BuildComboTrackerHitMap(List trackerHitsAct, List trackerHitsIn){ + Map>> trackerNewHitMap = new HashMap>>(); + for (SimTrackerHit hit : trackerHitsAct) { + MCParticle p = hit.getMCParticle(); + if (p == null) { + throw new RuntimeException("Tracker hit points to null MCParticle!"); + } + if (trackerNewHitMap.get(p) == null) { + trackerNewHitMap.put(p, new HashMap>()); + trackerNewHitMap.get(p).put("active", new ArrayList()); + } + trackerNewHitMap.get(p).get("active").add(hit); + } + int i = 0; + for (SimTrackerHit hit : trackerHitsIn) { + if (i == trackerHitsIn.size()/2) break; + MCParticle p = hit.getMCParticle(); + if (p == null) { + throw new RuntimeException("Tracker hit points to null MCParticle!"); + } + if (trackerNewHitMap.get(p) == null) { + trackerNewHitMap.put(p, new HashMap>()); + trackerNewHitMap.get(p).put("inactive", new ArrayList()); + } + if(trackerNewHitMap.get(p).get("inactive") == null){ + trackerNewHitMap.get(p).put("inactive", new ArrayList()); + } + trackerNewHitMap.get(p).get("inactive").add(hit); + i++; + } + return trackerNewHitMap; + } + + /*public static Map> BuildComboTrackerHitMap(Map> ActiveHitMap, Map> InActiveHitMap){ + Map> trackerHitMap = new HashMap>(); + for (Entry> entry_act : ActiveHitMap.entrySet()) { + MCParticle p_act = entry_act.getKey(); + List hits_act = entry_act.getValue(); + for (Entry> entry_in : InActiveHitMap.entrySet()) { + MCParticle p_in = entry_in.getKey(); + if(p_act != p_in) continue; + List hits_in = entry_in.getValue(); + if (trackerHitMap.get(p_act) == null) { + trackerHitMap.put(p_act, new ArrayList()); + } + for (SimTrackerHit hit : hits_act) { + trackerHitMap.get(p_act).add(hit); + } + for (SimTrackerHit hit : hits_in) { + trackerHitMap.get(p_act).add(hit); + } + } + } + return trackerHitMap; + }*/ + + public static Map> BuildCalHitMap(List calHits){ + // map particle to a list of its sim cal hits + Map> calHitMap = new HashMap>(); + for (SimCalorimeterHit hit : calHits) { + int nmc = hit.getMCParticleCount(); + for (int i = 0; i < nmc; i++) { + MCParticle p = hit.getMCParticle(i); + if (p == null) { + throw new RuntimeException("Cal hit points to null MCParticle!"); + } + if (calHitMap.get(p) == null) { + calHitMap.put(p, new ArrayList()); + } + if (!calHitMap.get(p).contains(hit)) { + calHitMap.get(p).add(hit); + } + } + } + return calHitMap; + } + + public static String trackHitLayer(SimTrackerHit hit) { + String layer = Integer.toString( (int) hit.getLayer()); + double y = hit.getPositionVec().y(); + String volume = ""; + //boolean isTop = ((HpsSiSensor) ((SimTrackerHit) hit.getDetectorElement()).getDetectorElement()).isTopLayer(); + //if(isTop) volume = "t"; + if(y > 0) volume = "t"; + else volume = "b"; + String prefix = "L" + layer + volume; + return prefix; + } + + public static String trackHitLayer_1(SimTrackerHit hit) { + String layer = Integer.toString( (int) hit.getLayer() - 1); + double y = hit.getPositionVec().y(); + String volume = ""; + //boolean isTop = ((HpsSiSensor) ((SimTrackerHit) hit.getDetectorElement()).getDetectorElement()).isTopLayer(); + //if(isTop) volume = "t"; + if(y > 0) volume = "t"; + else volume = "b"; + String prefix = "L" + layer + volume; + return prefix; + } + + public static String MCParticleType(MCParticle p, List particles, double ebeam) { + boolean isEle = false; + boolean isPos = false; + + // particle PDG ID + int pdgid = p.getPDGID(); + + // particle energy + double energy = p.getEnergy(); + + if(pdgid == 11){ + isEle = true; + } + + if(pdgid == -11){ + isPos = true; + } + + // parent index in particle list + Integer parIdx = null; + + // find parent's index in the particle collection + if (p.getParents().size() > 0) { + MCParticle parent = p.getParents().get(0); + for (int i = 0; i < particles.size(); i++) { + if (particles.get(i) == parent) { + parIdx = i; + break; + } + } + } + else{ + parIdx = -1; + } + if(isEle && parIdx == 0){ + for (MCParticle particle : particles) { + if(particle.getParents().size() == 0) continue; + if(particle.getPDGID() == 11 && particle.getParents().get(0).getPDGID() == 622 && p != particle){ + if(particle.getEnergy() < energy){ + return "triEle1"; + } + else{ + return "triEle2"; + } + } + } + } + + if(isPos && parIdx == 0){ + return "triPos"; + } + + + MCParticle wab = null; + + MCParticle ele1 = null;// conversion electron daughter + MCParticle ele2 = null;// recoil wab electron + MCParticle pos = null;// conversion positron daughter + + List wabParticles = null; + + for (MCParticle particle : particles) { + if (particle.getPDGID() == 22) { + if (particle.getDaughters().size() != 2) continue; + double wabEnergy = particle.getEnergy(); + for(MCParticle part : particles){ + if(part.getPDGID() != 11 || !part.getParents().isEmpty()) continue; + double eleEnergy = part.getEnergy(); + double esum = wabEnergy + eleEnergy; + if(esum < 0.98 * ebeam || esum > 1.02 * ebeam) continue; + ele2 = part; + wab = particle; + wabParticles = wab.getDaughters(); + break; + } + } + } + if (wab == null) { + return ""; + } + + + for (MCParticle particle : wabParticles) { + if(particle.getPDGID() == 11){ + pos = particle; + } + if(particle.getPDGID() == -11){ + ele1 = particle; + } + } + + if (ele1 == p) { + return "wabEle1"; + } + if (ele2 == p) { + return "wabEle2"; + } + if (pos == p) { + return "wabPos"; + } + + return ""; + } + + /*public static Hep3Vector extrapolateTrackPosition(Hep3Vector startPosition, Hep3Vector startMomentum, double endPositionZ, double stepSize, FieldMap fieldMap, double q) { + + // Start by transforming detector vectors into tracking frame + Hep3Vector currentPosition = CoordinateTransformations.transformVectorToTracking(startPosition); + Hep3Vector currentMomentum = CoordinateTransformations.transformVectorToTracking(startMomentum); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // Retrieve the y component of the bfield in the middle of detector + double bFieldY = fieldMap.getField(new BasicHep3Vector(0, 0, 500.0)).y(); + + // HACK: LCSim doesn't deal well with negative fields so they are + // turned to positive for tracking purposes. As a result, + // the charge calculated using the B-field, will be wrong + // when the field is negative and needs to be flipped. + if (bFieldY < 0) + q = q * (-1); + + // Swim the track through the B-field until the end point is reached. + // The position of the track will be incremented according to the step + // size up to ~90% of the final position. At this point, a finer + // track size will be used. + boolean stepSizeChange = false; + while (currentPosition.x() < endPositionZ) { + // The field map coordinates are in the detector frame so the + // extrapolated track position needs to be transformed from the + // track frame to detector. + Hep3Vector currentPositionDet = CoordinateTransformations.transformVectorToDetector(currentPosition); + + // Get the field at the current position along the track. + bFieldY = fieldMap.getField(currentPositionDet).y(); + + // Get a trajectory (Helix or Line objects) created with the + // track parameters at the current position. + Trajectory trajectory = TrackUtils.getTrajectory(currentMomentum, new org.lcsim.spacegeom.SpacePoint(currentPosition), q, bFieldY); + + // Using the new trajectory, extrapolated the track by a step and + // update the extrapolated position. + //if(CoordinateTransformations.transformVectorToTracking(startPosition).x() > currentPosition.x()){ + if(currentMomentum.x() < 0){ + return null; + } + currentPosition = trajectory.getPointAtDistance(stepSize); + + // Calculate the momentum vector at the new position. This will + // be used when creating the trajectory that will be used to + // extrapolate the track in the next iteration. + currentMomentum = VecOp.mult(currentMomentum.magnitude(), trajectory.getUnitTangentAtLength(stepSize)); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // If the position of the track along X (or z in the detector frame) + // is at 90% of the total distance, reduce the step size. + if (currentPosition.x() / endPositionZ > .80 && !stepSizeChange) { + stepSize /= 10; + // System.out.println("Changing step size: " + stepSize); + stepSizeChange = true; + } + } + + // Transform vector back to detector frame + return CoordinateTransformations.transformVectorToDetector(currentPosition); + } + + public static Hep3Vector extrapolateTrackMomentum(Hep3Vector startPosition, Hep3Vector startMomentum, double endPositionZ, double stepSize, FieldMap fieldMap, double q) { + + // Start by transforming detector vectors into tracking frame + Hep3Vector currentPosition = CoordinateTransformations.transformVectorToTracking(startPosition); + Hep3Vector currentMomentum = CoordinateTransformations.transformVectorToTracking(startMomentum); + + // Retrieve the y component of the bfield in the middle of detector + double bFieldY = fieldMap.getField(new BasicHep3Vector(0, 0, 500.0)).y(); + + // HACK: LCSim doesn't deal well with negative fields so they are + // turned to positive for tracking purposes. As a result, + // the charge calculated using the B-field, will be wrong + // when the field is negative and needs to be flipped. + if (bFieldY < 0) + q = q * (-1); + + // Swim the track through the B-field until the end point is reached. + // The position of the track will be incremented according to the step + // size up to ~90% of the final position. At this point, a finer + // track size will be used. + boolean stepSizeChange = false; + while (currentPosition.x() < endPositionZ) { + // The field map coordinates are in the detector frame so the + // extrapolated track position needs to be transformed from the + // track frame to detector. + Hep3Vector currentPositionDet = CoordinateTransformations.transformVectorToDetector(currentPosition); + + // Get the field at the current position along the track. + bFieldY = fieldMap.getField(currentPositionDet).y(); + + // Get a trajectory (Helix or Line objects) created with the + // track parameters at the current position. + Trajectory trajectory = TrackUtils.getTrajectory(currentMomentum, new org.lcsim.spacegeom.SpacePoint(currentPosition), q, bFieldY); + + //if(CoordinateTransformations.transformVectorToTracking(startPosition).x() > currentPosition.x()){ + if(currentMomentum.x() < 0){ + return null; + } + + // Using the new trajectory, extrapolated the track by a step and + // update the extrapolated position. + currentPosition = trajectory.getPointAtDistance(stepSize); + + // Calculate the momentum vector at the new position. This will + // be used when creating the trajectory that will be used to + // extrapolate the track in the next iteration. + currentMomentum = VecOp.mult(currentMomentum.magnitude(), trajectory.getUnitTangentAtLength(stepSize)); + + // If the position of the track along X (or z in the detector frame) + // is at 90% of the total distance, reduce the step size. + if (currentPosition.x() / endPositionZ > .80 && !stepSizeChange) { + stepSize /= 10; + // System.out.println("Changing step size: " + stepSize); + stepSizeChange = true; + } + } + + // Transform vector back to detector frame + return CoordinateTransformations.transformVectorToDetector(currentMomentum); + }*/ + + public static double deltaThetaX(Hep3Vector p1, Hep3Vector p2){ + double theta1 = p1.x()/p1.z(); + double theta2 = p2.x()/p2.z(); + return theta2 - theta1; + } + + public static double deltaThetaY(Hep3Vector p1, Hep3Vector p2){ + double theta1 = p1.y()/p1.z(); + double theta2 = p2.y()/p2.z(); + return theta2 - theta1; + } + + public static Hep3Vector extrapolateTrackMomentum(Hep3Vector endPosition, Hep3Vector endMomentum, Hep3Vector startPosition, double stepSize, FieldMap fieldMap, double q) { + if(endPosition == null || endMomentum == null || startPosition == null) return null; + // Start by transforming detector vectors into tracking frame + Hep3Vector currentPosition = CoordinateTransformations.transformVectorToTracking(endPosition); + Hep3Vector currentMomentum = VecOp.neg(CoordinateTransformations.transformVectorToTracking(endMomentum)); + double startPositionZ = startPosition.z(); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // Retrieve the y component of the bfield in the middle of detector + double bFieldY = fieldMap.getField(new BasicHep3Vector(0, 0, 500.0)).y(); + + // HACK: LCSim doesn't deal well with negative fields so they are + // turned to positive for tracking purposes. As a result, + // the charge calculated using the B-field, will be wrong + // when the field is negative and needs to be flipped. + if (bFieldY < 0) + q = q * (-1); + + // Swim the track through the B-field until the end point is reached. + // The position of the track will be incremented according to the step + // size up to ~90% of the final position. At this point, a finer + // track size will be used. + boolean stepSizeChange = false; + while (currentPosition.x() > startPositionZ) { + // The field map coordinates are in the detector frame so the + // extrapolated track position needs to be transformed from the + // track frame to detector. + Hep3Vector currentPositionDet = CoordinateTransformations.transformVectorToDetector(currentPosition); + + // Get the field at the current position along the track. + bFieldY = fieldMap.getField(currentPositionDet).y(); + + // Get a trajectory (Helix or Line objects) created with the + // track parameters at the current position. + Trajectory trajectory = TrackUtils.getTrajectory(currentMomentum, new org.lcsim.spacegeom.SpacePoint(currentPosition), q, bFieldY); + + // Using the new trajectory, extrapolated the track by a step and + // update the extrapolated position. + //if(CoordinateTransformations.transformVectorToTracking(startPosition).x() > currentPosition.x()){ + if(currentMomentum.x() > 0){ + //System.out.println("Track is going Forwards!"); + return null; + } + currentPosition = trajectory.getPointAtDistance(stepSize); + + // Calculate the momentum vector at the new position. This will + // be used when creating the trajectory that will be used to + // extrapolate the track in the next iteration. + currentMomentum = VecOp.mult(currentMomentum.magnitude(), trajectory.getUnitTangentAtLength(stepSize)); + + //System.out.println("Position " + CoordinateTransformations.transformVectorToDetector(currentPosition) + " Momentum " + CoordinateTransformations.transformVectorToDetector(currentMomentum) + " startPositionZ " + startPositionZ); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // If the position of the track along X (or z in the detector frame) + // is at 90% of the total distance, reduce the step size. + if (currentPosition.x() / startPositionZ > .80 && !stepSizeChange) { + stepSize /= 10; + //System.out.println("Changing step size: " + stepSize); + stepSizeChange = true; + } + } + + // Transform vector back to detector frame + return CoordinateTransformations.transformVectorToDetector(currentMomentum); + } + + public static Hep3Vector extrapolateTrackPosition(Hep3Vector endPosition, Hep3Vector endMomentum, Hep3Vector startPosition, double stepSize, FieldMap fieldMap, double q) { + if(endPosition == null || endMomentum == null || startPosition == null) return null; + // Start by transforming detector vectors into tracking frame + Hep3Vector currentPosition = CoordinateTransformations.transformVectorToTracking(endPosition); + Hep3Vector currentMomentum = VecOp.neg(CoordinateTransformations.transformVectorToTracking(endMomentum)); + double startPositionZ = startPosition.z(); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // Retrieve the y component of the bfield in the middle of detector + double bFieldY = fieldMap.getField(new BasicHep3Vector(0, 0, 500.0)).y(); + + // HACK: LCSim doesn't deal well with negative fields so they are + // turned to positive for tracking purposes. As a result, + // the charge calculated using the B-field, will be wrong + // when the field is negative and needs to be flipped. + if (bFieldY < 0) + q = q * (-1); + + // Swim the track through the B-field until the end point is reached. + // The position of the track will be incremented according to the step + // size up to ~90% of the final position. At this point, a finer + // track size will be used. + boolean stepSizeChange = false; + while (currentPosition.x() > startPositionZ) { + // The field map coordinates are in the detector frame so the + // extrapolated track position needs to be transformed from the + // track frame to detector. + Hep3Vector currentPositionDet = CoordinateTransformations.transformVectorToDetector(currentPosition); + + // Get the field at the current position along the track. + bFieldY = fieldMap.getField(currentPositionDet).y(); + + // Get a trajectory (Helix or Line objects) created with the + // track parameters at the current position. + Trajectory trajectory = TrackUtils.getTrajectory(currentMomentum, new org.lcsim.spacegeom.SpacePoint(currentPosition), q, bFieldY); + + // Using the new trajectory, extrapolated the track by a step and + // update the extrapolated position. + //if(CoordinateTransformations.transformVectorToTracking(startPosition).x() > currentPosition.x()){ + if(currentMomentum.x() > 0){ + //System.out.println("Track is going Forwards!"); + return null; + } + currentPosition = trajectory.getPointAtDistance(stepSize); + + // Calculate the momentum vector at the new position. This will + // be used when creating the trajectory that will be used to + // extrapolate the track in the next iteration. + currentMomentum = VecOp.mult(currentMomentum.magnitude(), trajectory.getUnitTangentAtLength(stepSize)); + + //System.out.println(currentPosition.x() + " " + currentPosition.y() + " " + currentPosition.z() + " "); + + // If the position of the track along X (or z in the detector frame) + // is at 90% of the total distance, reduce the step size. + if (currentPosition.x() / startPositionZ > .80 && !stepSizeChange) { + stepSize /= 10; + //System.out.println("Changing step size: " + stepSize); + stepSizeChange = true; + } + } + + // Transform vector back to detector frame + return CoordinateTransformations.transformVectorToDetector(currentPosition); + } + + +} diff --git a/analysis/src/main/java/org/hps/analysis/MC/TrackTruthMatching.java b/analysis/src/main/java/org/hps/analysis/MC/TrackTruthMatching.java new file mode 100644 index 0000000000..295b3e86ce --- /dev/null +++ b/analysis/src/main/java/org/hps/analysis/MC/TrackTruthMatching.java @@ -0,0 +1,467 @@ +package org.hps.analysis.MC; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import hep.physics.vec.BasicHep3Vector; +import hep.physics.vec.Hep3Vector; +import hep.physics.vec.VecOp; + +import org.hps.recon.tracking.axial.HelicalTrack2DHit; +import org.lcsim.event.MCParticle; +import org.lcsim.event.RelationalTable; +import org.lcsim.event.Track; +import org.lcsim.event.TrackerHit; +import org.lcsim.fit.helicaltrack.HelicalTrackCross; +import org.lcsim.fit.helicaltrack.HelicalTrackStrip; + +/** + * + * @author Matt Solt + * based off of "TrackAnalysis" Driver + */ +public class TrackTruthMatching { + + private static final Hep3Vector axial = new BasicHep3Vector(0, 1, 0); + + private MCParticle _mcp = null; + private int _nhits; + private int _nbadhits; + private double _purity; + private MCParticle _mcpNew = null; + private int _nhitsNew; + private int _nbadhitsNew; + private double _purityNew; + private int _nAxialhits; + private int _nZhits; + private int _nbadAxialhits; + private int _nbadZhits; + private boolean _hasLayerOne; + private List badHitList = new ArrayList(); + private List sharedHitList = new ArrayList(); + private List trackLayerList = new ArrayList(); + private Map badhits = new HashMap(); + // Create a map containing the number of hits for each MCParticle associated with the track + private Map mcmap = new HashMap(); + private Map mcmapAll = new HashMap(); + private Map mcmapAxial = new HashMap(); + private Map mcmapZ = new HashMap(); + private int[] _nMCHitsPerLayer = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + private int[] _nStripHitsPerLayer = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + private Map _hitLocationPerLayer = new HashMap(); + + /** + * Creates a new instance of TrackAnalysis + * @return + */ + + public TrackTruthMatching(Track trk, RelationalTable hittomc) { + doAnalysis(trk, hittomc); + } + + private void doAnalysis(Track trk, RelationalTable hittomc){ + //private void doAnalysis(Track trk, Map> trackerHitMap){ //RelationalTable hittomc, RelationalTable rthtosimhit, RelationalTable hittostrip, RelationalTable hittorotated) { + + // Get the number of hits on the track + _nhits = trk.getTrackerHits().size(); + + _hasLayerOne = false; + // Loop over the hits on the track and make sure we have HelicalTrackHits (which contain the MC particle) + for (TrackerHit hit : trk.getTrackerHits()) { + // get the set of MCParticles associated with this hit and update the hit count for each MCParticle + Set mclist = hittomc.allFrom(hit); + //for (Entry> entry : trackerHitMap.entrySet()) { + //MCParticle mcp = entry.getKey(); + //List hits = entry.getValue(); + //System.out.println("MCParticle " + mcp);// + " TrackerHitMap = " + hits); + //Set mclist = hittomc.allFrom(hit); + + for (MCParticle mcp : mclist) { + Integer mchits = 0; + if (mcmap.containsKey(mcp)) + mchits = mcmap.get(mcp); + mchits++; + //System.out.println("mcp " + mcp + " ID " + mcp.getPDGID() + " mchits " + mchits); + + mcmap.put(mcp, mchits); + } + if (hit instanceof HelicalTrackCross) + countHit((HelicalTrackCross) hit); + else if (hit instanceof HelicalTrack2DHit) + countHit((HelicalTrack2DHit) hit); + /*else if (!(hit instanceof HelicalTrack2DHit )) //probably SOITrackerHit + countHit(hit, rthtosimhit, hittostrip, hittorotated);*/ + } + + // Find the MCParticle that has the most hits on the track + int nbest = 0; + MCParticle mcbest = null; + for (MCParticle mcp : mcmap.keySet()) { + //System.out.println("Loop " + mcp + " MCmap " + mcmap.get(mcp)); + int count = mcmap.get(mcp); + if (count > nbest) { + nbest = count; + mcbest = mcp; + } + } + + //System.out.println("MCbest " + mcbest + " nbest " + nbest); + + if (nbest > 0) + _mcp = mcbest; + _purity = (double) nbest / (double) _nhits; + _nbadhits = _nhits - nbest; + +//single strip layer accounting. + int nbestAll = 0; + MCParticle mcbestAll = null; + for (MCParticle mcp : mcmapAll.keySet()) { + int count = mcmapAll.get(mcp); + if (count > nbestAll) { + nbestAll = count; + mcbestAll = mcp; + } + } + + if (nbestAll > 0) + _mcpNew = mcbestAll; + _purityNew = (double) nbestAll / (double) _nhitsNew; + _nbadhitsNew = _nhitsNew - nbestAll; + + for (TrackerHit hit : trk.getTrackerHits()) + if (hit instanceof HelicalTrackCross) + checkForBadHit((HelicalTrackCross) hit); + + if (_nAxialhits > 0) + if (mcmapAxial.containsKey(_mcpNew)) + _nbadAxialhits = _nAxialhits - mcmapAxial.get(_mcpNew); + else + _nbadAxialhits = _nAxialhits; + if (_nZhits > 0) + if (mcmapZ.containsKey(_mcpNew)) + _nbadZhits = _nZhits - mcmapZ.get(_mcpNew); + else + _nbadZhits = _nZhits; + } + + private void countHit(HelicalTrackCross cross) { + List clusterlist = cross.getStrips(); + + for (HelicalTrackStrip cl : clusterlist) { + int layer = cl.layer(); + if (layer == 1) + _hasLayerOne = true; + + _nStripHitsPerLayer[layer - 1] = cl.rawhits().size(); + _hitLocationPerLayer.put(layer, clusterPosition(cl)); + _nhitsNew++; + double axdotu = VecOp.dot(cl.u(), axial); +// System.out.println(new BasicHep3Vector(cross.getPosition()).toString() + cl.u()); + boolean isAxial = false; + if (axdotu > 0.5) { + isAxial = true; + _nAxialhits++; + } else + _nZhits++; + List mcPartList = cl.MCParticles(); + _nMCHitsPerLayer[layer - 1] = mcPartList.size(); + for (MCParticle mcp : mcPartList) { + Integer mchits = 0; + if (mcmapAll.containsKey(mcp)) + mchits = mcmapAll.get(mcp); + mchits++; + mcmapAll.put(mcp, mchits); + if (isAxial) { + Integer mchitsAxial = 0; + if (mcmapAxial.containsKey(mcp)) + mchitsAxial = mcmapAxial.get(mcp); + mchitsAxial++; + mcmapAxial.put(mcp, mchitsAxial); + } else { + Integer mchitsZ = 0; + if (mcmapZ.containsKey(mcp)) + mchitsZ = mcmapZ.get(mcp); + mchitsZ++; + mcmapZ.put(mcp, mchitsZ); + } + } + } + } + + /*private void countHit(TrackerHit hit, RelationalTable rthtosimhit, RelationalTable hittostrip, RelationalTable hittorotated) { + TrackerHit unrotatedHit = (TrackerHit) hittorotated.from(hit); +// System.out.println("ID: " + unrotatedHit.getCellID()); + Set hitlist = hittostrip.allFrom(unrotatedHit); +// System.out.println("size: " + hitlist.size()); + for (TrackerHit cl : hitlist) { + int layer = -1; + int module = -1; + List rawHits = cl.getRawHits(); +// System.out.println("RawHits: " + rawHits.size()); + for (RawTrackerHit rawHit : rawHits) { +// System.out.println(rawHit.getCellID()); + IIdentifier id = new Identifier(rawHit.getCellID()); + //===> int newLayer = SvtUtils.getInstance().getHelper().getValue(id, "layer"); + int newLayer = ((HpsSiSensor) rawHit.getDetectorElement()).getLayerNumber(); + if (layer != -1 && layer != newLayer) + System.out.format("TrackerHit has hits from multiple layers: %d and %d\n", layer, newLayer); + layer = newLayer; + //===> int newModule = SvtUtils.getInstance().getHelper().getValue(id, "module"); + int newModule = ((HpsSiSensor) rawHit.getDetectorElement()).getModuleNumber(); + if (module != -1 && module != newModule) + System.out.format("TrackerHit has hits from multiple modules: %d and %d\n", module, newModule); + module = newModule; +// System.out.println(SvtUtils.getInstance().getHelper().getValue(id, "strip")); + } + + if (layer == 1) + _hasLayerOne = true; + DiagonalizedCovarianceMatrix covariance = new DiagonalizedCovarianceMatrix(cl); + _nStripHitsPerLayer[layer - 1] = cl.getRawHits().size(); + _hitLocationPerLayer.put(layer, new BasicHep3Vector(hit.getPosition())); + _nhitsNew++; + + double axdotu = VecOp.dot(transformVectorToTracking(covariance.getMeasuredVector()), axial); +// System.out.println(transformVectorToTracking(new BasicHep3Vector(cl.getPosition())).toString() + transformVectorToTracking(covariance.getMeasuredVector())); + boolean isAxial = false; + if (axdotu > 0.5) { + isAxial = true; + _nAxialhits++; + } else + _nZhits++; + // get the set of MCParticles associated with this hit and update the hit count for each MCParticle + + Set mcPartList = new HashSet(); + for (RawTrackerHit rawHit : rawHits) { + Set simhits = (Set) rthtosimhit.allFrom(rawHit); + for (SimTrackerHit simhit : simhits) + if (simhit != null && simhit.getMCParticle() != null) + mcPartList.add(simhit.getMCParticle()); + } +// System.out.println("MCParticle count: " + mcPartList.size()); + _nMCHitsPerLayer[layer - 1] = mcPartList.size(); + for (MCParticle mcp : mcPartList) { + Integer mchits = 0; + if (mcmapAll.containsKey(mcp)) + mchits = mcmapAll.get(mcp); + mchits++; + mcmapAll.put(mcp, mchits); + if (isAxial) { + Integer mchitsAxial = 0; + if (mcmapAxial.containsKey(mcp)) + mchitsAxial = mcmapAxial.get(mcp); + mchitsAxial++; + mcmapAxial.put(mcp, mchitsAxial); + } else { + Integer mchitsZ = 0; + if (mcmapZ.containsKey(mcp)) + mchitsZ = mcmapZ.get(mcp); + mchitsZ++; + mcmapZ.put(mcp, mchitsZ); + } + } + } + }*/ + + private void countHit(HelicalTrack2DHit hit2d) { + _nhitsNew++; + _nAxialhits++; + List mcPartList = hit2d.getMCParticles(); + //assume that lone hits are all axial + boolean isAxial = true; + for (MCParticle mcp : mcPartList) { + Integer mchits = 0; + if (mcmapAll.containsKey(mcp)) + mchits = mcmapAll.get(mcp); + mchits++; + mcmapAll.put(mcp, mchits); + Integer mchitsAxial = 0; + if (mcmapAxial.containsKey(mcp)) + mchitsAxial = mcmapAxial.get(mcp); + mchitsAxial++; + mcmapAxial.put(mcp, mchitsAxial); + } + } + + private void checkForBadHit(HelicalTrackCross cross) { + List clusterlist = cross.getStrips(); + for (HelicalTrackStrip cl : clusterlist) { + trackLayerList.add(cl.layer()); + if (!(cl.MCParticles().contains(_mcpNew))) { + badHitList.add(cl.layer()); + badhits.put(_mcpNew, cross); + } + if (cl.MCParticles().size() > 1) + sharedHitList.add(cl.layer()); + } + } + + public static Hep3Vector clusterPosition(HelicalTrackStrip cl) { + Hep3Vector corigin = cl.origin(); + Hep3Vector u = cl.u(); + double umeas = cl.umeas(); + Hep3Vector uvec = VecOp.mult(umeas, u); + return VecOp.add(corigin, uvec); + + } + + public MCParticle getMCParticle() { + return _mcp; + } + + public int getNHits() { + return _nhits; + } + + public int getNBadHits() { + return _nbadhits; + } + + public double getPurity() { + return _purity; + } + + public MCParticle getMCParticleNew() { + return _mcpNew; + } + + public int getNHitsNew() { + return _nhitsNew; + } + + public int getNAxialHits() { + return _nAxialhits; + } + + public int getNZHits() { + return _nZhits; + } + + public int getNBadHitsNew() { + return _nbadhitsNew; + } + + public double getPurityNew() { + return _purityNew; + } + + public int getNBadAxialHits() { + return _nbadAxialhits; + } + + public int getNBadZHits() { + return _nbadZhits; + } + + public boolean hasLayerOne() { + return _hasLayerOne; + } + + public Hep3Vector getClusterPosition(Integer layer) { + return _hitLocationPerLayer.get(layer); + } + + public int getNumberOfMCParticles(int layer) { + return _nMCHitsPerLayer[layer - 1]; + } + + public int getNumberOfStripHits(int layer) { + return _nStripHitsPerLayer[layer - 1]; + } + + public List getBadHitList() { + return badHitList; + } + + public List getSharedHitList() { + return sharedHitList; + } + + public List getTrackLayerList() { + return trackLayerList; + } + + public Map getBadHits() { + return badhits; + } + + /*public static class DiagonalizedCovarianceMatrix { + + double[] measurement_errors = new double[3]; + Hep3Vector[] measurement_vectors = new Hep3Vector[3]; + + public DiagonalizedCovarianceMatrix(TrackerHit hit) { + SymmetricMatrix cov = new SymmetricMatrix(3, hit.getCovMatrix(), true); + RealMatrix covMatrix = new Array2DRowRealMatrix(3, 3); + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + covMatrix.setEntry(i, j, cov.e(i, j)); + EigenDecomposition decomposed = new EigenDecomposition(covMatrix); + BasicHep3Matrix localToGlobal = new BasicHep3Matrix(); + for (int i = 0; i < 3; i++) + for (int j = 0; j < 3; j++) + localToGlobal.setElement(i, j, decomposed.getV().getEntry(i, j)); +// SymmetricMatrix localToGlobal = decomposed.getV().operate(new ArrayRealVector(3)) + { + double eigenvalue = decomposed.getRealEigenvalue(0); +// Hep3Vector eigenvector = VecOp.mult(localToGlobal, new BasicHep3Vector()); + Hep3Vector eigenvector = VecOp.mult(Math.signum(eigenvalue), new BasicHep3Vector(decomposed.getVT().getRow(0))); + measurement_errors[0] = eigenvalue; + measurement_vectors[0] = eigenvector; + measurement_errors[2] = eigenvalue; + measurement_vectors[2] = eigenvector; + } + { + double eigenvalue = decomposed.getRealEigenvalue(1); + Hep3Vector eigenvector = VecOp.mult(Math.signum(eigenvalue), new BasicHep3Vector(decomposed.getVT().getRow(1))); + if (eigenvalue > measurement_errors[0]) { + measurement_errors[0] = eigenvalue; + measurement_vectors[0] = eigenvector; + } + if (eigenvalue < measurement_errors[2]) { + measurement_errors[2] = eigenvalue; + measurement_vectors[2] = eigenvector; + } + } + { + double eigenvalue = decomposed.getRealEigenvalue(2); + Hep3Vector eigenvector = VecOp.mult(Math.signum(eigenvalue), new BasicHep3Vector(decomposed.getVT().getRow(2))); + if (eigenvalue > measurement_errors[0]) { + measurement_errors[1] = measurement_errors[0]; + measurement_vectors[1] = measurement_vectors[0]; + measurement_errors[0] = eigenvalue; + measurement_vectors[0] = eigenvector; + } + if (eigenvalue < measurement_errors[2]) { + measurement_errors[1] = measurement_errors[2]; + measurement_vectors[1] = measurement_vectors[2]; + measurement_errors[2] = eigenvalue; + measurement_vectors[2] = eigenvector; + } + if (measurement_vectors[1] == null) { + measurement_errors[1] = eigenvalue; + measurement_vectors[1] = eigenvector; + } + } +// for (int i = 0; i < 3; i++) { +// System.out.format("%d: resolution %f, vector %s\n", i, measurement_errors[i], measurement_vectors[i].toString()); +// } + }*/ + + /*public Hep3Vector getUnmeasuredVector() { + return measurement_vectors[0]; + } + + public Hep3Vector getMeasuredVector() { + return measurement_vectors[1]; + } + + public Hep3Vector getNormalVector() { + return measurement_vectors[2]; + } + + }*/ +} diff --git a/analysis/src/main/java/org/hps/analysis/tuple/FullTruthTupleDriver.java b/analysis/src/main/java/org/hps/analysis/tuple/FullTruthTupleDriver.java new file mode 100644 index 0000000000..6f9acbc329 --- /dev/null +++ b/analysis/src/main/java/org/hps/analysis/tuple/FullTruthTupleDriver.java @@ -0,0 +1,33 @@ +package org.hps.analysis.tuple; + +import java.util.Arrays; + +import org.lcsim.event.EventHeader; + +public class FullTruthTupleDriver extends TupleDriver { + + @Override + protected void setupVariables() { + tupleVariables.clear(); + addEventVariables(); + addFullMCTridentVariables(); + addFullMCWabVariables(); + } + + protected void addEventVariables() { + String[] newVars = new String[] {"run/I", "event/I", "tupleevent/I"}; + tupleVariables.addAll(Arrays.asList(newVars)); + } + + @Override + public void process(EventHeader event) { + + fillTruthEventVariables(event); + fillMCFullTruthVariables(event); + fillMCWabVariables(event); + + if (tupleWriter != null) { + writeTuple(); + } + } +} diff --git a/analysis/src/main/java/org/hps/analysis/tuple/TridentTupleDriver.java b/analysis/src/main/java/org/hps/analysis/tuple/TridentTupleDriver.java index 86e6911b5c..ee2b1cb2eb 100644 --- a/analysis/src/main/java/org/hps/analysis/tuple/TridentTupleDriver.java +++ b/analysis/src/main/java/org/hps/analysis/tuple/TridentTupleDriver.java @@ -1,8 +1,17 @@ package org.hps.analysis.tuple; +//import hep.physics.vec.BasicHep3Vector; +//import hep.physics.vec.Hep3Vector; +//import hep.physics.vec.VecOp; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; +//import java.util.Map; +//import java.util.Map.Entry; + +//import org.hps.analysis.MC.MCFullDetectorTruth; +//import org.hps.analysis.MC.TrackTruthMatching; import org.hps.recon.particle.ReconParticleDriver; import org.hps.recon.tracking.TrackType; import org.hps.recon.vertexing.BilliorTrack; @@ -10,9 +19,13 @@ import org.hps.record.triggerbank.TIData; import org.lcsim.event.EventHeader; import org.lcsim.event.GenericObject; +//import org.lcsim.event.MCParticle; import org.lcsim.event.ReconstructedParticle; +//import org.lcsim.event.SimCalorimeterHit; +//import org.lcsim.event.SimTrackerHit; import org.lcsim.event.Track; import org.lcsim.event.TrackState; +//import org.lcsim.geometry.IDDecoder; public class TridentTupleDriver extends TupleDriver { @@ -21,6 +34,8 @@ public class TridentTupleDriver extends TupleDriver { private final double tupleTrkPCut = 0.9; private final double tupleMaxSumCut = 1.3; private boolean getMC = false; + private boolean getFullTruth = false; + private int tupleevent = 0; @Override protected void setupVariables() { @@ -29,6 +44,9 @@ protected void setupVariables() { addVertexVariables(); addParticleVariables("ele"); addParticleVariables("pos"); + if(getFullTruth){ + addFullTruthVertexVariables(); + } String[] newVars = new String[]{"minPositiveIso/D", "minNegativeIso/D", "minIso/D"}; tupleVariables.addAll(Arrays.asList(newVars)); if (getMC) { @@ -39,10 +57,16 @@ protected void setupVariables() { public void setGetMC(boolean getMC) { this.getMC = getMC; } + + public void setGetFullTruth(boolean getFullTruth) { + this.getFullTruth = getFullTruth; + } @Override public void process(EventHeader event) { /* make sure everything is there */ + tupleevent++; + //tupleMap.put("tupleevent/I",(double) tupleevent); if (!event.hasCollection(ReconstructedParticle.class, unconstrainedV0CandidatesColName)) { return; } @@ -94,10 +118,15 @@ public void process(EventHeader event) { tupleMap.put("minPositiveIso/D", minPositiveIso); tupleMap.put("minNegativeIso/D", minNegativeIso); tupleMap.put("minIso/D", minIso); + tupleMap.put("tupleevent/I",(double) tupleevent); if (getMC) { fillMCTridentVariables(event); } + + if (getFullTruth){ + fillFullVertexTruth(event,eleTrack,posTrack); + } if (tupleWriter != null) { boolean trkCut = tupleMap.get("eleP/D") < tupleTrkPCut * ebeam && tupleMap.get("posP/D") < tupleTrkPCut * ebeam; diff --git a/analysis/src/main/java/org/hps/analysis/tuple/TupleDriver.java b/analysis/src/main/java/org/hps/analysis/tuple/TupleDriver.java index 756e8bc389..d65a2f7a2b 100644 --- a/analysis/src/main/java/org/hps/analysis/tuple/TupleDriver.java +++ b/analysis/src/main/java/org/hps/analysis/tuple/TupleDriver.java @@ -5,7 +5,6 @@ import hep.physics.vec.Hep3Vector; import hep.physics.vec.HepLorentzVector; import hep.physics.vec.VecOp; - import hep.physics.matrix.Matrix; import hep.physics.matrix.MatrixOp; @@ -19,6 +18,8 @@ import org.apache.commons.lang3.StringUtils; import org.hps.analysis.ecal.MassCalculator; +import org.hps.analysis.MC.MCFullDetectorTruth; +import org.hps.analysis.MC.TrackTruthMatching; import org.hps.conditions.beam.BeamEnergy; import org.hps.recon.ecal.cluster.ClusterUtilities; import org.hps.recon.particle.HpsReconParticleDriver; @@ -38,15 +39,23 @@ import org.lcsim.event.LCRelation; import org.lcsim.event.MCParticle; import org.lcsim.event.ReconstructedParticle; +import org.lcsim.event.SimCalorimeterHit; +import org.lcsim.event.SimTrackerHit; import org.lcsim.event.Track; import org.lcsim.event.TrackState; +import org.lcsim.event.base.BaseRelationalTable; import org.lcsim.event.base.BaseTrackState; import org.lcsim.fit.helicaltrack.HelicalTrackFit; import org.lcsim.geometry.Detector; +import org.lcsim.geometry.FieldMap; +import org.lcsim.geometry.IDDecoder; import org.lcsim.util.Driver; import org.lcsim.event.RelationalTable; import org.lcsim.event.TrackerHit; + import java.util.Collection; +import java.util.Map.Entry; + import org.lcsim.detector.tracker.silicon.HpsSiSensor; import org.lcsim.event.RawTrackerHit; @@ -72,6 +81,7 @@ public abstract class TupleDriver extends Driver { private boolean applyBeamRotation = true; private final String finalStateParticlesColName = "FinalStateParticles"; + private final String trackHitMCRelationsCollectionName = "RotatedHelicalTrackMCRelations"; protected double bfield; private final double[] beamSize = {0.001, 0.130, 0.050}; // rough estimate from harp scans during engineering run // production running @@ -84,10 +94,17 @@ public abstract class TupleDriver extends Driver { protected final BasicHep3Matrix beamAxisRotation = BasicHep3Matrix.identity(); protected double ebeam = Double.NaN; private int nLay = 6; + private int nEcalHit = 3; + //private int tupleevent = 0; + FieldMap bFieldMap = null; public void setNLay(int nLay) { this.nLay = nLay; } + + public void setNEcalHit(int nEcalHit) { + this.nEcalHit = nEcalHit; + } public void setApplyBeamRotation(boolean applyBeamRotation) { this.applyBeamRotation = applyBeamRotation; @@ -177,6 +194,7 @@ protected void detectorChanged(Detector detector) { beamAxisRotation.setActiveEuler(Math.PI / 2, -0.0305, -Math.PI / 2); } bfield = TrackUtils.getBField(detector).magnitude(); + bFieldMap = detector.getFieldMap(); if (Double.isNaN(ebeam)) { try { @@ -259,7 +277,7 @@ public void setCutTuple(boolean cutTuple) { } protected void addEventVariables() { - String[] newVars = new String[] {"run/I", "event/I", "nTrk/I", "nPos/I", "nCl/I", "isCalib/B", "isPulser/B", + String[] newVars = new String[] {"run/I", "event/I", "tupleevent/I","nTrk/I", "nPos/I", "nCl/I", "isCalib/B", "isPulser/B", "isSingle0/B", "isSingle1/B", "isPair0/B", "isPair1/B", "evTime/D", "evTx/I", "evTy/I", "rfT1/D", "rfT2/D", "nEcalHits/I", "nSVTHits/I", "nEcalCl/I", "nEcalClele/I", "nEcalClpos/I", "nEcalClpho/I", "nEcalClEleSide/I", "nEcalClPosSide/I", "nSVTHitsL1/I", "nSVTHitsL2/I", "nSVTHitsL3/I", "nSVTHitsL4/I", @@ -319,9 +337,17 @@ protected void addParticleVariables(String prefix) { tupleVariables.addAll(Arrays.asList(newVars)); } + protected void fillTruthEventVariables(EventHeader event) { + tupleMap.put("run/I", (double) event.getRunNumber()); + tupleMap.put("event/I", (double) event.getEventNumber()); + //tupleMap.put("tupleevent/I", (double) tupleevent); + //tupleevent++; + } protected void fillEventVariables(EventHeader event, TIData triggerData) { tupleMap.put("run/I", (double) event.getRunNumber()); tupleMap.put("event/I", (double) event.getEventNumber()); + //tupleMap.put("tupleevent/I", (double) tupleevent); + //tupleevent++; List fspList = event.get(ReconstructedParticle.class, finalStateParticlesColName); int npos = 0; int ntrk = 0; @@ -1423,16 +1449,89 @@ protected void addMCTridentVariables() { addMCPairVariables("triPair1"); addMCPairVariables("triPair2"); } + + protected void addMCWabVariables() { + addMCParticleVariables("wab"); + addMCParticleVariables("wabEle1"); + addMCParticleVariables("wabEle2"); + addMCParticleVariables("wabPos"); + } + + protected void addFullMCTridentVariables() { + addMCTridentVariables(); + addEcalTruthVariables("triEle1"); + addEcalTruthVariables("triEle2"); + addEcalTruthVariables("triPos"); + addSVTTruthVariables("triEle1"); + addSVTTruthVariables("triEle2"); + addSVTTruthVariables("triPos"); + } + + protected void addFullMCWabVariables() { + addMCTridentVariables(); + addEcalTruthVariables("wabEle1"); + addEcalTruthVariables("wabEle2"); + addEcalTruthVariables("wabPos"); + addSVTTruthVariables("wabEle1"); + addSVTTruthVariables("wabEle2"); + addSVTTruthVariables("wabPos"); + } + + + protected void addFullTruthVertexVariables() { + addMCParticleVariables("ele"); + addMCParticleVariables("pos"); + addEcalTruthVariables("ele"); + addEcalTruthVariables("pos"); + addSVTTruthVariables("ele"); + addSVTTruthVariables("pos"); + } protected void addMCParticleVariables(String prefix) { String[] newVars = new String[] {"StartX/D", "StartY/D", "StartZ/D", "EndX/D", "EndY/D", "EndZ/D", "PX/D", - "PY/D", "PZ/D", "P/D", "M/D", "E/D"}; + "PY/D", "PZ/D", "P/D", "M/D", "E/D","pdgid/I","parentID/I","HasTruthMatch/I","NTruthHits/I","NBadTruthHits/I","Purity/D"}; for (int i = 0; i < newVars.length; i++) { newVars[i] = prefix + newVars[i]; } tupleVariables.addAll(Arrays.asList(newVars)); } + + protected void addMCSVTVariables(String prefix) { + String[] newVars = new String[] {"svthitX/D","svthitY/D","svthitZ/D", + "svthitPx/D","svthitPy/D","svthitPz/D","thetaX/D","thetaY/D","residualX/D","residualY/D"}; + for (int i = 0; i < newVars.length; i++) { + newVars[i] = prefix + newVars[i]; + } + tupleVariables.addAll(Arrays.asList(newVars)); + } + + protected void addMCEcalVariables(String prefix) { + String[] newVars = new String[]{ + "ecalhitIx/D","ecalhitIy/D","ecalhitX/D","ecalhitY/D","ecalhitZ/D", + "ecalhitEnergy/D"}; + for (int i = 0; i < newVars.length; i++) { + newVars[i] = prefix + newVars[i]; + } + tupleVariables.addAll(Arrays.asList(newVars)); + } + + protected void addEcalTruthVariables(String prefix){ + for(int i = 0; i < nEcalHit; i++){ + String hit = Integer.toString(i); + addMCEcalVariables(prefix+"Hit"+hit); + } + } + + protected void addSVTTruthVariables(String prefix){ + for(int i = 0; i < nLay*2; i++){ + String layer = Integer.toString(i+1); + addMCSVTVariables(prefix+"L"+layer+"t"); + addMCSVTVariables(prefix+"L"+layer+"b"); + addMCSVTVariables(prefix+"L"+layer+"tIn"); + addMCSVTVariables(prefix+"L"+layer+"bIn"); + } + } protected void addMCPairVariables(String prefix) { String[] newVars = new String[] {"PX/D", "PY/D", "PZ/D", "P/D", "M/D", "E/D"}; @@ -1447,11 +1546,18 @@ protected void fillMCParticleVariables(String prefix, MCParticle particle) { // System.out.format("%d %x\n", particle.getGeneratorStatus(), particle.getSimulatorStatus().getValue()); Hep3Vector start = VecOp.mult(beamAxisRotation, particle.getOrigin()); Hep3Vector end; + MCParticle parent; try { end = VecOp.mult(beamAxisRotation, particle.getEndPoint()); } catch (RuntimeException e) { end = null; } + + try { + parent = particle.getParents().get(0); + } catch (RuntimeException e) { + parent = null; + } Hep3Vector p = VecOp.mult(beamAxisRotation, particle.getMomentum()); @@ -1469,6 +1575,10 @@ protected void fillMCParticleVariables(String prefix, MCParticle particle) { tupleMap.put(prefix + "P/D", p.magnitude()); tupleMap.put(prefix + "M/D", particle.getMass()); tupleMap.put(prefix + "E/D", particle.getEnergy()); + tupleMap.put(prefix + "pdgid/I", (double) particle.getPDGID()); + if(parent != null){ + tupleMap.put(prefix + "parentID/I", (double) parent.getPDGID()); + } } protected void fillMCPairVariables(String prefix, MCParticle ele, MCParticle pos) { @@ -1476,7 +1586,7 @@ protected void fillMCPairVariables(String prefix, MCParticle ele, MCParticle pos Hep3Vector vtxP = VecOp.mult(beamAxisRotation, vtx.v3()); tupleMap.put(prefix + "PX/D", vtxP.x()); tupleMap.put(prefix + "PY/D", vtxP.y()); - tupleMap.put(prefix + "PY/D", vtxP.z()); + tupleMap.put(prefix + "PZ/D", vtxP.z()); tupleMap.put(prefix + "P/D", vtxP.magnitude()); tupleMap.put(prefix + "M/D", vtx.magnitude()); tupleMap.put(prefix + "E/D", vtx.t()); @@ -1542,4 +1652,751 @@ protected void fillMCTridentVariables(EventHeader event) { } } + + protected void fillMCWabVariables(EventHeader event) { + List MCParticles = event.getMCParticles(); + + MCParticle wab = null; + + MCParticle ele1 = null;// conversion electron daughter + MCParticle ele2 = null;// recoil wab electron + MCParticle pos = null;// conversion positron daughter + + List wabParticles = null; + + for (MCParticle particle : MCParticles) { + if (particle.getPDGID() == 22 && particle.getGeneratorStatus() == 1 && particle.getDaughters().size() == 2) { + double wabEnergy = particle.getEnergy(); + for(MCParticle p : MCParticles){ + if(p.getPDGID() != 11 || !p.getParents().isEmpty()) continue; + double eleEnergy = p.getEnergy(); + double energy = wabEnergy + eleEnergy; + if(energy < 0.98 * ebeam || energy > 1.02 * ebeam) continue; + ele2 = p; + wab = particle; + wabParticles = wab.getDaughters(); + break; + } + } + } + if (wab == null) { + return; + } + + fillMCParticleVariables("wab", wab); + + for (MCParticle particle : wabParticles) { + if(particle.getPDGID() == 11){ + pos = particle; + } + if(particle.getPDGID() == -11){ + ele1 = particle; + } + } + + if (ele1 != null) { + fillMCParticleVariables("wabEle1", ele1); + } + if (ele2 != null) { + fillMCParticleVariables("wabEle2", ele2); + } + if (pos != null) { + fillMCParticleVariables("wabPos", pos); + } + } + + protected void fillMCFullTruthVariables(EventHeader event){ + fillMCTridentVariables(event); + + // get objects and collections from event header + List trackerHits = event.get(SimTrackerHit.class, "TrackerHits"); + List trackerHits_Inactive = event.get(SimTrackerHit.class, "TrackerHits_Inactive"); + List calHits = event.get(SimCalorimeterHit.class, "EcalHits"); + List particles = event.get(MCParticle.class, "MCParticle"); + IDDecoder trackerDecoder = event.getMetaData(trackerHits).getIDDecoder(); + IDDecoder calDecoder = event.getMetaData(calHits).getIDDecoder(); + + // maps of particles to hits + //Map> trackerHitMap = new HashMap>(); + //Map> calHitMap = new HashMap>(); + + Map> trackerHitMap = MCFullDetectorTruth.BuildTrackerHitMap(trackerHits); + Map> trackerInHitMap = MCFullDetectorTruth.BuildTrackerHitMap(trackerHits_Inactive); + Map> calHitMap = MCFullDetectorTruth.BuildCalHitMap(calHits); + + for (Entry> entry : trackerInHitMap.entrySet()) { + + MCParticle p = entry.getKey(); + List hits = entry.getValue(); + + String MCprefix = MCFullDetectorTruth.MCParticleType(p, particles, ebeam); + boolean isTri = MCprefix == "triEle1" || MCprefix == "triEle2" || MCprefix == "triPos"; + boolean isWab = MCprefix == "wabEle1" || MCprefix == "wabEle2" || MCprefix == "wabPos"; + + if(!isTri && !isWab) continue; + + //if (isTri) System.out.println("Is Trident!"); + //if (isWab) System.out.println("Is Wab!"); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix; + String prefix_1 = MCprefix + layerprefix_1; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + } + + // loop over entries mapping particles to sim tracker hits + for (Entry> entry : trackerHitMap.entrySet()) { + + MCParticle p = entry.getKey(); + List hits = entry.getValue(); + + String MCprefix = MCFullDetectorTruth.MCParticleType(p, particles, ebeam); + //System.out.println(MCprefix); + boolean isTri = MCprefix == "triEle1" || MCprefix == "triEle2" || MCprefix == "triPos"; + boolean isWab = MCprefix == "wabEle1" || MCprefix == "wabEle2" || MCprefix == "wabPos"; + + if(!isTri && !isWab) continue; + + //if (isTri) System.out.println("Is Trident!"); + //if (isWab) System.out.println("Is Wab!"); + + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix; + String prefix_1 = MCprefix + layerprefix_1; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + } + + // loop over entries mapping particles to sim cal hits + for (Entry> entry : calHitMap.entrySet()) { + MCParticle p = entry.getKey(); + String MCprefix = MCFullDetectorTruth.MCParticleType(p, particles, ebeam); + List hits = entry.getValue(); + int i = 0; + for (SimCalorimeterHit hit : hits) { + calDecoder.setID(hit.getCellID()); + int ix = calDecoder.getValue("ix"); + int iy = calDecoder.getValue("iy"); + String HitNum = Integer.toString(i); + String prefix = MCprefix + "Hit" + HitNum; + tupleMap.put(prefix+"ecalhitIx/D", (double) ix); + tupleMap.put(prefix+"ecalhitIy/D", (double) iy); + tupleMap.put(prefix+"ecalhitX/D", hit.getPositionVec().x()); + tupleMap.put(prefix+"ecalhitY/D", hit.getPositionVec().y()); + tupleMap.put(prefix+"ecalhitZ/D", hit.getPositionVec().z()); + tupleMap.put(prefix+"ecalhitEnergy/D", hit.getCorrectedEnergy()); + i++; + } + } + } + + protected void fillFullVertexTruth(EventHeader event, Track eleTrack, Track posTrack){ + List trackerHits = event.get(SimTrackerHit.class, "TrackerHits"); + List trackerHits_Inactive = event.get(SimTrackerHit.class, "TrackerHits_Inactive"); + List calHits = event.get(SimCalorimeterHit.class, "EcalHits"); + //List particles = event.get(MCParticle.class, "MCParticle"); + IDDecoder trackerDecoder = event.getMetaData(trackerHits).getIDDecoder(); + IDDecoder calDecoder = event.getMetaData(calHits).getIDDecoder(); + + RelationalTable hittomc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED); + List mcrelations = event.get(LCRelation.class, trackHitMCRelationsCollectionName); + for (LCRelation relation : mcrelations) + if (relation != null && relation.getFrom() != null && relation.getTo() != null) + hittomc.add(relation.getFrom(), relation.getTo()); + + Map> trackerHitMap = MCFullDetectorTruth.BuildTrackerHitMap(trackerHits); + Map> trackerInHitMap = MCFullDetectorTruth.BuildTrackerHitMap(trackerHits_Inactive); + Map> calHitMap = MCFullDetectorTruth.BuildCalHitMap(calHits); + Map>> comboTrackerHitMap = MCFullDetectorTruth.BuildComboTrackerHitMap(trackerHits,trackerHits_Inactive); + + TrackTruthMatching eleTruth = new TrackTruthMatching(eleTrack, hittomc); + TrackTruthMatching posTruth = new TrackTruthMatching(posTrack, hittomc); + + //System.out.println(eleTruth + " " + posTruth); + + MCParticle ele = eleTruth.getMCParticle(); + MCParticle pos = posTruth.getMCParticle(); + + //if(ele == null) System.out.println("Ele no match"); + //if(pos == null) System.out.println("Pos no match"); + + if(ele == null && pos == null){ + //System.out.println("Ele or Pos is null!"); + return; + } + + if(ele != null){ + String MCprefix = "ele"; + tupleMap.put(MCprefix+"HasTruthMatch/I", (double) 1); + tupleMap.put(MCprefix+"NTruthHits/I", (double) eleTruth.getNHits()); + tupleMap.put(MCprefix+"NBadTruthHits/I", (double) eleTruth.getNBadHits()); + tupleMap.put(MCprefix+"Purity/D", eleTruth.getPurity()); + fillMCParticleVariables("ele", ele); + for (Entry>> entry : comboTrackerHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (ele != p) continue; + List hits_act = entry.getValue().get("active"); + List hits_in = entry.getValue().get("inactive"); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + int i = 0; + int k = 0; + String layerprefix_1 = ""; + // loop over particle's hits + boolean inactiveprev = false; + for (SimTrackerHit hit : hits_act) { + boolean inactive = false; + SimTrackerHit hit_act = hit; + do{ + k++; + inactive = false; + trackerDecoder.setID(hit.getCellID64()); + if(hits_in != null){ + int j = 0; + for(SimTrackerHit hit_in:hits_in){ + j++; + if(i >= j) continue; + if(hit_in.getLayer() >= hit_act.getLayer()) continue; + hit = hit_in; + inactive = true; + i = j; + break; + } + } + + if(!inactive) hit = hit_act; + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + //String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = ""; + String prefix_1 = ""; + if(!inactive){ + prefix = MCprefix + layerprefix; + } + else{ + prefix = MCprefix + layerprefix + "In"; + } + if(!inactiveprev){ + prefix_1 = MCprefix + layerprefix_1; + } + else{ + prefix_1 = MCprefix + layerprefix_1 +"In"; + } + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]); + + inactiveprev = inactive; + layerprefix_1 = layerprefix; + + if(k == 1){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } while(inactive); + } + break; + } + /*for (Entry> entry : trackerInHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (ele != p) continue; + + List hits = entry.getValue(); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix + "In"; + String prefix_1 = MCprefix + layerprefix_1 +"In"; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + break; + } + for (Entry> entry : trackerHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (ele != p) continue; + List hits = entry.getValue(); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix; + String prefix_1 = MCprefix + layerprefix_1; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + break; + }*/ + for (Entry> entry : calHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (ele != p) continue; + List hits = entry.getValue(); + int i = 0; + for (SimCalorimeterHit hit : hits) { + calDecoder.setID(hit.getCellID()); + int ix = calDecoder.getValue("ix"); + int iy = calDecoder.getValue("iy"); + String HitNum = Integer.toString(i); + String prefix = MCprefix + "Hit" + HitNum; + tupleMap.put(prefix+"ecalhitIx/D", (double) ix); + tupleMap.put(prefix+"ecalhitIy/D", (double) iy); + tupleMap.put(prefix+"ecalhitX/D", hit.getPositionVec().x()); + tupleMap.put(prefix+"ecalhitY/D", hit.getPositionVec().y()); + tupleMap.put(prefix+"ecalhitZ/D", hit.getPositionVec().z()); + tupleMap.put(prefix+"ecalhitEnergy/D", hit.getCorrectedEnergy()); + i++; + } + break; + } + } + else{ + tupleMap.put("eleHasTruthMatch/I", (double) 0); + } + + if(pos != null){ + String MCprefix = "pos"; + tupleMap.put(MCprefix+"HasTruthMatch/I", (double) 1); + tupleMap.put(MCprefix+"HasTruthMatch/I", (double) 1); + tupleMap.put(MCprefix+"NTruthHits/I", (double) posTruth.getNHits()); + tupleMap.put(MCprefix+"NBadTruthHits/I", (double) posTruth.getNBadHits()); + tupleMap.put(MCprefix+"Purity/D", posTruth.getPurity()); + fillMCParticleVariables("pos", pos); + + for (Entry>> entry : comboTrackerHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (pos != p) continue; + List hits_act = entry.getValue().get("active"); + List hits_in = entry.getValue().get("inactive"); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + int i = 0; + int k = 0; + String layerprefix_1 = ""; + // loop over particle's hits + boolean inactiveprev = false; + for (SimTrackerHit hit : hits_act) { + boolean inactive = false; + SimTrackerHit hit_act = hit; + do{ + k++; + inactive = false; + trackerDecoder.setID(hit.getCellID64()); + if(hits_in != null){ + int j = 0; + for(SimTrackerHit hit_in:hits_in){ + j++; + if(i >= j) continue; + if(hit_in.getLayer() >= hit_act.getLayer()) continue; + hit = hit_in; + inactive = true; + i = j; + break; + } + } + + if(!inactive) hit = hit_act; + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + //String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = ""; + String prefix_1 = ""; + if(!inactive){ + prefix = MCprefix + layerprefix; + } + else{ + prefix = MCprefix + layerprefix + "In"; + } + if(!inactiveprev){ + prefix_1 = MCprefix + layerprefix_1; + } + else{ + prefix_1 = MCprefix + layerprefix_1 +"In"; + } + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]); + + inactiveprev = inactive; + layerprefix_1 = layerprefix; + + if(k == 1){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } while(inactive); + } + break; + + + + /*for (Entry> entry : trackerInHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (pos != p) continue; + List hits = entry.getValue(); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix + "In"; + String prefix_1 = MCprefix + layerprefix_1 + "In"; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + break; + } + for (Entry> entry : trackerHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (pos != p) continue; + List hits = entry.getValue(); + + Hep3Vector startPosition = p.getOrigin(); + Hep3Vector startMomentum = p.getMomentum(); + + // loop over particle's hits + for (SimTrackerHit hit : hits) { + + trackerDecoder.setID(hit.getCellID64()); + + String layerprefix = MCFullDetectorTruth.trackHitLayer(hit); + String layerprefix_1 = MCFullDetectorTruth.trackHitLayer_1(hit); + String prefix = MCprefix + layerprefix; + String prefix_1 = MCprefix + layerprefix_1; + + Hep3Vector endPosition = hit.getPositionVec(); + Hep3Vector endMomentum = new BasicHep3Vector(hit.getMomentum()[0], hit.getMomentum()[1], hit.getMomentum()[2]);; + + if(hit == hits.get(0)){ + startPosition = endPosition; + startMomentum = endMomentum; + continue; + } + + double q = p.getCharge(); + Hep3Vector extrapPos = MCFullDetectorTruth.extrapolateTrackPosition(endPosition,endMomentum,startPosition,5,bFieldMap,q); + Hep3Vector extrapP = MCFullDetectorTruth.extrapolateTrackMomentum(endPosition,endMomentum,startPosition,5,bFieldMap,q); + + if(extrapP == null) continue; + + Hep3Vector startProt = VecOp.mult(beamAxisRotation, startMomentum); + Hep3Vector extrapProt = VecOp.mult(beamAxisRotation, VecOp.neg(extrapP)); + Hep3Vector endPositionrot = VecOp.mult(beamAxisRotation, endPosition); + + double thetaX = MCFullDetectorTruth.deltaThetaX(extrapProt,startProt); + double thetaY = MCFullDetectorTruth.deltaThetaY(extrapProt,startProt); + + tupleMap.put(prefix+"svthitX/D", endPositionrot.x()); + tupleMap.put(prefix+"svthitY/D", endPositionrot.y()); + tupleMap.put(prefix+"svthitZ/D", endPositionrot.z()); + tupleMap.put(prefix_1+"svthitPx/D", startProt.x()); + tupleMap.put(prefix_1+"svthitPy/D", startProt.y()); + tupleMap.put(prefix_1+"svthitPz/D", startProt.z()); + tupleMap.put(prefix_1+"thetaX/D", thetaX); + tupleMap.put(prefix_1+"thetaY/D", thetaY); + tupleMap.put(prefix_1+"residualX/D", startPosition.x()-extrapPos.x()); + tupleMap.put(prefix_1+"residualY/D", startPosition.y()-extrapPos.y()); + + startPosition = endPosition; + startMomentum = endMomentum; + } + break;*/ + } + for (Entry> entry : calHitMap.entrySet()) { + MCParticle p = entry.getKey(); + if (pos != p) continue; + List hits = entry.getValue(); + int i = 0; + for (SimCalorimeterHit hit : hits) { + calDecoder.setID(hit.getCellID()); + int ix = calDecoder.getValue("ix"); + int iy = calDecoder.getValue("iy"); + String HitNum = Integer.toString(i); + String prefix = MCprefix + "Hit" + HitNum; + tupleMap.put(prefix+"ecalhitIx/D", (double) ix); + tupleMap.put(prefix+"ecalhitIy/D", (double) iy); + tupleMap.put(prefix+"ecalhitX/D", hit.getPositionVec().x()); + tupleMap.put(prefix+"ecalhitY/D", hit.getPositionVec().y()); + tupleMap.put(prefix+"ecalhitZ/D", hit.getPositionVec().z()); + tupleMap.put(prefix+"ecalhitEnergy/D", hit.getCorrectedEnergy()); + i++; + } + break; + } + } + else{ + tupleMap.put("posHasTruthMatch/I", (double) 0); + } + } } diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221.lcdd b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221.lcdd new file mode 100644 index 0000000000..febb371fe5 --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221.lcdd @@ -0,0 +1,8392 @@ + + +
+ + + + HPS detector for 2015 Engineering Run. Start from version v1 with optical survey Curved + straight tracks Order of sensor floating: u translations, w translations, u-v-w rotations, global alignment tuning impact parameters central values (remember: z offsets must change sign!) best alignment version for 2015 data as of 170214 +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/SamplingFractions/Ecal.properties b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/SamplingFractions/Ecal.properties new file mode 100644 index 0000000000..6d1c9ac61f --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/SamplingFractions/Ecal.properties @@ -0,0 +1 @@ +samplingFraction: 1.0 diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/compact.xml b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/compact.xml new file mode 100644 index 0000000000..222792e6c6 --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/compact.xml @@ -0,0 +1,870 @@ + + + + + HPS detector for 2015 Engineering Run. + Start from version v1 with optical survey Curved + straight tracks + Order of sensor floating: u translations, w translations, + u-v-w rotations, global alignment tuning impact parameters + central values (remember: z offsets must change sign!) + best alignment version for 2015 data as of 170214 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scoring plane after ECal flange for calibration studies + + + + + + + + + + + + + + + + + + + + + + + + + + The crystal ECal + + + + + + + + + + + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + + + system:6,layer:2,ix:-8,iy:-6 + + + + + + + + + + + + + diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/detector.properties b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/detector.properties new file mode 100644 index 0000000000..2954d1ff45 --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221/detector.properties @@ -0,0 +1 @@ +name: HPS-EngRun2015-Nominal-v6-0-fieldmap_iss221 diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/HPS-EngRun2015-Nominal-v7-0-fieldmap.lcdd b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/HPS-EngRun2015-Nominal-v7-0-fieldmap.lcdd new file mode 100644 index 0000000000..ae19cf3d4c --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/HPS-EngRun2015-Nominal-v7-0-fieldmap.lcdd @@ -0,0 +1,8390 @@ + + +

+ + + + Copy of v6-fieldmap detector with inactive Si turned on. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/SamplingFractions/Ecal.properties b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/SamplingFractions/Ecal.properties new file mode 100644 index 0000000000..6d1c9ac61f --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/SamplingFractions/Ecal.properties @@ -0,0 +1 @@ +samplingFraction: 1.0 diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/compact.xml b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/compact.xml new file mode 100644 index 0000000000..86b1c1c717 --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/compact.xml @@ -0,0 +1,863 @@ + + + + + Copy of v6-fieldmap detector with inactive Si turned on. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Scoring plane after ECal flange for calibration studies + + + + + + + + + + + + + + + + + + + + + + + + + + The crystal ECal + + + + + + + + + + + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + + system:6,barrel:3,layer:4,module:12,sensor:1,side:32:-2,strip:12 + + + + + system:6,layer:2,ix:-8,iy:-6 + + + + + + + + + + + + diff --git a/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/detector.properties b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/detector.properties new file mode 100644 index 0000000000..6cd27e4233 --- /dev/null +++ b/detector-data/detectors/HPS-EngRun2015-Nominal-v7-0-fieldmap/detector.properties @@ -0,0 +1 @@ +name: HPS-EngRun2015-Nominal-v7-0-fieldmap diff --git a/detector-model/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTracker2014Base.java b/detector-model/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTracker2014Base.java index 2e7e25c7e0..9029e3a6e0 100644 --- a/detector-model/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTracker2014Base.java +++ b/detector-model/src/main/java/org/lcsim/geometry/compact/converter/lcdd/HPSTracker2014Base.java @@ -20,6 +20,7 @@ import org.lcsim.geometry.compact.converter.lcdd.util.Position; import org.lcsim.geometry.compact.converter.lcdd.util.Rotation; import org.lcsim.geometry.compact.converter.lcdd.util.SensitiveDetector; +import org.lcsim.geometry.compact.converter.lcdd.util.Tracker; import org.lcsim.geometry.compact.converter.lcdd.util.Volume; import org.lcsim.geometry.util.TransformationUtils; @@ -36,9 +37,19 @@ public abstract class HPSTracker2014Base extends LCDDSubdetector { private final double beamPlaneWidth = 385.00; private final double beamPlaneLength = 1216.00; private final double beamPlaneThickness = 0.00000001; + + private String inactiveSiReadoutName = null; + private Tracker inactiveSiTracker = null; public HPSTracker2014Base(Element c) throws JDOMException { super(c); + if (c.getAttribute("inactiveSiReadout") != null) { + this.inactiveSiReadoutName = c.getAttributeValue("inactiveSiReadout"); + } + } + + public void setInactiveSiReadoutName(String inactiveSiReadoutName) { + this.inactiveSiReadoutName = inactiveSiReadoutName; } /** @@ -49,7 +60,7 @@ public HPSTracker2014Base(Element c) throws JDOMException { * @return the builder. */ abstract protected HPSTrackerLCDDBuilder initializeBuilder(LCDD lcdd, SensitiveDetector sens); - + public boolean isTracker() { return true; } @@ -73,6 +84,17 @@ public void addToLCDD(LCDD lcdd, SensitiveDetector sens) throws JDOMException { // vee (constraints pitch & yaw) // flat (constraints roll) // / + + /** + * The sensitive detector for reading out hits from the inactive region of the + * sensor is setup here, if necessary. --JM + */ + if (this.inactiveSiReadoutName != null) { + Tracker tracker = new Tracker(this.inactiveSiReadoutName + "_det"); + tracker.setHitsCollection(this.inactiveSiReadoutName); + lcdd.addSensitiveDetector(tracker); + this.inactiveSiTracker = tracker; + } // ID of the detector. int id = node.getAttribute("id").getIntValue(); @@ -227,14 +249,14 @@ private void setupPhysicalVolumes(LCDDSurveyVolume lcddObj, LCDD lcdd, Sensitive */ private void setPhysicalVolumeProperties(LCDDSurveyVolume surveyVolume, SensitiveDetector sd) throws DataConversionException { - + if (_debug) System.out.printf("%s: setPhysVolumeProperties for name %s\n", getClass().getSimpleName(), - surveyVolume.getName()); + surveyVolume.getName()); String name = surveyVolume.getName(); if (HPSTrackerBuilder.isHalfModule(surveyVolume.getName())) { - setHalfModulePhysicalVolumeProperties(surveyVolume); + setHalfModulePhysicalVolumeProperties(surveyVolume); } else if (HPSTrackerBuilder.isActiveSensor(surveyVolume.getName())) { setActiveSensorPhysicalVolumeProperties(surveyVolume, sd); } else if (HPSTrackerBuilder.isSensor(surveyVolume.getName())) { @@ -272,6 +294,16 @@ private void setSensorPhysicalVolumeProperties(LCDDSurveyVolume surveyVolume) { private void setActiveSensorPhysicalVolumeProperties(LCDDSurveyVolume surveyVolume, SensitiveDetector sd) { surveyVolume.getPhysVolume().addPhysVolID("sensor", 0); surveyVolume.getVolume().setSensitiveDetector(sd); + + /** + * Assign inactive Si detector to half-module, which must happen after the active sensor has been processed so + * that XML elements appear in the correct order defined by the schema. --JM + */ + if (this.inactiveSiTracker != null) { + //System.out.println("Setting sens det '" + this.inactiveSiReadoutName + // + "' on inactive Si volume '" + surveyVolume.getVolume().getName() + "'"); + surveyVolume.getPhysMother().getVolume().setSensitiveDetector(this.inactiveSiTracker); + } } abstract protected int getModuleNumber(String surveyVolume); @@ -293,7 +325,6 @@ private void setHalfModulePhysicalVolumeProperties(LCDDSurveyVolume surveyVolume physVol.addPhysVolID("barrel", 0); surveyVolume.getPhysVolume().addPhysVolID("layer", layer); surveyVolume.getPhysVolume().addPhysVolID("module", moduleNumber); - } protected void makeBeamPlane(Volume motherVolume, LCDD lcdd, SensitiveDetector sens) throws JDOMException { diff --git a/ecal-readout-sim/src/main/java/org/hps/readout/ecal/InactiveSiHitReadout.java b/ecal-readout-sim/src/main/java/org/hps/readout/ecal/InactiveSiHitReadout.java new file mode 100644 index 0000000000..3bf7f611d3 --- /dev/null +++ b/ecal-readout-sim/src/main/java/org/hps/readout/ecal/InactiveSiHitReadout.java @@ -0,0 +1,40 @@ +package org.hps.readout.ecal; + +import java.util.ArrayList; +import java.util.List; + +import org.lcsim.event.EventHeader; +import org.lcsim.event.SimTrackerHit; +import org.lcsim.event.base.BaseSimTrackerHit; +import org.lcsim.lcio.LCIOConstants; + +public class InactiveSiHitReadout extends TriggerableDriver { + + private static String COLLNAME = "TrackerHits_Inactive"; + private List hits = new ArrayList(); + static final int FLAG = (1 << LCIOConstants.THBIT_MOMENTUM); + + public void process(EventHeader event) { + if (event.hasCollection(SimTrackerHit.class, COLLNAME)) { + List hits = event.get(SimTrackerHit.class, COLLNAME); + for (SimTrackerHit hit : hits) { + double hitTime = hit.getTime(); + hitTime += ClockSingleton.getTime(); + ((BaseSimTrackerHit)hit).setTime(hitTime); + } + hits.addAll(hits); + } + checkTrigger(event); + } + + @Override + protected void processTrigger(EventHeader event) { + event.put(COLLNAME, hits, SimTrackerHit.class, FLAG, "TrackerHits"); + hits.clear(); + } + + @Override + public int getTimestampType() { + return ReadoutTimestamp.SYSTEM_TRACKER; + } +} diff --git a/evio/src/main/java/org/hps/evio/TestRunTriggeredReconToLcio.java b/evio/src/main/java/org/hps/evio/TestRunTriggeredReconToLcio.java index c36c9feacb..758f2dc283 100644 --- a/evio/src/main/java/org/hps/evio/TestRunTriggeredReconToLcio.java +++ b/evio/src/main/java/org/hps/evio/TestRunTriggeredReconToLcio.java @@ -49,17 +49,22 @@ public class TestRunTriggeredReconToLcio extends TriggerableDriver { private int ecalMode = EventConstants.ECAL_PULSE_INTEGRAL_MODE; List mcParticles = null; List trackerHits = null; + List trackerHitsInactive = null; List ecalHits = null; List ecalScoringPlaneHits = null; //MC collections from the last 500n'th event (trident or preselected trigger event) List triggerMCParticles = null; List triggerTrackerHits = null; + List triggerTrackerHitsInactive = null; List triggerECalHits = null; List triggerECalScoringPlaneHits = null; + List inactiveSiHits = null; static final String ecalCollectionName = "EcalHits"; static final String trackerCollectionName = "TrackerHits"; + static final String trackerInactiveCollectionName = "TrackerHits_Inactive"; private final String relationCollectionName = "SVTTrueHitRelations"; String ecalScoringPlaneHitsCollectionName = "TrackerHitsECal"; + static final String inactiveSiCollectionName = "TrackerHits_Inactive"; private int verbosity = 1; private boolean writeSvtData = true; private boolean writeEcalData = true; @@ -200,6 +205,9 @@ protected void process(EventHeader event) { if (event.hasCollection(SimTrackerHit.class, trackerCollectionName)) { trackerHits = event.get(SimTrackerHit.class, trackerCollectionName); } + if (event.hasCollection(SimTrackerHit.class, trackerInactiveCollectionName)) { + trackerHitsInactive = event.get(SimTrackerHit.class, trackerInactiveCollectionName); + } if (event.hasCollection(SimTrackerHit.class, ecalScoringPlaneHitsCollectionName)) { ecalScoringPlaneHits = event.get(SimTrackerHit.class, ecalScoringPlaneHitsCollectionName); } @@ -211,13 +219,20 @@ protected void process(EventHeader event) { if (event.hasCollection(SimTrackerHit.class, trackerCollectionName)) { triggerTrackerHits = event.get(SimTrackerHit.class, trackerCollectionName); } + if (event.hasCollection(SimTrackerHit.class, trackerInactiveCollectionName)) { + triggerTrackerHitsInactive = event.get(SimTrackerHit.class, trackerInactiveCollectionName); + } if (event.hasCollection(SimTrackerHit.class, ecalScoringPlaneHitsCollectionName)) { triggerECalScoringPlaneHits = event.get(SimTrackerHit.class, ecalScoringPlaneHitsCollectionName); } + if (event.hasCollection(SimTrackerHit.class, inactiveSiCollectionName)) { + inactiveSiHits = event.get(SimTrackerHit.class, inactiveSiCollectionName); + } } else { triggerMCParticles = null; triggerECalHits = null; triggerTrackerHits = null; + triggerTrackerHitsInactive = null; triggerECalScoringPlaneHits = null; } } @@ -309,6 +324,12 @@ protected void processTrigger(EventHeader event) { System.out.println("Adding " + trackerHits.size() + " SimTrackerHits"); } } + if (trackerHitsInactive != null) { + lcsimEvent.put(trackerInactiveCollectionName, trackerHitsInactive, SimTrackerHit.class, 0xc0000000); + if (verbosity >= 1) { + System.out.println("Adding " + trackerHitsInactive.size() + " SimTrackerHitsInactive"); + } + } if (ecalScoringPlaneHits != null) { lcsimEvent.put(ecalScoringPlaneHitsCollectionName, ecalScoringPlaneHits, SimTrackerHit.class, 0xc0000000); if (verbosity >= 1) { @@ -332,13 +353,28 @@ protected void processTrigger(EventHeader event) { System.out.println("Adding " + triggerTrackerHits.size() + " SimTrackerHits"); } } + if (triggerTrackerHitsInactive != null) { + lcsimEvent.put(trackerInactiveCollectionName, triggerTrackerHitsInactive, SimTrackerHit.class, 0xc0000000); + if (verbosity >= 1) { + System.out.println("Adding " + triggerTrackerHitsInactive.size() + " SimTrackerHitsInactive"); + } + } if (triggerECalScoringPlaneHits != null) { lcsimEvent.put(ecalScoringPlaneHitsCollectionName, triggerECalScoringPlaneHits, SimTrackerHit.class, 0xc0000000); if (verbosity >= 1) { System.out.println("Adding " + triggerECalScoringPlaneHits.size() + " ECalTrackerHits"); } } - } + // iss221: Write inactive Si hits. --JM + if (inactiveSiHits != null) { + lcsimEvent.put(inactiveSiCollectionName, this.inactiveSiHits, SimTrackerHit.class, 0xc0000000); + if (verbosity >= 1) { + System.out.println("Adding " + this.inactiveSiHits.size() + " to " + inactiveSiCollectionName); + } + } + + } + lcsimEvent.put(ReadoutTimestamp.collectionName, event.get(ReadoutTimestamp.class, ReadoutTimestamp.collectionName)); ++eventNum; } diff --git a/steering-files/src/main/resources/org/hps/steering/analysis/MakeTuplesFullTruthMC.lcsim b/steering-files/src/main/resources/org/hps/steering/analysis/MakeTuplesFullTruthMC.lcsim new file mode 100644 index 0000000000..3ae72d51c4 --- /dev/null +++ b/steering-files/src/main/resources/org/hps/steering/analysis/MakeTuplesFullTruthMC.lcsim @@ -0,0 +1,44 @@ + + + + + + + + + + + + + SVTRawTrackerHits + + + + all + true + ${outputFile}_tri.txt + true + 0.0 + true + + + all + true + ${outputFile}_moller.txt + true + 0.0 + + + all + true + ${outputFile}_fee.txt + true + 0.0 + + + 3 + ${outputFile}_fulltruth.txt + + + \ No newline at end of file diff --git a/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1_Pass2.lcsim b/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1_Pass2.lcsim index 99349d595d..c5a1b19207 100644 --- a/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1_Pass2.lcsim +++ b/steering-files/src/main/resources/org/hps/steering/readout/EngineeringRun2015TrigPairs1_Pass2.lcsim @@ -12,6 +12,7 @@ + @@ -72,7 +73,7 @@ 0.600 1 ${outputFile}.triggers.pairs1 - + true false @@ -91,5 +92,6 @@ true 1 +