Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:28

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Christopher Dilks, Duane Byer
0003 
0004 /* SidisTree
0005  * - provides a simple tree, for common usage in any Analysis or
0006  *   Analysis derived class; this tree is designed to be compatible
0007  *   with BruFit for asymmetry analysis
0008  *   (see `https://github.com/c-dilks/dispin/tree/master/src`)
0009  */
0010 #pragma once
0011 
0012 #include <stdio.h>
0013 #include <stdlib.h>
0014 #include <iostream>
0015 #include <sstream>
0016 
0017 // epic-analysis
0018 #include "Kinematics.h"
0019 
0020 // ROOT
0021 #include <TTree.h>
0022 
0023 class SidisTree
0024 {
0025   public:
0026     SidisTree(TString treeName_, std::shared_ptr<Kinematics> K_, std::shared_ptr<Kinematics> Ktrue_);
0027     ~SidisTree();
0028 
0029     TTree *GetTree() { return T; };
0030     std::shared_ptr<Kinematics> GetKinematics() { return K; };
0031     std::shared_ptr<Kinematics> GetKinematicsTrue() { return Ktrue; };
0032     void FillTree(Double_t w) { weight = w; T->Fill(); };
0033     void WriteTree() { T->Write(); };
0034 
0035   private:
0036     Double_t weight;
0037     TTree *T;
0038     std::shared_ptr<Kinematics> K;
0039     std::shared_ptr<Kinematics> Ktrue;
0040     TString treeName;
0041 
0042   ClassDef(SidisTree,1);
0043 };