CMS 3D CMS Logo

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

#include <TotemRPSD.h>

Inheritance diagram for TotemRPSD:
SensitiveTkDetector Observer< const BeginOfEvent * > Observer< const EndOfEvent * > SensitiveDetector

Public Member Functions

void clear () override
 
void DrawAll () override
 
void EndOfEvent (G4HCofThisEvent *eventHC) override
 
void fillHits (edm::PSimHitContainer &, const std::string &) override
 
void Initialize (G4HCofThisEvent *HCE) override
 
void PrintAll () override
 
void printHitInfo ()
 
 TotemRPSD (const std::string &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *)
 
 ~TotemRPSD () override
 
- Public Member Functions inherited from SensitiveTkDetector
 SensitiveTkDetector (const std::string &iname, const edm::EventSetup &es, 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
 
bool isCaloSD () const
 
 SensitiveDetector (const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &, edm::ParameterSet const &p, bool calo)
 
 ~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 EndOfEvent * >
 Observer ()
 
void slotForUpdate (const EndOfEvent * iT)
 
virtual ~Observer ()
 

Static Public Attributes

static double rp_garage_position_ = 40.0
 

Private Member Functions

void clearHits () override
 
void createNewHit ()
 
G4bool hitExists ()
 
bool isPrimary (const G4Track *track)
 
bool ProcessHits (G4Step *step, G4TouchableHistory *tHistory) override
 
void resetForNewPrimary ()
 
uint32_t setDetUnitId (const G4Step *step) override
 
void setNumberingScheme (TotemRPVDetectorOrganization *scheme)
 
G4ThreeVector setToLocal (const G4ThreeVector &globalPoint)
 
void stepInfo (const G4Step *aStep)
 
void storeHit (TotemRPG4Hit *)
 
void summarize ()
 
void update (const BeginOfEvent *) override
 This routine will be called when the appropriate signal arrives. More...
 
void update (const ::EndOfEvent *) override
 
void updateHit ()
 

Private Attributes

TotemRPG4HitcurrentHit_
 
G4VPhysicalVolume * currentPV_
 
double Eloss_
 
G4ThreeVector entrancePoint_
 
int eventno_
 
G4ThreeVector exitPoint_
 
G4int hcID_
 
G4ThreeVector hitPoint_
 
double incidentEnergy_
 
G4String name_
 
std::unique_ptr< TotemRPVDetectorOrganizationnumberingScheme_
 
double Pabs_
 
int ParentId_
 
short ParticleType_
 
double PhiAtEntry_
 
G4StepPoint * postStepPoint_
 
G4StepPoint * preStepPoint_
 
G4int primaryID_
 
std::unique_ptr< TrackingSlaveSDslave_
 
TotemRPG4HitCollectiontheHC_
 
G4ThreeVector theLocalEntryPoint_
 
G4ThreeVector theLocalExitPoint_
 
double thePx_
 
double thePy_
 
double thePz_
 
double ThetaAtEntry_
 
G4Track * theTrack_
 
double Tof_
 
G4double tSlice_
 
G4int tSliceID_
 
unsigned int unitID_
 
int verbosity_
 
double Vx_
 
double Vy_
 
double Vz_
 

Static Private Attributes

static unsigned int maxTotemHits_ = 15000
 

Additional Inherited Members

- Protected Types inherited from SensitiveDetector
enum  coordinates { WorldCoordinates, LocalCoordinates }
 
- Protected Member Functions inherited from SensitiveDetector
TrackInformationcmsTrackInformation (const G4Track *aTrack)
 
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 > &)
 
- Protected Member Functions inherited from Observer< const EndOfEvent * >
virtual void update (const EndOfEvent *)=0
 This routine will be called when the appropriate signal arrives. More...
 

Detailed Description

Definition at line 27 of file TotemRPSD.h.

Constructor & Destructor Documentation

