fads

package
v0.34.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

README

fads

GoDoc

fads, a FAst Detector Simulation, is a Go-based detector simulation including a tracking system embedded into a magnetic field, calorimeters and a muon system.

Installation

Is done via go get:

$ go get go-hep.org/x/hep/fads/...

Documentation

Is available on godoc: https://godoc.org/go-hep.org/x/hep/fads

Example

A test application is available over there:

https://go-hep.org/x/hep/fads/blob/main/cmd/fads-app/main.go

A more in-depth tutorial is available at go-hep/tutos but, in a nutshell:

$ fads-app -help
Usage: fads-app [options] <hepmc-input-file>

ex:
 $ fads-app -l=INFO -evtmax=-1 ./testdata/hepmc.data

options:
  -cpu-prof=false: enable CPU profiling
  -evtmax=-1: number of events to process
  -l="INFO": log level (DEBUG|INFO|WARN|ERROR)
  -nprocs=0: number of concurrent events to process

$ fads-app $GOPATH/src/go-hep.org/x/hep/fads/testdata/hepmc.data
::: fads-app...
app                  INFO >>> running evt=0...
app                  INFO >>> running evt=1...
app                  INFO >>> running evt=2...
app                  INFO >>> running evt=3...
app                  INFO >>> running evt=4...
app                  INFO >>> running evt=5...
app                  INFO cpu: 1.212611252s
app                  INFO mem: alloc:           3219 kB
app                  INFO mem: tot-alloc:      26804 kB
app                  INFO mem: n-mallocs:      53058
app                  INFO mem: n-frees:        52419
app                  INFO mem: gc-pauses:         36 ms
::: fads-app... [done] (time=1.216341021s)

Using the execution tracer

It is now possible to run fads-app with the runtime/trace execution tracer enabled:

$ fads-app -trace=foo.out ./testdata/hepmc.data

The traces are then analyzed and displayed via trace-viewer from the catapult project:

$ go tool trace `which fads-app` ./foo.out

See: catapult-tracing

Documentation

Overview

Package fads exposes building blocks for a fast simulation of a HEP detector.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BTagging

type BTagging struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*BTagging) Configure

func (tsk *BTagging) Configure(ctx fwk.Context) error

func (*BTagging) Process

func (tsk *BTagging) Process(ctx fwk.Context) error

func (*BTagging) StartTask

func (tsk *BTagging) StartTask(ctx fwk.Context) error

func (*BTagging) StopTask

func (tsk *BTagging) StopTask(ctx fwk.Context) error

type ByPt

type ByPt []Candidate

ByPt sorts candidate by descending Pt

func (ByPt) Len

func (p ByPt) Len() int

func (ByPt) Less

func (p ByPt) Less(i, j int) bool

func (ByPt) Swap

func (p ByPt) Swap(i, j int)

type Calorimeter

type Calorimeter struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*Calorimeter) Configure

func (tsk *Calorimeter) Configure(ctx fwk.Context) error

func (*Calorimeter) Process

func (tsk *Calorimeter) Process(ctx fwk.Context) error

func (*Calorimeter) StartTask

func (tsk *Calorimeter) StartTask(ctx fwk.Context) error

func (*Calorimeter) StopTask

func (tsk *Calorimeter) StopTask(ctx fwk.Context) error

type Candidate

type Candidate struct {
	Pid            int32   // HEP ID number
	Status         int32   // particle status
	M1, M2, D1, D2 int32   // particle mothers and daughters
	CandCharge     int32   // particle charge
	CandMass       float64 // particle mass

	IsPU          byte   // 0 or 1 for particles from pile-up interactions
	IsConstituent byte   // 0 or 1 for particles being constituents
	BTag          uint32 // b-tag information (bit-mask)
	TauTag        uint32 // tau-tag information (bit-mask)

	Eem  float64 // electromagnetic energy
	Ehad float64 // hadronic energy

	Edges [4]float64
	DEta  float64
	DPhi  float64

	Mom  fmom.PxPyPzE
	Pos  fmom.PxPyPzE
	Area fmom.PxPyPzE

	Candidates []Candidate
}

