CMS 3D CMS Logo

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

#include <FP420Test.h>

Inheritance diagram for FP420Test:
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

 FP420Test (const edm::ParameterSet &p)
 
virtual ~FP420Test ()
 
- 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

int dn0
 
G4double entot0
 
std::string fDataLabel
 
std::string fOutputFile
 
Float_t fp420eventarray [1]
 
TNtuple * fp420eventntuple
 
TFile fp420OutputFile
 
std::string fRecreateFile
 
double gapBlade
 
int iev
 
int itrk
 
G4ThreeVector lastpo
 
int lastTrackID
 
int numofpart
 
int pn0
 
double rinCalo
 
int rn0
 
int rn00
 
int sn0
 
G4double SumEnerDeposit
 
G4double SumStepc
 
G4double SumStepl
 
Fp420AnalysisHistManagerTheHistManager
 
G4double tracklength0
 
int verbosity
 
int whichevent
 
double z1
 
double z2
 
double z3
 
double z4
 
double z420
 
double zBlade
 
double ZBoundDet
 
double zD2
 
double zD3
 
double ZGapLDet
 
double zinCalo
 
double zinibeg
 
double ZSiDet
 
double ZSiPlane
 
double ZSiStep
 

Additional Inherited Members

Detailed Description

Definition at line 162 of file FP420Test.h.

Constructor & Destructor Documentation

FP420Test::FP420Test ( const edm::ParameterSet p)

Definition at line 54 of file FP420Test.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, HIPAlignmentAlgorithm_cfi::verbosity, FP420Track_cfi::z420, FP420Track_cfi::zD2, and FP420Track_cfi::zD3.

54  {
55  //constructor
56  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("FP420Test");
57  verbosity = m_Anal.getParameter<int>("Verbosity");
58  //verbosity = 1;
59 
60  fDataLabel = m_Anal.getParameter<std::string>("FDataLabel");
61  fOutputFile = m_Anal.getParameter<std::string>("FOutputFile");
62  fRecreateFile = m_Anal.getParameter<std::string>("FRecreateFile");
63 
64  if (verbosity > 0) {
65  std::cout<<"============================================================================"<<std::endl;
66  std::cout << "FP420Testconstructor :: Initialized as observer"<< std::endl;
67  }
68  // Initialization:
69 
70  pn0 = 6;
71  sn0 = 3;
72  rn00 = 7;
73 
74  z420 = 420000.0; // mm
75  zD2 = 4000.0; // mm
76  zD3 = 8000.0; // mm
77  //
78  zBlade = 5.00;
79  gapBlade = 1.6;
80  double gapSupplane = 1.6;
81  ZSiPlane=2*zBlade+gapBlade+gapSupplane;
82 
83  double ZKapton = 0.1;
84  ZSiStep=ZSiPlane+ZKapton;
85 
86  double ZBoundDet = 0.020;
87  double ZSiElectr = 0.250;
88  double ZCeramDet = 0.500;
89  //
90  ZSiDet = 0.250;
91  ZGapLDet= zBlade/2-(ZSiDet+ZSiElectr+ZBoundDet+ZCeramDet/2);
92  //
93  // ZSiStation = 5*(2*(5.+1.6)+0.1)+2*6.+1.0 = 79.5
94  double ZSiStation = (pn0-1)*(2*(zBlade+gapBlade)+ZKapton)+2*6.+0.0; // = 78.5
95  // 11.=e1, 12.=e2 in zzzrectangle.xml
96  double eee1=11.;
97  double eee2=12.;
98 
99  zinibeg = (eee1-eee2)/2.;
100 
101  z1 = zinibeg + (ZSiStation+10.)/2 + z420; // z1 - right after 1st Station
102  z2 = z1+zD2; //z2 - right after middle Station
103  z3 = z1+zD3; //z3 - right after last Station
104  z4 = z1+2*zD3;
105  //==================================
106 
107  fp420eventntuple = new TNtuple("NTfp420event","NTfp420event","evt");
108 
109  whichevent = 0;
110 
111  // fDataLabel = "defaultData";
112  // fOutputFile = "TheAnlysis.root";
113  // fRecreateFile = "RECREATE";
114 
115  TheHistManager = new Fp420AnalysisHistManager(fDataLabel);
116 
117  if (verbosity > 0) {
118  std::cout << "FP420Test constructor :: Initialized Fp420AnalysisHistManager"<< std::endl;
119  }
120 }
T getParameter(std::string const &) const
double z4
Definition: FP420Test.h:218
double zinibeg
Definition: FP420Test.h:222
double z2
Definition: FP420Test.h:218
int verbosity
Definition: FP420Test.h:207
std::string fRecreateFile
Definition: FP420Test.h:235
double ZSiStep
Definition: FP420Test.h:222
double ZSiDet
Definition: FP420Test.h:221
double zD2
Definition: FP420Test.h:218
double ZSiPlane
Definition: FP420Test.h:222
int rn00
Definition: FP420Test.h:220
std::string fOutputFile
Definition: FP420Test.h:234
int whichevent
Definition: FP420Test.h:230
double zD3
Definition: FP420Test.h:218
double z3
Definition: FP420Test.h:218
double z1
Definition: FP420Test.h:218
double z420
Definition: FP420Test.h:221
double ZBoundDet
Definition: FP420Test.h:222
double ZGapLDet
Definition: FP420Test.h:222
double gapBlade
Definition: FP420Test.h:223
Fp420AnalysisHistManager * TheHistManager
Definition: FP420Test.h:232
TNtuple * fp420eventntuple
Definition: FP420Test.h:228
std::string fDataLabel
Definition: FP420Test.h:233
double zBlade
Definition: FP420Test.h:223
FP420Test::~FP420Test ( )
virtual

Definition at line 122 of file FP420Test.cc.

References gather_cfg::cout, and HIPAlignmentAlgorithm_cfi::verbosity.

122  {
123  // delete UserNtuples;
124 
125  TFile fp420OutputFile("newntfp420.root","RECREATE");
126  std::cout << "FP420 output root file has been created";
127  fp420eventntuple->Write();
128  std::cout << ", written";
129  fp420OutputFile.Close();
130  std::cout << ", closed";
131  delete fp420eventntuple;
132  std::cout << ", and deleted" << std::endl;
133 
134  //------->while end
135 
136  // Write histograms to file
138  if (verbosity > 0) {
139  std::cout << std::endl << "FP420Test Destructor --------> End of FP420Test : " << std::endl;
140  }
141 }
int verbosity
Definition: FP420Test.h:207
TFile fp420OutputFile
Definition: FP420Test.h:229
std::string fRecreateFile
Definition: FP420Test.h:235
void WriteToFile(const TString &fOutputFile, const TString &fRecreateFile)
Definition: FP420Test.cc:207
std::string fOutputFile
Definition: FP420Test.h:234
Fp420AnalysisHistManager * TheHistManager
Definition: FP420Test.h:232
TNtuple * fp420eventntuple
Definition: FP420Test.h:228

Member Function Documentation

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

Definition at line 828 of file FP420Test.cc.

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

829  {
830 
831  //Get name and copy numbers
832  if (level > 0) {
833  for (int ii = 0; ii < level; ii++) {
834  int i = level - ii - 1;
835  G4VPhysicalVolume* pv = touch->GetVolume(i);
836  if (pv != 0)
837  name[ii] = pv->GetName();
838  else
839  name[ii] = "Unknown";
840  copyno[ii] = touch->GetReplicaNumber(i);
841  }
842  }
843 }
def pv(vc)
Definition: MetAnalyzer.py:6
ii
Definition: cuy.py:588
int FP420Test::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 806 of file FP420Test.cc.

806  {
807 
808  //Return number of levels
809  if (touch)
810  return ((touch->GetHistoryDepth())+1);
811  else
812  return 0;
813 }
G4String FP420Test::detName ( const G4VTouchable *  touch,
int  level,
int  currentlevel 
) const
private

Definition at line 816 of file FP420Test.cc.

References cuy::ii.

817  {
818 
819  //Go down to current level
820  if (level > 0 && level >= currentlevel) {
821  int ii = level - currentlevel;
822  return touch->GetVolume(ii)->GetName();
823  } else {
824  return "NotFound";
825  }
826 }
ii
Definition: cuy.py:588
void FP420Test::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

