Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-17 07:06:50

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Christopher Dilks
0003 
0004 R__LOAD_LIBRARY(EpicAnalysis)
0005 
0006 /* full simulation (dd4hep) usage
0007  * - note the similarity of the macro to the fast simulation
0008  * - you only need to swap `AnalysisDelphes` with `AnalysisAthena` to switch
0009  *   between fast and full simulations
0010  * - some settings are specific to the full simulations, e.g. electron
0011  *   energy threshold
0012  * - this tutorial accesses files on S3:
0013  *   - alternatively, use your preferred method to run (download, mirror, etc.)
0014  *   - for S3, you must know the username and password, and have them in your environment:
0015  *     - `export S3_ACCESS_KEY=<login>`
0016  *     - `export S3_SECRET_KEY=<password>`
0017  */
0018 void analysis_athena(
0019     TString configFile="tutorial/athena.config", // input config file
0020     TString outfilePrefix="tutorial.athena"      // output filename prefix
0021 ) {
0022 
0023   // setup analysis ========================================
0024   // - define `AnalysisAthena` instead of `AnalysisDelphes`
0025   AnalysisAthena *A = new AnalysisAthena(configFile, outfilePrefix);
0026 
0027   A->maxEvents = 300000; // use this to limit the number of events
0028   A->writeSidisTree = true;
0029 
0030   // set reconstruction method and final states =============================
0031   // - see `Analysis` constructor for methods (or other tutorials)
0032   A->SetReconMethod("Ele");
0033 
0034   // decide which output sets to include ===================
0035   // - by default, only single-hadron data are included in the output
0036   // - see `src/Analysis.cxx` for all available settings
0037   //A->includeOutputSet["jets"] = true;
0038   //A->includeOutputSet["1h"] = false;
0039   //A->includeOutputSet["inclusive"] = false;
0040   //A->includeOutputSet["depolarization"] = true;
0041 
0042   A->AddFinalState("pipTrack");
0043   //A->AddFinalState("pimTrack");
0044   //A->AddFinalState("KpTrack");
0045   //A->AddFinalState("KmTrack");
0046 
0047 
0048   // define cuts ====================================
0049   // - cuts are defined the same way as bins are defined; be mindful
0050   //   of what bins you are defining vs. what cuts you are defining.
0051   //   For example, if you define a Q2 minimum cut, and you also define
0052   //   Q2 bins below, you may be creating more bins than you actually
0053   //   need, since the Q2 minimum cut actually defines another bin;
0054   //   in this case, your Q2 bins effectively define a Q2 minimum.
0055   A->AddBinScheme("w");  A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
0056   A->AddBinScheme("y");  A->BinScheme("y")->BuildBin("Range",0.01,0.95); // 0.01 < y < 0.95
0057   A->AddBinScheme("z");  A->BinScheme("z")->BuildBin("Range",0.2,0.9); // 0.2 < z < 0.9
0058   A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
0059   A->AddBinScheme("ptLab");  A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)
0060 
0061 
0062   // set binning scheme ====================================
0063   // - see other tutorials for guidance
0064   // - see `Analysis` constructor for available bin variables
0065   A->AddBinScheme("q2");
0066   A->AddBinScheme("x");
0067 
0068   // 3x2 grid of (x,Q2) bins, equal width in logarithmic scale
0069   A->BinScheme("q2")->BuildBins( 2, 1,    100,  true );
0070   A->BinScheme("x")->BuildBins(  3, 0.01, 1,    true );
0071 
0072 
0073 
0074   // perform the analysis ==================================
0075   A->Execute();
0076 
0077   // for reference, here is a print out of HistosDAG
0078   // - it lists each node, together with its inputs and outputs, which
0079   //   indicate the connections between the nodes
0080   //A->GetHistosDAG()->PrintBreadth("HistosDAG Nodes");
0081 
0082 }