Search/Navigation:
Related:
SLAC/EPP
/HPS Public
Jefferson Lab/Hall B
/HPS Run Wiki
S30XL-LESA/LDMX
...
Code Block | ||
---|---|---|
| ||
public void process(EventHeader event) { List<CalorimeterHit> hits = event.get(CalorimeterHit.class, "EcalHits"); for (CalorimeterHit hit : hits) { System.out.println("calorimeter hit has energy " + hit.getCorrectedEnergy() + " GeV."); } } |
You may also get all collections of a given type by not providing a collection name which will return a "list of lists."
Code Block | ||
---|---|---|
| ||
public void process(EventHeader event) { List<List<CalorimeterHit>> collections = event.get(CalorimeterHit.class); for (List<CalorimeterHit> hits : collections) { for (CalorimeterHit hit : hits) { System.out.println("calorimeter hit has energy " + hit.getCorrectedEnergy() + " GeV."); } } } |
Each collection in the event has an associated metadata object with information about it.
Code Block | ||
---|---|---|
| ||
public void process(EventHeader event) { List<List<CalorimeterHit>> collections = event.get(CalorimeterHit.class); for (List<CalorimeterHit> hits : collections) { System.out.println("found Calorimeter collection: " + event.getMetaData(hits).getName()); } } |
You must provide the list object as a key.
New collections can be added to the event using the put method of EventHeader.
...
Flags is an integer bit mask with values defined in the LCIOConstants class.
Histogramming of event data can be done using the AIDA utility class which provides a simplified wrapper to the AIDA plotting interface.
Code Block | ||
---|---|---|
| ||
private AIDA aida = AIDA.getInstance();
public void process(EventHeader event) {
List<CalorimeterHit> hits = event.get(CalorimeterHit.class, "EcalHits");
for (CalorimeterHit hit : hits) {
aida.cloud1D("Cal Hit Energy").fill(hit.getCorrectedEnergy();
}
} |
AIDA provides facilities for creating 1, 2 and 3D histograms, clouds, profiles, tuples, fitting and other functionality. (Refer to the API documentation for full details.)