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

Definition at line 25 of file SaveSimTrack.cc.

25 {}

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

27  {
28 
29  G4Track* theTrack = (G4Track*)((*trk)());
30  TrackInformation * trkInfo = (TrackInformation *)(theTrack->GetUserInformation());
31  if (trkInfo) {
32  int pdg = theTrack->GetDefinition()->GetPDGEncoding();
33  if (std::find(pdgs_.begin(),pdgs_.end(),pdg) != pdgs_.end()) {
34  trkInfo->storeTrack(true);
35  LogDebug("SaveSimTrack") << "Save SimTrack the Track "
36  << theTrack->GetTrackID() << " Type "
37  << theTrack->GetDefinition()->GetParticleName()
38  << " Momentum " << theTrack->GetMomentum()/MeV
39  << " MeV/c";
40  }
41  }
42 }
#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:20

Member Data Documentation

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

Definition at line 20 of file SaveSimTrack.h.

Referenced by SaveSimTrack(), and update().