File indexing completed on 2024-09-28 07:02:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "eicsmear/erhic/EventRapgap.h"
0011
0012 #include <sstream>
0013 #include <string>
0014
0015 namespace erhic {
0016
0017 bool EventRapgap::Parse(const std::string& line) {
0018 static std::stringstream ss;
0019 ss.str("");
0020 ss.clear();
0021 ss << line;
0022 ss >>
0023 number >> number >>
0024 genevent >> process >> idir >> idisdif >> cs >> sigma_cs >> s >> q2 >>
0025 y >> xgam >> xpr >> Pt_h >> pt2_hat >> sHat >> t >> x_pom >> sHat2 >> z >>
0026 x1 >> phi1 >> nTracks;
0027
0028 return !ss.fail();
0029 }
0030
0031
0032
0033
0034
0035
0036 const ParticleMC* EventRapgap::ScatteredLepton() const {
0037
0038
0039
0040 const VirtualParticle* beam = BeamLepton();
0041 if (!beam) {
0042 return NULL;
0043 }
0044 const int species = beam->Id().Code();
0045
0046
0047 std::vector<const VirtualParticle*> final;
0048 FinalState(final);
0049 std::vector<const VirtualParticle*>::const_iterator iter;
0050 for (iter = final.begin(); iter != final.end(); ++iter) {
0051
0052
0053 if ( (*iter)->Id().Code() == species &&
0054 ( (*iter)->GetParentIndex() == 1 || (*iter)->GetParentIndex() == 2 )
0055 ) {
0056
0057 return static_cast<const ParticleMC*>(*iter);
0058 }
0059 }
0060
0061 return nullptr;
0062 }
0063
0064
0065
0066
0067
0068 const ParticleMC* EventRapgap::ExchangeBoson() const {
0069 for ( auto particle : EventMC::GetTracks() ){
0070 if ( particle->GetStatus() != 21 ) continue;
0071 if ( particle->GetParentIndex() != 1 && particle->GetParentIndex() == 2 ) continue;
0072 if ( particle->Id().Code() == 22 || particle->Id().Code() == 23 || std::abs(particle->Id().Code()) == 24 ){
0073
0074 return static_cast<const ParticleMC*>(particle);
0075 }
0076 }
0077
0078 return nullptr;
0079 }
0080
0081 }