# Presentation: 140149

## NICADD Test Beam Simulator

- Jeremy I. McCormick

- Project Description
- Classes
- Geometry
- Hits Processing
- Command Interface
- Particle Generation
- Text Output Format
- Histograms
- Visualization
- Additional Information

## Project Description and Goals

- Sensitive Material: Polystyrene, Silicon
- HCal & ECal layering similar to SDJan03
- Single volume per cell geometry
- Edep by cell with track contributions
- Investigate E-flow & cluster separability

- NICADD Test Beam Simulator

## Software Libraries

-  GPS
-  g4phys SO (Mokka v01-04 Physics List)
-  popt for CL
-  Composite Materials def from PEGS4 (CERN)

- NICADD Test Beam Simulator

## Classes

-  Cellulizer
-  BoxCellulizer
-  MaterialMap

- User
-  TBEventAction
-  TBPrimaryGeneratorAction
-  TBRunAction
-  TBSteppingAction
-  TBTracking Action
-  TBVisManager

- Geometry
-  GeometryMap
-  PhysVolInfo
-  TBDetectorConstruction
-  TBCal
-  TBTailCatcher
-  TBECal
-  TBHCal

- Hits and Tracks
-  TBCellHit
-  TBSensitiveDetector
-  TBTrackInformation
-  TBEdepMap

- NICADD Test Beam Simulator

## Class Diagram

- Directed Assoc.

- Association

- Inheritance

- NICADD Test Beam Simulator

## GeometryMap

-    ComputeWorldVectors()
-    AddDaughters(vol, layno)

- PhysVolInfo
-   GetLayNo()
-   GetVolType()
-   GetGlobId()
-   GetHit()
-   GetThreeVector()
-   ComputeWorldVector()

- TBCellHit

- TBDetectorConstruction

- TBSensitiveDetector

- NICADD Test Beam Simulator

## Detector Geometry

- ECal

- HCal

- TC

- ~2 m

- 1.5 m

- 1 m

- NICADD Test Beam Simulator

## Geometry Overview

- NICADD Test Beam Simulator

## Cells

- 1.5 m

- NICADD Test Beam Simulator

## HCal

- Front

- Side (Angled)

- 1 m

- 1.25 m

- 30 cm

- NICADD Test Beam Simulator

## ECal

- Front

- Side (partial)

- 1 m

- ~6 cm

- NICADD Test Beam Simulator

## Tail Catcher

- Front (Horizontal Layer)

- Front (Vertical Layer)

- Side

- Front (transparent)

- 1.5 m

- 1.5 m

- 63 cm

- NICADD Test Beam Simulator

## Command Interface

-   -?					: print usage
-    -c				: visualize cells
-    -t					: visualize tracks
-    -h				: visualize hits
-    -o outfile_path 	: output filepath
-    -m macro_file   	: macro
-    -v              		: start with vis.mac
-  All Options Example:
-   testbeam -vhtc -o outfile_txt -m run.mac

- NICADD Test Beam Simulator

## Particle Generation

-  1 to n MC particles
-  fixed or random E, pos & mom
-  theta, phi within min, max
-  energy spectra
-  ***/tbeam/doRun no_events ***for multiple events

- NICADD Test Beam Simulator

## GPS Conical Example

- 10 pi+
- pos = (0, 0 ,1990)
- theta = 0-10
- phi = all
- E = 2-10 GeV
- charged traj only

- NICADD Test Beam Simulator

## GPS Square Example

- pos = (rX,rY,1990)
- square = 15 cm / side
- E = 10-20 GeV
- charged traj only

- NICADD Test Beam Simulator

## Hits Processing

- PhysVolInfo *pinfo = PhysVolMap->GetPhysVolInfo(physVol);
- TBCellHit *theHit = CellHit(physVol);
- if (!theHit) {
-  theHit = new TBCellHit();
-  if (pinfo) {
-   theHit->SetPhysVolInfo(pinfo);
-    mapHits.insert(HitMapPair(physVol,theHit));
-   PhysVolInfo::PhysVolType vtype = pinfo->GetVolType();
-   if (vtype == PhysVolInfo::CELL) {
-     theHit->IncrEdep(edep);
-     TBTrackInformation *tinfo = (TBTrackInformation*)(aStep->GetTrack()->GetUserInformation());
-     theHit->IncrTrkEdep(tinfo->GetTrackID(),edep);
-   }
-   else if (vtype == PhysVolInfo::ABSORBER) {
-     theHit->IncrAbsEdep(edep);
-   }
- }

- NICADD Test Beam Simulator

## End of Event

-     { Copy Hits to HC }
- TBEventAction::EndOfEventAction()
-     WriteEvent(evt)
-         WriteHitsCollection(HC)
-             aHit->Write(ostr)
-                 TrackEdep->Write(ostr)
-             aHit->Draw()
-     VisualizeTrajectories(evt)

- NICADD Test Beam Simulator

## Text Output Format

- ECAL ***no_hits***
***layer_no ... x y z cell_edep abs_edep***
***track_no track_edep***
- ...
- HCAL ...
- ...
- TAILCATCHER ...
- ...

- NICADD Test Beam Simulator

## Output Example

- HCAL 2
- 1 0 0 0 0 -352.5 0 407.334 0
- 1 0 0 65 -85 435 1.22144 0 1
- 2 1.22144
- ECAL 1
- 1 0 0 85 95 584.3 0.113163 0 1
- 2 0.113163
- TAILCATCHER 1
- 1 0 0 0 300 -690 0.00100138 0 1
- 1 0.00100138

- NICADD Test Beam Simulator

## HCal Live Edep: 20 GeV Pi+

- NICADD Test Beam Simulator

## HCal Abs. Edep: 20 GeV Pi+

- NICADD Test Beam Simulator

## Edep in Inner Cells: 20 GeV Pi+

- NICADD Test Beam Simulator

## ECal Live Edep: 20 GeV Pi+

- NICADD Test Beam Simulator

## Visualization Scheme

- Cell Hits (all layers)

- Tracks

- Blue:    positive
- Red:     negative
- Green:  neutral

- Trajectory Charge

- Color

- (front view of HCal & ECal hits)

- (Geant4 defaults)

- NICADD Test Beam Simulator

## All Trajectories and Lit Cells: Side View

- pi+
- pos = (0, 0, 1990)
- mom = (0, 0, -1)
- E = 20 GeV
- all traj & lit cells

- NICADD Test Beam Simulator

## GPS Square: Side View

- 100 pi+
- small square
- charged traj
-   and hits

- NICADD Test Beam Simulator

## GPS Cone: Top View

- 20 pi+
- theta = 0-10
- phi = all
- mom = (0, 0, -1)
- E = 5-10 GeV
- charged traj & lit cells

- NICADD Test Beam Simulator

## GPS Cone: Front View

- 100 pi+
- random circle
- charged traj

- NICADD Test Beam Simulator

## Hits and Tracks in ECal

- e-
- pos = (0, 0, 1990)
- mom = (0, 0, -1)
- E = 50 GeV
- all traj & hits

- NICADD Test Beam Simulator

## Additional Information

- Source Browser: http://nicadd.niu.edu/~jeremy/tbeam/html/
- CVS (bash):
-   export CVSROOT=:ext:lcdguest@nicadd.niu.edu:/cvs
-   export CVS_RSH=ssh
-   cvs co tbeam
- password: lcd_2004
- g4phys: http://nicadd.niu.edu/~jeremy/download/g4phys.tgz
- popt: http://www.gnu.org/directory/libs/popt.html

- NICADD Test Beam Simulator