Synergien bei BES3 und PANDA - Thomas Jefferson National ...

Synergien bei BES3 und PANDA - Thomas Jefferson National ...

Analysis Tools in PandaRoot GlueX PANDA Workshop 2019 Washington, GW, May 3 - 5, 2019 Klaus Gtzen GSI Darmstadt Topics Performing analysis The Rho Analysis Framework PandaRoot Tools Only briefly discussed 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. Gtzen GlueX PANDA Workshop 2019 2 Performing Analysis 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. Gtzen GlueX PANDA Workshop 2019 4 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 K. Gtzen GlueX PANDA Workshop 2019 5 Basic Analysis Basic Analysis via ROOT Macro ... 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. Gtzen GlueX PANDA Workshop 2019 7 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access 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. Gtzen GlueX PANDA Workshop 2019 8 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access PndAnalysis *ana = new PndAnalysis(); Candidate RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi,Lists 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. Gtzen GlueX PANDA Workshop 2019 9 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access PndAnalysis *ana = new PndAnalysis(); Candidate RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi,Lists 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"); PID Selection & Algorithms 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. Gtzen GlueX PANDA Workshop 2019 10 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access

PndAnalysis *ana = new PndAnalysis(); Candidate RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi,Lists 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"); PID Selection & Algorithms Combinatorics 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. Gtzen GlueX PANDA Workshop 2019

11 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access PndAnalysis *ana = new PndAnalysis(); Candidate RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi,Lists 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"); PID Selection & Algorithms Combinatorics

MC truth 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. Gtzen GlueX PANDA Workshop 2019 match 12 Basic Analysis via ROOT Macro ... FairRunAna *fRun = new FairRunAna(); Object fRun->SetInputFile("pbarp_jpsi_pipipi0.root"); for data access PndAnalysis *ana = new PndAnalysis(); Candidate RhoCandList eplus, eminus, piplus, piminus, gamma, pi0, jpsi,Lists 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"); n i s l i a t e D e r o M BACKUP slides PID Selection & Algorithms Combinatorics MC truth 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. Gtzen GlueX PANDA Workshop 2019 match 13 Output and QA TTrees with RhoTuple Creating TTree output without overhead RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;jColumn("ev", (Float_t) evnumber, -999.0f); ntp->Column("cand", (Float_t) j, -999.0f); // *** basic information about ntp->Column("jpsim", (Float_t) ntp->Column("jpsip", (Float_t) ntp->Column("jpsipt",(Float_t) ntp->Column("jpsiE", (Float_t) .... ntp->DumpData();

J/psi jpsi[j]->M(), jpsi[j]->P(), jpsi[j]->P4().Pt(), jpsi[j]->E(), } ... // ... end of macro ... TFile *f=new TFile("ntp.root","RECREATE"); ntp->GetInternalTree()->Write(); f->Close(); K. Gtzen -999.0f); -999.0f); -999.0f); -999.0f); Just create new branches on the fly! GlueX PANDA Workshop 2019 15 PndRhoTupleQA - TTree made simple Provides QA functions for persisting values in TTree // *** 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 Very handy function void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); store composite info! void qaKs0(TString pre, RhoCandidate *c, RhoTuple to *n); void qaPi0(TString pre, RhoCandidate *c, RhoTuple *n); ... Usage: PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;jDumpData(); // *** and fill ntuple } K. Gtzen GlueX PANDA Workshop 2019 16 PndRhoTupleQA - TTree made simple

Provides QA functions for persisting values in TTree // *** QA for candidates void qaCand(TString RhoCandidate *cc, RhoTuple *n, bool skip=false); This createspre, branches: 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); ... Usage: PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ... // ... in event loop ... for (j=0;jDumpData(); // *** and fill ntuple } K. Gtzen

GlueX PANDA Workshop 2019 17 PndRhoTupleQA - TTree made simple Provides QA functions for persisting values in TTree // *** QA for candidates void qaCand(TString RhoCandidate This createspre, branches: infos *cc, about RhoTuple daugther 0*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); ... Usage: PndRhoTupleQA qa(ana, pbarmom); RhoTuple *ntp = new RhoTuple("ntp","J/psi analysis"); ...

// ... in event loop ... for (j=0;jDumpData(); // *** and fill ntuple } K. Gtzen GlueX PANDA Workshop 2019 18 Quick Analysis Tools 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/ ( p J/ ( +) + can be done by root -l -b -q 'quickana.C( "pid_complete.root", 6.232, "J/psi->mu+ mu-; pbarpSystem->J/psi pi+ pi-", reco 0, (0=all) "fit4c:fitvtx:mwin(J/psi)=0.8" )' parameters

