CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
KillSecondariesTrackAction Class Reference

#include <KillSecondariesTrackAction.h>

Inheritance diagram for KillSecondariesTrackAction:
SimWatcher Observer< const BeginOfTrack * >

Public Member Functions

 KillSecondariesTrackAction (edm::ParameterSet const &p)
 
void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
 ~KillSecondariesTrackAction ()
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack *iT)
 
virtual ~Observer ()
 

Private Attributes

bool killHeavy
 
double kmaxIon
 
double kmaxNeutron
 
double kmaxProton
 

Additional Inherited Members

Detailed Description

Definition at line 10 of file KillSecondariesTrackAction.h.

Constructor & Destructor Documentation

KillSecondariesTrackAction::KillSecondariesTrackAction ( edm::ParameterSet const &  p)

Definition at line 12 of file KillSecondariesTrackAction.cc.

References edm::ParameterSet::getParameter(), and MeV.

12  {
13 
14  killHeavy = p.getParameter<bool>("KillHeavy");
15  kmaxIon = p.getParameter<double>("IonThreshold")*MeV;
16  kmaxProton = p.getParameter<double>("ProtonThreshold")*MeV;
17  kmaxNeutron = p.getParameter<double>("NeutronThreshold")*MeV;
18 
19  edm::LogInfo("KillSecondaries") << "KillSecondariesTrackAction:: Killing"
20  << " Flag " << killHeavy << " protons below "
21  << kmaxProton << " MeV, neutrons below "
22  << kmaxNeutron << " MeV and ions below "
23  << kmaxIon << " MeV\n";
24 }
const double MeV
KillSecondariesTrackAction::~KillSecondariesTrackAction ( )

Definition at line 26 of file KillSecondariesTrackAction.cc.

26 {}

Member Function Documentation

void KillSecondariesTrackAction::update ( const BeginOfTrack )
virtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 28 of file KillSecondariesTrackAction.cc.

References TrackInformation::isPrimary(), ke, and MeV.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

28  {
29 
30  if (killHeavy) {
31  G4Track* theTrack = (G4Track*)((*trk)());
32  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
33  if (trkInfo) {
34  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
35  if (!(trkInfo->isPrimary())) { // Only secondary particles
36  double ke = theTrack->GetKineticEnergy()/MeV;
37  if ((((pdg/1000000000 == 1 && ((pdg/10000)%100) > 0 &&
38  ((pdg/10)%100) > 0)) && (ke<kmaxIon)) ||
39  ((pdg == 2212) && (ke < kmaxProton)) ||
40  ((pdg == 2112) && (ke < kmaxNeutron))) {
41  theTrack->SetTrackStatus(fStopAndKill);
42  edm::LogInfo("KillSecondaries") << "Kill Track " << theTrack->GetTrackID()
43  << " Type " << theTrack->GetDefinition()->GetParticleName()
44  << " Kinetic Energy " << ke <<" MeV";
45  }
46  }
47  }
48  }
49 }
const double MeV
int ke
bool isPrimary() const

Member Data Documentation

bool KillSecondariesTrackAction::killHeavy
private

Definition at line 19 of file KillSecondariesTrackAction.h.

double KillSecondariesTrackAction::kmaxIon
private

Definition at line 20 of file KillSecondariesTrackAction.h.

double KillSecondariesTrackAction::kmaxNeutron
private

Definition at line 20 of file KillSecondariesTrackAction.h.

double KillSecondariesTrackAction::kmaxProton
private

Definition at line 20 of file KillSecondariesTrackAction.h.