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
PltSD Class Reference

#include <PltSD.h>

Inheritance diagram for PltSD:
SensitiveTkDetector Observer< const BeginOfEvent * > Observer< const BeginOfTrack * > Observer< const BeginOfJob * > SensitiveDetector

Public Member Functions

virtual void EndOfEvent (G4HCofThisEvent *)
 
void fillHits (edm::PSimHitContainer &, std::string use)
 
 PltSD (std::string, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual uint32_t setDetUnitId (G4Step *)
 
virtual ~PltSD ()
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (const std::string &vname)
 
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point)
 
Local3DPoint FinalStepPosition (G4Step *s, coordinates)
 
virtual std::vector< std::string > getNames ()
 
virtual void Initialize (G4HCofThisEvent *eventHC)
 
Local3DPoint InitialStepPosition (G4Step *s, coordinates)
 
std::string nameOfSD ()
 
void NaNTrap (G4Step *step)
 
void Register ()
 
 SensitiveDetector (std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
virtual ~SensitiveDetector ()
 
- 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 BeginOfJob * >
 Observer ()
 
void slotForUpdate (const BeginOfJob *iT)
 
virtual ~Observer ()
 

Private Member Functions

virtual void clearHits ()
 
virtual bool closeHit (G4Step *)
 
virtual void createHit (G4Step *)
 
TrackInformationgetOrCreateTrackInformation (const G4Track *)
 
virtual bool newHit (G4Step *)
 
virtual void sendHit ()
 
void update (const BeginOfEvent *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *)
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfJob *)
 This routine will be called when the appropriate signal arrives. More...
 
virtual void updateHit (G4Step *)
 

Private Attributes

float energyCut
 
float energyHistoryCut
 
int eventno
 
Local3DPoint globalEntryPoint
 
Local3DPoint globalExitPoint
 
uint32_t lastId
 
unsigned int lastTrack
 
G4TrackToParticleIDmyG4TrackToParticleID
 
std::string myName
 
UpdatablePSimHitmySimHit
 
G4VPhysicalVolume * oldVolume
 
std::string pname
 
TrackingSlaveSDslave
 
G4ProcessTypeEnumeratortheG4ProcessTypeEnumerator
 

Additional Inherited Members

- Public Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 

Detailed Description

Definition at line 30 of file PltSD.h.

Constructor & Destructor Documentation

