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 32 of file TrackingMaterialProducer.h.

Constructor & Destructor Documentation

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

Definition at line 80 of file TrackingMaterialProducer.cc.

References edm::ParameterSet::getParameter().

80  {
81  edm::ParameterSet config = iPSet.getParameter<edm::ParameterSet>("TrackingMaterialProducer");
82  m_selectedNames = config.getParameter<std::vector<std::string> >("SelectedVolumes");
83  m_primaryTracks = config.getParameter<bool>("PrimaryTracksOnly");
84  m_tracks = nullptr;
85 
86  produces<std::vector<MaterialAccountingTrack> >();
87  output_file_ = new TFile("radLen_vs_eta_fromProducer.root", "RECREATE");
88  output_file_->cd();
89  radLen_vs_eta_ = new TProfile("radLen", "radLen", 250., -5., 5., 0, 10.);
90 }
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 93 of file TrackingMaterialProducer.cc.

93 {}

Member Function Documentation

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

Definition at line 262 of file TrackingMaterialProducer.cc.

References DEFINE_SIMWATCHER, mps_fire::i, and or.

262  {
263  for (size_t i = 0; i < m_selectedVolumes.size(); ++i)
264  if (m_selectedVolumes[i]->IsAncestor(touchable->GetVolume()) or
265  m_selectedVolumes[i] == touchable->GetVolume()->GetLogicalVolume())
266  return true;
267 
268  return false;
269 }
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
std::vector< const G4LogicalVolume * > m_selectedVolumes
bool TrackingMaterialProducer::isSelectedFast ( const G4TouchableHistory *  touch)
private

Definition at line 135 of file TrackingMaterialProducer.cc.

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

135  {
136  for (int d = touchable->GetHistoryDepth() - 1; d >= 0; --d) {
137  if (std::find(m_selectedNames.begin(), m_selectedNames.end(), touchable->GetVolume(d)->GetName()) !=
138  m_selectedNames.end())
139  return true;
140  }
141  return false;
142 }
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 254 of file TrackingMaterialProducer.cc.

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

