Analysis Tools in PandaRoot GlueX PANDA Workshop 2019 Washington, - - PowerPoint PPT Presentation

analysis tools in pandaroot
SMART_READER_LITE
LIVE PREVIEW

Analysis Tools in PandaRoot GlueX PANDA Workshop 2019 Washington, - - PowerPoint PPT Presentation

Analysis Tools in PandaRoot GlueX PANDA Workshop 2019 Washington, GW, May 3 - 5, 2019 Klaus Gtzen GSI Darmstadt Topics Performing analysis Only briefly The Rho Analysis Framework discussed PandaRoot Tools Previewing


slide-1
SLIDE 1

Analysis Tools in PandaRoot

GlueX PANDA Workshop 2019 Washington, GW, May 3 - 5, 2019

Klaus Götzen GSI Darmstadt

slide-2
SLIDE 2

Topics

  • Performing analysis

– The Rho Analysis Framework – PandaRoot Tools

  • Previewing signal/background reconstruction

– Fast Simulations

  • Studying generic signal/background distributions

– Event Generators - Stand-Alone Usage

  • Reduce computing demand (background simulation)

– Event Filtering

  • Special Feature:

– Speeding up GlueX interactive analysis

  • K. Götzen

GlueX PANDA Workshop 2019 2

Only briefly discussed

slide-3
SLIDE 3

Performing Analysis

slide-4
SLIDE 4

The Rho Analysis Framework

  • Core based on the Rho Analysis Framework

– Inspired by the beta software/analysis framework of BaBar – Written by M. Kunze at Univ. Bochum – Fully ROOT based – Optimized for speed

  • PandaROOT Analysis Toolset

– Analysis via ROOT Macros – Extends core by experiment specific features – PID, MC Truth match – Simple Analysis Tools – QA Tools

  • K. Götzen

GlueX PANDA Workshop 2019 4

slide-5
SLIDE 5

PANDA Analysis Toolset - Features

  • Data access (PndAnalysis)
  • Particle candidates (RhoCandidate, FairRecoCandidate)
  • PID (PndAnalysis, PndPidCombiner)
  • Combinatorics (RhoCandList)
  • Particle Selectors (Rho...Selector, PndAnaPidSelector)
  • MC truth (tree) matching (PndAnalysis::McTruthMatch)
  • Fitting: POCA finder, vertex-, kinematic-, tree fitters

– PndVtxPoca,PndKalmanVtxFitter, PndKinVtxFitter, PndDecayTreeFitter, PndKinFitter, Pnd4CFitter

  • N-tuples & QA Tools (RhoTuple, PndRhoTupleQA)
  • Quick Analysis (PndSimpleCombiner, PndSimpleCombinerTask)
  • Documentation (PandaRoot Wiki)

https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootRhoTutorial

GlueX PANDA Workshop 2019 5

  • K. Götzen
slide-6
SLIDE 6

Basic Analysis

slide-7
SLIDE 7

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 7 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen
slide-8
SLIDE 8

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 8 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access

slide-9
SLIDE 9

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 9 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access Candidate Lists

slide-10
SLIDE 10

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 10 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access Candidate Lists Candidate Lists PID Selection & Algorithms PID Selection & Algorithms

slide-11
SLIDE 11

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 11 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access Combinatorics Candidate Lists Candidate Lists PID Selection & Algorithms PID Selection & Algorithms

slide-12
SLIDE 12

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 12 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access Combinatorics MC truth match Candidate Lists Candidate Lists PID Selection & Algorithms PID Selection & Algorithms

slide-13
SLIDE 13

Basic Analysis via ROOT Macro

