Print

Print


Probably you want to change clusterCollectionName to tridentCollectionName here:

> tridentCandidates = event.get(ReconstructedParticle.class, clusterCollectionName);

(fyi, the filename you mentioned looks like a pass2 file).



On Oct 25, 2015, at 14:16, Kyle McCarty <[log in to unmask]> wrote:

> Hello hps-software,
> 
> I am trying to look at V0 candidate particles.According to confluence (https://confluence.slac.stanford.edu/display/hpsg/MC+Recon+Collection+Definitions), the collection for (say, unconstrained) V0 candidates is "UnconstrainedV0Candidates" and should be of type "ReconstructedParticle."
> 
> When running on this collection, however, I get ClassCastException errors. I tried this code to check the object type of the collection:
> 
>         String tridentCollectionName = "UnconstrainedV0Candidates";
>         List<ReconstructedParticle> tridentCandidates = null;
>         if(event.hasCollection(ReconstructedParticle.class, tridentCollectionName)) {
>             tridentCandidates = event.get(ReconstructedParticle.class, clusterCollectionName);
>         } else {
>             tridentCandidates = new ArrayList<ReconstructedParticle>(0);
>         }
>         
>         for(Object o : tridentCandidates) {
>             System.out.println(o.getClass().getName());
>         }
> 
> It outputs "org.lcsim.lcio.SIOCluster" as the object type of V0 candidate collection. Can anyone assist me with figuring out what is wrong here? Am I accessing something incorrectly? I am using the file "hps_005772.10_recon_R340.slcio" (should be from pass-3) if that helps.
> 
> Thanks,
> 
> Kyle
> 
> Use REPLY-ALL to reply to list
> 
> To unsubscribe from the HPS-SOFTWARE list, click the following link:
> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1
> 

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the HPS-SOFTWARE list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=HPS-SOFTWARE&A=1