Belle II Software  release-08-01-10
CDCSensitiveDetector Class Reference

The Class for CDC Sensitive Detector. More...

#include <CDCSensitiveDetector.h>

Inheritance diagram for CDCSensitiveDetector:
Collaboration diagram for CDCSensitiveDetector:

Public Member Functions

 CDCSensitiveDetector (G4String name, G4double thresholdEnergyDeposit, G4double thresholdKineticEnergy)
 Constructor.
 
 ~CDCSensitiveDetector ()
 Destructor.
 
void Initialize (G4HCofThisEvent *) override
 Register CDC hits collection into G4HCofThisEvent.
 
bool step (G4Step *aStep, G4TouchableHistory *history) override
 Process each step and calculate variables defined in CDCB4VHit.
 
void EndOfEvent (G4HCofThisEvent *) override
 Do what you want to do at the beginning of each event (why this is not called ?) More...
 
void saveSimHit (const G4int layerId, const G4int wireId, const G4int trackID, const G4int pid, const G4double distance, const G4double tof, const G4double edep, const G4double stepLength, const G4ThreeVector &mom, const G4ThreeVector &posW, const G4ThreeVector &posIn, const G4ThreeVector &posOut, const G4ThreeVector &posTrack, const G4int lr, const G4int NewLrRaw, const G4int NewLr, const G4double speed, const G4double hitWeight)
 Save CDCSimHit into datastore.
 

Static Public Member Functions

static const std::map< std::string, RelationArray::EConsolidationAction > & getMCParticleRelations ()
 Return a list of all registered Relations with MCParticles.
 
static void setActive (bool activeStatus)
 Enable/Disable all Sensitive Detectors. More...
 
static void registerMCParticleRelation (const std::string &name, RelationArray::EConsolidationAction ignoreAction=RelationArray::c_negativeWeight)
 Register an relation involving MCParticles. More...
 
static void registerMCParticleRelation (const RelationArray &relation, RelationArray::EConsolidationAction ignoreAction=RelationArray::c_negativeWeight)
 Overload to make it easer to register MCParticle relations. More...
 

Private Member Functions

G4double ClosestApproach (G4ThreeVector bwp, G4ThreeVector fwp, G4ThreeVector posIn, G4ThreeVector posOut, G4ThreeVector &hitPosition, G4ThreeVector &wirePosition)
 Assume line track to calculate distance between track and wire (drift length).
 
void CellBound (const G4int layerId, const G4int ic1, const G4int ic2, const G4double venter[6], const G4double vexit[6], const G4double s1, const G4double s2, G4double xint[6], G4double &sint, G4int &iflag)
 Calculate intersection of track with cell boundary. More...
 
void GCUBS (const G4double x, const G4double y, const G4double d1, const G4double d2, G4double a[4])
 
void for_Rotat (const G4double bfld[3])
 Calculates a rotation matrix. More...
 
void Rotat (G4double &x, G4double &y, G4double &z, const int mode)
 Translation method. More...
 
void Rotat (G4double x[3], const int mode)
 Overloaded translation method.
 
void HELWIR (const G4double xwb4, const G4double ywb4, const G4double zwb4, const G4double xwf4, const G4double ywf4, const G4double zwf4, const G4double xp, const G4double yp, const G4double zp, const G4double px, const G4double py, const G4double pz, const G4double B_kG[3], const G4double charge, const G4int ntryMax, G4double &distance, G4double q2[3], G4double q1[3], G4double q3[3], G4int &ntry)
 Calculate closest points between helix and wire. More...
 
void Mvopr (const G4int ndim, const G4double b[3], const G4double m[3][3], const G4double a[3], G4double c[3], const G4int mode)
 Calculate the result of a matrix times vector. More...
 
std::vector< int > WireId_in_hit_order (int id0, int id1, int nWires)
 Sort wire id.
 
void setModifiedLeftRightFlag ()
 set left/right flag modified for tracking
 
void reAssignLeftRightInfo ()
 Re-assign left/right info.
 
unsigned short areNeighbors (const WireID &wireId, const WireID &otherWireId) const
 Check if neighboring cell in the same super-layer; essentially a copy from cdcLocalTracking/mclookup. More...
 
unsigned short areNeighbors (unsigned short iCLayer, unsigned short iSuperLayer, unsigned short iLayer, unsigned short iWire, const WireID &otherWireId) const
 Check if neighboring cell in the same super-layer; essentially a copy from cdcLocalTracking/mclookup. More...
 
virtual bool ProcessHits (G4Step *aStep, G4TouchableHistory *aROhist)
 Check if recording hits is enabled and if so call step() and set the correct MCParticle flag. More...
 

Private Attributes

StoreArray< MCParticlem_MCParticles
 MC particles.
 
StoreArray< CDCSimHitm_CDCSimHits
 CDC simulation hits.
 
G4int m_magneticField
 Magnetic field is on or off.
 