GlueX PANDA Workshop 2019 13 ... FairRunAna *fRun = new FairRunAna(); fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); PndAnalysis *ana = new PndAnalysis(); RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi, pbarp; while ( ana->GetEvent() ) { ana->FillList( eplus, "ElectronTightPlus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( eminus, "ElectronTightMinus", "PidAlgoEmcBayes;PidAlgoDrc" ); ana->FillList( piplus, "PionLoosePlus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( piminus, "PionLooseMinus", "PidAlgoStt;PidAlgoDrc;PidAlgoMvd" ); ana->FillList( gamma, "Neutral"); pi0->Combine(gamma, gamma); jpsi->Combine(eplus, eminus, "J/psi"); pbarp->Combine(jpsi, piplus, piminus, pi0, "pbarpSystem"); if (ana->McTruthMatch( pbarp[0] )) { RhoCandidate *truth = pbarp[0].GetMcTruth(); ...

  • K. Götzen

Object for data access Combinatorics MC truth match Candidate Lists Candidate Lists PID Selection & Algorithms PID Selection & Algorithms

slide-14
SLIDE 14

Output and QA

slide-15
SLIDE 15

TTrees with RhoTuple

  • Creating TTree output without overhead

GlueX PANDA Workshop 2019 15 RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;j<jpsi.GetLength();++j) { // *** store event number and candidate number in current event ntp->Column("ev", (Float_t) evnumber, -999.0f); ntp->Column("cand", (Float_t) j, -999.0f); // *** basic information about J/psi ntp->Column("jpsim", (Float_t) jpsi[j]->M(), -999.0f); ntp->Column("jpsip", (Float_t) jpsi[j]->P(), -999.0f); ntp->Column("jpsipt",(Float_t) jpsi[j]->P4().Pt(), -999.0f); ntp->Column("jpsiE", (Float_t) jpsi[j]->E(), -999.0f); .... ntp->DumpData(); } ... // ... end of macro ... TFile *f=new TFile("ntp.root","RECREATE"); ntp->GetInternalTree()->Write(); f->Close();

Just create new branches on the fly!

  • K. Götzen
slide-16
SLIDE 16

PndRhoTupleQA - TTree made simple

  • Provides QA functions for persisting values in TTree
  • Usage:

GlueX PANDA Workshop 2019 16 // *** QA for candidates void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false); void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cms(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cov(TString pre, RhoCandidate *c, RhoTuple *n, bool skip=false); // *** QA for composites void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); void qaKs0(TString pre, RhoCandidate *c, RhoTuple *n); void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n); ...

Very handy function to store composite info!

  • K. Götzen

PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;j<jpsi.GetLength();++j) { ... qa.qaComp("x", jpsi[j], ntp); // composite info incl. daugthers, MC truth ntp->DumpData(); // *** and fill ntuple }

slide-17
SLIDE 17

PndRhoTupleQA - TTree made simple

  • Provides QA functions for persisting values in TTree
  • Usage:

GlueX PANDA Workshop 2019 17 // *** QA for candidates void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false); void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cms(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cov(TString pre, RhoCandidate *c, RhoTuple *n, bool skip=false); // *** QA for composites void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); void qaKs0(TString pre, RhoCandidate *c, RhoTuple *n); void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n); ...

  • K. Götzen

PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;j<jpsi.GetLength();++j) { ... qa.qaComp("x", jpsi[j], ntp); // composite info incl. daugthers, MC truth ntp->DumpData(); // *** and fill ntuple }

This creates branches:

slide-18
SLIDE 18

PndRhoTupleQA - TTree made simple

  • Provides QA functions for persisting values in TTree
  • Usage:

GlueX PANDA Workshop 2019 18 // *** QA for candidates void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false); void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cms(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cov(TString pre, RhoCandidate *c, RhoTuple *n, bool skip=false); // *** QA for composites void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); void qaKs0(TString pre, RhoCandidate *c, RhoTuple *n); void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n); ...

  • K. Götzen

PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;j<jpsi.GetLength();++j) { ... qa.qaComp("x", jpsi[j], ntp); // composite info incl. daugthers, MC truth ntp->DumpData(); // *** and fill ntuple }

This creates branches:

infos about daugther 0

slide-19
SLIDE 19

Quick Analysis Tools

slide-20
SLIDE 20

Quick Analysis

  • Based on PndSimpleCombiner & PndSimpleCombinerTask

– very simple and compact analysis approach – runs analysis in compiled FairTask (faster + more robust)

  • Reco e.g. of mode p → J/ψ (→ μ+μ−) π+π− can be done by

GlueX PANDA Workshop 2019 20

root -l -b -q 'quickana.C( "pid_complete.root", // input file 6.232, // p [GeV/c] "J/psi->mu+ mu-; pbarpSystem->J/psi pi+ pi-", // decay tree reco 0, // #events (0=all) "fit4c:fitvtx:mwin(J/psi)=0.8" )' // some parameters

Attaching file pid_complete_ana.root as _file0... root [1] .ls TFile** pid_complete_ana.root TFile* pid_complete_ana.root KEY: TFolder cbmout;1 Main Output Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi->mu+ mu- KEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi-

  • K. Götzen
slide-21
SLIDE 21

Quick Analysis

  • Based on PndSimpleCombiner & PndSimpleCombinerTask

– very simple and compact analysis approach – runs analysis in compiled FairTask (faster + more robust)

  • Reco e.g. of mode p → J/ψ (→ μ+μ−) π+π− can be done by

GlueX PANDA Workshop 2019 21

root -l -b -q 'quickana.C( "pid_complete.root", // input file 6.232, // p [GeV/c] "J/psi->mu+ mu-; pbarpSystem->J/psi pi+ pi-", // decay tree reco 0, // #events (0=all) "fit4c:fitvtx:mwin(J/psi)=0.8" )' // some parameters

Attaching file pid_complete_ana.root as _file0... root [1] .ls TFile** pid_complete_ana.root TFile* pid_complete_ana.root KEY: TFolder cbmout;1 Main Output Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi->mu+ mu- KEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi-

  • K. Götzen

Decay chain to be reco'd Reco options

slide-22
SLIDE 22

Quick Analysis

  • Based on PndSimpleCombiner & PndSimpleCombinerTask

– very simple and compact analysis approach – runs analysis in compiled FairTask (faster + more robust)

  • Reco e.g. of mode p → J/ψ (→ μ+μ−) π+π− can be done by

GlueX PANDA Workshop 2019 22

root -l -b -q 'quickana.C( "pid_complete.root", // input file 6.232, // p [GeV/c] "J/psi->mu+ mu-; pbarpSystem->J/psi pi+ pi-", // decay tree reco 0, // #events (0=all) "fit4c:fitvtx:mwin(J/psi)=0.8" )' // some parameters

Attaching file pid_complete_ana.root as _file0... root [1] .ls TFile** pid_complete_ana.root TFile* pid_complete_ana.root KEY: TFolder cbmout;1 Main Output Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi->mu+ mu- KEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi-

  • K. Götzen
slide-23
SLIDE 23

Quick Analysis Parameters

https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootRhoTutorial#A_5._Quick_analysis

  • K. Götzen

GlueX PANDA Workshop 2019 23

fitting mass cuts energy/momentum cut PID control

  • utput control
slide-24
SLIDE 24

Quick Analysis Parameters

https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootRhoTutorial#A_5._Quick_analysis

  • K. Götzen

GlueX PANDA Workshop 2019 24

Our X(3872) scan analysis was completely done with quickana.C ... and is published now!

[EPJ A 55 (2019) 42]

slide-25
SLIDE 25

Fast Simulation

slide-26
SLIDE 26

Fast Simulations

  • Idea: Particle smearing instead Geant simulation
  • Simulate large number of events in short time
  • Very simple configuration
  • Study of

– Reaction kinematics – Detector configurations

  • Output analysed with same analysis code

as for full simulation

  • K. Götzen

GlueX PANDA Workshop 2019 26

slide-27
SLIDE 27

Concept

  • K. Götzen

GlueX PANDA Workshop 2019 27

Detector 1

Generator Particle P

Detector 2 Detector n

...

Response 1 for P Response n for P

...

Reco Particle P' Modify/Reject/Add info to P according to total response

Response 2 for P

reject

Secondaries for P'

add

slide-28
SLIDE 28

Detector Modules

  • K. Götzen

Fast Simulations - PANDA CM June 2014 28

Target Spectrometer Forward Spectrometer

TRK EMC PID

STT STT + MVD STT + MVD + GEM MVD + GEM Fwd TS EMC Barrel EMC Fwd EMC Bwd EMC FS EMC Barrel EMC Fwd EMC Bwd STT PID MVD PID MUO PID DIRC PID DISC PID EMC FS PID RICH PID MUO FS PID MVD Vtx

slide-29
SLIDE 29

Acceptance Modelling

  • Spatial acceptance typically defined by polar θ range from IP
  • Different trackers or EMCs should not overlap
  • K. Götzen

GlueX PANDA Workshop 2019 29

IP

Barrel DRC Central Tracking (STT + MVD) EMC BwdCap EMC FwdCap Fwd Tracker STT + GEM EMC Barrel Disc DRC

Just for illustration

slide-30
SLIDE 30

Full PANDA Detector

  • K. Götzen

GlueX PANDA Workshop 2019 30

// ** Tracking **

fastSim->AddDetector("ScSttAlone", "thtMin=145. thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency= fastSim->AddDetector("ScSttMvd", "thtMin=20.9 thtMax=145. ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency= fastSim->AddDetector("ScSttMvdGem", "thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency fastSim->AddDetector("ScMvdGem", "thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 efficiency= fastSim->AddDetector("ScFts", "thtMin=0. thtMax=5. ptmin=0.0 pmin=0.5 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=

// ** Vertexing **

fastSim->AddDetector("ScVtxMvd", "thtMin=5. thtMax=145. ptmin=0.1 vtxRes=0.005 efficiency=1."); fastSim->AddDetector("ScVtxNoMvd", "thtMin=0. thtMax=5. ptmin=0.0 vtxRes=0.05 efficiency=1.");

// ** EM Calorimeters **

fastSim->AddDetector("EmcFwCap", "thtMin=10.0 thtMax=22.0 Emin=0.01 dist=2.5"); fastSim->AddDetector("EmcBwCap", "thtMin=142.0 thtMax=160.0 Emin=0.01 dist=0.7"); fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=142.0 Emin=0.01 barrelRadius=0.5"); fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=10.0 aPar=0.013 bPar=0.0283 Emin=0.01 dist=8.2");

// ** PID **

fastSim->AddDetector("DrcBarrel", "thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("DrcDisc", "thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("Rich", "angleXMax=5.0 angleYMax=10.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");

// ** Trackers with dE/dx **

fastSim->AddDetector("SttPid","thtMin=7.8 thtMax=159.5 ptmin=0.1 dEdxRes=0.15 efficiency=1 fastSim->AddDetector("MvdPid","thtMin=5. thtMax=133.6 ptmin=0.1 dEdxResMulti=1. efficiency=1.");

// ** Muon counters **

fastSim->AddDetector("ScMdtPidBarrel", "thtMin=10.0 thtMax=130.0 pmin=0.5 efficiency=0.95 misId=0.01"); fastSim->AddDetector("ScMdtPidForward","thtMin=0.0 thtMax=10.0 pmin=0.5 efficiency=0.95 misId=0.01");

// ** EMCs for PID **

fastSim->AddDetector("ScEmcPidFwCap", "thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBwCap", "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBarrel", "thtMin=22.0 thtMax=142.0 ptmin=0.2 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidFS", "thtMin=0.5 thtMax=10.0 ptmin=0.0 pmin=0.5 efficiency=1.0");

slide-31
SLIDE 31

Full PANDA Detector

  • K. Götzen

GlueX PANDA Workshop 2019 31

// ** Tracking **

fastSim->AddDetector("ScSttAlone", "thtMin=145. thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency= fastSim->AddDetector("ScSttMvd", "thtMin=20.9 thtMax=145. ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency= fastSim->AddDetector("ScSttMvdGem", "thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency fastSim->AddDetector("ScMvdGem", "thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 efficiency= fastSim->AddDetector("ScFts", "thtMin=0. thtMax=5. ptmin=0.0 pmin=0.5 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=

// ** Vertexing **

fastSim->AddDetector("ScVtxMvd", "thtMin=5. thtMax=145. ptmin=0.1 vtxRes=0.005 efficiency=1."); fastSim->AddDetector("ScVtxNoMvd", "thtMin=0. thtMax=5. ptmin=0.0 vtxRes=0.05 efficiency=1.");

// ** EM Calorimeters **

fastSim->AddDetector("EmcFwCap", "thtMin=10.0 thtMax=22.0 Emin=0.01 dist=2.5"); fastSim->AddDetector("EmcBwCap", "thtMin=142.0 thtMax=160.0 Emin=0.01 dist=0.7"); fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=142.0 Emin=0.01 barrelRadius=0.5"); fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=10.0 aPar=0.013 bPar=0.0283 Emin=0.01 dist=8.2");

// ** PID **

fastSim->AddDetector("DrcBarrel", "thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("DrcDisc", "thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); fastSim->AddDetector("Rich", "angleXMax=5.0 angleYMax=10.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");

// ** Trackers with dE/dx **

fastSim->AddDetector("SttPid","thtMin=7.8 thtMax=159.5 ptmin=0.1 dEdxRes=0.15 efficiency=1 fastSim->AddDetector("MvdPid","thtMin=5. thtMax=133.6 ptmin=0.1 dEdxResMulti=1. efficiency=1.");

// ** Muon counters **

fastSim->AddDetector("ScMdtPidBarrel", "thtMin=10.0 thtMax=130.0 pmin=0.5 efficiency=0.95 misId=0.01"); fastSim->AddDetector("ScMdtPidForward","thtMin=0.0 thtMax=10.0 pmin=0.5 efficiency=0.95 misId=0.01");

// ** EMCs for PID **

fastSim->AddDetector("ScEmcPidFwCap", "thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBwCap", "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidBarrel", "thtMin=22.0 thtMax=142.0 ptmin=0.2 pmin=0.0 efficiency=1.0"); fastSim->AddDetector("ScEmcPidFS", "thtMin=0.5 thtMax=10.0 ptmin=0.0 pmin=0.5 efficiency=1.0");

slide-32
SLIDE 32

Detector Parameters/Response

  • Detector parameters

– Global detection efficiency ε – Spatial acceptance in θ (sometimes φ) – Kinematic acceptance (pmin, pt,min, Emin, ...) – Resolutions: dp/p, dE/E, dt/t, dθ, dφ, vertex – Detector specific parameters (geometry, # layers, granularity,...)

  • Detector responses

– Accept/reject particle – Current resolution dp/p, dE/E, dt/t, dθ, dφ, vertex – PID probabilities (Pe, Pμ, Pπ, PK, Pp) – Raw PID information (EEMC, θC, dE/dx, Liron, ...)

  • Total response

– created from individual responses + applied to particle

  • K. Götzen

GlueX PANDA Workshop 2019 32

slide-33
SLIDE 33

Performance: Tracking Resolutions

  • K. Götzen

GlueX PANDA Workshop 2019 33

FAST FULL

dp/p (e±) dp/p (non-e±) dθ dφ

slide-34
SLIDE 34

Performance: PID

  • K. Götzen

GlueX PANDA Workshop 2019 34

DIRC STT EMC MDT MVD FAST FULL

slide-35
SLIDE 35

Combining Fast Simulation with Quick Analysis

slide-36
SLIDE 36

Quick Fast Simulation & Analysis

  • Same channel with Fast Sim → no simulation stage needed!

⇒ Events are generated on-the-fly

GlueX PANDA Workshop 2019 36

root -l -b -q 'quickfsimana.C( "jpsi", // output prefix "pp_Jpsi2pi_Jpsi_mumu.dec", // decay file 6.232, // p [GeV/c] "J/psi -> mu+ mu-; pbarpSystem -> J/psi pi+ pi-", // decay tree reco 1000, // # events generated "fit4c:fitvtx:mwin=0.8") // parameters TFile** jpsi_0_ana.root TFile* jpsi_0_ana.root KEY: TFolder cbmroot;1 Main Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi -> mu+ mu- KEY: TTree ntp1;1 pbarpSystem -> J/psi pi+ pi- KEY: TTree cbmsim;1 /cbmroot

  • K. Götzen
slide-37
SLIDE 37

Quick Fast Simulation & Analysis

  • Same channel with Fast Sim → no simulation stage needed!

⇒ Events are generated on-the-fly

GlueX PANDA Workshop 2019 37

root -l -b -q 'quickfsimana.C( "jpsi", // output prefix "pp_Jpsi2pi_Jpsi_mumu.dec", // decay file 6.232, // p [GeV/c] "J/psi -> mu+ mu-; pbarpSystem -> J/psi pi+ pi-", // decay tree reco 1000, // # events generated "fit4c:fitvtx:mwin=0.8") // parameters TFile** jpsi_0_ana.root TFile* jpsi_0_ana.root KEY: TFolder cbmroot;1 Main Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi -> mu+ mu- KEY: TTree ntp1;1 pbarpSystem -> J/psi pi+ pi- KEY: TTree cbmsim;1 /cbmroot

  • K. Götzen

Decay chain to be reco'd Generator config Reco options

slide-38
SLIDE 38

Quick Fast Simulation & Analysis

  • Same channel with Fast Sim → no simulation stage needed!

⇒ Events are generated on-the-fly

GlueX PANDA Workshop 2019 38

root -l -b -q 'quickfsimana.C( "jpsi", // output prefix "pp_Jpsi2pi_Jpsi_mumu.dec", // decay file 6.232, // p [GeV/c] "J/psi -> mu+ mu-; pbarpSystem -> J/psi pi+ pi-", // decay tree reco 1000, // # events generated "fit4c:fitvtx:mwin=0.8") // parameters TFile** jpsi_0_ana.root TFile* jpsi_0_ana.root KEY: TFolder cbmroot;1 Main Folder KEY: TList BranchList;1 Doubly linked list KEY: FairFileHeader FileHeader;1 KEY: TTree ntp0;1 J/psi -> mu+ mu- KEY: TTree ntp1;1 pbarpSystem -> J/psi pi+ pi- KEY: TTree cbmsim;1 /cbmroot

  • K. Götzen

Decay chain to be reco'd Generator config Reco options

slide-39
SLIDE 39

Event Generators Stand-alone Usage

slide-40
SLIDE 40

Important Particle Generators in PANDA

  • EvtGen (PndEvtGenDirect / simpleEvtGen)

– Generate signal reactions or specific backgrounds

  • DPM - Dual Parton Model (PndDpmDirect / DPMGen)

– Study p background reactions

  • FTF (PndFtfDirect / FTFGen)

– Study p and A background reactions

  • Particle Gun (PndBoxGenerator)

– Single tracks for acceptance, efficiency, resolution studies

  • Many others not discussed here

– GiBuu, UrQmd, Fluka, Pythia,...

  • K. Götzen

PANDA Computing Workshop - Thailand 40

slide-41
SLIDE 41

EvtGen

  • EvtGen - Generating specific signal/background reactions

– Decayer rather than generator – Knows many actual particle properties (evt.pdl) and decays (DECAY.DEC) – Extendable with new decay models – Configuration of a well defined decay chain

  • K. Götzen

PANDA Computing Workshop - Thailand 41

noPhotos Decay pbarpSystem 1.0 J/psi pi+ pi- PHSP; Enddecay Decay J/psi 0.0597 e+ e- VLL; 0.0596 mu+ mu- VLL; Enddecay End

EvtGen switches; Alias definitions Decay Models End of decay file with <CR> Decay definition Decay fractions (autom. normalized)

slide-42
SLIDE 42

EvtGen - Particles and Decays

  • K. Götzen

GlueX PANDA Workshop 2019 42

  • Knowledge base: particle list, decay table, decay models

evt.pdl DECAY.DEC

slide-43
SLIDE 43

EvtGen - Aliases and Decay-Models

  • K. Götzen

PANDA Computing Workshop - Thailand 43

Alias MyD0 D0 Alias MyD0b anti-D0 Decay pbarpSystem 0.5 MyD0 anti-D0 PHSP; 0.5 MyD0b D0 PHSP; Enddecay Decay MyD0 1.0 K- pi+ pi0 PHSP; Enddecay Decay MyD0b 1.0 K+ pi- pi0 D_DALITZ; Enddecay End

D_DALITZ PHSP

Decay not specified → decay according to DECAY.DEC! Alias is copy of known particle

slide-44
SLIDE 44

EvtGen - Stand-alone Usage

  • Executable: build/bin/simpleEvtGen(RO)
  • Stand-alone: Usefull for studying initial distributions
  • Simple ROOT TTree output
  • K. Götzen

PANDA Computing Workshop - Thailand 44

build/bin > ./simpleEvtGenRO USAGE: simpleEvtGen <particle> <dec-file> <# events> <pbar-mom/cms-energy> <rand seed> <A_Target> <particle> = particle type to decay, e.g. 'eta_c', 'pbarpSystem' etc. <dec-file> = EvtGen decay file (.DEC) to use; see directory 'test' for examples <# events> = number of events to produce; default value = 10 <pbar-mom> = (>0) momentum of the pbar beam; (<0) negativ cms energy; default value = mass of <particle>, mandatory, when <particle> = pbarpSystem <rand seed> = random seed for TRandom3. Value < 0 = use default random gen.; default = -1 <A_Target> = target nucleus mass number; mandatory when <particle> = 'pbarASystem' build/bin > ./simpleEvtGenRO pbarpSystem Jpsi2pi.dec 1000 7.0 ... build/bin > root -l evtOutput.root root [0] .ls TFile** evtOutput.root TFile* evtOutput.root KEY: TTree ntp;1 ntp

slide-45
SLIDE 45

EvtGen - ROOT Output

  • Contents of the output TTree are event based arrays with
  • Array indices according order in decay file configuration
  • For first example

– 0 = pbarpSystem, 1 = J/psi, 2 = pi+, 3 = pi-, 4 = mu+,...

  • K. Götzen

PANDA Computing Workshop - Thailand 45

Branches Content ev, nTrk Event, #particles in event N, Id particle ID, pdg code M1, M2, nDau, DF, DL Mother - daughter information E, px, py, pz, pt, p, tht, m 4-vector information t, x, y, z space-time vertex arrays

build/bin > root -l evtOutput.root root [0] ntp->Draw("m[1]") // plots generated mass distribution of J/psi

DF[0] DL[0] DF[1]

slide-46
SLIDE 46

DF[0] DL[0] DF[1]

EvtGen - ROOT Output

  • Contents of the output TTree are event based arrays with
  • Array indices according order in decay file configuration
  • For first example

– 0 = pbarpSystem, 1 = J/psi, 2 = pi+, 3 = pi-, 4 = mu+,...

  • K. Götzen

PANDA Computing Workshop - Thailand 46

Branches Content ev, nTrk Event, #particles in event N, Id particle ID, pdg code M1, M2, nDau, DF, DL Mother - daughter information E, px, py, pz, pt, p, tht, m 4-vector information t, x, y, z space-time vertex arrays

build/bin > root -l evtOutput.root root [0] ntp->Draw("m[1]") // plots generated mass distribution of J/psi

slide-47
SLIDE 47

DPM - Stand-alone Usage

  • Stand-alone executable: build/bin/DPMGen
  • Input parameters:

– Random seed – Beam momentum (for PANDA: 1.5 ... 15 GeV/c) – Mode (0 = inelastic, 1 = inel. + elastic, 2 = elastic) – Un/stable settings (e.g. '111 0' lets π0 be decayed by DPM) – Number of events

  • Output:

– ROOT file containing TTree 'data' with TParticles

  • K. Götzen

PANDA Computing Workshop - Thailand 47

slide-48
SLIDE 48

DPM - ROOT Output

  • Relevant (and filled) information in ROOT output
  • No mother-daughter relations stored
  • K. Götzen

PANDA Computing Workshop - Thailand 48

Branches/Methods Content Npart #particles in event fPdgCode PDG code of particle fE, fPx, fPy, fPz, fCalcMass 4-vector information Theta(), Phi(), Pt(), P() Eta(), Y() Additional kinematic information arrays

build/bin > ./DPMGen Give as seed a large float number (eg. 123456.): 23 Enter P_lab(GeV/c), 15 Enter Elastic : 0., 1. or 2. Enter: particle PDGcode and status (for example -- Pi0 unstable: 111 0), To go to event generation, Enter: 0 0 0 0 Enter N_Events 30000 build/bin > root -l Background-micro.root root [0] data->Draw("fCalcMass","fabs(fPdgCode)==3122")

slide-49
SLIDE 49

DPM - ROOT Output

  • Relevant (and filled) information in ROOT output
  • No mother-daughter relations stored
  • K. Götzen

PANDA Computing Workshop - Thailand 49

Branches/Methods Content Npart #particles in event fPdgCode PDG code of particle fE, fPx, fPy, fPz, fCalcMass 4-vector information Theta(), Phi(), Pt(), P() Eta(), Y() Additional kinematic information arrays

build/bin > ./DPMGen Give as seed a large float number (eg. 123456.): 23 Enter P_lab(GeV/c), 15 Enter Elastic : 0., 1. or 2. Enter: particle PDGcode and status (for example -- Pi0 unstable: 111 0), To go to event generation, Enter: 0 0 0 0 Enter N_Events 30000 build/bin > root -l Background-micro.root root [0] data->Draw("fCalcMass","fabs(fPdgCode)==3122")

slide-50
SLIDE 50

Event Filtering

slide-51
SLIDE 51

Event Filtering

  • Usually 𝜏𝐶𝑏𝑑𝑙𝑕𝑠𝑝𝑣𝑜𝑒 ≫ 𝜏𝑇𝑗𝑕𝑜𝑏𝑚 (e.g. ∼mb vs. ∼nb)
  • Since (full) simulation of reactions computational intensive:

– Idea: Reject events already at generator level likely being rejected at reco/analysis level – Saves a lot of computing power! – Caveat: Due to missing secondaries, rejecting criteria must be chosen carefully

  • Comprehensive tutorial at

https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootEventFilterTutorial

  • K. Götzen

PANDA Computing Workshop - Thailand 51

slide-52
SLIDE 52

Event Filtering in PandaRoot

PndFilteredPrimaryGenerator (w/ PndSmpFilt, PndSmpCand)

  • Complete logic via Disjunctive Normal Form
  • Filter on: Multiplicity, kinematic quantities, composite mass
  • Filterset: Individual filters combined with '&&' (AND)
  • Multiple filtersets combined with '||' (OR)
  • Negate individual filters with '!' (NOT)
  • Example:

!Ntrk ≤ 3 AND Ngam ≤ 6 AND N(2.0<M(e+ e-)<4.0 GeV/c2) ≥ 1 (No number range given defaults to '1..' = at least one)

  • Aug. 14, 2018
  • K. Götzen - PandaRoot Meeting

52

PndFilteredPrimaryGenerator* primGen = new PndFilteredPrimaryGenerator(); primGen->AddFilter("!(t+- ; ..3) && (gam ; ..6) && M(e+ e- ; m[3.0,2.0])");

(DNF = , e.g. )

slide-53
SLIDE 53

Event Filter Example

  • K. Götzen

GlueX PANDA Workshop 2019 53

Reconstruct: Filter: N(t+) ≥ 3, N(t−) ≥ 3, |mKK − mφ| < 150MeV, |m2K2π − mχc| < 500MeV → Unfiltered DPM: 1.2M ev; filtered DPM: 0.1M ev (→ 12x less simulation!!)

Signal MC Background (DPM)

slide-54
SLIDE 54

GlueX DSelector FlatTree Extension

slide-55
SLIDE 55

Idea: Extension for DSelector Flat Tree

  • Like to have flat tree for quick interactive work

– Current flat tree (TLorentzVectors) inconvenient for plotting e.g. arbitrary invariant masses

  • DComboTreeHelper class

– extends in DSelector package – modified MakeDSelector prepares code to use it – Adds to tree:

  • arbitrary combined invariant masses (measured, fitted, true)
  • full 4-vectors of combinations
  • branches of common usage (RF ∆t, accidental weights)
  • PID information (timings)
  • kinematic information (p, pt, theta, phi)
  • uniqueness flag + bit markers for uniqueness check
  • Dalitz plot variables+ opening/decay angles
  • K. Götzen

GlueX PANDA Workshop 2019 55

slide-56
SLIDE 56

Usage in DSelector

  • Inside DSelector_xyz::Init() [here e.g. for input: pipkmkspi0]
  • Adds branches (based on options):

– always : Inv. masses (_m, _mf, _mt), MM² (mm2), unique flag (_uni, _unifs), charge – p4 : 4-vectors of combinations as TLorentzVector (_meas, _kin, _thr) – acc : RF dt, weights for 2, 4, and 8 acc. bunches (rf_dt, w2, w4, w8) – pid : dtTOF, dtBCAL, dtFCAL (_dttof, _dtbcal, _dtfcal) – kin : kinematics of combinations (_p, _pt, _tht, _phi, beam_e, beam_z) – marker : bit marker for used final states (idxs_) – angle : opening/decay angles (_dec, _cdec, _oang) – dalitz : Dalitz vars (_m01, _m02, _m12, _dal01, _dal02, _dal12)

  • K. Götzen

GlueX PANDA Workshop 2019 56 ... //CREATE HELPER AND INITIALIZE WITH DESIRED COMBINATIONS TO BE STORED dComboTreeHelper = new DComboTreeHelper( dTreeInterface, dComboWrapper, dFlatTreeInterface, // the interfaces "Ks; pi0; pi+ K-; Ks pi+; Ks K-; p Ks; p pi0", // combinations to be stored dThrownWrapper, // interface MC match "p4:acc:pid:kin:marker:angle:dalitz"); // options

slide-57
SLIDE 57

Usage in DSelector

  • You only need to do (w/ modified MakeDSelector):
  • In DSelector_pipkmkspi0.C uncomment/modify
  • and that's it basically ...
  • K. Götzen

GlueX PANDA Workshop 2019 57 MakeDSelector tree_pipkmkspi0_030300.root pipkmkspi0_Tree pipkmkspi0 3 Bool_t DSelector_pipkmkspi0::Init(TTree *locTree) ... 107 dComboTreeHelper = new DComboTreeHelper(..., "Ks; pi0; pi+ K-; ...",...); ... 338 // FILL FLAT TREE 339 dComboTreeHelper->Fill(locEntry); 340 Fill_FlatTree();

slide-58
SLIDE 58

Output

  • K. Götzen

GlueX PANDA Workshop 2019 58

... Step 0 : g -> pip km ks pi0 p Step 1 : ks -> pim pip Step 2 : pi0 -> g g Final state : "pip km ks pi0 p pim pip g g " The particle list is: 0) pip [wrapper prt = 0x6f39f90] FS: 0 1) km [wrapper prt = 0x6f3a200] FS: 1 2) ks [wrapper prt = 0x6f3a420] FS: 5 6 3) pi0 [wrapper prt = 0x6f3a570] FS: 7 8 4) p [wrapper prt = 0x6f3dfe0] FS: 4 5) pim [wrapper prt = 0x6f3e2a0] FS: 5 6) pip [wrapper prt = 0x6f3e500] FS: 6 7) g [wrapper prt = 0x6f3e780] FS: 7 8) g [wrapper prt = 0x6f3e9e0] FS: 8 Requested combinatorics info for:

  • 0. ks : (branch prefix: ks) 2
  • 1. pi0 : (branch prefix: pi0) 3
  • 2. pip km : (branch prefix: pipkm) 01:16
  • 3. ks pip : (branch prefix: kspip) 02:26
  • 4. ks km : (branch prefix: kskm) 12
  • 5. p ks : (branch prefix: pks) 24
  • 6. p pi0 : (branch prefix: ppi0) 34

[DComboTreeHelper] Creating 191 branches: mm2 rf_dt w2 w4 w8 beam_e beam_z pip1_dttof pip1_dtbcal pip1_dtfcal pip1_p pip1_pt pip1_tht pip1_phi km_dttof km_dtbcal km_dtfcal km_p km_pt km_tht km_phi p_dttof p_dtbcal p_dtfcal p_p p_pt p_tht p_phi pim_dttof pim_dtbcal pim_dtfcal pim_p pim_pt pim_tht pim_phi pip2_dttof pip2_dtbcal pip2_dtfcal pip2_p pip2_pt pip2_tht pip2_phi g1_p g1_pt g1_tht g1_phi g2_p g2_pt ...

slide-59
SLIDE 59

Output

  • K. Götzen

GlueX PANDA Workshop 2019 59

... Step 0 : g -> pip km ks pi0 p Step 1 : ks -> pim pip Step 2 : pi0 -> g g Final state : "pip km ks pi0 p pim pip g g " The particle list is: 0) pip [wrapper prt = 0x6f39f90] FS: 0 1) km [wrapper prt = 0x6f3a200] FS: 1 2) ks [wrapper prt = 0x6f3a420] FS: 5 6 3) pi0 [wrapper prt = 0x6f3a570] FS: 7 8 4) p [wrapper prt = 0x6f3dfe0] FS: 4 5) pim [wrapper prt = 0x6f3e2a0] FS: 5 6) pip [wrapper prt = 0x6f3e500] FS: 6 7) g [wrapper prt = 0x6f3e780] FS: 7 8) g [wrapper prt = 0x6f3e9e0] FS: 8 Requested combinatorics info for:

  • 0. ks : (branch prefix: ks) 2
  • 1. pi0 : (branch prefix: pi0) 3
  • 2. pip km : (branch prefix: pipkm) 01:16
  • 3. ks pip : (branch prefix: kspip) 02:26
  • 4. ks km : (branch prefix: kskm) 12
  • 5. p ks : (branch prefix: pks) 24
  • 6. p pi0 : (branch prefix: ppi0) 34

