hep: go-hep.org/x/hep/lcio Index | Examples | Files | Directories

package lcio

import "go-hep.org/x/hep/lcio"

Package lcio provides read/write access to the LCIO data model.

Index

Examples

Package 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

Constants

const (
    MajorVersion uint32 = 2
    MinorVersion uint32 = 8
    Version      uint32 = (MajorVersion << 16) + MinorVersion
)

Variables

var Blocks = struct {
    Index        string
    RandomAccess string
    RunHeader    string
    EventHeader  string
}{
    Index:        "LCIOndex",
    RandomAccess: "LCIORandomAccess",
    RunHeader:    "RunHeader",
    EventHeader:  "EventHeader",
}
var Records = struct {
    Index        string
    RandomAccess string
    RunHeader    string
    EventHeader  string
    Event        string
}{
    Index:        "LCIOIndex",
    RandomAccess: "LCIORandomAccess",
    RunHeader:    "LCRunHeader",
    EventHeader:  "LCEventHeader",
    Event:        "LCEvent",
}

func ID Uses

func ID(ptr interface{}) uint32

ID returns a unique identifier for ptr.

type BlockDescr Uses

type BlockDescr struct {
    Name string
    Type string
}

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 Uses

type CalorimeterHit struct {
    CellID0   int32
    CellID1   int32
    Energy    float32
    EnergyErr float32
    Time      float32
    Pos       [3]float32
    Type      int32
    Raw       Hit
}

func (*CalorimeterHit) GetCellID0 Uses

func (hit *CalorimeterHit) GetCellID0() int32

func (*CalorimeterHit) GetCellID1 Uses

func (hit *CalorimeterHit) GetCellID1() int32

type CalorimeterHitContainer Uses

type CalorimeterHitContainer struct {
    Flags  Flags
    Params Params
    Hits   []CalorimeterHit
}

CalorimeterHitContainer is a collection of calorimeter hits.

func (*CalorimeterHitContainer) MarshalSio Uses

func (hits *CalorimeterHitContainer) MarshalSio(w sio.Writer) error

func (CalorimeterHitContainer) String Uses

func (hits CalorimeterHitContainer) String() string

func (*CalorimeterHitContainer) UnmarshalSio Uses

func (hits *CalorimeterHitContainer) UnmarshalSio(r sio.Reader) error

func (*CalorimeterHitContainer) VersionSio Uses

func (*CalorimeterHitContainer) VersionSio() uint32

type CellIDDecoder Uses

type CellIDDecoder struct {
    // contains filtered or unexported fields
}

CellIDDecoder decodes cell IDs from a Hit cell-ID

func NewCellIDDecoder Uses

func NewCellIDDecoder(codec string) *CellIDDecoder

func NewCellIDDecoderFrom Uses

func NewCellIDDecoderFrom(params Params) *CellIDDecoder

func (*CellIDDecoder) Get Uses

func (dec *CellIDDecoder) Get(hit Hit, name string) int64

func (*CellIDDecoder) Value Uses

func (dec *CellIDDecoder) Value(hit Hit) int64

func (*CellIDDecoder) ValueString Uses

func (dec *CellIDDecoder) ValueString(hit Hit) string

type Cluster Uses

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 Uses

type ClusterContainer struct {
    Flags    Flags
    Params   Params
    Clusters []Cluster
}

ClusterContainer is a collection of clusters.

func (*ClusterContainer) MarshalSio Uses

func (clus *ClusterContainer) MarshalSio(w sio.Writer) error

func (ClusterContainer) String Uses

func (clus ClusterContainer) String() string

func (*ClusterContainer) UnmarshalSio Uses

func (clus *ClusterContainer) UnmarshalSio(r sio.Reader) error

func (*ClusterContainer) VersionSio Uses

func (*ClusterContainer) VersionSio() uint32

type Contrib Uses

type Contrib struct {
    Mc      *McParticle
    Energy  float32
    Time    float32
    PDG     int32
    StepPos [3]float32
}

type Event Uses

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 Uses

func (evt *Event) Add(name string, ptr interface{})

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 Uses

func (evt *Event) Get(name string) interface{}

Get returns the event data labelled name.

func (*Event) Has Uses

func (evt *Event) Has(name string) bool

Has returns whether this event has data named name.

func (*Event) Names Uses

func (evt *Event) Names() []string

Names returns the event data labels that define this event.

func (*Event) String Uses

func (evt *Event) String() string

func (*Event) Weight Uses

