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 10 of file KillSecondariesTrackAction.cc.

References edm::ParameterSet::getParameter(), killHeavy, kmaxIon, kmaxNeutron, and kmaxProton.

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

Definition at line 24 of file KillSecondariesTrackAction.cc.

24 {}

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 26 of file KillSecondariesTrackAction.cc.

References TrackInformation::isPrimary(), killHeavy, kmaxIon, kmaxNeutron, and kmaxProton.

Referenced by python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Views.LineDecayView.LineDecayContainer::createObject(), python.Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), python.Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), python.Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), python.Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), python.Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), python.Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), python.Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), python.Vispa.Gui.FindDialog.FindDialog::reset(), python.Vispa.Gui.PortConnection.PointToPointConnection::select(), python.Vispa.Gui.VispaWidget.VispaWidget::select(), python.Vispa.Views.LineDecayView.LineDecayContainer::select(), python.Vispa.Gui.VispaWidget.VispaWidget::setText(), python.Vispa.Gui.VispaWidget.VispaWidget::setTitle(), python.Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), python.Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and python.Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

Member Data Documentation

bool KillSecondariesTrackAction::killHeavy
private

Definition at line 19 of file KillSecondariesTrackAction.h.

Referenced by KillSecondariesTrackAction(), and update().

double KillSecondariesTrackAction::kmaxIon
private

Definition at line 20 of file KillSecondariesTrackAction.h.

Referenced by KillSecondariesTrackAction(), and update().

double KillSecondariesTrackAction::kmaxNeutron
private

Definition at line 20 of file KillSecondariesTrackAction.h.

Referenced by KillSecondariesTrackAction(), and update().

double KillSecondariesTrackAction::kmaxProton
private

Definition at line 20 of file KillSecondariesTrackAction.h.

Referenced by KillSecondariesTrackAction(), and update().