Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:12:31

0001 #ifndef __LeptoquarksReco_H__
0002 #define __LeptoquarksReco_H__
0003 
0004 #include "PidCandidate.h"
0005 
0006 /* Fun4All includes */
0007 #include <fun4all/SubsysReco.h>
0008 #include <calobase/RawTowerDefs.h>
0009 
0010 /* STL includes */
0011 #include <math.h>
0012 #include <map>
0013 
0014 /*HepMC include */
0015 #include <phhepmc/PHHepMCGenEvent.h>
0016 #include <phhepmc/PHHepMCGenEventMap.h>
0017 #include <HepMC/GenEvent.h>
0018 class TNtuple;
0019 class TTree;
0020 class TFile;
0021 
0022 class PHCompositeNode;
0023 class CaloRawTowerEval;
0024 class RawTowerContainer;
0025 class RawTowerGeomContainer;
0026 class JetMap;
0027 class SvtxTrackMap;
0028 class SvtxVertexMap;
0029 class SvtxEvalStack;
0030 class PHHepMCGenEventMap;
0031 
0032 class PidCandidate;
0033 
0034 typedef std::map<float, PidCandidate*> type_map_tcan;
0035 typedef std::map< RawTowerDefs::CalorimeterId , std::pair< RawTowerContainer*, RawTowerGeomContainer* > > type_map_cdata;
0036 
0037 class LeptoquarksReco : public SubsysReco
0038 {
0039 
0040 public:
0041 
0042   LeptoquarksReco(std::string filename);
0043 
0044   int
0045   Init(PHCompositeNode*);
0046   int
0047   process_event(PHCompositeNode*);
0048   int
0049   End(PHCompositeNode*);
0050 
0051 
0052   void
0053   set_save_towers( bool savetower=true )
0054   {
0055     _save_towers = savetower;
0056   }
0057 
0058 
0059   void
0060   set_save_tracks( bool savetracks=true )
0061   {
0062     _save_tracks = savetracks;
0063   }
0064 
0065 
0066   void
0067   set_beam_energies( float beam_electron , float beam_proton )
0068   {
0069     _ebeam_E = fabs( beam_electron );
0070     _pbeam_E = fabs( beam_proton );
0071   }
0072 
0073   void
0074   set_reco_jet_collection( std::string newname )
0075   {
0076     _jetcolname = newname;
0077   }
0078 
0079 private:
0080 
0081   bool _verbose;
0082   bool _save_towers;
0083   bool _save_tracks;
0084 
0085   int _ievent;
0086   int _total_pass;
0087 
0088   std::string _filename;
0089   TFile *_tfile;
0090 
0091   /* output tree and variables */
0092   TTree* _t_event;
0093   TNtuple* _ntp_tower;
0094   TNtuple* _ntp_track;
0095 
0096   /* beam energies electron and proton */
0097   float _ebeam_E;
0098   float _pbeam_E;
0099 
0100   /* set minimum energy for tau jets to consider */
0101   float _tau_jet_emin;
0102 
0103   /** name of jet collection */
0104   std::string _jetcolname;
0105 
0106   /** CaloRawTowerEvaluators to access tru particle info for
0107    * given towers */
0108   std::map< std::string, CaloRawTowerEval* > _map_towereval;
0109 
0110   /** Map of PidCandidate properties that will be written to
0111    * output ROOT Tree */
0112   std::map< PidCandidate::PROPERTY , std::vector< float > > _map_tau_candidate_branches;
0113 
0114   /** Map of Event properties that will be written to
0115    * output ROOT Tree */
0116   std::map< std::string , float > _map_event_branches;
0117 
0118   int AddTrueTauTag( type_map_tcan&, PHHepMCGenEventMap* );
0119 
0120   int AddJetInformation( type_map_tcan&, JetMap*, type_map_cdata* );
0121 
0122   int AddJetStructureInformation( type_map_tcan&, type_map_cdata* );
0123 
0124   int AddTrackInformation( type_map_tcan&, SvtxTrackMap*, SvtxVertexMap*, SvtxEvalStack*,double );
0125 
0126   int WritePidCandidatesToTree( type_map_tcan& );
0127 
0128   int AddGlobalEventInformation( type_map_tcan& , type_map_cdata* );
0129 
0130   /** Find tau candidate in map that is closest to given eta, phi angle */
0131   PidCandidate* FindMinDeltaRCandidate( type_map_tcan*, const float, const float );
0132 
0133   /** Calculate Delta R ("distance in eta-phi space") between two sets of eta, phi angles */
0134   float CalculateDeltaR( float, float, float, float );
0135 
0136   /** Reset branch maps for each event */
0137   void ResetBranchMap();
0138 
0139   /** Enum to identify calorimeter types */
0140   enum CALOTYPE
0141   {
0142     calo_cemc,
0143     calo_ihcal,
0144     calo_ohcal,
0145     calo_femc,
0146     calo_fhcal,
0147     calo_eemc
0148   };
0149 
0150 };
0151 
0152 #endif // __LeptoquarksReco_H__