CMS 3D CMS Logo

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

#include <SimG4Core/HelpfulWatchers/interface/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

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

Usage: <usage>

Definition at line 47 of file EcalTBH4Trigger.h.

Constructor & Destructor Documentation

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

Definition at line 61 of file EcalTBH4Trigger.h.

61  :
62  m_verbose(pSet.getUntrackedParameter<bool>("verbose",false)), nTriggeredEvents_(0), trigEvents_(pSet.getUntrackedParameter<int>("trigEvents",-1)) {
63  }
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 75 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().

76  {
77  // std::cout <<"++ signal BeginOfEvent " ;
78  // m_enteringTBH4BeamLine=false;
79  // m_exitingTBH4BeamLine=false;
80  // m_passedTrigger=false;
81  m_passedTrg1=false;
82  m_passedTrg3=false;
83  m_passedTrg4=false;
84  m_passedTrg5=false;
85  m_passedTrg6=false;
86  }
void EcalTBH4Trigger::update ( const G4Step *  )
inlineoverridevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 89 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().

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

156  {
157  // std::cout <<"++ signal BeginOfEvent " ;
158  // m_enteringTBH4BeamLine=false;
159  // m_exitingTBH4BeamLine=false;
160  // m_passedTrigger=false;
162  }

Member Data Documentation

bool EcalTBH4Trigger::m_passedTrg1
private

Definition at line 174 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg3
private

Definition at line 175 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg4
private

Definition at line 176 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg5
private

Definition at line 177 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_passedTrg6
private

Definition at line 178 of file EcalTBH4Trigger.h.

Referenced by update().

bool EcalTBH4Trigger::m_verbose
private

Definition at line 171 of file EcalTBH4Trigger.h.

Referenced by update().

int EcalTBH4Trigger::nTriggeredEvents_
private

Definition at line 179 of file EcalTBH4Trigger.h.

Referenced by update().

int EcalTBH4Trigger::trigEvents_
private

Definition at line 180 of file EcalTBH4Trigger.h.

Referenced by update().