CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
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 58 of file BscTest.cc.

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

58  {
59  //constructor
60  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("BscTest");
61  verbosity = m_Anal.getParameter<int>("Verbosity");
62  //verbosity = 1;
63 
64  fDataLabel = m_Anal.getParameter<std::string>("FDataLabel");
65  fOutputFile = m_Anal.getParameter<std::string>("FOutputFile");
66  fRecreateFile = m_Anal.getParameter<std::string>("FRecreateFile");
67 
68  if (verbosity > 0) {
69  std::cout<<"============================================================================"<<std::endl;
70  std::cout << "BscTestconstructor :: Initialized as observer"<< std::endl;
71  }
72  // Initialization:
73 
75  bsceventntuple = new TNtuple("NTbscevent","NTbscevent","evt");
76  whichevent = 0;
77  TheHistManager = new BscAnalysisHistManager(fDataLabel);
78 
79  if (verbosity > 0) {
80  std::cout << "BscTest constructor :: Initialized BscAnalysisHistManager"<< std::endl;
81  }
82 }
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
tuple cout
Definition: gather_cfg.py:121
BscTest::~BscTest ( )
virtual

Definition at line 86 of file BscTest.cc.

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

86  {
87  // delete UserNtuples;
88  delete theBscNumberingScheme;
89 
90  TFile bscOutputFile("newntbsc.root","RECREATE");
91  std::cout << "Bsc output root file has been created";
92  bsceventntuple->Write();
93  std::cout << ", written";
94  bscOutputFile.Close();
95  std::cout << ", closed";
96  delete bsceventntuple;
97  std::cout << ", and deleted" << std::endl;
98 
99  //------->while end
100 
101  // Write histograms to file
103  if (verbosity > 0) {
104  std::cout << std::endl << "BscTest Destructor --------> End of BscTest : "
105  << std::cout << std::endl;
106  }
107 
108  std::cout<<"BscTest: End of process"<<std::endl;
109 
110 
111 
112 }
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:164
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:231
BscNumberingScheme * theBscNumberingScheme
Definition: BscTest.h:194
TNtuple * bsceventntuple
Definition: BscTest.h:227
tuple cout
Definition: gather_cfg.py:121
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 580 of file BscTest.cc.

References i, cuy::ii, and testEve_cfg::level.

Referenced by update().

581  {
582 
583  //Get name and copy numbers
584  if (level > 0) {
585  for (int ii = 0; ii < level; ii++) {
586  int i = level - ii - 1;
587  G4VPhysicalVolume* pv = touch->GetVolume(i);
588  if (pv != 0)
589  name[ii] = pv->GetName();
590  else
591  name[ii] = "Unknown";
592  copyno[ii] = touch->GetReplicaNumber(i);
593  }
594  }
595 }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
tuple level
Definition: testEve_cfg.py:34
int BscTest::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 558 of file BscTest.cc.

Referenced by update().

558  {
559 
560  //Return number of levels
561  if (touch)
562  return ((touch->GetHistoryDepth())+1);
563  else
564  return 0;
565 }
G4String BscTest::detName ( const G4VTouchable *  touch,
int  level,
int  currentlevel 
) const
private

Definition at line 568 of file BscTest.cc.

References cuy::ii.

569  {
570 
571  //Go down to current level
572  if (level > 0 && level >= currentlevel) {
573  int ii = level - currentlevel;
574  return touch->GetVolume(ii)->GetName();
575  } else {
576  return "NotFound";
577  }
578 }
int ii
Definition: cuy.py:588
tuple level
Definition: testEve_cfg.py:34
void BscTest::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

Definition at line 277 of file BscTest.cc.

References gather_cfg::cout.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

277  {
278  //job
279  std::cout<<"BscTest:beggining of job"<<std::endl;;
280 }
tuple cout
Definition: gather_cfg.py:121
void BscTest::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 284 of file BscTest.cc.

References gather_cfg::cout.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

284  {
285  //run
286 
287  std::cout << std::endl << "BscTest:: Begining of Run"<< std::endl;
288 }
tuple cout
Definition: gather_cfg.py:121
void BscTest::update ( const EndOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

Definition at line 291 of file BscTest.cc.

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

291 {;}
void BscTest::update ( const BeginOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 296 of file BscTest.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

296  {
297  iev = (*evt)()->GetEventID();
298  if (verbosity > 0) {
299  std::cout <<"BscTest:update Event number = " << iev << std::endl;
300  }
301  whichevent++;
302 }
int iev
Definition: BscTest.h:197
int verbosity
Definition: BscTest.h:211
int whichevent
Definition: BscTest.h:229
tuple cout
Definition: gather_cfg.py:121
void BscTest::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 305 of file BscTest.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

305  {
306  itrk = (*trk)()->GetTrackID();
307  if (verbosity > 1) {
308  std::cout <<"BscTest:update BeginOfTrack number = " << itrk << std::endl;
309  }
310  if(itrk == 1) {
311  SumEnerDeposit = 0.;
312  numofpart = 0;
313  SumStepl = 0.;
314  SumStepc = 0.;
315  tracklength0 = 0.;
316  }
317 }
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
tuple cout
Definition: gather_cfg.py:121
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 358 of file BscTest.cc.

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

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

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

322  {
323  itrk = (*trk)()->GetTrackID();
324  if (verbosity > 1) {
325  std::cout <<"BscTest:update EndOfTrack number = " << itrk << std::endl;
326  }
327  if(itrk == 1) {
328  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
329 
330  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
331  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
332 
333  // direction !!!
334  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
335  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
336 
337  // float eta = 0.5 * log( (1.+vert_mom.z()) / (1.-vert_mom.z()) );
338  float phi = atan2(vert_mom.y(),vert_mom.x());
339  if (phi < 0.) phi += twopi;
340  if(tracklength < z4) {
341 
342  }
343 
344  // last step information
345  const G4Step* aStep = (*trk)()->GetStep();
346  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
347  lastpo = preStepPoint->GetPosition();
348 
349  // Analysis:
350 
351  }
352 
353 }
TH1F * GetHisto(Int_t Number)
Definition: BscTest.cc:210
G4ThreeVector lastpo
Definition: BscTest.h:218
int verbosity
Definition: BscTest.h:211
double z4
Definition: BscTest.h:222
BscAnalysisHistManager * TheHistManager
Definition: BscTest.h:231
G4double SumEnerDeposit
Definition: BscTest.h:214
int itrk
Definition: BscTest.h:198
tuple cout
Definition: gather_cfg.py:121
Definition: DDAxes.h:10
void BscTest::update ( const EndOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 599 of file BscTest.cc.

References bsceventarray, gather_cfg::cout, eta(), BscG4Hit::getEnergyLoss(), BscG4Hit::getEntry(), BscG4Hit::getEntryLocalP(), BscG4Hit::getExitLocalP(), BscAnalysisHistManager::GetHisto(), BscG4Hit::getTrackID(), BscG4Hit::getUnitID(), i, iev, cmsHarvester::index, j, lastpo, log, npart, ntbsc_evt, numofpart, BscNumberingScheme::packBscIndex(), phi, pi, funct::tan(), TheHistManager, tracklength0, BscNumberingScheme::unpackBscIndex(), verbosity, whichevent, z2, z3, z4, and ecaldqm::zside().

Referenced by progressbar.ProgressBar::__next__(), relval_steps.Matrix::__setitem__(), relval_steps.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), 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(), relval_steps.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

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.