lcsim/src/org/lcsim/recon/cluster/analysis
diff -u -r1.2 -r1.3
--- ClusterMCPInfo.java 12 Oct 2005 17:01:04 -0000 1.2
+++ ClusterMCPInfo.java 18 Oct 2005 13:48:11 -0000 1.3
@@ -30,11 +30,16 @@
private MCPClusterInfo maxMCPC;
/**
+ *@param c - cluster for which this object is created
+ *@param fsmap - map of MCParticle to final state MCParticle
*/
public ClusterMCPInfo(BasicCluster c, Map<MCParticle,MCParticle> fsmap)
{
thisCluster = c;
contributers = new HashMap();
+//
+// Loop over all the Calorimeter hits in this cluster
+//
for(CalorimeterHit h:c.getCalorimeterHits())
{
SimCalorimeterHit simhit = (SimCalorimeterHit) h;
@@ -42,6 +47,9 @@
double totecorr = simhit.getCorrectedEnergy();
double toteraw = simhit.getRawEnergy();
Map<MCParticle,Double> pemap = new HashMap<MCParticle,Double>();
+//
+// Loop over the MCParticle contributions to the hit
+//
for(int i=0;i<simhit.getMCParticleCount();i++)
{
MCParticle p = fsmap.get(simhit.getMCParticle(i));
@@ -58,6 +66,9 @@
}
pemap.put(p,ce);
}
+//
+// For each contibuter to the hit, fill (or create and fill) a contribution object
+//
for(MCParticle p:pemap.keySet())
{
if(contributers.containsKey(p))
@@ -72,6 +83,9 @@
cc.addEcorrected(totecorr*pemap.get(p).doubleValue()/toteraw);
}
}
+//
+// Create and fill a MCParticle array of contributers
+//
NMCP = contributers.size();
mcparts = new MCParticle[NMCP];
int ipart = 0;
@@ -82,6 +96,8 @@
}
}
/**
+ * Fill in the necessary information after the MCPClusterInfo objects are
+ * filled.
*/
public void FillInfo(Map<MCParticle,MCPClusterInfo> m)
{
@@ -89,11 +105,18 @@
maxErawContribution = 0.;
nPrimary = 0;
nFragment = 0;
+//
+// Loop over the contributers
+//
for(MCParticle p:contributers.keySet())
{
MCPClusterInfo ci = m.get(p);
Contributions co = contributers.get(p);
if(ci.isFinalState())co.setFS();
+//
+// If this cluster is the contributers maximum cluster, call it a primary. Otherwise
+// call it a fragment
+//
if(thisCluster == ci.getMaxCluster())
{
co.setPrimary();
@@ -104,6 +127,9 @@
co.setFragment();
nFragment++;
}
+//
+// Store the maximum contributer to this cluster
+//
int nh = co.getNhits();
if(nh > maxNhits)
{
@@ -129,6 +155,9 @@
fragments = new MCParticle[nFragment];
int iprim = 0;
int ifrag = 0;
+//
+// Set a pointer to this object for all the primaries
+//
for(MCParticle p:contributers.keySet())
{
Contributions co = contributers.get(p);
lcsim/src/org/lcsim/recon/cluster/analysis
diff -u -r1.2 -r1.3
--- CreateClusterAnalysisLists.java 12 Oct 2005 17:01:04 -0000 1.2
+++ CreateClusterAnalysisLists.java 18 Oct 2005 13:48:11 -0000 1.3
@@ -13,6 +13,8 @@
import hep.physics.vec.*;
/**
+ * Driver to create and write to event list of objects referencing MCParticles
+ * to Clusters, and Clusters to MCParticles.
* @author Ron Cassell
*/
public class CreateClusterAnalysisLists extends Driver
@@ -30,7 +32,8 @@
* @param pclist
* @param cplist
*/
- public CreateClusterAnalysisLists(String[] calhitlists,String[] clusterlists,String fslist,String pclist,String cplist)
+ public CreateClusterAnalysisLists(String[] calhitlists,String[] clusterlists,
+ String fslist,String pclist,String cplist)
{
hitlistnames = calhitlists;
clusterlistnames = clusterlists;
lcsim/src/org/lcsim/recon/cluster/analysis
diff -u -r1.2 -r1.3
--- MCPClusterInfo.java 12 Oct 2005 17:00:33 -0000 1.2
+++ MCPClusterInfo.java 18 Oct 2005 13:48:11 -0000 1.3
@@ -33,6 +33,8 @@
private ClusterMCPInfo MaxCMCP;
/**
+ * @param p - MCParticle for which this object is created
+ * @param FSmap - map of MCParticle to final state MCParticle
*/
public MCPClusterInfo(MCParticle p,Map<MCParticle,MCParticle> FSmap)
{
@@ -131,10 +133,18 @@
TotalEraw += rawE;
TotalEcorrected += h.getCorrectedEnergy()*rawE/h.getRawEnergy();
}
+ /*
+ *set a pointer to the ClusterMCPInfo object for tor the maximum cluster
+ *for this particle
+ */
public void setMaxCMCP(ClusterMCPInfo ci)
{
MaxCMCP = ci;
}
+ /*
+ *get a pointer to the ClusterMCPInfo object for tor the maximum cluster
+ *for this particle
+ */
public ClusterMCPInfo getMaxCMCP()
{
return MaxCMCP;