CMS 3D CMS Logo

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

#include <BscTest.h>

Inheritance diagram for BscTest:
Observer< const EndOfEvent * > Observer< const EndOfTrack * > Observer< const G4Step * > Observer< const BeginOfTrack * > Observer< const BeginOfEvent * > Observer< const EndOfRun * > Observer< const BeginOfRun * > Observer< const BeginOfJob * > SimWatcher

Public Member Functions

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

Private Member Functions

void detectorLevel (const G4VTouchable *, int &, int *, G4String *) const
 
int detLevels (const G4VTouchable *) const
 
G4String detName (const G4VTouchable *, int, int) const
 
void update (const BeginOfJob *run) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *run) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfRun *run) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *evt) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *step) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfEvent *evt) override
 This routine will be called when the appropriate signal arrives. More...
 

Private Attributes

Float_t bsceventarray [1]
 
TNtuple * bsceventntuple
 
TFile bscOutputFile
 
G4double entot0
 
std::string fDataLabel
 
std::string fOutputFile
 
std::string fRecreateFile
 
int iev
 
int itrk
 
G4ThreeVector lastpo
 
int lastTrackID
 
int numofpart
 
double rinCalo
 
G4double SumEnerDeposit
 
G4double SumStepc
 
G4double SumStepl
 
BscNumberingSchemetheBscNumberingScheme
 
BscAnalysisHistManagerTheHistManager
 
G4double tracklength0
 
int verbosity
 
int whichevent
 
double z1
 
double z2
 
double z3
 
double z4
 
double zinCalo
 

Additional Inherited Members

Detailed Description

Definition at line 158 of file BscTest.h.

Constructor & Destructor Documentation

BscTest::BscTest ( const edm::ParameterSet p)

Definition at line 49 of file BscTest.cc.

References bsceventntuple, gather_cfg::cout, fDataLabel, fOutputFile, fRecreateFile, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, theBscNumberingScheme, TheHistManager, verbosity, and whichevent.

49  {
50  //constructor
51  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("BscTest");
52  verbosity = m_Anal.getParameter<int>("Verbosity");
53  //verbosity = 1;
54 
55  fDataLabel = m_Anal.getParameter<std::string>("FDataLabel");
56  fOutputFile = m_Anal.getParameter<std::string>("FOutputFile");
57  fRecreateFile = m_Anal.getParameter<std::string>("FRecreateFile");
58 
59  if (verbosity > 0) {
60  std::cout << "============================================================================" << std::endl;
61  std::cout << "BscTestconstructor :: Initialized as observer" << std::endl;
62  }
63  // Initialization:
64 
66  bsceventntuple = new TNtuple("NTbscevent", "NTbscevent", "evt");
67  whichevent = 0;
68  TheHistManager = new BscAnalysisHistManager(fDataLabel);
69 
70  if (verbosity > 0) {
71  std::cout << "BscTest constructor :: Initialized BscAnalysisHistManager" << std::endl;
72  }
73 }
T getParameter(std::string const &) const
std::string fOutputFile
Definition: BscTest.h:220
std::string fRecreateFile
Definition: BscTest.h:221
int verbosity
Definition: BscTest.h:200
int whichevent
Definition: BscTest.h:216
std::string fDataLabel
Definition: BscTest.h:219
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:218
BscNumberingScheme * theBscNumberingScheme
Definition: BscTest.h:185
TNtuple * bsceventntuple
Definition: BscTest.h:214
BscTest::~BscTest ( )
override

Definition at line 75 of file BscTest.cc.

References bsceventntuple, bscOutputFile, gather_cfg::cout, fOutputFile, fRecreateFile, theBscNumberingScheme, TheHistManager, verbosity, and BscAnalysisHistManager::WriteToFile().

75  {
76  // delete UserNtuples;
77  delete theBscNumberingScheme;
78 
79  TFile bscOutputFile("newntbsc.root", "RECREATE");
80  std::cout << "Bsc output root file has been created";
81  bsceventntuple->Write();
82  std::cout << ", written";
83  bscOutputFile.Close();
84  std::cout << ", closed";
85  delete bsceventntuple;
86  std::cout << ", and deleted" << std::endl;
87 
88  //------->while end
89 
90  // Write histograms to file
92  if (verbosity > 0) {
93  std::cout << std::endl << "BscTest Destructor --------> End of BscTest : " << std::endl;
94  }
95 
96  std::cout << "BscTest: End of process" << std::endl;
97 }
std::string fOutputFile
Definition: BscTest.h:220
std::string fRecreateFile
Definition: BscTest.h:221
int verbosity
Definition: BscTest.h:200
void WriteToFile(const TString &fOutputFile, const TString &fRecreateFile)
Definition: BscTest.cc:143
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:218
BscNumberingScheme * theBscNumberingScheme
Definition: BscTest.h:185
TNtuple * bsceventntuple
Definition: BscTest.h:214
TFile bscOutputFile
Definition: BscTest.h:215

