CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PrintTrackNumberAction Class Reference

#include <PrintTrackNumberAction.h>

Inheritance diagram for PrintTrackNumberAction:
SimWatcher Observer< const EndOfEvent * > Observer< const EndOfTrack * >

Public Member Functions

 PrintTrackNumberAction (edm::ParameterSet const &p)
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfEvent *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
 ~PrintTrackNumberAction () override
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 

Private Attributes

bool bNoUserLimits
 
int theNoTracks
 
int theNoTracksNoUL
 
int theNoTracksThisEvent
 
int theNoTracksThisEventNoUL
 
int theNoTracksToPrint
 

Additional Inherited Members

Detailed Description

Definition at line 11 of file PrintTrackNumberAction.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file PrintTrackNumberAction.cc.

References bNoUserLimits, gather_cfg::cout, edm::ParameterSet::getUntrackedParameter(), and theNoTracksToPrint.

13 {
14  theNoTracksToPrint = p.getUntrackedParameter<int>("EachNTrack",-1);
15  // do not count tracks killed by user limits (MinEkineCut for the moment only)
16  bNoUserLimits = p.getUntrackedParameter<bool>("NoUserLimits", true);
17  std::cout << " PrintTrackNumberAction::bNoUserLimits " << bNoUserLimits << std::endl;
18 }
PrintTrackNumberAction::~PrintTrackNumberAction ( )
override

Definition at line 20 of file PrintTrackNumberAction.cc.

20 {}

Member Function Documentation

void PrintTrackNumberAction::update ( const EndOfTrack )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 22 of file PrintTrackNumberAction.cc.

References bNoUserLimits, gather_cfg::cout, theNoTracks, theNoTracksNoUL, theNoTracksThisEvent, theNoTracksThisEventNoUL, and theNoTracksToPrint.

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

23 {
24  const G4Track * aTrack = (*trk)();
25 
26  theNoTracks++;
28 
29  if (bNoUserLimits)
30  {
31  bool countTrk = true;
32  // tracks that have been killed before first step (by MinEkineCut).
33  // In fact the track makes the first step, MinEkineCut process determines
34  // that the energy is too low, set it to 0, and then at the next step
35  // the 0-energy particle dies
36  if (aTrack->GetCurrentStepNumber() == 2)
37  {
38  const G4VProcess* proccur =
39  aTrack->GetStep()->GetPostStepPoint()->GetProcessDefinedStep();
40  if (proccur != nullptr)
41  {
42  if (proccur->GetProcessName() == "MinEkineCut")
43  {
44  countTrk = false;
45  }
46  else
47  {
48  // for e+, last step is annihil, while previous is MinEkineCut
49  const G4VProcess* procprev =
50  aTrack->GetStep()->GetPreStepPoint()->GetProcessDefinedStep();
51  if (procprev != nullptr)
52  {
53  if (procprev->GetProcessName() == "MinEkineCut")
54  {
55  countTrk = false;
56  }
57  }
58  }
59  }
60  }
61  if (countTrk)
62  {
65  if (theNoTracksToPrint > 0)
66  {
68  {
69  std::cout << "PTNA: Simulating Track Number = "
70  << theNoTracksThisEventNoUL << std::endl;
71  }
72  }
73  }
74  }
75  else
76  {
77  if (theNoTracksToPrint > 0)
78  {
80  {
81  std::cout << "PTNA: Simulating Track Number = "
82  << theNoTracksThisEvent << std::endl;
83  }
84  }
85  }
86 }
void PrintTrackNumberAction::update ( const EndOfEvent )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 89 of file PrintTrackNumberAction.cc.

References bNoUserLimits, gather_cfg::cout, theNoTracks, theNoTracksNoUL, theNoTracksThisEvent, and theNoTracksThisEventNoUL.

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

90 {
91  const G4Event * g4e = (*e)();
92  std::cout << "PTNA: Event simulated= " << g4e->GetEventID() << " #tracks= ";
93  if (bNoUserLimits)
94  {
95  std::cout << theNoTracksThisEventNoUL << " Total #tracks in run= "
96  << theNoTracksNoUL << " counting killed by UL= " << theNoTracks
97  << std::endl;
99  }
100  else
101  {
102  std::cout << theNoTracksThisEvent << " Total #tracks in run= "
103  << theNoTracks << std::endl;
105  }
106 }

Member Data Documentation

bool PrintTrackNumberAction::bNoUserLimits
private

Definition at line 26 of file PrintTrackNumberAction.h.

Referenced by PrintTrackNumberAction(), and update().

int PrintTrackNumberAction::theNoTracks
private

Definition at line 21 of file PrintTrackNumberAction.h.

Referenced by update().

int PrintTrackNumberAction::theNoTracksNoUL
private

Definition at line 23 of file PrintTrackNumberAction.h.

Referenced by update().

int PrintTrackNumberAction::theNoTracksThisEvent
private

Definition at line 22 of file PrintTrackNumberAction.h.

Referenced by update().

int PrintTrackNumberAction::theNoTracksThisEventNoUL
private

Definition at line 24 of file PrintTrackNumberAction.h.

Referenced by update().

int PrintTrackNumberAction::theNoTracksToPrint
private

Definition at line 25 of file PrintTrackNumberAction.h.

Referenced by PrintTrackNumberAction(), and update().