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)
 
virtual ~BscTest ()
 
- 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)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfRun *run)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfRun *run)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfEvent *evt)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const G4Step *step)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfTrack *trk)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const EndOfEvent *evt)
 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 ( )
virtual

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 550 of file BscTest.cc.

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

Referenced by update().

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

Definition at line 528 of file BscTest.cc.

Referenced by update().

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

Definition at line 538 of file BscTest.cc.

References cuy::ii.

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

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 )
privatevirtual

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 )
privatevirtual

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 )
privatevirtual

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 )
privatevirtual

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 *  )
privatevirtual

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

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 )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 569 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, diffTreeTool::index, lastpo, cmsBatch::log, npart, ntbsc_evt, numofpart, BscNumberingScheme::packBscIndex(), phi, pi, funct::tan(), TheHistManager, tracklength0, BscNumberingScheme::unpackBscIndex(), verbosity, whichevent, z2, z3, z4, HcalDigiParam_cfi::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().

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