Member Function Documentation

void BscTest::detectorLevel ( const G4VTouchable *  touch,
int &  level,
int *  copyno,
G4String *  name 
) const
private

Definition at line 499 of file BscTest.cc.

References mps_fire::i, cuy::ii, personalPlayback::level, and MetAnalyzer::pv().

Referenced by update().

499  {
500  //Get name and copy numbers
501  if (level > 0) {
502  for (int ii = 0; ii < level; ii++) {
503  int i = level - ii - 1;
504  G4VPhysicalVolume* pv = touch->GetVolume(i);
505  if (pv != nullptr)
506  name[ii] = pv->GetName();
507  else
508  name[ii] = "Unknown";
509  copyno[ii] = touch->GetReplicaNumber(i);
510  }
511  }
512 }
def pv(vc)
Definition: MetAnalyzer.py:7
ii
Definition: cuy.py:590
int BscTest::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 480 of file BscTest.cc.

Referenced by update().

480  {
481  //Return number of levels
482  if (touch)
483  return ((touch->GetHistoryDepth()) + 1);
484  else
485  return 0;
486 }
G4String BscTest::detName ( const G4VTouchable *  touch,
int  level,
int  currentlevel 
) const
private

Definition at line 489 of file BscTest.cc.

References cuy::ii.

489  {
490  //Go down to current level
491  if (level > 0 && level >= currentlevel) {
492  int ii = level - currentlevel;
493  return touch->GetVolume(ii)->GetName();
494  } else {
495  return "NotFound";
496  }
497 }
ii
Definition: cuy.py:590
void BscTest::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 241 of file BscTest.cc.

References gather_cfg::cout.

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