[DComboTreeHelper] Creating 191 branches: mm2 rf_dt w2 w4 w8 beam_e beam_z pip1_dttof pip1_dtbcal pip1_dtfcal pip1_p pip1_pt pip1_tht pip1_phi km_dttof km_dtbcal km_dtfcal km_p km_pt km_tht km_phi p_dttof p_dtbcal p_dtfcal p_p p_pt p_tht p_phi pim_dttof pim_dtbcal pim_dtfcal pim_p pim_pt pim_tht pim_phi pip2_dttof pip2_dtbcal pip2_dtfcal pip2_p pip2_pt pip2_tht pip2_phi g1_p g1_pt g1_tht g1_phi g2_p g2_pt ...

slide-60
SLIDE 60

Examples Plots (MC data: pi+ pi- K+ K- p)

  • K. Götzen

GlueX PANDA Workshop 2019 60

RF ∆t RF ∆t weighted mfit(K+K-) mfit (weighted w/ w4) mfit (unique FS) mfit-mtrue (e.g. for resolution)

n->Draw("rf_dt") n->Draw("rf_dt", "w4") n->Draw("kpkm_mf") n->Draw("kpkm_mf","w4", "same") n->Draw("kpkm_mf","kpkm_unifs","same") n->Draw("kpkm_mf-kpkm_mt", "w4*(kin_chisq<25)")

