Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-29 07:05:50

0001 /**
0002  \file
0003  Implementation of class erhic::EventMilou.
0004  
0005  \author    Thomas Burton
0006  \date      2011-07-07
0007  \copyright 2011 Brookhaven National Lab
0008  */
0009 
0010 #include "eicsmear/erhic/EventMilou.h"
0011 
0012 #include <cmath>
0013 #include <sstream>
0014 #include <string>
0015 
0016 namespace erhic {
0017 
0018 EventMilou::EventMilou()
0019 : radcorr(-1)
0020 , weight(NAN)
0021 , trueX(NAN)
0022 , trueQ2(NAN)
0023 , trueY(NAN)
0024 , trueT(NAN)
0025 , truePhi(NAN)
0026 , phibelgen(NAN)
0027 , phibelres(NAN)
0028 , phibelrec(NAN) {
0029 }
0030 
0031 bool EventMilou::Parse(const std::string& line) {
0032   static std::stringstream ss;
0033   ss.str("");
0034   ss.clear();
0035   ss << line;
0036   ss >>
0037   number >> number >>  // Skip first int in the line
0038   nTracks >> weight >> process >> radcorr >> trueX >> trueQ2 >>
0039   trueY >> trueT >> truePhi >> phibelgen >> phibelres >> phibelrec;
0040   // Protect against errors in the input file or the stream
0041   return !ss.fail();
0042 }
0043 
0044 }  // namespace erhic