func (evt *Event) Weight() float64

type EventHeader Uses

type EventHeader struct {
    RunNumber   int32
    EventNumber int32
    TimeStamp   int64
    Detector    string
    Blocks      []BlockDescr
    Params      Params
}

EventHeader provides metadata about an Event.

func (*EventHeader) MarshalSio Uses

func (hdr *EventHeader) MarshalSio(w sio.Writer) error

func (*EventHeader) String Uses

func (hdr *EventHeader) String() string

func (*EventHeader) UnmarshalSio Uses

func (hdr *EventHeader) UnmarshalSio(r sio.Reader) error

func (*EventHeader) VersionSio Uses

func (*EventHeader) VersionSio() uint32

func (*EventHeader) Weight Uses

func (hdr *EventHeader) Weight() float64

type Flags Uses

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

func (Flags) Test Uses

func (flags Flags) Test(bit Flags) bool

Test returns whether the given bit is != 0

type FloatVec Uses

type FloatVec struct {
    Flags    Flags
    Params   Params
    Elements [][]float32
}

func (*FloatVec) MarshalSio Uses

func (vec *FloatVec) MarshalSio(w sio.Writer) error

func (FloatVec) String Uses

func (vec FloatVec) String() string

func (*FloatVec) UnmarshalSio Uses

func (vec *FloatVec) UnmarshalSio(r sio.Reader) error

func (*FloatVec) VersionSio Uses

func (*FloatVec) VersionSio() uint32

type GenericObject Uses

type GenericObject struct {
    Flag   Flags
    Params Params
    Data   []GenericObjectData
}

func (*GenericObject) MarshalSio Uses

func (obj *GenericObject) MarshalSio(w sio.Writer) error

func (GenericObject) String Uses

func (obj GenericObject) String() string

func (*GenericObject) UnmarshalSio Uses

func (obj *GenericObject) UnmarshalSio(r sio.Reader) error

func (*GenericObject) VersionSio Uses

func (*GenericObject) VersionSio() uint32

type GenericObjectData Uses

type GenericObjectData struct {
    I32s []int32
    F32s []float32
    F64s []float64
}

func (*GenericObjectData) String Uses

func (obj *GenericObjectData) String() string

type Hit Uses

type Hit interface {
    GetCellID0() int32
    GetCellID1() int32
}

Hit is an abstract Hit in the LCIO event data model.

type Index Uses

type Index struct {
    // Bit 0 = single run.
    // Bit 1 = int64 offset required
    // Bit 2 = Params included (not yet implemented)
    ControlWord uint32
    RunMin      int32
    BaseOffset  int64
    Offsets     []Offset
}

func (*Index) MarshalSio Uses

func (idx *Index) MarshalSio(w sio.Writer) error

func (*Index) UnmarshalSio Uses

func (idx *Index) UnmarshalSio(r sio.Reader) error

type IntVec Uses

type IntVec struct {
    Flags    Flags
    Params   Params
    Elements [][]int32
}

func (*IntVec) MarshalSio Uses

func (vec *IntVec) MarshalSio(w sio.Writer) error

func (IntVec) String Uses

func (vec IntVec) String() string

func (*IntVec) UnmarshalSio Uses

func (vec *IntVec) UnmarshalSio(r sio.Reader) error

func (*IntVec) VersionSio Uses

func (*IntVec) VersionSio() uint32

type McParticle Uses

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 Uses

func (mc *McParticle) EndPoint() [3]float64

func (*McParticle) Energy Uses

func (mc *McParticle) Energy() float64

func (*McParticle) HasLeftDetector Uses

func (mc *McParticle) HasLeftDetector() bool

func (*McParticle) IsBackScatter Uses

func (mc *McParticle) IsBackScatter() bool

func (*McParticle) IsCreatedInSimulation Uses

func (mc *McParticle) IsCreatedInSimulation() bool

func (*McParticle) IsDecayedInCalorimeter Uses

func (mc *McParticle) IsDecayedInCalorimeter() bool

func (*McParticle) IsDecayedInTracker Uses

func (mc *McParticle) IsDecayedInTracker() bool

func (*McParticle) IsOverlay Uses

func (mc *McParticle) IsOverlay() bool

func (*McParticle) IsStopped Uses

func (mc *McParticle) IsStopped() bool

func (*McParticle) MarshalSio Uses

func (mc *McParticle) MarshalSio(w sio.Writer) error

func (*McParticle) SimStatusString Uses

func (mc *McParticle) SimStatusString() string