func (*Candidate) Add

func (cand *Candidate) Add(c *Candidate)

func (*Candidate) Charge

func (cand *Candidate) Charge() int32

func (*Candidate) Clone

func (cand *Candidate) Clone() *Candidate

func (*Candidate) Overlaps

func (cand *Candidate) Overlaps(o *Candidate) bool

func (*Candidate) P4

func (cand *Candidate) P4() fmom.P4

type Classifier

type Classifier interface {
	Category(cand *Candidate) int
}

Classifier classifies candidates into categories

type Efficiency

type Efficiency struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*Efficiency) Configure

func (tsk *Efficiency) Configure(ctx fwk.Context) error

func (*Efficiency) Process

func (tsk *Efficiency) Process(ctx fwk.Context) error

func (*Efficiency) StartTask

func (tsk *Efficiency) StartTask(ctx fwk.Context) error

func (*Efficiency) StopTask

func (tsk *Efficiency) StopTask(ctx fwk.Context) error

type Electron

type Electron struct {
	Mom       fmom.PtEtaPhiM // electron momentum (mass=0.0)
	EleCharge int32          // electron charge
	EhoEem    float64        // ratio of the hadronic versus electromagnetic energy deposited in the calorimeter

	McPart *hepmc.Particle // generated particle
}

func (*Electron) Charge

func (ele *Electron) Charge() int32

func (*Electron) P4

func (ele *Electron) P4() fmom.P4

type EneFrac

type EneFrac struct {
	ECal float64
	HCal float64
}

type EnergyScale

type EnergyScale struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*EnergyScale) Configure

func (tsk *EnergyScale) Configure(ctx fwk.Context) error

func (*EnergyScale) Process

func (tsk *EnergyScale) Process(ctx fwk.Context) error

func (*EnergyScale) StartTask

func (tsk *EnergyScale) StartTask(ctx fwk.Context) error

func (*EnergyScale) StopTask

func (tsk *EnergyScale) StopTask(ctx fwk.Context) error

type EnergySmearing

type EnergySmearing struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*EnergySmearing) Configure

func (tsk *EnergySmearing) Configure(ctx fwk.Context) error

func (*EnergySmearing) Process

func (tsk *EnergySmearing) Process(ctx fwk.Context) error

func (*EnergySmearing) StartTask

func (tsk *EnergySmearing) StartTask(ctx fwk.Context) error

func (*EnergySmearing) StopTask

func (tsk *EnergySmearing) StopTask(ctx fwk.Context) error

type EtaPhiBin

type EtaPhiBin struct {
	EtaBins []float64
	PhiBins []float64
}

type EtaPhiGrid

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

func NewEtaPhiGrid

func NewEtaPhiGrid(bins []EtaPhiBin) EtaPhiGrid

func (*EtaPhiGrid) EtaPhiBin

func (grid *EtaPhiGrid) EtaPhiBin(ieta, iphi int) (float64, float64, bool)

EtaPhiBin returns the eta/phi bin center corresponding to a given eta/phi index pair.

func (*EtaPhiGrid) EtaPhiIndex

func (grid *EtaPhiGrid) EtaPhiIndex(eta, phi float64) (int, int, bool)

EtaPhiIndex returns the eta/phi bin indices corresponding to a given eta/phi pair. EtaPhiIndex returns false if no bin contains this eta/phi pair.

type Event

type Event struct {
	Header RunHeader
}

type FastJetFinder

type FastJetFinder struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

FastJetFinder finds jets using the fastjet library

func (*FastJetFinder) Configure

func (tsk *FastJetFinder) Configure(ctx fwk.Context) error

func (*FastJetFinder) Process

func (tsk *FastJetFinder) Process(ctx fwk.Context) error

