#include "PhaseSpaceHit.hh" #include "G4ios.hh" #include "G4VVisManager.hh" #include "G4Colour.hh" #include "G4VisAttributes.hh" #include "G4LogicalVolume.hh" #include "G4UIcommand.hh" #include "G4UnitsTable.hh" #include "G4AttValue.hh" #include "G4AttDef.hh" #include "G4AttCheck.hh" G4ThreadLocal G4Allocator* psHitAllocator=0; std::map PhaseSpaceHit::fAttDefs; PhaseSpaceHit::PhaseSpaceHit(): G4VHit(), fCopyNo(), fParentID(), fParticleName(), fPos(), fLogV(0) {;} PhaseSpaceHit::PhaseSpaceHit ( G4int copyNo, G4int parentID, G4String particleName, G4ThreeVector pos, G4ThreeVector mom, G4double energy ): G4VHit(), fCopyNo(copyNo), fParentID(parentID), fParticleName(particleName), fPos(pos), fMom(mom), fEnergy(energy) {;} // Copy constructor PhaseSpaceHit::PhaseSpaceHit(const PhaseSpaceHit &right): G4VHit(), fCopyNo(right.fCopyNo), fParentID(right.fParentID), fParticleName(right.fParticleName), fPos(right.fPos), fMom(right.fMom), fEnergy(right.fEnergy) {;} PhaseSpaceHit::~PhaseSpaceHit() {;} //------------------------------------------------------------------------------------ // Functions below are needed for visualisation of hits. Currently unused. //------------------------------------------------------------------------------------ //void PhaseSpaceHit::Draw() //{ // G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); // if(pVVisManager) // { // G4VisAttributes attribs; // const G4VisAttributes* pVA = fLogV->GetVisAttributes(); // if(pVA) attribs = *pVA; // G4Colour colour(1.,0.,0.); // attribs.SetColour(colour); // attribs.SetForceSolid(true); // pVVisManager->Draw(*fLogV,attribs); // } //} //const std::map* PhaseSpaceHit::GetAttDefs() const //{ // if (fAttDefs.empty()) { // fAttDefs["HitType"] = // G4AttDef("HitType","Type of hit","Physics","","G4String"); // fAttDefs["Pos"] = // G4AttDef( "Pos","Particle position","Physics","","G4ThreeVector" ); // fAttDefs["Count"] = // G4AttDef( "Count","Number of hits","Physics","","G4int"); // } // return &fAttDefs; //} //std::vector* PhaseSpaceHit::CreateAttValues() const //{ // std::vector* attValues = new std::vector; // attValues->push_back(G4AttValue("HitType","PhaseSpaceHit","")); // attValues->push_back(G4AttValue("Pos",fPos,"")); // attValues->push_back // ("Count",G4UIcommand::ConvertToString(fHitCount),""); //G4cout << "Checking...\n" << G4AttCheck(attValues, GetAttDefs()); // return attValues; //} void PhaseSpaceHit::Print() {;}