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
EcalTBH4Trigger Class Reference

#include <SimG4Core/HelpfulWatchers/interface/EcalTBH4Trigger.h>

Inheritance diagram for EcalTBH4Trigger:
SimWatcher

Public Member Functions

 EcalTBH4Trigger (const edm::ParameterSet &pSet)
 
void update (const BeginOfEvent *anEvent)
 
void update (const G4Step *iStep)
 
void update (const EndOfEvent *anEvent)
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 

Private Attributes

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

Detailed Description

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

Usage: <usage>

Definition at line 46 of file EcalTBH4Trigger.h.

Constructor & Destructor Documentation

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

Definition at line 60 of file EcalTBH4Trigger.h.

60  :
61  m_verbose(pSet.getUntrackedParameter<bool>("verbose",false)), nTriggeredEvents_(0), trigEvents_(pSet.getUntrackedParameter<int>("trigEvents",-1)) {
62  }
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

void EcalTBH4Trigger::update ( const BeginOfEvent anEvent)
inline

Definition at line 74 of file EcalTBH4Trigger.h.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

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

Definition at line 88 of file EcalTBH4Trigger.h.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().

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

Definition at line 150 of file EcalTBH4Trigger.h.

References nTriggeredEvents_.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.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(), relval_steps.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().