Print

Print


Hi,

More on clustering fix up....

I have implemented the energy ordering for ReconClusterer (used to be called IC) and SimpleReconClusterer (used to be ICBasic).

My clustering tests indicate it is working fine.

I used Holly's energy comparator to disambiguate when the energies are exactly equal.

There is a utility method to sort in place all the hits in this way easily now.

 org.hps.recon.ecal.cluster.ClusterUtilities.sortReconClusterHits(List<Cluster> clusters)

BTW, there is a bug in the comparator as it is written...

if (e[0] < e[1]) {
    return 1;
} else if (e[0] > e[1]) {
     return -1;
}

In fact, if the first argument is less than the second, -1 should be returned, so you have reversed the convention here.

See doc for Comparator.

http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html

" a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second."

I basically copied your comparator to a nested class in ClusterUtilities, but perhaps this is the reason the ordering was not correct.

--Jeremy

-----Original Message-----
From: McCormick, Jeremy I. 
Sent: Monday, January 05, 2015 9:17 PM
To: 'Kyle McCarty'
Cc: Holly Vance
Subject: RE: about calorimeter hit lists in clusters

The important thing is always having the seed hit first in the list so we can count on this as a convention.

Ordering subsequent hits isn't necessary if you don't feel like it.  :)

-----Original Message-----
From: Kyle McCarty [mailto:[log in to unmask]] 
Sent: Monday, January 05, 2015 9:04 PM
To: McCormick, Jeremy I.
Cc: Holly Vance
Subject: Re: about calorimeter hit lists in clusters

Hello Jeremy,


My algorithm should already have the seed hit as the first hit in the cluster, but it does not order any subsequent hits by energy. Is there a particular reason that this needs to be done? I understand placing the seed hit fist, so that we can access it without the cluster object separately storing the seed reference, but what is the advantage of ordering the entire list?


Thanks,

Kyle


On Mon, Jan 5, 2015 at 11:58 PM, McCormick, Jeremy I. <[log in to unmask]> wrote:


	Hi,
	
	I have a fairly urgent request....
	
	Can you make it a priority that the CalorimeterHit lists in your output clusters are ordered correctly in your clustering algorithms?
	
	This should be energy ordered from greatest to least energy, with the seed hit first.
	
	The reason is that the seed hit is not persisted from an HPSEcalCluster so you have to recover this when reading the LCIO back in (e.g. for analysis).
	
	So it would be best if by convention we simply had the the first hit in the list be the seed.
	
	Please do this on the code within this package.
	
	org.hps.recon.ecal.cluster
	
	We're going to deprecate and remove the old Driver classes soon so don't bother modifying them.
	
	--Jeremy
	



########################################################################
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