func (*FastJetFinder) StartTask

func (tsk *FastJetFinder) StartTask(ctx fwk.Context) error

func (*FastJetFinder) StopTask

func (tsk *FastJetFinder) StopTask(ctx fwk.Context) error

type HepMcReader

type HepMcReader struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*HepMcReader) Configure

func (tsk *HepMcReader) Configure(ctx fwk.Context) error

func (*HepMcReader) Process

func (tsk *HepMcReader) Process(ctx fwk.Context) error

func (*HepMcReader) StartTask

func (tsk *HepMcReader) StartTask(ctx fwk.Context) error

func (*HepMcReader) StopTask

func (tsk *HepMcReader) StopTask(ctx fwk.Context) error

type HepMcStreamer

type HepMcStreamer struct {
	Name string // input filename
	// contains filtered or unexported fields
}

func (*HepMcStreamer) Connect

func (s *HepMcStreamer) Connect(ports []fwk.Port) error

func (*HepMcStreamer) Disconnect

func (s *HepMcStreamer) Disconnect() error

func (*HepMcStreamer) Read

func (s *HepMcStreamer) Read(ctx fwk.Context) error

type Isolation

type Isolation struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*Isolation) Configure

func (tsk *Isolation) Configure(ctx fwk.Context) error

func (*Isolation) Process

func (tsk *Isolation) Process(ctx fwk.Context) error

func (*Isolation) StartTask

func (tsk *Isolation) StartTask(ctx fwk.Context) error

func (*Isolation) StopTask

func (tsk *Isolation) StopTask(ctx fwk.Context) error

type Jet

type Jet struct {
	Mom       fmom.PtEtaPhiM // jet momentum
	JetCharge int32          // jet charge

	DEta float64 // jet radius in pseudo-rapidity
	DPhi float64 // jet radius in azimuthal angle

	BTag   byte // 0 or 1 for a jet that has been tagged as containing a heavy quark
	TauTag byte // 0 or 1 for a jet that has been tagged as a tau

	Constituents []Particle        // pointers to constituents
	McParts      []*hepmc.Particle // pointers to generated particles
}

func (*Jet) Charge

func (jet *Jet) Charge() int32

func (*Jet) P4

func (jet *Jet) P4() fmom.P4

type Merger

type Merger struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*Merger) Configure

func (tsk *Merger) Configure(ctx fwk.Context) error

func (*Merger) Process

func (tsk *Merger) Process(ctx fwk.Context) error

func (*Merger) StartTask

func (tsk *Merger) StartTask(ctx fwk.Context) error

func (*Merger) StopTask

func (tsk *Merger) StopTask(ctx fwk.Context) error

type MissingEt

type MissingEt struct {
	MET float64 // missing transverse energy
	Phi float64 // missing energy azimuthal angle
}

type MomentumSmearing

type MomentumSmearing struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*MomentumSmearing) Configure

func (tsk *MomentumSmearing) Configure(ctx fwk.Context) error

func (*MomentumSmearing) Process

func (tsk *MomentumSmearing) Process(ctx fwk.Context) error

func (*MomentumSmearing) StartTask

func (tsk *MomentumSmearing) StartTask(ctx fwk.Context) error

func (*MomentumSmearing) StopTask

func (tsk *MomentumSmearing) StopTask(ctx fwk.Context) error

type Muon

type Muon struct {
	Mom      fmom.PtEtaPhiM // muon momentum (mass=0.0)
	MuCharge int32          // muon charge

	McPart *hepmc.Particle // generated particle
}

func (*Muon) Charge

func (muon *Muon) Charge() int32

func (*Muon) P4

func (muon *Muon) P4() fmom.P4

type ObjPair

type ObjPair struct {
	In  string
	Out string
}

type Particle

type Particle interface {
	P4() fmom.P4
	Charge() int32
}

type Photon