PltSD::PltSD ( std::string  name,
const DDCompactView cpv,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 35 of file PltSD.cc.

References SensitiveDetector::AssignSD(), energyCut, energyHistoryCut, edm::ParameterSet::getParameter(), GeV, SensitiveDetectorCatalog::logicalNames(), myG4TrackToParticleID, SensitiveDetector::Register(), slave, and theG4ProcessTypeEnumerator.

39  :
40 SensitiveTkDetector(name, cpv, clg, p), myName(name), mySimHit(0),
41 oldVolume(0), lastId(0), lastTrack(0), eventno(0) {
42 
43  edm::ParameterSet m_TrackerSD = p.getParameter<edm::ParameterSet>("PltSD");
44  energyCut = m_TrackerSD.getParameter<double>("EnergyThresholdForPersistencyInGeV")*GeV; //default must be 0.5 (?)
45  energyHistoryCut = m_TrackerSD.getParameter<double>("EnergyThresholdForHistoryInGeV")*GeV;//default must be 0.05 (?)
46 
47  edm::LogInfo("PltSD") <<"Criteria for Saving Tracker SimTracks: \n "
48  <<" History: "<<energyHistoryCut<< " MeV ; Persistency: "<< energyCut<<" MeV\n"
49  <<" Constructing a PltSD with ";
50 
51  slave = new TrackingSlaveSD(name);
52 
53  // Now attach the right detectors (LogicalVolumes) to me
54  const std::vector<std::string>& lvNames = clg.logicalNames(name);
55  this->Register();
56  for (std::vector<std::string>::const_iterator it = lvNames.begin();
57  it != lvNames.end(); it++) {
58  edm::LogInfo("PltSD")<< name << " attaching LV " << *it;
59  this->AssignSD(*it);
60  }
61 
64 }
T getParameter(std::string const &) const
const double GeV
Definition: MathUtil.h:16
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
std::string myName
Definition: PltSD.h:66
G4TrackToParticleID * myG4TrackToParticleID
Definition: PltSD.h:65
int eventno
Definition: PltSD.h:76
TrackingSlaveSD * slave
Definition: PltSD.h:63
const std::vector< std::string > & logicalNames(const std::string &readoutName) const
virtual void AssignSD(const std::string &vname)
float energyCut
Definition: PltSD.h:68
float energyHistoryCut
Definition: PltSD.h:69
SensitiveTkDetector(std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
G4VPhysicalVolume * oldVolume
Definition: PltSD.h:73
unsigned int lastTrack
Definition: PltSD.h:75
uint32_t lastId
Definition: PltSD.h:74
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: PltSD.h:64
PltSD::~PltSD ( )
virtual

Definition at line 66 of file PltSD.cc.

References myG4TrackToParticleID, slave, and theG4ProcessTypeEnumerator.

66  {
67  delete slave;
69  delete myG4TrackToParticleID;
70 }
G4TrackToParticleID * myG4TrackToParticleID
Definition: PltSD.h:65
TrackingSlaveSD * slave
Definition: PltSD.h:63
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: PltSD.h:64

Member Function Documentation

void PltSD::clearHits ( )
privatevirtual

Implements SensitiveDetector.

Definition at line 328 of file PltSD.cc.

References TrackingSlaveSD::Initialize(), and slave.

Referenced by update().

328  {
329  slave->Initialize();
330 }
TrackingSlaveSD * slave
Definition: PltSD.h:63
virtual void Initialize()
bool PltSD::closeHit ( G4Step *  aStep)
privatevirtual

Definition at line 255 of file PltSD.cc.

References PSimHit::exitPoint(), SensitiveDetector::InitialStepPosition(), SensitiveDetector::LocalCoordinates, LogDebug, mag(), and mySimHit.

Referenced by newHit().

255  {
256 
257  if (mySimHit == 0) return false;
258  const float tolerance = 0.05 * mm; // 50 micron are allowed between the exit
259  // point of the current hit and the entry point of the new hit
261  LogDebug("PltSD")<< " closeHit: distance = " << (mySimHit->exitPoint()-theEntryPoint).mag();
262 
263  if ((mySimHit->exitPoint()-theEntryPoint).mag()<tolerance) return true;
264  return false;
265 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
Local3DPoint InitialStepPosition(G4Step *s, coordinates)
void PltSD::createHit ( G4Step *  aStep)
privatevirtual

Definition at line 267 of file PltSD.cc.

References SensitiveDetector::ConvertToLocal3DPoint(), PSimHit::detUnitId(), PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), SensitiveDetector::FinalStepPosition(), GeV, globalEntryPoint, globalExitPoint, SensitiveDetector::InitialStepPosition(), lastId, lastTrack, SensitiveDetector::LocalCoordinates, LogDebug, myG4TrackToParticleID, mySimHit, oldVolume, G4TrackToParticleID::particleID(), PV3DBase< T, PVType, FrameType >::phi(), pname, G4ProcessTypeEnumerator::processId(), setDetUnitId(), theG4ProcessTypeEnumerator, PV3DBase< T, PVType, FrameType >::theta(), PSimHit::trackId(), findQualityFiles::v, and SensitiveDetector::WorldCoordinates.

Referenced by ProcessHits().

267  {
268 
269  if (mySimHit != 0) {
270  delete mySimHit;
271  mySimHit=0;
272  }
273 
274  G4Track * theTrack = aStep->GetTrack();
275  G4VPhysicalVolume * v = aStep->GetPreStepPoint()->GetPhysicalVolume();
276 
279 
280  float thePabs = aStep->GetPreStepPoint()->GetMomentum().mag()/GeV;
281  float theTof = aStep->GetPreStepPoint()->GetGlobalTime()/nanosecond;
282  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
283  int theParticleType = myG4TrackToParticleID->particleID(theTrack);
284  uint32_t theDetUnitId = setDetUnitId(aStep);
285 
288  pname = theTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
289 
290  unsigned int theTrackID = theTrack->GetTrackID();
291 
292  G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
293  // convert it to local frame
294  G4ThreeVector lmd = ((G4TouchableHistory *)(aStep->GetPreStepPoint()->GetTouchable()))->GetHistory()->GetTopTransform().TransformAxis(gmd);
296  float theThetaAtEntry = lnmd.theta();
297  float thePhiAtEntry = lnmd.phi();
298 
299  mySimHit = new UpdatablePSimHit(theEntryPoint,theExitPoint,thePabs,theTof,
300  theEnergyLoss,theParticleType,theDetUnitId,
301  theTrackID,theThetaAtEntry,thePhiAtEntry,
302  theG4ProcessTypeEnumerator->processId(theTrack->GetCreatorProcess()));
303 
304  LogDebug("PltSD") << " Created PSimHit: " << pname << " "
305  << mySimHit->detUnitId() << " " << mySimHit->trackId()
306  << " " << mySimHit->energyLoss() << " "
307  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
308  lastId = theDetUnitId;
309  lastTrack = theTrackID;
310  oldVolume = v;
311 }
#define LogDebug(id)
const double GeV
Definition: MathUtil.h:16
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
G4TrackToParticleID * myG4TrackToParticleID
Definition: PltSD.h:65
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
unsigned int processId(const G4VProcess *p)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point)
static int particleID(const G4Track *)
Local3DPoint globalExitPoint
Definition: PltSD.h:72
virtual uint32_t setDetUnitId(G4Step *)
Definition: PltSD.cc:103
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
G4VPhysicalVolume * oldVolume
Definition: PltSD.h:73
unsigned int trackId() const
Definition: PSimHit.h:102
unsigned int lastTrack
Definition: PltSD.h:75
std::string pname
Definition: PltSD.h:77
uint32_t lastId
Definition: PltSD.h:74
Local3DPoint FinalStepPosition(G4Step *s, coordinates)
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: PltSD.h:64
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
Local3DPoint InitialStepPosition(G4Step *s, coordinates)
unsigned int detUnitId() const
Definition: PSimHit.h:93
Local3DPoint globalEntryPoint
Definition: PltSD.h:71
void PltSD::EndOfEvent ( G4HCofThisEvent *  )
virtual

Reimplemented from SensitiveDetector.

Definition at line 197 of file PltSD.cc.

References LogDebug, myName, mySimHit, and sendHit().

197  {
198 
199  LogDebug("PltSD")<< " Saving the last hit in a ROU " << myName;
200 
201  if (mySimHit == 0) return;
202  sendHit();
203 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
std::string myName
Definition: PltSD.h:66
virtual void sendHit()
Definition: PltSD.cc:209
void PltSD::fillHits ( edm::PSimHitContainer c,
std::string  use 
)
virtual

Implements SensitiveTkDetector.

Definition at line 205 of file PltSD.cc.

References TrackingSlaveSD::hits(), gen::n, TrackingSlaveSD::name(), and slave.

205  {
206  if (slave->name() == n) c=slave->hits();
207 }
std::string name() const
TrackingSlaveSD * slave
Definition: PltSD.h:63
std::vector< PSimHit > & hits()
TrackInformation * PltSD::getOrCreateTrackInformation ( const G4Track *  gTrack)
private

Definition at line 332 of file PltSD.cc.

References info(), and groupFilesInBlocks::temp.

Referenced by ProcessHits().

332  {
333  G4VUserTrackInformation* temp = gTrack->GetUserInformation();
334  if (temp == 0){
335  edm::LogError("PltSD") <<" ERROR: no G4VUserTrackInformation available";
336  abort();
337  }else{
338  TrackInformation* info = dynamic_cast<TrackInformation*>(temp);
339  if (info == 0){
340  edm::LogError("PltSD") <<" ERROR: TkSimTrackSelection: the UserInformation does not appear to be a TrackInformation";
341  abort();
342  }
343  return info;
344  }
345 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool PltSD::newHit ( G4Step *  aStep)
privatevirtual

Definition at line 241 of file PltSD.cc.

References closeHit(), lastId, lastTrack, LogDebug, mySimHit, and setDetUnitId().

Referenced by ProcessHits().

241  {
242 
243  G4Track * theTrack = aStep->GetTrack();
244  uint32_t theDetUnitId = setDetUnitId(aStep);
245  unsigned int theTrackID = theTrack->GetTrackID();
246 
247  LogDebug("PltSD") << " OLD (d,t) = (" << lastId << "," << lastTrack
248  << "), new = (" << theDetUnitId << "," << theTrackID << ") return "
249  << ((theTrackID == lastTrack) && (lastId == theDetUnitId));
250  if ((mySimHit != 0) && (theTrackID == lastTrack) && (lastId == theDetUnitId) && closeHit(aStep))
251  return false;
252  return true;
253 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
virtual uint32_t setDetUnitId(G4Step *)
Definition: PltSD.cc:103
virtual bool closeHit(G4Step *)
Definition: PltSD.cc:255
unsigned int lastTrack
Definition: PltSD.h:75
uint32_t lastId
Definition: PltSD.h:74
bool PltSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Implements SensitiveDetector.

Definition at line 72 of file PltSD.cc.

References createHit(), energyCut, energyHistoryCut, getOrCreateTrackInformation(), info(), lastTrack, LogDebug, newHit(), TrackInformation::putInHistory(), sendHit(), TrackInformation::storeTrack(), and updateHit().

72  {
73 
74  LogDebug("PltSD") << " Entering a new Step "
75  << aStep->GetTotalEnergyDeposit() << " "
76  << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName();
77 
78  G4Track * gTrack = aStep->GetTrack();
79  if ((unsigned int)(gTrack->GetTrackID()) != lastTrack) {
80 
81  if (gTrack->GetKineticEnergy() > energyCut){
83  info->storeTrack(true);
84  }
85  if (gTrack->GetKineticEnergy() > energyHistoryCut){
87  info->putInHistory();
88  }
89  }
90 
91  if (aStep->GetTotalEnergyDeposit()>0.) {
92  if (newHit(aStep) == true) {
93  sendHit();
94  createHit(aStep);
95  } else {
96  updateHit(aStep);
97  }
98  return true;
99  }
100  return false;
101 }
#define LogDebug(id)
static const TGPicture * info(bool iBackgroundIsBlack)
virtual bool newHit(G4Step *)
Definition: PltSD.cc:241
bool storeTrack() const
virtual void updateHit(G4Step *)
Definition: PltSD.cc:224
float energyCut
Definition: PltSD.h:68
virtual void sendHit()
Definition: PltSD.cc:209
float energyHistoryCut
Definition: PltSD.h:69
virtual void createHit(G4Step *)
Definition: PltSD.cc:267
unsigned int lastTrack
Definition: PltSD.h:75
TrackInformation * getOrCreateTrackInformation(const G4Track *)
Definition: PltSD.cc:332
void PltSD::sendHit ( )
privatevirtual

Definition at line 209 of file PltSD.cc.

References PSimHit::detUnitId(), PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), lastId, lastTrack, LogDebug, mySimHit, pname, TrackingSlaveSD::processHits(), slave, and PSimHit::trackId().

Referenced by EndOfEvent(), and ProcessHits().

209  {
210  if (mySimHit == 0) return;
211  LogDebug("PltSD") << " Storing PSimHit: " << pname << " " << mySimHit->detUnitId()
212  << " " << mySimHit->trackId() << " " << mySimHit->energyLoss()
213  << " " << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
214 
216 
217  // clean up
218  delete mySimHit;
219  mySimHit = 0;
220  lastTrack = 0;
221  lastId = 0;
222 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
TrackingSlaveSD * slave
Definition: PltSD.h:63
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
unsigned int trackId() const
Definition: PSimHit.h:102
unsigned int lastTrack
Definition: PltSD.h:75
virtual bool processHits(const PSimHit &)
std::string pname
Definition: PltSD.h:77
uint32_t lastId
Definition: PltSD.h:74
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
unsigned int detUnitId() const
Definition: PSimHit.h:93
uint32_t PltSD::setDetUnitId ( G4Step *  aStep)
virtual

Implements SensitiveDetector.

Definition at line 103 of file PltSD.cc.

References gather_cfg::cout, testEve_cfg::level, LogDebug, and groupFilesInBlocks::temp.

Referenced by createHit(), and newHit().

103  {
104 
105  unsigned int detId = 0;
106 
107  LogDebug("PltSD")<< " DetID = "<<detId;
108 
109  //Find number of levels
110  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
111  int level = 0;
112  if (touch) level = ((touch->GetHistoryDepth())+1);
113 
114  //Get name and copy numbers
115  if ( level > 1 ) {
116  //some debugging with the names
117  G4String sensorName = touch->GetVolume(2)->GetName();
118  G4String telName = touch->GetVolume(3)->GetName();
119  G4String volumeName = touch->GetVolume(4)->GetName();
120  if ( sensorName != "PLTSensorPlane" )
121  std::cout << " PltSD::setDetUnitId -w- Sensor name not PLTSensorPlane " << std::endl;
122  if ( telName != "Telescope" )
123  std::cout << " PltSD::setDetUnitId -w- Telescope name not Telescope " << std::endl;
124  if ( volumeName != "PLT" )
125  std::cout << " PltSD::setDetUnitId -w- Volume name not PLT " << std::endl;
126 
127  //Get the information about which telescope, plane, row/column was hit
128  int columnNum = touch->GetReplicaNumber(0);
129  int rowNum = touch->GetReplicaNumber(1);
130  int sensorNum = touch->GetReplicaNumber(2);
131  int telNum = touch->GetReplicaNumber(3);
132  //temp stores the PLTBCM volume the hit occured in (i.e. was the hit on the + or -z side?)
133  int temp = touch->GetReplicaNumber(5);
134  //convert to the PLT hit id standard
135  int pltNum;
136  if (temp == 2) pltNum = 0;
137  else pltNum = 1;
138 
139  //correct the telescope numbers on the -z side to have the same naming convention in phi as the +z side
140  if (pltNum == 0){
141  if (telNum == 0){
142  telNum = 7;
143  }
144  else if (telNum == 1){
145  telNum = 6;
146  }
147  else if (telNum == 2){
148  telNum = 5;
149  }
150  else if (telNum == 3){
151  telNum = 4;
152  }
153  else if (telNum == 4){
154  telNum = 3;
155  }
156  else if (telNum == 5){
157  telNum = 2;
158  }
159  else if (telNum == 6){
160  telNum = 1;
161  }
162  else if (telNum == 7){
163  telNum = 0;
164  }
165  }
166  //the PLT is divided into sets of telescopes on the + and -x sides
167  int halfCarriageNum = -1;
168 
169  //If the telescope is on the -x side of the carriage, halfCarriageNum=0. If on the +x side, it is = 1.
170  if(telNum == 0 || telNum == 1 || telNum == 2 || telNum == 3)
171  halfCarriageNum = 0;
172  else
173  halfCarriageNum = 1;
174  //correct the telescope numbers of the +x half-carriage to range from 0 to 3
175  if(halfCarriageNum == 1){
176  if(telNum == 4){
177  telNum = 0;
178  }
179  else if (telNum == 5){
180  telNum = 1;
181  }
182  else if (telNum == 6){
183  telNum = 2;
184  }
185  else if (telNum == 7){
186  telNum = 3;
187  }
188  }
189  //Define unique detId for each pixel. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/PLTSimulationGuide for more information
190  detId = 10000000*pltNum+1000000*halfCarriageNum+100000*telNum+10000*sensorNum+100*rowNum+columnNum;
191  //std::cout << "Hit Recorded at " << "plt:" << pltNum << " hc:" << halfCarriageNum << " tel:" << telNum << " plane:" << sensorNum << std::endl;
192  }
193 
194  return detId;
195 }
#define LogDebug(id)
tuple cout
Definition: gather_cfg.py:121
tuple level
Definition: testEve_cfg.py:34
void PltSD::update ( const BeginOfEvent )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 315 of file PltSD.cc.

References clearHits(), eventno, and mySimHit.

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

315  {
316 
317  clearHits();
318  eventno = (*i)()->GetEventID();
319  mySimHit = 0;
320 }
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
int eventno
Definition: PltSD.h:76
virtual void clearHits()
Definition: PltSD.cc:328
void PltSD::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 322 of file PltSD.cc.

References pname.

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

322  {
323 
324  const G4Track* gTrack = (*bot)();
325  pname = gTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
326 }
std::string pname
Definition: PltSD.h:77
void PltSD::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

313 { }
void PltSD::updateHit ( G4Step *  aStep)
privatevirtual

Definition at line 224 of file PltSD.cc.

References UpdatablePSimHit::addEnergyLoss(), PSimHit::detUnitId(), PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), SensitiveDetector::FinalStepPosition(), GeV, globalExitPoint, SensitiveDetector::LocalCoordinates, LogDebug, mySimHit, pname, UpdatablePSimHit::setExitPoint(), PSimHit::trackId(), and SensitiveDetector::WorldCoordinates.

Referenced by ProcessHits().

224  {
225 
227  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
228  mySimHit->setExitPoint(theExitPoint);
229  LogDebug("PltSD")<< " Before : " << mySimHit->energyLoss();
230  mySimHit->addEnergyLoss(theEnergyLoss);
232 
233  LogDebug("PltSD") << " Updating: new exitpoint " << pname << " "
234  << theExitPoint << " new energy loss " << theEnergyLoss
235  << "\n Updated PSimHit: " << mySimHit->detUnitId()
236  << " " << mySimHit->trackId()
237  << " " << mySimHit->energyLoss() << " "
238  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
239 }
#define LogDebug(id)
const double GeV
Definition: MathUtil.h:16
UpdatablePSimHit * mySimHit
Definition: PltSD.h:67
void setExitPoint(const Local3DPoint &exit)
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
Local3DPoint globalExitPoint
Definition: PltSD.h:72
void addEnergyLoss(float eloss)
float energyLoss() const
The energy deposit in the PSimHit, in ???.
Definition: PSimHit.h:75
unsigned int trackId() const
Definition: PSimHit.h:102
std::string pname
Definition: PltSD.h:77
Local3DPoint FinalStepPosition(G4Step *s, coordinates)
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
unsigned int detUnitId() const
Definition: PSimHit.h:93

Member Data Documentation

float PltSD::energyCut
private

Definition at line 68 of file PltSD.h.

Referenced by PltSD(), and ProcessHits().

float PltSD::energyHistoryCut
private

Definition at line 69 of file PltSD.h.

Referenced by PltSD(), and ProcessHits().

int PltSD::eventno
private

Definition at line 76 of file PltSD.h.

Referenced by update().

Local3DPoint PltSD::globalEntryPoint
private

Definition at line 71 of file PltSD.h.

Referenced by createHit().

Local3DPoint PltSD::globalExitPoint
private

Definition at line 72 of file PltSD.h.

Referenced by createHit(), and updateHit().

uint32_t PltSD::lastId
private

Definition at line 74 of file PltSD.h.

Referenced by createHit(), newHit(), and sendHit().

unsigned int PltSD::lastTrack
private

Definition at line 75 of file PltSD.h.

Referenced by createHit(), newHit(), ProcessHits(), and sendHit().

G4TrackToParticleID* PltSD::myG4TrackToParticleID
private

Definition at line 65 of file PltSD.h.

Referenced by createHit(), PltSD(), and ~PltSD().

std::string PltSD::myName
private

Definition at line 66 of file PltSD.h.

Referenced by EndOfEvent().

UpdatablePSimHit* PltSD::mySimHit
private

Definition at line 67 of file PltSD.h.

Referenced by closeHit(), createHit(), EndOfEvent(), newHit(), sendHit(), update(), and updateHit().

G4VPhysicalVolume* PltSD::oldVolume
private

Definition at line 73 of file PltSD.h.

Referenced by createHit().

std::string PltSD::pname
private

Definition at line 77 of file PltSD.h.

Referenced by createHit(), sendHit(), update(), and updateHit().

TrackingSlaveSD* PltSD::slave
private

Definition at line 63 of file PltSD.h.

Referenced by clearHits(), fillHits(), PltSD(), sendHit(), and ~PltSD().

G4ProcessTypeEnumerator* PltSD::theG4ProcessTypeEnumerator
private

Definition at line 64 of file PltSD.h.

Referenced by createHit(), PltSD(), and ~PltSD().