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 : " << std::endl;
105  }
106 
107  std::cout<<"BscTest: End of process"<<std::endl;
108 
109 
110 
111 }
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:163
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, testEve_cfg::level, and MetAnalyzer::pv().

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

276  {
277  //job
278  std::cout<<"BscTest:beggining of job"<<std::endl;;
279 }
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 283 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().

283  {
284  //run
285 
286  std::cout << std::endl << "BscTest:: Begining of Run"<< std::endl;
287 }
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 290 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().

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

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

295  {
296  iev = (*evt)()->GetEventID();
297  if (verbosity > 0) {
298  std::cout <<"BscTest:update Event number = " << iev << std::endl;
299  }
300  whichevent++;
301 }
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 304 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().

304  {
305  itrk = (*trk)()->GetTrackID();
306  if (verbosity > 1) {
307  std::cout <<"BscTest:update BeginOfTrack number = " << itrk << std::endl;
308  }
309  if(itrk == 1) {
310  SumEnerDeposit = 0.;
311  numofpart = 0;
312  SumStepl = 0.;
313  SumStepc = 0.;
314  tracklength0 = 0.;
315  }
316 }
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, HLT_25ns14e33_v1_cff::particleType, SumEnerDeposit, SumStepc, SumStepl, tracklength0, and verbosity.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

