Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:35:54

0001 /**
0002  \file
0003  Global function declarations.
0004  
0005  \author    Thomas Burton
0006  \date      2011-07-07
0007  \copyright 2011 Brookhaven National Lab
0008  */
0009 
0010 #ifndef INCLUDE_EICSMEAR_FUNCTIONS_H_
0011 #define INCLUDE_EICSMEAR_FUNCTIONS_H_
0012 
0013 #include <string>
0014 
0015 #include <Rtypes.h>
0016 #include <TString.h>
0017 
0018 #include "eicsmear/smear/Smear.h"
0019 #include "eicsmear/smear/Detector.h"
0020 
0021 class TLorentzVector;
0022 
0023 namespace erhic {
0024   class EventMC;
0025   class VirtualEventFactory;
0026   /** 
0027       Simple namespace-wide constant to determine the version
0028   */
0029   const std::string EicSmearVersionString = "1.1.11";
0030 
0031 }
0032 
0033 /**
0034  \fn
0035  Returns the first non-blank character in a line.
0036  Returns a NULL termination character if there are no non-blank characters
0037  in the line.
0038  */
0039 char getFirstNonBlank(const std::string&);
0040 
0041 /**
0042  \fn
0043  Calculate the hadron azimuthal angle around the virtual photon direction with
0044  respect to the lepton scattering plane in the proton rest frame.
0045  We use the HERMES convention, returning an angle in the range [0,2pi].
0046  The vectors passed as arguments should already be boosted to the proton rest
0047  frame. Incident and scattered leptons, incident protons and virtual photons
0048  all return -999.
0049  */
0050 double computeHermesPhiH(const TLorentzVector& hadronInPrf,
0051                          const TLorentzVector& leptonInPrf,
0052                          const TLorentzVector& photonInPrf);
0053 
0054 // Forward declarations of functions for which we wish to build dictionaries
0055 // using rootcint
0056 
0057 /**
0058  \fn
0059  Function for generating a ROOT TTree file from a plain-text Monte Carlo file.
0060  */
0061 Long64_t BuildTree(const std::string& inputFileName,
0062                    const std::string& outputDirName = ".",
0063                    const Long64_t maxEvent = 0,
0064                    const std::string& logFileName = "");
0065 
0066 /**
0067  \enum
0068  Allows to choose various output formats supported by HepMC
0069  */
0070 namespace erhic{
0071   enum HepMC_outtype {HepMC3, HepMC2, RootTree, Root };
0072 }
0073 
0074 /**
0075  \fn
0076  Function for generating a HepMC file from en EICTree ROOT file.
0077  */
0078 Long64_t TreeToHepMC(const std::string& inputFileName,
0079              const std::string& outputDirName = ".",
0080              Long64_t maxEvent = 0,
0081              const erhic::HepMC_outtype outtype = erhic::HepMC_outtype::HepMC3);
0082 
0083 /**
0084  \fn
0085  Deprecated legacy wrapper
0086  */
0087 Long64_t TreeToHepMC(const std::string& inputFileName,
0088              const std::string& outputDirName,
0089              Long64_t maxEvent,
0090              const bool createHepMC2=false);
0091 
0092 /**
0093  Produces a DOT file describing the particle content of the event.
0094  */
0095 class EventToDot {
0096  public:
0097   /**
0098    Destructor.
0099    */
0100   virtual ~EventToDot() { }
0101 
0102   /**
0103    Write a DOT file describing an event.
0104    */
0105   void Generate(const erhic::EventMC&, const std::string& outputName) const;
0106 
0107   ClassDef(EventToDot, 0)
0108 };
0109 
0110 #endif  // INCLUDE_EICSMEAR_FUNCTIONS_H_