TotemRPSD::TotemRPSD ( const std::string &  name_,
const edm::EventSetup es,
const SensitiveDetectorCatalog clg,
edm::ParameterSet const &  p,
const SimTrackManager manager 
)

Definition at line 33 of file TotemRPSD.cc.

References bysipixelclustmulteventfilter_cfi::collectionName, edm::ParameterSet::getParameter(), name_, numberingScheme_, slave_, and verbosity_.

38  : SensitiveTkDetector(name_, es, clg, p),
39  numberingScheme_(nullptr),
40  hcID_(-1),
41  theHC_(nullptr),
42  currentHit_(nullptr),
43  theTrack_(nullptr),
44  currentPV_(nullptr),
45  unitID_(0),
46  preStepPoint_(nullptr),
47  postStepPoint_(nullptr),
48  eventno_(0) {
49  collectionName.insert(name_);
50 
51  edm::ParameterSet m_Anal = p.getParameter<edm::ParameterSet>("TotemRPSD");
52  verbosity_ = m_Anal.getParameter<int>("Verbosity");
53 
54  slave_ = std::make_unique<TrackingSlaveSD>(name_);
55 
56  if (name_ == "TotemHitsRP") {
57  numberingScheme_ = std::make_unique<PPSStripNumberingScheme>(3);
58  } else {
59  edm::LogWarning("TotemRP") << "TotemRPSD: ReadoutName not supported\n";
60  }
61 
62  edm::LogInfo("TotemRP") << "TotemRPSD: Instantiation completed";
63 }
T getParameter(std::string const &) const
G4Track * theTrack_
Definition: TotemRPSD.h:87
SensitiveTkDetector(const std::string &iname, const edm::EventSetup &es, const SensitiveDetectorCatalog &clg, edm::ParameterSet const &p)
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:88
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:58
int eventno_
Definition: TotemRPSD.h:114
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:94
int verbosity_
Definition: TotemRPSD.h:61
unsigned int unitID_
Definition: TotemRPSD.h:89
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
G4int hcID_
Definition: TotemRPSD.h:83
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:86
G4String name_
Definition: TotemRPSD.h:82
TotemRPSD::~TotemRPSD ( )
override

Definition at line 65 of file TotemRPSD.cc.

65 {}

Member Function Documentation

void TotemRPSD::clear ( void  )
override

Definition at line 260 of file TotemRPSD.cc.

260 {}
void TotemRPSD::clearHits ( )
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 287 of file TotemRPSD.cc.

References slave_.

Referenced by update().

287 { slave_->Initialize(); }
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
void TotemRPSD::createNewHit ( )
private

Definition at line 190 of file TotemRPSD.cc.

References currentHit_, Eloss_, exitPoint_, hitPoint_, incidentEnergy_, Pabs_, ParentId_, ParticleType_, PhiAtEntry_, primaryID_, rp_garage_position_, TotemRPG4Hit::setEnergyLoss(), TotemRPG4Hit::setEntry(), TotemRPG4Hit::setExit(), TotemRPG4Hit::setIncidentEnergy(), TotemRPG4Hit::setLocalEntry(), TotemRPG4Hit::setLocalExit(), TotemRPG4Hit::setP(), TotemRPG4Hit::setParentId(), TotemRPG4Hit::setParticleType(), TotemRPG4Hit::setPhiAtEntry(), TotemRPG4Hit::setPx(), TotemRPG4Hit::setPy(), TotemRPG4Hit::setPz(), TotemRPG4Hit::setThetaAtEntry(), TotemRPG4Hit::setTimeSlice(), TotemRPG4Hit::setTof(), TotemRPG4Hit::setTrackID(), TotemRPG4Hit::setUnitID(), TotemRPG4Hit::setVx(), TotemRPG4Hit::setVy(), TotemRPG4Hit::setVz(), storeHit(), theLocalEntryPoint_, theLocalExitPoint_, thePx_, thePy_, thePz_, ThetaAtEntry_, Tof_, tSlice_, unitID_, Vx_, Vy_, and Vz_.