321  {
322  itrk = (*trk)()->GetTrackID();
323  if (verbosity > 1) {
324  std::cout <<"BscTest:update EndOfTrack number = " << itrk << std::endl;
325  }
326  if(itrk == 1) {
327  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
328 
329  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
330  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
331 
332  // direction !!!
333  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
334  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
335 
336  // float eta = 0.5 * log( (1.+vert_mom.z()) / (1.-vert_mom.z()) );
337  /*
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:209
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
tuple cout
Definition: gather_cfg.py:121
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, cmsBatch::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__(), 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().

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  for (int j=0; j<theCAFI->entries(); j++) {
726  BscG4Hit* aHit = (*theCAFI)[j];
727  CLHEP::Hep3Vector hitPoint = aHit->getEntry();
728  double zz = hitPoint.z();
729  TheHistManager->GetHisto("zHits")->Fill(zz);
730  if(tracklength0>8300.) TheHistManager->GetHisto("zHitsTrLoLe")->Fill(zz);
731  }
732  // varia = 0;
733  // if( varia == 0) {
734  if( varia == 2) {
735 
736 
737  int nhit11 = 0, nhit12 = 0, nhit13 = 0 ;
738  double totallosenergy= 0.;
739  for (int j=0; j<theCAFI->entries(); j++) {
740  BscG4Hit* aHit = (*theCAFI)[j];
741 
742  CLHEP::Hep3Vector hitEntryLocalPoint = aHit->getEntryLocalP();
743  CLHEP::Hep3Vector hitExitLocalPoint = aHit->getExitLocalP();
744  CLHEP::Hep3Vector hitPoint = aHit->getEntry();
745  int trackIDhit = aHit->getTrackID();
746  unsigned int unitID = aHit->getUnitID();
747  double losenergy = aHit->getEnergyLoss();
748  //double phi_hit = hitPoint.phi();
749  //if (phi_hit < 0.) phi_hit += twopi;
750 
751  double zz = hitPoint.z();
752 
753  TheHistManager->GetHisto("zHitsnoMI")->Fill(zz);
754 
755  if (verbosity > 2) {
756  std::cout << "BscTest:zHits = " << zz << std::endl;
757  }
758 
759  themap[unitID] += losenergy;
760  totallosenergy += losenergy;
761 
762  int zside, sector;
764  zside = (unitID&32)>>5;
765  sector = (unitID&7);
766 
767  //
768  //=======================================
769  G4ThreeVector middle = (hitExitLocalPoint+hitEntryLocalPoint)/2.;
770  themapz[unitID] = hitPoint.z()+middle.z();
771  //=======================================
772  // Y
773  if(zside==1) {
774  //UserNtuples->fillg24(losenergy,1.);
775  if(losenergy > 0.00003) {
776  themap1[unitID] += 1.;
777  }
778  }
779  //X
780  if(zside==2){
781  //UserNtuples->fillg25(losenergy,1.);
782  if(losenergy > 0.00005) {
783  themap1[unitID] += 1.;
784  }
785  }
786  // }
787  //
788  if(sector==1) {
789  nhit11 += 1;
790  //UserNtuples->fillg33(rr,1.);
791  //UserNtuples->fillg11(yy,1.);
792  }
793  if(sector==2) {
794  nhit12 += 1;
795  //UserNtuples->fillg34(rr,1.);
796  //UserNtuples->fillg86(yy,1.);
797  }
798  if(sector==3) {
799  nhit13 += 1;
800  //UserNtuples->fillg35(rr,1.);
801  //UserNtuples->fillg87(yy,1.);
802  }
803 
804  if(lastpo.z()<z4 && lastpo.perp()< 120.) {
805  // MIonly:
806  //UserNtuples->fillg16(lastpo.z(),1.);
807  //UserNtuples->fillg18(zz,1.);
808  // Station I
809  if( zz < z2){
810  //UserNtuples->fillg54(dx,1.);
811  //UserNtuples->fillg55(dy,1.);
812  }
813  // Station II
814  if( zz < z3 && zz > z2){
815  //UserNtuples->fillg50(dx,1.);
816  //UserNtuples->fillg51(dy,1.);
817  }
818  // Station III
819  if( zz < z4 && zz > z3){
820  //UserNtuples->fillg64(dx,1.);
821  //UserNtuples->fillg65(dy,1.);
822  //UserNtuples->filld209(xx,yy,1.);
823  }
824  }
825  else{
826  // no MIonly:
827  //UserNtuples->fillg17(lastpo.z(),1.);
828  //UserNtuples->fillg19(zz,1.);
829  //UserNtuples->fillg74(incidentEnergyHit,1.);
830  //UserNtuples->fillg75(float(trackIDhit),1.);
831  // Station I
832  if( zz < z2){
833  //UserNtuples->fillg56(dx,1.);
834  //UserNtuples->fillg57(dy,1.);
835  //UserNtuples->fillg20(numofpart,1.);
836  //UserNtuples->fillg21(SumEnerDeposit,1.);
837  if(zside==1) {
838  //UserNtuples->fillg26(losenergy,1.);
839  }
840  if(zside==2){
841  //UserNtuples->fillg76(losenergy,1.);
842  }
843  if(trackIDhit == 1){
844  //UserNtuples->fillg70(dx,1.);
845  //UserNtuples->fillg71(incidentEnergyHit,1.);
846  //UserNtuples->fillg79(losenergy,1.);
847  }
848  else{
849  //UserNtuples->fillg82(dx,1.);
850  }
851  }
852  // Station II
853  if( zz < z3 && zz > z2){
854  //UserNtuples->fillg52(dx,1.);
855  //UserNtuples->fillg53(dy,1.);
856  //UserNtuples->fillg22(numofpart,1.);
857  //UserNtuples->fillg23(SumEnerDeposit,1.);
858  //UserNtuples->fillg80(incidentEnergyHit,1.);
859  //UserNtuples->fillg81(float(trackIDhit),1.);
860  if(zside==1) {
861  //UserNtuples->fillg27(losenergy,1.);
862  }
863  if(zside==2){
864  //UserNtuples->fillg77(losenergy,1.);
865  }
866  if(trackIDhit == 1){
867  //UserNtuples->fillg72(dx,1.);
868  //UserNtuples->fillg73(incidentEnergyHit,1.);
869  }
870  else{
871  //UserNtuples->fillg83(dx,1.);
872  }
873  }
874  // Station III
875  if( zz < z4 && zz > z3){
876  if(zside==1) {
877  //UserNtuples->fillg28(losenergy,1.);
878  }
879  if(zside==2){
880  //UserNtuples->fillg78(losenergy,1.);
881  }
882  }
883  }
884  } // MIonly or noMIonly ENDED
885  if(totallosenergy == 0.0) {
886  std::cout << "BscTest: number of hits = " << theCAFI->entries() << std::endl;
887  for (int j=0; j<theCAFI->entries(); j++) {
888  BscG4Hit* aHit = (*theCAFI)[j];
889  double losenergy = aHit->getEnergyLoss();
890  std::cout << " j hits = " << j << "losenergy = " << losenergy << std::endl;
891  }
892  }
893  // FIBRE Hit collected analysis
894  double totalEnergy = 0.;
895  int nhitsX = 0, nhitsY = 0, nsumhit = 0 ;
896  for (int sector=1; sector<4; sector++) {
897  int nhitsecX = 0, nhitsecY = 0;
898  for (int zmodule=1; zmodule<11; zmodule++) {
899  for (int zside=1; zside<3; zside++) {
900  int det= 1;// nhit = 0;
901  // int sScale = 20;
902  int index = BscNumberingScheme::packBscIndex(det, zside, sector);
903  double theTotalEnergy = themap[index];
904  // X planes
905  if(zside<2){
906  //UserNtuples->fillg47(theTotalEnergy,1.);
907  if(theTotalEnergy > 0.00003) {
908  nhitsX += 1;
909  // nhitsecX += themap1[index];
910  // nhit=1;
911  }
912  }
913  // Y planes
914  else {
915  //UserNtuples->fillg49(theTotalEnergy,1.);
916  if(theTotalEnergy > 0.00005) {
917  nhitsY += 1;
918  // nhitsecY += themap1[index];
919  // nhit=1;
920  }
921  }
922 
923  totalEnergy += themap[index];
924  } // for
925  } // for
926  //UserNtuples->fillg39(nhitsecY,1.);
927  if(nhitsecX > 10 || nhitsecY > 10) {
928  nsumhit +=1;
929  //UserNtuples->fillp213(float(sector),float(1.),1.);
930  }
931  else{ //UserNtuples->fillp213(float(sector),float(0.),1.);
932  }
933  } // for
934 
935  if( nsumhit >=2 ) { //UserNtuples->fillp212(vy,float(1.),1.);
936  }
937  else{ //UserNtuples->fillp212(vy,float(0.),1.);
938  }
939  } // MI or no MI or all - end
940  } // primary end
941 
942  if (verbosity > 0) {
943  std::cout << "BscTest: END OF Event " << (*evt)()->GetEventID() << std::endl;
944  }
945 
946 }
int numofpart
Definition: BscTest.h:216
double z2
Definition: BscTest.h:222
int i
Definition: DBlmapReader.cc:9
G4ThreeVector getEntryLocalP() const
Definition: BSCG4Hit.cc:118
TH1F * GetHisto(Int_t Number)
Definition: BscTest.cc:209
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
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
tuple log
Definition: cmsBatch.py:341

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.