Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:02:50

0001 /**
0002  \file
0003  Implementation of class erhic::EventGmcTrans.
0004  
0005  \author    Thomas Burton
0006  \date      2012-09-20
0007  \copyright 2012 Brookhaven National Lab
0008  */
0009 
0010 #include "eicsmear/erhic/EventGmcTrans.h"
0011 
0012 #include <cmath>
0013 #include <sstream>
0014 #include <string>
0015 
0016 namespace erhic {
0017 
0018 EventGmcTrans::EventGmcTrans(const std::string& s)
0019 // Initialise all floats to NAN for consistency with EventDis
0020 : mStruckQuark(0)
0021 , mQSquared(NAN)
0022 , mBjorkenX(NAN)
0023 , mInelasticity(NAN)
0024 , mWSquared(NAN)
0025 , mNu(NAN)
0026 , mS(NAN)
0027 , mZ(NAN)
0028 , mHadronPt(NAN)
0029 , mLeptonTheta(NAN)
0030 , mLeptonPhi(NAN)
0031 , mPhiSpin(NAN)
0032 , mPhiHadron(NAN)
0033 , mF1(NAN)
0034 , mG1(NAN)
0035 , mH1(NAN)
0036 , mD1(NAN)
0037 , mF1TPerp(NAN)
0038 , mF1TPerp1(NAN)
0039 , mF1TPerp12(NAN)
0040 , mH1Perp(NAN)
0041 , mH1Perp1(NAN)
0042 , mH1Perp12(NAN)
0043 , mAutSiv(NAN)
0044 , mAutWtSiv(NAN)
0045 , mAutSivAllQ(NAN)
0046 , mAutWtSivAllQ(NAN)
0047 , mAutSivPiDiff(NAN)
0048 , mAutWtSivPiDiff(NAN)
0049 , mAutCol(NAN)
0050 , mAutWtCol(NAN)
0051 , mAutTw3Col(NAN)
0052 , mAutWtTw3Col(NAN)
0053 , mAutColAllQ(NAN)
0054 , mAutWtColAllQ(NAN)
0055 , mXUnpolarised(NAN)
0056 , mXSivers(NAN)
0057 , mXCollins(NAN) {
0058   // Initialise from a string if provided.
0059   if (!s.empty()) {
0060     Parse(s);
0061   }  // if
0062 }
0063 
0064 bool EventGmcTrans::Parse(const std::string& line) {
0065   // Save ourselves the overhead of a new stringstream with each event read.
0066   static std::stringstream stream;
0067   // Clear the stream contents and flags from any previous use.
0068   stream.str("");
0069   stream.clear();
0070   // Read values from the input line.
0071   stream << line;
0072   stream
0073   // The first integer is always 0 (indicating start of event record)
0074   // so skip that and read the next int, which is the struck quark.
0075   >> mStruckQuark >> mStruckQuark
0076   >> mBjorkenX
0077   >> mQSquared
0078   >> mNu
0079   >> mInelasticity
0080   >> mWSquared
0081   >> mZ
0082   >> mHadronPt
0083   >> mLeptonTheta
0084   >> mLeptonPhi
0085   >> mPhiSpin
0086   >> mPhiHadron
0087   >> mF1 >> mG1 >> mH1 >> mD1
0088   >> mF1TPerp >> mF1TPerp1 >> mF1TPerp12
0089   >> mH1Perp >> mH1Perp1 >> mH1Perp12
0090   >> mAutSiv >> mAutWtSiv >> mAutSivAllQ >> mAutWtSivAllQ
0091   >> mAutSivPiDiff >> mAutWtSivPiDiff
0092   >> mAutCol >> mAutWtCol >> mAutTw3Col >> mAutWtTw3Col
0093   >> mAutColAllQ >> mAutWtColAllQ
0094   >> mXUnpolarised >> mXSivers >> mXCollins;
0095   // Inherits process from EventMC. Always set this equal to 99 for DIS
0096   process = 99;
0097   // The stream state should still be good if processing
0098   // the string went OK.
0099   return !stream.fail();
0100 }
0101 
0102 }  // namespace erhic