CMS 3D CMS Logo

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

#include <MaterialBudgetAction.h>

Inheritance diagram for MaterialBudgetAction:
SimWatcher Observer< const BeginOfRun * > Observer< const BeginOfTrack * > Observer< const G4Step * > Observer< const EndOfTrack * > Observer< const EndOfRun * >

Public Member Functions

 MaterialBudgetAction (const edm::ParameterSet &)
 
 ~MaterialBudgetAction () override
 
- Public Member Functions inherited from SimWatcher
 SimWatcher ()
 
virtual ~SimWatcher ()
 
- Public Member Functions inherited from Observer< const BeginOfRun * >
 Observer ()
 
void slotForUpdate (const BeginOfRun * 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 ()
 
- Public Member Functions inherited from Observer< const EndOfRun * >
 Observer ()
 
void slotForUpdate (const EndOfRun * iT)
 
virtual ~Observer ()
 

Private Member Functions

bool CheckTouchableInSelectedVolumes (const G4VTouchable *touch)
 
std::string getPartName (G4StepPoint *aStepPoint)
 
std::string getSubDetectorName (G4StepPoint *aStepPoint)
 
 MaterialBudgetAction (const MaterialBudgetAction &)
 
const MaterialBudgetActionoperator= (const MaterialBudgetAction &)
 
void save (const G4Step *aStep)
 
bool StopAfterProcess (const G4Step *aStep)
 
void update (const BeginOfRun *) 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 EndOfRun *) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

double Ekin
 
bool firstParticle
 
bool saveToHistos
 
bool saveToTree
 
bool saveToTxt
 
bool storeDecay
 
std::shared_ptr< MaterialBudgetDatatheData
 
std::string theHistoList
 
std::shared_ptr< TestHistoMgrtheHistoMgr
 
std::shared_ptr< MaterialBudgetFormattheHistos
 
G4String theProcessToStop
 
std::shared_ptr< MaterialBudgetTreetheTree
 
std::shared_ptr< MaterialBudgetTxttheTxt
 
std::vector< G4String > theVolumeList
 

Additional Inherited Members

Detailed Description

Definition at line 32 of file MaterialBudgetAction.h.

Constructor & Destructor Documentation

MaterialBudgetAction::MaterialBudgetAction ( const edm::ParameterSet iPSet)

Definition at line 32 of file MaterialBudgetAction.cc.

References Ekin, firstParticle, edm::ParameterSet::getParameter(), LogDebug, saveToHistos, saveToTree, saveToTxt, storeDecay, AlCaHLTBitMon_QueryRunRegistry::string, theData, theHistoList, theHistoMgr, theHistos, theProcessToStop, theTree, theTxt, and theVolumeList.