Referenced by ProcessHits().

190  {
191  // Protect against creating hits in detectors not inserted
192  double outrangeX = hitPoint_.x();
193  double outrangeY = hitPoint_.y();
194  if (fabs(outrangeX) > rp_garage_position_)
195  return;
196  if (fabs(outrangeY) > rp_garage_position_)
197  return;
198  // end protection
199 
205 
212 
217 
222 
226 
228 }
void setEntry(G4ThreeVector xyz)
Definition: TotemRPG4Hit.cc:76
void setTof(double e)
void setP(double e)
double Tof_
Definition: TotemRPSD.h:102
void setIncidentEnergy(double e)
Definition: TotemRPG4Hit.cc:87
void storeHit(TotemRPG4Hit *)
Definition: TotemRPSD.cc:181
void setVx(double p)
void setPy(double p)
double Pabs_
Definition: TotemRPSD.h:100
G4double tSlice_
Definition: TotemRPSD.h:91
void setLocalEntry(const G4ThreeVector &theLocalEntryPoint)
Definition: TotemRPG4Hit.cc:82
void setExit(G4ThreeVector xyz)
Definition: TotemRPG4Hit.cc:79
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:97
int ParentId_
Definition: TotemRPSD.h:109
short ParticleType_
Definition: TotemRPSD.h:104
unsigned int unitID_
Definition: TotemRPSD.h:89
G4int primaryID_
Definition: TotemRPSD.h:90
void setLocalExit(const G4ThreeVector &theLocalExitPoint)
Definition: TotemRPG4Hit.cc:84
void setThetaAtEntry(double t)
void setUnitID(unsigned int i)
Definition: TotemRPG4Hit.cc:93
static double rp_garage_position_
Definition: TotemRPSD.h:45
double PhiAtEntry_
Definition: TotemRPSD.h:107
double Vy_
Definition: TotemRPSD.h:110
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:98
double ThetaAtEntry_
Definition: TotemRPSD.h:106
double Vz_
Definition: TotemRPSD.h:110
void setPhiAtEntry(double f)
double thePz_
Definition: TotemRPSD.h:101
void setVz(double p)
double thePx_
Definition: TotemRPSD.h:101
double incidentEnergy_
Definition: TotemRPSD.h:80
void setParentId(int p)
void setTrackID(int i)
Definition: TotemRPG4Hit.cc:90
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:96
void setPz(double p)
void setParticleType(short i)
double Eloss_
Definition: TotemRPSD.h:103
void setEnergyLoss(double e)
void setVy(double p)
double thePy_
Definition: TotemRPSD.h:101
void setPx(double p)
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:95
TotemRPG4Hit * currentHit_
Definition: TotemRPSD.h:86
double Vx_
Definition: TotemRPSD.h:110
void setTimeSlice(double d)
Definition: TotemRPG4Hit.cc:96
void TotemRPSD::DrawAll ( )
override

Definition at line 262 of file TotemRPSD.cc.

262 {}
void TotemRPSD::EndOfEvent ( G4HCofThisEvent *  eventHC)
override

Definition at line 237 of file TotemRPSD.cc.

References TotemRPG4Hit::energyLoss(), mps_splice::entry, beamvalidation::exit(), createfilelist::int, dqmiolumiharvest::j, TotemRPG4Hit::localEntry(), TotemRPG4Hit::localExit(), maxTotemHits_, TotemRPG4Hit::p(), TotemRPG4Hit::particleType(), TotemRPG4Hit::phiAtEntry(), slave_, summarize(), theHC_, TotemRPG4Hit::thetaAtEntry(), TotemRPG4Hit::tof(), TotemRPG4Hit::trackID(), and TotemRPG4Hit::unitID().

