CMS 3D CMS Logo

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) override
 This routine will be called when the appropriate signal arrives. More...
 
 ~SaveSimTrack () override
 
- 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

std::vector< int > pdgs_
 

Additional Inherited Members

Detailed Description

Definition at line 11 of file SaveSimTrack.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file SaveSimTrack.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), gen::k, and pdgs_.

13  {
14  edm::ParameterSet ps = p.getParameter<edm::ParameterSet>("SaveSimTrack");
15  pdgs_ = ps.getUntrackedParameter<std::vector<int>>("PDGCodes");
16 
17  edm::LogInfo("SaveSimTrack") << "SaveSimTrack:: Save Sim Track if PDG code "
18  << "is one from the list of " << pdgs_.size() << " items";
19  for (unsigned int k = 0; k < pdgs_.size(); ++k)
20  edm::LogInfo("SaveSimTrack") << "[" << k << "] " << pdgs_[k];
21 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > pdgs_
Definition: SaveSimTrack.h:18
int k[5][pyjets_maxn]
SaveSimTrack::~SaveSimTrack ( )
override

Definition at line 23 of file SaveSimTrack.cc.

23 {}

Member Function Documentation

void SaveSimTrack::update ( const BeginOfTrack )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 25 of file SaveSimTrack.cc.

References spr::find(), LogDebug, MeV, pdgs_, 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().

25  {
26  G4Track *theTrack = (G4Track *)((*trk)());
27  TrackInformation *trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
28  if (trkInfo) {
29  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
30  if (std::find(pdgs_.begin(), pdgs_.end(), pdg) != pdgs_.end()) {
31  trkInfo->storeTrack(true);
32  LogDebug("SaveSimTrack") << "Save SimTrack the Track " << theTrack->GetTrackID() << " Type "
33  << theTrack->GetDefinition()->GetParticleName() << " Momentum "
34  << theTrack->GetMomentum() / MeV << " MeV/c";
35  }
36  }
37 }
#define LogDebug(id)
bool storeTrack() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
const double MeV
std::vector< int > pdgs_
Definition: SaveSimTrack.h:18

Member Data Documentation

std::vector<int> SaveSimTrack::pdgs_
private

Definition at line 18 of file SaveSimTrack.h.

Referenced by SaveSimTrack(), and update().