func (*McParticle) UnmarshalSio Uses

func (mc *McParticle) UnmarshalSio(r sio.Reader) error

func (*McParticle) VersionSio Uses

func (mc *McParticle) VersionSio() uint32

func (*McParticle) VertexIsNotEnpointOfParent Uses

func (mc *McParticle) VertexIsNotEnpointOfParent() bool

type McParticleContainer Uses

type McParticleContainer struct {
    Flags     Flags
    Params    Params
    Particles []McParticle
}

McParticleContainer is a collection of monte-carlo particles.

func (*McParticleContainer) LinkSio Uses

func (mc *McParticleContainer) LinkSio(vers uint32) error

func (*McParticleContainer) MarshalSio Uses

func (mc *McParticleContainer) MarshalSio(w sio.Writer) error

func (McParticleContainer) String Uses

func (mcs McParticleContainer) String() string

func (*McParticleContainer) UnmarshalSio Uses

func (mc *McParticleContainer) UnmarshalSio(r sio.Reader) error

func (*McParticleContainer) VersionSio Uses

func (*McParticleContainer) VersionSio() uint32

type Offset Uses

type Offset struct {
    RunOffset   int32 // run offset relative to Index.RunMin
    EventNumber int32 // event number or -1 for run header records
    Location    int64 // location offset relative to Index.BaseOffset
    Ints        []int32
    Floats      []float32
    Strings     []string
}

type Params Uses

type Params struct {
    Ints    map[string][]int32
    Floats  map[string][]float32
    Strings map[string][]string
}

func (*Params) MarshalSio Uses

func (p *Params) MarshalSio(w sio.Writer) error

func (Params) String Uses

func (p Params) String() string

func (*Params) UnmarshalSio Uses

func (p *Params) UnmarshalSio(r sio.Reader) error

func (*Params) VersionSio Uses

func (*Params) VersionSio() uint32

type ParticleID Uses

type ParticleID struct {
    Likelihood float32
    Type       int32
    PDG        int32
    AlgType    int32
    Params     []float32
}

type RandomAccess Uses

type RandomAccess struct {
    RunMin         int32
    EventMin       int32
    RunMax         int32
    EventMax       int32
    RunHeaders     int32
    Events         int32
    RecordsInOrder int32
    IndexLoc       int64
    PrevLoc        int64
    NextLoc        int64
    FirstRecordLoc int64
    RecordSize     int32
}

type RawCalorimeterHit Uses

type RawCalorimeterHit struct {
    CellID0   int32
    CellID1   int32
    Amplitude int32
    TimeStamp int32
}

func (*RawCalorimeterHit) GetCellID0 Uses

func (hit *RawCalorimeterHit) GetCellID0() int32

func (*RawCalorimeterHit) GetCellID1 Uses

func (hit *RawCalorimeterHit) GetCellID1() int32

type RawCalorimeterHitContainer Uses

type RawCalorimeterHitContainer struct {
    Flags  Flags
    Params Params
    Hits   []RawCalorimeterHit
}

RawCalorimeterHitContainer is a collection of raw calorimeter hits.

func (*RawCalorimeterHitContainer) MarshalSio Uses

func (hits *RawCalorimeterHitContainer) MarshalSio(w sio.Writer) error

func (RawCalorimeterHitContainer) String Uses

func (hits RawCalorimeterHitContainer) String() string

func (*RawCalorimeterHitContainer) UnmarshalSio Uses

func (hits *RawCalorimeterHitContainer) UnmarshalSio(r sio.Reader) error

func (*RawCalorimeterHitContainer) VersionSio Uses

func (*RawCalorimeterHitContainer) VersionSio() uint32

type Reader Uses

type Reader struct {
    // contains filtered or unexported fields
}

Code:

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 Open Uses

func Open(fname string) (*Reader, error)

func (*Reader) Close Uses

func (r *Reader) Close() error

func (*Reader) Err Uses

func (r *Reader) Err() error

func (*Reader) Event Uses

func (r *Reader) Event() Event

func (*Reader) EventHeader Uses

func (r *Reader) EventHeader() EventHeader

func (*Reader) Next Uses

func (r *Reader) Next() bool

func (*Reader) RunHeader Uses

func (r *Reader) RunHeader() RunHeader

type RecParticle Uses

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 Uses

type RecParticleContainer struct {
    Flags  Flags
    Params Params
    Parts  []RecParticle
}

RecParticleContainer is a collection of RecParticles.

