Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /tutorials/myjetanalysis/README.md is written in an unsupported language. File is not indexed.

0001 # Welcome
0002 
0003 This is an example analys module which iterates through reconstructed jet, matches it with truth jet, and matches with reconstructed tracks within a dR cone.
0004 The output is a ROOT file with histograms of reconstructed jet sepectrum and a TTree with per-jet kinematics and matched truth jet kinematics. 
0005 The matched track pT and Delta-R is also saved in an array in the TTree. 
0006 
0007 ## Compile this module 
0008 
0009 To compile this module, please follow instruction of [building a package](https://wiki.bnl.gov/sPHENIX/index.php/Example_of_using_DST_nodes#Building_a_package), 
0010 
0011 After compiling, it should produce this file: `$MYINSTALL/lib/libmyjetanalysis.so`
0012 
0013 ## Run this module
0014 
0015 To run this module, please insert this block of code in the Fun4All macro for your jet analysis:
0016 ```diff
0017 @@ -20,6 +20,9 @@
0018  #include <phpythia8/PHPythia8.h>
0019  #include <phhepmc/Fun4AllHepMCPileupInputManager.h>
0020  #include <phhepmc/Fun4AllHepMCInputManager.h>
0021 +
0022 +#include <myjetanalysis/MyJetAnalysis.h>
0023 +
0024  #include "G4Setup_sPHENIX.C"
0025  #include "G4_Bbc.C"
0026  #include "G4_Global.C"
0027 @@ -33,6 +36,8 @@ R__LOAD_LIBRARY(libg4testbench.so)
0028  R__LOAD_LIBRARY(libphhepmc.so)
0029  R__LOAD_LIBRARY(libPHPythia6.so)
0030  R__LOAD_LIBRARY(libPHPythia8.so)
0031 +
0032 +R__LOAD_LIBRARY(libmyjetanalysis.so)
0033  #endif
0034  
0035  using namespace std;
0036 @@ -587,6 +592,11 @@ int Fun4All_G4_sPHENIX(
0037      if (do_dst_compress) DstCompress(out);
0038      se->registerOutputManager(out);
0039    }
0040 +
0041 +  gSystem->Load("libmyjetanalysis");
0042 +  MyJetAnalysis *myJetAnalysis = new MyJetAnalysis("AntiKt_Tower_r04","AntiKt_Truth_r04","myjetanalysis.root");
0043 +  se->registerSubsystem(myJetAnalysis);
0044 +
0045    //-----------------
0046    // Event processing
0047    //-----------------
0048 
0049 ```
0050 Furthermore, here is a full set of example macro to run this analysis module by analyzing PYTHIA8 jet event simulated in the same process: 
0051 https://github.com/blackcathj/macros/blob/my-jet-analysis/macros/g4simulations/Fun4All_G4_sPHENIX.C
0052 
0053 ## Check the output
0054 
0055 The main output file is `myjetanalysis.root`, which contains
0056 ```
0057 root [1] .ls
0058 TFile**         myjetanalysis.root      
0059  TFile*         myjetanalysis.root      
0060   KEY: TH1F     hInclusive_E;1  AntiKt_Tower_r04 inclusive jet E
0061   KEY: TH1F     hInclusive_eta;1        AntiKt_Tower_r04 inclusive jet #eta
0062   KEY: TH1F     hInclusive_phi;1        AntiKt_Tower_r04 inclusive jet #phi
0063   KEY: TTree    T;1     MyJetAnalysis Tree
0064 ```
0065 The T tree contains one entry per reconstructed jet. Here is its first entry:
0066 ```
0067 root [2] T->Show(0)
0068 ======> EVENT:0
0069  event           = 0          <- event number
0070  id              = 49         <- jet ID in this event
0071  nComponent      = 51         <- number of component in reco jet, i.e. # of towers in jet
0072  eta             = 0.3255     <- jet psuedorapidity
0073  phi             = -1.43342   <- jet phi
0074  e               = 19.4207    <- jet energy
0075  pt              = 18.2251    <- jet pT
0076  truthID         = 0          <- If matched with a truth jet, the truth jet's ID
0077  truthNComponent = 1          <- If matched with a truth jet, the truth jet's number of component
0078  truthEta        = 0.348408   <- If matched with a truth jet, the truth jet's eta
0079  truthPhi        = -1.42448   <- If matched with a truth jet, the truth jet's phi
0080  truthE          = 32.0003    <- If matched with a truth jet, the truth jet's energy
0081  truthPt         = 30.1514    <- If matched with a truth jet, the truth jet's pT
0082  nMatchedTrack   = 1          <- Number of track that matched with the jet
0083  trackdR         = 0.00869318 <- Distance of track and jet in eta-phi space, an array with size of [nMatchedTrack]
0084  trackpT         = 30.4937    <- Track's pT, an array with size of [nMatchedTrack]
0085 ```
0086 
0087 ## Make this your module
0088 
0089 Please copy this folder to a new folder under your local [analysis repository](https://github.com/sPHENIX-Collaboration/analysis) 
0090 and change package and class names. Welcome to edit it for your analysis cases. 
0091 
0092 Please upload your analysis module back to the [analysis repository](https://github.com/sPHENIX-Collaboration/analysis) at the end too so it could be shared with others. 
0093 
0094 
0095 ## Use Mock Data Challenge Output
0096 
0097 The Fun4All_JetAna_MDC.C uses the current Mock Data Challenge Output. Jets are not reconstructed during production, so we need to run the jet reconstruction using the Jet_Reco() function in the installed G4_Jets.C macro. As input we need Tracks, Calorimeter Clusters and the Truth info. Use the CreateFileList.pl script to get the lists of those files (here type 16 which are photon jet samples:
0098 `CreateFileList.pl -type 16 DST_TRACKS DST_TRUTH DST_CALO_CLUSTER`
0099 
0100 # Read more
0101 
0102 Many next-step topics are listed in the [software](https://wiki.bnl.gov/sPHENIX/index.php/Software) page. And specifically, to use the simulation for your study, a few thing you might want to try:
0103 
0104 * [More on write your analysis module for more dedicated analysis](https://wiki.bnl.gov/sPHENIX/index.php/Example_of_using_DST_nodes), 
0105 * Examples to use evaluators of track, caloiemter, and jets in your analysis module ([CaloEvaluator](https://www.phenix.bnl.gov/WWW/sPHENIX/doxygen/html/dd/d59/classCaloEvaluator.html), [JetEvaluator](https://www.phenix.bnl.gov/WWW/sPHENIX/doxygen/html/d1/df4/classJetEvaluator.html), [SvtxEvaluator](https://www.phenix.bnl.gov/WWW/sPHENIX/doxygen/html/d6/d11/classSvtxEvaluator.html)). Welcome to copy and resuse blocks of the code from them.