Attaching file pid_complete_ana.root as _file0... // input file // p [GeV/c] // decay tree // #events // some 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+ muKEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi- K. Gtzen GlueX PANDA Workshop 2019 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/ ( p J/ ( +) + can be done by Decay chain to be reco'd 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 Reco// options (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+ muKEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi- K. Gtzen GlueX PANDA Workshop 2019 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/ ( p J/ ( +) + can be done by root -l -b -q 'quickana.C( "pid_complete.root", 6.232, "J/psi->mu+ mu-; pbarpSystem->J/psi pi+ pi-", reco 0, (0=all) "fit4c:fitvtx:mwin(J/psi)=0.8" )' parameters Attaching file pid_complete_ana.root as _file0... // input file // p [GeV/c] // decay tree // #events

// some 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+ muKEY: TTree ntp1;1 pbarpSystem->J/psi pi+ pi- K. Gtzen GlueX PANDA Workshop 2019 22 Quick Analysis Parameters https://panda-wiki.gsi.de/foswiki/bin/view/Computing/ PandaRootRhoTutorial#A_5._Quick_analysis fitting mass cuts energy/momentum cut PID control

output control K. Gtzen GlueX PANDA Workshop 2019 23 Quick Analysis Parameters https://panda-wiki.gsi.de/foswiki/bin/view/Computing/ PandaRootRhoTutorial#A_5._Quick_analysis Our X(3872) scan analysis was completely done with quickana.C ... and is published now! [EPJ [EPJ A A 55 55 (2019) (2019) 42] 42] K. Gtzen GlueX PANDA Workshop 2019 24 Fast Simulation 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. Gtzen GlueX PANDA Workshop 2019 26 Concept Generator Particle P Detector 1 Response 1 for P Detector 2 ... Response 2 for P Detector n ... Modify/Reject/Add info to P according to total response Response n for P reject

add Reco Particle P' K. Gtzen Secondaries for P' GlueX PANDA Workshop 2019 27 Detector Modules Target Spectrometer TRK STT Forward Spectrometer STT + MVD + GEM STT + MVD MVD + GEM EMC Barrel EMC Fwd Fwd TS MVD Vtx

EMC FS EMC EMC Bwd PID K. Gtzen EMC Barrel STT PID DIRC PID EMC FS PID EMC Fwd MVD PID DISC PID RICH PID EMC Bwd MUO PID Fast Simulations - PANDA CM June 2014 MUO FS PID 28 Acceptance Modelling

Spatial acceptance typically defined by polar range from IP Different trackers or EMCs should not overlap Barrel DRC EMC Barrel Central Tracking (STT + MVD) EMC BwdCap IP Disc DRC Fwd Tracker STT + GEM EMC FwdCap Just for illustration K. Gtzen GlueX PANDA Workshop 2019 29 Full PANDA Detector // ** Tracking ** fastSim->AddDetector("ScSttAlone", efficiency=0.25"); fastSim->AddDetector("ScSttMvd", efficiency=0.85");

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

// ** 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 fastSim->AddDetector("EmcBwCap", "thtMin=142.0 fastSim->AddDetector("EmcBarrel","thtMin=22.0 fastSim->AddDetector("EmcFS", "thtMin=0.05 // ** PID ** fastSim->AddDetector("DrcBarrel", fastSim->AddDetector("DrcDisc", fastSim->AddDetector("Rich", thtMax=22.0 thtMax=160.0 thtMax=142.0 thtMax=10.0 Emin=0.01 dist=2.5"); Emin=0.01 dist=0.7"); Emin=0.01 barrelRadius=0.5"); aPar=0.013 bPar=0.0283 Emin=0.01 dist=8.2"); "thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); "thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); "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 fastSim->AddDetector("MvdPid","thtMin=5. thtMax=133.6 ptmin=0.1 dEdxRes=0.15 efficiency=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", K. Gtzen fastSim->AddDetector("ScEmcPidBwCap", "thtMin=10.0 thtMax=22.0 GlueX PANDA Workshop "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); 30 pmin=0.0 efficiency=1.0"); 2019 ptmin=0.0 Full PANDA Detector // ** Tracking ** fastSim->AddDetector("ScSttAlone", efficiency=0.25");