type Photon struct {
	Mom    fmom.PtEtaPhiM // photon momentum (mass=0.0)
	EhoEem float64        // ratio of the hadronic over electromagnetic energy deposited in the calorimeter

	McPart *hepmc.Particle // generated particle
}

func (*Photon) Charge

func (pho *Photon) Charge() int32

func (*Photon) P4

func (pho *Photon) P4() fmom.P4

type Propagator

type Propagator struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*Propagator) Configure

func (tsk *Propagator) Configure(ctx fwk.Context) error

func (*Propagator) Process

func (tsk *Propagator) Process(ctx fwk.Context) error

func (*Propagator) StartTask

func (tsk *Propagator) StartTask(ctx fwk.Context) error

func (*Propagator) StopTask

func (tsk *Propagator) StopTask(ctx fwk.Context) error

type Rho

type Rho float64

rho energy density

type RunHeader

type RunHeader struct {
	RunNbr  int64 // run number
	EvtNbr  int64 // event number
	Trigger int64 // trigger word
}

type ScalarHt

type ScalarHt float64

scalar sum of transverse momenta

type TauTagging

type TauTagging struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*TauTagging) Configure

func (tsk *TauTagging) Configure(ctx fwk.Context) error

func (*TauTagging) Process

func (tsk *TauTagging) Process(ctx fwk.Context) error

func (*TauTagging) StartTask

func (tsk *TauTagging) StartTask(ctx fwk.Context) error

func (*TauTagging) StopTask

func (tsk *TauTagging) StopTask(ctx fwk.Context) error

type Tower

type Tower struct {
	Mom  fmom.EtEtaPhiM // calorimeter tower momentum
	Ene  float64        // calorimeter tower energy
	Eem  float64        // calorimeter tower electromagnetic energy
	Ehad float64        // calorimter tower hadronic energy

	Edges [4]float64 // calorimeter tower edges

	McParts []*hepmc.Particle // pointers to generated particles
}

func (*Tower) P4

func (tower *Tower) P4() fmom.P4

type Track

type Track struct {
	Pid       int32          // HEP ID number
	Mom       fmom.PtEtaPhiM // track momentum (mass=0.0)
	TrkCharge int32          // track charge

	Eta float64 // track pseudo-rapidity at the tracker edge
	Phi float64 // track azimuthal angle at the tracker edge

	X float64 // track vertex position
	Y float64 // track vertex position
	Z float64 // track vertex position

	Xout float64 // track vertex position at the tracker edge
	Yout float64 // track vertex position at the tracker edge
	Zout float64 // track vertex position at the tracker edge

	McPart *hepmc.Particle // pointer to generated particle
}

func (*Track) Charge

func (trk *Track) Charge() int32

func (*Track) P4

func (trk *Track) P4() fmom.P4

type UniqueObjectFinder

type UniqueObjectFinder struct {
	fwk.TaskBase
	// contains filtered or unexported fields
}

func (*UniqueObjectFinder) Configure

func (tsk *UniqueObjectFinder) Configure(ctx fwk.Context) error

func (*UniqueObjectFinder) Process

func (tsk *UniqueObjectFinder) Process(ctx fwk.Context) error

func (*UniqueObjectFinder) StartTask

func (tsk *UniqueObjectFinder) StartTask(ctx fwk.Context) error

func (*UniqueObjectFinder) StopTask

func (tsk *UniqueObjectFinder) StopTask(ctx fwk.Context) error

Directories

Path Synopsis
cmd
fads-app
fads-app is a command that runs a simple ATLAS-like detector simulation, modelled after the C++ Delphes ATLAS data-card.
fads-app is a command that runs a simple ATLAS-like detector simulation, modelled after the C++ Delphes ATLAS data-card.
fads-rivet-mc-generic
fads-rivet-mc-generic is a command mirroring the MC_GENERIC analysis example from Rivet.
fads-rivet-mc-generic is a command mirroring the MC_GENERIC analysis example from Rivet.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL