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 164 of file BscTest.h.

Constructor & Destructor Documentation

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

Definition at line 51 of file BscTest.cc.

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

51  {
52  //constructor
53  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("BscTest");
54  verbosity = m_Anal.getParameter<int>("Verbosity");
55  //verbosity = 1;
56 
57  fDataLabel = m_Anal.getParameter<std::string>("FDataLabel");
58  fOutputFile = m_Anal.getParameter<std::string>("FOutputFile");
59  fRecreateFile = m_Anal.getParameter<std::string>("FRecreateFile");
60 
61  if (verbosity > 0) {
62  std::cout<<"============================================================================"<<std::endl;
63  std::cout << "BscTestconstructor :: Initialized as observer"<< std::endl;
64  }
65  // Initialization:
66 
68  bsceventntuple = new TNtuple("NTbscevent","NTbscevent","evt");
69  whichevent = 0;
70  TheHistManager = new BscAnalysisHistManager(fDataLabel);
71 
72  if (verbosity > 0) {
73  std::cout << "BscTest constructor :: Initialized BscAnalysisHistManager"<< std::endl;
74  }
75 }
T getParameter(std::string const &) const
std::string fOutputFile
Definition: BscTest.h:233
std::string fRecreateFile
Definition: BscTest.h:234
int verbosity
Definition: BscTest.h:211
int whichevent
Definition: BscTest.h:229
std::string fDataLabel
Definition: BscTest.h:232
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:231
BscNumberingScheme * theBscNumberingScheme
Definition: BscTest.h:194
TNtuple * bsceventntuple
Definition: BscTest.h:227
BscTest::~BscTest ( )
override

Definition at line 77 of file BscTest.cc.

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

77  {
78  // delete UserNtuples;
79  delete theBscNumberingScheme;
80 
81  TFile bscOutputFile("newntbsc.root","RECREATE");
82  std::cout << "Bsc output root file has been created";
83  bsceventntuple->Write();
84  std::cout << ", written";
85  bscOutputFile.Close();
86  std::cout << ", closed";
87  delete bsceventntuple;
88  std::cout << ", and deleted" << std::endl;
89 
90  //------->while end
91 
92  // Write histograms to file
94  if (verbosity > 0) {
95  std::cout << std::endl << "BscTest Destructor --------> End of BscTest : " << std::endl;
96  }
97 
98  std::cout<<"BscTest: End of process"<<std::endl;
99 }
std::string fOutputFile
Definition: BscTest.h:233
std::string fRecreateFile
Definition: BscTest.h:234
int verbosity
Definition: BscTest.h:211
void WriteToFile(const TString &fOutputFile, const TString &fRecreateFile)
Definition: BscTest.cc:148
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:231
BscNumberingScheme * theBscNumberingScheme
Definition: BscTest.h:194
TNtuple * bsceventntuple
Definition: BscTest.h:227
TFile bscOutputFile
Definition: BscTest.h:228

Member Function Documentation

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

Definition at line 548 of file BscTest.cc.

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

Referenced by update().

549  {
550 
551  //Get name and copy numbers
552  if (level > 0) {
553  for (int ii = 0; ii < level; ii++) {
554  int i = level - ii - 1;
555  G4VPhysicalVolume* pv = touch->GetVolume(i);
556  if (pv != nullptr)
557  name[ii] = pv->GetName();
558  else
559  name[ii] = "Unknown";
560  copyno[ii] = touch->GetReplicaNumber(i);
561  }
562  }
563 }
def pv(vc)
Definition: MetAnalyzer.py:6
ii
Definition: cuy.py:588
int BscTest::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 526 of file BscTest.cc.

Referenced by update().

526  {
527 
528  //Return number of levels
529  if (touch)
530  return ((touch->GetHistoryDepth())+1);
531  else
532  return 0;
533 }
G4String BscTest::detName ( const G4VTouchable *  touch,
int  level,
int  currentlevel 
) const
private

Definition at line 536 of file BscTest.cc.

References cuy::ii.

537  {
538 
539  //Go down to current level
540  if (level > 0 && level >= currentlevel) {
541  int ii = level - currentlevel;
542  return touch->GetVolume(ii)->GetName();
543  } else {
544  return "NotFound";
545  }
546 }
ii
Definition: cuy.py:588
void BscTest::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

