Hello Sho, You're right; that was stupid of me. I copied the name to the first if statement, and missed doing so for the second instance. Also, that file name does not sound like pass3 - it's probably pass2. > That might be; I couldn't remember for sure which it was. Thanks, Kyle On Sun, Oct 25, 2015 at 2:23 PM, Sho Uemura <[log in to unmask]> wrote: > tridentCandidates = event.get(ReconstructedParticle.class, > clusterCollectionName); > > you're using clusterCollectionName. > > Also, that file name does not sound like pass3 - it's probably pass2. > > > On Sun, 25 Oct 2015, Kyle McCarty 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