237  {
238  // here we loop over transient hits and make them persistent
239  for (unsigned int j = 0; j < (unsigned int)theHC_->entries() && j < maxTotemHits_; j++) {
240  TotemRPG4Hit* aHit = (*theHC_)[j];
241 
242  Local3DPoint entry(aHit->localEntry().x(), aHit->localEntry().y(), aHit->localEntry().z());
243  Local3DPoint exit(aHit->localExit().x(), aHit->localExit().y(), aHit->localExit().z());
244  slave_->processHits(PSimHit(entry,
245  exit,
246  aHit->p(),
247  aHit->tof(),
248  aHit->energyLoss(),
249  aHit->particleType(),
250  aHit->unitID(),
251  aHit->trackID(),
252  aHit->thetaAtEntry(),
253  aHit->phiAtEntry()));
254  }
255  summarize();
256 }
G4ThreeVector localEntry() const
Definition: TotemRPG4Hit.cc:81
unsigned int trackID() const
Definition: TotemRPG4Hit.cc:89
int particleType() const
int unitID() const
Definition: TotemRPG4Hit.cc:92
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
double p() const
Definition: TotemRPG4Hit.cc:99
double phiAtEntry() const
static unsigned int maxTotemHits_
Definition: TotemRPSD.h:48
double energyLoss() const
double thetaAtEntry() const
G4ThreeVector localExit() const
Definition: TotemRPG4Hit.cc:83
double tof() const
void summarize()
Definition: TotemRPSD.cc:258
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
def exit(msg="")
void TotemRPSD::fillHits ( edm::PSimHitContainer c,
const std::string &  n 
)
overridevirtual

Implements SensitiveTkDetector.

Definition at line 269 of file TotemRPSD.cc.

References dqmiodumpmetadata::n, and slave_.

269  {
270  if (slave_->name() == n) {
271  c = slave_->hits();
272  }
273 }
std::unique_ptr< TrackingSlaveSD > slave_
Definition: TotemRPSD.h:57
G4bool TotemRPSD::hitExists ( )
private
void TotemRPSD::Initialize ( G4HCofThisEvent *  HCE)
override

Definition at line 67 of file TotemRPSD.cc.

References bysipixelclustmulteventfilter_cfi::collectionName, hcID_, LogDebug, name_, and theHC_.

67  {
68  LogDebug("TotemRP") << "TotemRPSD : Initialize called for " << name_;
69 
70  theHC_ = new TotemRPG4HitCollection(GetName(), collectionName[0]);
71  G4SDManager::GetSDMpointer()->AddNewCollection(name_, collectionName[0]);
72 
73  if (hcID_ < 0)
74  hcID_ = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
75  HCE->AddHitsCollection(hcID_, theHC_);
76 }
#define LogDebug(id)
G4THitsCollection< TotemRPG4Hit > TotemRPG4HitCollection
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
G4int hcID_
Definition: TotemRPSD.h:83
G4String name_
Definition: TotemRPSD.h:82
bool TotemRPSD::isPrimary ( const G4Track *  track)
private

Definition at line 289 of file TotemRPSD.cc.

References info(), and TrackInformation::isPrimary().

Referenced by stepInfo().

289  {
290  TrackInformation* info = dynamic_cast<TrackInformation*>(track->GetUserInformation());
291  return info && info->isPrimary();
292 }
static const TGPicture * info(bool iBackgroundIsBlack)
bool isPrimary() const
void TotemRPSD::PrintAll ( )
override

Definition at line 264 of file TotemRPSD.cc.

References LogDebug, and theHC_.

264  {
265  LogDebug("TotemRP") << "TotemRPSD: Collection " << theHC_->GetName() << std::endl;
266  theHC_->PrintAllHits();
267 }
#define LogDebug(id)
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
void TotemRPSD::printHitInfo ( )

Definition at line 78 of file TotemRPSD.cc.

References currentPV_, Eloss_, LogDebug, postStepPoint_, preStepPoint_, primaryID_, theTrack_, tSliceID_, and unitID_.