33 {
34  theData = std::make_shared<MaterialBudgetData>();
35 
36  edm::ParameterSet m_Anal = iPSet.getParameter<edm::ParameterSet>("MaterialBudgetAction");
37 
38  //---- Accumulate material budget only inside selected volumes
39  std::string theHistoList = m_Anal.getParameter<std::string>("HistogramList");
40  std::vector<std::string> volList = m_Anal.getParameter< std::vector<std::string> >("SelectedVolumes");
41 
42  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: List of the selected volumes:";
43  for( const auto& it : volList) {
44  if( it != "None" ) {
45  theVolumeList.push_back(it);
46  edm::LogInfo("MaterialBudget") << it ;
47  }
48  }
49 
50  // log
51  if(theHistoList == "Tracker" ) {
52  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: running in Tracker Mode";
53  }
54  else if(theHistoList == "ECAL" ) {
55  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: running in Ecal Mode";
56  }
57  else if(theHistoList == "HGCal" ) {
58  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: running in HGCal Mode";
59  }
60  else {
61  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: running in General Mode";
62  }
63 
64  //---- Stop track when a process occurs
65  theProcessToStop = m_Anal.getParameter<std::string>("StopAfterProcess");
66  LogDebug("MaterialBudget") << "MaterialBudgetAction: stop at process " << theProcessToStop;
67 
68  //---- Save histos to ROOT file
69  std::string saveToHistosFile = m_Anal.getParameter<std::string>("HistosFile");
70  if( saveToHistosFile != "None" ) {
71  saveToHistos = true;
72  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: saving histograms to " << saveToHistosFile;
73  theHistoMgr = std::make_shared<TestHistoMgr>();
74  if(theHistoList == "Tracker" ) {
75  theHistos = std::make_shared<MaterialBudgetTrackerHistos>(theData, theHistoMgr, saveToHistosFile);
76  }
77  else if (theHistoList == "ECAL") {
78  theHistos = std::make_shared<MaterialBudgetEcalHistos>(theData, theHistoMgr, saveToHistosFile);
79  }
80  else if (theHistoList == "HGCal") {
81  theHistos = std::make_shared<MaterialBudgetHGCalHistos>( theData, theHistoMgr, saveToHistosFile );
82  //In HGCal mode, so tell data class
83  theData->setHGCalmode(true);
84  }
85  else {
86  theHistos = std::make_shared<MaterialBudgetHistos>( theData, theHistoMgr, saveToHistosFile );
87  }
88  } else {
89  edm::LogWarning("MaterialBudget") << "MaterialBudgetAction: No histograms file specified";
90  saveToHistos = false;
91  }
92 
93  //---- Save material budget info to TEXT file
94  std::string saveToTxtFile = m_Anal.getParameter<std::string>("TextFile");
95  if( saveToTxtFile != "None" ) {
96  saveToTxt = true;
97  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: saving text info to " << saveToTxtFile;
98  theTxt = std::make_shared<MaterialBudgetTxt>( theData, saveToTxtFile );
99  } else {
100  saveToTxt = false;
101  }
102 
103  //---- Compute all the steps even if not stored on file
104  bool allSteps = m_Anal.getParameter<bool>("AllStepsToTree");
105  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: all steps are computed " << allSteps;
106  if( allSteps ) theData->SetAllStepsToTree();
107 
108  //---- Save tree to ROOT file
109  std::string saveToTreeFile = m_Anal.getParameter<std::string>("TreeFile");
110  if( saveToTreeFile != "None" ) {
111  saveToTree = true;
112  theTree = std::make_shared<MaterialBudgetTree>( theData, saveToTreeFile );
113  } else {
114  saveToTree = false;
115  }
116  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: saving ROOT TTree to " << saveToTreeFile;
117 
118  //---- Track the first decay products of the main particle
119  // if their kinetic energy is greater than Ekin
120  storeDecay = m_Anal.getUntrackedParameter<bool>("storeDecay",false);
121  Ekin = m_Anal.getUntrackedParameter<double>("EminDecayProd",1000.0); // MeV
122  edm::LogInfo("MaterialBudget") << "MaterialBudgetAction: decay products steps are stored ("
123  << storeDecay << ") if their kinetic energy is greater than "
124  << Ekin << " MeV";
125  firstParticle = false;
126 }
#define LogDebug(id)
T getParameter(std::string const &) const
std::shared_ptr< MaterialBudgetFormat > theHistos
std::shared_ptr< TestHistoMgr > theHistoMgr
std::shared_ptr< MaterialBudgetTxt > theTxt
std::shared_ptr< MaterialBudgetTree > theTree
std::vector< G4String > theVolumeList
std::shared_ptr< MaterialBudgetData > theData
MaterialBudgetAction::~MaterialBudgetAction ( )
override

Definition at line 130 of file MaterialBudgetAction.cc.

131 {
132 }
MaterialBudgetAction::MaterialBudgetAction ( const MaterialBudgetAction )
private

Member Function Documentation

bool MaterialBudgetAction::CheckTouchableInSelectedVolumes ( const G4VTouchable *  touch)
private

Definition at line 312 of file MaterialBudgetAction.cc.

References spr::find(), cuy::ii, and theVolumeList.

Referenced by update().

