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
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)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfRun *track)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *track)
 This routine will be called when the appropriate signal arrives. More...
 
 ~CountProcessesAction ()
 
- 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 ( )

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 )
virtual

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, FSQHLTOfflineSource_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;
31  theParticleList[particleName] = 0;
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(0);
46 }
void DumpProcessList(bool printNsteps, std::ostream &out=std::cout)
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:27
int ii
Definition: cuy.py:588
tuple cout
Definition: gather_cfg.py:145
void CountProcessesAction::update ( const BeginOfTrack )
virtual

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(), proc, FSQHLTOfflineSource_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();
53  theParticleList[particleName]++;
54 
55  //----- Fill counter of Creator Processes
56  const G4VProcess * proc = aTrack->GetCreatorProcess();
58  if (proc != 0) 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-
tuple cout
Definition: gather_cfg.py:145
void CountProcessesAction::update ( const EndOfRun )
virtual

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(1);
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 *  )
virtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 69 of file CountProcessesAction.cc.

References FSQHLTOfflineSource_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() != 0)
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().