78  {
79  LogDebug("TotemRP") << theTrack_->GetDefinition()->GetParticleName() << " TotemRPSD CreateNewHit for"
80  << " PV " << currentPV_->GetName() << " PVid = " << currentPV_->GetCopyNo() << " Unit "
81  << unitID_;
82  LogDebug("TotemRP") << " primary " << primaryID_ << " time slice " << tSliceID_ << " of energy "
83  << theTrack_->GetTotalEnergy() << " Eloss_ " << Eloss_ << " positions ";
84  printf("(%10f,%10f,%10f)",
85  preStepPoint_->GetPosition().x(),
86  preStepPoint_->GetPosition().y(),
87  preStepPoint_->GetPosition().z());
88  printf("(%10f,%10f,%10f)",
89  postStepPoint_->GetPosition().x(),
90  postStepPoint_->GetPosition().y(),
91  postStepPoint_->GetPosition().z());
92  LogDebug("TotemRP") << " positions "
93  << "(" << postStepPoint_->GetPosition().x() << "," << postStepPoint_->GetPosition().y() << ","
94  << postStepPoint_->GetPosition().z() << ")"
95  << " For Track " << theTrack_->GetTrackID() << " which is a "
96  << theTrack_->GetDefinition()->GetParticleName();
97 
98  if (theTrack_->GetTrackID() == 1) {
99  LogDebug("TotemRP") << " primary particle ";
100  } else {
101  LogDebug("TotemRP") << " daughter of part. " << theTrack_->GetParentID();
102  }
103 
104  LogDebug("TotemRP") << " and created by ";
105 
106  if (theTrack_->GetCreatorProcess() != nullptr)
107  LogDebug("TotemRP") << theTrack_->GetCreatorProcess()->GetProcessName();
108  else
109  LogDebug("TotemRP") << "NO process";
110 
111  LogDebug("TotemRP") << std::endl;
112 }
#define LogDebug(id)
G4Track * theTrack_
Definition: TotemRPSD.h:87
G4int tSliceID_
Definition: TotemRPSD.h:90
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:88
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:94
unsigned int unitID_
Definition: TotemRPSD.h:89
G4int primaryID_
Definition: TotemRPSD.h:90
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
double Eloss_
Definition: TotemRPSD.h:103
bool TotemRPSD::ProcessHits ( G4Step *  step,
G4TouchableHistory *  tHistory 
)
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 114 of file TotemRPSD.cc.

References createNewHit(), and stepInfo().

114  {
115  if (aStep == nullptr) {
116  return true;
117  } else {
118  stepInfo(aStep);
119 
120  createNewHit();
121  return true;
122  }
123 }
void createNewHit()
Definition: TotemRPSD.cc:190
void stepInfo(const G4Step *aStep)
Definition: TotemRPSD.cc:125
void TotemRPSD::resetForNewPrimary ( )
private
uint32_t TotemRPSD::setDetUnitId ( const G4Step *  step)
overrideprivatevirtual

Implements SensitiveDetector.

Definition at line 177 of file TotemRPSD.cc.

References numberingScheme_.

Referenced by stepInfo().

177  {
178  return (numberingScheme_ == nullptr ? 0 : numberingScheme_->unitID(aStep));
179 }
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:58
void TotemRPSD::setNumberingScheme ( TotemRPVDetectorOrganization scheme)
private

Definition at line 274 of file TotemRPSD.cc.

References LogDebug, and numberingScheme_.

274  {
275  if (scheme) {
276  LogDebug("TotemRP") << "TotemRPSD: updates numbering scheme for " << GetName();
277  numberingScheme_.reset(scheme);
278  }
279 }
#define LogDebug(id)
std::unique_ptr< TotemRPVDetectorOrganization > numberingScheme_
Definition: TotemRPSD.h:58
G4ThreeVector TotemRPSD::setToLocal ( const G4ThreeVector &  globalPoint)
private

Definition at line 230 of file TotemRPSD.cc.

References preStepPoint_.

Referenced by stepInfo().

