public class LayerWeight extends Object
Modifier and Type | Field and Description |
---|---|
private double |
adjacence_multiplier |
private double |
default_weight |
private double |
defaultEfficiency |
private boolean |
divideByTwoInTrackerEndcap |
private boolean |
divideByTwoInTrackerForward |
private Map<String,Double> |
readout_efficiencies |
private String |
targetDetector |
private Map<DumbLayer,Double> |
weights |
Constructor and Description |
---|
LayerWeight() |
LayerWeight(DumbLayer[] layers,
double[] wghts,
String[] readoutNames,
double[] readoutEfficiencies) |
LayerWeight(LayerWeight lw) |
Modifier and Type | Method and Description |
---|---|
private void |
checkReadoutEfficiencyValid(double d) |
double |
getAdjacenceMultiplier() |
Comparator |
getComparator() |
static String |
getDefaultResourcePrefix()
Returns the prefix of the default resource path to where the
layer weight XML files are stored.
|
private static LayerWeight |
getLayerWeightFromDocument(org.jdom.Document doc) |
static LayerWeight |
getLayerWeightFromFile(File file)
Loads LayerWeight definitions from the specified file.
|
static LayerWeight |
getLayerWeightFromInputStream(InputStream in)
Loads LayerWeight definitions from the specified input stream
|
static LayerWeight |
getLayerWeightFromResource(String resourceName)
Loads LayerWeight definitions from the resource with the specified name.
|
double |
getReadoutEfficiency(String readoutName) |
String |
getTargetDetector() |
double |
getWeight(DumbLayer layer) |
double |
getWeight(Set<DumbLayer> set) |
boolean |
isDivideByTwoInTrackerEndcap() |
boolean |
isDivideByTwoInTrackerForward() |
void |
setAdjacenceMultiplier(double adjacence_multiplier) |
void |
setDefaultReadoutEfficiency(double d) |
void |
setDefaultWeight(double d) |
void |
setDivideByTwoInTrackerEndcap(boolean divideByTwo) |
void |
setDivideByTwoInTrackerForward(boolean divideByTwo) |
void |
setReadoutEfficiency(String readoutName,
double eff) |
void |
setTargetDetector(String name) |
void |
setWeight(DumbLayer lyr,
double weight) |
boolean |
writeToFile(File file)
Writes this LayerWeight to an XML file with a location specified
by the given file object.
|
private double default_weight
private double adjacence_multiplier
private double defaultEfficiency
private String targetDetector
private boolean divideByTwoInTrackerEndcap
private boolean divideByTwoInTrackerForward
public LayerWeight()
public LayerWeight(LayerWeight lw)
public void setDefaultWeight(double d)
public void setDefaultReadoutEfficiency(double d)
public void setWeight(DumbLayer lyr, double weight)
public void setReadoutEfficiency(String readoutName, double eff)
public void setTargetDetector(String name)
public String getTargetDetector()
public double getWeight(DumbLayer layer)
public double getReadoutEfficiency(String readoutName)
public double getAdjacenceMultiplier()
public void setAdjacenceMultiplier(double adjacence_multiplier)
public boolean isDivideByTwoInTrackerEndcap()
public void setDivideByTwoInTrackerEndcap(boolean divideByTwo)
public boolean isDivideByTwoInTrackerForward()
public void setDivideByTwoInTrackerForward(boolean divideByTwo)
public static String getDefaultResourcePrefix()
public static LayerWeight getLayerWeightFromResource(String resourceName)
resourceName
- the full name of the resource file to readpublic Comparator getComparator()
public static LayerWeight getLayerWeightFromInputStream(InputStream in)
in
- an input stream corresponding to a valid XML filepublic static LayerWeight getLayerWeightFromFile(File file)
file
- a valid XML file specifying layer weightsprivate void checkReadoutEfficiencyValid(double d)
private static LayerWeight getLayerWeightFromDocument(org.jdom.Document doc)
public boolean writeToFile(File file)
file
- output File objectCopyright © 2016 Linear Collider Detector (LCD). All rights reserved.