254  {
255  // transfer ownership to the Event
256  std::unique_ptr<std::vector<MaterialAccountingTrack> > tracks(m_tracks);
257  iEvent.put(std::move(tracks));
258  m_tracks = nullptr;
259 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
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 101 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().

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

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

120  {
121  m_tracks = new std::vector<MaterialAccountingTrack>();
122 }
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 125 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().

125  {
126  m_track.reset();
127 
128  // prevent secondary tracks from propagating
129  G4Track* track = const_cast<G4Track*>((*event)());
130  if (m_primaryTracks and track->GetParentID() != 0) {
131  track->SetTrackStatus(fStopAndKill);
132  }
133 }
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 145 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().

145  {
146  const G4TouchableHistory* touchable = static_cast<const G4TouchableHistory*>(step->GetTrack()->GetTouchable());
147  if (not isSelectedFast(touchable)) {
148  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer:\t[...] skipping "
149  << touchable->GetVolume()->GetName() << std::endl;
150  return;
151  }
152 
153  // material and step proterties
154  const G4Material* material = touchable->GetVolume()->GetLogicalVolume()->GetMaterial();
155  double length = step->GetStepLength() / cm; // mm -> cm
156  double X0 = material->GetRadlen() / cm; // mm -> cm
157  double Ne = material->GetElectronDensity() * cm3; // 1/mm3 -> 1/cm3
158  double Xi = Ne / 6.0221415e23 * 0.307075 / 2; // MeV / cm
159  double radiationLengths = length / X0; //
160  double energyLoss = length * Xi / 1000.; // GeV
161  //double energyLoss = step->GetDeltaEnergy()/MeV; should we use this??
162 
163  G4ThreeVector globalPosPre = step->GetPreStepPoint()->GetPosition();
164  G4ThreeVector globalPosPost = step->GetPostStepPoint()->GetPosition();
165  GlobalPoint globalPositionIn(globalPosPre.x() / cm, globalPosPre.y() / cm, globalPosPre.z() / cm); // mm -> cm
166  GlobalPoint globalPositionOut(globalPosPost.x() / cm, globalPosPost.y() / cm, globalPosPost.z() / cm); // mm -> cm
167 
168  // check for a sensitive detector
169  bool enter_sensitive = false;
170  bool leave_sensitive = false;
171  double cosThetaPre = 0.0;
172  double cosThetaPost = 0.0;
173  int level = 0;
174  const G4VPhysicalVolume* sensitive = nullptr;
176  std::tie(sensitive, level) = GetSensitiveVolume(touchable);
177  if (sensitive) {
178  const G4VSolid& solid = *touchable->GetSolid(level);
179  const G4AffineTransform& transform = GetTransform(touchable, level);
180  G4ThreeVector pos = transform.Inverse().TransformPoint(G4ThreeVector(0., 0., 0.));
181  position = GlobalPoint(pos.x() / cm, pos.y() / cm, pos.z() / cm); // mm -> cm
182 
183  G4ThreeVector localPosPre = transform.TransformPoint(globalPosPre);
184  EInside statusPre = solid.Inside(localPosPre);
185  if (statusPre == kSurface) {
186  enter_sensitive = true;
187  G4ThreeVector globalDirPre = step->GetPreStepPoint()->GetMomentumDirection();
188  G4ThreeVector localDirPre = transform.TransformAxis(globalDirPre);
189  G4ThreeVector normalPre = solid.SurfaceNormal(localPosPre);
190  cosThetaPre = normalPre.cosTheta(-localDirPre);
191  }
192 
193  G4ThreeVector localPosPost = transform.TransformPoint(globalPosPost);
194  EInside statusPost = solid.Inside(localPosPost);
195  if (statusPost == kSurface) {
196  leave_sensitive = true;
197  G4ThreeVector globalDirPost = step->GetPostStepPoint()->GetMomentumDirection();
198  G4ThreeVector localDirPost = transform.TransformAxis(globalDirPost);
199  G4ThreeVector normalPost = solid.SurfaceNormal(localPosPost);
200  cosThetaPost = normalPost.cosTheta(localDirPost);
201  }
202  }
203 
204  // update track accounting
205  if (enter_sensitive)
206  m_track.enterDetector(sensitive, position, cosThetaPre);
207  m_track.step(MaterialAccountingStep(length, radiationLengths, energyLoss, globalPositionIn, globalPositionOut));
208  if (leave_sensitive)
209  m_track.leaveDetector(sensitive, cosThetaPost);
210 
211  if (sensitive)
212  LogInfo("TrackingMaterialProducer") << "Track was near sensitive volume " << sensitive->GetName() << std::endl;
213  else
214  LogInfo("TrackingMaterialProducer") << "Track was near non-sensitive volume " << touchable->GetVolume()->GetName()
215  << std::endl;
216  LogInfo("TrackingMaterialProducer") << "Step length: " << length << " cm\n"
217  << "globalPreStep(r,z): (" << globalPositionIn.perp() << ", "
218  << globalPositionIn.z() << ") cm\n"
219  << "globalPostStep(r,z): (" << globalPositionOut.perp() << ", "
220  << globalPositionOut.z() << ") cm\n"
221  << "position(r,z): (" << position.perp() << ", " << position.z() << ") cm\n"
222  << "Radiation lengths: " << radiationLengths << " \t\t(X0: " << X0
223  << " cm)\n"
224  << "Energy loss: " << energyLoss << " MeV \t(Xi: " << Xi
225  << " MeV/cm)\n"
226  << "Track was " << (enter_sensitive ? "entering " : "in none ")
227  << "sensitive volume\n"
228  << "Track was " << (leave_sensitive ? "leaving " : "in none ")
229  << "sensitive volume\n";
230 }
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
Definition: StallMonitor.cc:94
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 233 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().

233  {
234  const G4Track* track = (*event)();
235  if (m_primaryTracks and track->GetParentID() != 0)
236  return;
237 
238  radLen_vs_eta_->Fill(track->GetMomentum().eta(), m_track.summary().radiationLengths());
239  m_tracks->push_back(m_track);
240 
241  // LogInfo
242  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: this track took " << m_track.steps().size()
243  << " steps, and passed through " << m_track.detectors().size()
244  << " sensitive detectors" << std::endl;
245  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: track length: " << m_track.summary().length()
246  << " cm" << std::endl;
247  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: radiation lengths: "
248  << m_track.summary().radiationLengths() << std::endl;
249  LogInfo("TrackingMaterialProducer") << "TrackingMaterialProducer: energy loss: "
250  << m_track.summary().energyLoss() << " MeV" << std::endl;
251 }
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 96 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().

96  {
97  radLen_vs_eta_->Write();
98  output_file_->Close();
99 }

Member Data Documentation

bool TrackingMaterialProducer::m_primaryTracks
private

Definition at line 56 of file TrackingMaterialProducer.h.

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

Definition at line 57 of file TrackingMaterialProducer.h.

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

Definition at line 58 of file TrackingMaterialProducer.h.

MaterialAccountingTrack TrackingMaterialProducer::m_track
private

Definition at line 59 of file TrackingMaterialProducer.h.

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

Definition at line 60 of file TrackingMaterialProducer.h.

TFile* TrackingMaterialProducer::output_file_
private

Definition at line 61 of file TrackingMaterialProducer.h.

TProfile* TrackingMaterialProducer::radLen_vs_eta_
private

Definition at line 62 of file TrackingMaterialProducer.h.