230  {
231  G4ThreeVector localPoint;
232  const G4VTouchable* touch = preStepPoint_->GetTouchable();
233  localPoint = touch->GetHistory()->GetTopTransform().TransformPoint(global);
234  return localPoint;
235 }
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
void TotemRPSD::stepInfo ( const G4Step *  aStep)
private

Definition at line 125 of file TotemRPSD.cc.

References SensitiveDetector::ConvertToLocal3DPoint(), currentPV_, Eloss_, exitPoint_, GeV, hitPoint_, createfilelist::int, isPrimary(), LogDebug, name_, Pabs_, ParentId_, PbPb_ZMuSkimMuonDPG_cff::particleType, ParticleType_, PV3DBase< T, PVType, FrameType >::phi(), PhiAtEntry_, postStepPoint_, preStepPoint_, primaryID_, setDetUnitId(), setToLocal(), theLocalEntryPoint_, theLocalExitPoint_, thePx_, thePy_, thePz_, PV3DBase< T, PVType, FrameType >::theta(), ThetaAtEntry_, theTrack_, Tof_, tSlice_, tSliceID_, unitID_, verbosity_, Vx_, Vy_, and Vz_.

Referenced by ProcessHits().

125  {
126  preStepPoint_ = aStep->GetPreStepPoint();
127  postStepPoint_ = aStep->GetPostStepPoint();
128  theTrack_ = aStep->GetTrack();
129  hitPoint_ = preStepPoint_->GetPosition();
130  exitPoint_ = postStepPoint_->GetPosition();
131  currentPV_ = preStepPoint_->GetPhysicalVolume();
134 
135  G4String name_ = currentPV_->GetName();
136  name_.assign(name_, 0, 4);
137  G4String particleType = theTrack_->GetDefinition()->GetParticleName();
138  tSlice_ = (postStepPoint_->GetGlobalTime()) / nanosecond;
139  tSliceID_ = (int)tSlice_;
140  unitID_ = setDetUnitId(aStep);
141 
142  if (verbosity_)
143  LogDebug("TotemRP") << "UNIT " << unitID_ << std::endl;
144 
145  primaryID_ = theTrack_->GetTrackID();
146 
147  Pabs_ = (aStep->GetPreStepPoint()->GetMomentum().mag()) / GeV;
148  thePx_ = (aStep->GetPreStepPoint()->GetMomentum().x()) / GeV;
149  thePy_ = (aStep->GetPreStepPoint()->GetMomentum().y()) / GeV;
150  thePz_ = (aStep->GetPreStepPoint()->GetMomentum().z()) / GeV;
151 
152  Tof_ = aStep->GetPostStepPoint()->GetGlobalTime() / nanosecond;
153  Eloss_ = aStep->GetTotalEnergyDeposit() / GeV;
154  ParticleType_ = theTrack_->GetDefinition()->GetPDGEncoding();
155 
156  //corrected phi and theta treatment
157  G4ThreeVector gmd = aStep->GetPreStepPoint()->GetMomentumDirection();
158  // convert it to local frame
159  G4ThreeVector lmd = ((G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable()))
160  ->GetHistory()
161  ->GetTopTransform()
162  .TransformAxis(gmd);
164  ThetaAtEntry_ = lnmd.theta();
165  PhiAtEntry_ = lnmd.phi();
166 
167  if (isPrimary(theTrack_))
168  ParentId_ = 0;
169  else
170  ParentId_ = theTrack_->GetParentID();
171 
172  Vx_ = theTrack_->GetVertexPosition().x() / mm;
173  Vy_ = theTrack_->GetVertexPosition().y() / mm;
174  Vz_ = theTrack_->GetVertexPosition().z() / mm;
175 }
#define LogDebug(id)
const double GeV
Definition: MathUtil.h:16
G4Track * theTrack_
Definition: TotemRPSD.h:87
Local3DPoint ConvertToLocal3DPoint(const G4ThreeVector &point) const
double Tof_
Definition: TotemRPSD.h:102
G4ThreeVector setToLocal(const G4ThreeVector &globalPoint)
Definition: TotemRPSD.cc:230
G4int tSliceID_
Definition: TotemRPSD.h:90
G4VPhysicalVolume * currentPV_
Definition: TotemRPSD.h:88
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
double Pabs_
Definition: TotemRPSD.h:100
G4double tSlice_
Definition: TotemRPSD.h:91
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
G4ThreeVector theLocalEntryPoint_
Definition: TotemRPSD.h:97
int ParentId_
Definition: TotemRPSD.h:109
uint32_t setDetUnitId(const G4Step *step) override
Definition: TotemRPSD.cc:177
short ParticleType_
Definition: TotemRPSD.h:104
G4StepPoint * postStepPoint_
Definition: TotemRPSD.h:94
int verbosity_
Definition: TotemRPSD.h:61
unsigned int unitID_
Definition: TotemRPSD.h:89
G4int primaryID_
Definition: TotemRPSD.h:90
G4StepPoint * preStepPoint_
Definition: TotemRPSD.h:93
double PhiAtEntry_
Definition: TotemRPSD.h:107
double Vy_
Definition: TotemRPSD.h:110
G4ThreeVector theLocalExitPoint_
Definition: TotemRPSD.h:98
double ThetaAtEntry_
Definition: TotemRPSD.h:106
double Vz_
Definition: TotemRPSD.h:110
double thePz_
Definition: TotemRPSD.h:101
double thePx_
Definition: TotemRPSD.h:101
G4ThreeVector exitPoint_
Definition: TotemRPSD.h:96
bool isPrimary(const G4Track *track)
Definition: TotemRPSD.cc:289
double Eloss_
Definition: TotemRPSD.h:103
double thePy_
Definition: TotemRPSD.h:101
G4ThreeVector hitPoint_
Definition: TotemRPSD.h:95
double Vx_
Definition: TotemRPSD.h:110
G4String name_
Definition: TotemRPSD.h:82
void TotemRPSD::storeHit ( TotemRPG4Hit hit)
private

