Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add import statements to code example

...

Example without strong photon ID

Here is a code snippet showing a photon-finder in action:

No Format

// Some of the import statements:
import org.lcsim.recon.cluster.mipfinder.TrackClusterDriver;
import org.lcsim.recon.cluster.util.ClusterFirstLayerDecision;
import org.lcsim.recon.pfa.identifier.MIPChargedParticleMaker;
import org.lcsim.recon.pfa.identifier.SimpleTrackMIPClusterMatcher;
import org.lcsim.recon.cluster.mst.MSTPhotonFinderDriver;
import org.lcsim.recon.pfa.identifier.SimpleNeutralParticleMaker;

// Find MIP candidates in ECAL, starting near the front:
TrackClusterDriver ecalFrontSideMIPs = new TrackClusterDriver("input hit map ecal", "front-side mips ecal", "hit map ecal without front-side mips");
ecalFrontSideMIPs.filterOutputClusters(new ClusterFirstLayerDecision(4));
add(ecalFrontSideMIPs);

// Check if they match a track (ugly... don't need to make the particles!)
MIPChargedParticleMaker mipHadID = new MIPChargedParticleMaker();
SimpleTrackMIPClusterMatcher mipMatch = new SimpleTrackMIPClusterMatcher();
add(mipMatch);
mipHadID.setTrackMatcher(mipMatch);
mipHadID.setInputTrackList(trackList);
mipHadID.setOutputTrackList("tracks left over from front-side mips");
mipHadID.setInputMIPList("front-side mips ecal");
mipHadID.setOutputMIPList("mips minus front-side mips ecal");
mipHadID.setOutputParticleList("front-side mip particles");
add(mipHadID);

// Isolate the genuine (charged) MIPs from the rest
ClusterListFilterDriver filterRemoveChargedMIPs = new ClusterListFilterDriver();
VetoClustersFromParticles vetoChargedMIPs = new VetoClustersFromParticles("front-side mip particles"); // veto MIPs
filterRemoveChargedMIPs.setInputDecision(vetoChargedMIPs);
filterRemoveChargedMIPs.setInputList("front-side mips ecal");
filterRemoveChargedMIPs.setOutputList("neutral front-side mips ecal");
add(vetoChargedMIPs);
add(filterRemoveChargedMIPs);

// Merge the non-charged "MIP" hits back in
ClusterListToHitMapDriver convertFakeMIPsToHitMap = new ClusterListToHitMapDriver("neutral front-side mips ecal", "hit map ecal of neutral front-side mips");
add(convertFakeMIPsToHitMap);
HitMapAddDriver addFakeMIPHitsBack = new HitMapAddDriver();
addFakeMIPHitsBack.addInputHitMap("hit map ecal of neutral front-side mips");
addFakeMIPHitsBack.addInputHitMap("hit map ecal without front-side mips");
addFakeMIPHitsBack.setOutputHitMap("hit map ecal without charged front-side mips");
add(addFakeMIPHitsBack);

// Find photons
MSTPhotonFinderDriver photonFinder = new MSTPhotonFinderDriver();
photonFinder.setCoreThreshold(7.5);
photonFinder.setFragmentThreshold(7.5);
photonFinder.setLayerProximityThreshold(2);
photonFinder.setCoreSizeMinimum(10);
photonFinder.setFragmentSizeMaximum(6);
photonFinder.setInputHitMap("hit map ecal without charged front-side mips");
photonFinder.setOutputHitMap("hit map ecal without photons or charged front-side mips");
photonFinder.setOutputClusterList("photon clusters");
add(photonFinder);

// Make into particles
SimpleNeutralParticleMaker myPhotonIdentifier = new SimpleNeutralParticleMaker(22); // 22 = photon
myPhotonIdentifier.setInputClusterList("photon clusters");
myPhotonIdentifier.setOutputParticleList("photon particles");
add(myPhotonIdentifier);

...