Linear Collider Forum



Home » Software Tools » org.lcsim » EventHeader.get() and EventHeader.put()
Re: EventHeader.get() and EventHeader.put() [message #392 is a reply to message #391] Tue, 15 November 2005 17:14 Go to previous messageGo to previous message
tonyj
Messages: 138
Registered: January 2004

Hi Mat,

you can't do what you want with the get(Class,String) method since it is specifically for use with the (common) case of returning a List of objects.

There are howver generic put and get methods (inherited from HEPEvent) that can be used with any object, but you will need to do a cast when you extract the object:

   Map<Cluster, Cluster> clusterMap;
   event.put("MyClusterMap",clusterMap);

   clusterMap =(Map<Cluster, Cluster>) event.get("MyClusterMap");
 


One thing to note, such object will not be saved if the event is written out, since they have no LCIO mapping. If you only want them for transient analysis that is fine, but if you need them to be persisted that could be a problem. Since clusters can point to child clusters perhaps that would be a better solution in this case?

Tony

 
Read Message
Read Message
Read Message
Previous Topic:using Id tags for CVS
Next Topic:LCSim Event Viewer not available
Goto Forum:
  


Current Time: Sat Feb 22 05:50:43 Pacific Standard Time 2020
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software