test
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
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 64 of file FP420Test.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and HLT_25ns10e33_v2_cff::verbosity.

64  {
65  //constructor
66  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("FP420Test");
67  verbosity = m_Anal.getParameter<int>("Verbosity");
68  //verbosity = 1;
69 
70  fDataLabel = m_Anal.getParameter<std::string>("FDataLabel");
71  fOutputFile = m_Anal.getParameter<std::string>("FOutputFile");
72  fRecreateFile = m_Anal.getParameter<std::string>("FRecreateFile");
73 
74  if (verbosity > 0) {
75  std::cout<<"============================================================================"<<std::endl;
76  std::cout << "FP420Testconstructor :: Initialized as observer"<< std::endl;
77  }
78  // Initialization:
79 
80  pn0 = 6;
81  sn0 = 3;
82  rn00 = 7;
83 
84  z420 = 420000.0; // mm
85  zD2 = 4000.0; // mm
86  zD3 = 8000.0; // mm
87  //
88  zBlade = 5.00;
89  gapBlade = 1.6;
90  double gapSupplane = 1.6;
91  ZSiPlane=2*zBlade+gapBlade+gapSupplane;
92 
93  double ZKapton = 0.1;
94  ZSiStep=ZSiPlane+ZKapton;
95 
96  double ZBoundDet = 0.020;
97  double ZSiElectr = 0.250;
98  double ZCeramDet = 0.500;
99  //
100  ZSiDet = 0.250;
101  ZGapLDet= zBlade/2-(ZSiDet+ZSiElectr+ZBoundDet+ZCeramDet/2);
102  //
103  // ZSiStation = 5*(2*(5.+1.6)+0.1)+2*6.+1.0 = 79.5
104  double ZSiStation = (pn0-1)*(2*(zBlade+gapBlade)+ZKapton)+2*6.+0.0; // = 78.5
105  // 11.=e1, 12.=e2 in zzzrectangle.xml
106  double eee1=11.;
107  double eee2=12.;
108 
109  zinibeg = (eee1-eee2)/2.;
110 
111  z1 = zinibeg + (ZSiStation+10.)/2 + z420; // z1 - right after 1st Station
112  z2 = z1+zD2; //z2 - right after middle Station
113  z3 = z1+zD3; //z3 - right after last Station
114  z4 = z1+2*zD3;
115  //==================================
116 
117  fp420eventntuple = new TNtuple("NTfp420event","NTfp420event","evt");
118 
119  whichevent = 0;
120 
121  // fDataLabel = "defaultData";
122  // fOutputFile = "TheAnlysis.root";
123  // fRecreateFile = "RECREATE";
124 
125  TheHistManager = new Fp420AnalysisHistManager(fDataLabel);
126 
127  if (verbosity > 0) {
128  std::cout << "FP420Test constructor :: Initialized Fp420AnalysisHistManager"<< std::endl;
129  }
130 }
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
tuple cout
Definition: gather_cfg.py:145
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 134 of file FP420Test.cc.

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

134  {
135  // delete UserNtuples;
136 
137  TFile fp420OutputFile("newntfp420.root","RECREATE");
138  std::cout << "FP420 output root file has been created";
139  fp420eventntuple->Write();
140  std::cout << ", written";
141  fp420OutputFile.Close();
142  std::cout << ", closed";
143  delete fp420eventntuple;
144  std::cout << ", and deleted" << std::endl;
145 
146  //------->while end
147 
148  // Write histograms to file
150  if (verbosity > 0) {
151  std::cout << std::endl << "FP420Test Destructor --------> End of FP420Test : " << std::endl;
152  }
153 
154  std::cout<<"FP420Test: End of process"<<std::endl;
155 
156 
157 
158 }
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:224
std::string fOutputFile
Definition: FP420Test.h:234
tuple cout
Definition: gather_cfg.py:145
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 920 of file FP420Test.cc.

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