313 {
314  size_t volh = touch->GetHistoryDepth();
315  for( int ii = volh; ii >= 0; ii-- ){
316  if (
317  std::find(theVolumeList.begin(),
318  theVolumeList.end(),
319  touch->GetVolume(ii)->GetName()) != theVolumeList.end() )
320  return true;
321  }
322  return false;
323 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
ii
Definition: cuy.py:590
std::vector< G4String > theVolumeList
std::string MaterialBudgetAction::getPartName ( G4StepPoint *  aStepPoint)
private

Definition at line 274 of file MaterialBudgetAction.cc.

275 {
276  const G4TouchableHistory* theTouchable
277  = (const G4TouchableHistory*)(aStepPoint->GetTouchable());
278  G4int num_levels = theTouchable->GetHistoryDepth();
279 
280  if( theTouchable->GetVolume() ) {
281  return theTouchable->GetVolume(num_levels-3)->GetName();
282  } else {
283  return "OutOfWorld";
284  }
285 }
std::string MaterialBudgetAction::getSubDetectorName ( G4StepPoint *  aStepPoint)
private

Definition at line 259 of file MaterialBudgetAction.cc.

260 {
261  const G4TouchableHistory* theTouchable
262  = (const G4TouchableHistory*)(aStepPoint->GetTouchable());
263  G4int num_levels = theTouchable->GetHistoryDepth();
264 
265  if( theTouchable->GetVolume() ) {
266  return theTouchable->GetVolume(num_levels-1)->GetName();
267  } else {
268  return "OutOfWorld";
269  }
270 }
const MaterialBudgetAction& MaterialBudgetAction::operator= ( const MaterialBudgetAction )
private
void MaterialBudgetAction::save ( const G4Step *  aStep)
private
bool MaterialBudgetAction::StopAfterProcess ( const G4Step *  aStep)
private

Definition at line 326 of file MaterialBudgetAction.cc.

References theProcessToStop.

Referenced by update().

327 {
328  if( theProcessToStop.empty() ) return false;
329 
330  if( aStep->GetPostStepPoint()->GetProcessDefinedStep() == nullptr) return false;
331  if( aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == theProcessToStop ) {
332  edm::LogInfo("MaterialBudget" )<< "MaterialBudgetAction :"
333  << aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
334  return true;
335  } else {
336  return false;
337  }
338 }
void MaterialBudgetAction::update ( const BeginOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 135 of file MaterialBudgetAction.cc.

References cuy::ii, findQualityFiles::jj, theProcessToStop, and theVolumeList.

Referenced by 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(), 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  //----- Check that selected volumes are indeed part of the geometry
138  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
139 
140  for(const auto& volcite: theVolumeList) {
141  bool volFound = false;
142  for(const auto& lvcite: *lvs) {
143  if( lvcite->GetName() == volcite ) {
144  volFound = true;
145  break;
146  }
147  }
148  if( !volFound ) {
149  edm::LogWarning("MaterialBudget") << "MaterialBudgetAction: selected volume not found in geometry " << volcite;
150  }
151  }
152 
153 
154  //----- Check process selected is one of the available ones
155  bool procFound = false;
156  if( theProcessToStop == "None" ) {
157  procFound = true;
158  } else {
159  G4ParticleTable * partTable = G4ParticleTable::GetParticleTable();
160  int siz = partTable->size();
161  for (int ii= 0; ii < siz; ii++) {
162  G4ParticleDefinition * particle = partTable->GetParticle(ii);
163 
164  //--- All processes of this particle
165  G4ProcessManager * pmanager = particle->GetProcessManager();
166  G4ProcessVector * pvect = pmanager->GetProcessList();
167  int sizproc = pvect->size();
168  for (int jj = 0; jj < sizproc; jj++) {
169  if( (*pvect)[jj]->GetProcessName() == theProcessToStop ) {
170  procFound = true;
171  break;
172  }
173  }
174  }
175  }
176 
177  if( !procFound ) {
178  edm::LogWarning("MaterialBudget") << "MaterialBudgetAction: selected process to stop tracking not found " << theProcessToStop;
179  }
180 }
ii
Definition: cuy.py:590
std::vector< G4String > theVolumeList
void MaterialBudgetAction::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 183 of file MaterialBudgetAction.cc.

References Ekin, firstParticle, LogDebug, saveToHistos, saveToTree, saveToTxt, storeDecay, theData, theHistos, theTree, and theTxt.

Referenced by 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(), 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().

184 {
185  const G4Track * aTrack = (*trk)(); // recover G4 pointer if wanted
186 
187  // that was a temporary action while we're sorting out
188  // about # of secondaries (produced if CutsPerRegion=true)
189 
190  LogDebug("MaterialBudget") << "MaterialBudgetAction: Track ID " << aTrack->GetTrackID()
191  << "Track parent ID " << aTrack->GetParentID()
192  << "PDG Id. = " << aTrack->GetDefinition()->GetPDGEncoding()
193  << "Ekin = " << aTrack->GetKineticEnergy() << " MeV";
194 
195  if( aTrack->GetCreatorProcess() )
196  LogDebug("MaterialBudget") << "MaterialBudgetAction: produced through " << aTrack->GetCreatorProcess()->GetProcessType();
197 
198  if(aTrack->GetTrackID() == 1) {
199  firstParticle = true;
200  } else {
201  firstParticle = false;
202  }
203 
204  if( storeDecay ) { // if record of the decay is requested
205  if( aTrack->GetCreatorProcess() ) {
206  if (
207  aTrack->GetParentID() == 1
208  &&
209  // aTrack->GetCreatorProcess()->GetProcessType() == 6
210  // &&
211  aTrack->GetKineticEnergy() > Ekin
212  ) {
213  // continue
214  } else {
215  G4Track * aTracknc = const_cast<G4Track*>(aTrack);
216  aTracknc->SetTrackStatus(fStopAndKill);
217  return;
218  }
219  } // particles produced from a decay (type=6) of the main particle (ID=1) with Kinetic Energy [MeV] > Ekin
220  } else { // kill all the other particles (take only the main one until it disappears) if decay not stored
221  if( aTrack->GetParentID() != 0) {
222  G4Track * aTracknc = const_cast<G4Track*>(aTrack);
223  aTracknc->SetTrackStatus(fStopAndKill);
224  return;
225  }
226  }
227 
228  theData->dataStartTrack( aTrack );
229 
230  if (saveToTree) theTree->fillStartTrack();
231  if (saveToHistos) theHistos->fillStartTrack();
232  if (saveToTxt) theTxt->fillStartTrack();
233 }
#define LogDebug(id)
std::shared_ptr< MaterialBudgetFormat > theHistos
std::shared_ptr< MaterialBudgetTxt > theTxt
std::shared_ptr< MaterialBudgetTree > theTree
std::shared_ptr< MaterialBudgetData > theData
void MaterialBudgetAction::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 236 of file MaterialBudgetAction.cc.

References CheckTouchableInSelectedVolumes(), saveToHistos, saveToTree, saveToTxt, StopAfterProcess(), theData, theHistos, theTree, theTxt, theVolumeList, and HiIsolationCommonParameters_cff::track.

Referenced by 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(), 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().

237 {
238  //----- Check it is inside one of the volumes selected
239  if( !theVolumeList.empty() ) {
240  if( !CheckTouchableInSelectedVolumes( aStep->GetTrack()->GetTouchable() ) ) return;
241  }
242 
243  //---------- each step
244  theData->dataPerStep( aStep );
245  if (saveToTree) theTree->fillPerStep();
246  if (saveToHistos) theHistos->fillPerStep();
247  if (saveToTxt) theTxt->fillPerStep();
248 
249  //----- Stop tracking after selected process
250  if( StopAfterProcess( aStep ) ) {
251  G4Track* track = aStep->GetTrack();
252  track->SetTrackStatus( fStopAndKill );
253  }
254 
255  return;
256 }
bool CheckTouchableInSelectedVolumes(const G4VTouchable *touch)
std::shared_ptr< MaterialBudgetFormat > theHistos
std::shared_ptr< MaterialBudgetTxt > theTxt
std::shared_ptr< MaterialBudgetTree > theTree
bool StopAfterProcess(const G4Step *aStep)
std::vector< G4String > theVolumeList
std::shared_ptr< MaterialBudgetData > theData
void MaterialBudgetAction::update ( const EndOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 288 of file MaterialBudgetAction.cc.

References saveToHistos, saveToTree, saveToTxt, theData, theHistos, theTree, and theTxt.

Referenced by 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(), 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().

289 {
290  const G4Track * aTrack = (*trk)(); // recover G4 pointer if wanted
291  theData->dataEndTrack( aTrack );
292 
293  if (saveToTree) theTree->fillEndTrack();
294  if (saveToHistos) theHistos->fillEndTrack();
295  if (saveToTxt) theTxt->fillEndTrack();
296 }
std::shared_ptr< MaterialBudgetFormat > theHistos
std::shared_ptr< MaterialBudgetTxt > theTxt
std::shared_ptr< MaterialBudgetTree > theTree
std::shared_ptr< MaterialBudgetData > theData
void MaterialBudgetAction::update ( const EndOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

Definition at line 299 of file MaterialBudgetAction.cc.

References saveToHistos, saveToTree, saveToTxt, theHistos, and theTree.

Referenced by 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(), 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().

300 {
301  // endOfRun calls TestHistoMgr::save() allowing to write
302  // the ROOT files containing the histograms
303 
304  if (saveToHistos) theHistos->endOfRun();
305  if (saveToTxt) theHistos->endOfRun();
306  if (saveToTree) theTree->endOfRun();
307 
308  return;
309 }
std::shared_ptr< MaterialBudgetFormat > theHistos
std::shared_ptr< MaterialBudgetTree > theTree

Member Data Documentation

double MaterialBudgetAction::Ekin
private

Definition at line 69 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::firstParticle
private

Definition at line 70 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::saveToHistos
private

Definition at line 67 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::saveToTree
private

Definition at line 67 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::saveToTxt
private

Definition at line 67 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::storeDecay
private

Definition at line 68 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

std::shared_ptr<MaterialBudgetData> MaterialBudgetAction::theData
private

Definition at line 61 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

std::string MaterialBudgetAction::theHistoList
private

Definition at line 74 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction().

std::shared_ptr<TestHistoMgr> MaterialBudgetAction::theHistoMgr
private

Definition at line 65 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction().

std::shared_ptr<MaterialBudgetFormat> MaterialBudgetAction::theHistos
private

Definition at line 63 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

G4String MaterialBudgetAction::theProcessToStop
private

Definition at line 73 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), StopAfterProcess(), and update().

std::shared_ptr<MaterialBudgetTree> MaterialBudgetAction::theTree
private

Definition at line 62 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

std::shared_ptr<MaterialBudgetTxt> MaterialBudgetAction::theTxt
private

Definition at line 64 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

std::vector<G4String> MaterialBudgetAction::theVolumeList
private