Skip to content

Commit

Permalink
Merge pull request #239 from JeffersonLab/iss221
Browse files Browse the repository at this point in the history
Iss221: Support readout of inactive Si regions in SVT sensors
  • Loading branch information
JeremyMcCormick authored Nov 8, 2017
2 parents 6700493 + 90f22bb commit 687bca9
Show file tree
Hide file tree
Showing 18 changed files with 20,593 additions and 11 deletions.
524 changes: 524 additions & 0 deletions analysis/src/main/java/org/hps/analysis/MC/MCFullDetectorTruth.java

Large diffs are not rendered by default.

467 changes: 467 additions & 0 deletions analysis/src/main/java/org/hps/analysis/MC/TrackTruthMatching.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
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;
import org.hps.record.triggerbank.AbstractIntData;
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 {

Expand All @@ -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() {
Expand All @@ -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) {
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 687bca9

Please sign in to comment.