921  {
922 
923  //Get name and copy numbers
924  if (level > 0) {
925  for (int ii = 0; ii < level; ii++) {
926  int i = level - ii - 1;
927  G4VPhysicalVolume* pv = touch->GetVolume(i);
928  if (pv != 0)
929  name[ii] = pv->GetName();
930  else
931  name[ii] = "Unknown";
932  copyno[ii] = touch->GetReplicaNumber(i);
933  }
934  }
935 }
int i
Definition: DBlmapReader.cc:9
int ii
Definition: cuy.py:588
tuple level
Definition: testEve_cfg.py:34
int FP420Test::detLevels ( const G4VTouchable *  touch) const
private

Definition at line 898 of file FP420Test.cc.

898  {
899 
900  //Return number of levels
901  if (touch)
902  return ((touch->GetHistoryDepth())+1);
903  else
904  return 0;
905 }
G4String FP420Test::detName ( const G4VTouchable *  touch,
int  level,
int  currentlevel 
) const
private

Definition at line 908 of file FP420Test.cc.

References cuy::ii.

909  {
910 
911  //Go down to current level
912  if (level > 0 && level >= currentlevel) {
913  int ii = level - currentlevel;
914  return touch->GetVolume(ii)->GetName();
915  } else {
916  return "NotFound";
917  }
918 }
int ii
Definition: cuy.py:588
tuple level
Definition: testEve_cfg.py:34
void FP420Test::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