G4int m_nonUniformField
 Magnetic field is uniform or non-uniform. More...
 
G4double m_brot [3][3]
 a rotation matrix.
 
CDCGeometryParm_cdcgp
 Pointer to CDCGeometryPar object.
 
G4double m_thresholdEnergyDeposit
 Threshold energy deposit to be stored.
 
G4double m_thresholdKineticEnergy
 Threshold kinetic energy to be stored.
 
G4bool m_wireSag
 Switch to activate wire sag effect.
 
G4bool m_modifiedLeftRightFlag
 Switch for left/right flag modified for tracking.
 
G4double m_minTrackLength
 Min. More...
 
int m_hitNumber
 The current number of created hits in an event. More...
 
std::multimap< unsigned short, CDCSimHit * > m_hitWithPosWeight
 Map containing hits with positive weight. More...
 
std::vector< CDCSimHit * > m_hitWithNegWeight
 Vector containing hits with negative weight.
 
const signed short CCW = 1
 Constant for counterclockwise orientation.
 
const signed short CW = -1
 Constant for clockwise orientation.
 
const signed short CW_OUT_NEIGHBOR = 1
 Constant for clockwise outwards.
 
const signed short CW_NEIGHBOR = 3
 Constant for clockwise.
 
const signed short CW_IN_NEIGHBOR = 5
 Constant for clockwise inwards.
 
const signed short CCW_IN_NEIGHBOR = 7
 Constant for counterclockwise inwards.
 
const signed short CCW_NEIGHBOR = 9
 Constant for counterclockwise.
 
const signed short CCW_OUT_NEIGHBOR = 11
 Constant for counterclockwise outwards.
 
Const::EDetector m_subdetector
 Subdetector the class belongs to.
 

Static Private Attributes

static std::map< std::string, RelationArray::EConsolidationActions_mcRelations
 Static set holding all relations which have to be updated at the end of the Event.
 
static bool s_active
 Static bool which indicates wether recording of hits is enabled.
 

Detailed Description

The Class for CDC Sensitive Detector.

In this class, every variable defined in CDCB4VHit will be calculated. And save CDCB4VHit into hits collection.

Definition at line 38 of file CDCSensitiveDetector.h.

Member Function Documentation

◆ ProcessHits()

bool ProcessHits ( G4Step *  aStep,
G4TouchableHistory *  aROhist 
)
inlineprivatevirtualinherited

Check if recording hits is enabled and if so call step() and set the correct MCParticle flag.

Called by Geant4 for each step inside the sensitive volumes attached

Definition at line 94 of file SensitiveDetectorBase.h.

◆ registerMCParticleRelation() [1/2]

static void registerMCParticleRelation ( const RelationArray relation,
RelationArray::EConsolidationAction  ignoreAction = RelationArray::c_negativeWeight 
)
inlinestaticinherited

Overload to make it easer to register MCParticle relations.

Parameters
relationRelationArray to register
ignoreAction

Definition at line 66 of file SensitiveDetectorBase.h.

◆ registerMCParticleRelation() [2/2]

void registerMCParticleRelation ( const std::string &  name,
RelationArray::EConsolidationAction  ignoreAction = RelationArray::c_negativeWeight 
)
staticinherited

Register an relation involving MCParticles.

All Relations which point from an MCParticle to something have to be registered with addMCParticleRelation() because the index of the MCParticles might change at the end of the event. During simulation, the TrackID should be used as index of the MCParticle

Parameters
nameName of the relation to register
ignoreAction

Definition at line 22 of file SensitiveDetectorBase.cc.

◆ setActive()

static void setActive ( bool  activeStatus)
inlinestaticinherited

Enable/Disable all Sensitive Detectors.

By default, all sensitive detectors won't create hits to make it possible to use the Geant4 Navigator for non-simulation purposes. Only during simulation the sensitive detectors will be enabled to record hits

Parameters
activeStatusbool to indicate wether hits should be recorded

Definition at line 50 of file SensitiveDetectorBase.h.

Member Data Documentation

◆ m_hitNumber

int m_hitNumber
private

The current number of created hits in an event.

Used to fill the DataStore CDC array.

Definition at line 277 of file CDCSensitiveDetector.h.

◆ m_hitWithPosWeight

std::multimap<unsigned short, CDCSimHit*> m_hitWithPosWeight
private

Map containing hits with positive weight.

Map may be replaced by vector, which may make the job speed faster... Try later.

Definition at line 280 of file CDCSensitiveDetector.h.

◆ m_minTrackLength

G4double m_minTrackLength
private

Min.

track length (mm) required for saving in MCParticle.

Definition at line 275 of file CDCSensitiveDetector.h.

◆ m_nonUniformField

G4int m_nonUniformField
private

Magnetic field is uniform or non-uniform.

0: uniform B field (1.5 T), 1: non-uniform B field.

Definition at line 254 of file CDCSensitiveDetector.h.


The documentation for this class was generated from the following files: