Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Connor Pecar
0003 
0004 /* HFSTree
0005    - Produces a tree containing information needed for kinematic
0006      reconstruction studies: hadronic final state four-momenta
0007      and PID, scattered electron information, and true scattered
0008      electron and beam information.
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 HFSTree
0024 {
0025   public:
0026     HFSTree(TString treeName_, std::shared_ptr<Kinematics> K_, std::shared_ptr<Kinematics> Ktrue_);
0027     ~HFSTree();
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;
0033       T->Fill(); };
0034     void WriteTree() { T->Write(); };
0035   
0036   private:
0037     Double_t weight;
0038     TTree *T;
0039     std::shared_ptr<Kinematics> K;
0040     std::shared_ptr<Kinematics> Ktrue;
0041     TString treeName;
0042 
0043   ClassDef(HFSTree,1);
0044 };