fastSim->AddDetector("ScSttMvd", efficiency=0.85"); fastSim->AddDetector("ScSttMvdGem", efficiency=0.85"); fastSim->AddDetector("ScMvdGem", efficiency=0.60"); fastSim->AddDetector("ScFts", efficiency=0.80"); "thtMin=145. thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 "thtMin=20.9 thtMax=145. ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 "thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 "thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 "thtMin=0. thtMax=5.

ptmin=0.0 pmin=0.5 pRes=0.05 thtRes=0.002 phiRes=0.002 // ** 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 fastSim->AddDetector("EmcBwCap", "thtMin=142.0 fastSim->AddDetector("EmcBarrel","thtMin=22.0 fastSim->AddDetector("EmcFS", "thtMin=0.05 Emin=0.01 dist=2.5"); lueX G p u t e s Emin=0.01 dist=0.7"); d l u o c Emin=0.01 barrelRadius=0.5"); Probably :-) Emin=0.01 dist=8.2"); e

aPar=0.013 bPar=0.0283 m i t t r o h s in Detector // ** PID ** fastSim->AddDetector("DrcBarrel", fastSim->AddDetector("DrcDisc", fastSim->AddDetector("Rich", thtMax=22.0 thtMax=160.0 thtMax=142.0 thtMax=10.0 "thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); "thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075"); "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", K. Gtzen fastSim->AddDetector("ScEmcPidBwCap", "thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); GlueX PANDA Workshop 2019 31 "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0"); 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. Gtzen GlueX PANDA Workshop 2019 32 Performance: Tracking Resolutions dp/p (non-e) d d FULL FAST dp/p (e) K. Gtzen GlueX PANDA Workshop 2019 33 Performance: PID DIRC

STT EMC MDT MVD FAST FULL K. Gtzen GlueX PANDA Workshop 2019 34 Combining Fast Simulation with Quick Analysis Quick Fast Simulation & Analysis Same channel with Fast Sim no simulation stage needed! Events are generated on-the-fly 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+ muKEY: TTree ntp1;1 pbarpSystem -> J/psi pi+ piKEY: TTree cbmsim;1 /cbmroot K. Gtzen GlueX PANDA Workshop 2019 36 Quick Fast Simulation & Analysis Same channel with Fast Sim no simulation stage needed! Events are generated on-the-fly

root -l -b -q 'quickfsimana.C( Generator config "jpsi", // output prefix Decay//chain tofile be reco'd "pp_Jpsi2pi_Jpsi_mumu.dec", decay 6.232, // p [GeV/c] "J/psi -> mu+ mu-; pbarpSystem -> J/psi pi+ pi-", // decay tree reco 1000, // # events generated Reco options "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+ muKEY: TTree ntp1;1 pbarpSystem -> J/psi pi+ piKEY: TTree cbmsim;1 /cbmroot

K. Gtzen GlueX PANDA Workshop 2019 37 Quick Fast Simulation & Analysis Same channel with Fast Sim no simulation stage needed! Events are generated on-the-fly root -l -b -q 'quickfsimana.C( Generator config "jpsi", // output prefix Decay//chain tofile be reco'd "pp_Jpsi2pi_Jpsi_mumu.dec", decay 6.232, // p [GeV/c] "J/psi -> mu+ mu-; pbarpSystem -> J/psi pi+ pi-", // decay tree reco 1000, // # events generated Reco options "fit4c:fitvtx:mwin=0.8") // parameters sis ly a n

A + n io t la im u TFile** omplejpsi_0_ana.root te (Fast) S C TFile* jpsi_0_ana.root ell command! ith one shMain Folder KEY: TFolder w cbmroot;1 KEY: KEY: KEY: KEY: KEY: K. Gtzen TList BranchList;1 Doubly linked list FairFileHeader FileHeader;1 TTree ntp0;1 J/psi -> mu+ muTTree ntp1;1 pbarpSystem -> J/psi pi+ piTTree cbmsim;1 /cbmroot