Definition at line 181 of file TotemRPSD.cc.

References LogDebug, theHC_, and verbosity_.

Referenced by createNewHit().

181  {
182  if (hit == nullptr) {
183  if (verbosity_)
184  LogDebug("TotemRP") << "TotemRPSD: hit to be stored is NULL !!" << std::endl;
185  return;
186  }
187  theHC_->insert(hit);
188 }
#define LogDebug(id)
TotemRPG4HitCollection * theHC_
Definition: TotemRPSD.h:84
int verbosity_
Definition: TotemRPSD.h:61
void TotemRPSD::summarize ( )
private

Definition at line 258 of file TotemRPSD.cc.

Referenced by EndOfEvent().

258 {}
void TotemRPSD::update ( const BeginOfEvent )
overrideprivatevirtual

This routine will be called when the appropriate signal arrives.

Implements Observer< const BeginOfEvent * >.

Definition at line 280 of file TotemRPSD.cc.

References clearHits(), and eventno_.

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

280  {
281  clearHits();
282  eventno_ = (*i)()->GetEventID();
283 }
int eventno_
Definition: TotemRPSD.h:114
void clearHits() override
Definition: TotemRPSD.cc:287
void TotemRPSD::update ( const ::EndOfEvent )
overrideprivate
void TotemRPSD::updateHit ( )
private

Member Data Documentation

TotemRPG4Hit* TotemRPSD::currentHit_
private

Definition at line 86 of file TotemRPSD.h.

Referenced by createNewHit().

G4VPhysicalVolume* TotemRPSD::currentPV_
private

Definition at line 88 of file TotemRPSD.h.

Referenced by printHitInfo(), and stepInfo().

double TotemRPSD::Eloss_
private

Definition at line 103 of file TotemRPSD.h.

Referenced by createNewHit(), printHitInfo(), and stepInfo().

G4ThreeVector TotemRPSD::entrancePoint_
private

