Documentation ¶
Overview ¶
Package lcio provides read/write access to the LCIO data model.
Index ¶
- Constants
- Variables
- func ID(ptr interface{}) uint32
- type BlockDescr
- type CalorimeterHit
- type CalorimeterHitContainer
- type CellIDDecoder
- type Cluster
- type ClusterContainer
- type Contrib
- type Event
- type EventHeader
- type Flags
- type FloatVec
- type GenericObject
- type GenericObjectData
- type Hit
- type Index
- type IntVec
- type McParticle
- func (mc *McParticle) EndPoint() [3]float64
- func (mc *McParticle) Energy() float64
- func (mc *McParticle) HasLeftDetector() bool
- func (mc *McParticle) IsBackScatter() bool
- func (mc *McParticle) IsCreatedInSimulation() bool
- func (mc *McParticle) IsDecayedInCalorimeter() bool
- func (mc *McParticle) IsDecayedInTracker() bool
- func (mc *McParticle) IsOverlay() bool
- func (mc *McParticle) IsStopped() bool
- func (mc *McParticle) MarshalSio(w sio.Writer) error
- func (mc *McParticle) SimStatusString() string
- func (mc *McParticle) UnmarshalSio(r sio.Reader) error
- func (mc *McParticle) VersionSio() uint32
- func (mc *McParticle) VertexIsNotEnpointOfParent() bool
- type McParticleContainer
- type Offset
- type Params
- type ParticleID
- type RandomAccess
- type RawCalorimeterHit
- type RawCalorimeterHitContainer
- type Reader
- type RecParticle
- type RecParticleContainer
- type References
- type Relation
- type RelationContainer
- type RunHeader
- type SimCalorimeterHit
- type SimCalorimeterHitContainer
- type SimTrackerHit
- type SimTrackerHitContainer
- type StrVec
- type Track
- type TrackContainer
- type TrackState
- type TrackerData
- type TrackerDataContainer
- type TrackerHit
- type TrackerHitContainer
- type TrackerHitPlane
- type TrackerHitPlaneContainer
- type TrackerHitZCylinder
- type TrackerHitZCylinderContainer
- type TrackerPulse
- type TrackerPulseContainer
- type TrackerRawData
- type TrackerRawDataContainer
- type Vertex
- type VertexContainer
- type Writer
Examples ¶
Constants ¶
const ( MajorVersion uint32 = 2 MinorVersion uint32 = 8 Version uint32 = (MajorVersion << 16) + MinorVersion )
Variables ¶
Functions ¶
Types ¶
type BlockDescr ¶
BlockDescr describes a SIO block. BlockDescr provides the name of the SIO block and the type name of the data stored in that block.
type CalorimeterHit ¶
type CalorimeterHit struct { CellID0 int32 CellID1 int32 Energy float32 EnergyErr float32 Time float32 Pos [3]float32 Type int32 Raw Hit }
func (*CalorimeterHit) GetCellID0 ¶
func (hit *CalorimeterHit) GetCellID0() int32
func (*CalorimeterHit) GetCellID1 ¶
func (hit *CalorimeterHit) GetCellID1() int32
type CalorimeterHitContainer ¶
type CalorimeterHitContainer struct { Flags Flags Params Params Hits []CalorimeterHit }
CalorimeterHitContainer is a collection of calorimeter hits.
func (*CalorimeterHitContainer) MarshalSio ¶
func (hits *CalorimeterHitContainer) MarshalSio(w sio.Writer) error
func (CalorimeterHitContainer) String ¶
func (hits CalorimeterHitContainer) String() string
func (*CalorimeterHitContainer) UnmarshalSio ¶
func (hits *CalorimeterHitContainer) UnmarshalSio(r sio.Reader) error
func (*CalorimeterHitContainer) VersionSio ¶
func (*CalorimeterHitContainer) VersionSio() uint32
type CellIDDecoder ¶
type CellIDDecoder struct {
// contains filtered or unexported fields
}
CellIDDecoder decodes cell IDs from a Hit cell-ID
func NewCellIDDecoder ¶
func NewCellIDDecoder(codec string) *CellIDDecoder
func NewCellIDDecoderFrom ¶
func NewCellIDDecoderFrom(params Params) *CellIDDecoder
func (*CellIDDecoder) Get ¶
func (dec *CellIDDecoder) Get(hit Hit, name string) int64
func (*CellIDDecoder) Value ¶
func (dec *CellIDDecoder) Value(hit Hit) int64
func (*CellIDDecoder) ValueString ¶
func (dec *CellIDDecoder) ValueString(hit Hit) string
type Cluster ¶
type Cluster struct { // Type of cluster: // - bits 31-16: ECAL, HCAL, COMBINED, LAT, LCAL // - bits 15-00: NEUTRAL, CHARGED, UNDEFINED Type int32 Energy float32 // energy of the cluster EnergyErr float32 // energy error of the cluster Pos [3]float32 // center of cluster (x,y,z) PosErr [6]float32 // covariance matrix of position Theta float32 // intrinsic direction: theta at position Phi float32 // intrinsic direction: phi at position DirErr [3]float32 // covariance matrix of direct Shape []float32 // shape parameters, defined in collection parameter 'ShapeParameterNames' PIDs []ParticleID Clusters []*Cluster // clusters combined into this cluster Hits []*CalorimeterHit // hits that made this cluster Weights []float32 // energy fraction of the hit that contributed to this cluster SubDetEnes []float32 // energy observed in a particular subdetector }
type ClusterContainer ¶
ClusterContainer is a collection of clusters.
func (*ClusterContainer) MarshalSio ¶
func (clus *ClusterContainer) MarshalSio(w sio.Writer) error
func (ClusterContainer) String ¶
func (clus ClusterContainer) String() string
func (*ClusterContainer) UnmarshalSio ¶
func (clus *ClusterContainer) UnmarshalSio(r sio.Reader) error
func (*ClusterContainer) VersionSio ¶
func (*ClusterContainer) VersionSio() uint32
type Contrib ¶
type Contrib struct { Mc *McParticle Energy float32 Time float32 PDG int32 StepPos [3]float32 }
type Event ¶
type Event struct { RunNumber int32 EventNumber int32 TimeStamp int64 Detector string Params Params // contains filtered or unexported fields }
Event holds informations about an LCIO event. Event also holds collection data for that event.
func (*Event) Add ¶
Add attaches the (pointer to the) data ptr to this event, with the given name. Add panics if there is already some data labelled with the same name. Add panics if ptr is not a pointer to some data.
func (*Event) Get ¶
Get returns the event data labelled name.
func (*Event) Has ¶
Has returns whether this event has data named name.
func (*Event) Names ¶
Names returns the event data labels that define this event.
type EventHeader ¶
type EventHeader struct { RunNumber int32 EventNumber int32 TimeStamp int64 Detector string Blocks []BlockDescr Params Params }
EventHeader provides metadata about an Event.
func (*EventHeader) MarshalSio ¶
func (hdr *EventHeader) MarshalSio(w sio.Writer) error
func (*EventHeader) String ¶
func (hdr *EventHeader) String() string
func (*EventHeader) UnmarshalSio ¶
func (hdr *EventHeader) UnmarshalSio(r sio.Reader) error
func (*EventHeader) VersionSio ¶
func (*EventHeader) VersionSio() uint32
func (*EventHeader) Weight ¶
func (hdr *EventHeader) Weight() float64
type Flags ¶
type Flags uint32
Flags are bit patterns describing detector and simulation states.
const ( BitsChLong Flags = 1 << 31 // long(1) - short(0), (position) BitsChBarrel Flags = 1 << 30 // barrel(1) - endcap(0) BitsChID1 Flags = 1 << 29 // cellid1 stored BitsChPDG Flags = 1 << 28 // PDG(1) - no PDG(0) (detailed shower contributions) // DEPRECATED: use ChBitStep BitsChStep Flags = 1 << 28 // detailed shower contributions )
Flags for SimCalorimeterHit (CH)
const ( BitsRChLong Flags = 1 << 31 // long(1) - short(0), incl./excl. position BitsRChBarrel Flags = 1 << 30 // barrel(1) - endcap(0) BitsRChID1 Flags = 1 << 29 // cellid1 stored BitsRChNoPtr Flags = 1 << 28 // 1: pointer tag not added BitsRChTime Flags = 1 << 27 // 1: time information stored BitsRChEnergyError Flags = 1 << 26 // 1: store energy error )
Flags for the (raw) Calorimeter hits
const ( BitsTRawID1 Flags = 1 << 31 // cellid1 stored BitsTRawCM Flags = 1 << 30 // covariant matrix stored(1) - not stored(0) )
Flags for the (raw) tracker data (pulses)
const ( BitsThBarrel Flags = 1 << 31 // barrel(1) - endcap(0) BitsThMomentum Flags = 1 << 30 // momentum of particle stored(1) - not stored(0) BitsThID1 Flags = 1 << 29 // cellid1 stored )
Flags for the SimTrackerHit
const ( BitsTPCRaw Flags = 1 << 31 // raw data stored(1) - not stored(0) BitsTPCNoPtr Flags = 1 << 30 // 1: pointer tag not added (needed for TrackerHit) )
Flags for the TPCHit
const (
BitsClHits Flags = 1 << 31 // hits stored(1) - not stored(0)
)
Flags for the Cluster
const (
BitsGOFixed Flags = 1 << 31 // is fixed size
)
Flags for GenericObject
const (
BitsRThID1 Flags = 1 << 31 // cellid1 stored
)
Flags for the raw tracker hit
const (
BitsRelWeighted Flags = 1 << 31 // relation has weights
)
Flags for Relation
const (
BitsThPID1 Flags = 1 << 31 // cellid1 stored
)
Flags for the tracker hit plane
const (
BitsThZID1 Flags = 1 << 31 // cellid1 stored
)
Flags for the tracker hit z-cylinder
const (
BitsTrHits Flags = 1 << 31 // hits stored(1) - not stored(0)
)
Flags for the Tracks
type FloatVec ¶
type GenericObject ¶
type GenericObject struct { Flag Flags Params Params Data []GenericObjectData }
func (*GenericObject) MarshalSio ¶
func (obj *GenericObject) MarshalSio(w sio.Writer) error
func (GenericObject) String ¶
func (obj GenericObject) String() string
func (*GenericObject) UnmarshalSio ¶
func (obj *GenericObject) UnmarshalSio(r sio.Reader) error
func (*GenericObject) VersionSio ¶
func (*GenericObject) VersionSio() uint32
type GenericObjectData ¶
func (*GenericObjectData) String ¶
func (obj *GenericObjectData) String() string
type Hit ¶
Hit is an abstract Hit in the LCIO event data model.
type Index ¶
type IntVec ¶
type McParticle ¶
type McParticle struct { Parents []*McParticle Children []*McParticle PDG int32 GenStatus int32 SimStatus uint32 Vertex [3]float64 Time float32 // creation time of the particle in ns P [3]float64 // Momentum at production vertex Mass float64 Charge float32 PEndPoint [3]float64 // momentum at end-point Spin [3]float32 ColorFlow [2]int32 // contains filtered or unexported fields }
func (*McParticle) EndPoint ¶
func (mc *McParticle) EndPoint() [3]float64
func (*McParticle) Energy ¶
func (mc *McParticle) Energy() float64
func (*McParticle) HasLeftDetector ¶
func (mc *McParticle) HasLeftDetector() bool
func (*McParticle) IsBackScatter ¶
func (mc *McParticle) IsBackScatter() bool
func (*McParticle) IsCreatedInSimulation ¶
func (mc *McParticle) IsCreatedInSimulation() bool
func (*McParticle) IsDecayedInCalorimeter ¶
func (mc *McParticle) IsDecayedInCalorimeter() bool
func (*McParticle) IsDecayedInTracker ¶
func (mc *McParticle) IsDecayedInTracker() bool
func (*McParticle) IsOverlay ¶
func (mc *McParticle) IsOverlay() bool
func (*McParticle) IsStopped ¶
func (mc *McParticle) IsStopped() bool
func (*McParticle) MarshalSio ¶
func (mc *McParticle) MarshalSio(w sio.Writer) error
func (*McParticle) SimStatusString ¶
func (mc *McParticle) SimStatusString() string
func (*McParticle) UnmarshalSio ¶
func (mc *McParticle) UnmarshalSio(r sio.Reader) error
func (*McParticle) VersionSio ¶
func (mc *McParticle) VersionSio() uint32
func (*McParticle) VertexIsNotEnpointOfParent ¶
func (mc *McParticle) VertexIsNotEnpointOfParent() bool
type McParticleContainer ¶
type McParticleContainer struct { Flags Flags Params Params Particles []McParticle }
McParticleContainer is a collection of monte-carlo particles.
func (*McParticleContainer) LinkSio ¶
func (mc *McParticleContainer) LinkSio(vers uint32) error
func (*McParticleContainer) MarshalSio ¶
func (mc *McParticleContainer) MarshalSio(w sio.Writer) error
func (McParticleContainer) String ¶
func (mcs McParticleContainer) String() string
func (*McParticleContainer) UnmarshalSio ¶
func (mc *McParticleContainer) UnmarshalSio(r sio.Reader) error
func (*McParticleContainer) VersionSio ¶
func (*McParticleContainer) VersionSio() uint32
type Offset ¶
type Params ¶
type ParticleID ¶
type RandomAccess ¶
type RawCalorimeterHit ¶
func (*RawCalorimeterHit) GetCellID0 ¶
func (hit *RawCalorimeterHit) GetCellID0() int32
func (*RawCalorimeterHit) GetCellID1 ¶
func (hit *RawCalorimeterHit) GetCellID1() int32
type RawCalorimeterHitContainer ¶
type RawCalorimeterHitContainer struct { Flags Flags Params Params Hits []RawCalorimeterHit }
RawCalorimeterHitContainer is a collection of raw calorimeter hits.
func (*RawCalorimeterHitContainer) MarshalSio ¶
func (hits *RawCalorimeterHitContainer) MarshalSio(w sio.Writer) error
func (RawCalorimeterHitContainer) String ¶
func (hits RawCalorimeterHitContainer) String() string
func (*RawCalorimeterHitContainer) UnmarshalSio ¶
func (hits *RawCalorimeterHitContainer) UnmarshalSio(r sio.Reader) error
func (*RawCalorimeterHitContainer) VersionSio ¶
func (*RawCalorimeterHitContainer) VersionSio() uint32
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Example ¶
package main import ( "fmt" "io" "log" "go-hep.org/x/hep/lcio" ) func main() { r, err := lcio.Open("testdata/event_golden.slcio") if err != nil { log.Fatal(err) } defer r.Close() for r.Next() { evt := r.Event() fmt.Printf("event number = %d (weight=%+e)\n", evt.EventNumber, evt.Weight()) fmt.Printf("run number = %d\n", evt.RunNumber) fmt.Printf("detector = %q\n", evt.Detector) fmt.Printf("collections = %v\n", evt.Names()) calohits := evt.Get("CaloHits").(*lcio.CalorimeterHitContainer) fmt.Printf("calohits: %d\n", len(calohits.Hits)) for i, hit := range calohits.Hits { fmt.Printf(" calohit[%d]: cell-id0=%d cell-id1=%d ene=%+e ene-err=%+e\n", i, hit.CellID0, hit.CellID1, hit.Energy, hit.EnergyErr, ) } } err = r.Err() if err == io.EOF { err = nil } if err != nil { log.Fatal(err) } }
Output: event number = 52 (weight=+4.200000e+01) run number = 42 detector = "my detector" collections = [McParticles SimCaloHits CaloHits] calohits: 1 calohit[0]: cell-id0=1024 cell-id1=2048 ene=+1.000000e+03 ene-err=+1.000000e-01
func (*Reader) EventHeader ¶
func (r *Reader) EventHeader() EventHeader
type RecParticle ¶
type RecParticle struct { Type int32 P [3]float32 // momentum (Px,PyPz) Energy float32 // energy of particle Cov [10]float32 // covariance matrix for 4-vector (Px,Py,Pz,E) Mass float32 // mass of object used for 4-vector Charge float32 // charge of particle Ref [3]float32 // reference point of 4-vector PIDs []ParticleID PIDUsed *ParticleID GoodnessOfPID float32 // overall quality of the particle identification Recs []*RecParticle Tracks []*Track Clusters []*Cluster StartVtx *Vertex // start vertex associated to the particle }
type RecParticleContainer ¶
type RecParticleContainer struct { Flags Flags Params Params Parts []RecParticle }
RecParticleContainer is a collection of RecParticles.
func (*RecParticleContainer) MarshalSio ¶
func (recs *RecParticleContainer) MarshalSio(w sio.Writer) error
func (*RecParticleContainer) String ¶
func (recs *RecParticleContainer) String() string
func (*RecParticleContainer) UnmarshalSio ¶
func (recs *RecParticleContainer) UnmarshalSio(r sio.Reader) error
func (*RecParticleContainer) VersionSio ¶
func (*RecParticleContainer) VersionSio() uint32
type References ¶
func (*References) MarshalSio ¶
func (refs *References) MarshalSio(w sio.Writer) error
func (*References) UnmarshalSio ¶
func (refs *References) UnmarshalSio(r sio.Reader) error
func (*References) VersionSio ¶
func (*References) VersionSio() uint32
type RelationContainer ¶
func (*RelationContainer) MarshalSio ¶
func (rc *RelationContainer) MarshalSio(w sio.Writer) error
func (RelationContainer) String ¶
func (rc RelationContainer) String() string
func (*RelationContainer) UnmarshalSio ¶
func (rc *RelationContainer) UnmarshalSio(r sio.Reader) error
func (*RelationContainer) VersionSio ¶
func (*RelationContainer) VersionSio() uint32
type RunHeader ¶
type RunHeader struct { RunNumber int32 Detector string Descr string SubDetectors []string Params Params }
RunHeader provides metadata about a Run.
type SimCalorimeterHit ¶
type SimCalorimeterHit struct { Params Params CellID0 int32 CellID1 int32 Energy float32 Pos [3]float32 Contributions []Contrib }
func (*SimCalorimeterHit) GetCellID0 ¶
func (hit *SimCalorimeterHit) GetCellID0() int32
func (*SimCalorimeterHit) GetCellID1 ¶
func (hit *SimCalorimeterHit) GetCellID1() int32
type SimCalorimeterHitContainer ¶
type SimCalorimeterHitContainer struct { Flags Flags Params Params Hits []SimCalorimeterHit }
SimCalorimeterHitContainer is a collection of simulation calorimter hits.
func (*SimCalorimeterHitContainer) MarshalSio ¶
func (hits *SimCalorimeterHitContainer) MarshalSio(w sio.Writer) error
func (SimCalorimeterHitContainer) String ¶
func (hits SimCalorimeterHitContainer) String() string
func (*SimCalorimeterHitContainer) UnmarshalSio ¶
func (hits *SimCalorimeterHitContainer) UnmarshalSio(r sio.Reader) error
func (*SimCalorimeterHitContainer) VersionSio ¶
func (*SimCalorimeterHitContainer) VersionSio() uint32
type SimTrackerHit ¶
type SimTrackerHit struct { CellID0 int32 CellID1 int32 // second word for cell ID Pos [3]float64 EDep float32 // energy deposited on the hit Time float32 Mc *McParticle Momentum [3]float32 PathLength float32 Quality int32 }
func (*SimTrackerHit) GetCellID0 ¶
func (hit *SimTrackerHit) GetCellID0() int32
func (*SimTrackerHit) GetCellID1 ¶
func (hit *SimTrackerHit) GetCellID1() int32
type SimTrackerHitContainer ¶
type SimTrackerHitContainer struct { Flags Flags Params Params Hits []SimTrackerHit }
SimTrackerHitContainer is a collection of simulated tracker hits.
func (*SimTrackerHitContainer) MarshalSio ¶
func (hits *SimTrackerHitContainer) MarshalSio(w sio.Writer) error
func (SimTrackerHitContainer) String ¶
func (hits SimTrackerHitContainer) String() string
func (*SimTrackerHitContainer) UnmarshalSio ¶
func (hits *SimTrackerHitContainer) UnmarshalSio(r sio.Reader) error
func (*SimTrackerHitContainer) VersionSio ¶
func (*SimTrackerHitContainer) VersionSio() uint32
type StrVec ¶
type Track ¶
type Track struct { Type int32 // type of track (e.g TPC, VTX, SIT) States []TrackState Chi2 float32 // chi^2 of fit NdF int32 // ndf of fit DEdx float32 // dEdx DEdxErr float32 // error of dEdx Radius float32 // radius of innermost hit used in track fit SubDetHits []int32 // number of hits in particular sub-detectors Tracks []*Track // tracks that have been combined into this track Hits []*TrackerHit }
type TrackContainer ¶
TrackContainer is a collection of tracks.
func (*TrackContainer) MarshalSio ¶
func (trks *TrackContainer) MarshalSio(w sio.Writer) error
func (*TrackContainer) String ¶
func (trks *TrackContainer) String() string
func (*TrackContainer) UnmarshalSio ¶
func (trks *TrackContainer) UnmarshalSio(r sio.Reader) error
func (*TrackContainer) VersionSio ¶
func (*TrackContainer) VersionSio() uint32
type TrackState ¶
type TrackState struct { Loc int32 // location of the track state D0 float32 // impact parameter in r-phi Phi float32 // phi of track in r-phi Omega float32 // curvature signed with charge Z0 float32 // impact parameter in r-z TanL float32 // tangent of dip angle in r-z Cov [15]float32 // covariance matrix Ref [3]float32 // reference point (x,y,z) }
type TrackerData ¶
func (*TrackerData) GetCellID0 ¶
func (data *TrackerData) GetCellID0() int32
func (*TrackerData) GetCellID1 ¶
func (data *TrackerData) GetCellID1() int32
type TrackerDataContainer ¶
type TrackerDataContainer struct { Flags Flags // bits 0-15 are user/detector specific Params Params Data []TrackerData }
func (*TrackerDataContainer) MarshalSio ¶
func (tds *TrackerDataContainer) MarshalSio(w sio.Writer) error
func (*TrackerDataContainer) String ¶
func (tds *TrackerDataContainer) String() string
func (*TrackerDataContainer) UnmarshalSio ¶
func (tds *TrackerDataContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerDataContainer) VersionSio ¶
func (*TrackerDataContainer) VersionSio() uint32
type TrackerHit ¶
type TrackerHit struct { CellID0 int32 CellID1 int32 Type int32 // type of Track; encoded in parameters TrackerHitTypeName+TrackerHit TypeValue Pos [3]float64 Cov [6]float64 // covariance matrix of position (x,y,z) EDep float32 // energy deposit on the hit EDepErr float32 // error measured on EDep Time float32 Quality int32 // quality flag word RawHits []Hit }
func (*TrackerHit) GetCellID0 ¶
func (hit *TrackerHit) GetCellID0() int32
func (*TrackerHit) GetCellID1 ¶
func (hit *TrackerHit) GetCellID1() int32
type TrackerHitContainer ¶
type TrackerHitContainer struct { Flags Flags Params Params Hits []TrackerHit }
TrackerHitContainer is a collection of tracker hits.
func (*TrackerHitContainer) MarshalSio ¶
func (hits *TrackerHitContainer) MarshalSio(w sio.Writer) error
func (TrackerHitContainer) String ¶
func (hits TrackerHitContainer) String() string
func (*TrackerHitContainer) UnmarshalSio ¶
func (hits *TrackerHitContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerHitContainer) VersionSio ¶
func (*TrackerHitContainer) VersionSio() uint32
type TrackerHitPlane ¶
type TrackerHitPlane struct { CellID0 int32 CellID1 int32 Type int32 // type of Track; encoded in parameters TrackerHitTypeName+TrackerHit TypeValue Pos [3]float64 U [2]float32 V [2]float32 DU float32 // measurement error along u DV float32 // measurement error along v EDep float32 // energy deposit on the hit EDepErr float32 // error measured on EDep Time float32 Quality int32 // quality flag word RawHits []*RawCalorimeterHit }
func (*TrackerHitPlane) GetCellID0 ¶
func (hit *TrackerHitPlane) GetCellID0() int32
func (*TrackerHitPlane) GetCellID1 ¶
func (hit *TrackerHitPlane) GetCellID1() int32
type TrackerHitPlaneContainer ¶
type TrackerHitPlaneContainer struct { Flags Flags Params Params Hits []TrackerHitPlane }
TrackerHitPlaneContainer is a collection of tracker hit planes.
func (*TrackerHitPlaneContainer) MarshalSio ¶
func (hits *TrackerHitPlaneContainer) MarshalSio(w sio.Writer) error
func (TrackerHitPlaneContainer) String ¶
func (hits TrackerHitPlaneContainer) String() string
func (*TrackerHitPlaneContainer) UnmarshalSio ¶
func (hits *TrackerHitPlaneContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerHitPlaneContainer) VersionSio ¶
func (*TrackerHitPlaneContainer) VersionSio() uint32
type TrackerHitZCylinder ¶
type TrackerHitZCylinder struct { CellID0 int32 CellID1 int32 Type int32 // type of Track; encoded in parameters TrackerHitTypeName+TrackerHit TypeValue Pos [3]float64 Center [2]float32 DRPhi float32 // measurement error along RPhi DZ float32 // measurement error along z EDep float32 // energy deposit on the hit EDepErr float32 // error measured on EDep Time float32 Quality int32 // quality flag word RawHits []Hit }
func (*TrackerHitZCylinder) GetCellID0 ¶
func (hit *TrackerHitZCylinder) GetCellID0() int32
func (*TrackerHitZCylinder) GetCellID1 ¶
func (hit *TrackerHitZCylinder) GetCellID1() int32
type TrackerHitZCylinderContainer ¶
type TrackerHitZCylinderContainer struct { Flags Flags Params Params Hits []TrackerHitZCylinder }
TrackerHitZCylinderContainer is a collection of tracker hit z-cylinders.
func (*TrackerHitZCylinderContainer) MarshalSio ¶
func (hits *TrackerHitZCylinderContainer) MarshalSio(w sio.Writer) error
func (TrackerHitZCylinderContainer) String ¶
func (hits TrackerHitZCylinderContainer) String() string
func (*TrackerHitZCylinderContainer) UnmarshalSio ¶
func (hits *TrackerHitZCylinderContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerHitZCylinderContainer) VersionSio ¶
func (*TrackerHitZCylinderContainer) VersionSio() uint32
type TrackerPulse ¶
type TrackerPulse struct { CellID0 int32 CellID1 int32 Time float32 // time of pulse Charge float32 // charge of pulse Cov [3]float32 // covariance matrix of charge (c) and time (t) measurements Quality int32 // quality flag word TPC *TrackerData // TPC corrected data: spectrum used to create this pulse }
func (*TrackerPulse) GetCellID0 ¶
func (hit *TrackerPulse) GetCellID0() int32
func (*TrackerPulse) GetCellID1 ¶
func (hit *TrackerPulse) GetCellID1() int32
type TrackerPulseContainer ¶
type TrackerPulseContainer struct { Flags Flags Params Params Pulses []TrackerPulse }
func (*TrackerPulseContainer) MarshalSio ¶
func (ps *TrackerPulseContainer) MarshalSio(w sio.Writer) error
func (*TrackerPulseContainer) String ¶
func (ps *TrackerPulseContainer) String() string
func (*TrackerPulseContainer) UnmarshalSio ¶
func (ps *TrackerPulseContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerPulseContainer) VersionSio ¶
func (*TrackerPulseContainer) VersionSio() uint32
type TrackerRawData ¶
func (*TrackerRawData) GetCellID0 ¶
func (data *TrackerRawData) GetCellID0() int32
func (*TrackerRawData) GetCellID1 ¶
func (data *TrackerRawData) GetCellID1() int32
type TrackerRawDataContainer ¶
type TrackerRawDataContainer struct { Flags Flags // bits 0-15 are user/detector specific Params Params Data []TrackerRawData }
func (*TrackerRawDataContainer) MarshalSio ¶
func (trs *TrackerRawDataContainer) MarshalSio(w sio.Writer) error
func (*TrackerRawDataContainer) String ¶
func (tds *TrackerRawDataContainer) String() string
func (*TrackerRawDataContainer) UnmarshalSio ¶
func (trs *TrackerRawDataContainer) UnmarshalSio(r sio.Reader) error
func (*TrackerRawDataContainer) VersionSio ¶
func (*TrackerRawDataContainer) VersionSio() uint32
type Vertex ¶
type Vertex struct { Primary int32 // primary vertex of the event AlgType int32 // algorithm type Chi2 float32 // Chi^2 of vertex Prob float32 // probability of the fit Pos [3]float32 // position of the vertex (Px,Py,Pz) Cov [6]float32 // covariance matrix Params []float32 RecPart *RecParticle // reconstructed particle associated to the vertex }
type VertexContainer ¶
VertexContainer is a collection of vertices
func (*VertexContainer) MarshalSio ¶
func (vtxs *VertexContainer) MarshalSio(w sio.Writer) error
func (VertexContainer) String ¶
func (vtxs VertexContainer) String() string
func (*VertexContainer) UnmarshalSio ¶
func (vtxs *VertexContainer) UnmarshalSio(r sio.Reader) error
func (*VertexContainer) VersionSio ¶
func (*VertexContainer) VersionSio() uint32
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer provides a way to write LCIO RunHeaders and Events to an output SIO stream.
Example ¶
package main import ( "fmt" "log" "go-hep.org/x/hep/lcio" ) func main() { w, err := lcio.Create("out.slcio") if err != nil { log.Fatal(err) } defer w.Close() run := lcio.RunHeader{ RunNumber: 42, Descr: "a simple run header", Detector: "my detector", SubDetectors: []string{"det-1", "det-2"}, Params: lcio.Params{ Floats: map[string][]float32{ "floats-1": {1, 2, 3}, "floats-2": {4, 5, 6}, }, }, } err = w.WriteRunHeader(&run) if err != nil { log.Fatal(err) } const NEVENTS = 1 for ievt := 0; ievt < NEVENTS; ievt++ { evt := lcio.Event{ RunNumber: run.RunNumber, Detector: run.Detector, EventNumber: 52 + int32(ievt), TimeStamp: 1234567890 + int64(ievt), Params: lcio.Params{ Floats: map[string][]float32{ "_weight": {42}, }, Strings: map[string][]string{ "Descr": {"a description"}, }, }, } calhits := lcio.CalorimeterHitContainer{ Flags: lcio.BitsRChLong | lcio.BitsRChID1 | lcio.BitsRChTime | lcio.BitsRChNoPtr | lcio.BitsRChEnergyError, Params: lcio.Params{ Floats: map[string][]float32{"f32": {1, 2, 3}}, Ints: map[string][]int32{"i32": {1, 2, 3}}, Strings: map[string][]string{"str": {"1", "2", "3"}}, }, Hits: []lcio.CalorimeterHit{ { CellID0: 1024, CellID1: 2048, Energy: 1000, EnergyErr: 0.1, Time: 1234, Pos: [3]float32{11, 22, 33}, Type: 42, }, }, } evt.Add("CaloHits", &calhits) fmt.Printf("evt has key %q: %v\n", "CaloHits", evt.Has("CaloHits")) err = w.WriteEvent(&evt) if err != nil { log.Fatal(err) } } err = w.Close() if err != nil { log.Fatal(err) } }
Output: evt has key "CaloHits": true
func Create ¶
Create creates a new LCIO writer, saving data in file fname.
func (*Writer) Close ¶
Close closes the underlying output stream and makes it unavailable for further I/O operations. Close will synchronize and commit to disk any lingering data before closing the output stream.
func (*Writer) SetCompressionLevel ¶
SetCompressionLevel sets the compression level to lvl. lvl must be a compress/flate compression value. SetCompressionLevel must be called before WriteRunHeader or WriteEvent.
Source Files ¶
- bits.go
- calohit.go
- cellid.go
- cluster.go
- collections.go
- event.go
- hit.go
- lcio.go
- mc.go
- meta.go
- rawcalohit.go
- reader.go
- recparticle.go
- simcalohit.go
- simtrackerhit.go
- track.go
- trackerdata.go
- trackerhit.go
- trackerhitplane.go
- trackerhitzcylinder.go
- trackerpulse.go
- trackerrawdata.go
- types.go
- vertex.go
- writer.go
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
lcio-ls
lcio-ls displays the content of a LCIO file.
|
lcio-ls displays the content of a LCIO file. |
example
|
|
lcio-ex-read-event
lcio-ex-read-event is the hep/x/lcio example equivalent to: https://github.com/iLCSoft/LCIO/blob/master/examples/cpp/rootDict/readEventTree.C example: $> lcio-ex-read-event ./DST01-06_ppr004_bbcsdu.slcio lcio-ex-read-event: read 50 events from file "./DST01-06_ppr004_bbcsdu.slcio" $> open out.png
|
lcio-ex-read-event is the hep/x/lcio example equivalent to: https://github.com/iLCSoft/LCIO/blob/master/examples/cpp/rootDict/readEventTree.C example: $> lcio-ex-read-event ./DST01-06_ppr004_bbcsdu.slcio lcio-ex-read-event: read 50 events from file "./DST01-06_ppr004_bbcsdu.slcio" $> open out.png |