GlueX PANDA Workshop 2019 38 Event Generators Stand-alone Usage Important Particle Generators in PANDA EvtGen (PndEvtGenDirect / simpleEvtGen) Generate signal reactions or specific backgrounds DPM - Dual Parton Model (PndDpmDirect / DPMGen) Study p J/ ( p background reactions FTF (PndFtfDirect / FTFGen) Study p J/ ( p and p J/ ( A background reactions Particle Gun (PndBoxGenerator) Single tracks for acceptance, efficiency, resolution studies Many others not discussed here GiBuu, UrQmd, Fluka, Pythia,... K. Gtzen

PANDA Computing Workshop - Thailand 40 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 noPhotos Decay pbarpSystem 1.0 J/psi pi+ piEnddecay EvtGen switches; Alias definitions PHSP; Decay definition Decay Models Decay J/psi 0.0597 e+ e0.0596 mu+ muEnddecay End K. Gtzen VLL; VLL;Decay fractions

(autom. normalized) End of decay file with PANDA Computing Workshop - Thailand 41 EvtGen - Particles and Decays Knowledge base: particle list, decay table, decay models evt.pdl DECAY.DEC K. Gtzen GlueX PANDA Workshop 2019 42 EvtGen - Aliases and Decay-Models Alias Alias MyD0 MyD0b D0 anti-D0 Alias is copy of known particle

Decay pbarpSystem 0.5 MyD0 anti-D0 0.5 MyD0b D0 Enddecay PHSP; PHSP; Decay MyD0 1.0 K- pi+ pi0 Enddecay PHSP; Decay MyD0b 1.0 K+ pi- pi0 Enddecay D_DALITZ; Decay not specified decay according to DECAY.DEC! End D_DALITZ K. Gtzen PANDA Computing Workshop - Thailand

PHSP 43 EvtGen - Stand-alone Usage Executable: build/bin/simpleEvtGen(RO) Stand-alone: Usefull for studying initial distributions Simple ROOT TTree output build/bin > ./simpleEvtGenRO USAGE: simpleEvtGen <# events> <# events> = = = = particle type to decay, e.g. 'eta_c', 'pbarpSystem' etc. EvtGen decay file (.DEC) to use; see directory 'test' for examples number of events to produce; default value = 10 (>0) momentum of the pbar beam; (<0) negativ cms energy; default value = mass of , mandatory, when = pbarpSystem

= random seed for TRandom3. Value < 0 = use default random gen.; default = -1 = target nucleus mass number; mandatory when = '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 K. Gtzen PANDA Computing Workshop - Thailand 44 EvtGen - ROOT Output arrays Contents of the output TTree are event based arrays with 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 Array indices according order in decay file configuration For first example DL[0] DF[1] DF[0] 0 = pbarpSystem, 1 = J/psi, 2 = pi+, 3 = pi-, 4 = mu+,... build/bin > root -l evtOutput.root root [0] ntp->Draw("m[1]") // plots generated mass distribution of J/psi K. Gtzen PANDA Computing Workshop - Thailand

45 EvtGen - ROOT Output arrays Contents of the output TTree are event based arrays with 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 Array indices according order in decay file configuration For first example DL[0] DF[1] DF[0] 0 = pbarpSystem, 1 = J/psi, 2 = pi+, 3 = pi-, 4 = mu+,... build/bin > root -l evtOutput.root root [0] ntp->Draw("m[1]") // plots generated mass distribution of J/psi K. Gtzen PANDA Computing Workshop - Thailand 46 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. Gtzen PANDA Computing Workshop - Thailand 47 DPM - ROOT Output arrays Relevant (and filled) information in ROOT output 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 No mother-daughter relations stored 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. 0 Enter: particle PDGcode and status (for example -- Pi0 unstable: 111 0), To go to event generation, Enter: 0 0 Enter N_Events 30000 0 0 build/bin > root -l Background-micro.root root [0] data->Draw("fCalcMass","fabs(fPdgCode)==3122") K. Gtzen PANDA Computing Workshop - Thailand 48 DPM - ROOT Output

arrays Relevant (and filled) information in ROOT output 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 No mother-daughter relations stored 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. 0 Enter: particle PDGcode and status (for example -- Pi0 unstable: 111 0), To go to event generation, Enter: 0 0 Enter N_Events 30000 0 0 build/bin > root -l Background-micro.root root [0] data->Draw("fCalcMass","fabs(fPdgCode)==3122") K. Gtzen PANDA Computing Workshop - Thailand 49 Event Filtering 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/PandaRootEventFilterTutor ial K. Gtzen PANDA Computing Workshop - Thailand 51 Event Filtering in PandaRoot PndFilteredPrimaryGenerator (w/ PndSmpFilt, PndSmpCand) Complete logic via Disjunctive Normal Form (DNF = , e.g. ) 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.0AddFilter("!(t+- ; ..3) && (gam ; ..6) && M(e+ e- ; m[3.0,2.0])"); (No number range given defaults to '1..' = at least one) Aug. 14, 2018 K. Gtzen - PandaRoot Meeting 52 Event Filter Example Reconstruct: Filter: N(t+) 3, N(t) 3, |mKK m| < 150MeV, |mMeV, |m2K2 mcc| < 50MeV, |m0MeV, |mMeV Unfiltered DPM: 1.2M ev; filtered DPM: 0.1M ev ( 12x less simulation!!) Signal MC Background (DPM) K. Gtzen GlueX PANDA Workshop 2019 53 GlueX DSelector

FlatTree Extension 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: K. Gtzen 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 GlueX PANDA Workshop 2019 55

Usage in DSelector Inside DSelector_xyz::Init() [here e.g. for input: pipkmkspi0] ... //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 Adds branches (based on options): always charge p4 acc pid kin beam_z) marker angle dalitz K. Gtzen : Inv. masses (_m, _mf, _mt), MM (mm2), unique flag (_uni, _unifs), :

: : : 4-vectors of combinations as TLorentzVector (_meas, _kin, _thr) RF dt, weights for 2, 4, and 8 acc. bunches (rf_dt, w2, w4, w8) dtTOF, dtBCAL, dtFCAL (_dttof, _dtbcal, _dtfcal) kinematics of combinations (_p, _pt, _tht, _phi, beam_e, : bit marker for used final states (idxs_) : opening/decay angles (_dec, _cdec, _oang) : Dalitz vars (_m01, _m02, _m12, _dal01, _dal02, _dal12) GlueX PANDA Workshop 2019 56 Usage in DSelector You only need to do (w/ modified MakeDSelector): MakeDSelector tree_pipkmkspi0_030300.root pipkmkspi0_Tree pipkmkspi0 In DSelector_pipkmkspi0.C uncomment/modify 3 Bool_t DSelector_pipkmkspi0::Init(TTree *locTree) ... 107 dComboTreeHelper = new DComboTreeHelper(..., "Ks; pi0; pi+ K-; ...",...); ... 338 339 340

// FILL FLAT TREE dComboTreeHelper->Fill(locEntry); Fill_FlatTree(); and that's it basically ... K. Gtzen GlueX PANDA Workshop 2019 57 Output ... Step 0 : g -> pip km ks Step 1 : ks -> pim pip Step 2 : pi0 -> g g Final state : "pip km The particle list is: 0) pip [wrapper prt 1) km [wrapper prt 2) ks [wrapper prt 3) pi0 [wrapper prt 4) p [wrapper prt 5) pim [wrapper prt 6) pip [wrapper prt 7) g [wrapper prt 8)

g [wrapper prt pi0 p ks pi0 p pim pip g g " = = = = = = = = = 0x6f39f90] 0x6f3a200] 0x6f3a420] 0x6f3a570] 0x6f3dfe0] 0x6f3e2a0] 0x6f3e500] 0x6f3e780] 0x6f3e9e0] FS: FS: FS: FS: FS: FS: FS:

FS: FS: 0 1 5 6 7 8 4 5 6 7 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 ... K. Gtzen GlueX PANDA Workshop 2019 58

Output ... Step 0 : g -> pip km ks Step 1 : ks -> pim pip Step 2 : pi0 -> g g Final state : "pip km The particle list is: 0) pip [wrapper prt 1) km [wrapper prt 2) ks [wrapper prt 3) pi0 [wrapper prt 4) p [wrapper prt 5) pim [wrapper prt 6) pip [wrapper prt 7) g [wrapper prt 8) g [wrapper prt pi0 p ks pi0 p pim pip g g " = = = = = =

= = = 0x6f39f90] 0x6f3a200] 0x6f3a420] 0x6f3a570] 0x6f3dfe0] 0x6f3e2a0] 0x6f3e500] 0x6f3e780] 0x6f3e9e0] FS: FS: FS: FS: FS: FS: FS: FS: FS: 0 1 5 6 7 8 4 5 6 7 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 ... K. Gtzen GlueX PANDA Workshop 2019 59 Examples Plots (MC data: pi+ pi- K+ K- p) n>Draw("rf_dt") n->Draw("rf_dt", "w4") RF t weighted RF t n->Draw("kpkm_mf-kpkm_mt",

"w4*(kin_chisq<25)") mfit(K+K-) mfit (weighted w/ w4) mfit (unique FS) mfit-mtrue (e.g. for resolution) n->Draw("kpkm_mf") n->Draw("kpkm_mf","w4", "same") n>Draw("kpkm_mf","kpkm_unifs","same" ) K. Gtzen GlueX PANDA Workshop 2019 60 Examples Plots (data: pi+ pi- K+ K- p) (1020) K*(892) m(KK) correl. PIDBCAL:m study correlation m(K)