Definition at line 79 of file TotemRPSD.h.

int TotemRPSD::eventno_
private

Definition at line 114 of file TotemRPSD.h.

Referenced by update().

G4ThreeVector TotemRPSD::exitPoint_
private

Definition at line 96 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4int TotemRPSD::hcID_
private

Definition at line 83 of file TotemRPSD.h.

Referenced by Initialize().

G4ThreeVector TotemRPSD::hitPoint_
private

Definition at line 95 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::incidentEnergy_
private

Definition at line 80 of file TotemRPSD.h.

Referenced by createNewHit().

unsigned int TotemRPSD::maxTotemHits_ = 15000
staticprivate

Definition at line 48 of file TotemRPSD.h.

Referenced by EndOfEvent().

G4String TotemRPSD::name_
private

Definition at line 82 of file TotemRPSD.h.

Referenced by Initialize(), stepInfo(), and TotemRPSD().

std::unique_ptr<TotemRPVDetectorOrganization> TotemRPSD::numberingScheme_
private

Definition at line 58 of file TotemRPSD.h.

Referenced by setDetUnitId(), setNumberingScheme(), and TotemRPSD().

double TotemRPSD::Pabs_
private

Definition at line 100 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

int TotemRPSD::ParentId_
private

Definition at line 109 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

short TotemRPSD::ParticleType_
private

Definition at line 104 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::PhiAtEntry_
private

Definition at line 107 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4StepPoint* TotemRPSD::postStepPoint_
private

Definition at line 94 of file TotemRPSD.h.

Referenced by printHitInfo(), and stepInfo().

G4StepPoint* TotemRPSD::preStepPoint_
private

Definition at line 93 of file TotemRPSD.h.

Referenced by printHitInfo(), setToLocal(), and stepInfo().

G4int TotemRPSD::primaryID_
private

Definition at line 90 of file TotemRPSD.h.

Referenced by createNewHit(), printHitInfo(), and stepInfo().

double TotemRPSD::rp_garage_position_ = 40.0
static

Definition at line 45 of file TotemRPSD.h.

Referenced by createNewHit().

std::unique_ptr<TrackingSlaveSD> TotemRPSD::slave_
private

Definition at line 57 of file TotemRPSD.h.

Referenced by clearHits(), EndOfEvent(), fillHits(), and TotemRPSD().

TotemRPG4HitCollection* TotemRPSD::theHC_
private

Definition at line 84 of file TotemRPSD.h.

Referenced by EndOfEvent(), Initialize(), PrintAll(), and storeHit().

G4ThreeVector TotemRPSD::theLocalEntryPoint_
private

Definition at line 97 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4ThreeVector TotemRPSD::theLocalExitPoint_
private

Definition at line 98 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::thePx_
private

Definition at line 101 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::thePy_
private

Definition at line 101 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::thePz_
private

Definition at line 101 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::ThetaAtEntry_
private

Definition at line 106 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4Track* TotemRPSD::theTrack_
private

Definition at line 87 of file TotemRPSD.h.

Referenced by printHitInfo(), and stepInfo().

double TotemRPSD::Tof_
private

Definition at line 102 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4double TotemRPSD::tSlice_
private

Definition at line 91 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

G4int TotemRPSD::tSliceID_
private

Definition at line 90 of file TotemRPSD.h.

Referenced by printHitInfo(), and stepInfo().

unsigned int TotemRPSD::unitID_
private

Definition at line 89 of file TotemRPSD.h.

Referenced by createNewHit(), printHitInfo(), and stepInfo().

int TotemRPSD::verbosity_
private

Definition at line 61 of file TotemRPSD.h.

Referenced by stepInfo(), storeHit(), and TotemRPSD().

double TotemRPSD::Vx_
private

Definition at line 110 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::Vy_
private

Definition at line 110 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().

double TotemRPSD::Vz_
private

Definition at line 110 of file TotemRPSD.h.

Referenced by createNewHit(), and stepInfo().