slide-61
SLIDE 61

Examples Plots (data: pi+ pi- K+ K- p)

  • K. Götzen

GlueX PANDA Workshop 2019 61

m(KK) φ(1020) m(Kπ) K*(892) study correlation

  • correl. PIDBCAL:m
  • correl. PIDTOF:m

study correlation to find good selection

m(pK-) w/o cut m(pK-) w/ cut

slide-62
SLIDE 62

Summary

  • PandaRoot Rho

– Complete framework for basic analysis – Fast simulation/stand-alone generators for quick studies – Quick Analysis / simple TTree dump allow convenient and interactive analysis work

  • GlueX DSelector extension (DComboTreeHelper)

– Tries to transfer part of the quick analysis features – Allows to do combinatorics with no effort – Stores many quantities of general use – Could be intergrated in DSelector on github

  • K. Götzen

GlueX PANDA Workshop 2019 62

slide-63
SLIDE 63

BACKUP

slide-64
SLIDE 64

PANDA Analysis Toolset - Features

  • Data access (PndAnalysis)
  • Particle candidates (RhoCandidate, FairRecoCandidate)
  • PID (PndAnalysis, PndPidCombiner)
  • Combinatorics (RhoCandList)
  • Particle Selectors (Rho...Selector, PndAnaPidSelector)
  • MC truth (tree) matching (PndAnalysis::McTruthMatch)
  • Fitting: POCA finder, vertex-, kinematic-, tree fitters