correl. PIDTOF:m m(pK-) w/o cut m(pK-) w/ cut study correlation to find good selection K. Gtzen GlueX PANDA Workshop 2019 61 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. Gtzen GlueX PANDA Workshop 2019 62

BACKUP 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 K. Gtzen GlueX PANDA Workshop 2019 64 Combinatorics in PandaROOT Particle candidates: RhoCandList & RhoCandidate Example channel: RhoCandList piplus, piminus, gamma, pi0, jpsi, psip; RhoCandLists // define 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); jpsi.Combine(piplus, piminus, pi0); psip.Combine(jpsi, piplus, piminus); particles // avoid doubled combinations // avoids mutiple use of for (int j=0; j

PDF 1. 2. 3. 4. K. Gtzen current measurement PANDA Lecture Week 2017 - GSI expected c distributions for a certain momentum 67 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. Gtzen PANDA Lecture Week 2017 - GSI 68 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: PidAlgoIdealCharge PidAlgoDrc d PidAlgoDisc PidAlgoIdealNeutra PidAlgoStt l PidAlgoEmcBaye

PidAlgoMvd s PndAnalysis *pndana = new PndAnalysis(); PidAlgoMdtHardCuts pndana->FillList(chrg, "Charged"); pndana->FillList(trpos, "Plus"); pndana->FillList(pipm, "PionAll", "PidAlgoMvd;PidAlgoStt"); pndana->FillList(kpm, "KaonTight", "PidAlgoDrd;PidAlgoSciT"); pndana->FillList(ep, "ElectronLoosePlus", K. Gtzen PANDA Lecture Week 2017 - GSI PidAlgoSciT PidAlgoFtof PidAlgoRich 69 MC Truth Matching MC Truth Genealogy Idea: Each Reco points to an McTruth object, from which the full truth tree can be accessed McTruth

All Reco (2S) GetMcTruth() trk+ TheMother() Daughter(i) trktrk + + J/ - trkneut + trktrk- not matched secondaries K. Gtzen GlueX PANDA Workshop 2019 71 MC Truth Tree Match

If composites reconstructed correctly, GetMcTruth() also works for those McTruth All Reco (2S) GetMcTruth() trk+ psi' trktrk jpsi TheMother() Daughter(i) + + J/ - trkneut + trk-

K. Gtzen GlueX PANDA Workshop 2019 72 MC Truth Tree Match For matching, composite candidates have to have type set 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] ); RhoCandidate int nmatch = ana->McTruthMatch( psi2s ); (match) RhoCandidate if Example channel truth + // match complete RhoCandList *truth = psi2s[j].GetMcTruth(); // access compos. p J/ ( p J/ ( ) 1000 signal events +