325  {
326  //job
327  std::cout<<"FP420Test:beggining of job"<<std::endl;;
328 }
void FP420Test::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

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

332  {
333  //run
334 
335  std::cout << std::endl << "FP420Test:: Begining of Run"<< std::endl;
336 }
void FP420Test::update ( const EndOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

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

338 {;}
void FP420Test::update ( const BeginOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 341 of file FP420Test.cc.

References gather_cfg::cout, and HIPAlignmentAlgorithm_cfi::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().

341  {
342  iev = (*evt)()->GetEventID();
343  if (verbosity > 0) {
344  std::cout <<"FP420Test:update Event number = " << iev << std::endl;
345  }
346  whichevent++;
347 }
int verbosity
Definition: FP420Test.h:207
int whichevent
Definition: FP420Test.h:230
void FP420Test::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 350 of file FP420Test.cc.

References gather_cfg::cout, and HIPAlignmentAlgorithm_cfi::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().

350  {
351  itrk = (*trk)()->GetTrackID();
352  if (verbosity > 1) {
353  std::cout <<"FP420Test:update BeginOfTrack number = " << itrk << std::endl;
354  }
355  if(itrk == 1) {
356  SumEnerDeposit = 0.;
357  numofpart = 0;
358  SumStepl = 0.;
359  SumStepc = 0.;
360  tracklength0 = 0.;
361  }
362 }
G4double SumStepl
Definition: FP420Test.h:210
int verbosity
Definition: FP420Test.h:207
G4double SumEnerDeposit
Definition: FP420Test.h:210
int itrk
Definition: FP420Test.h:194
int numofpart
Definition: FP420Test.h:212
G4double SumStepc
Definition: FP420Test.h:210
G4double tracklength0
Definition: FP420Test.h:195
void FP420Test::update ( const G4Step *  )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 465 of file FP420Test.cc.

References gather_cfg::cout, mps_fire::i, objects.autophobj::particleType, and HIPAlignmentAlgorithm_cfi::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().

465  {
466 // ==========================================================================
467 
468  if (verbosity > 2) {
469  G4int stepnumber = aStep->GetTrack()->GetCurrentStepNumber();
470  std::cout <<"FP420Test:update Step number = " << stepnumber << std::endl;
471  }
472  // track on aStep: !
473  G4Track* theTrack = aStep->GetTrack();
474  TrackInformation* trkInfo = dynamic_cast<TrackInformation*> (theTrack->GetUserInformation());
475  if (trkInfo == 0) {
476  std::cout << "FP420Test on aStep: No trk info !!!! abort " << std::endl;
477  }
478  G4int id = theTrack->GetTrackID();
479  G4String particleType = theTrack->GetDefinition()->GetParticleName(); // !!!
480  G4int parentID = theTrack->GetParentID(); // !!!
481  G4TrackStatus trackstatus = theTrack->GetTrackStatus(); // !!!
482  G4double tracklength = theTrack->GetTrackLength(); // Accumulated track length
483  G4ThreeVector trackmom = theTrack->GetMomentum();
484  G4double entot = theTrack->GetTotalEnergy(); // !!! deposited on step
485  G4int curstepnumber = theTrack->GetCurrentStepNumber();
486  G4ThreeVector vert_pos = theTrack->GetVertexPosition(); // vertex ,where this track was created
487  G4ThreeVector vert_mom = theTrack->GetVertexMomentumDirection();
488 
489 // double costheta =vert_mom.z()/sqrt(vert_mom.x()*vert_mom.x()+vert_mom.y()*vert_mom.y()+vert_mom.z()*vert_mom.z());
490 // double theta = acos(min(max(costheta,double(-1.)),double(1.)));
491 // float eta = -log(tan(theta/2));
492 // double phi = -1000.;
493 // if (vert_mom.x() != 0) phi = atan2(vert_mom.y(),vert_mom.x());
494 // if (phi < 0.) phi += twopi;
495 // double phigrad = phi*360./twopi;
496 
497 //G4double trackvel = theTrack->GetVelocity();
498 
499 //std::cout << " trackstatus= " << trackstatus << " entot= " << entot << std::endl;
500 
501 
502  // step points: !
503  G4double stepl = aStep->GetStepLength();
504  G4double EnerDeposit = aStep->GetTotalEnergyDeposit();
505  // pointers: !
506 //G4VPhysicalVolume* physvol = theTrack->GetVolume();
507 //G4VPhysicalVolume* nextphysvol = theTrack->GetNextVolume();
508 //G4Material* materialtr = theTrack->GetMaterial();
509 //G4Material* nextmaterialtr = theTrack->GetNextMaterial();
510 
511  // preStep
512  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
513  G4ThreeVector preposition = preStepPoint->GetPosition();
514  G4ThreeVector prelocalpoint = theTrack->GetTouchable()->GetHistory()->
515  GetTopTransform().TransformPoint(preposition);
516  G4VPhysicalVolume* currentPV = preStepPoint->GetPhysicalVolume();
517  G4String prename = currentPV->GetName();
518 
519  const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
520  int pre_levels = detLevels(pre_touch);
521 
522  G4String name1[20]; int copyno1[20];
523  for(int i=0; i<20; ++i) {
524  name1[i] = "";
525  copyno1[i] = 0;
526  }
527  if (pre_levels > 0) {
528  detectorLevel(pre_touch, pre_levels, copyno1, name1);
529  }
530 
531 // G4LogicalVolume* lv = currentPV->GetLogicalVolume();
532 // G4Material* mat = lv->GetMaterial();
533 // std::string prenameVolume;
534 // prenameVolume.assign(prename,0,20);
535 
536 // G4double prebeta = preStepPoint->GetBeta();
537 // G4double precharge = preStepPoint->GetCharge();
538 // G4double prerad = mat->GetRadlen();
539 
540 // std::cout << " EneryDeposited = " << EnerDeposit << std::endl;
541 // std::cout << " prevolume = " << prename << std::endl;
543 // std::cout << " preposition = " << preposition << std::endl;
544  /*
545  // postStep
546  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
547  G4ThreeVector posposition = postStepPoint->GetPosition();
548  G4ThreeVector poslocalpoint = theTrack->GetTouchable()->GetHistory()->
549  GetTopTransform().TransformPoint(posposition);
550  G4VPhysicalVolume* poscurrentPV = postStepPoint->GetPhysicalVolume();
551  G4String posname = poscurrentPV->GetName();
552 // G4LogicalVolume* poslv = poscurrentPV->GetLogicalVolume();
553 // G4Material* posmat = poslv->GetMaterial();
554 // std::string posnameVolume;
555 // posnameVolume.assign(posname,0,20);
556 
557 #ifdef ddebug
558  std::cout << "============posStep: information:============" << std::endl;
559  std::cout << " posposition = " << posposition
560  << " poslocalpoint = " << poslocalpoint
561  << " posvolume = " << posname
562  // << " posnameVolume = " << posnameVolume
563  << std::endl;
564 
565  std::cout << " ==========================================" << std::endl;
566 #endif
567 
568 
569 */
570 
571 // //
572 // //
573 
574  // 24.01.2006:
575 // tr : id parentID trackstatus tracklength curstepnumber entot vert_pos
576 // st : stepl EnerDeposit
577 // prestep: preposition prevolume = SBSTm SIDETL SIDETR name= SISTATION copy= 1,2,3 name= SIPLANE copy= 1..5..10
578 
579 // gen_track:
580 // id=1 parentID=1 trackstatus=0,2 tracklength(accumulated) curstepnumber entot vert_pos
581  if ( id == 1 ) {
582 
583  // on 1-st step:
584  if (curstepnumber == 1 ) {
585  entot0 = entot;
586  //UserNtuples->fillg519(entot0,1.);
587 
588  }
589 
590  // on every step:
591 
592  // for Copper:
593  if(prename == "SBST" ) {
594  SumStepc += stepl;
595  // =========
596  }
597  // for ststeel:
598 // if(prename == "SBSTs") {
599  if(prename == "SBSTs" ) {
600  SumStepl += stepl;
601  // =========
602  }
603  // =========
604  // =========
605 
606  // exclude last track point if it is in SD (MI was started their)
607  if (trackstatus != 2 ) {
608  // for SD: Si Det.: SISTATION:SIPLANE:(SIDETL+BOUNDDET +SIDETR + CERAMDET)
609  if(prename == "SIDETL" || prename == "SIDETR" ) {
610  if(prename == "SIDETL") {
611  //UserNtuples->fillg569(EnerDeposit,1.);
612  }
613  if(prename == "SIDETR") {
614  //UserNtuples->fillg570(EnerDeposit,1.);
615  }
616 
617 // double numbcont = 10.*(copyno1[2]-1)+copyno1[3];
618 
619  // =========
620 // double xx = preposition.x();
621 // double yy = preposition.y();
622 // double zz = preposition.z();
623  // =========
624  //UserNtuples->fillg580(theta,1.);
625  //UserNtuples->fillg07(phigrad,1.);
626 // double xPrimAtZhit = vert_pos.x() + (zz-vert_pos.z())*tan(theta)*cos(phi);
627 // double yPrimAtZhit = vert_pos.y() + (zz-vert_pos.z())*tan(theta)*sin(phi);
628  // =========
629 // double dx = xPrimAtZhit - xx;
630 // double dy = yPrimAtZhit - yy;
631  // =========
632 
633 // //UserNtuples->fillp212(numbcont,dx,1.);
634 // //UserNtuples->fillp213(numbcont,dy,1.);
635  // =========
636 
637  // last step of current SD Volume:
638  G4String posname = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
639  if((prename == "SIDETL" && posname != "SIDETL") || (prename == "SIDETR" && posname != "SIDETR")) {
640  if(name1[2] == "SISTATION" ) {
641  //UserNtuples->fillg539(copyno1[2],1.);
642  }
643  if(name1[3] == "SIPLANE" ) {
644  //UserNtuples->fillg540(copyno1[3],1.);
645  }
646 
647  if(prename == "SIDETL") {
648  //UserNtuples->fillg541(EnerDeposit,1.);
649  //UserNtuples->fillg561(numbcont,1.);
650  if(copyno1[2]<2) {
651  //UserNtuples->fillg571(dx,1.);
652  }
653  else if(copyno1[2]<3) {
654  //UserNtuples->fillg563(dx,1.);
655  if(copyno1[3]<2) {
656  }
657  else if(copyno1[3]<3) {
658  //UserNtuples->fillg572(dx,1.);
659  }
660  else if(copyno1[3]<4) {
661  //UserNtuples->fillg573(dx,1.);
662  }
663  else if(copyno1[3]<5) {
664  //UserNtuples->fillg574(dx,1.);
665  }
666  else if(copyno1[3]<6) {
667  //UserNtuples->fillg575(dx,1.);
668  }
669  else if(copyno1[3]<7) {
670  //UserNtuples->fillg576(dx,1.);
671  }
672  else if(copyno1[3]<8) {
673  //UserNtuples->fillg577(dx,1.);
674  }
675  else if(copyno1[3]<9) {
676  //UserNtuples->fillg578(dx,1.);
677  }
678  else if(copyno1[3]<10) {
679  //UserNtuples->fillg579(dx,1.);
680  }
681  }
682  else if(copyno1[2]<4) {
683  //UserNtuples->fillg565(dx,1.);
684  }
685  else if(copyno1[2]<5) {
686  //UserNtuples->fillg567(dx,1.);
687  }
688  }
689  if(prename == "SIDETR") {
690  //UserNtuples->fillg542(EnerDeposit,1.);
691  //UserNtuples->fillg562(numbcont,1.);
692  if(copyno1[2]<2) {
693  //UserNtuples->fillg581(dy,1.);
694  }
695  else if(copyno1[2]<3) {
696  //UserNtuples->fillg564(dy,1.);
697  if(copyno1[3]<2) {
698  }
699  else if(copyno1[3]<3) {
700  //UserNtuples->fillg582(dy,1.);
701  }
702  else if(copyno1[3]<4) {
703  //UserNtuples->fillg583(dy,1.);
704  }
705  else if(copyno1[3]<5) {
706  //UserNtuples->fillg584(dy,1.);
707  }
708  else if(copyno1[3]<6) {
709  //UserNtuples->fillg585(dy,1.);
710  }
711  else if(copyno1[3]<7) {
712  //UserNtuples->fillg586(dy,1.);
713  }
714  else if(copyno1[3]<8) {
715  //UserNtuples->fillg587(dy,1.);
716  }
717  else if(copyno1[3]<9) {
718  //UserNtuples->fillg588(dy,1.);
719  }
720  else if(copyno1[3]<10) {
721  //UserNtuples->fillg589(dy,1.);
722  }
723  }
724  else if(copyno1[2]<4) {
725  //UserNtuples->fillg566(dy,1.);
726  }
727  else if(copyno1[2]<5) {
728  //UserNtuples->fillg568(dy,1.);
729  }
730  }
731 
732  }
733  }
734  // end of prenames SIDETL // SIDETR
735  }
736  // end of trackstatus != 2
737 
738 
739  // deposition of energy on steps along primary track
740  //UserNtuples->fillg500(EnerDeposit,1.);
741  // collect sum deposited energy on all steps along primary track
742  SumEnerDeposit += EnerDeposit;
743  // position of step for primary track:
744  //UserNtuples->fillg501(preposition.x(),1.);
745  //UserNtuples->fillg502(preposition.y(),1.);
746  //UserNtuples->fillg503(preposition.z(),1.);
747  //UserNtuples->fillg504(preposition.x(),EnerDeposit);
748  //UserNtuples->fillg505(preposition.y(),EnerDeposit);
749  //UserNtuples->fillg506(preposition.z(),EnerDeposit);
750  // 2D step coordinates weighted by energy deposited on step
751 // //UserNtuples->fillp201(preposition.x(),preposition.y(),EnerDeposit);
752 // //UserNtuples->fillp202(preposition.x(),preposition.z(),EnerDeposit);
753 // //UserNtuples->fillp203(preposition.y(),preposition.z(),EnerDeposit);
754  //UserNtuples->filld204(preposition.x(),preposition.y(),EnerDeposit);
755  //UserNtuples->filld205(preposition.x(),preposition.z(),EnerDeposit);
756  //UserNtuples->filld206(preposition.y(),preposition.z(),EnerDeposit);
757  //UserNtuples->filld223(preposition.y(),preposition.z(),EnerDeposit);
758  // last step of primary track
759  if (trackstatus == 2 ) {
760  // primary track length
761  // //UserNtuples->fillg508(tracklength,1.);
762  tracklength0 = tracklength;
763  // how many steps primary track consist
764  //UserNtuples->fillg509(curstepnumber,1.);
765  // tot. energy of primary track at the end of trajectory(before disappeare)
766  //UserNtuples->fillg510((entot0-entot),1.);
767  //UserNtuples->fillg520((entot0-entot),1.);
768  }
769  }
770  // end of primary track !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
771 
772 
773  if (parentID == 1 && curstepnumber == 1) {
774  // particles deposit their energy along primary track
775  numofpart += 1;
776  // energy of radiated particle
777  //UserNtuples->fillg511(entot,1.);
778  // coordinates of radiated particle
779  //UserNtuples->fillg512(vert_pos.x(),1.);
780  //UserNtuples->fillg513(vert_pos.y(),1.);
781  //UserNtuples->fillg514(vert_pos.z(),1.);
782  //UserNtuples->fillg515(vert_pos.x(),entot);
783  //UserNtuples->fillg516(vert_pos.y(),entot);
784  //UserNtuples->fillg517(vert_pos.z(),entot);
785 
786  //UserNtuples->filld214(vert_pos.x(),vert_pos.y(),1.);
787  //UserNtuples->filld215(vert_pos.x(),vert_pos.z(),1.);
788  //UserNtuples->filld216(vert_pos.y(),vert_pos.z(),1.);
789  //UserNtuples->filld219(vert_pos.y(),vert_pos.z(),1.);
790  //UserNtuples->filld224(vert_pos.y(),vert_pos.z(),1.);
791  if(prename == "SBST" ) {
792  //UserNtuples->filld225(vert_pos.y(),vert_pos.z(),1.);
793  }
794  if(prename == "SBSTs" ) {
795  //UserNtuples->filld226(vert_pos.y(),vert_pos.z(),1.);
796  }
797  }
798 
799 
800 
801  // ==========================================================================
802 
803 }
G4double SumStepl
Definition: FP420Test.h:210
int verbosity
Definition: FP420Test.h:207
G4double SumEnerDeposit
Definition: FP420Test.h:210
G4double entot0
Definition: FP420Test.h:195
int numofpart
Definition: FP420Test.h:212
G4double SumStepc
Definition: FP420Test.h:210
int detLevels(const G4VTouchable *) const
Definition: FP420Test.cc:806
G4double tracklength0
Definition: FP420Test.h:195
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: FP420Test.cc:828
void FP420Test::update ( const EndOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 365 of file FP420Test.cc.

References gather_cfg::cout, and HIPAlignmentAlgorithm_cfi::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().

365  {
366  itrk = (*trk)()->GetTrackID();
367  if (verbosity > 1) {
368  std::cout <<"FP420Test:update EndOfTrack number = " << itrk << std::endl;
369  }
370  if(itrk == 1) {
371  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
372 
373  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
374  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
375 
376  // direction !!!
377  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
378  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
379 
380 // float eta = 0.5 * log( (1.+vert_mom.z()) / (1.-vert_mom.z()) );
381 // float phi = atan2(vert_mom.y(),vert_mom.x());
382 // if (phi < 0.) phi += twopi;
383 // float phigrad = phi*180./pi;
384 
385 // float XV = vert_pos.x(); // mm
386 // float YV = vert_pos.y(); // mm
387  //UserNtuples->fillg543(phigrad,1.);
388  //UserNtuples->fillp203(phigrad,SumStepl,1.);
389  //UserNtuples->fillg544(XV,1.);
390  //UserNtuples->fillp201(XV,SumStepl,1.);
391  //UserNtuples->fillg545(YV,1.);
392  //UserNtuples->fillp202(YV,SumStepl,1.);
393 
394  //UserNtuples->fillg524(eta,1.);
395 
396  //UserNtuples->fillg534(SumStepl,1.);
397  //UserNtuples->fillg535(eta,SumStepl);
398  //UserNtuples->fillp207(eta,SumStepl,1.);
399  //UserNtuples->filld217(eta,SumStepl,1.);
400  //UserNtuples->filld220(phigrad,SumStepl,1.);
401  //UserNtuples->filld221(XV,SumStepl,1.);
402  //UserNtuples->filld222(YV,SumStepl,1.);
403  //UserNtuples->fillg537(SumStepc,1.);
404  //UserNtuples->fillg84(SumStepl,1.);
405 
406 // MI = (multiple interactions):
407  if(tracklength < z4) {
408 // //UserNtuples->fillp208(eta,tracklength,1.);
409  //UserNtuples->filld218(eta,tracklength,1.);
410  //UserNtuples->fillg538(SumStepc,1.);
411  //UserNtuples->fillg85(SumStepl,1.);
412  }
413 
414  // last step information
415  const G4Step* aStep = (*trk)()->GetStep();
416  // G4int csn = (*trk)()->GetCurrentStepNumber();
417  // G4double sl = (*trk)()->GetStepLength();
418  // preStep
419  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
420  lastpo = preStepPoint->GetPosition();
421 
422  // Analysis:
423  if(lastpo.z()<z1 && lastpo.perp()< 100.) {
424  //UserNtuples->fillg525(eta,1.);
425  //UserNtuples->fillg546(XV,1.);
426  //UserNtuples->fillg551(YV,1.);
427  //UserNtuples->fillg556(phigrad,1.);
428  }
429  if((lastpo.z()>z1 && lastpo.z()<z2) && lastpo.perp()< 100.) {
430  //UserNtuples->fillg526(eta,1.);
431  //UserNtuples->fillg547(XV,1.);
432  //UserNtuples->fillg552(YV,1.);
433  //UserNtuples->fillg557(phigrad,1.);
434  }
435  if(lastpo.z()<z2 && lastpo.perp()< 100.) {
436  //UserNtuples->fillg527(eta,1.);
437  //UserNtuples->fillg548(XV,1.);
438  //UserNtuples->fillg553(YV,1.);
439  //UserNtuples->fillg558(phigrad,1.);
440  //UserNtuples->fillg521(lastpo.x(),1.);
441  //UserNtuples->fillg522(lastpo.y(),1.);
442  //UserNtuples->fillg523(lastpo.z(),1.);
443  }
444  if(lastpo.z()<z3 && lastpo.perp()< 100.) {
445  //UserNtuples->fillg528(eta,1.);
446  //UserNtuples->fillg549(XV,1.);
447  //UserNtuples->fillg554(YV,1.);
448  //UserNtuples->fillg559(phigrad,1.);
449  }
450  if(lastpo.z()<z4 && lastpo.perp()< 100.) {
451  //UserNtuples->fillg529(eta,1.);
452  //UserNtuples->fillg550(XV,1.);
453  //UserNtuples->fillg555(YV,1.);
454  //UserNtuples->fillg560(phigrad,1.);
455  //UserNtuples->fillg531(lastpo.x(),1.);
456  //UserNtuples->fillg532(lastpo.y(),1.);
457  //UserNtuples->fillg533(lastpo.z(),1.);
458  }
459  }
460 }
double z4
Definition: FP420Test.h:218
double z2
Definition: FP420Test.h:218
int verbosity
Definition: FP420Test.h:207
G4ThreeVector lastpo
Definition: FP420Test.h:214
G4double SumEnerDeposit
Definition: FP420Test.h:210
double z3
Definition: FP420Test.h:218
double z1
Definition: FP420Test.h:218
int itrk
Definition: FP420Test.h:194
TH1F * GetHisto(Int_t Number)
Definition: FP420Test.cc:253
Fp420AnalysisHistManager * TheHistManager
Definition: FP420Test.h:232
void FP420Test::update ( const EndOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 847 of file FP420Test.cc.

References gather_cfg::cout, stringResolutionProvider_cfi::eta, objects.autophobj::float, FP420G4Hit::getEnergyLoss(), FP420G4Hit::getEntry(), FP420G4Hit::getEntryLocalP(), FP420G4Hit::getExitLocalP(), FP420G4Hit::getTrackID(), FP420G4Hit::getUnitID(), mps_fire::i, cuy::ii, diffTreeTool::index, cmsBatch::log, ntfp420_evt, FP420NumberingScheme::packFP420Index(), FP420NumberingScheme::packMYIndex(), pi, FP420NumberingScheme::realzside(), funct::tan(), FP420NumberingScheme::unpackCopyIndex(), FP420NumberingScheme::unpackFP420Index(), FP420NumberingScheme::unpackLayerIndex(), FP420NumberingScheme::unpackOrientation(), HIPAlignmentAlgorithm_cfi::verbosity, FP420Track_cfi::z420, FP420Track_cfi::zD2, FP420Track_cfi::zD3, HcalDigiParam_cfi::zside, and geometryCSVtoXML::zz.

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

847  {
848  // ==========================================================================
849 
850  if (verbosity > 1) {
851  iev = (*evt)()->GetEventID();
852  std::cout <<"FP420Test:update EndOfEvent = " << iev << std::endl;
853  }
854  // Fill-in ntuple
856 
857  //
858  int trackID = 0;
859  G4PrimaryParticle* thePrim=0;
860 
861 
862  // prim.vertex:
863  G4int nvertex = (*evt)()->GetNumberOfPrimaryVertex();
864  if (nvertex !=1)
865  std::cout << "FP420Test: My warning: NumberOfPrimaryVertex != 1 --> = " << nvertex << std::endl;
866 
867  for (int i = 0 ; i<nvertex; i++) {
868  G4PrimaryVertex* avertex = (*evt)()->GetPrimaryVertex(i);
869  if (avertex == 0)
870  std::cout << "FP420Test End Of Event ERR: pointer to vertex = 0"
871  << std::endl;
872  G4int npart = avertex->GetNumberOfParticle();
873  if (npart !=1)
874  std::cout << "FP420Test: My warning: NumberOfPrimaryPart != 1 --> = " << npart << std::endl;
875  if (npart ==0)
876  std::cout << "FP420Test End Of Event ERR: no NumberOfParticle" << std::endl;
877 
878  // find just primary track: track pointer: thePrim
879  if (thePrim==0) thePrim=avertex->GetPrimary(trackID);
880 
881  if (thePrim!=0) {
882  // primary vertex:
883  G4double vx=0.,vy=0.,vz=0.;
884  vx = avertex->GetX0();
885  vy = avertex->GetY0();
886  vz = avertex->GetZ0();
887  //UserNtuples->fillh01(vx);
888  //UserNtuples->fillh02(vy);
889  //UserNtuples->fillh03(vz);
890  TheHistManager->GetHisto("VtxX")->Fill(vx);
891  TheHistManager->GetHisto("VtxY")->Fill(vy);
892  TheHistManager->GetHisto("VtxZ")->Fill(vz);
893  }
894  }
895  // prim.vertex loop end
896 
897 //=========================== thePrim != 0 ================================================================================
898  if (thePrim != 0) {
899 // inline G4ParticleDefinition * GetG4code() const
900 // inline G4PrimaryParticle * GetNext() const
901 // inline G4PrimaryParticle * GetDaughter() const
902 
903 // prim.vertex
904  //int ivert = 0 ;
905  //G4PrimaryVertex* avertex = (*evt)()->GetPrimaryVertex(ivert);
906  //G4double vx=0.,vy=0.,vz=0.;
907  //vx = avertex->GetX0();
908  //vy = avertex->GetY0();
909  //vz = avertex->GetZ0();
910 
911  //
912  // number of secondary particles deposited their energy along primary track
913  //UserNtuples->fillg518(numofpart,1.);
914  if(lastpo.z()<z4 && lastpo.perp()< 100.) {
915  //UserNtuples->fillg536(numofpart,1.);
916  }
917  //
918 
919  // direction !!!
920  G4ThreeVector mom = thePrim->GetMomentum();
921 
922  double phi = atan2(mom.y(),mom.x());
923  if (phi < 0.) phi += twopi;
924  double phigrad = phi*180./pi;
925 
926  double th = mom.theta();
927  double eta = -log(tan(th/2));
928 // works OK:
929 // double costheta =mom.z()/sqrt(mom.x()*mom.x()+mom.y()*mom.y()+mom.z()*mom.z());
930  // double theta = acos(min(max(costheta,double(-1.)),double(1.)));
931 
932  //UserNtuples->fillh04(eta);
933  //UserNtuples->fillh05(phigrad);
934  //UserNtuples->fillh06(th);
935 
936  //UserNtuples->fillg13(lastpo.x(),1.);
937  //UserNtuples->fillg14(lastpo.y(),1.);
938  //UserNtuples->fillg15(lastpo.z(),1.);
939 
940  TheHistManager->GetHisto("PrimaryEta")->Fill(eta);
941  TheHistManager->GetHisto("PrimaryPhigrad")->Fill(phigrad);
942  TheHistManager->GetHisto("PrimaryTh")->Fill(th*180./pi);
943 
944  TheHistManager->GetHisto("PrimaryLastpoZ")->Fill(lastpo.z());
945  if(lastpo.z() < z4 ) {
946  TheHistManager->GetHisto("PrimaryLastpoX")->Fill(lastpo.x());
947  TheHistManager->GetHisto("PrimaryLastpoY")->Fill(lastpo.y());
948  }
949  if(numofpart > 4 ) {
950  TheHistManager->GetHisto("XLastpoNumofpart")->Fill(lastpo.x());
951  TheHistManager->GetHisto("YLastpoNumofpart")->Fill(lastpo.y());
952  }
953 
954  // ==========================================================================
955 
956  // hit map for FP420
957  // ==================================
958 
959  map<int,float,less<int> > themap;
960  map<int,float,less<int> > themap1;
961 
962  map<int,float,less<int> > themapxy;
963  map<int,float,less<int> > themapz;
964  // access to the G4 hit collections: -----> this work OK:
965 
966 // edm::LogInfo("FP420Test") << "1";
967  G4HCofThisEvent* allHC = (*evt)()->GetHCofThisEvent();
968 // edm::LogInfo("FP420Test") << "2";
969  if (verbosity > 0) {
970  std::cout << "FP420Test: accessed all HC" << std::endl;;
971  }
972  int CAFIid = G4SDManager::GetSDMpointer()->GetCollectionID("FP420SI");
973  // edm::LogInfo("FP420Test") << "3";
974  // std::cout << " CAFIid = " << CAFIid << std::endl;;
975 
976  FP420G4HitCollection* theCAFI = (FP420G4HitCollection*) allHC->GetHC(CAFIid);
977  // CaloG4HitCollection* theCAFI = (CaloG4HitCollection*) allHC->GetHC(CAFIid);
978  if (verbosity > 0) {
979  //std::cout << "FP420Test: theCAFI = " << theCAFI << std::endl;
980  std::cout << "FP420Test: theCAFI->entries = " << theCAFI->entries() << std::endl;
981  }
982  // edm::LogInfo("FP420Test") << "theCAFI->entries="<< theCAFI->entries();
983  TheHistManager->GetHisto("NumberOfHits")->Fill(theCAFI->entries());
984 
985  // access to the G4 hit collections ----> variant 2: give 0 hits
986 // FP420G4HitCollection * theCAFI;
987 // theCAFI = new FP420G4HitCollection();
988  // ==========================================================================
989  // Silicon Hit collection start
990  //0) if particle goes into flat beam pipe below detector:
991  int varia ; // = 0 -all; =1 - MI; =2 - noMI
992  // Select MI or noMI over all 3 stations
993  // 1)MI:
994  // if particle goes through window into detector:
995  // lastpoint of track in lateral dir. outside the detector and inside in z
996  // lastpoint of track in lateral dir. outside the detector and inside in z
997  // for all except zzzmarta.xml
998 // if( lastpo.z()<z4 || abs(lastpo.x())> 5. || lastpo.y()< 10.2 || lastpo.y()>30.2 ) {
999 // for zzzmarta.xml
1000  // if( lastpo.z()<z4 || abs(lastpo.x())> 10. || lastpo.y()< 3.2 || lastpo.y()>43.2 ) {
1001  if( lastpo.z()< z4) {
1002 // if( lastpo.z()<z4 && lastpo.perp()< 100. ) {
1003 // if(lastpo.z()<z4 || lastpo.perp()> 45.) {
1004  //UserNtuples->fillg66(theCAFI->entries(),1.);
1005  varia = 1;
1006  }
1007  else{
1008  // 2) no MI start in detector:
1009  //UserNtuples->fillg31(numofpart,1.);
1010  //UserNtuples->fillg67(theCAFI->entries(),1.);
1011  varia = 2;
1012  } // no MI end:
1013 
1014  for (int j=0; j<theCAFI->entries(); j++) {
1015  FP420G4Hit* aHit = (*theCAFI)[j];
1016  G4ThreeVector hitPoint = aHit->getEntry();
1017  double zz = hitPoint.z();
1018  TheHistManager->GetHisto("zHits")->Fill(zz);
1019  if(tracklength0>8300.) TheHistManager->GetHisto("zHitsTrLoLe")->Fill(zz);
1020  }
1021  // varia = 0;
1022  // if( varia == 0) {
1023  if( varia == 2) {
1024 
1025 // .............
1026 // number of hits < 50
1027 // if(theCAFI->entries() <50) {
1028 // if(theCAFI->entries() > 0) {
1029 // if(theCAFI->entries() > -1) {
1030 // .............
1031  int nhit11 = 0, nhit12 = 0, nhit13 = 0 ;
1032  double totallosenergy= 0.;
1033  for (int j=0; j<theCAFI->entries(); j++) {
1034  FP420G4Hit* aHit = (*theCAFI)[j];
1035 
1036  G4ThreeVector hitEntryLocalPoint = aHit->getEntryLocalP();
1037  G4ThreeVector hitExitLocalPoint = aHit->getExitLocalP();
1038  G4ThreeVector hitPoint = aHit->getEntry();
1039 // double elmenergy = aHit->getEM();
1040 // double hadrenergy = aHit->getHadr();
1041 // double incidentEnergyHit = aHit->getIncidentEnergy();
1042  int trackIDhit = aHit->getTrackID();
1043  unsigned int unitID = aHit->getUnitID();
1044 // double timeslice = aHit->getTimeSlice();
1045 // int timesliceID = aHit->getTimeSliceID();
1046 // double depenergy = aHit->getEnergyDeposit();
1047 // float pabs = aHit->getPabs();
1048 // float tof = aHit->getTof();
1049  double losenergy = aHit->getEnergyLoss();
1050 // int particletype = aHit->getParticleType();
1051 // float thetaEntry = aHit->getThetaAtEntry();
1052 // float phiEntry = aHit->getPhiAtEntry();
1053 // float xEntry = aHit->getX();
1054 // float yEntry = aHit->getY();
1055 // float zEntry = aHit->getZ();
1056 // int parentID = aHit->getParentId();
1057 // float vxget = aHit->getVx();
1058 // float vyget = aHit->getVy();
1059 // float vzget = aHit->getVz();
1060 
1061 // double th_hit = hitPoint.theta();
1062 // double eta_hit = -log(tan(th_hit/2));
1063 // double phi_hit = hitPoint.phi();
1064 // if (phi_hit < 0.) phi_hit += twopi;
1065 // double phigrad_hit = phi_hit*180./pi;
1066  //UserNtuples->fillg60(eta_hit,losenergy);
1067  //UserNtuples->fillg61(eta_hit,1.);
1068  //UserNtuples->fillg62(phigrad_hit,losenergy);
1069  //UserNtuples->fillg63(phigrad_hit,1.);
1070 
1071 // double xx = hitPoint.x();
1072 // double yy = hitPoint.y();
1073  double zz = hitPoint.z();
1074 
1075  TheHistManager->GetHisto("zHitsnoMI")->Fill(zz);
1076 
1077  if (verbosity > 2) {
1078  std::cout << "FP420Test:zHits = " << zz << std::endl;
1079  }
1080 // double rr = hitPoint.perp();
1081  /*
1082  if(aHit->getTrackID() == 1) {
1083  emu += aHit->getEnergyDeposit();} else {
1084  erest += aHit->getEnergyDeposit();}
1085  */
1086 
1087  //collect lost in Si en.of hits in every plane and put it into themap[]
1088  //UserNtuples->fillg30(losenergy,1.);
1089  themap[unitID] += losenergy;
1090  totallosenergy += losenergy;
1091 
1092  int det, zside, sector, zmodule;
1093 // CaloNumberingPacker::unpackCastorIndex(unitID, det, zside, sector, zmodule);
1094  FP420NumberingScheme::unpackFP420Index(unitID, det, zside, sector, zmodule);
1095  int justlayer = FP420NumberingScheme::unpackLayerIndex(rn00, zside);// 1,2
1096  if(justlayer<1||justlayer>2) {
1097  std::cout << "FP420Test:WRONG justlayer= " << justlayer << std::endl;
1098  }
1099  // zside=1,2 ; zmodule=1,10 ; sector=1,3
1100  //UserNtuples->fillg44(float(sector),1.);
1101  //UserNtuples->fillg45(float(zmodule),1.);
1102  //UserNtuples->fillg46(float(zside),1.);
1103  // int sScale = 20;
1104  // intindex is a continues numbering of FP420
1105  //int zScale = 2; unsigned int intindex = sScale*(sector - 1)+zScale*(zmodule - 1)+zside; //intindex=1-30:X,Y,X,Y,X,Y...
1106  // int zScale = 10; unsigned int intindex = sScale*(sector - 1)+zScale*(zside - 1)+zmodule; //intindex=1-30:XXXXXXXXXX,YYYYYYYYYY,...
1107  //UserNtuples->fillg40(float(intindex),1.);
1108  //UserNtuples->fillg48(float(intindex),losenergy);
1109  //
1110  //=======================================
1111  // G4ThreeVector middle = (hitExitLocalPoint+hitEntryLocalPoint)/2.;
1112  G4ThreeVector middle = (hitExitLocalPoint-hitEntryLocalPoint)/2.;
1113  themapz[unitID] = hitPoint.z()+fabs(middle.z());
1114  if (verbosity > 2) {
1115  std::cout << "1111111111111111111111111111111111111111111111111111111111111111111111111 " << std::endl;
1116  std::cout << "FP420Test: det, zside, sector, zmodule = " << det << zside << sector << zmodule << std::endl;
1117  std::cout << "FP420Test: justlayer = " << justlayer << std::endl;
1118  std::cout << "FP420Test: hitExitLocalPoint = " << hitExitLocalPoint << std::endl;
1119  std::cout << "FP420Test: hitEntryLocalPoint = " << hitEntryLocalPoint << std::endl;
1120  std::cout << "FP420Test: middle= " << middle << std::endl;
1121  std::cout << "FP420Test: hitPoint.z()-419000.= " << hitPoint.z()-419000. << std::endl;
1122 
1123  std::cout << "FP420Test:zHits-419000. = " << themapz[unitID]-419000. << std::endl;
1124  }
1125  //=======================================
1126  // Y
1127  if(zside==1) {
1128  //UserNtuples->fillg24(losenergy,1.);
1129  if(losenergy > 0.00003) {
1130  themap1[unitID] += 1.;
1131  }
1132  }
1133 //X
1134  if(zside==2){
1135  //UserNtuples->fillg25(losenergy,1.);
1136  if(losenergy > 0.00005) {
1137  themap1[unitID] += 1.;
1138  }
1139  }
1140 // }
1141 //
1142  if(sector==1) {
1143  nhit11 += 1;
1144  //UserNtuples->fillg33(rr,1.);
1145  //UserNtuples->fillg11(yy,1.);
1146  }
1147  if(sector==2) {
1148  nhit12 += 1;
1149  //UserNtuples->fillg34(rr,1.);
1150  //UserNtuples->fillg86(yy,1.);
1151  }
1152  if(sector==3) {
1153  nhit13 += 1;
1154  //UserNtuples->fillg35(rr,1.);
1155  //UserNtuples->fillg87(yy,1.);
1156  }
1157  //UserNtuples->fillg10(xx,1.);
1158  //UserNtuples->fillg12(zz,1.);
1159  //UserNtuples->fillg32(rr,1.);
1160 
1161 
1162 
1163 
1164 
1165 
1166 
1167  // =========
1168 // double xPrimAtZhit = vx + (zz-vz)*tan(th)*cos(phi);
1169 // double yPrimAtZhit = vy + (zz-vz)*tan(th)*sin(phi);
1170 
1171 // double dx = xPrimAtZhit - xx;
1172 // double dy = yPrimAtZhit - yy;
1173 
1174  // Select SD hits
1175 // if(rr<120.) {
1176  // Select MI or noMI over all 3 stations
1177  if(lastpo.z()<z4 && lastpo.perp()< 120.) {
1178  // MIonly:
1179  //UserNtuples->fillg16(lastpo.z(),1.);
1180  //UserNtuples->fillg18(zz,1.);
1181  // Station I
1182  if( zz < z2){
1183  //UserNtuples->fillg54(dx,1.);
1184  //UserNtuples->fillg55(dy,1.);
1185  }
1186  // Station II
1187  if( zz < z3 && zz > z2){
1188  //UserNtuples->fillg50(dx,1.);
1189  //UserNtuples->fillg51(dy,1.);
1190  }
1191  // Station III
1192  if( zz < z4 && zz > z3){
1193  //UserNtuples->fillg64(dx,1.);
1194  //UserNtuples->fillg65(dy,1.);
1195  //UserNtuples->filld209(xx,yy,1.);
1196  }
1197  }
1198  else{
1199  // no MIonly:
1200  //UserNtuples->fillg17(lastpo.z(),1.);
1201  //UserNtuples->fillg19(zz,1.);
1202  //UserNtuples->fillg74(incidentEnergyHit,1.);
1203  //UserNtuples->fillg75(float(trackIDhit),1.);
1204  // Station I
1205  if( zz < z2){
1206  //UserNtuples->fillg56(dx,1.);
1207  //UserNtuples->fillg57(dy,1.);
1208  //UserNtuples->fillg20(numofpart,1.);
1209  //UserNtuples->fillg21(SumEnerDeposit,1.);
1210  if(zside==1) {
1211  //UserNtuples->fillg26(losenergy,1.);
1212  }
1213  if(zside==2){
1214  //UserNtuples->fillg76(losenergy,1.);
1215  }
1216  if(trackIDhit == 1){
1217  //UserNtuples->fillg70(dx,1.);
1218  //UserNtuples->fillg71(incidentEnergyHit,1.);
1219  //UserNtuples->fillg79(losenergy,1.);
1220  }
1221  else{
1222  //UserNtuples->fillg82(dx,1.);
1223  }
1224  }
1225  // Station II
1226  if( zz < z3 && zz > z2){
1227  //UserNtuples->fillg52(dx,1.);
1228  //UserNtuples->fillg53(dy,1.);
1229  //UserNtuples->fillg22(numofpart,1.);
1230  //UserNtuples->fillg23(SumEnerDeposit,1.);
1231  //UserNtuples->fillg80(incidentEnergyHit,1.);
1232  //UserNtuples->fillg81(float(trackIDhit),1.);
1233  if(zside==1) {
1234  //UserNtuples->fillg27(losenergy,1.);
1235  }
1236  if(zside==2){
1237  //UserNtuples->fillg77(losenergy,1.);
1238  }
1239  if(trackIDhit == 1){
1240  //UserNtuples->fillg72(dx,1.);
1241  //UserNtuples->fillg73(incidentEnergyHit,1.);
1242  }
1243  else{
1244  //UserNtuples->fillg83(dx,1.);
1245  }
1246  }
1247  // Station III
1248  if( zz < z4 && zz > z3){
1249  //UserNtuples->fillg68(dx,1.);
1250  //UserNtuples->fillg69(dy,1.);
1251  //UserNtuples->filld210(xx,yy,1.);
1252  //UserNtuples->fillg22(numofpart,1.);
1253  //UserNtuples->fillg23(SumEnerDeposit,1.);
1254  if(zside==1) {
1255  //UserNtuples->fillg28(losenergy,1.);
1256  }
1257  if(zside==2){
1258  //UserNtuples->fillg78(losenergy,1.);
1259  }
1260  }
1261  } // MIonly or noMIonly ENDED
1262 // }
1263 
1264  // !!!!!!!!!!!!!
1265 
1266  } // for loop on all hits ENDED ENDED ENDED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1267 
1268  // !!!!!!!!!!!!!
1269 
1270  //======================================================================================================SUMHIT
1271  //UserNtuples->fillg29(totallosenergy,1.);
1272  //UserNtuples->fillg36(nhit11,1.);
1273  //UserNtuples->fillg37(nhit12,1.);
1274  //UserNtuples->fillg38(nhit13,1.);
1275  //======================================================================================================SUMHIT
1276  // int rn00=3;//test only with 2 sensors in superlayer, not 4
1277  // int rn00=rn0;//always
1278  if (verbosity > 2) {
1279  std::cout << "22222222222222222222222222222222222222222222222222222222222222222222222222 " << std::endl;
1280  }
1281  int det = 1;
1282  int allplacesforsensors=7;
1283  for (int sector=1; sector < sn0; sector++) {
1284  for (int zmodule=1; zmodule<pn0; zmodule++) {
1285  for (int zsideinorder=1; zsideinorder<allplacesforsensors; zsideinorder++) {
1286  int zside = FP420NumberingScheme::realzside(rn00, zsideinorder);//1,3,5,2,4,6
1287  if (verbosity > 2) {
1288  std::cout << "FP420Test: sector= " << sector << " zmodule= " << zmodule << " zsideinorder= " << zsideinorder << " zside= " << zside << std::endl;
1289  }
1290  if(zside != 0) {
1291  int justlayer = FP420NumberingScheme::unpackLayerIndex(rn00, zside);// 1,2
1292  if(justlayer<1||justlayer>2) {
1293  std::cout << "FP420Test:WRONG justlayer= " << justlayer << std::endl;
1294  }
1295  int copyinlayer = FP420NumberingScheme::unpackCopyIndex(rn00, zside);// 1,2,3
1296  if(copyinlayer<1||copyinlayer>3) {
1297  std::cout << "FP420Test:WRONG copyinlayer= " << copyinlayer << std::endl;
1298  }
1299  int orientation = FP420NumberingScheme::unpackOrientation(rn00, zside);// Front: = 1; Back: = 2
1300  if(orientation<1||orientation>2) {
1301  std::cout << "FP420Test:WRONG orientation= " << orientation << std::endl;
1302  }
1303 
1304  // iu is a continues numbering of planes(!) over two arm FP420 set up
1305  int detfixed=1;// use this treatment for each set up arm, hence no sense to do it defferently for +FP420 and -FP420;
1306  // and ...[ii] massives have prepared in such a way
1307  unsigned int ii=FP420NumberingScheme::packMYIndex(rn00,pn0,sn0,detfixed,justlayer,sector,zmodule)-1;
1308  // ii = 0-19 --> 20 items
1309  if (verbosity > 2) {
1310  std::cout << "FP420Test: justlayer = " << justlayer << " copyinlayer = " << copyinlayer << " orientation = " << orientation << " ii= " << ii << std::endl;
1311  }
1312  double zdiststat = 0.;
1313  if(sn0<4) {
1314  if(sector==2) zdiststat = zD3;
1315  }
1316  else {
1317  if(sector==2) zdiststat = zD2;
1318  if(sector==3) zdiststat = zD3;
1319  }
1320  double kplane = -(pn0-1)/2 - 0.5 + (zmodule-1); //-3.5 +0...5 = -3.5,-2.5,-1.5,+2.5,+1.5
1321  double zcurrent = zinibeg + z420 + (ZSiStep-ZSiPlane)/2 + kplane*ZSiStep + zdiststat;
1322  //double zcurrent = zinibeg +(ZSiStep-ZSiPlane)/2 + kplane*ZSiStep + (sector-1)*zUnit;
1323  if (verbosity > 2) {
1324  std::cout << "FP420Test: Leftzcurrent-419000. = " << zcurrent-419000. << std::endl;
1325  std::cout << "FP420Test: ZGapLDet = " << ZGapLDet << std::endl;
1326  }
1327  if(justlayer==1){
1328  if(orientation==1) zcurrent += (ZGapLDet+ZSiDet/2);
1329  if(orientation==2) zcurrent += zBlade-(ZGapLDet+ZSiDet/2);
1330  }
1331  if(justlayer==2){
1332  if(orientation==1) zcurrent += (ZGapLDet+ZSiDet/2)+zBlade+gapBlade;
1333  if(orientation==2) zcurrent += 2*zBlade+gapBlade-(ZGapLDet+ZSiDet/2);
1334  }
1335  // .
1336  //
1337  if(det == 2) zcurrent = -zcurrent;
1338  //
1339  if (verbosity > 2) {
1340  std::cout << "FP420Test: zcurrent-419000. = " << zcurrent-419000. << std::endl;
1341  }
1342  //================================== end of for loops in continuius number iu:
1343  }//if(zside!=0
1344  } // for superlayer
1345  } // for zmodule
1346  } // for sector
1347 
1348 
1349  if (verbosity > 2) {
1350  std::cout << "----------------------------------------------------------------------------- " << std::endl;
1351  }
1352 
1353 
1354 
1355 //======================================================================================================CHECK
1356  if(totallosenergy == 0.0) {
1357  std::cout << "FP420Test: number of hits = " << theCAFI->entries() << std::endl;
1358  for (int j=0; j<theCAFI->entries(); j++) {
1359  FP420G4Hit* aHit = (*theCAFI)[j];
1360  double losenergy = aHit->getEnergyLoss();
1361  std::cout << " j hits = " << j << "losenergy = " << losenergy << std::endl;
1362  }
1363  }
1364 //======================================================================================================CHECK
1365 
1366 
1367 
1368 //====================================================================================================== HIT START
1369 
1370  // FIBRE Hit collected analysis
1371  double totalEnergy = 0.;
1372  int nhitsX = 0, nhitsY = 0, nsumhit = 0 ;
1373  for (int sector=1; sector<4; sector++) {
1374  int nhitsecX = 0, nhitsecY = 0;
1375  for (int zmodule=1; zmodule<11; zmodule++) {
1376  for (int zside=1; zside<3; zside++) {
1377  int det= 1;
1378 // int nhit = 0;
1379 // int sScale = 20;
1380  int index = FP420NumberingScheme::packFP420Index(det, zside, sector, zmodule);
1381  double theTotalEnergy = themap[index];
1382  // X planes
1383  if(zside<2){
1384  //UserNtuples->fillg47(theTotalEnergy,1.);
1385  if(theTotalEnergy > 0.00003) {
1386  nhitsX += 1;
1387 // nhitsecX += themap1[index];
1388 // nhit=1;
1389  }
1390  }
1391  // Y planes
1392  else {
1393  //UserNtuples->fillg49(theTotalEnergy,1.);
1394  if(theTotalEnergy > 0.00005) {
1395  nhitsY += 1;
1396 // nhitsecY += themap1[index];
1397 // nhit=1;
1398  }
1399  }
1400  // intindex is a continues numbering of FP420
1401 // int zScale=2; unsigned int intindex = sScale*(sector - 1)+zScale*(zmodule - 1)+zside;
1402  // int zScale=10; unsigned int intindex = sScale*(sector - 1)+zScale*(zside - 1)+zmodule;
1403  //UserNtuples->fillg41(float(intindex),theTotalEnergy);
1404  //UserNtuples->fillg42(float(intindex),1.);
1405  //UserNtuples->fillp208(float(intindex),float(nhit),1.);
1406  //UserNtuples->fillp211(float(intindex),float(themap1[index]),1.);
1407  totalEnergy += themap[index];
1408  } // for
1409  } // for
1410  //UserNtuples->fillg39(nhitsecY,1.);
1411  if(nhitsecX > 10 || nhitsecY > 10) {
1412  nsumhit +=1;
1413  //UserNtuples->fillp213(float(sector),float(1.),1.);
1414  }
1415  else{ //UserNtuples->fillp213(float(sector),float(0.),1.);
1416  }
1417  } // for
1418 //====================================================================================================== HIT END
1419 
1420 //====================================================================================================== HIT ALL
1421  //UserNtuples->fillg43(totalEnergy,1.);
1422  //UserNtuples->fillg58(nhitsX,1.);
1423  //UserNtuples->fillg59(nhitsY,1.);
1424  // if( nsumhit !=0 ) { //UserNtuples->fillp212(vy,float(1.),1.);
1425  if( nsumhit >=2 ) { //UserNtuples->fillp212(vy,float(1.),1.);
1426  }
1427  else{ //UserNtuples->fillp212(vy,float(0.),1.);
1428  }
1429 
1430 //====================================================================================================== HIT ALL
1431 
1432 //====================================================================================================== number of hits
1433 // .............
1434 // } // number of hits < 50
1435 // .............
1436  } // MI or no MI or all - end
1437 
1438  } // primary end
1439 //=========================== thePrim != 0 end ===
1440  // ==========================================================================
1441  if (verbosity > 0) {
1442  std::cout << "FP420Test: END OF Event " << (*evt)()->GetEventID() << std::endl;
1443  }
1444 }
static int unpackCopyIndex(int rn0, int zside)
double z4
Definition: FP420Test.h:218
G4ThreeVector getExitLocalP() const
Definition: FP420G4Hit.cc:121
static int realzside(int rn0, int zsideinorder)
static void unpackFP420Index(const unsigned int &idx, int &det, int &zside, int &station, int &superplane)
double zinibeg
Definition: FP420Test.h:222
double z2
Definition: FP420Test.h:218
int verbosity
Definition: FP420Test.h:207
static int unpackLayerIndex(int rn0, int zside)
double ZSiStep
Definition: FP420Test.h:222
unsigned int getTrackID() const
Definition: FP420G4Hit.cc:133
G4ThreeVector lastpo
Definition: FP420Test.h:214
const Double_t pi
unsigned int getUnitID() const
Definition: FP420G4Hit.cc:136
double ZSiDet
Definition: FP420Test.h:221
static unsigned packMYIndex(int rn0, int pn0, int sn0, int det, int zside, int sector, int zmodule)
double zD2
Definition: FP420Test.h:218
double ZSiPlane
Definition: FP420Test.h:222
int rn00
Definition: FP420Test.h:220
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
int whichevent
Definition: FP420Test.h:230
double zD3
Definition: FP420Test.h:218
G4ThreeVector getEntryLocalP() const
Definition: FP420G4Hit.cc:118
double z3
Definition: FP420Test.h:218
Float_t fp420eventarray[1]
Definition: FP420Test.h:227
static unsigned int packFP420Index(int det, int zside, int station, int superplane)
float getEnergyLoss() const
Definition: FP420G4Hit.cc:150
ii
Definition: cuy.py:588
double z420
Definition: FP420Test.h:221
G4THitsCollection< FP420G4Hit > FP420G4HitCollection
double ZGapLDet
Definition: FP420Test.h:222
int numofpart
Definition: FP420Test.h:212
double gapBlade
Definition: FP420Test.h:223
TH1F * GetHisto(Int_t Number)
Definition: FP420Test.cc:253
G4double tracklength0
Definition: FP420Test.h:195
Fp420AnalysisHistManager * TheHistManager
Definition: FP420Test.h:232
G4ThreeVector getEntry() const
Definition: FP420G4Hit.cc:115
static int unpackOrientation(int rn0, int zside)
double zBlade
Definition: FP420Test.h:223

Member Data Documentation

int FP420Test::dn0
private

Definition at line 219 of file FP420Test.h.

G4double FP420Test::entot0
private

Definition at line 195 of file FP420Test.h.

std::string FP420Test::fDataLabel
private

Definition at line 233 of file FP420Test.h.

std::string FP420Test::fOutputFile
private

Definition at line 234 of file FP420Test.h.

Float_t FP420Test::fp420eventarray[1]
private

Definition at line 227 of file FP420Test.h.

TNtuple* FP420Test::fp420eventntuple
private

Definition at line 228 of file FP420Test.h.

TFile FP420Test::fp420OutputFile
private

Definition at line 229 of file FP420Test.h.

std::string FP420Test::fRecreateFile
private

Definition at line 235 of file FP420Test.h.

double FP420Test::gapBlade
private

Definition at line 223 of file FP420Test.h.

int FP420Test::iev
private

Definition at line 193 of file FP420Test.h.

int FP420Test::itrk
private

Definition at line 194 of file FP420Test.h.

G4ThreeVector FP420Test::lastpo
private

Definition at line 214 of file FP420Test.h.

int FP420Test::lastTrackID
private

Definition at line 206 of file FP420Test.h.

int FP420Test::numofpart
private

Definition at line 212 of file FP420Test.h.

int FP420Test::pn0
private

Definition at line 219 of file FP420Test.h.

double FP420Test::rinCalo
private

Definition at line 205 of file FP420Test.h.

int FP420Test::rn0
private

Definition at line 219 of file FP420Test.h.

int FP420Test::rn00
private

Definition at line 220 of file FP420Test.h.

int FP420Test::sn0
private

Definition at line 219 of file FP420Test.h.

G4double FP420Test::SumEnerDeposit
private

Definition at line 210 of file FP420Test.h.

G4double FP420Test::SumStepc
private

Definition at line 210 of file FP420Test.h.

G4double FP420Test::SumStepl
private

Definition at line 210 of file FP420Test.h.

Fp420AnalysisHistManager* FP420Test::TheHistManager
private

Definition at line 232 of file FP420Test.h.

G4double FP420Test::tracklength0
private

Definition at line 195 of file FP420Test.h.

int FP420Test::verbosity
private

Definition at line 207 of file FP420Test.h.

int FP420Test::whichevent
private

Definition at line 230 of file FP420Test.h.

double FP420Test::z1
private

Definition at line 218 of file FP420Test.h.

double FP420Test::z2
private

Definition at line 218 of file FP420Test.h.

double FP420Test::z3
private

Definition at line 218 of file FP420Test.h.

double FP420Test::z4
private

Definition at line 218 of file FP420Test.h.

double FP420Test::z420
private

Definition at line 221 of file FP420Test.h.

double FP420Test::zBlade
private

Definition at line 223 of file FP420Test.h.

double FP420Test::ZBoundDet
private

Definition at line 222 of file FP420Test.h.

double FP420Test::zD2
private

Definition at line 218 of file FP420Test.h.

double FP420Test::zD3
private

Definition at line 218 of file FP420Test.h.

double FP420Test::ZGapLDet
private

Definition at line 222 of file FP420Test.h.

double FP420Test::zinCalo
private

Definition at line 205 of file FP420Test.h.

double FP420Test::zinibeg
private

Definition at line 222 of file FP420Test.h.

double FP420Test::ZSiDet
private

Definition at line 221 of file FP420Test.h.

double FP420Test::ZSiPlane
private

Definition at line 222 of file FP420Test.h.

double FP420Test::ZSiStep
private

Definition at line 222 of file FP420Test.h.