– PndVtxPoca,PndKalmanVtxFitter, PndKinVtxFitter, PndDecayTreeFitter, PndKinFitter, Pnd4CFitter

  • N-tuples & QA Tools (RhoTuple, PndRhoTupleQA)
  • Quick Analysis (PndSimpleCombiner, PndSimpleCombinerTask)
  • Documentation (PandaRoot Wiki)

https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootRhoTutorial

GlueX PANDA Workshop 2019 64

  • K. Götzen
slide-65
SLIDE 65

Combinatorics in PandaROOT

  • Particle candidates: RhoCandList & RhoCandidate
  • Example channel:

GlueX PANDA Workshop 2019 65 RhoCandList piplus, piminus, gamma, pi0, jpsi, psip; // define RhoCandList‘s pndana->FillList(piplus, "PionAllPlus"); // positive chrg trks with pion hypo pndana->FillList(piminus, "PionAllMinus"); // negative chrg trks with pion hypo pndana->FillList(gamma, "Neutral"); // neutral particle candidates pi0.Combine(gamma, gamma); // avoid doubled combinations jpsi.Combine(piplus, piminus, pi0); psip.Combine(jpsi, piplus, piminus); // avoids mutiple use of particles for (int j=0; j<psip.GetLength(); ++j) // loop over candidates in TCandList { masshisto.Fill( psip[j]->M() ); // and fill e.g. a mass histo }

  • K. Götzen