// match for single All candidates MC truth match m(+-) [GeV/c2] K. Gtzen GlueX PANDA Workshop 2019 73 Fitting 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: 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 ); fitmass.SetMassConstraint( 1.115 ); fitmass.Fit(); // setup mass fitter // set mass constraint // 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 ); Under development: PndDecayTreeFitter doing all at once K. Gtzen GlueX PANDA Workshop 2019 75 Fitting: Access to Results After fit full fitted tree is attached to the reco object Reco'd Decay GetFit() Fit Results

(2S) (2S) TheMother() Daughter(i) TheMother() Daughter(i) - + + - J/ J/ + + - K. Gtzen - GlueX PANDA Workshop 2019 76

Fitting Example: Vertex-Fit PandaROOT object: PndKinVtxFitter // ... in event loop ... for (j=0; jGetFit(); TVector3 ksVtx = ksfit->Pos(); double chi2_vtx = vtxfitter.GetChi2(); fit if ( chi2_vtxFill( ksfit->M() ); hvpos->Fill( ksVtx.X(),ksVtx.Y() ); } // instantiate vertex // perform fit // get fitted candidate // and the vertex position // and the chi^2 of the // if chi2 is good enough // fill some histos } K. Gtzen GlueX PANDA Workshop 2019

77 Vertex Fitting (PndKinVtxFitter) Example channel (FastSim): p J/ ( p KS ( +) X 2000 signal, 5000 background (DPM) c (+) m(+) All DPM All c > 0.2cm c [cm] K. Gtzen GlueX PANDA Workshop 2019 m(+) [GeV/c2] 78 Fitting Example: 4C-Fit PandaROOT object: PndKinFitter // 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;jDaughter(0)->GetFit(); // get fitted J/psi Double_t chi2 = fitter.GetChi2(); if ( 0 != jfit ) { hjpsim_4cf->Fill( jfit->M() ); } // and the chi^2 of the fit // fill histogram } K. Gtzen GlueX PANDA Workshop 2019 79 4C Fitting (PndKinFitter)

Example channel (FullSim): p J/ ( p J/ ( +) + 1000 signal events m(+) m(+) raw m(+) with 4C on p m(+) [GeV/c2] K. Gtzen GlueX PANDA Workshop 2019 80 Details: Overlap mechanism 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: 10MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m K+2: 0MeV, |m10MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m K-1: 0MeV, |m0MeV, |m10MeV, |m0MeV, |m0MeV, |m0MeV, |m0MeV, |m K-2: 0MeV, |m0MeV, |m0MeV, |m10MeV, |m0MeV, |m0MeV, |m0MeV, |m

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! Very fast with binary & and |, even in complicated decay trees! K. Gtzen GlueX PANDA Workshop 2019 81 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. Gtzen PANDA Lecture Week 2017 - GSI 82 PID Concept in PandaROOT PandaROOT: PndAnalysis, PndAnaPidCombiner, PndAnaPidSelector PndAnalysis *pndana= new PndAnalysis(); pndana->FillList(eplus, "ElectronLoosePlus", "PidAlgoEmcBayes;PidAlgoMvd"); pndana->FillList(eminus, "ElectronLooseMinus", Or 'by hand': "PidAlgoEmcBayes;PidAlgoMvd"); RhoCandList charged, kaonLoose; PndAnaPidSelector kaonSel("KaonSelector"); kaonSel.SetSelection("KaonLoose"); criterion // set selection

PndAnaPidCombiner pidComb("PidCombiner"); pidComb.SetTcaNames("PidAlgoDrc;PidAlgoMvd"); // set algos while (evr->GetEvent()) { pndana->FillList(charged, "Charged"); candidates // start w/ charged pidComb.Apply(charged); // copy probab. to candidates kaonLoose.Select(charged, kaonSel); // select kaons from K. Gtzen PANDA Lecture Week 2017 - GSI charged 83 PndRhoTupleQA - TTree made simple Provides QA functions for persisting values in TTree // *** 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 Very handy function void qaComp(TString pre, RhoCandidate *c, RhoTuple *n); void qaKs0(TString pre, RhoCandidate *c, RhoTuple *n); to store composite info!

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); .... K. Gtzen GlueX PANDA Workshop 2019 84 PndRhoTupleQA - Application Concretely it might look like this: 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

// *** 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. Gtzen GlueX PANDA Workshop 2019 85 Fast Simulation Details Detector Modules Target Spectrometer TRK STT Forward Spectrometer STT + MVD + GEM STT + MVD

MVD + GEM EMC Barrel EMC Fwd Fwd TS MVD Vtx EMC FS EMC EMC Bwd PID K. Gtzen EMC Barrel STT PID DIRC PID EMC FS PID EMC Fwd MVD PID DISC PID RICH PID

EMC Bwd MUO PID GlueX PANDA Workshop 2019 MUO FS PID 87 Performance: Tracking Efficiency TRK,Fast 85% K. Gtzen TRK,Full 80% GlueX PANDA Workshop 2019 88 Performance: Gamma Efficiency K. Gtzen Gamma efficiency Gamma efficiency gam,Fast 100% gam,Full 100% GlueX PANDA Workshop 2019 89

Performance: Gamma Resolutions d vs. d vs. FULL FAST dE/E vs. E K. Gtzen GlueX PANDA Workshop 2019 90 Event Filtering in PandaRoot PndFilteredPrimaryGenerator (w/ PndSmpFilt, PndSmpCand) Complete logic via Disjunctive Normal Form (DNF = , e.g. ) 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.0AddFilter("!(t+- ; ..3) && (gam ; ..6) && M(e+ e- ; m[3.0,2.0])"); (No number range given defaults to '1..' = at least one) Aug. 14, 2018 K. Gtzen - PandaRoot Meeting 91 Filter Syntax Syntax: Counts: "( ; [] ; [kinematic cuts])" : 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+-, n0MeV, |m (neutron), n0MeV, |mb, n0MeV, |m0MeV, |mb (neutron or anti-neutron) pdg[], pdg[*10MeV, |m0MeV, |m0MeV, |m] (incl. anti-particle) Inv. mass: "M( [ .. ] ; m[ctr, wid] ; [] ; [kin. cuts])" : 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. Gtzen - PandaRoot Meeting

92 Filter Syntax Syntax: : multiplicity short cuts examples min .. max : min N max (t+- ; 2..4) num = num..num (pdg[3122] ; 1) ..max = 0MeV, |m .. max (nt ; ..2) min.. = min .. 10MeV, |m0MeV, |m0MeV, |m0MeV, |m (any ; 4..) none = 1 .. 10MeV, |m0MeV, |m0MeV, |m0MeV, |m (K+) : optional cuts on p, pt, pz, tht, phi (= keyword X) p, pt, and pz in [GeV/c] tht and phi in [deg] short cuts Aug. 14, 2018

examples X[min, max] : min X max (t+- ; phi[5,10]) X[ ,max] = X[0MeV, |m , max] (nt ; tht[,20]) X[min, ] = X[min, 1E8] (mu+- ; pt[1,]) K. Gtzen - PandaRoot Meeting 93 Filter Examples Examples: { N(K) 2 AND N() 2 } OR N(p/p J/ ( ) 2 AddFilter("(K+- ; 2..) && (pi+- ; 2..) || (p+- ; 2..)"); { N(part) 6 AND N(|m22 - 0MeV, |m.78| < 0MeV, |m.1) 1 } OR N(|mK-+ - 1.86| < 0MeV, |m.0MeV, |m5) = 1 AddFilter("(any; 6..) && M(pi+ pi- gam gam; m[0.78,0.2])"); AddFilter("M(K- pi+ nocc ; 1 ; m[1.86,0.1])"); N() 4 AND { N(|m - 0MeV, |m.14| < 0MeV, |m.0MeV, |m2 and p > 2 and 20MeV, |m) 2 ) 2 OR N(|m - 0MeV, |m.55| < 0MeV, |m.0MeV, |m3 and p > 1 and 5) 2 45) 2 ) 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])"); Aug. 14, 2018 K. Gtzen - PandaRoot Meeting 94

