CMS 3D CMS Logo

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

#include <Bcm1fSD.h>

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

Public Member Functions

 Bcm1fSD (const std::string &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
void clearHits () override
 
void EndOfEvent (G4HCofThisEvent *) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
bool ProcessHits (G4Step *, G4TouchableHistory *) override
 
uint32_t setDetUnitId (const G4Step *) override
 
 ~Bcm1fSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
const std::vector< std::string > & getNames () const
 
void Initialize (G4HCofThisEvent *eventHC) override
 
 SensitiveDetector (const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &, edm::ParameterSet const &p)
 
 ~SensitiveDetector () override
 
- 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 bool closeHit (G4Step *)
 
virtual void createHit (G4Step *)
 
TrackInformationgetOrCreateTrackInformation (const G4Track *)
 
virtual bool newHit (G4Step *)
 
virtual void sendHit ()
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfTrack *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const BeginOfJob *) override
 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
 
UpdatablePSimHitmySimHit
 
G4VPhysicalVolume * oldVolume
 
std::string pname
 
TrackingSlaveSDslave
 
G4ProcessTypeEnumeratortheG4ProcessTypeEnumerator
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from SensitiveDetector
Local3DPoint ConvertToLocal3DPoint (const G4ThreeVector &point) const
 
Local3DPoint FinalStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint InitialStepPosition (const G4Step *step, coordinates) const
 
Local3DPoint LocalPostStepPosition (const G4Step *step) const
 
Local3DPoint LocalPreStepPosition (const G4Step *step) const
 
void NaNTrap (const G4Step *step) const
 
void setNames (const std::vector< std::string > &)
 

Detailed Description

Definition at line 30 of file Bcm1fSD.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file Bcm1fSD.cc.

References energyCut, energyHistoryCut, edm::ParameterSet::getParameter(), GeV, myG4TrackToParticleID, slave, and theG4ProcessTypeEnumerator.

