#include <SimMuon/Neutron/src/AsciiNeutronWriter.h>
Public Member Functions | |
AsciiNeutronWriter (std::string fileNameBase) | |
virtual | ~AsciiNeutronWriter () |
Protected Member Functions | |
virtual void | writeEvent (int chamberType, const edm::PSimHitContainer &hits) |
makes an "event" from a list of SimHits. Called by writeEvent | |
Private Attributes | |
std::string | theFileNameBase |
Definition at line 12 of file AsciiNeutronWriter.h.
AsciiNeutronWriter::AsciiNeutronWriter | ( | std::string | fileNameBase | ) |
AsciiNeutronWriter::~AsciiNeutronWriter | ( | ) | [virtual] |
void AsciiNeutronWriter::writeEvent | ( | int | detType, | |
const edm::PSimHitContainer & | simHits | |||
) | [protected, virtual] |
makes an "event" from a list of SimHits. Called by writeEvent
Implements NeutronWriter.
Definition at line 17 of file AsciiNeutronWriter.cc.
References PSimHit::detUnitId(), lat::endl(), PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), h, i, LogDebug, PSimHit::momentumAtEntry(), PSimHit::pabs(), PSimHit::particleType(), PV3DBase< T, PVType, FrameType >::phi(), s, theFileNameBase, PV3DBase< T, PVType, FrameType >::theta(), PSimHit::timeOfFlight(), PSimHit::trackId(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
00018 { 00019 // open the correct file 00020 stringstream s; 00021 s << theFileNameBase << chamberType; 00022 LogDebug("NeutronWriter") << "opening " << s.str(); 00023 ofstream os; 00024 os.open(s.str().c_str(), ofstream::app); 00025 os << hits.size() << endl; 00026 for(size_t i = 0; i < hits.size(); ++i) { 00027 PSimHit h = hits[i]; 00028 os << h.entryPoint().x() << " " << h.entryPoint().y() << " " 00029 << h.entryPoint().z() << " " << h.exitPoint().x() << " " 00030 << h.exitPoint().y() << " " << h.exitPoint().z() << " " 00031 << h.pabs() << " " << " " << h.timeOfFlight() << " " 00032 << h.energyLoss() << " " <<h.particleType() << " " 00033 << h.detUnitId() << " " << h.trackId() << " " 00034 << h.momentumAtEntry().theta() << " " << h.momentumAtEntry().phi() << endl; 00035 } 00036 }
std::string AsciiNeutronWriter::theFileNameBase [private] |