Recently Viewed Presentations

  • Intro to Computer Algorithms Lecture 6

    Intro to Computer Algorithms Lecture 6

    Gaussian Elimination Classic Transform and conquer Transformation uses row operations Exchange two rows Replace an equation with an non-zero multiple Replace an equation with the sum or difference of itself and another equation Examples at the board Intro to Computer...
  • LES CLEFS DOR EDUCATION SYMPOSIUM #LesClefsdOrEdu EDUCATION COMMITTEE

    LES CLEFS DOR EDUCATION SYMPOSIUM #LesClefsdOrEdu EDUCATION COMMITTEE

    WIN. #LesClefsdOrEdu @LesClefsdOrIntl. Refer to the tent cards on the table in front of you for more information.
  • BIG write - Mawnan C of E VA School

    BIG write - Mawnan C of E VA School

    The Key Features 'VCOP' Slide 5 Slide 6 Slide 7 Slide 8 Slide 9 Impact on lessons The Learning Environment Slide 12 Slide 13 Slide 14 Slide 15 How it works Extended writing opportunities with Big Writing The Method…on the...
  • TradingLivingTampa-5-29-04 - AIQ Systems

    TradingLivingTampa-5-29-04 - AIQ Systems

    Let your winner run See that when you follow your rules you make the most money and when you invent trades that are not part of your plan, most often they will fail Find Out the importance of having patience...
  • All About Interfaces Jessica Sands, User Group 2011

    All About Interfaces Jessica Sands, User Group 2011

    If importing graphics, use the "Set transparent color" tool to make the white background disappear (to avoid covering text). Recommended graphic placement: along right side or bottom of slide Data Flow Between the Data Warehouse and Other Systems
  • Influence of Islam on West Africa - Mrs. Romeo&#x27;s Website

    Influence of Islam on West Africa - Mrs. Romeo's Website

    Describe the role of the trans-Saharan caravan trade in the changing religious & cultural characteristics of West Africa & the influence of Islamic beliefs, ethics, and law. 7.4-4: Trace the growth of the Arabic language in government, trade, and Islamic...
  • Florida Legislative History Research

    Florida Legislative History Research

    Trebuchet MS Arial Arial Black Calibri Impact Times New Roman Wingdings Whirligig design template 1_Whirligig design template FLORIDA LEGISLATIVE HISTORY RESEARCH Slide 2 Begin with the Florida Statute section. Slide 4 Slide 5 Slide 6 Identify Florida laws which enacted...
  • Metabolic Dysregulation drives sensitivity after PI3K/mTOR inhibition in

    Metabolic Dysregulation drives sensitivity after PI3K/mTOR inhibition in

    The fig on the left shows a scatterplot for each drug. Each data point is one cell line and they were sorted individually based on IC70 values for each drug. Since these drugs are in clinical development, we used peak...