func (*RecParticleContainer) MarshalSio Uses

func (recs *RecParticleContainer) MarshalSio(w sio.Writer) error

func (*RecParticleContainer) String Uses

func (recs *RecParticleContainer) String() string

func (*RecParticleContainer) UnmarshalSio Uses

func (recs *RecParticleContainer) UnmarshalSio(r sio.Reader) error

func (*RecParticleContainer) VersionSio Uses

func (*RecParticleContainer) VersionSio() uint32

type References Uses

type References struct {
    Flags  Flags
    Params Params
    Refs   []interface{}
}

func (*References) MarshalSio Uses

func (refs *References) MarshalSio(w sio.Writer) error

func (*References) UnmarshalSio Uses

func (refs *References) UnmarshalSio(r sio.Reader) error

func (*References) VersionSio Uses

func (*References) VersionSio() uint32

type Relation Uses

type Relation struct {
    From   interface{}
    To     interface{}
    Weight float32
}

type RelationContainer Uses

type RelationContainer struct {
    Flags  Flags
    Params Params
    Rels   []Relation
}

func (*RelationContainer) MarshalSio Uses

func (rc *RelationContainer) MarshalSio(w sio.Writer) error

func (RelationContainer) String Uses

func (rc RelationContainer) String() string

func (*RelationContainer) UnmarshalSio Uses

func (rc *RelationContainer) UnmarshalSio(r sio.Reader) error

func (*RelationContainer) VersionSio Uses

func (*RelationContainer) VersionSio() uint32

type RunHeader Uses

type RunHeader struct {
    RunNumber    int32
    Detector     string
    Descr        string
    SubDetectors []string
    Params       Params
}

RunHeader provides metadata about a Run.

func (*RunHeader) MarshalSio Uses

func (hdr *RunHeader) MarshalSio(w sio.Writer) error

func (*RunHeader) String Uses

func (hdr *RunHeader) String() string

func (*RunHeader) UnmarshalSio Uses

func (hdr *RunHeader) UnmarshalSio(r sio.Reader) error

func (*RunHeader) VersionSio Uses

func (*RunHeader) VersionSio() uint32

type SimCalorimeterHit Uses

type SimCalorimeterHit struct {
    Params        Params
    CellID0       int32
    CellID1       int32
    Energy        float32
    Pos           [3]float32
    Contributions []Contrib
}

func (*SimCalorimeterHit) GetCellID0 Uses

func (hit *SimCalorimeterHit) GetCellID0() int32

func (*SimCalorimeterHit) GetCellID1 Uses

func (hit *SimCalorimeterHit) GetCellID1() int32

type SimCalorimeterHitContainer Uses

type SimCalorimeterHitContainer struct {
    Flags  Flags
    Params Params
    Hits   []SimCalorimeterHit
}

SimCalorimeterHitContainer is a collection of simulation calorimter hits.

func (*SimCalorimeterHitContainer) MarshalSio Uses

func (hits *SimCalorimeterHitContainer) MarshalSio(w sio.Writer) error

func (SimCalorimeterHitContainer) String Uses

func (hits SimCalorimeterHitContainer) String() string

func (*SimCalorimeterHitContainer) UnmarshalSio Uses

func (hits *SimCalorimeterHitContainer) UnmarshalSio(r sio.Reader) error

func (*SimCalorimeterHitContainer) VersionSio Uses

func (*SimCalorimeterHitContainer) VersionSio() uint32

type SimTrackerHit Uses

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 Uses

func (hit *SimTrackerHit) GetCellID0() int32

func (*SimTrackerHit) GetCellID1 Uses

func (hit *SimTrackerHit) GetCellID1() int32

type SimTrackerHitContainer Uses

type SimTrackerHitContainer struct {
    Flags  Flags
    Params Params
    Hits   []SimTrackerHit
}

SimTrackerHitContainer is a collection of simulated tracker hits.

func (*SimTrackerHitContainer) MarshalSio Uses

func (hits *SimTrackerHitContainer) MarshalSio(w sio.Writer) error

func (SimTrackerHitContainer) String Uses

func (hits SimTrackerHitContainer) String() string

func (*SimTrackerHitContainer) UnmarshalSio Uses

func (hits *SimTrackerHitContainer) UnmarshalSio(r sio.Reader) error

func (*SimTrackerHitContainer) VersionSio Uses

func (*SimTrackerHitContainer) VersionSio() uint32

type StrVec Uses

