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
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 (std::string, const DDCompactView &, SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
virtual void EndOfEvent (G4HCofThisEvent *)
 
void fillHits (edm::PSimHitContainer &, std::string use)
 
virtual bool ProcessHits (G4Step *, G4TouchableHistory *)
 
virtual uint32_t setDetUnitId (G4Step *)
 
virtual ~Bcm1fSD ()
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (std::string &iname, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
 
- Public Member Functions inherited from SensitiveDetector
virtual void AssignSD (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, 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 Bcm1fSD.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file Bcm1fSD.cc.

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

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

Definition at line 64 of file Bcm1fSD.cc.

References myG4TrackToParticleID, slave, and theG4ProcessTypeEnumerator.

64  {
65  delete slave;
67  delete myG4TrackToParticleID;
68 }
G4TrackToParticleID * myG4TrackToParticleID
Definition: Bcm1fSD.h:65
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: Bcm1fSD.h:64
TrackingSlaveSD * slave
Definition: Bcm1fSD.h:63

Member Function Documentation

void Bcm1fSD::clearHits ( )
privatevirtual

Implements SensitiveDetector.

Definition at line 284 of file Bcm1fSD.cc.

References TrackingSlaveSD::Initialize(), and slave.

Referenced by update().

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

Definition at line 211 of file Bcm1fSD.cc.

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

Referenced by newHit().

211  {
212 
213  if (mySimHit == 0) return false;
214  const float tolerance = 0.05 * mm; // 50 micron are allowed between the exit
215  // point of the current hit and the entry point of the new hit
217  LogDebug("Bcm1fSD")<< " closeHit: distance = " << (mySimHit->exitPoint()-theEntryPoint).mag();
218 
219  if ((mySimHit->exitPoint()-theEntryPoint).mag()<tolerance) return true;
220  return false;
221 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.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 Bcm1fSD::createHit ( G4Step *  aStep)
privatevirtual

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

223  {
224 
225  if (mySimHit != 0) {
226  delete mySimHit;
227  mySimHit=0;
228  }
229 
230  G4Track * theTrack = aStep->GetTrack();
231  G4VPhysicalVolume * v = aStep->GetPreStepPoint()->GetPhysicalVolume();
232 
235 
236  float thePabs = aStep->GetPreStepPoint()->GetMomentum().mag()/GeV;
237  float theTof = aStep->GetPreStepPoint()->GetGlobalTime()/nanosecond;
238  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
239  int theParticleType = myG4TrackToParticleID->particleID(theTrack);
240  uint32_t theDetUnitId = setDetUnitId(aStep);
241 
244  pname = theTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
245 
246  unsigned int theTrackID = theTrack->GetTrackID();
247 
248  G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
249  // convert it to local frame
250  G4ThreeVector lmd = ((G4TouchableHistory *)(aStep->GetPreStepPoint()->GetTouchable()))->GetHistory()->GetTopTransform().TransformAxis(gmd);
252  float theThetaAtEntry = lnmd.theta();
253  float thePhiAtEntry = lnmd.phi();
254 
255  mySimHit = new UpdatablePSimHit(theEntryPoint,theExitPoint,thePabs,theTof,
256  theEnergyLoss,theParticleType,theDetUnitId,
257  theTrackID,theThetaAtEntry,thePhiAtEntry,
258  theG4ProcessTypeEnumerator->processId(theTrack->GetCreatorProcess()));
259 
260  LogDebug("Bcm1fSD") << " Created PSimHit: " << pname << " "
261  << mySimHit->detUnitId() << " " << mySimHit->trackId()
262  << " " << mySimHit->energyLoss() << " "
263  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
264  lastId = theDetUnitId;
265  lastTrack = theTrackID;
266  oldVolume = v;
267 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
Local3DPoint globalExitPoint
Definition: Bcm1fSD.h:72
const double GeV
Definition: MathUtil.h:16
G4TrackToParticleID * myG4TrackToParticleID
Definition: Bcm1fSD.h:65
uint32_t lastId
Definition: Bcm1fSD.h:74
G4VPhysicalVolume * oldVolume
Definition: Bcm1fSD.h:73
G4ProcessTypeEnumerator * theG4ProcessTypeEnumerator
Definition: Bcm1fSD.h:64
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Local3DPoint globalEntryPoint
Definition: Bcm1fSD.h:71
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)
virtual uint32_t setDetUnitId(G4Step *)
Definition: Bcm1fSD.cc:101
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:75
std::string pname
Definition: Bcm1fSD.h:77
Local3DPoint FinalStepPosition(G4Step *s, coordinates)
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
void Bcm1fSD::EndOfEvent ( G4HCofThisEvent *  )
virtual

Reimplemented from SensitiveDetector.

Definition at line 153 of file Bcm1fSD.cc.

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

153  {
154 
155  LogDebug("Bcm1fSD")<< " Saving the last hit in a ROU " << myName;
156 
157  if (mySimHit == 0) return;
158  sendHit();
159 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
std::string myName
Definition: Bcm1fSD.h:66
virtual void sendHit()
Definition: Bcm1fSD.cc:165
void Bcm1fSD::fillHits ( edm::PSimHitContainer c,
std::string  use 
)
virtual

Implements SensitiveTkDetector.

Definition at line 161 of file Bcm1fSD.cc.

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

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

Definition at line 288 of file Bcm1fSD.cc.

References info(), and groupFilesInBlocks::temp.

Referenced by ProcessHits().

288  {
289  G4VUserTrackInformation* temp = gTrack->GetUserInformation();
290  if (temp == 0){
291  edm::LogError("Bcm1fSD") <<" ERROR: no G4VUserTrackInformation available";
292  abort();
293  }else{
294  TrackInformation* info = dynamic_cast<TrackInformation*>(temp);
295  if (info == 0){
296  edm::LogError("Bcm1fSD") <<" ERROR: TkSimTrackSelection: the UserInformation does not appear to be a TrackInformation";
297  abort();
298  }
299  return info;
300  }
301 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool Bcm1fSD::newHit ( G4Step *  aStep)
privatevirtual

Definition at line 197 of file Bcm1fSD.cc.

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

Referenced by ProcessHits().

197  {
198 
199  G4Track * theTrack = aStep->GetTrack();
200  uint32_t theDetUnitId = setDetUnitId(aStep);
201  unsigned int theTrackID = theTrack->GetTrackID();
202 
203  LogDebug("Bcm1fSD") << " OLD (d,t) = (" << lastId << "," << lastTrack
204  << "), new = (" << theDetUnitId << "," << theTrackID << ") return "
205  << ((theTrackID == lastTrack) && (lastId == theDetUnitId));
206  if ((mySimHit != 0) && (theTrackID == lastTrack) && (lastId == theDetUnitId) && closeHit(aStep))
207  return false;
208  return true;
209 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
uint32_t lastId
Definition: Bcm1fSD.h:74
virtual bool closeHit(G4Step *)
Definition: Bcm1fSD.cc:211
virtual uint32_t setDetUnitId(G4Step *)
Definition: Bcm1fSD.cc:101
unsigned int lastTrack
Definition: Bcm1fSD.h:75
bool Bcm1fSD::ProcessHits ( G4Step *  aStep,
G4TouchableHistory *   
)
virtual

Implements SensitiveDetector.

Definition at line 70 of file Bcm1fSD.cc.

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

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

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

165  {
166  if (mySimHit == 0) return;
167  LogDebug("Bcm1fSD") << " Storing PSimHit: " << pname << " " << mySimHit->detUnitId()
168  << " " << mySimHit->trackId() << " " << mySimHit->energyLoss()
169  << " " << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
170 
172 
173  // clean up
174  delete mySimHit;
175  mySimHit = 0;
176  lastTrack = 0;
177  lastId = 0;
178 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
uint32_t lastId
Definition: Bcm1fSD.h:74
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:75
virtual bool processHits(const PSimHit &)
std::string pname
Definition: Bcm1fSD.h:77
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 ( G4Step *  aStep)
virtual

Implements SensitiveDetector.

Definition at line 101 of file Bcm1fSD.cc.

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

Referenced by createHit(), and newHit().

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

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 271 of file Bcm1fSD.cc.

References clearHits(), eventno, and mySimHit.

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

271  {
272 
273  clearHits();
274  eventno = (*i)()->GetEventID();
275  mySimHit = 0;
276 }
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
int eventno
Definition: Bcm1fSD.h:76
virtual void clearHits()
Definition: Bcm1fSD.cc:284
void Bcm1fSD::update ( const BeginOfTrack )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfTrack * >.

Definition at line 278 of file Bcm1fSD.cc.

References pname.

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

278  {
279 
280  const G4Track* gTrack = (*bot)();
281  pname = gTrack->GetDynamicParticle()->GetDefinition()->GetParticleName();
282 }
std::string pname
Definition: Bcm1fSD.h:77
void Bcm1fSD::update ( const BeginOfJob )
privatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfJob * >.

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

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

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

180  {
181 
183  float theEnergyLoss = aStep->GetTotalEnergyDeposit()/GeV;
184  mySimHit->setExitPoint(theExitPoint);
185  LogDebug("Bcm1fSD")<< " Before : " << mySimHit->energyLoss();
186  mySimHit->addEnergyLoss(theEnergyLoss);
188 
189  LogDebug("Bcm1fSD") << " Updating: new exitpoint " << pname << " "
190  << theExitPoint << " new energy loss " << theEnergyLoss
191  << "\n Updated PSimHit: " << mySimHit->detUnitId()
192  << " " << mySimHit->trackId()
193  << " " << mySimHit->energyLoss() << " "
194  << mySimHit->entryPoint() << " " << mySimHit->exitPoint();
195 }
#define LogDebug(id)
UpdatablePSimHit * mySimHit
Definition: Bcm1fSD.h:67
Local3DPoint globalExitPoint
Definition: Bcm1fSD.h:72
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
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: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 Bcm1fSD::energyCut
private

Definition at line 68 of file Bcm1fSD.h.

Referenced by Bcm1fSD(), and ProcessHits().

float Bcm1fSD::energyHistoryCut
private

Definition at line 69 of file Bcm1fSD.h.

Referenced by Bcm1fSD(), and ProcessHits().

int Bcm1fSD::eventno
private

Definition at line 76 of file Bcm1fSD.h.

Referenced by update().

Local3DPoint Bcm1fSD::globalEntryPoint
private

Definition at line 71 of file Bcm1fSD.h.

Referenced by createHit().

Local3DPoint Bcm1fSD::globalExitPoint
private

Definition at line 72 of file Bcm1fSD.h.

Referenced by createHit(), and updateHit().

uint32_t Bcm1fSD::lastId
private

Definition at line 74 of file Bcm1fSD.h.

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

unsigned int Bcm1fSD::lastTrack
private

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

std::string Bcm1fSD::myName
private

Definition at line 66 of file Bcm1fSD.h.

Referenced by EndOfEvent().

UpdatablePSimHit* Bcm1fSD::mySimHit
private

Definition at line 67 of file Bcm1fSD.h.

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

G4VPhysicalVolume* Bcm1fSD::oldVolume
private

Definition at line 73 of file Bcm1fSD.h.

Referenced by createHit().

std::string Bcm1fSD::pname
private

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