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 Member Functions | Private Attributes
MaterialBudgetAction Class Reference

#include <MaterialBudgetAction.h>

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

Public Member Functions

 MaterialBudgetAction (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~MaterialBudgetAction ()
 
- 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 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 EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent *iT)
 
virtual ~Observer ()
 

Private Member Functions

bool CheckTouchableInSelectedVolumes (const G4VTouchable *touch)
 
void endRun ()
 
std::string getPartName (G4StepPoint *aStepPoint)
 
std::string getSubDetectorName (G4StepPoint *aStepPoint)
 
void initRun ()
 
 MaterialBudgetAction (const MaterialBudgetAction &)
 
const MaterialBudgetActionoperator= (const MaterialBudgetAction &)
 
void processEvent (unsigned int nEv)
 
void save (const G4Step *aStep)
 
bool StopAfterProcess (const G4Step *aStep)
 
void update (const BeginOfRun *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfEvent *)
 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
 
MaterialBudgetDatatheData
 
std::string theHistoList
 
TestHistoMgrtheHistoMgr
 
MaterialBudgetFormattheHistos
 
G4String theProcessToStop
 
MaterialBudgetTreetheTree
 
MaterialBudgetTxttheTxt
 
std::vector< G4String > theVolumeList
 

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 MaterialBudgetAction.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file MaterialBudgetAction.cc.

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