slide-66
SLIDE 66

Particle Identification

slide-67
SLIDE 67

Particle Identification

Principle scheme

  • 1. Reconstruct track (candidate)
  • 2. Match track with PID detector signal
  • 3. Reconstruct PID information
  • 4. Compute likelihood for various particle types
  • K. Götzen

PANDA Lecture Week 2017 - GSI 67

TRK DIRC

current measurement

PDF

expected θc distributions for a certain momentum

slide-68
SLIDE 68

PID Concept in PandaROOT

  • Each PID subdetector delivers individual likelihood information
  • PID Combiner, which combines the likelihood values from

different detectors

  • Turn into a 'probability' via
  • PID Selector, which requires certain Pj for positive

identification of particle type j

  • K. Götzen

PANDA Lecture Week 2017 - GSI 68

slide-69
SLIDE 69

PID Concept in PandaROOT

  • PndAnalysis::FillList applies PID to candidates
  • Predefined selection with keywords (probability based)

Electron / Muon / Pion / Kaon / Proton + All / VeryLoose / Loose / Tight / VeryTight / Best + Plus / Minus (optional)

Simple keywords: Charged / Plus / Minus / Neutral / All

  • Available PID algorithms:
  • K. Götzen

PANDA Lecture Week 2017 - GSI 69

PndAnalysis *pndana = new PndAnalysis(); pndana->FillList(chrg, "Charged"); pndana->FillList(trpos, "Plus"); pndana->FillList(pipm, "PionAll", "PidAlgoMvd;PidAlgoStt"); pndana->FillList(kpm, "KaonTight", "PidAlgoDrd;PidAlgoSciT"); pndana->FillList(ep, "ElectronLoosePlus", "PidAlgoEmcBayes;PidAlgoMvd");

PidAlgoIdealCharged PidAlgoIdealNeutral PidAlgoMvd PidAlgoMdtHardCuts PidAlgoDrc PidAlgoDisc PidAlgoStt PidAlgoEmcBayes PidAlgoSciT PidAlgoFtof PidAlgoRich

slide-70
SLIDE 70

MC Truth Matching

slide-71
SLIDE 71

MC Truth Genealogy

  • Idea: Each Reco points to an McTruth object, from which

the full truth tree can be accessed

71

trk+ trk+ trk- trk- All Reco ψ(2S) π+ J/ψ μ+ μ- π- secondaries McTruth trk- trk- neut

TheMother() Daughter(i)

GetMcTruth()

→ not matched

GlueX PANDA Workshop 2019

  • K. Götzen
slide-72
SLIDE 72

MC Truth Tree Match

  • If composites reconstructed correctly, GetMcTruth() also works

for those

72

trk+ trk+ trk- trk- All Reco ψ(2S) π+ J/ψ μ+ μ- π- McTruth trk- neut

TheMother() Daughter(i)

GetMcTruth() jpsi psi'

GlueX PANDA Workshop 2019

  • K. Götzen
slide-73
SLIDE 73

MC Truth Tree Match

  • For matching, composite candidates have to have type set