402  {
403  //job
404  std::cout<<"FP420Test:beggining of job"<<std::endl;;
405 }
tuple cout
Definition: gather_cfg.py:145
void FP420Test::update ( const BeginOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

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

409  {
410  //run
411 
412  std::cout << std::endl << "FP420Test:: Begining of Run"<< std::endl;
413 }
tuple cout
Definition: gather_cfg.py:145
void FP420Test::update ( const EndOfRun )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 421 of file FP420Test.cc.

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

421  {
422  iev = (*evt)()->GetEventID();
423  if (verbosity > 0) {
424  std::cout <<"FP420Test:update Event number = " << iev << std::endl;
425  }
426  whichevent++;
427 }
int verbosity
Definition: FP420Test.h:207
int whichevent
Definition: FP420Test.h:230
tuple cout
Definition: gather_cfg.py:145
void FP420Test::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 430 of file FP420Test.cc.

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

430  {
431  itrk = (*trk)()->GetTrackID();
432  if (verbosity > 1) {
433  std::cout <<"FP420Test:update BeginOfTrack number = " << itrk << std::endl;
434  }
435  if(itrk == 1) {
436  SumEnerDeposit = 0.;
437  numofpart = 0;
438  SumStepl = 0.;
439  SumStepc = 0.;
440  tracklength0 = 0.;
441  }
442 }
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
tuple cout
Definition: gather_cfg.py:145
void FP420Test::update ( const G4Step *  )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 557 of file FP420Test.cc.

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

557  {
558 // ==========================================================================
559 
560  if (verbosity > 2) {
561  G4int stepnumber = aStep->GetTrack()->GetCurrentStepNumber();
562  std::cout <<"FP420Test:update Step number = " << stepnumber << std::endl;
563  }
564  // track on aStep: !
565  G4Track* theTrack = aStep->GetTrack();
566  TrackInformation* trkInfo = dynamic_cast<TrackInformation*> (theTrack->GetUserInformation());
567  if (trkInfo == 0) {
568  std::cout << "FP420Test on aStep: No trk info !!!! abort " << std::endl;
569  // throw Genexception("FP420Test:FP420Test on aStep: cannot get trkInfo");
570  }
571  G4int id = theTrack->GetTrackID();
572  G4String particleType = theTrack->GetDefinition()->GetParticleName(); // !!!
573  G4int parentID = theTrack->GetParentID(); // !!!
574  G4TrackStatus trackstatus = theTrack->GetTrackStatus(); // !!!
575  G4double tracklength = theTrack->GetTrackLength(); // Accumulated track length
576  G4ThreeVector trackmom = theTrack->GetMomentum();
577  G4double entot = theTrack->GetTotalEnergy(); // !!! deposited on step
578  G4int curstepnumber = theTrack->GetCurrentStepNumber();
579  G4ThreeVector vert_pos = theTrack->GetVertexPosition(); // vertex ,where this track was created
580  G4ThreeVector vert_mom = theTrack->GetVertexMomentumDirection();
581 
582 // double costheta =vert_mom.z()/sqrt(vert_mom.x()*vert_mom.x()+vert_mom.y()*vert_mom.y()+vert_mom.z()*vert_mom.z());
583 // double theta = acos(min(max(costheta,double(-1.)),double(1.)));
584 // float eta = -log(tan(theta/2));
585 // double phi = -1000.;
586 // if (vert_mom.x() != 0) phi = atan2(vert_mom.y(),vert_mom.x());
587 // if (phi < 0.) phi += twopi;
588 // double phigrad = phi*360./twopi;
589 
590 //G4double trackvel = theTrack->GetVelocity();
591 
592 //std::cout << " trackstatus= " << trackstatus << " entot= " << entot << std::endl;
593 
594 
595  // step points: !
596  G4double stepl = aStep->GetStepLength();
597  G4double EnerDeposit = aStep->GetTotalEnergyDeposit();
598  // pointers: !
599 //G4VPhysicalVolume* physvol = theTrack->GetVolume();
600 //G4VPhysicalVolume* nextphysvol = theTrack->GetNextVolume();
601 //G4Material* materialtr = theTrack->GetMaterial();
602 //G4Material* nextmaterialtr = theTrack->GetNextMaterial();
603 
604  // preStep
605  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
606  G4ThreeVector preposition = preStepPoint->GetPosition();
607  G4ThreeVector prelocalpoint = theTrack->GetTouchable()->GetHistory()->
608  GetTopTransform().TransformPoint(preposition);
609  G4VPhysicalVolume* currentPV = preStepPoint->GetPhysicalVolume();
610  G4String prename = currentPV->GetName();
611 
612 const G4VTouchable* pre_touch = preStepPoint->GetTouchable();
613  int pre_levels = detLevels(pre_touch);
614 
615 // G4String pre_name1 = detName(pre_touch, pre_levels, 1);
616 // G4String pre_name2 = detName(pre_touch, pre_levels, 2);
617 // G4String pre_name3 = detName(pre_touch, pre_levels, 3);
618  G4String name1[20]; int copyno1[20];
619  if (pre_levels > 0) {
620  detectorLevel(pre_touch, pre_levels, copyno1, name1);
621  }
622 
623 // G4LogicalVolume* lv = currentPV->GetLogicalVolume();
624 // G4Material* mat = lv->GetMaterial();
625 // std::string prenameVolume;
626 // prenameVolume.assign(prename,0,20);
627 
628 // G4double prebeta = preStepPoint->GetBeta();
629 // G4double precharge = preStepPoint->GetCharge();
630 // G4double prerad = mat->GetRadlen();
631 
632 // std::cout << " EneryDeposited = " << EnerDeposit << std::endl;
633 // std::cout << " prevolume = " << prename << std::endl;
635 // std::cout << " preposition = " << preposition << std::endl;
636  /*
637  // postStep
638  G4StepPoint* postStepPoint = aStep->GetPostStepPoint();
639  G4ThreeVector posposition = postStepPoint->GetPosition();
640  G4ThreeVector poslocalpoint = theTrack->GetTouchable()->GetHistory()->
641  GetTopTransform().TransformPoint(posposition);
642  G4VPhysicalVolume* poscurrentPV = postStepPoint->GetPhysicalVolume();
643  G4String posname = poscurrentPV->GetName();
644 // G4LogicalVolume* poslv = poscurrentPV->GetLogicalVolume();
645 // G4Material* posmat = poslv->GetMaterial();
646 // std::string posnameVolume;
647 // posnameVolume.assign(posname,0,20);
648 
649 #ifdef ddebug
650  std::cout << "============posStep: information:============" << std::endl;
651  std::cout << " posposition = " << posposition
652  << " poslocalpoint = " << poslocalpoint
653  << " posvolume = " << posname
654  // << " posnameVolume = " << posnameVolume
655  << std::endl;
656 
657  std::cout << " ==========================================" << std::endl;
658 #endif
659 
660 
661 */
662 
663 // //
664 // //
665 
666  // 24.01.2006:
667 // tr : id parentID trackstatus tracklength curstepnumber entot vert_pos
668 // st : stepl EnerDeposit
669 // prestep: preposition prevolume = SBSTm SIDETL SIDETR name= SISTATION copy= 1,2,3 name= SIPLANE copy= 1..5..10
670 
671 // gen_track:
672 // id=1 parentID=1 trackstatus=0,2 tracklength(accumulated) curstepnumber entot vert_pos
673  if ( id == 1 ) {
674 
675  // on 1-st step:
676  if (curstepnumber == 1 ) {
677  entot0 = entot;
678  //UserNtuples->fillg519(entot0,1.);
679 
680  }
681 
682  // on every step:
683 
684  // for Copper:
685  if(prename == "SBST" ) {
686  SumStepc += stepl;
687  // =========
688  }
689  // for ststeel:
690 // if(prename == "SBSTs") {
691  if(prename == "SBSTs" ) {
692  SumStepl += stepl;
693  // =========
694  }
695  // =========
696  // =========
697 
698  // exclude last track point if it is in SD (MI was started their)
699  if (trackstatus != 2 ) {
700  // for SD: Si Det.: SISTATION:SIPLANE:(SIDETL+BOUNDDET +SIDETR + CERAMDET)
701  if(prename == "SIDETL" || prename == "SIDETR" ) {
702  if(prename == "SIDETL") {
703  //UserNtuples->fillg569(EnerDeposit,1.);
704  }
705  if(prename == "SIDETR") {
706  //UserNtuples->fillg570(EnerDeposit,1.);
707  }
708 
709 // double numbcont = 10.*(copyno1[2]-1)+copyno1[3];
710 
711  // =========
712 // double xx = preposition.x();
713 // double yy = preposition.y();
714 // double zz = preposition.z();
715  // =========
716  //UserNtuples->fillg580(theta,1.);
717  //UserNtuples->fillg07(phigrad,1.);
718 // double xPrimAtZhit = vert_pos.x() + (zz-vert_pos.z())*tan(theta)*cos(phi);
719 // double yPrimAtZhit = vert_pos.y() + (zz-vert_pos.z())*tan(theta)*sin(phi);
720  // =========
721 // double dx = xPrimAtZhit - xx;
722 // double dy = yPrimAtZhit - yy;
723  // =========
724 
725 // //UserNtuples->fillp212(numbcont,dx,1.);
726 // //UserNtuples->fillp213(numbcont,dy,1.);
727  // =========
728 
729  // last step of current SD Volume:
730  G4String posname = aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName();
731  if((prename == "SIDETL" && posname != "SIDETL") || (prename == "SIDETR" && posname != "SIDETR")) {
732  if(name1[2] == "SISTATION" ) {
733  //UserNtuples->fillg539(copyno1[2],1.);
734  }
735  if(name1[3] == "SIPLANE" ) {
736  //UserNtuples->fillg540(copyno1[3],1.);
737  }
738 
739  if(prename == "SIDETL") {
740  //UserNtuples->fillg541(EnerDeposit,1.);
741  //UserNtuples->fillg561(numbcont,1.);
742  if(copyno1[2]<2) {
743  //UserNtuples->fillg571(dx,1.);
744  }
745  else if(copyno1[2]<3) {
746  //UserNtuples->fillg563(dx,1.);
747  if(copyno1[3]<2) {
748  }
749  else if(copyno1[3]<3) {
750  //UserNtuples->fillg572(dx,1.);
751  }
752  else if(copyno1[3]<4) {
753  //UserNtuples->fillg573(dx,1.);
754  }
755  else if(copyno1[3]<5) {
756  //UserNtuples->fillg574(dx,1.);
757  }
758  else if(copyno1[3]<6) {
759  //UserNtuples->fillg575(dx,1.);
760  }
761  else if(copyno1[3]<7) {
762  //UserNtuples->fillg576(dx,1.);
763  }
764  else if(copyno1[3]<8) {
765  //UserNtuples->fillg577(dx,1.);
766  }
767  else if(copyno1[3]<9) {
768  //UserNtuples->fillg578(dx,1.);
769  }
770  else if(copyno1[3]<10) {
771  //UserNtuples->fillg579(dx,1.);
772  }
773  }
774  else if(copyno1[2]<4) {
775  //UserNtuples->fillg565(dx,1.);
776  }
777  else if(copyno1[2]<5) {
778  //UserNtuples->fillg567(dx,1.);
779  }
780  }
781  if(prename == "SIDETR") {
782  //UserNtuples->fillg542(EnerDeposit,1.);
783  //UserNtuples->fillg562(numbcont,1.);
784  if(copyno1[2]<2) {
785  //UserNtuples->fillg581(dy,1.);
786  }
787  else if(copyno1[2]<3) {
788  //UserNtuples->fillg564(dy,1.);
789  if(copyno1[3]<2) {
790  }
791  else if(copyno1[3]<3) {
792  //UserNtuples->fillg582(dy,1.);
793  }
794  else if(copyno1[3]<4) {
795  //UserNtuples->fillg583(dy,1.);
796  }
797  else if(copyno1[3]<5) {
798  //UserNtuples->fillg584(dy,1.);
799  }
800  else if(copyno1[3]<6) {
801  //UserNtuples->fillg585(dy,1.);
802  }
803  else if(copyno1[3]<7) {
804  //UserNtuples->fillg586(dy,1.);
805  }
806  else if(copyno1[3]<8) {
807  //UserNtuples->fillg587(dy,1.);
808  }
809  else if(copyno1[3]<9) {
810  //UserNtuples->fillg588(dy,1.);
811  }
812  else if(copyno1[3]<10) {
813  //UserNtuples->fillg589(dy,1.);
814  }
815  }
816  else if(copyno1[2]<4) {
817  //UserNtuples->fillg566(dy,1.);
818  }
819  else if(copyno1[2]<5) {
820  //UserNtuples->fillg568(dy,1.);
821  }
822  }
823 
824  }
825  }
826  // end of prenames SIDETL // SIDETR
827  }
828  // end of trackstatus != 2
829 
830 
831  // deposition of energy on steps along primary track
832  //UserNtuples->fillg500(EnerDeposit,1.);
833  // collect sum deposited energy on all steps along primary track
834  SumEnerDeposit += EnerDeposit;
835  // position of step for primary track:
836  //UserNtuples->fillg501(preposition.x(),1.);
837  //UserNtuples->fillg502(preposition.y(),1.);
838  //UserNtuples->fillg503(preposition.z(),1.);
839  //UserNtuples->fillg504(preposition.x(),EnerDeposit);
840  //UserNtuples->fillg505(preposition.y(),EnerDeposit);
841  //UserNtuples->fillg506(preposition.z(),EnerDeposit);
842  // 2D step coordinates weighted by energy deposited on step
843 // //UserNtuples->fillp201(preposition.x(),preposition.y(),EnerDeposit);
844 // //UserNtuples->fillp202(preposition.x(),preposition.z(),EnerDeposit);
845 // //UserNtuples->fillp203(preposition.y(),preposition.z(),EnerDeposit);
846  //UserNtuples->filld204(preposition.x(),preposition.y(),EnerDeposit);
847  //UserNtuples->filld205(preposition.x(),preposition.z(),EnerDeposit);
848  //UserNtuples->filld206(preposition.y(),preposition.z(),EnerDeposit);
849  //UserNtuples->filld223(preposition.y(),preposition.z(),EnerDeposit);
850  // last step of primary track
851  if (trackstatus == 2 ) {
852  // primary track length
853  // //UserNtuples->fillg508(tracklength,1.);
854  tracklength0 = tracklength;
855  // how many steps primary track consist
856  //UserNtuples->fillg509(curstepnumber,1.);
857  // tot. energy of primary track at the end of trajectory(before disappeare)
858  //UserNtuples->fillg510((entot0-entot),1.);
859  //UserNtuples->fillg520((entot0-entot),1.);
860  }
861  }
862  // end of primary track !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
863 
864 
865  if (parentID == 1 && curstepnumber == 1) {
866  // particles deposit their energy along primary track
867  numofpart += 1;
868  // energy of radiated particle
869  //UserNtuples->fillg511(entot,1.);
870  // coordinates of radiated particle
871  //UserNtuples->fillg512(vert_pos.x(),1.);
872  //UserNtuples->fillg513(vert_pos.y(),1.);
873  //UserNtuples->fillg514(vert_pos.z(),1.);
874  //UserNtuples->fillg515(vert_pos.x(),entot);
875  //UserNtuples->fillg516(vert_pos.y(),entot);
876  //UserNtuples->fillg517(vert_pos.z(),entot);
877 
878  //UserNtuples->filld214(vert_pos.x(),vert_pos.y(),1.);
879  //UserNtuples->filld215(vert_pos.x(),vert_pos.z(),1.);
880  //UserNtuples->filld216(vert_pos.y(),vert_pos.z(),1.);
881  //UserNtuples->filld219(vert_pos.y(),vert_pos.z(),1.);
882  //UserNtuples->filld224(vert_pos.y(),vert_pos.z(),1.);
883  if(prename == "SBST" ) {
884  //UserNtuples->filld225(vert_pos.y(),vert_pos.z(),1.);
885  }
886  if(prename == "SBSTs" ) {
887  //UserNtuples->filld226(vert_pos.y(),vert_pos.z(),1.);
888  }
889  }
890 
891 
892 
893  // ==========================================================================
894 
895 }
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:898
G4double tracklength0
Definition: FP420Test.h:195
void detectorLevel(const G4VTouchable *, int &, int *, G4String *) const
Definition: FP420Test.cc:920
tuple cout
Definition: gather_cfg.py:145
void FP420Test::update ( const EndOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 447 of file FP420Test.cc.

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

447  {
448  itrk = (*trk)()->GetTrackID();
449  if (verbosity > 1) {
450  std::cout <<"FP420Test:update EndOfTrack number = " << itrk << std::endl;
451  }
452  if(itrk == 1) {
453  G4double tracklength = (*trk)()->GetTrackLength(); // Accumulated track length
454 
455  TheHistManager->GetHisto("SumEDep")->Fill(SumEnerDeposit);
456  TheHistManager->GetHisto("TrackL")->Fill(tracklength);
457 
458  // direction !!!
459  G4ThreeVector vert_mom = (*trk)()->GetVertexMomentumDirection();
460  G4ThreeVector vert_pos = (*trk)()->GetVertexPosition(); // vertex ,where this track was created
461 
462 // float eta = 0.5 * log( (1.+vert_mom.z()) / (1.-vert_mom.z()) );
463 // float phi = atan2(vert_mom.y(),vert_mom.x());
464 // if (phi < 0.) phi += twopi;
465 // float phigrad = phi*180./pi;
466 
467 // float XV = vert_pos.x(); // mm
468 // float YV = vert_pos.y(); // mm
469  //UserNtuples->fillg543(phigrad,1.);
470  //UserNtuples->fillp203(phigrad,SumStepl,1.);
471  //UserNtuples->fillg544(XV,1.);
472  //UserNtuples->fillp201(XV,SumStepl,1.);
473  //UserNtuples->fillg545(YV,1.);
474  //UserNtuples->fillp202(YV,SumStepl,1.);
475 
476  //UserNtuples->fillg524(eta,1.);
477 
478  //UserNtuples->fillg534(SumStepl,1.);
479  //UserNtuples->fillg535(eta,SumStepl);
480  //UserNtuples->fillp207(eta,SumStepl,1.);
481  //UserNtuples->filld217(eta,SumStepl,1.);
482  //UserNtuples->filld220(phigrad,SumStepl,1.);
483  //UserNtuples->filld221(XV,SumStepl,1.);
484  //UserNtuples->filld222(YV,SumStepl,1.);
485  //UserNtuples->fillg537(SumStepc,1.);
486  //UserNtuples->fillg84(SumStepl,1.);
487 
488 // MI = (multiple interactions):
489  if(tracklength < z4) {
490 // //UserNtuples->fillp208(eta,tracklength,1.);
491  //UserNtuples->filld218(eta,tracklength,1.);
492  //UserNtuples->fillg538(SumStepc,1.);
493  //UserNtuples->fillg85(SumStepl,1.);
494  }
495 
496  // last step information
497  const G4Step* aStep = (*trk)()->GetStep();
498  // G4int csn = (*trk)()->GetCurrentStepNumber();
499  // G4double sl = (*trk)()->GetStepLength();
500  // preStep
501  G4StepPoint* preStepPoint = aStep->GetPreStepPoint();
502  lastpo = preStepPoint->GetPosition();
503 
504  // Analysis:
505  if(lastpo.z()<z1 && lastpo.perp()< 100.) {
506  //UserNtuples->fillg525(eta,1.);
507  //UserNtuples->fillg546(XV,1.);
508  //UserNtuples->fillg551(YV,1.);
509  //UserNtuples->fillg556(phigrad,1.);
510  }
511  if((lastpo.z()>z1 && lastpo.z()<z2) && lastpo.perp()< 100.) {
512  //UserNtuples->fillg526(eta,1.);
513  //UserNtuples->fillg547(XV,1.);
514  //UserNtuples->fillg552(YV,1.);
515  //UserNtuples->fillg557(phigrad,1.);
516  }
517  if(lastpo.z()<z2 && lastpo.perp()< 100.) {
518  //UserNtuples->fillg527(eta,1.);
519  //UserNtuples->fillg548(XV,1.);
520  //UserNtuples->fillg553(YV,1.);
521  //UserNtuples->fillg558(phigrad,1.);
522  //UserNtuples->fillg521(lastpo.x(),1.);
523  //UserNtuples->fillg522(lastpo.y(),1.);
524  //UserNtuples->fillg523(lastpo.z(),1.);
525  }
526  if(lastpo.z()<z3 && lastpo.perp()< 100.) {
527  //UserNtuples->fillg528(eta,1.);
528  //UserNtuples->fillg549(XV,1.);
529  //UserNtuples->fillg554(YV,1.);
530  //UserNtuples->fillg559(phigrad,1.);
531  }
532  if(lastpo.z()<z4 && lastpo.perp()< 100.) {
533  //UserNtuples->fillg529(eta,1.);
534  //UserNtuples->fillg550(XV,1.);
535  //UserNtuples->fillg555(YV,1.);
536  //UserNtuples->fillg560(phigrad,1.);
537  //UserNtuples->fillg531(lastpo.x(),1.);
538  //UserNtuples->fillg532(lastpo.y(),1.);
539  //UserNtuples->fillg533(lastpo.z(),1.);
540  }
541 
542  /*
543  float th_tr = lastpo.theta();
544  float eta_tr = -log(tan(th_tr/2));
545  float phi_tr = lastpo.phi();
546  if (phi_tr < 0.) phi_tr += twopi;
547 */
548 
549 
550  }
551 
552 }
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:270
tuple cout
Definition: gather_cfg.py:145
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 939 of file FP420Test.cc.

References gather_cfg::cout, eta, FP420G4Hit::getEnergyLoss(), FP420G4Hit::getEntry(), FP420G4Hit::getEntryLocalP(), FP420G4Hit::getExitLocalP(), FP420G4Hit::getTrackID(), FP420G4Hit::getUnitID(), i, cuy::ii, cmsHarvester::index, j, dqm-mbProfile::log, npart, ntfp420_evt, FP420NumberingScheme::packFP420Index(), FP420NumberingScheme::packMYIndex(), phi(), pi, FP420NumberingScheme::realzside(), funct::tan(), FP420NumberingScheme::unpackCopyIndex(), FP420NumberingScheme::unpackFP420Index(), FP420NumberingScheme::unpackLayerIndex(), FP420NumberingScheme::unpackOrientation(), HLT_25ns10e33_v2_cff::verbosity, 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().

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