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
SaveSimTrack Class Reference

#include <SaveSimTrack.h>

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

Public Member Functions

 SaveSimTrack (edm::ParameterSet const &p)
 
void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
 ~SaveSimTrack ()
 
- 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

int pdgMax
 
int pdgMin
 

Additional Inherited Members

Detailed Description

Definition at line 9 of file SaveSimTrack.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file SaveSimTrack.cc.

References edm::ParameterSet::getUntrackedParameter(), pdgMax, and pdgMin.

10  {
11 
12  pdgMin = p.getUntrackedParameter<int>("MinimumPDGCode", 1000000);
13  pdgMax = p.getUntrackedParameter<int>("MaximumPDGCode", 2000000);
14 
15  edm::LogInfo("SaveSimTrack") << "SaveSimTrack:: Save Sim Track if PDG code "
16  << "lies between " << pdgMin << " and "
17  << pdgMax;
18 }
SaveSimTrack::~SaveSimTrack ( )

Definition at line 20 of file SaveSimTrack.cc.

20 {}

Member Function Documentation

void SaveSimTrack::update ( const BeginOfTrack )
virtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 22 of file SaveSimTrack.cc.

References abs, LogDebug, pdgMax, pdgMin, and TrackInformation::storeTrack().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

22  {
23 
24  G4Track* theTrack = (G4Track*)((*trk)());
25  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
26  if (trkInfo) {
27  int pdg = std::abs(theTrack->GetDefinition()->GetPDGEncoding());
28  if (pdg >= pdgMin && pdg <= pdgMax) {
29  trkInfo->storeTrack(true);
30  LogDebug("SaveSimTrack") << "Save SimTrack the Track "
31  << theTrack->GetTrackID() << " Type "
32  << theTrack->GetDefinition()->GetParticleName()
33  << " Momentum " << theTrack->GetMomentum()/MeV
34  << " MeV/c";
35  }
36  }
37 }
#define LogDebug(id)
bool storeTrack() const
#define abs(x)
Definition: mlp_lapack.h:159

Member Data Documentation

int SaveSimTrack::pdgMax
private

Definition at line 18 of file SaveSimTrack.h.

Referenced by SaveSimTrack(), and update().

int SaveSimTrack::pdgMin
private

Definition at line 18 of file SaveSimTrack.h.

Referenced by SaveSimTrack(), and update().