CMS 3D CMS Logo

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

#include <CountProcessesAction.h>

Inheritance diagram for CountProcessesAction:
SimWatcher Observer< const BeginOfRun * > Observer< const EndOfRun * > Observer< const BeginOfTrack * > Observer< const G4Step * >

Public Member Functions

 CountProcessesAction (edm::ParameterSet const &p)
 
void DumpCreatorProcessList (bool printNsteps, std::ostream &out=std::cout)
 
void DumpParticleList (std::ostream &out=std::cout)
 
void DumpProcessList (bool printNsteps, std::ostream &out=std::cout)
 
void update (const BeginOfRun *run) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfRun *track) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *track) override
 This routine will be called when the appropriate signal arrives. More...
 
 ~CountProcessesAction () override
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfRun * >
 Observer ()
 
void slotForUpdate (const EndOfRun * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfTrack * >
 Observer ()
 
void slotForUpdate (const BeginOfTrack * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const G4Step * >
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 

Private Attributes

bool fDEBUG
 
mpssi theCreatorProcessList
 
psi theParticleList
 
mpssi theProcessList
 

Additional Inherited Members

Detailed Description

Definition at line 23 of file CountProcessesAction.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file CountProcessesAction.cc.

15  : fDEBUG(p.getUntrackedParameter<bool>("DEBUG",false))
16 {}
CountProcessesAction::~CountProcessesAction ( )
override

Definition at line 18 of file CountProcessesAction.cc.

18 {}

Member Function Documentation

void CountProcessesAction::DumpCreatorProcessList ( bool  printNsteps,
std::ostream &  out = std::cout 
)

Definition at line 100 of file CountProcessesAction.cc.

References theCreatorProcessList.

Referenced by update().

101 {
102  mpssi::iterator ite;
103  for (ite = theCreatorProcessList.begin(); ite != theCreatorProcessList.end(); ite++)
104  {
105  if (!printNsteps)
106  out << "PROC-CREATOR_LIST " << (*ite).first.first << " : "
107  <<(*ite) .first.second << std::endl;
108  else if ((*ite).second != 0)
109  out << "PROC_CREATOR_COUNT " << (*ite).first.first << " : "
110  <<(*ite) .first.second << " = " << (*ite).second << std::endl;
111  }
112 }
void CountProcessesAction::DumpParticleList ( std::ostream &  out = std::cout)

Definition at line 114 of file CountProcessesAction.cc.

References theParticleList.

Referenced by update().

115 {
116  psi::iterator ite;
117  for (ite = theParticleList.begin(); ite != theParticleList.end(); ite++)
118  {
119  if ((*ite).second != 0)
120  out << "PART_LIST: " << (*ite).first << " = " << (*ite).second << std::endl;
121  }
122 }
void CountProcessesAction::DumpProcessList ( bool  printNsteps,
std::ostream &  out = std::cout 
)

Definition at line 86 of file CountProcessesAction.cc.

References theProcessList.

Referenced by update().

87 {
88  mpssi::iterator ite;
89  for (ite = theProcessList.begin(); ite != theProcessList.end(); ite++)
90  {
91  if (!printNsteps)
92  out << "PROC_LIST " << (*ite).first.first << " : "
93  << (*ite) .first.second << std::endl;
94  else if ((*ite).second != 0)
95  out << "PROC_COUNT " << (*ite).first.first << " : "
96  << (*ite) .first.second << " = " << (*ite).second << std::endl;
97  }
98 }
void CountProcessesAction::update ( const BeginOfRun )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 20 of file CountProcessesAction.cc.

References gather_cfg::cout, DumpProcessList(), fDEBUG, cuy::ii, findQualityFiles::jj, HiggsValidation_cfi::particleName, modifiedElectrons_cfi::processName, AlCaHLTBitMon_QueryRunRegistry::string, theParticleList, and theProcessList.

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

21 {
22  G4ParticleTable * partTable = G4ParticleTable::GetParticleTable();
23  int siz = partTable->size();
24  for (int ii= 0; ii < siz; ii++)
25  {
26  G4ParticleDefinition * particle = partTable->GetParticle(ii);
27  std::string particleName = particle->GetParticleName();
28  if (fDEBUG)
29  std::cout << ii << " PCA " << particleName<< " " << particle->GetPDGStable()
30  << " " << particle->IsShortLived() << std::endl;
32 
33  //--- All processes of this particle
34  G4ProcessManager * pmanager = particle->GetProcessManager();
35  G4ProcessVector * pvect = pmanager->GetProcessList();
36  int sizproc = pvect->size();
37  for (int jj = 0; jj < sizproc; jj++)
38  {
39  std::string processName = (*pvect)[jj]->GetProcessName();
40  if (fDEBUG)
41  std::cout << jj << " PCR " << processName<< std::endl;
42  theProcessList[pss(particleName,processName)] = 0;
43  }
44  }
45  DumpProcessList(false);
46 }
void DumpProcessList(bool printNsteps, std::ostream &out=std::cout)
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27
ii
Definition: cuy.py:588
void CountProcessesAction::update ( const BeginOfTrack )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 48 of file CountProcessesAction.cc.

References gather_cfg::cout, fDEBUG, reco::if(), HiggsValidation_cfi::particleName, proc, modifiedElectrons_cfi::processName, AlCaHLTBitMon_QueryRunRegistry::string, theCreatorProcessList, and theParticleList.

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

49 {
50  //----- Fill counter of particles
51  const G4Track * aTrack = (*trk)();
52  std::string particleName = aTrack->GetDefinition()->GetParticleName();
54 
55  //----- Fill counter of Creator Processes
56  const G4VProcess * proc = aTrack->GetCreatorProcess();
58  if (proc != nullptr) processName = proc->GetProcessName();
59  else processName = "Primary";
60  pss parproc(particleName,processName);
61  mpssi::iterator ite = theCreatorProcessList.find(parproc);
62  if (ite == theCreatorProcessList.end()) theCreatorProcessList[ parproc ] = 1;
63  else (*ite).second = (*ite).second +1;
64  if (fDEBUG)
65  std::cout << " creator " << particleName << " " << processName
66  << theCreatorProcessList.size() << std::endl;
67 }
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27
TrainProcessor *const proc
Definition: MVATrainer.cc:101
if(dp >Float(M_PI)) dp-
void CountProcessesAction::update ( const EndOfRun )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

Definition at line 79 of file CountProcessesAction.cc.

References DumpCreatorProcessList(), DumpParticleList(), and DumpProcessList().

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

80 {
81  DumpProcessList(true);
84 }
void DumpProcessList(bool printNsteps, std::ostream &out=std::cout)
void DumpParticleList(std::ostream &out=std::cout)
void DumpCreatorProcessList(bool printNsteps, std::ostream &out=std::cout)
void CountProcessesAction::update ( const G4Step *  )
overridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 69 of file CountProcessesAction.cc.

References HiggsValidation_cfi::particleName, modifiedElectrons_cfi::processName, AlCaHLTBitMon_QueryRunRegistry::string, and theProcessList.

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

70 {
72  if(aStep->GetPostStepPoint()->GetProcessDefinedStep() != nullptr)
73  processName = aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
74  else processName = "User Limit";
75  std::string particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
76  theProcessList[pss(particleName,processName)] = theProcessList[pss(particleName,processName)] + 1;
77 }
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27

Member Data Documentation

bool CountProcessesAction::fDEBUG
private

Definition at line 43 of file CountProcessesAction.h.

Referenced by update().

mpssi CountProcessesAction::theCreatorProcessList
private

Definition at line 45 of file CountProcessesAction.h.

Referenced by DumpCreatorProcessList(), and update().

psi CountProcessesAction::theParticleList
private

Definition at line 46 of file CountProcessesAction.h.

Referenced by DumpParticleList(), and update().

mpssi CountProcessesAction::theProcessList
private

Definition at line 44 of file CountProcessesAction.h.

Referenced by DumpProcessList(), and update().