type StrVec struct {
    Flags    Flags
    Params   Params
    Elements [][]string
}

func (*StrVec) MarshalSio Uses

func (vec *StrVec) MarshalSio(w sio.Writer) error

func (StrVec) String Uses

func (vec StrVec) String() string

func (*StrVec) UnmarshalSio Uses

func (vec *StrVec) UnmarshalSio(r sio.Reader) error

func (*StrVec) VersionSio Uses

func (*StrVec) VersionSio() uint32

type Track Uses

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
}

func (*Track) D0 Uses

func (trk *Track) D0() float64

func (*Track) Omega Uses

func (trk *Track) Omega() float64

func (*Track) Phi Uses

func (trk *Track) Phi() float64

func (*Track) TanL Uses

func (trk *Track) TanL() float64

func (*Track) Z0 Uses

func (trk *Track) Z0() float64

type TrackContainer Uses

type TrackContainer struct {
    Flags  Flags
    Params Params
    Tracks []Track
}

TrackContainer is a collection of tracks.

func (*TrackContainer) MarshalSio Uses

func (trks *TrackContainer) MarshalSio(w sio.Writer) error

func (*TrackContainer) String Uses

func (trks *TrackContainer) String() string

func (*TrackContainer) UnmarshalSio Uses

func (trks *TrackContainer) UnmarshalSio(r sio.Reader) error

func (*TrackContainer) VersionSio Uses

func (*TrackContainer) VersionSio() uint32

type TrackState Uses

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 Uses

type TrackerData struct {
    CellID0 int32
    CellID1 int32
    Time    float32
    Charges []float32
}

func (*TrackerData) GetCellID0 Uses

func (data *TrackerData) GetCellID0() int32

func (*TrackerData) GetCellID1 Uses

func (data *TrackerData) GetCellID1() int32

type TrackerDataContainer Uses

type TrackerDataContainer struct {
    Flags  Flags // bits 0-15 are user/detector specific
    Params Params
    Data   []TrackerData
}

func (*TrackerDataContainer) MarshalSio Uses

func (tds *TrackerDataContainer) MarshalSio(w sio.Writer) error

func (*TrackerDataContainer) String Uses

func (tds *TrackerDataContainer) String() string

func (*TrackerDataContainer) UnmarshalSio Uses

func (tds *TrackerDataContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerDataContainer) VersionSio Uses

func (*TrackerDataContainer) VersionSio() uint32

type TrackerHit Uses

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 Uses

func (hit *TrackerHit) GetCellID0() int32

func (*TrackerHit) GetCellID1 Uses

func (hit *TrackerHit) GetCellID1() int32

type TrackerHitContainer Uses

type TrackerHitContainer struct {
    Flags  Flags
    Params Params
    Hits   []TrackerHit
}

TrackerHitContainer is a collection of tracker hits.

func (*TrackerHitContainer) MarshalSio Uses

func (hits *TrackerHitContainer) MarshalSio(w sio.Writer) error

func (TrackerHitContainer) String Uses

func (hits TrackerHitContainer) String() string

func (*TrackerHitContainer) UnmarshalSio Uses

func (hits *TrackerHitContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerHitContainer) VersionSio Uses

func (*TrackerHitContainer) VersionSio() uint32

type TrackerHitPlane Uses

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 Uses

func (hit *TrackerHitPlane) GetCellID0() int32

func (*TrackerHitPlane) GetCellID1 Uses

func (hit *TrackerHitPlane) GetCellID1() int32

type TrackerHitPlaneContainer Uses

type TrackerHitPlaneContainer struct {
    Flags  Flags
    Params Params
    Hits   []TrackerHitPlane
}

TrackerHitPlaneContainer is a collection of tracker hit planes.

func (*TrackerHitPlaneContainer) MarshalSio Uses

func (hits *TrackerHitPlaneContainer) MarshalSio(w sio.Writer) error

func (TrackerHitPlaneContainer) String Uses

func (hits TrackerHitPlaneContainer) String() string

func (*TrackerHitPlaneContainer) UnmarshalSio Uses

func (hits *TrackerHitPlaneContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerHitPlaneContainer) VersionSio Uses

func (*TrackerHitPlaneContainer) VersionSio() uint32

type TrackerHitZCylinder Uses

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 Uses

func (hit *TrackerHitZCylinder) GetCellID0() int32

func (*TrackerHitZCylinder) GetCellID1 Uses

func (hit *TrackerHitZCylinder) GetCellID1() int32

