test
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 12 of file SaveSimTrack.cc.

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

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

Definition at line 22 of file SaveSimTrack.cc.

22 {}

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 24 of file SaveSimTrack.cc.

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

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().

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

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().