CMS 3D CMS Logo

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

#include <TrackingMaterialProducer.h>

Inheritance diagram for TrackingMaterialProducer:
SimProducer Observer< const BeginOfJob * > Observer< const EndOfJob * > Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const G4Step * > Observer< const EndOfTrack * > SimWatcher

Public Member Functions

 TrackingMaterialProducer (const edm::ParameterSet &)
 
 ~TrackingMaterialProducer () override
 
- Public Member Functions inherited from SimProducer
void registerProducts (edm::ProducerBase &iProd)
 
 SimProducer ()
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const EndOfJob * >
 Observer ()
 
void slotForUpdate (const EndOfJob * iT)
 
virtual ~Observer ()
 
- Public Member Functions inherited from Observer< const BeginOfEvent * >
 Observer ()
 
void slotForUpdate (const BeginOfEvent * 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 ()
 
- Public Member Functions inherited from Observer< const EndOfTrack * >
 Observer ()
 
void slotForUpdate (const EndOfTrack * iT)
 
virtual ~Observer ()
 

Private Member Functions

bool isSelected (const G4VTouchable *touch)
 
bool isSelectedFast (const G4TouchableHistory *touch)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void update (const BeginOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfJob *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

bool m_primaryTracks
 
std::vector< std::string > m_selectedNames
 
std::vector< const G4LogicalVolume * > m_selectedVolumes
 
MaterialAccountingTrack m_track
 
std::vector< MaterialAccountingTrack > * m_tracks
 
TFile * output_file_
 
TProfile * radLen_vs_eta_
 

Additional Inherited Members

- Protected Member Functions inherited from SimProducer
template<class T >
void produces ()
 
template<class T >
void produces (const std::string &instanceName)
 

Detailed Description

Definition at line 30 of file TrackingMaterialProducer.h.

Constructor & Destructor Documentation

TrackingMaterialProducer::TrackingMaterialProducer ( const edm::ParameterSet iPSet)

Definition at line 84 of file TrackingMaterialProducer.cc.

References edm::ParameterSet::getParameter().

85 {
86  edm::ParameterSet config = iPSet.getParameter<edm::ParameterSet>("TrackingMaterialProducer");
87  m_selectedNames = config.getParameter< std::vector<std::string> >("SelectedVolumes");
88  m_primaryTracks = config.getParameter<bool>("PrimaryTracksOnly");
89  m_tracks = nullptr;
90 
91  produces< std::vector<MaterialAccountingTrack> >();
92  output_file_ = new TFile("radLen_vs_eta_fromProducer.root", "RECREATE");
93  output_file_->cd();
94  radLen_vs_eta_ = new TProfile("radLen", "radLen", 250., -5., 5., 0, 10.);
95 }
T getParameter(std::string const &) const
Definition: config.py:1
std::vector< MaterialAccountingTrack > * m_tracks
std::vector< std::string > m_selectedNames
TrackingMaterialProducer::~TrackingMaterialProducer ( void  )
override

Definition at line 98 of file TrackingMaterialProducer.cc.

99 {
100 }

Member Function Documentation

bool TrackingMaterialProducer::isSelected ( const G4VTouchable *  touch)
private

Definition at line 292 of file TrackingMaterialProducer.cc.

References DEFINE_SIMWATCHER, mps_fire::i, and or.

293 {
294  for (size_t i = 0; i < m_selectedVolumes.size(); ++i)
295  if (m_selectedVolumes[i]->IsAncestor( touchable->GetVolume() )
296  or m_selectedVolumes[i] == touchable->GetVolume()->GetLogicalVolume())
297  return true;
298 
299  return false;
300 }
std::vector< const G4LogicalVolume * > m_selectedVolumes
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
bool TrackingMaterialProducer::isSelectedFast ( const G4TouchableHistory *  touch)
private

Definition at line 146 of file TrackingMaterialProducer.cc.

References edmIntegrityCheck::d, and spr::find().

146  {
147  for (int d = touchable->GetHistoryDepth() -1; d >=0; --d) {
148  if (
149  std::find(
150  m_selectedNames.begin(),
151  m_selectedNames.end(),
152  touchable->GetVolume(d)->GetName())
153  != m_selectedNames.end())
154  return true;
155  }
156  return false;
157 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > m_selectedNames
void TrackingMaterialProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements SimProducer.

Definition at line 283 of file TrackingMaterialProducer.cc.

References eostools::move(), edm::Event::put(), and l1t::tracks.

284 {
285  // transfer ownership to the Event
286  std::unique_ptr<std::vector<MaterialAccountingTrack> > tracks( m_tracks );
287  iEvent.put(std::move(tracks));
288  m_tracks = nullptr;
289 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
std::vector< MaterialAccountingTrack > * m_tracks
def move(src, dest)
Definition: eostools.py:511
void TrackingMaterialProducer::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 109 of file TrackingMaterialProducer.cc.

References MessageLogger_cfi::cerr, and GetVolume().

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

110 {
111  // INFO
112  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: List of the selected volumes: " << std::endl;
113  for (std::vector<std::string>::const_iterator volume_name = m_selectedNames.begin();
114  volume_name != m_selectedNames.end(); ++volume_name) {
115  const G4LogicalVolume* volume = GetVolume(*volume_name);
116  if (volume) {
117  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: " << *volume_name << std::endl;
118  m_selectedVolumes.push_back( volume );
119  } else {
120  // FIXME: throw an exception ?
121  std::cerr << "TrackingMaterialProducer::update(const BeginOfJob*): WARNING: selected volume \"" << *volume_name << "\" not found in geometry " << std::endl;
122  }
123  }
124 }
std::vector< const G4LogicalVolume * > m_selectedVolumes
static const G4LogicalVolume * GetVolume(const std::string &name)
std::vector< std::string > m_selectedNames
void TrackingMaterialProducer::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 128 of file TrackingMaterialProducer.cc.

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

129 {
130  m_tracks = new std::vector<MaterialAccountingTrack>();
131 }
std::vector< MaterialAccountingTrack > * m_tracks
void TrackingMaterialProducer::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 135 of file TrackingMaterialProducer.cc.

References HiIsolationCommonParameters_cff::track.

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

136 {
137  m_track.reset();
138 
139  // prevent secondary tracks from propagating
140  G4Track* track = const_cast<G4Track*>((*event)());
141  if (m_primaryTracks and track->GetParentID() != 0) {
142  track->SetTrackStatus(fStopAndKill);
143  }
144 }
MaterialAccountingTrack m_track
void TrackingMaterialProducer::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 160 of file TrackingMaterialProducer.cc.

References GetSensitiveVolume(), GetTransform(), hcalDigis_cfi::level, PV3DBase< T, PVType, FrameType >::perp(), position, create_public_lumi_plots::transform, X0, and PV3DBase< T, PVType, FrameType >::z().

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

161 {
162  const G4TouchableHistory* touchable = (G4TouchableHistory*)(step->GetTrack()->GetTouchable());
163  if (not isSelectedFast( touchable )) {
164  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer:\t[...] skipping "
165  << touchable->GetVolume()->GetName() << std::endl;
166  return;
167  }
168 
169  // material and step proterties
170  const G4Material* material = touchable->GetVolume()->GetLogicalVolume()->GetMaterial();
171  double length = step->GetStepLength() / cm; // mm -> cm
172  double X0 = material->GetRadlen() / cm; // mm -> cm
173  double Ne = material->GetElectronDensity() * cm3; // 1/mm3 -> 1/cm3
174  double Xi = Ne / 6.0221415e23 * 0.307075 / 2; // MeV / cm
175  double radiationLengths = length / X0; //
176  double energyLoss = length * Xi / 1000.; // GeV
177  //double energyLoss = step->GetDeltaEnergy()/MeV; should we use this??
178 
179  G4ThreeVector globalPosPre = step->GetPreStepPoint()->GetPosition();
180  G4ThreeVector globalPosPost = step->GetPostStepPoint()->GetPosition();
181  GlobalPoint globalPositionIn( globalPosPre.x() / cm, globalPosPre.y() / cm, globalPosPre.z() / cm ); // mm -> cm
182  GlobalPoint globalPositionOut( globalPosPost.x() / cm, globalPosPost.y() / cm, globalPosPost.z() / cm ); // mm -> cm
183 
184  // check for a sensitive detector
185  bool enter_sensitive = false;
186  bool leave_sensitive = false;
187  double cosThetaPre = 0.0;
188  double cosThetaPost = 0.0;
189  int level = 0;
190  const G4VPhysicalVolume* sensitive = nullptr;
192  std::tie(sensitive, level) = GetSensitiveVolume(touchable);
193  if (sensitive) {
194  const G4VSolid & solid = *touchable->GetSolid( level );
195  const G4AffineTransform & transform = GetTransform( touchable, level );
196  G4ThreeVector pos = transform.Inverse().TransformPoint( G4ThreeVector( 0., 0., 0. ) );
197  position = GlobalPoint( pos.x() / cm, pos.y() / cm, pos.z() / cm ); // mm -> cm
198 
199  G4ThreeVector localPosPre = transform.TransformPoint( globalPosPre );
200  EInside statusPre = solid.Inside( localPosPre );
201  if (statusPre == kSurface) {
202  enter_sensitive = true;
203  G4ThreeVector globalDirPre = step->GetPreStepPoint()->GetMomentumDirection();
204  G4ThreeVector localDirPre = transform.TransformAxis( globalDirPre );
205  G4ThreeVector normalPre = solid.SurfaceNormal( localPosPre );
206  cosThetaPre = normalPre.cosTheta( -localDirPre );
207  }
208 
209  G4ThreeVector localPosPost = transform.TransformPoint( globalPosPost );
210  EInside statusPost = solid.Inside( localPosPost );
211  if (statusPost == kSurface) {
212  leave_sensitive = true;
213  G4ThreeVector globalDirPost = step->GetPostStepPoint()->GetMomentumDirection();
214  G4ThreeVector localDirPost = transform.TransformAxis( globalDirPost );
215  G4ThreeVector normalPost = solid.SurfaceNormal( localPosPost );
216  cosThetaPost = normalPost.cosTheta( localDirPost );
217  }
218  }
219 
220  // update track accounting
221  if (enter_sensitive)
222  m_track.enterDetector( sensitive, position, cosThetaPre );
223  m_track.step(MaterialAccountingStep( length, radiationLengths, energyLoss, globalPositionIn, globalPositionOut ));
224  if (leave_sensitive)
225  m_track.leaveDetector( sensitive, cosThetaPost );
226 
227  if (sensitive)
228  LogInfo("TrackingMaterialProducer") << "Track was near sensitive volume "
229  << sensitive->GetName() << std::endl;
230  else
231  LogInfo("TrackingMaterialProducer") << "Track was near non-sensitive volume "
232  << touchable->GetVolume()->GetName() << std::endl;
233  LogInfo("TrackingMaterialProducer") << "Step length: "
234  << length << " cm\n"
235  << "globalPreStep(r,z): (" << globalPositionIn.perp()
236  << ", " << globalPositionIn.z() << ") cm\n"
237  << "globalPostStep(r,z): (" << globalPositionOut.perp()
238  << ", " << globalPositionOut.z() << ") cm\n"
239  << "position(r,z): ("
240  << position.perp()
241  << ", " << position.z() << ") cm\n"
242  << "Radiation lengths: "
243  << radiationLengths << " \t\t(X0: "
244  << X0 << " cm)\n"
245  << "Energy loss: "
246  << energyLoss << " MeV \t(Xi: "
247  << Xi << " MeV/cm)\n"
248  << "Track was " << (enter_sensitive ? "entering " : "in none ")
249  << "sensitive volume\n"
250  << "Track was " << (leave_sensitive ? "leaving " : "in none ")
251  << "sensitive volume\n";
252 
253 }
T perp() const
Definition: PV3DBase.h:72
MaterialAccountingTrack m_track
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void step(const MaterialAccountingStep &step)
static const G4AffineTransform & GetTransform(const G4TouchableHistory *touchable, int depth)
T z() const
Definition: PV3DBase.h:64
void enterDetector(const G4VPhysicalVolume *volume, const GlobalPoint &position, double cosTheta)
static int position[264][3]
Definition: ReadPGInfo.cc:509
step
static const double X0
void leaveDetector(const G4VPhysicalVolume *volume, double cosTheta)
bool isSelectedFast(const G4TouchableHistory *touch)
std::tuple< const G4VPhysicalVolume *, int > GetSensitiveVolume(const G4VTouchable *touchable)
void TrackingMaterialProducer::update ( const EndOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 257 of file TrackingMaterialProducer.cc.

References HiIsolationCommonParameters_cff::track.

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

258 {
259  const G4Track * track = (*event)();
260  if (m_primaryTracks and track->GetParentID() != 0)
261  return;
262 
263  radLen_vs_eta_->Fill(track->GetMomentum().eta(), m_track.summary().radiationLengths());
264  m_tracks->push_back(m_track);
265 
266  // LogInfo
267  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: this track took "
268  << m_track.steps().size()
269  << " steps, and passed through "
270  << m_track.detectors().size()
271  << " sensitive detectors" << std::endl;
272  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: track length: "
273  << m_track.summary().length()
274  << " cm" << std::endl;
275  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: radiation lengths: "
276  << m_track.summary().radiationLengths() << std::endl;
277  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: energy loss: "
278  << m_track.summary().energyLoss()
279  << " MeV" << std::endl;
280 }
const std::vector< MaterialAccountingDetector > & detectors() const
const std::vector< MaterialAccountingStep > & steps() const
MaterialAccountingTrack m_track
double length(void) const
double radiationLengths(void) const
double energyLoss(void) const
std::vector< MaterialAccountingTrack > * m_tracks
const MaterialAccountingStep & summary() const
void TrackingMaterialProducer::update ( const EndOfJob *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfJob * >.

Definition at line 103 of file TrackingMaterialProducer.cc.

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

104 {
105  radLen_vs_eta_->Write();
106  output_file_->Close();
107 }

Member Data Documentation

bool TrackingMaterialProducer::m_primaryTracks
private

Definition at line 55 of file TrackingMaterialProducer.h.

std::vector<std::string> TrackingMaterialProducer::m_selectedNames
private

Definition at line 56 of file TrackingMaterialProducer.h.

std::vector<const G4LogicalVolume *> TrackingMaterialProducer::m_selectedVolumes
private

Definition at line 57 of file TrackingMaterialProducer.h.

MaterialAccountingTrack TrackingMaterialProducer::m_track
private

Definition at line 58 of file TrackingMaterialProducer.h.

std::vector<MaterialAccountingTrack>* TrackingMaterialProducer::m_tracks
private

Definition at line 59 of file TrackingMaterialProducer.h.

TFile* TrackingMaterialProducer::output_file_
private

Definition at line 60 of file TrackingMaterialProducer.h.

TProfile* TrackingMaterialProducer::radLen_vs_eta_
private

Definition at line 61 of file TrackingMaterialProducer.h.