diff --git a/k4Gen/src/components/MDIReader.cpp b/k4Gen/src/components/MDIReader.cpp index 8009206..381d727 100644 --- a/k4Gen/src/components/MDIReader.cpp +++ b/k4Gen/src/components/MDIReader.cpp @@ -21,7 +21,7 @@ GaudiAlgorithm(name, svcLoc), declareProperty("GenParticles", m_genphandle, "Generated particles collection (output)"); declareProperty("CrossingAngle",xing,"Half the crossing angle beam in [rad]"); declareProperty("LongitudinalCut",cut_z,"the value for cut_z used in GP++ in [um]"); - declareProperty("InputType",input_type,"string: guineapig, xtrack"); + declareProperty("InputType",input_type,"string: guineapig, xtrack, photons, general"); declareProperty("BeamEnergy",beam_energy,"beam energy [GeV], necessary for xtrack type"); } @@ -50,7 +50,7 @@ StatusCode MDIReader::execute() } // Check the input type flag - if(input_type!="guineapig" && input_type!="xtrack") + if(input_type!="guineapig" && input_type!="xtrack" && input_type!="photons" && input_type!="general") { error() << "Input type flag - wrong definition: "<< input_type << endmsg; return StatusCode::FAILURE; @@ -89,6 +89,7 @@ StatusCode MDIReader::execute() size_t pcount = 0; PHEP5 = 5.11e-4; + while(m_input.good()) { if(input_type=="guineapig"){ @@ -97,7 +98,7 @@ StatusCode MDIReader::execute() >> VHEP1 >> VHEP2 >> VHEP3 >> process >> trash >> id_ee; - + PHEP5 = 5.11e-4; //std::cout<> VHEP1 >> PHEP1 + >> VHEP2 >> PHEP2 + >> PHEP4 >> PHEP3 + >> trash ; + PHEP5 = 0; + if(m_input.eof())break; + else if(!m_input.good()) + { + debug() << "End of file reached before reading all the hits" << endmsg; + error() << "End of file reached before reading all the hits" << endmsg; + return StatusCode::FAILURE; + } + + //std::cout<> VHEP1 >> VHEP2 >> VHEP3 + >> PHEP1 >> PHEP2 >> PHEP3 + >> PHEP4 >> IDHEP; + if(m_input.eof())break; + else if(!m_input.good()) + { + debug() << "End of file reached before reading all the hits" << endmsg; + error() << "End of file reached before reading all the hits" << endmsg; + return StatusCode::FAILURE; + } + + //std::cout<create(); particle.setPDG(IDHEP);