31  :
32  theHistoMgr(0)
33 {
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  std::vector<std::string>::const_iterator ite;
42  std::cout << "TestGeometry: List of the selected volumes: " << std::endl;
43  for( ite = volList.begin(); ite != volList.end(); ite++ ){
44  if( (*ite) != "None" ) {
45  theVolumeList.push_back( *ite );
46  std::cout << (*ite) << std::endl;
47  }
48  }
49  // log
50  if(theHistoList == "Tracker" ) {
51  std::cout << "TestGeometry: MaterialBudgetAction running in Tracker Mode" << std::endl;
52  }
53  else if(theHistoList == "ECAL" ) {
54  std::cout << "TestGeometry: MaterialBudgetAction running in Ecal Mode" << std::endl;
55  }
56  else {
57  std::cout << "TestGeometry: MaterialBudgetAction running in General Mode" << std::endl;
58  }
59  //
60 
61  //---- Stop track when a process occurs
62  theProcessToStop = m_Anal.getParameter<std::string>("StopAfterProcess");
63  std::cout << "TestGeometry: stop at process " << theProcessToStop << std::endl;
64 
65  //---- Save histos to ROOT file
66  std::string saveToHistosFile = m_Anal.getParameter<std::string>("HistosFile");
67  if( saveToHistosFile != "None" ) {
68  saveToHistos = true;
69  std::cout << "TestGeometry: saving histograms to " << saveToHistosFile << std::endl;
70  theHistoMgr = new TestHistoMgr();
71 
72  // rr
73  if(theHistoList == "Tracker" ) {
74  theHistos = new MaterialBudgetTrackerHistos( theData, theHistoMgr, saveToHistosFile );
75  }
76  else if (theHistoList == "ECAL") {
77  theHistos = new MaterialBudgetEcalHistos( theData, theHistoMgr, saveToHistosFile );
78  }
79  else {
80  theHistos = new MaterialBudgetHistos( theData, theHistoMgr, saveToHistosFile );
81  }
82  // rr
83  } else {
84  saveToHistos = false;
85  }
86 
87  //---- Save material budget info to TEXT file
88  std::string saveToTxtFile = m_Anal.getParameter<std::string>("TextFile");
89  if( saveToTxtFile != "None" ) {
90  saveToTxt = true;
91  std::cout << "TestGeometry: saving text info to " << saveToTxtFile << std::endl;
92  theTxt = new MaterialBudgetTxt( theData, saveToTxtFile );
93  } else {
94  saveToTxt = false;
95  }
96 
97  //---- Compute all the steps even if not stored on file
98  bool allSteps = m_Anal.getParameter<bool>("AllStepsToTree");
99  std::cout << "TestGeometry: all steps are computed " << allSteps << std::endl;
100  if( allSteps ) theData->SetAllStepsToTree();
101 
102  //---- Save tree to ROOT file
103  std::string saveToTreeFile = m_Anal.getParameter<std::string>("TreeFile");
104  // std::string saveToTreeFile = "";
105  if( saveToTreeFile != "None" ) {
106  saveToTree = true;
107  theTree = new MaterialBudgetTree( theData, saveToTreeFile );
108  } else {
109  saveToTree = false;
110  }
111  std::cout << "TestGeometry: saving ROOT TREE to " << saveToTreeFile << std::endl;
112 
113  //---- Track the first decay products of the main particle
114  // if their kinetic energy is greater than Ekin
115  storeDecay = m_Anal.getUntrackedParameter<bool>("storeDecay",false);
116  Ekin = m_Anal.getUntrackedParameter<double>("EminDecayProd",1000.0); // MeV
117  std::cout << "TestGeometry: decay products steps are stored " << storeDecay;
118  if(storeDecay) std::cout << " if their kinetic energy is greater than " << Ekin << " MeV";
119  std::cout << std::endl;
120  firstParticle = false;
121  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MaterialBudgetTxt * theTxt
MaterialBudgetFormat * theHistos
MaterialBudgetData * theData
tuple cout
Definition: gather_cfg.py:121
std::vector< G4String > theVolumeList
MaterialBudgetTree * theTree
MaterialBudgetAction::~MaterialBudgetAction ( )
virtual

Definition at line 125 of file MaterialBudgetAction.cc.

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

126 {
127  if (saveToTxt) delete theTxt;
128  if (saveToTree) delete theTree;
129  if (saveToHistos) delete theHistos;
130  if (theHistoMgr) delete theHistoMgr;
131  delete theData;
132 }
MaterialBudgetTxt * theTxt
MaterialBudgetFormat * theHistos
MaterialBudgetData * theData
MaterialBudgetTree * theTree
MaterialBudgetAction::MaterialBudgetAction ( const MaterialBudgetAction )
private

Member Function Documentation

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

Definition at line 337 of file MaterialBudgetAction.cc.

References cuy::ii, and theVolumeList.

Referenced by update().

338 {
339  std::vector<G4String>::const_iterator ite;
340  size_t volh = touch->GetHistoryDepth();
341  for( ite = theVolumeList.begin(); ite != theVolumeList.end(); ite++ ){
342  //- std::cout << " CheckTouchableInSelectedVolumes vol " << *ite << std::endl;
343  for( int ii = volh; ii >= 0; ii-- ){
344  //- std::cout << ii << " CheckTouchableInSelectedVolumes parent " << touch->GetVolume(ii)->GetName() << std::endl;
345  if( touch->GetVolume(ii)->GetName() == *ite ) return true;
346  }
347  }
348 
349  return false;
350 
351 }
int ii
Definition: cuy.py:588
std::vector< G4String > theVolumeList
void MaterialBudgetAction::endRun ( void  )
private

Definition at line 331 of file MaterialBudgetAction.cc.

332 {
333 }
std::string MaterialBudgetAction::getPartName ( G4StepPoint *  aStepPoint)
private

Definition at line 294 of file MaterialBudgetAction.cc.

295 {
296  G4TouchableHistory* theTouchable
297  = (G4TouchableHistory*)(aStepPoint->GetTouchable());
298  G4int num_levels = theTouchable->GetHistoryDepth();
299  // theTouchable->MoveUpHistory(num_levels-3);
300 
301  if( theTouchable->GetVolume() ) {
302  return theTouchable->GetVolume(num_levels-3)->GetName();
303  } else {
304  return "OutOfWorld";
305  }
306 }
std::string MaterialBudgetAction::getSubDetectorName ( G4StepPoint *  aStepPoint)
private

Definition at line 279 of file MaterialBudgetAction.cc.

280 {
281  G4TouchableHistory* theTouchable
282  = (G4TouchableHistory*)(aStepPoint->GetTouchable());
283  G4int num_levels = theTouchable->GetHistoryDepth();
284 
285  if( theTouchable->GetVolume() ) {
286  return theTouchable->GetVolume(num_levels-1)->GetName();
287  } else {
288  return "OutOfWorld";
289  }
290 }
void MaterialBudgetAction::initRun ( )
private
const MaterialBudgetAction& MaterialBudgetAction::operator= ( const MaterialBudgetAction )
private
void MaterialBudgetAction::processEvent ( unsigned int  nEv)
private
void MaterialBudgetAction::produce ( edm::Event e,
const edm::EventSetup  
)
virtual

Implements SimProducer.

Definition at line 136 of file MaterialBudgetAction.cc.

137 {
138 }
void MaterialBudgetAction::save ( const G4Step *  aStep)
private
bool MaterialBudgetAction::StopAfterProcess ( const G4Step *  aStep)
private

Definition at line 355 of file MaterialBudgetAction.cc.

References gather_cfg::cout, NULL, and theProcessToStop.

Referenced by update().

356 {
357  if( theProcessToStop == "" ) return false;
358 
359  if(aStep->GetPostStepPoint()->GetProcessDefinedStep() == NULL) return false;
360  if( aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == theProcessToStop ) {
361  std::cout << " MaterialBudgetAction::StopAfterProcess " << aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() << std::endl;
362  return true;
363  } else {
364  return false;
365  }
366 }
#define NULL
Definition: scimark2.h:8
tuple cout
Definition: gather_cfg.py:121
void MaterialBudgetAction::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 142 of file MaterialBudgetAction.cc.

References dtNoiseDBValidation_cfg::cerr, cuy::ii, findQualityFiles::jj, AlCaHLTBitMon_QueryRunRegistry::string, theProcessToStop, and theVolumeList.

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

143 {
144  //----- Check that selected volumes are indeed part of the geometry
145  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
146  std::vector<G4LogicalVolume*>::const_iterator lvcite;
147  std::vector<G4String>::const_iterator volcite;
148 
149  for( volcite = theVolumeList.begin(); volcite != theVolumeList.end(); volcite++ ){
150  //- std::cout << " MaterialBudgetAction checking volume " << *volcite << std::endl;
151  bool volFound = false;
152  for( lvcite = lvs->begin(); lvcite != lvs->end(); lvcite++ ) {
153  if( (*lvcite)->GetName() == *volcite ) {
154  volFound = true;
155  break;
156  }
157  }
158  if( !volFound ) {
159  std::cerr << " @@@@@@@ WARNING at MaterialBudgetAction: selected volume not found in geometry " << *volcite << std::endl;
160  }
161  }
162 
163 
164  //----- Check process selected is one of the available ones
165  bool procFound = false;
166  if( theProcessToStop == "None" ) {
167  procFound = true;
168  } else {
169  G4ParticleTable * partTable = G4ParticleTable::GetParticleTable();
170  int siz = partTable->size();
171  for (int ii= 0; ii < siz; ii++) {
172  G4ParticleDefinition * particle = partTable->GetParticle(ii);
173  std::string particleName = particle->GetParticleName();
174 
175  //--- All processes of this particle
176  G4ProcessManager * pmanager = particle->GetProcessManager();
177  G4ProcessVector * pvect = pmanager->GetProcessList();
178  int sizproc = pvect->size();
179  for (int jj = 0; jj < sizproc; jj++) {
180  if( (*pvect)[jj]->GetProcessName() == theProcessToStop ) {
181  procFound = true;
182  break;
183  }
184  }
185  }
186  }
187 
188  if( !procFound ) {
189  std::cerr << " @@@@@@@ WARNING at MaterialBudgetAction: selected process to stop tracking not found " << theProcessToStop << std::endl;
190  }
191 
192 }
int ii
Definition: cuy.py:588
std::vector< G4String > theVolumeList
void MaterialBudgetAction::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 196 of file MaterialBudgetAction.cc.

References gather_cfg::cout, MaterialBudgetData::dataStartTrack(), Ekin, MaterialBudgetFormat::fillStartTrack(), MaterialBudgetTxt::fillStartTrack(), MaterialBudgetTree::fillStartTrack(), firstParticle, saveToHistos, saveToTree, saveToTxt, storeDecay, theData, theHistos, theTree, and theTxt.

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

197 {
198  const G4Track * aTrack = (*trk)(); // recover G4 pointer if wanted
199 
200  // that was a temporary action while we're sorting out
201  // about # of secondaries (produced if CutsPerRegion=true)
202  //
203  std::cout << "Track ID " << aTrack->GetTrackID() << " Track parent ID " << aTrack->GetParentID()
204  << " PDG Id. = " << aTrack->GetDefinition()->GetPDGEncoding()
205  << " Ekin = " << aTrack->GetKineticEnergy() << " MeV" << std::endl;
206  if( aTrack->GetCreatorProcess() ) std::cout << " produced through " << aTrack->GetCreatorProcess()->GetProcessType() << std::endl;
207 
208  if(aTrack->GetTrackID() == 1) {
209  firstParticle = true;
210  } else {
211  firstParticle = false;
212  }
213 
214  if( storeDecay ) { // if record of the decay is requested
215  if( aTrack->GetCreatorProcess() ) {
216  if (
217  aTrack->GetParentID() == 1
218  &&
219  // aTrack->GetCreatorProcess()->GetProcessType() == 6
220  // &&
221  aTrack->GetKineticEnergy() > Ekin
222  ) {
223  // continue
224  } else {
225  G4Track * aTracknc = const_cast<G4Track*>(aTrack);
226  aTracknc->SetTrackStatus(fStopAndKill);
227  return;
228  }
229  } // particles produced from a decay (type=6) of the main particle (ID=1) with Kinetic Energy [MeV] > Ekin
230  } else { // kill all the other particles (take only the main one until it disappears) if decay not stored
231  if( aTrack->GetParentID() != 0) {
232  G4Track * aTracknc = const_cast<G4Track*>(aTrack);
233  aTracknc->SetTrackStatus(fStopAndKill);
234  return;
235  }
236  }
237 
238 
239  if(firstParticle) {
240  //--------- start of track
241  //- std::cout << " Data Start Track " << std::endl;
242  theData->dataStartTrack( aTrack );
246  }
247 }
MaterialBudgetTxt * theTxt
virtual void fillStartTrack()
virtual void fillStartTrack()=0
MaterialBudgetFormat * theHistos
MaterialBudgetData * theData
void dataStartTrack(const G4Track *aTrack)
tuple cout
Definition: gather_cfg.py:121
virtual void fillStartTrack()
MaterialBudgetTree * theTree
void MaterialBudgetAction::update ( const G4Step *  )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 251 of file MaterialBudgetAction.cc.

References CheckTouchableInSelectedVolumes(), MaterialBudgetData::dataPerStep(), MaterialBudgetFormat::fillPerStep(), MaterialBudgetTxt::fillPerStep(), MaterialBudgetTree::fillPerStep(), saveToHistos, saveToTree, saveToTxt, StopAfterProcess(), theData, theHistos, theTree, theTxt, and theVolumeList.

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

252 {
253 
254  //----- Check it is inside one of the volumes selected
255  if( theVolumeList.size() != 0 ) {
256  if( !CheckTouchableInSelectedVolumes( aStep->GetTrack()->GetTouchable() ) ) return;
257  }
258 
259  //---------- each step
260  theData->dataPerStep( aStep );
261  //- std::cout << " aStep->GetPostStepPoint()->GetTouchable() " << aStep->GetPostStepPoint()->GetTouchable()->GetVolume() << " " << aStep->GetPreStepPoint()->GetTouchable()->GetVolume() << std::endl;
264  if (saveToTxt) theTxt->fillPerStep();
265 
266 
267  //----- Stop tracking after selected process
268  if( StopAfterProcess( aStep ) ) {
269  G4Track* track = aStep->GetTrack();
270  track->SetTrackStatus( fStopAndKill );
271  }
272 
273  return;
274 
275 }
bool CheckTouchableInSelectedVolumes(const G4VTouchable *touch)
virtual void fillPerStep()
MaterialBudgetTxt * theTxt
MaterialBudgetFormat * theHistos
void dataPerStep(const G4Step *aStep)
MaterialBudgetData * theData
bool StopAfterProcess(const G4Step *aStep)
virtual void fillPerStep()
std::vector< G4String > theVolumeList
virtual void fillPerStep()=0
MaterialBudgetTree * theTree
void MaterialBudgetAction::update ( const EndOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 311 of file MaterialBudgetAction.cc.

References MaterialBudgetData::dataEndTrack(), and theData.

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

312 {
313  // std::cout << " EndOfTrack " << saveToHistos << std::endl;
314  const G4Track * aTrack = (*trk)(); // recover G4 pointer if wanted
315  // if( aTrack->GetParentID() != 0 ) return;
316 
317  //---------- end of track (OutOfWorld)
318  //- std::cout << " Data End Track " << std::endl;
319  theData->dataEndTrack( aTrack );
320 }
void dataEndTrack(const G4Track *aTrack)
MaterialBudgetData * theData
void MaterialBudgetAction::update ( const EndOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 322 of file MaterialBudgetAction.cc.

References MaterialBudgetFormat::fillEndTrack(), MaterialBudgetTxt::fillEndTrack(), MaterialBudgetTree::fillEndTrack(), saveToHistos, saveToTree, saveToTxt, theHistos, theTree, and theTxt.

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

323 {
324  //- std::cout << " Data End Event " << std::endl;
327  if (saveToTxt) theTxt->fillEndTrack();
328 }
virtual void fillEndTrack()
virtual void fillEndTrack()
MaterialBudgetTxt * theTxt
MaterialBudgetFormat * theHistos
virtual void fillEndTrack()=0
MaterialBudgetTree * theTree

Member Data Documentation

double MaterialBudgetAction::Ekin
private

Definition at line 73 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::firstParticle
private

Definition at line 74 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

bool MaterialBudgetAction::saveToHistos
private

Definition at line 71 of file MaterialBudgetAction.h.

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

bool MaterialBudgetAction::saveToTree
private

Definition at line 71 of file MaterialBudgetAction.h.

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

bool MaterialBudgetAction::saveToTxt
private

Definition at line 71 of file MaterialBudgetAction.h.

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

bool MaterialBudgetAction::storeDecay
private

Definition at line 72 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and update().

MaterialBudgetData* MaterialBudgetAction::theData
private

Definition at line 66 of file MaterialBudgetAction.h.

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

std::string MaterialBudgetAction::theHistoList
private

Definition at line 78 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction().

TestHistoMgr* MaterialBudgetAction::theHistoMgr
private

Definition at line 70 of file MaterialBudgetAction.h.

Referenced by MaterialBudgetAction(), and ~MaterialBudgetAction().

MaterialBudgetFormat* MaterialBudgetAction::theHistos
private

Definition at line 68 of file MaterialBudgetAction.h.

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

G4String MaterialBudgetAction::theProcessToStop
private

Definition at line 77 of file MaterialBudgetAction.h.

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

MaterialBudgetTree* MaterialBudgetAction::theTree
private

Definition at line 67 of file MaterialBudgetAction.h.

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

MaterialBudgetTxt* MaterialBudgetAction::theTxt
private

Definition at line 69 of file MaterialBudgetAction.h.

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

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