CMS 3D CMS Logo

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

#include <EcalTBH4Trigger.h>

Inheritance diagram for EcalTBH4Trigger:
SimWatcher Observer< const BeginOfEvent * > Observer< const G4Step * > Observer< const EndOfEvent * >

Public Member Functions

 EcalTBH4Trigger (const edm::ParameterSet &pSet)
 
void update (const BeginOfEvent *anEvent) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *iStep) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfEvent *anEvent) override
 This routine will be called when the appropriate signal arrives. More...
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const G4Step * >
 Observer ()
 
void slotForUpdate (const G4Step * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 

Private Attributes

bool m_passedTrg1
 
bool m_passedTrg3
 
bool m_passedTrg4
 
bool m_passedTrg5
 
bool m_passedTrg6
 
bool m_verbose
 
int nTriggeredEvents_
 
int trigEvents_
 

Additional Inherited Members

Detailed Description

SimG4Core/HelpfulWatchers/interface/EcalTBH4Trigger.h

Description: Simulates ECALTBH4 trigger an throw exception in case of non triggering event

Usage: <usage>

Definition at line 52 of file EcalTBH4Trigger.h.

Constructor & Destructor Documentation

EcalTBH4Trigger::EcalTBH4Trigger ( const edm::ParameterSet pSet)
inline

Definition at line 65 of file EcalTBH4Trigger.h.

66  : m_verbose(pSet.getUntrackedParameter<bool>("verbose", false)),
68  trigEvents_(pSet.getUntrackedParameter<int>("trigEvents", -1)) {}
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

void EcalTBH4Trigger::update ( const BeginOfEvent )
inlineoverridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 80 of file EcalTBH4Trigger.h.

References m_passedTrg1, m_passedTrg3, m_passedTrg4, m_passedTrg5, and m_passedTrg6.

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  // std::cout <<"++ signal BeginOfEvent " ;
82  // m_enteringTBH4BeamLine=false;
83  // m_exitingTBH4BeamLine=false;
84  // m_passedTrigger=false;
85  m_passedTrg1 = false;
86  m_passedTrg3 = false;
87  m_passedTrg4 = false;
88  m_passedTrg5 = false;
89  m_passedTrg6 = false;
90  }
void EcalTBH4Trigger::update ( const G4Step *  )
inlineoverridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 93 of file EcalTBH4Trigger.h.

References gather_cfg::cout, cuy::ii, m_passedTrg1, m_passedTrg3, m_passedTrg4, m_passedTrg5, m_passedTrg6, m_verbose, MeV, nTriggeredEvents_, and trigEvents_.

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

93  {
95  throw SimG4Exception("Number of needed trigger events reached in ECALTBH4");
96 
97  const G4StepPoint *pre = iStep->GetPreStepPoint();
98  const G4StepPoint *post = iStep->GetPostStepPoint();
99  if (m_verbose) {
100  std::cout << "++ signal G4Step";
101  const G4VTouchable *touch = iStep->GetPreStepPoint()->GetTouchable();
102  // Get name and copy numbers
103  if (touch->GetHistoryDepth() > 0) {
104  for (int ii = 0; ii <= touch->GetHistoryDepth(); ii++) {
105  std::cout << "EcalTBH4::Level " << ii << ": " << touch->GetVolume(ii)->GetName() << "["
106  << touch->GetReplicaNumber(ii) << "]";
107  }
108  }
109  std::cout << std::endl;
110  const G4Track *theTrack = iStep->GetTrack();
111  const G4ThreeVector &pos = post->GetPosition();
112  std::cout << "( " << pos.x() << "," << pos.y() << "," << pos.z() << ") ";
113  std::cout << " released energy (MeV) " << iStep->GetTotalEnergyDeposit() / CLHEP::MeV;
114  if (theTrack) {
115  const G4ThreeVector mom = theTrack->GetMomentum();
116  std::cout << " track length (cm) " << theTrack->GetTrackLength() / CLHEP::cm << " particle type "
117  << theTrack->GetDefinition()->GetParticleName() << " momentum "
118  << "( " << mom.x() << "," << mom.y() << "," << mom.z() << ") ";
119  if (theTrack->GetCreatorProcess()) {
120  std::cout << " created by " << theTrack->GetCreatorProcess()->GetProcessName();
121  }
122  }
123  if (post->GetPhysicalVolume()) {
124  std::cout << " " << pre->GetPhysicalVolume()->GetName() << "->" << post->GetPhysicalVolume()->GetName();
125  }
126  std::cout << std::endl;
127  }
128 
129  if (post && post->GetPhysicalVolume()) {
130  if (!m_passedTrg1 && post->GetPhysicalVolume()->GetName() == "TRG1")
131  m_passedTrg1 = true;
132  if (!m_passedTrg3 && post->GetPhysicalVolume()->GetName() == "TRG3")
133  m_passedTrg3 = true;
134  if (!m_passedTrg4 && post->GetPhysicalVolume()->GetName() == "TRG4")
135  m_passedTrg4 = true;
136  if (!m_passedTrg5 && post->GetPhysicalVolume()->GetName() == "TRG5")
137  m_passedTrg5 = true;
138  if (!m_passedTrg6 && post->GetPhysicalVolume()->GetName() == "TRG6")
139  m_passedTrg6 = true;
140  if (post->GetPhysicalVolume()->GetName() == "CMSSE") // Exiting TBH4BeamLine
141  if (!(m_passedTrg1 && m_passedTrg6)) // Trigger defined as Trg4 && Trg6
142  throw SimG4Exception("Event is not triggered by ECALTBH4");
143  }
144 
145  /* if (!m_enteringTBH4BeamLine && ( post->GetPhysicalVolume()->GetName()
146  * == */
147  }
const double MeV
ii
Definition: cuy.py:590
void EcalTBH4Trigger::update ( const EndOfEvent )
inlineoverridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 151 of file EcalTBH4Trigger.h.

References nTriggeredEvents_.

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

151  {
152  // std::cout <<"++ signal BeginOfEvent " ;
153  // m_enteringTBH4BeamLine=false;
154  // m_exitingTBH4BeamLine=false;
155  // m_passedTrigger=false;
157  }

Member Data Documentation

bool EcalTBH4Trigger::m_passedTrg1
private

Definition at line 169 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg3
private

Definition at line 170 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg4
private

Definition at line 171 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg5
private

Definition at line 172 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg6
private

Definition at line 173 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_verbose
private

Definition at line 166 of file EcalTBH4Trigger.h.

Referenced by update().

int EcalTBH4Trigger::nTriggeredEvents_
private

Definition at line 174 of file EcalTBH4Trigger.h.

Referenced by update().

int EcalTBH4Trigger::trigEvents_
private

Definition at line 175 of file EcalTBH4Trigger.h.

Referenced by update().