type TrackerHitZCylinderContainer Uses

type TrackerHitZCylinderContainer struct {
    Flags  Flags
    Params Params
    Hits   []TrackerHitZCylinder
}

TrackerHitZCylinderContainer is a collection of tracker hit z-cylinders.

func (*TrackerHitZCylinderContainer) MarshalSio Uses

func (hits *TrackerHitZCylinderContainer) MarshalSio(w sio.Writer) error

func (TrackerHitZCylinderContainer) String Uses

func (hits TrackerHitZCylinderContainer) String() string

func (*TrackerHitZCylinderContainer) UnmarshalSio Uses

func (hits *TrackerHitZCylinderContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerHitZCylinderContainer) VersionSio Uses

func (*TrackerHitZCylinderContainer) VersionSio() uint32

type TrackerPulse Uses

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 Uses

func (hit *TrackerPulse) GetCellID0() int32

func (*TrackerPulse) GetCellID1 Uses

func (hit *TrackerPulse) GetCellID1() int32

type TrackerPulseContainer Uses

type TrackerPulseContainer struct {
    Flags  Flags
    Params Params
    Pulses []TrackerPulse
}

func (*TrackerPulseContainer) MarshalSio Uses

func (ps *TrackerPulseContainer) MarshalSio(w sio.Writer) error

func (*TrackerPulseContainer) String Uses

func (ps *TrackerPulseContainer) String() string

func (*TrackerPulseContainer) UnmarshalSio Uses

func (ps *TrackerPulseContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerPulseContainer) VersionSio Uses

func (*TrackerPulseContainer) VersionSio() uint32

type TrackerRawData Uses

type TrackerRawData struct {
    CellID0 int32
    CellID1 int32
    Time    int32
    ADCs    []uint16
}

func (*TrackerRawData) GetCellID0 Uses

func (data *TrackerRawData) GetCellID0() int32

func (*TrackerRawData) GetCellID1 Uses

func (data *TrackerRawData) GetCellID1() int32

type TrackerRawDataContainer Uses

type TrackerRawDataContainer struct {
    Flags  Flags // bits 0-15 are user/detector specific
    Params Params
    Data   []TrackerRawData
}

func (*TrackerRawDataContainer) MarshalSio Uses

func (trs *TrackerRawDataContainer) MarshalSio(w sio.Writer) error

func (*TrackerRawDataContainer) String Uses

func (tds *TrackerRawDataContainer) String() string

func (*TrackerRawDataContainer) UnmarshalSio Uses

func (trs *TrackerRawDataContainer) UnmarshalSio(r sio.Reader) error

func (*TrackerRawDataContainer) VersionSio Uses

func (*TrackerRawDataContainer) VersionSio() uint32

type Vertex Uses

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
}

func (*Vertex) AlgName Uses

func (vtx *Vertex) AlgName() string

type VertexContainer Uses

type VertexContainer struct {
    Flags  Flags
    Params Params
    Vtxs   []Vertex
}

VertexContainer is a collection of vertices

func (*VertexContainer) MarshalSio Uses

func (vtxs *VertexContainer) MarshalSio(w sio.Writer) error

func (VertexContainer) String Uses

func (vtxs VertexContainer) String() string

func (*VertexContainer) UnmarshalSio Uses

func (vtxs *VertexContainer) UnmarshalSio(r sio.Reader) error

func (*VertexContainer) VersionSio Uses

func (*VertexContainer) VersionSio() uint32

type Writer Uses

type Writer struct {
    // contains filtered or unexported fields
}

Writer provides a way to write LCIO RunHeaders and Events to an output SIO stream.

Code:

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 Uses

func Create(fname string) (*Writer, error)

Create creates a new LCIO writer, saving data in file fname.

func (*Writer) Close Uses

func (w *Writer) Close() error

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 Uses

func (w *Writer) SetCompressionLevel(lvl int)

SetCompressionLevel sets the compression level to lvl. lvl must be a compress/flate compression value. SetCompressionLevel must be called before WriteRunHeader or WriteEvent.

func (*Writer) WriteEvent Uses

func (w *Writer) WriteEvent(evt *Event) error

func (*Writer) WriteRunHeader Uses

func (w *Writer) WriteRunHeader(run *RunHeader) error

Directories

PathSynopsis
cmd/lcio-lslcio-ls displays the content of a LCIO file.

Package lcio imports 11 packages (graph) and is imported by 3 packages. Updated 2018-09-12. Refresh now. Tools for package owners.