36  :
37  SensitiveTkDetector(name, cpv, clg, p), mySimHit(nullptr),
38  oldVolume(nullptr), lastId(0), lastTrack(0), eventno(0) {
39 
40  edm::ParameterSet m_TrackerSD = p.getParameter<edm::ParameterSet>("Bcm1fSD");
41  energyCut = m_TrackerSD.getParameter<double>("EnergyThresholdForPersistencyInGeV")*GeV; //default must be 0.5 (?)
42  energyHistoryCut = m_TrackerSD.getParameter<double>("EnergyThresholdForHistoryInGeV")*GeV;//default must be 0.05 (?)
43 
44  edm::LogInfo("Bcm1fSD") <<" Criteria for Saving Tracker SimTracks: \n "
45  <<" History: "<<energyHistoryCut<< " MeV ; Persistency: "
46  << energyCut<<" MeV\n" <<" Constructing a Bcm1fSD";
47 
48  slave = new TrackingSlaveSD(name);
49 
52 }
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
T getParameter(std::string const &) const
const double GeV
Definition: MathUtil.h:16
G4TrackToParticleID * myG4TrackToParticleID
Definition: Bcm1fSD.h:65
uint32_t lastId
Definition: Bcm1fSD.h:73
G4VPhysicalVolume * oldVolume
Definition: Bcm1fSD.h:72
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: Bcm1fSD.h:64
TrackingSlaveSD * slave
Definition: Bcm1fSD.h:63
float energyHistoryCut
Definition: Bcm1fSD.h:68
int eventno
Definition: Bcm1fSD.h:75
float energyCut
Definition: Bcm1fSD.h:67
unsigned int lastTrack
Definition: Bcm1fSD.h:74
SensitiveTkDetector(const std::string &iname, const DDCompactView &cpv, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
Bcm1fSD::~Bcm1fSD ( )
override

Definition at line 54 of file Bcm1fSD.cc.

References myG4TrackToParticleID, slave, and theG4ProcessTypeEnumerator.

54  {
55  delete slave;
57  delete myG4TrackToParticleID;
58 }
G4TrackToParticleID * myG4TrackToParticleID
Definition: Bcm1fSD.h:65
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: Bcm1fSD.h:64
TrackingSlaveSD * slave
Definition: Bcm1fSD.h:63

Member Function Documentation

void Bcm1fSD::clearHits ( )
overridevirtual

Implements SensitiveDetector.

Definition at line 274 of file Bcm1fSD.cc.

References TrackingSlaveSD::Initialize(), and slave.

Referenced by update().

274  {
275  slave->Initialize();
276 }
TrackingSlaveSD * slave
Definition: Bcm1fSD.h:63
virtual void Initialize()
bool Bcm1fSD::closeHit ( G4Step *  aStep)
privatevirtual

Definition at line 201 of file Bcm1fSD.cc.

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

Referenced by newHit().

201  {
202 
203  if (mySimHit == nullptr) return false;
204  const float tolerance = 0.05 * mm; // 50 micron are allowed between the exit
205  // point of the current hit and the entry point of the new hit
207  LogDebug("Bcm1fSD")<< " closeHit: distance = " << (mySimHit->exitPoint()-theEntryPoint).mag();
208 
209  if ((mySimHit->exitPoint()-theEntryPoint).mag()<tolerance) return true;
210  return false;
211 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
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(const G4Step *step, coordinates) const
void Bcm1fSD::createHit ( G4Step *  aStep)
privatevirtual

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

213  {
214 
215  if (mySimHit != nullptr) {
216  delete mySimHit;
217  mySimHit=nullptr;
218  }
219 
220  G4Track * theTrack = aStep->GetTrack();
221  G4VPhysicalVolume * v = aStep->GetPreStepPoint()->GetPhysicalVolume();
222 
225 
226  float thePabs = aStep->GetPreStepPoint()->GetMomentum().mag()/GeV;
227  float theTof = aStep->GetPreStepPoint()->GetGlobalTime()/nanosecond;
228  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
229  int theParticleType = myG4TrackToParticleID->particleID(theTrack);
230  uint32_t theDetUnitId = setDetUnitId(aStep);
231 
234  pname = theTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
235 
236  unsigned int theTrackID = theTrack->GetTrackID();
237 
238  G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
239  // convert it to local frame
240  G4ThreeVector lmd = ((G4TouchableHistory *)(aStep->GetPreStepPoint()->GetTouchable()))->GetHistory()->GetTopTransform().TransformAxis(gmd);
242  float theThetaAtEntry = lnmd.theta();
243  float thePhiAtEntry = lnmd.phi();
244 
245  mySimHit = new UpdatablePSimHit(theEntryPoint,theExitPoint,thePabs,theTof,
246  theEnergyLoss,theParticleType,theDetUnitId,
247  theTrackID,theThetaAtEntry,thePhiAtEntry,
248  theG4ProcessTypeEnumerator->processId(theTrack->GetCreatorProcess()));
249 
250  LogDebug("Bcm1fSD") << " Created PSimHit: " << pname << " "
251  << mySimHit->detUnitId() << " " << mySimHit->trackId()
252  << " " << mySimHit->energyLoss() << " "
253  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
254  lastId = theDetUnitId;
255  lastTrack = theTrackID;
256  oldVolume = v;
257 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
Local3DPoint globalExitPoint
Definition: Bcm1fSD.h:71
const double GeV
Definition: MathUtil.h:16
G4TrackToParticleID * myG4TrackToParticleID
Definition: Bcm1fSD.h:65
uint32_t lastId
Definition: Bcm1fSD.h:73
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
G4VPhysicalVolume * oldVolume
Definition: Bcm1fSD.h:72
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: Bcm1fSD.h:64
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Local3DPoint globalEntryPoint
Definition: Bcm1fSD.h:70
uint32_t setDetUnitId(const G4Step *) override
Definition: Bcm1fSD.cc:91
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
unsigned int processId(const G4VProcess *p) const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
Local3DPoint FinalStepPosition(const G4Step *step, coordinates) const
static int particleID(const G4Track *)
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: Bcm1fSD.h:74
std::string pname
Definition: Bcm1fSD.h:76
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
unsigned int detUnitId() const
Definition: PSimHit.h:93
Local3DPoint InitialStepPosition(const G4Step *step, coordinates) const
void Bcm1fSD::EndOfEvent ( G4HCofThisEvent *  )
override

Definition at line 143 of file Bcm1fSD.cc.

References LogDebug, mySimHit, and sendHit().

143  {
144 
145  LogDebug("Bcm1fSD")<< " Saving the last hit in a ROU " << GetName();
146 
147  if (mySimHit == nullptr) return;
148  sendHit();
149 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
virtual void sendHit()
Definition: Bcm1fSD.cc:155
void Bcm1fSD::fillHits ( edm::PSimHitContainer cc,
const std::string &  hname 
)
overridevirtual

Implements SensitiveTkDetector.

Definition at line 151 of file Bcm1fSD.cc.

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

151  {
152  if (slave->name() == hname) { cc=slave->hits(); }
153 }
std::string name() const
TrackingSlaveSD * slave
Definition: Bcm1fSD.h:63
std::vector< PSimHit > & hits()
TrackInformation * Bcm1fSD::getOrCreateTrackInformation ( const G4Track *  gTrack)
private

Definition at line 278 of file Bcm1fSD.cc.

References info(), and groupFilesInBlocks::temp.

Referenced by ProcessHits().

278  {
279  G4VUserTrackInformation* temp = gTrack->GetUserInformation();
280  if (temp == nullptr){
281  edm::LogError("Bcm1fSD") <<" ERROR: no G4VUserTrackInformation available";
282  abort();
283  }else{
284  TrackInformation* info = dynamic_cast<TrackInformation*>(temp);
285  if (info == nullptr){
286  edm::LogError("Bcm1fSD") <<" ERROR: TkSimTrackSelection: the UserInformation does not appear to be a TrackInformation";
287  }
288  return info;
289  }
290 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool Bcm1fSD::newHit ( G4Step *  aStep)
privatevirtual

Definition at line 187 of file Bcm1fSD.cc.

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

Referenced by ProcessHits().

187  {
188 
189  G4Track * theTrack = aStep->GetTrack();
190  uint32_t theDetUnitId = setDetUnitId(aStep);
191  unsigned int theTrackID = theTrack->GetTrackID();
192 
193  LogDebug("Bcm1fSD") << " OLD (d,t) = (" << lastId << "," << lastTrack
194  << "), new = (" << theDetUnitId << "," << theTrackID << ") return "
195  << ((theTrackID == lastTrack) && (lastId == theDetUnitId));
196  if ((mySimHit != nullptr) && (theTrackID == lastTrack) && (lastId == theDetUnitId) && closeHit(aStep))
197  return false;
198  return true;
199 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
uint32_t lastId
Definition: Bcm1fSD.h:73
virtual bool closeHit(G4Step *)
Definition: Bcm1fSD.cc:201
uint32_t setDetUnitId(const G4Step *) override
Definition: Bcm1fSD.cc:91
unsigned int lastTrack
Definition: Bcm1fSD.h:74
bool Bcm1fSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
overridevirtual

Implements SensitiveDetector.

Definition at line 60 of file Bcm1fSD.cc.

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

60  {
61 
62  LogDebug("Bcm1fSD") << " Entering a new Step "
63  << aStep->GetTotalEnergyDeposit() << " "
64  << aStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetName();
65 
66  G4Track * gTrack = aStep->GetTrack();
67  if ((unsigned int)(gTrack->GetTrackID()) != lastTrack) {
68 
69  if (gTrack->GetKineticEnergy() > energyCut){
71  info->storeTrack(true);
72  }
73  if (gTrack->GetKineticEnergy() > energyHistoryCut){
75  info->putInHistory();
76  }
77  }
78 
79  if (aStep->GetTotalEnergyDeposit()>0.) {
80  if (newHit(aStep) == true) {
81  sendHit();
82  createHit(aStep);
83  } else {
84  updateHit(aStep);
85  }
86  return true;
87  }
88  return false;
89 }
#define LogDebug(id)
static const TGPicture * info(bool iBackgroundIsBlack)
bool storeTrack() const
TrackInformation * getOrCreateTrackInformation(const G4Track *)
Definition: Bcm1fSD.cc:278
float energyHistoryCut
Definition: Bcm1fSD.h:68
virtual bool newHit(G4Step *)
Definition: Bcm1fSD.cc:187
float energyCut
Definition: Bcm1fSD.h:67
virtual void sendHit()
Definition: Bcm1fSD.cc:155
virtual void updateHit(G4Step *)
Definition: Bcm1fSD.cc:170
unsigned int lastTrack
Definition: Bcm1fSD.h:74
virtual void createHit(G4Step *)
Definition: Bcm1fSD.cc:213
void Bcm1fSD::sendHit ( )
privatevirtual

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

155  {
156  if (mySimHit == nullptr) return;
157  LogDebug("Bcm1fSD") << " Storing PSimHit: " << pname << " " << mySimHit->detUnitId()
158  << " " << mySimHit->trackId() << " " << mySimHit->energyLoss()
159  << " " << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
160 
162 
163  // clean up
164  delete mySimHit;
165  mySimHit = nullptr;
166  lastTrack = 0;
167  lastId = 0;
168 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
uint32_t lastId
Definition: Bcm1fSD.h:73
TrackingSlaveSD * slave
Definition: Bcm1fSD.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: Bcm1fSD.h:74
virtual bool processHits(const PSimHit &)
std::string pname
Definition: Bcm1fSD.h:76
Local3DPoint entryPoint() const
Entry point in the local Det frame.
Definition: PSimHit.h:35
unsigned int detUnitId() const
Definition: PSimHit.h:93
uint32_t Bcm1fSD::setDetUnitId ( const G4Step *  aStep)
overridevirtual

Implements SensitiveDetector.

Definition at line 91 of file Bcm1fSD.cc.

References gather_cfg::cout, hcalDigis_cfi::level, and LogDebug.

Referenced by createHit(), and newHit().

91  {
92 
93  unsigned int detId = 0;
94 
95  LogDebug("Bcm1fSD")<< " DetID = "<<detId;
96 
97  //Find number of levels
98  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
99  int level = 0;
100  if (touch) level = ((touch->GetHistoryDepth())+1);
101 
102  //Get name and copy numbers
103  if ( level > 1 ) {
104 
105  G4String sensorName = touch->GetVolume(0)->GetName();
106  G4String diamondName = touch->GetVolume(1)->GetName();
107  G4String detectorName = touch->GetVolume(2)->GetName();
108  G4String volumeName = touch->GetVolume(3)->GetName();
109 
110  if ( sensorName != "BCM1FSensor" )
111  std::cout << " Bcm1fSD::setDetUnitId -w- Sensor name not BCM1FSensor " << std::endl;
112  if ( detectorName != "BCM1F" )
113  std::cout << " Bcm1fSD::setDetUnitId -w- Detector name not BCM1F " << std::endl;
114 
115  int sensorNo = touch->GetReplicaNumber(0);
116  int diamondNo = touch->GetReplicaNumber(1);
117 // int detectorNo = touch->GetReplicaNumber(2);
118  int volumeNo = touch->GetReplicaNumber(3);
119 
120  // Detector ID definition
121  // detId = XYYZ
122  // X = volume, 1: +Z, 2: -Z
123  // YY = diamond, 01-12, 12: phi = 90 deg, numbering clockwise when looking from the IP
124  // Z = sensor, 1 or 2, clockwise when looking from the IP
125 
126 // detId = 10*volumeNo + diamondNo;
127  detId = 1000*volumeNo + 10*diamondNo + sensorNo;
128 
129 // for ( int ii = 0; ii < level; ii++ ) {
130 // int i = level - ii - 1;
131 // G4String name = touch->GetVolume(i)->GetName();
132 // int copyno = touch->GetReplicaNumber(i);
133 // const G4ThreeVector trans = touch->GetVolume(i)->GetTranslation();
134 // std::cout << " detId = " << detId << " name = " << name << " " << copyno
135 // << ", translation x, y, z = " << trans.x() << ", " <<trans.y() << ", " <<trans.z()
136 // << ", eta = " << trans.eta() << std::endl;
137 // }
138  }
139 
140  return detId;
141 }
#define LogDebug(id)
void Bcm1fSD::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

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

261  {
262 
263  clearHits();
264  eventno = (*i)()->GetEventID();
265  mySimHit = nullptr;
266 }
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
void clearHits() override
Definition: Bcm1fSD.cc:274
int eventno
Definition: Bcm1fSD.h:75
void Bcm1fSD::update ( const BeginOfTrack )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

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

268  {
269 
270  const G4Track* gTrack = (*bot)();
271  pname = gTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
272 }
std::string pname
Definition: Bcm1fSD.h:76
void Bcm1fSD::update ( const BeginOfJob )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

259 { }
void Bcm1fSD::updateHit ( G4Step *  aStep)
privatevirtual

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

170  {
171 
173  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
174  mySimHit->setExitPoint(theExitPoint);
175  LogDebug("Bcm1fSD")<< " Before : " << mySimHit->energyLoss();
176  mySimHit->addEnergyLoss(theEnergyLoss);
178 
179  LogDebug("Bcm1fSD") << " Updating: new exitpoint " << pname << " "
180  << theExitPoint << " new energy loss " << theEnergyLoss
181  << "\n Updated PSimHit: " << mySimHit->detUnitId()
182  << " " << mySimHit->trackId()
183  << " " << mySimHit->energyLoss() << " "
184  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
185 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:66
Local3DPoint globalExitPoint
Definition: Bcm1fSD.h:71
const double GeV
Definition: MathUtil.h:16
void setExitPoint(const Local3DPoint &exit)
Local3DPoint exitPoint() const
Exit point in the local Det frame.
Definition: PSimHit.h:38
Local3DPoint FinalStepPosition(const G4Step *step, coordinates) const
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: Bcm1fSD.h:76
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 Bcm1fSD::energyCut
private

Definition at line 67 of file Bcm1fSD.h.

Referenced by Bcm1fSD(), and ProcessHits().

float Bcm1fSD::energyHistoryCut
private

Definition at line 68 of file Bcm1fSD.h.

Referenced by Bcm1fSD(), and ProcessHits().

int Bcm1fSD::eventno
private

Definition at line 75 of file Bcm1fSD.h.

Referenced by update().

Local3DPoint Bcm1fSD::globalEntryPoint
private

Definition at line 70 of file Bcm1fSD.h.

Referenced by createHit().

Local3DPoint Bcm1fSD::globalExitPoint
private

Definition at line 71 of file Bcm1fSD.h.

Referenced by createHit(), and updateHit().

uint32_t Bcm1fSD::lastId
private

Definition at line 73 of file Bcm1fSD.h.

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

unsigned int Bcm1fSD::lastTrack
private

Definition at line 74 of file Bcm1fSD.h.

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

G4TrackToParticleID* Bcm1fSD::myG4TrackToParticleID
private

Definition at line 65 of file Bcm1fSD.h.

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

UpdatablePSimHit* Bcm1fSD::mySimHit
private

Definition at line 66 of file Bcm1fSD.h.

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

G4VPhysicalVolume* Bcm1fSD::oldVolume
private

Definition at line 72 of file Bcm1fSD.h.

Referenced by createHit().

std::string Bcm1fSD::pname
private

Definition at line 76 of file Bcm1fSD.h.

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

TrackingSlaveSD* Bcm1fSD::slave
private

Definition at line 63 of file Bcm1fSD.h.

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

G4ProcessTypeEnumerator* Bcm1fSD::theG4ProcessTypeEnumerator
private

Definition at line 64 of file Bcm1fSD.h.

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