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_25ns14e33_v1_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:121
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_25ns14e33_v1_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 : "
152  << std::cout << std::endl;
153  }
154 
155  std::cout<<"FP420Test: End of process"<<std::endl;
156 
157 
158 
159 }
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:225
std::string fOutputFile
Definition: FP420Test.h:234
tuple cout
Definition: gather_cfg.py:121
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 921 of file FP420Test.cc.

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

922  {
923 
924  //Get name and copy numbers
925  if (level > 0) {
926  for (int ii = 0; ii < level; ii++) {
927  int i = level - ii - 1;
928  G4VPhysicalVolume* pv = touch->GetVolume(i);
929  if (pv != 0)
930  name[ii] = pv->GetName();
931  else
932  name[ii] = "Unknown";
933  copyno[ii] = touch->GetReplicaNumber(i);
934  }
935  }
936 }
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 899 of file FP420Test.cc.

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

Definition at line 909 of file FP420Test.cc.

References cuy::ii.

910  {
911 
912  //Go down to current level
913  if (level > 0 && level >= currentlevel) {
914  int ii = level - currentlevel;
915  return touch->GetVolume(ii)->GetName();
916  } else {
917  return "NotFound";
918  }
919 }
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 403 of file FP420Test.cc.

References gather_cfg::cout.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfRun * >.

Definition at line 410 of file FP420Test.cc.

References gather_cfg::cout.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfRun * >.

Definition at line 417 of file FP420Test.cc.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 422 of file FP420Test.cc.

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

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 431 of file FP420Test.cc.

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

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const G4Step * >.

Definition at line 558 of file FP420Test.cc.

References gather_cfg::cout, HLT_25ns14e33_v1_cff::particleType, and HLT_25ns14e33_v1_cff::verbosity.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfTrack * >.

Definition at line 448 of file FP420Test.cc.

References gather_cfg::cout, phi, and HLT_25ns14e33_v1_cff::verbosity.

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

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const EndOfEvent * >.

Definition at line 940 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, cmsBatch::log, npart, ntfp420_evt, FP420NumberingScheme::packFP420Index(), FP420NumberingScheme::packMYIndex(), phi, pi, FP420NumberingScheme::realzside(), funct::tan(), FP420NumberingScheme::unpackCopyIndex(), FP420NumberingScheme::unpackFP420Index(), FP420NumberingScheme::unpackLayerIndex(), FP420NumberingScheme::unpackOrientation(), HLT_25ns14e33_v1_cff::verbosity, and ecaldqm::zside().

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

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

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.