All Packages Class Hierarchy This Package Previous Next Index
Class hep.analysis.Cut
java.lang.Object
|
+----hep.analysis.Cut
- public abstract class Cut
- extends Object
- implements NamedObject
This class allows event analyzers and generators to use an adjustable
discriminator in processing events. If for example, you wanted to
include all values below a certain number, you might want to use a
DoubleCut
object. You could then dynamically modify
the criteria for the cut and view the corresponding changes in the
results of the analysis. You must extend this class to get a meaningful
cut.
- See Also:
- DoubleCut
-
Cut(String)
- Uses the default folder.
-
Cut(String, CutFolder)
-
-
apply(boolean)
- Returns whether a given
boolean
value should be included in
the cut.
-
apply(Date)
- Returns whether a given date should be included in
the cut.
-
apply(double)
- Returns whether a given
double
value should be included in
the cut.
-
apply(int)
- Returns whether a given
int
value should be included in
the cut.
-
apply(Object)
- Returns whether a given object should be included in
the cut.
-
apply(String)
- Returns whether a given string should be included in
the cut.
-
clearPartition()
- Call before the first event on all cuts to clear the partition.
-
destroyPartition()
- Destroy the partition if it exists.
-
getConstructor(CutProperties, String)
- Override and return a constructor that corresponds to the given properties.
-
getDescription(CutProperties, String)
- Override and return a description that corresponds to the given properties.
-
getName()
-
-
getPartition()
- Override and return the partition your cut keeps if it keeps a partition.
-
getPeer()
-
-
getProperties()
- Return a
CutProperties
object that encapsulates the current properties.
-
getType()
- Return a string that describes the type.
-
getValuesApplied()
- Returns an object that the application can use to display the values applied
to the cut.
-
partitionDone()
- Call after the last event on all cuts to get the last partition updates.
-
setPeer(NamedObjectPeer)
-
-
setProperties(CutProperties)
- Set the properties to those specified by the parameter
prop
.
Cut
public Cut(String name)
- Uses the default folder.
Cut
public Cut(String name,
CutFolder parent)
getName
public String getName()
setPeer
public void setPeer(NamedObjectPeer peer)
getPeer
public NamedObjectPeer getPeer()
apply
public boolean apply(double value) throws CutTypeException
- Returns whether a given
double
value should be included in
the cut. The default definition throws a CutTypeException
so override the default definition to support cuts of type double
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
double
apply
public boolean apply(int value) throws CutTypeException
- Returns whether a given
int
value should be included in
the cut. The default definition throws a CutTypeException
so override the default definition to support cuts of type int
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
int
apply
public boolean apply(Date value) throws CutTypeException
- Returns whether a given date should be included in
the cut. The default definition throws a
CutTypeException
so override the default definition to support cuts of type Date
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
Date
apply
public boolean apply(boolean value) throws CutTypeException
- Returns whether a given
boolean
value should be included in
the cut. The default definition throws a CutTypeException
so override the default definition to support cuts of type boolean
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
boolean
apply
public boolean apply(String value) throws CutTypeException
- Returns whether a given string should be included in
the cut. The default definition throws a
CutTypeException
so override the default definition to support cuts of type String
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
String
apply
public boolean apply(Object value) throws CutTypeException
- Returns whether a given object should be included in
the cut. The default definition throws a
CutTypeException
so override the default definition to support cuts of type Object
.
- Parameters:
- value - the value to test
- Returns:
- whether the paramater
value
is included in the cut
- Throws: CutTypeException
- thrown by default. You must override to support type
Object
getType
public abstract String getType()
- Return a string that describes the type. The client will look for a class named
jas.swingstudio.<type>CutDialog
when trying to show a dialog.
setProperties
public abstract void setProperties(CutProperties prop)
- Set the properties to those specified by the parameter
prop
.
getProperties
public abstract CutProperties getProperties()
- Return a
CutProperties
object that encapsulates the current properties.
getConstructor
public static String getConstructor(CutProperties prop,
String name)
- Override and return a constructor that corresponds to the given properties.
getDescription
public static String getDescription(CutProperties prop,
String name)
- Override and return a description that corresponds to the given properties.
clearPartition
public final void clearPartition()
- Call before the first event on all cuts to clear the partition.
partitionDone
public final void partitionDone()
- Call after the last event on all cuts to get the last partition updates.
destroyPartition
public abstract void destroyPartition()
- Destroy the partition if it exists. This function is called when the cut will
no longer be used, so the partition should be emptied to promote garbage collection.
getValuesApplied
public Object getValuesApplied()
- Returns an object that the application can use to display the values applied
to the cut. If the return value from
getPartition
is
null
then this method returns null
- an instance of Abstract1DPartition then this method returns a
Rebinnable1DHistogramData
- something else, this method returns
null
- See Also:
- getPartition
getPartition
protected Partition getPartition()
- Override and return the partition your cut keeps if it keeps a partition. The default
implementation returns
null
. You must
- fill this partition when
apply
is called
- initialize it after a properties change requires creating one
- destroy it after a properties change requires no partition or
destroyPartition()
is called
- set it to
null
after it's destroyed
Some operations are performed automatically:
- it will be cleared for you when
clearPartition()
is called on the cut, which is called
automatically by the cut peer when a job is rewound
done()
will be called on the partition when partitionDone()
is called,
which occurs automatically by the cut peer when a job finishes
All Packages Class Hierarchy This Package Previous Next Index