261  {
262  //job
263  std::cout<<"BscTest:beggining of job"<<std::endl;;
264 }
void BscTest::update ( const BeginOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

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

267  {
268  //run
269 
270  std::cout << std::endl << "BscTest:: Begining of Run"<< std::endl;
271 }
void BscTest::update ( const EndOfRun )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

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

276  {
277  iev = (*evt)()->GetEventID();
278  if (verbosity > 0) {
279  std::cout <<"BscTest:update Event number = " << iev << std::endl;
280  }
281  whichevent++;
282 }
int iev
Definition: BscTest.h:197
int verbosity
Definition: BscTest.h:211
int whichevent
Definition: BscTest.h:229
void BscTest::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

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

285  {
286  itrk = (*trk)()->GetTrackID();
287  if (verbosity > 1) {
288  std::cout <<"BscTest:update BeginOfTrack number = " << itrk << std::endl;
289  }
290  if(itrk == 1) {
291  SumEnerDeposit = 0.;
292  numofpart = 0;
293  SumStepl = 0.;
294  SumStepc = 0.;
295  tracklength0 = 0.;
296  }
297 }
int numofpart
Definition: BscTest.h:216
G4double SumStepl
Definition: BscTest.h:214
int verbosity
Definition: BscTest.h:211
G4double SumEnerDeposit
Definition: BscTest.h:214
int itrk
Definition: BscTest.h:198
G4double SumStepc
Definition: BscTest.h:214
G4double tracklength0
Definition: BscTest.h:199
void BscTest::update ( const G4Step *  )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 325 of file BscTest.cc.

References gather_cfg::cout, detectorLevel(), detLevels(), entot0, mps_fire::i, numofpart, objects.autophobj::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().

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

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

300  {
301  itrk = (*trk)()->GetTrackID();
302  if (verbosity > 1) {
303  std::cout <<"BscTest:update EndOfTrack number = " << itrk << std::endl;
304  }
305  if(itrk == 1) {
306  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
307 
308  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
309  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
310 
311  // direction !!!
312  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
313  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
314 
315  // last step information
316  const G4Step* aStep = (*trk)()->GetStep();
317  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
318  lastpo = preStepPoint->GetPosition();
319  }
320 }
TH1F * GetHisto(Int_t Number)
Definition: BscTest.cc:194
G4ThreeVector lastpo
Definition: BscTest.h:218
int verbosity
Definition: BscTest.h:211
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:231
G4double SumEnerDeposit
Definition: BscTest.h:214
int itrk
Definition: BscTest.h:198
void BscTest::update ( const EndOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 567 of file BscTest.cc.

References bsceventarray, gather_cfg::cout, PVValHelper::eta, objects.autophobj::float, BscG4Hit::getEnergyLoss(), BscG4Hit::getEntry(), BscG4Hit::getEntryLocalP(), BscG4Hit::getExitLocalP(), BscAnalysisHistManager::GetHisto(), BscG4Hit::getTrackID(), BscG4Hit::getUnitID(), mps_fire::i, iev, lastpo, cmsBatch::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().

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

Member Data Documentation

Float_t BscTest::bsceventarray[1]
private

Definition at line 226 of file BscTest.h.

Referenced by update().

TNtuple* BscTest::bsceventntuple
private

Definition at line 227 of file BscTest.h.

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

TFile BscTest::bscOutputFile
private

Definition at line 228 of file BscTest.h.

Referenced by ~BscTest().

G4double BscTest::entot0
private

Definition at line 199 of file BscTest.h.

Referenced by update().

std::string BscTest::fDataLabel
private

Definition at line 232 of file BscTest.h.

Referenced by BscTest().

std::string BscTest::fOutputFile
private

Definition at line 233 of file BscTest.h.

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

std::string BscTest::fRecreateFile
private

Definition at line 234 of file BscTest.h.

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

int BscTest::iev
private

Definition at line 197 of file BscTest.h.

Referenced by update().

int BscTest::itrk
private

Definition at line 198 of file BscTest.h.

Referenced by update().

G4ThreeVector BscTest::lastpo
private

Definition at line 218 of file BscTest.h.

Referenced by update().

int BscTest::lastTrackID
private

Definition at line 210 of file BscTest.h.

int BscTest::numofpart
private

Definition at line 216 of file BscTest.h.

Referenced by update().

double BscTest::rinCalo
private

Definition at line 209 of file BscTest.h.

G4double BscTest::SumEnerDeposit
private

Definition at line 214 of file BscTest.h.

Referenced by update().

G4double BscTest::SumStepc
private

Definition at line 214 of file BscTest.h.

Referenced by update().

G4double BscTest::SumStepl
private

Definition at line 214 of file BscTest.h.

Referenced by update().

BscNumberingScheme* BscTest::theBscNumberingScheme
private

Definition at line 194 of file BscTest.h.

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

BscAnalysisHistManager* BscTest::TheHistManager
private

Definition at line 231 of file BscTest.h.

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

G4double BscTest::tracklength0
private

Definition at line 199 of file BscTest.h.

Referenced by update().

int BscTest::verbosity
private

Definition at line 211 of file BscTest.h.

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

int BscTest::whichevent
private

Definition at line 229 of file BscTest.h.

Referenced by BscTest(), and update().

double BscTest::z1
private

Definition at line 222 of file BscTest.h.

double BscTest::z2
private

Definition at line 222 of file BscTest.h.

Referenced by update().

double BscTest::z3
private

Definition at line 222 of file BscTest.h.

Referenced by update().

double BscTest::z4
private

Definition at line 222 of file BscTest.h.

Referenced by update().

double BscTest::zinCalo
private

Definition at line 209 of file BscTest.h.