Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Duane Byer
0003 
0004 R__LOAD_LIBRARY(EpicAnalysis)
0005 
0006 struct WeightsProkudin : public WeightsSivers {
0007   ProkudinSfSet sf_set;
0008   Double_t Asymmetry(Double_t x, Double_t z, Double_t Q2, Double_t pt) const override {
0009     Double_t fuu = sf_set.F_UUT(Hadron::PI_P, x, z, Q2, pt*pt);
0010     Double_t fut = sf_set.F_UTT_sin_phih_m_phis(Hadron::PI_P, x, z, Q2, pt*pt);
0011     if (!TMath::Finite(fuu) || !TMath::Finite(fut)) {
0012         fuu = 1.;
0013         fut = 0.;
0014     }
0015     if (TMath::Abs(fut / fuu) > 1.) {
0016         fuu = 1.;
0017         fut = TMath::Sign(1., fut / fuu);
0018     }
0019     return fut / fuu;
0020   }
0021 };
0022 
0023 struct WeightsPavia : public WeightsSivers {
0024   PaviaSfSet sf_set;
0025   Double_t Asymmetry(Double_t x, Double_t z, Double_t Q2, Double_t pt) const override {
0026     Double_t fuu = sf_set.F_UUT(Hadron::PI_P, x, z, Q2, pt*pt);
0027     Double_t fut = sf_set.F_UTT_sin_phih_m_phis(Hadron::PI_P, x, z, Q2, pt*pt);
0028     if (!TMath::Finite(fuu) || !TMath::Finite(fut)) {
0029         fuu = 1.;
0030         fut = 0.;
0031     }
0032     if (TMath::Abs(fut / fuu) > 1.) {
0033         fuu = 1.;
0034         fut = TMath::Sign(1., fut / fuu);
0035     }
0036     return fut / fuu;
0037   }
0038 };
0039 
0040 struct WeightsTest : public WeightsSivers {
0041   Double_t Asymmetry(Double_t x, Double_t z, Double_t Q2, Double_t pt) const override {
0042     return 0.2;
0043   }
0044 };
0045 
0046 void analysis_asymmetry(
0047     TString configFile="datarec/in.config", /* delphes tree(s) */
0048     TString outfilePrefix="asymmetry" /* output filename prefix*/
0049 ) {
0050 
0051   // setup analysis ========================================
0052   AnalysisDelphes *A = new AnalysisDelphes(
0053       configFile,
0054       outfilePrefix
0055       );
0056   Weights* weights = new WeightsSum({
0057     new WeightsUniform(),
0058     new WeightsTest()
0059   });
0060   //A->SetWeights(weights);
0061 
0062   A->writeSidisTree = true; // write SidisTree (for one bin)
0063   //A->maxEvents = 10000; // use this to limit the number of events
0064   //A->SetReconMethod("Ele"); // recon method (default is "Ele")
0065   //A->AddFinalState("pipTrack"); // final states (default is "pipTrack" only)
0066 
0067   // define cuts ====================================
0068   A->AddBinScheme("w");  A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
0069   A->AddBinScheme("y");  A->BinScheme("y")->BuildBin("Range",0.01,0.95); // 0.01 < y < 0.95
0070   A->AddBinScheme("z");  A->BinScheme("z")->BuildBin("Range",0.2,0.9); // 0.2 < z < 0.9
0071   A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
0072   A->AddBinScheme("ptLab");  A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)
0073 
0074   // perform the analysis ==================================
0075   A->Execute();
0076 };
0077