lcsim-contrib/src/main/java/org/lcsim/contrib/Mbussonn
diff -u -r1.1 -r1.2
--- JetDriverExtended.java 8 Jun 2009 18:29:05 -0000 1.1
+++ JetDriverExtended.java 8 Jun 2009 18:44:44 -0000 1.2
@@ -26,7 +26,7 @@
* A simple driver which can be used to find jets from ReconstructedParticles.
* The resuslting jets are stored in a new collection of ReconstructedParticles.
* @author tonyj
- * @version $Id: JetDriverExtended.java,v 1.1 2009/06/08 18:29:05 mbussonn Exp $
+ * @version $Id: JetDriverExtended.java,v 1.2 2009/06/08 18:44:44 mbussonn Exp $
*/
public class JetDriverExtended extends Driver
{
@@ -114,13 +114,12 @@
for(MCParticle mcp : event.getMCParticles()){
if(mcp.getGeneratorStatus()==MCParticle.FINAL_STATE){
- MCReconstructedParticle rcp = new MCReconstructedParticle(mcp);
- input.add(rcp);
- MyLCRelation lcr = new MyLCRelation(rcp, mcp);
- rc2mc.add(lcr);
+ MCReconstructedParticle rcp = new MCReconstructedParticle(mcp); // reconstruct particle from mcp
+ input.add(rcp); // for further treatment in this driver
+ MyLCRelation lcr = new MyLCRelation(rcp, mcp); // new relation ship
+ rc2mc.add(lcr); // array of relationship written on this file line 213
+ collectionOfRCP.add(rcp); // list of rcp written line 211
System.out.println("lcr to string mcp :"+lcr.getTo().toString()+" rcp "+lcr.getFrom().getClass());
- collectionOfRCP.add(rcp);
- System.out.println("adding rcp -> "+collectionOfRCP.size());
totalEnergy += mcp.getEnergy();
}
@@ -210,9 +209,9 @@
// Add the list of jets to the event
- event.put("collectionOfRCP",collectionOfRCP,ReconstructedParticle.class,0);
- event.put(outputCollectionName, output, ReconstructedParticle.class, 0);
- event.put("rc2mc", rc2mc, LCRelation.class, 0);
+ event.put("collectionOfRCP",collectionOfRCP,ReconstructedParticle.class,0);//the collection which is sometime empty
+ event.put(outputCollectionName, output, ReconstructedParticle.class, 0); //another collection which always works
+ event.put("rc2mc", rc2mc, LCRelation.class, 0); //the array of relationship sometimes empty
}
private class Jet implements ReconstructedParticle
{
lcsim-contrib/src/main/java/org/lcsim/contrib/Mbussonn
diff -u -r1.2 -r1.3
--- JetFinder.java 8 Jun 2009 18:29:05 -0000 1.2
+++ JetFinder.java 8 Jun 2009 18:44:44 -0000 1.3
@@ -64,8 +64,8 @@
}
//******ajoute une ralation entre reconstructed particle and mcp ********//
RelationalTable rc2mc = new BaseRelationalTable(RelationalTable.Mode.MANY_TO_MANY, RelationalTable.Weighting.UNWEIGHTED);
- List<LCRelation> rcmcfe = event.get(LCRelation.class, "rc2mc");
- for (LCRelation relation : rcmcfe) {
+ List<LCRelation> rcmcfe = event.get(LCRelation.class, "rc2mc");//collection of relation is onyread once here
+ for (LCRelation relation : rcmcfe) { // the collection of rcp is not load anywhere
rc2mc.add(relation.getFrom(), relation.getTo());
}