73 PndAnalysis *ana = new PndAnalysis(); jpsi.Combine(muplus, muminus, "J/psi"); // type J/psi (ROOT names/PDG code) psi2s.Combine(jpsi, piplus, piminus, "psi'"); // type psi(3868) bool match = ana->McTruthMatch( psi2s[0] ); // match for single RhoCandidate int nmatch = ana->McTruthMatch( psi2s ); // match complete RhoCandList if (match) RhoCandidate *truth = psi2s[j].GetMcTruth(); // access compos. truth GlueX PANDA Workshop 2019

  • K. Götzen

All candidates MC truth match

m(μ+μ-) [GeV/c2]

  • Example channel
  • p → J/ψ (→ μ+μ−) π+π−
  • 1000 signal events
slide-74
SLIDE 74

Fitting

slide-75
SLIDE 75

Fitting in PandaROOT

  • Fit results are attached to RhoCandidates
  • Can be accessed as full tree, allows cascaded fitting!
  • E.g. vertex fitting + mass fitting might look like this:
  • Under development: PndDecayTreeFitter doing all at once

75 RhoCandidate *lambda = pplus->Combine( piminus ); PndKinVtxFitter fitvtx( lambda ); // setup vertex fitter fitvtx.Fit(); // perform fit RhoCandidate *lambda_vtx = lambda->GetFit(); // access fit results PndKinFitter fitmass( lambda_vtx ); // setup mass fitter fitmass.SetMassConstraint( 1.115 ); // set mass constraint fitmass.Fit(); // perform fit RhoCandidate *lambda_mass = lambda_vtx->GetFit(); // access cascaded fit results RhoCandidate *fit_pplus = lambda_mass->Daughter( 0 ); RhoCandidate *fit_piminus = lambda_mass->Daughter( 1 );

  • K. Götzen

GlueX PANDA Workshop 2019

slide-76
SLIDE 76

Fitting: Access to Results

  • After fit → full fitted tree is attached to the reco object

76

Fit Results

TheMother() Daughter(i)

ψ(2S) π+ J/ψ μ+ μ- π- Reco'd Decay

TheMother() Daughter(i)

ψ(2S) J/ψ π- μ+ μ- π+ GetFit()

  • K. Götzen

GlueX PANDA Workshop 2019

slide-77
SLIDE 77

Fitting Example: Vertex-Fit

  • PandaROOT object: PndKinVtxFitter
  • K. Götzen

GlueX PANDA Workshop 2019 77 // ... in event loop ... for (j=0; j<ks.GetLength(); ++j) { PndKinVtxFitter vtxfitter(ks[j]); // instantiate vertex fitter vtxfitter.Fit(); // perform fit RhoCandidate *ksfit = ks[j]->GetFit(); // get fitted candidate TVector3 ksVtx = ksfit->Pos(); // and the vertex position double chi2_vtx = vtxfitter.GetChi2(); // and the chi^2 of the fit if ( chi2_vtx<max_chi ) // if chi2 is good enough { // fill some histos hks_m_vf->Fill( ksfit->M() ); hvpos->Fill( ksVtx.X(),ksVtx.Y() ); } }

slide-78
SLIDE 78

Vertex Fitting (PndKinVtxFitter)

  • Example channel (FastSim): p → KS (→ π+π−) X
  • 2000 signal, 5000 background (DPM)

GlueX PANDA Workshop 2019 78

All DPM All cτ > 0.2cm

m(π+π−) [GeV/c2]

m(π+π−) c·τ (π+π−)

c·τ [cm]

  • K. Götzen
slide-79
SLIDE 79

Fitting Example: 4C-Fit

  • PandaROOT object: PndKinFitter
  • K. Götzen

GlueX PANDA Workshop 2019 79 // the lorentz vector of the initial system; important for the 4C-fit TLorentzVector ini(0, 0, 6.232, 7.240); // ... in event loop ... for (j=0;j<psi2s.GetLength();++j) { PndKinFitter fitter(psi2s[j]); // instantiate the kinematic fitter fitter.Add4MomConstraint(ini); // set 4 vector constraint fitter.Fit(); // perform fit RhoCandidate *jfit = psi2s[j]->Daughter(0)->GetFit(); // get fitted J/psi Double_t chi2 = fitter.GetChi2(); // and the chi^2 of the fit if ( 0 != jfit ) { hjpsim_4cf->Fill( jfit->M() ); // fill histogram } }

slide-80
SLIDE 80

4C Fitting (PndKinFitter)

  • Example channel (FullSim): p → J/ψ (→ μ+μ−) π+π−
  • 1000 signal events

GlueX PANDA Workshop 2019 80

m(μ+μ−) [GeV/c2]

m(μ+μ−) raw m(μ+μ−) with 4C on p m(μ+μ−)

  • K. Götzen
slide-81
SLIDE 81

Details: Overlap mechanism

  • K. Götzen

GlueX PANDA Workshop 2019 81

  • Problem:

– reconstruct a complicated decay tree – make sure, that no final state appears twice in the tree – check should be fast!

  • Idea:

– Make use of bit markers – Example

  • K+

1: 10000000

  • K+

2: 01000000

  • K-

1: 00100000

  • K-

2: 00010000

– Very fast with binary & and |, even in complicated decay trees!

1: 10100000 (K1+ OR K1

  • )

2: 10010000 (K1+ OR K2

  • )

3: 01100000 (K2+ OR K1

  • )

4: 01010000 (K2+ OR K2

  • )

≠! X1 = 1 + 2 : overlap 1 AND 2 = 10000000 ≠ 0 ! invalid! X2 = 1 + 4 : overlap 1 AND 4 = 00000000 ! valid!

slide-82
SLIDE 82

PID Concept in PandaROOT

PandaROOT: PndAnaPidCombiner, PndAnaPidSelector

  • PndAnaPidCombiner

– combines on demand probabilities from various algorithms by computing product of all Pk (k=algorithms) – copies resulting probabilities to RhoCandidate/RhoCandList

  • PndAnaPidSelector

– selects particles based on these probabilities

  • PndAnalysis::FillList is a short-cut to this funtionallity via

pndana.FillList(list, “ElectronLoose“, "PidAlgoEmcBayes;PidAlgoDrc");

  • Predefined selection with keywords (probability based)

Electron / Muon / Pion / Kaon / Proton + All / VeryLoose / Loose / Tight / VeryTight / Best + Plus / Minus (optional)

Simple keywords

Charged / Plus / Minus / Neutral / All

  • K. Götzen

PANDA Lecture Week 2017 - GSI 82

slide-83
SLIDE 83

PID Concept in PandaROOT

  • PandaROOT:

PndAnalysis, PndAnaPidCombiner, PndAnaPidSelector

  • K. Götzen

PANDA Lecture Week 2017 - GSI 83 PndAnalysis *pndana= new PndAnalysis(); pndana->FillList(eplus, "ElectronLoosePlus", "PidAlgoEmcBayes;PidAlgoMvd"); pndana->FillList(eminus, "ElectronLooseMinus", "PidAlgoEmcBayes;PidAlgoMvd"); RhoCandList charged, kaonLoose; PndAnaPidSelector kaonSel("KaonSelector"); kaonSel.SetSelection("KaonLoose"); // set selection criterion PndAnaPidCombiner pidComb("PidCombiner"); pidComb.SetTcaNames("PidAlgoDrc;PidAlgoMvd"); // set algo‘s while (evr->GetEvent()) { pndana->FillList(charged, "Charged"); // start w/ charged candidates pidComb.Apply(charged); // copy probab. to candidates kaonLoose.Select(charged, kaonSel); // select kaons from charged }

Or 'by hand':

slide-84
SLIDE 84

