Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-01 07:07:10

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Connor Pecar
0003 
0004 R__LOAD_LIBRARY(EpicAnalysis)
0005 #include <pybind11/embed.h>
0006 namespace py = pybind11;
0007 // using ML prediction for vecQ, and writing out tree of HFS four-vectors
0008 // requires pybind includes above
0009 void analysis_testml(
0010     TString configFile="datarec/in.config", /* delphes tree(s) */
0011     TString outfilePrefix="resolutions" /* output filename prefix*/
0012 ) {
0013   // object needed at start of script using pybind11
0014   py::scoped_interpreter guard{};
0015   //outfilePrefix+="_DA";
0016   // setup analysis ========================================
0017   AnalysisEcce *A = new AnalysisEcce(
0018       configFile,
0019       outfilePrefix
0020       );
0021   
0022   A->maxEvents = 10000; // use this to limit the number of events
0023   A->writeSidisTree = true; // write SidisTree (for one bin)
0024   A->writeHFSTree = true; // write HFSTree (for one bin)
0025   A->SetReconMethod("ML"); // set reconstruction method
0026   A->AddFinalState("pipTrack"); // pion final state
0027   //A->AddFinalState("KpTrack"); // kaon final state
0028   
0029 
0030   // define cuts ====================================
0031   A->AddBinScheme("w");  A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
0032   //A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
0033   //A->AddBinScheme("ptLab");  A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)
0034 
0035 
0036   // set binning scheme ====================================
0037   // z ranges
0038   //A->AddBinScheme("z");
0039   //A->BinScheme("z")->BuildBin("Min",0.2); // needed?
0040 
0041   // y minima
0042   A->AddBinScheme("y");
0043   A->BinScheme("y")->BuildBin("Full"); // a bin with no y-cut
0044 
0045   // perform the analysis ==================================
0046   A->Execute();
0047 
0048 };