241  {
242  //job
243  std::cout << "BscTest:beggining of job" << std::endl;
244  ;
245 }
void BscTest::update ( const BeginOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 248 of file BscTest.cc.

References gather_cfg::cout.

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

248  {
249  //run
250 
251  std::cout << std::endl << "BscTest:: Begining of Run" << std::endl;
252 }
void BscTest::update ( const EndOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

Definition at line 254 of file BscTest.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().

254 { ; }
void BscTest::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 257 of file BscTest.cc.

References gather_cfg::cout, iev, verbosity, and whichevent.

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

257  {
258  iev = (*evt)()->GetEventID();
259  if (verbosity > 0) {
260  std::cout << "BscTest:update Event number = " << iev << std::endl;
261  }
262  whichevent++;
263 }
int iev
Definition: BscTest.h:187
int verbosity
Definition: BscTest.h:200
int whichevent
Definition: BscTest.h:216
void BscTest::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 266 of file BscTest.cc.

References gather_cfg::cout, itrk, numofpart, SumEnerDeposit, SumStepc, SumStepl, tracklength0, and verbosity.

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

266  {
267  itrk = (*trk)()->GetTrackID();
268  if (verbosity > 1) {
269  std::cout << "BscTest:update BeginOfTrack number = " << itrk << std::endl;
270  }
271  if (itrk == 1) {
272  SumEnerDeposit = 0.;
273  numofpart = 0;
274  SumStepl = 0.;
275  SumStepc = 0.;
276  tracklength0 = 0.;
277  }
278 }
int numofpart
Definition: BscTest.h:205
G4double SumStepl
Definition: BscTest.h:203
int verbosity
Definition: BscTest.h:200
G4double SumEnerDeposit
Definition: BscTest.h:203
int itrk
Definition: BscTest.h:188
G4double SumStepc
Definition: BscTest.h:203
G4double tracklength0
Definition: BscTest.h:189
void BscTest::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 306 of file BscTest.cc.

References gather_cfg::cout, detectorLevel(), detLevels(), entot0, mps_fire::i, numofpart, PbPb_ZMuSkimMuonDPG_cff::particleType, SumEnerDeposit, SumStepc, SumStepl, tracklength0, and verbosity.

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

306  {
307  // ==========================================================================
308 
309  if (verbosity > 2) {
310  G4int stepnumber = aStep->GetTrack()->GetCurrentStepNumber();
311  std::cout << "BscTest:update Step number = " << stepnumber << std::endl;
312  }
313  // track on aStep: !
314  G4Track* theTrack = aStep->GetTrack();
315  TrackInformation* trkInfo = dynamic_cast<TrackInformation*>(theTrack->GetUserInformation());
316  if (trkInfo == nullptr) {
317  std::cout << "BscTest on aStep: No trk info !!!! abort " << std::endl;
318  }
319  G4int id = theTrack->GetTrackID();
320  G4String particleType = theTrack->GetDefinition()->GetParticleName(); // !!!
321  G4int parentID = theTrack->GetParentID(); // !!!
322  G4TrackStatus trackstatus = theTrack->GetTrackStatus(); // !!!
323  G4double tracklength = theTrack->GetTrackLength(); // Accumulated track length
324  G4ThreeVector trackmom = theTrack->GetMomentum();
325  G4double entot = theTrack->GetTotalEnergy(); // !!! deposited on step
326  G4int curstepnumber = theTrack->GetCurrentStepNumber();
327  G4double stepl = aStep->GetStepLength();
328  G4double EnerDeposit = aStep->GetTotalEnergyDeposit();
329  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
330  const G4ThreeVector& preposition = preStepPoint->GetPosition();
331  G4ThreeVector prelocalpoint = theTrack->GetTouchable()->GetHistory()->GetTopTransform().TransformPoint(preposition);
332  G4VPhysicalVolume* currentPV = preStepPoint->GetPhysicalVolume();
333  const G4String& prename = currentPV->GetName();
334 
335  const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
336  int pre_levels = detLevels(pre_touch);
337  G4String name1[20];
338  int copyno1[20];
339  for (int i = 0; i < 20; ++i) {
340  name1[i] = "";
341  copyno1[i] = 0;
342  }
343  if (pre_levels > 0) {
344  detectorLevel(pre_touch, pre_levels, copyno1, name1);
345  }
346 
347  if (id == 1) {
348  // on 1-st step:
349  if (curstepnumber == 1) {
350  entot0 = entot;
351  //UserNtuples->fillg519(entot0,1.);
352  }
353 
354  // on every step:
355 
356  // for Copper:
357  if (prename == "SBST") {
358  SumStepc += stepl;
359  // =========
360  }
361  // for ststeel:
362  // if(prename == "SBSTs") {
363  if (prename == "SBSTs") {
364  SumStepl += stepl;
365  // =========
366  }
367  // =========
368  // =========
369 
370  // exclude last track point if it is in SD (MI was started their)
371  if (trackstatus != 2) {
372  // for SD: Si Det.: SISTATION:SIPLANE:(SIDETL+BOUNDDET +SIDETR + CERAMDET)
373  if (prename == "SIDETL" || prename == "SIDETR") {
374  if (prename == "SIDETL") {
375  //UserNtuples->fillg569(EnerDeposit,1.);
376  }
377  if (prename == "SIDETR") {
378  //UserNtuples->fillg570(EnerDeposit,1.);
379  }
380 
381  G4String posname = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
382  if ((prename == "SIDETL" && posname != "SIDETL") || (prename == "SIDETR" && posname != "SIDETR")) {
383  if (name1[2] == "SISTATION") {
384  //UserNtuples->fillg539(copyno1[2],1.);
385  }
386  if (name1[3] == "SIPLANE") {
387  //UserNtuples->fillg540(copyno1[3],1.);
388  }
389 
390  if (prename == "SIDETL") {
391  //UserNtuples->fillg541(EnerDeposit,1.);
392  //UserNtuples->fillg561(numbcont,1.);
393  if (copyno1[2] < 2) {
394  //UserNtuples->fillg571(dx,1.);
395  } else if (copyno1[2] < 3) {
396  //UserNtuples->fillg563(dx,1.);
397  if (copyno1[3] < 2) {
398  } else if (copyno1[3] < 3) {
399  //UserNtuples->fillg572(dx,1.);
400  } else if (copyno1[3] < 4) {
401  //UserNtuples->fillg573(dx,1.);
402  } else if (copyno1[3] < 5) {
403  //UserNtuples->fillg574(dx,1.);
404  } else if (copyno1[3] < 6) {
405  //UserNtuples->fillg575(dx,1.);
406  } else if (copyno1[3] < 7) {
407  //UserNtuples->fillg576(dx,1.);
408  } else if (copyno1[3] < 8) {
409  //UserNtuples->fillg577(dx,1.);
410  } else if (copyno1[3] < 9) {
411  //UserNtuples->fillg578(dx,1.);
412  } else if (copyno1[3] < 10) {
413  //UserNtuples->fillg579(dx,1.);
414  }
415  } else if (copyno1[2] < 4) {
416  //UserNtuples->fillg565(dx,1.);
417  } else if (copyno1[2] < 5) {
418  //UserNtuples->fillg567(dx,1.);
419  }
420  }
421  if (prename == "SIDETR") {
422  //UserNtuples->fillg542(EnerDeposit,1.);
423  //UserNtuples->fillg562(numbcont,1.);
424  if (copyno1[2] < 2) {
425  //UserNtuples->fillg581(dy,1.);
426  } else if (copyno1[2] < 3) {
427  //UserNtuples->fillg564(dy,1.);
428  if (copyno1[3] < 2) {
429  } else if (copyno1[3] < 3) {
430  //UserNtuples->fillg582(dy,1.);
431  } else if (copyno1[3] < 4) {
432  //UserNtuples->fillg583(dy,1.);
433  } else if (copyno1[3] < 5) {
434  //UserNtuples->fillg584(dy,1.);
435  } else if (copyno1[3] < 6) {
436  //UserNtuples->fillg585(dy,1.);
437  } else if (copyno1[3] < 7) {
438  //UserNtuples->fillg586(dy,1.);
439  } else if (copyno1[3] < 8) {
440  //UserNtuples->fillg587(dy,1.);
441  } else if (copyno1[3] < 9) {
442  //UserNtuples->fillg588(dy,1.);
443  } else if (copyno1[3] < 10) {
444  //UserNtuples->fillg589(dy,1.);
445  }
446  } else if (copyno1[2] < 4) {
447  //UserNtuples->fillg566(dy,1.);
448  } else if (copyno1[2] < 5) {
449  //UserNtuples->fillg568(dy,1.);
450  }
451  }
452  }
453  }
454  // end of prenames SIDETL // SIDETR
455  }
456  // end of trackstatus != 2
457 
458  SumEnerDeposit += EnerDeposit;
459  if (trackstatus == 2) {
460  // primary track length
461  // //UserNtuples->fillg508(tracklength,1.);
462  tracklength0 = tracklength;
463  }
464  }
465  // end of primary track !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
466 
467  if (parentID == 1 && curstepnumber == 1) {
468  // particles deposit their energy along primary track
469  numofpart += 1;
470  if (prename == "SBST") {
471  //UserNtuples->filld225(vert_pos.y(),vert_pos.z(),1.);
472  }
473  if (prename == "SBSTs") {
474  //UserNtuples->filld226(vert_pos.y(),vert_pos.z(),1.);
475  }
476  }
477 }
int numofpart
Definition: BscTest.h:205
G4double SumStepl
Definition: BscTest.h:203
int detLevels(const G4VTouchable *) const
Definition: BscTest.cc:480
int verbosity
Definition: BscTest.h:200
G4double entot0
Definition: BscTest.h:189
G4double SumEnerDeposit
Definition: BscTest.h:203
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: BscTest.cc:499
G4double SumStepc
Definition: BscTest.h:203
G4double tracklength0
Definition: BscTest.h:189
void BscTest::update ( const EndOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 281 of file BscTest.cc.

References gather_cfg::cout, BscAnalysisHistManager::GetHisto(), itrk, lastpo, SumEnerDeposit, TheHistManager, and verbosity.

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

281  {
282  itrk = (*trk)()->GetTrackID();
283  if (verbosity > 1) {
284  std::cout << "BscTest:update EndOfTrack number = " << itrk << std::endl;
285  }
286  if (itrk == 1) {
287  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
288 
289  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
290  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
291 
292  // direction !!!
293  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
294  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
295 
296  // last step information
297  const G4Step* aStep = (*trk)()->GetStep();
298  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
299  lastpo = preStepPoint->GetPosition();
300  }
301 }
TH1F * GetHisto(Int_t Number)
Definition: BscTest.cc:184
G4ThreeVector lastpo
Definition: BscTest.h:207
int verbosity
Definition: BscTest.h:200
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:218
G4double SumEnerDeposit
Definition: BscTest.h:203
int itrk
Definition: BscTest.h:188
void BscTest::update ( const EndOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 516 of file BscTest.cc.

References bsceventarray, gather_cfg::cout, PVValHelper::eta, dqmMemoryStats::float, BscG4Hit::getEnergyLoss(), BscG4Hit::getEntry(), BscG4Hit::getEntryLocalP(), BscG4Hit::getExitLocalP(), BscAnalysisHistManager::GetHisto(), BscG4Hit::getTrackID(), BscG4Hit::getUnitID(), mps_fire::i, iev, dqmiolumiharvest::j, lastpo, dqm-mbProfile::log, npart, ntbsc_evt, numofpart, BscNumberingScheme::packBscIndex(), phi, pi, funct::tan(), TheHistManager, tracklength0, BscNumberingScheme::unpackBscIndex(), verbosity, whichevent, z2, z3, z4, ecaldqm::zside(), and geometryCSVtoXML::zz.

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

516  {
517  // ==========================================================================
518 
519  if (verbosity > 1) {
520  iev = (*evt)()->GetEventID();
521  std::cout << "BscTest:update EndOfEvent = " << iev << std::endl;
522  }
523  // Fill-in ntuple
525 
526  //
527  int trackID = 0;
528  G4PrimaryParticle* thePrim = nullptr;
529 
530  // prim.vertex:
531  G4int nvertex = (*evt)()->GetNumberOfPrimaryVertex();
532  if (nvertex != 1)
533  std::cout << "BscTest: My warning: NumberOfPrimaryVertex != 1 --> = " << nvertex << std::endl;
534 
535  for (int i = 0; i < nvertex; i++) {
536  G4PrimaryVertex* avertex = (*evt)()->GetPrimaryVertex(i);
537  if (avertex == nullptr)
538  std::cout << "BscTest End Of Event ERR: pointer to vertex = 0" << std::endl;
539  G4int npart = avertex->GetNumberOfParticle();
540  if (npart != 1)
541  std::cout << "BscTest: My warning: NumberOfPrimaryPart != 1 --> = " << npart << std::endl;
542  if (npart == 0)
543  std::cout << "BscTest End Of Event ERR: no NumberOfParticle" << std::endl;
544 
545  if (thePrim == nullptr)
546  thePrim = avertex->GetPrimary(trackID);
547 
548  if (thePrim != nullptr) {
549  // primary vertex:
550  G4double vx = 0., vy = 0., vz = 0.;
551  vx = avertex->GetX0();
552  vy = avertex->GetY0();
553  vz = avertex->GetZ0();
554  //UserNtuples->fillh01(vx);
555  //UserNtuples->fillh02(vy);
556  //UserNtuples->fillh03(vz);
557  TheHistManager->GetHisto("VtxX")->Fill(vx);
558  TheHistManager->GetHisto("VtxY")->Fill(vy);
559  TheHistManager->GetHisto("VtxZ")->Fill(vz);
560  }
561  }
562  // prim.vertex loop end
563 
564  //=========================== thePrim != 0 ================================================================================
565  if (thePrim != nullptr) {
566  //
567  // number of secondary particles deposited their energy along primary track
568  //UserNtuples->fillg518(numofpart,1.);
569  if (lastpo.z() < z4 && lastpo.perp() < 100.) {
570  //UserNtuples->fillg536(numofpart,1.);
571  }
572  //
573 
574  // direction !!!
575  G4ThreeVector mom = thePrim->GetMomentum();
576 
577  double phi = atan2(mom.y(), mom.x());
578  if (phi < 0.)
579  phi += twopi;
580  double phigrad = phi * 180. / pi;
581 
582  double th = mom.theta();
583  double eta = -log(tan(th / 2));
584  TheHistManager->GetHisto("PrimaryEta")->Fill(eta);
585  TheHistManager->GetHisto("PrimaryPhigrad")->Fill(phigrad);
586  TheHistManager->GetHisto("PrimaryTh")->Fill(th * 180. / pi);
587 
588  TheHistManager->GetHisto("PrimaryLastpoZ")->Fill(lastpo.z());
589  if (lastpo.z() < z4) {
590  TheHistManager->GetHisto("PrimaryLastpoX")->Fill(lastpo.x());
591  TheHistManager->GetHisto("PrimaryLastpoY")->Fill(lastpo.y());
592  }
593  if (numofpart > 4) {
594  TheHistManager->GetHisto("XLastpoNumofpart")->Fill(lastpo.x());
595  TheHistManager->GetHisto("YLastpoNumofpart")->Fill(lastpo.y());
596  }
597 
598  // ==========================================================================
599 
600  // hit map for Bsc
601  // ==================================
602 
603  std::map<int, float, std::less<int> > themap;
604  std::map<int, float, std::less<int> > themap1;
605 
606  std::map<int, float, std::less<int> > themapxy;
607  std::map<int, float, std::less<int> > themapz;
608  // access to the G4 hit collections: -----> this work OK:
609 
610  // edm::LogInfo("BscTest") << "1";
611  G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
612  // edm::LogInfo("BscTest") << "2";
613  if (verbosity > 0) {
614  std::cout << "BscTest: accessed all HC" << std::endl;
615  ;
616  }
617  int CAFIid = G4SDManager::GetSDMpointer()->GetCollectionID("BSCHits");
618 
619  BscG4HitCollection* theCAFI = (BscG4HitCollection*)allHC->GetHC(CAFIid);
620  if (verbosity > 0) {
621  std::cout << "BscTest: theCAFI->entries = " << theCAFI->entries() << std::endl;
622  }
623  int varia; // = 0 -all; =1 - MI; =2 - noMI
624  //varia = 0;
625  if (lastpo.z() < z4) {
626  varia = 1;
627  } else {
628  varia = 2;
629  } // no MI end:
630  for (int j = 0; j < theCAFI->entries(); j++) {
631  BscG4Hit* aHit = (*theCAFI)[j];
632  const CLHEP::Hep3Vector& hitPoint = aHit->getEntry();
633  double zz = hitPoint.z();
634  TheHistManager->GetHisto("zHits")->Fill(zz);
635  if (tracklength0 > 8300.)
636  TheHistManager->GetHisto("zHitsTrLoLe")->Fill(zz);
637  }
638 
639  if (varia == 2) {
640  int nhit11 = 0, nhit12 = 0, nhit13 = 0;
641  double totallosenergy = 0.;
642  for (int j = 0; j < theCAFI->entries(); j++) {
643  BscG4Hit* aHit = (*theCAFI)[j];
644 
645  const CLHEP::Hep3Vector& hitEntryLocalPoint = aHit->getEntryLocalP();
646  const CLHEP::Hep3Vector& hitExitLocalPoint = aHit->getExitLocalP();
647  const CLHEP::Hep3Vector& hitPoint = aHit->getEntry();
648  int trackIDhit = aHit->getTrackID();
649  unsigned int unitID = aHit->getUnitID();
650  double losenergy = aHit->getEnergyLoss();
651 
652  double zz = hitPoint.z();
653 
654  TheHistManager->GetHisto("zHitsnoMI")->Fill(zz);
655 
656  if (verbosity > 2) {
657  std::cout << "BscTest:zHits = " << zz << std::endl;
658  }
659 
660  themap[unitID] += losenergy;
661  totallosenergy += losenergy;
662 
663  int zside, sector;
665  zside = (unitID & 32) >> 5;
666  sector = (unitID & 7);
667 
668  //
669  //=======================================
670  G4ThreeVector middle = (hitExitLocalPoint + hitEntryLocalPoint) / 2.;
671  themapz[unitID] = hitPoint.z() + middle.z();
672  //=======================================
673  // Y
674  if (zside == 1) {
675  //UserNtuples->fillg24(losenergy,1.);
676  if (losenergy > 0.00003) {
677  themap1[unitID] += 1.;
678  }
679  }
680  //X
681  if (zside == 2) {
682  //UserNtuples->fillg25(losenergy,1.);
683  if (losenergy > 0.00005) {
684  themap1[unitID] += 1.;
685  }
686  }
687  // }
688  //
689  if (sector == 1) {
690  nhit11 += 1;
691  //UserNtuples->fillg33(rr,1.);
692  //UserNtuples->fillg11(yy,1.);
693  }
694  if (sector == 2) {
695  nhit12 += 1;
696  //UserNtuples->fillg34(rr,1.);
697  //UserNtuples->fillg86(yy,1.);
698  }
699  if (sector == 3) {
700  nhit13 += 1;
701  //UserNtuples->fillg35(rr,1.);
702  //UserNtuples->fillg87(yy,1.);
703  }
704 
705  if (lastpo.z() < z4 && lastpo.perp() < 120.) {
706  // MIonly:
707  //UserNtuples->fillg16(lastpo.z(),1.);
708  //UserNtuples->fillg18(zz,1.);
709  // Station I
710  if (zz < z2) {
711  //UserNtuples->fillg54(dx,1.);
712  //UserNtuples->fillg55(dy,1.);
713  }
714  // Station II
715  if (zz < z3 && zz > z2) {
716  //UserNtuples->fillg50(dx,1.);
717  //UserNtuples->fillg51(dy,1.);
718  }
719  // Station III
720  if (zz < z4 && zz > z3) {
721  //UserNtuples->fillg64(dx,1.);
722  //UserNtuples->fillg65(dy,1.);
723  //UserNtuples->filld209(xx,yy,1.);
724  }
725  } else {
726  // no MIonly:
727  //UserNtuples->fillg17(lastpo.z(),1.);
728  //UserNtuples->fillg19(zz,1.);
729  //UserNtuples->fillg74(incidentEnergyHit,1.);
730  //UserNtuples->fillg75(float(trackIDhit),1.);
731  // Station I
732  if (zz < z2) {
733  //UserNtuples->fillg56(dx,1.);
734  //UserNtuples->fillg57(dy,1.);
735  //UserNtuples->fillg20(numofpart,1.);
736  //UserNtuples->fillg21(SumEnerDeposit,1.);
737  if (zside == 1) {
738  //UserNtuples->fillg26(losenergy,1.);
739  }
740  if (zside == 2) {
741  //UserNtuples->fillg76(losenergy,1.);
742  }
743  if (trackIDhit == 1) {
744  //UserNtuples->fillg70(dx,1.);
745  //UserNtuples->fillg71(incidentEnergyHit,1.);
746  //UserNtuples->fillg79(losenergy,1.);
747  } else {
748  //UserNtuples->fillg82(dx,1.);
749  }
750  }
751  // Station II
752  if (zz < z3 && zz > z2) {
753  //UserNtuples->fillg52(dx,1.);
754  //UserNtuples->fillg53(dy,1.);
755  //UserNtuples->fillg22(numofpart,1.);
756  //UserNtuples->fillg23(SumEnerDeposit,1.);
757  //UserNtuples->fillg80(incidentEnergyHit,1.);
758  //UserNtuples->fillg81(float(trackIDhit),1.);
759  if (zside == 1) {
760  //UserNtuples->fillg27(losenergy,1.);
761  }
762  if (zside == 2) {
763  //UserNtuples->fillg77(losenergy,1.);
764  }
765  if (trackIDhit == 1) {
766  //UserNtuples->fillg72(dx,1.);
767  //UserNtuples->fillg73(incidentEnergyHit,1.);
768  } else {
769  //UserNtuples->fillg83(dx,1.);
770  }
771  }
772  // Station III
773  if (zz < z4 && zz > z3) {
774  if (zside == 1) {
775  //UserNtuples->fillg28(losenergy,1.);
776  }
777  if (zside == 2) {
778  //UserNtuples->fillg78(losenergy,1.);
779  }
780  }
781  }
782  } // MIonly or noMIonly ENDED
783  if (totallosenergy == 0.0) {
784  std::cout << "BscTest: number of hits = " << theCAFI->entries() << std::endl;
785  for (int j = 0; j < theCAFI->entries(); j++) {
786  BscG4Hit* aHit = (*theCAFI)[j];
787  double losenergy = aHit->getEnergyLoss();
788  std::cout << " j hits = " << j << "losenergy = " << losenergy << std::endl;
789  }
790  }
791  // FIBRE Hit collected analysis
792  double totalEnergy = 0.;
793  int nhitsX = 0, nhitsY = 0, nsumhit = 0;
794  for (int sector = 1; sector < 4; sector++) {
795  int nhitsecX = 0, nhitsecY = 0;
796  for (int zmodule = 1; zmodule < 11; zmodule++) {
797  for (int zside = 1; zside < 3; zside++) {
798  int det = 1; // nhit = 0;
799  // int sScale = 20;
800  int index = BscNumberingScheme::packBscIndex(det, zside, sector);
801  double theTotalEnergy = themap[index];
802  // X planes
803  if (zside < 2) {
804  //UserNtuples->fillg47(theTotalEnergy,1.);
805  if (theTotalEnergy > 0.00003) {
806  nhitsX += 1;
807  // nhitsecX += themap1[index];
808  // nhit=1;
809  }
810  }
811  // Y planes
812  else {
813  //UserNtuples->fillg49(theTotalEnergy,1.);
814  if (theTotalEnergy > 0.00005) {
815  nhitsY += 1;
816  // nhitsecY += themap1[index];
817  // nhit=1;
818  }
819  }
820 
821  totalEnergy += themap[index];
822  } // for
823  } // for
824  //UserNtuples->fillg39(nhitsecY,1.);
825  if (nhitsecX > 10 || nhitsecY > 10) {
826  nsumhit += 1;
827  //UserNtuples->fillp213(float(sector),float(1.),1.);
828  } else { //UserNtuples->fillp213(float(sector),float(0.),1.);
829  }
830  } // for
831 
832  if (nsumhit >= 2) { //UserNtuples->fillp212(vy,float(1.),1.);
833  } else { //UserNtuples->fillp212(vy,float(0.),1.);
834  }
835  } // MI or no MI or all - end
836  } // primary end
837 
838  if (verbosity > 0) {
839  std::cout << "BscTest: END OF Event " << (*evt)()->GetEventID() << std::endl;
840  }
841 }
int numofpart
Definition: BscTest.h:205
double z2
Definition: BscTest.h:210
TH1F * GetHisto(Int_t Number)
Definition: BscTest.cc:184
double npart
Definition: HydjetWrapper.h:46
int zside(DetId const &)
G4ThreeVector lastpo
Definition: BscTest.h:207
int iev
Definition: BscTest.h:187
int getTrackID() const
Definition: BscG4Hit.h:53
const Double_t pi
int verbosity
Definition: BscTest.h:200
double z4
Definition: BscTest.h:210
int whichevent
Definition: BscTest.h:216
static unsigned int packBscIndex(int det, int zside, int station)
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:218
double z3
Definition: BscTest.h:210
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const G4ThreeVector & getExitLocalP() const
Definition: BscG4Hit.h:35
const G4ThreeVector & getEntry() const
Definition: BscG4Hit.h:29
static void unpackBscIndex(const unsigned int &idx)
const G4ThreeVector & getEntryLocalP() const
Definition: BscG4Hit.h:32
Float_t bsceventarray[1]
Definition: BscTest.h:213
uint32_t getUnitID() const
Definition: BscG4Hit.h:56
G4THitsCollection< BscG4Hit > BscG4HitCollection
float getEnergyLoss() const
Definition: BscG4Hit.h:69
G4double tracklength0
Definition: BscTest.h:189

Member Data Documentation

Float_t BscTest::bsceventarray[1]
private

Definition at line 213 of file BscTest.h.

Referenced by update().

TNtuple* BscTest::bsceventntuple
private

Definition at line 214 of file BscTest.h.

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

TFile BscTest::bscOutputFile
private

Definition at line 215 of file BscTest.h.

Referenced by ~BscTest().

G4double BscTest::entot0
private

Definition at line 189 of file BscTest.h.

Referenced by update().

std::string BscTest::fDataLabel
private

Definition at line 219 of file BscTest.h.

Referenced by BscTest().

std::string BscTest::fOutputFile
private

Definition at line 220 of file BscTest.h.

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

std::string BscTest::fRecreateFile
private

Definition at line 221 of file BscTest.h.

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

int BscTest::iev
private

Definition at line 187 of file BscTest.h.

Referenced by update().

int BscTest::itrk
private

Definition at line 188 of file BscTest.h.

Referenced by update().

G4ThreeVector BscTest::lastpo
private

Definition at line 207 of file BscTest.h.

Referenced by update().

int BscTest::lastTrackID
private

Definition at line 199 of file BscTest.h.

int BscTest::numofpart
private

Definition at line 205 of file BscTest.h.

Referenced by update().

double BscTest::rinCalo
private

Definition at line 198 of file BscTest.h.

G4double BscTest::SumEnerDeposit
private

Definition at line 203 of file BscTest.h.

Referenced by update().

G4double BscTest::SumStepc
private

Definition at line 203 of file BscTest.h.

Referenced by update().

G4double BscTest::SumStepl
private

Definition at line 203 of file BscTest.h.

Referenced by update().

BscNumberingScheme* BscTest::theBscNumberingScheme
private

Definition at line 185 of file BscTest.h.

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

BscAnalysisHistManager* BscTest::TheHistManager
private

Definition at line 218 of file BscTest.h.

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

G4double BscTest::tracklength0
private

Definition at line 189 of file BscTest.h.

Referenced by update().

int BscTest::verbosity
private

Definition at line 200 of file BscTest.h.

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

int BscTest::whichevent
private

Definition at line 216 of file BscTest.h.

Referenced by BscTest(), and update().

double BscTest::z1
private

Definition at line 210 of file BscTest.h.

double BscTest::z2
private

Definition at line 210 of file BscTest.h.

Referenced by update().

double BscTest::z3
private

Definition at line 210 of file BscTest.h.

Referenced by update().

double BscTest::z4
private

Definition at line 210 of file BscTest.h.

Referenced by update().

double BscTest::zinCalo
private

Definition at line 198 of file BscTest.h.