PndRhoTupleQA - TTree made simple

  • Provides QA functions for persisting values in TTree

GlueX PANDA Workshop 2019 84

// *** QA for candidates void qaCand(TString pre, RhoCandidate *cc, RhoTuple *n, bool skip=false); void qaP4(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cms(TString pre, TLorentzVector c, RhoTuple *n, bool skip=false); void qaP4Cov(TString pre, RhoCandidate *c, RhoTuple *n, bool skip=false); // *** QA for composites void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); void qaKs0(TString pre, RhoCandidate *c, RhoTuple *n); void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n); // *** QA of event shape void qaEventShape(TString pre, PndEventShape *evsh, RhoTuple *n); void qaEventShapeShort(TString pre, PndEventShape *evsh, RhoTuple *n); // *** QA for parts of eventshape void qaESPidMult(TString pre, PndEventShape *evsh, double prob, double pmin, RhoTuple *n); void qaESMult(TString pre, PndEventShape *evsh, RhoTuple *n); void qaESSum(TString pre, PndEventShape *evsh, RhoTuple *n); void qaESMinMax(TString pre, PndEventShape *evsh, RhoTuple *n); void qaESEventVars(TString pre, PndEventShape *evsh, RhoTuple *n); // *** QA track, vtx, PID, decay void qaVtx(TString pre, RhoCandidate *c, RhoTuple *n); void qaPoca(TString pre, RhoCandidate *c, RhoTuple *n); ....

Very handy function to store composite info!

  • K. Götzen
slide-85
SLIDE 85

PndRhoTupleQA - Application

  • Concretely it might look like this:

GlueX PANDA Workshop 2019 85 double pbarmom = 15.0; PndAnalysis *ana = new PndAnalysis(); PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;j<jpsi.GetLength();++j) { // *** store event number and candidate number in current event ntp->Column("ev", (Float_t) evnumber, -999.0f); ntp->Column("cand", (Float_t) j, -999.0f); // *** all information about composite J/psi, // **** including info about daughters, 2-body quantities and MC truth qa.qaComp("x", jpsi[j], ntp); // *** and fill ntuple ntp->DumpData(); }

  • K. Götzen
slide-86
SLIDE 86

Fast Simulation Details

slide-87
SLIDE 87

Detector Modules

  • K. Götzen

GlueX PANDA Workshop 2019 87

Target Spectrometer Forward Spectrometer

TRK EMC PID

STT STT + MVD STT + MVD + GEM MVD + GEM Fwd TS EMC Barrel EMC Fwd EMC Bwd EMC FS EMC Barrel EMC Fwd EMC Bwd STT PID MVD PID MUO PID DIRC PID DISC PID EMC FS PID RICH PID MUO FS PID MVD Vtx

slide-88
SLIDE 88

Performance: Tracking Efficiency

  • K. Götzen

GlueX PANDA Workshop 2019 88

εTRK,Fast ≈ 85% εTRK,Full ≈ 80%

slide-89
SLIDE 89

Performance: Gamma Efficiency

  • K. Götzen

GlueX PANDA Workshop 2019 89

εgam,Fast ≈ 100% εgam,Full ≈ 100%

Gamma efficiency Gamma efficiency

slide-90
SLIDE 90

Performance: Gamma Resolutions

  • K. Götzen

GlueX PANDA Workshop 2019 90

FAST FULL

dE/E vs. E dθ vs. θ dφ vs. φ

slide-91
SLIDE 91

Event Filtering in PandaRoot

PndFilteredPrimaryGenerator (w/ PndSmpFilt, PndSmpCand)

  • Complete logic via Disjunctive Normal Form
  • Filter on: Multiplicity, kinematic quantities, composite mass
  • Filterset: Individual filters combined with '&&' (AND)
  • Multiple filtersets combined with '||' (OR)
  • Negate individual filters with '!' (NOT)
  • Example:

!Ntrk ≤ 3 AND Ngam ≤ 6 AND N(2.0<M(e+ e-)<4.0 GeV/c2) ≥ 1 (No number range given defaults to '1..' = at least one)

  • Aug. 14, 2018
  • K. Götzen - PandaRoot Meeting

91

PndFilteredPrimaryGenerator* primGen = new PndFilteredPrimaryGenerator(); primGen->AddFilter("!(t+- ; ..3) && (gam ; ..6) && M(e+ e- ; m[3.0,2.0])");

(DNF = , e.g. )

slide-92
SLIDE 92

Filter Syntax

Syntax:

  • Counts: "(<particle> ; [<mult>] ; [kinematic cuts])"

<particle>: particle type (MC truth) to count any (tracks/neutrals), t+- (tracks), t+, t-, nt/gam (neutrals) e+, e-, e+-, mu+, mu-, mu+-, pi+, pi-, pi+-, k+, k-, k+- p+, p-, p+-, n0 (neutron), n0b, n00b (neutron or anti-neutron) pdg[<pdg code>], pdg[<pdg code>*1000] (incl. anti-particle)

  • Inv. mass: "M(<p1> <p2> [<p3> .. <p5>] ; m[ctr, wid] ; [<mult>] ; [kin. cuts])"

<pi> : particle hypothesis to be applied for combinatorics e+, e-, mu+, mu-, pi+, pi-, k+, k-, p+, p-, gam m[ctr,wid] : mass window | minv - ctr | ≤ wid / 2

  • Aug. 14, 2018
  • K. Götzen - PandaRoot Meeting

92

slide-93
SLIDE 93

Filter Syntax

Syntax:

  • <mult>: multiplicity

min .. max : min ≤ N ≤ max (t+- ; 2..4) num = num..num (pdg[3122] ; 1) ..max = 0 .. max (nt ; ..2) min.. = min .. 10000 (any ; 4..) none = 1 .. 10000 (K+)

  • <kinematic cuts>: optional cuts on p, pt, pz, tht, phi (= keyword X)

p, pt, and pz in [GeV/c] tht and phi in [deg] X[min, max] : min ≤ X ≤ max (t+- ; phi[5,10]) X[ ,max] = X[0 , max] (nt ; tht[,20]) X[min, ] = X[min, 1E8] (mu+- ; pt[1,])

  • Aug. 14, 2018
  • K. Götzen - PandaRoot Meeting

93

examples examples short cuts short cuts

slide-94
SLIDE 94

Filter Examples

Examples:

  • { N(K±) ≥ 2 AND N(π±) ≥ 2 } OR N(p/ ) ≥ 2
  • { N(part) ≥ 6 AND N(|m2π2γ - 0.78| < 0.1) ≥ 1 } OR N(|mK-π+ - 1.86| < 0.05) = 1
  • N(γ) ≥ 4 AND

{ N(|mγγ - 0.14| < 0.02 and pγγ > 2 and θγγ ≤ 20°) ≥ 2 OR N(|mγγ - 0.55| < 0.03 and pγγ > 1 and 5° ≤ θγγ ≤ 45°) ≥ 1 }

  • Aug. 14, 2018
  • K. Götzen - PandaRoot Meeting

94

AddFilter("(K+- ; 2..) && (pi+- ; 2..) || (p+- ; 2..)"); AddFilter("(any; 6..) && M(pi+ pi- gam gam; m[0.78,0.2])"); AddFilter("M(K- pi+ nocc ; 1 ; m[1.86,0.1])");

AddFilter("(gam; 4..) && M(gam gam ; m[0.14,0.04] ; p[2,] ; tht[,20] ; 2..)"); AddFilter("(gam; 4..) && M(gam gam ; m[0.55,0.06] ; p[1,] ; tht[5,45])");