Commit in projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis on MAIN | |||
ReconstructedParticleAnalysis.java | +32 | -6 | 3278 -> 3279 |
added map connecting CalorimeterHit to SimCalorimeterHit
--- projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/ReconstructedParticleAnalysis.java 2014-08-19 22:39:37 UTC (rev 3278) +++ projects/lcsim/trunk/analysis/src/main/java/org/lcsim/analysis/ReconstructedParticleAnalysis.java 2014-08-26 22:10:41 UTC (rev 3279) @@ -1,10 +1,20 @@
package org.lcsim.analysis;
+import java.util.ArrayList; +import java.util.HashMap;
import java.util.List;
+import java.util.Map; +import org.lcsim.event.CalorimeterHit; +import org.lcsim.event.Cluster;
import org.lcsim.event.EventHeader;
+import org.lcsim.event.LCRelation;
import org.lcsim.event.MCParticle; import org.lcsim.event.ReconstructedParticle;
+import org.lcsim.event.SimCalorimeterHit; +import org.lcsim.event.base.BaseLCRelation;
import org.lcsim.util.Driver;
+import static org.lcsim.util.Driver.HLEVEL_FULL; +import static org.lcsim.util.Driver.HLEVEL_NORMAL;
import org.lcsim.util.aida.AIDA; /**
@@ -23,14 +33,21 @@
{ // The Monte carlo Particles List<MCParticle> mcparts = event.getMCParticles();
- for(MCParticle mcp : mcparts) - {
+ for (MCParticle mcp : mcparts) {
// only book final state particles here...
- if(mcp.getGeneratorStatus() == MCParticle.FINAL_STATE) - { - aida.cloud1D("MC final state PDG ID").fill(mcp.getPDGID()); - }
+ if (mcp.getGeneratorStatus() == MCParticle.FINAL_STATE) { + aida.cloud1D("MC final state PDG ID").fill(mcp.getPDGID()); + }
}
+ // need to set up the relation between CalorimeterHit ans SimCalorimeterHit + List<LCRelation> caloHitSimHitRelation = event.get(LCRelation.class, "CalorimeterHitRelations"); + Map<CalorimeterHit, SimCalorimeterHit> simhitmap = new HashMap<CalorimeterHit, SimCalorimeterHit>(); + for (LCRelation relation : caloHitSimHitRelation) { + CalorimeterHit digiHit = (CalorimeterHit) relation.getFrom(); + SimCalorimeterHit simHit = (SimCalorimeterHit) relation.getTo(); + simhitmap.put(digiHit, simHit); + } +
// the ReconstructedParticles List<ReconstructedParticle> rplist = event.get(ReconstructedParticle.class, "PandoraPFOCollection"); aida.cloud1D("Number of ReconstructedParticles found").fill(rplist.size());
@@ -38,6 +55,15 @@
aida.cloud1D("Energy").fill(rp.getEnergy()); int id = rp.getType(); aida.cloud1D("Cluster Energy pid= " + id).fill(rp.getEnergy());
+ List<Cluster> clusters = rp.getClusters(); + for (Cluster clus : clusters) { + List<CalorimeterHit> hits = clus.getCalorimeterHits(); + for (CalorimeterHit hit : hits) { + //get the SimCalorimeterHit that corresponds to this hit + SimCalorimeterHit simHit = simhitmap.get(hit); + // TODO: flesh out the analysis here... + } + }
} } }
Use REPLY-ALL to reply to list
To unsubscribe from the LCDET-SVN list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCDET-SVN&A=1