Belle II Software development
CDCGeometryPar Class Reference

The Class for CDC Geometry Parameters. More...

#include <CDCGeometryPar.h>

Public Types

enum  EWirePosition {
  c_Base = 0 ,
  c_Misaligned ,
  c_Aligned
}
 Wire position set. More...
 

Public Member Functions

virtual ~CDCGeometryPar ()
 Destructor.
 
void clear ()
 Clears.
 
void Print () const
 Print some debug information.
 
void readFromDB (const CDCGeometry &)
 Gets geometry parameters from database.
 
void readWirePositionParams (EWirePosition set, const CDCGeometry *geom)
 Read displacement or (mis)alignment params from text file.
 
void setWirPosAlignParams ()
 Set wire alignment params.
 
void setWirPosMisalignParams ()
 Set wire misalignment params.
 
void readXT (const GearDir &gbxParams, int mode=0)
 Read XT-relation table.
 
void newReadXT (const GearDir &gbxParams, int mode=0)
 Read XT-relation table in new format.
 
void setXT ()
 Set XT-relation table (from DB).
 
void setXtRel ()
 Set XT-relation table (from DB) (new).
 
void readSigma (const GearDir &gbxParams, int mode=0)
 Read spatial resolution table.
 
void newReadSigma (const GearDir &gbxParams, int mode=0)
 Read spatial resolution table in new format.
 
void readFFactor (const GearDir &gbxParams, int mode=0)
 Read fudge factors.
 
void setSResol ()
 Set spatial resolution (from DB).
 
void setFFactor ()
 Set fudge factors (from DB).
 
void readPropSpeed (const GearDir &gbxParams, int mode=0)
 Read the propagation speed along the sense wire.
 
void setPropSpeed ()
 Set prop.
 
void readT0 (const GearDir &gbxParams, int mode=0)
 Read t0 parameters (from a file).
 
void setT0 ()
 Set t0 parameters (from DB)
 
void calcMeanT0 (double minT0=3800, double maxT0=5800, int maxIt=10, double nStdv=3, double epsi=0.1)
 Calculate mean t0 in ns (over all good wires)
 
void setBadWire ()
 Set bad-wires (from DB)
 
void readChMap ()
 Read channel map between wire-id and electronics-id.
 
void setChMap ()
 Set channel map (from DB)
 
void readTW (const GearDir &gbxParams, int mode=0)
 Read time-walk parameter.
 
void readEDepToADC (const GearDir &gbxParams, int mode=0)
 Read spatial edep-to-adc conv.
 
void setTW ()
 Set time-walk parameters.
 
void setEDepToADCConversions ()
 Set edep-to-ADC conversion params.
 
double getEDepToADCConvFactor (unsigned short layer, unsigned short cell, double edep, double dx, double costh)
 Return edep-to-ADC conversion factor.
 
double getEDepToADCMainFactor (unsigned short layer, unsigned short cell, double costh=0)
 Return edep-to-ADC conversion main factor (in count/keV)
 
double getEDepToADCSigma (unsigned short layer, unsigned short cell)
 Return sigma for extra smearing of edep to ADC conversion.
 
void generateXML (const std::string &of)
 Generate an xml file used in gearbox.
 
std::string version () const
 Returns the version of cdc geometry parameters.
 
double motherInnerR () const
 The method to get cdc mother volume inner R.
 
double motherOuterR () const
 The method to get cdc mother volume outer R.
 
double motherLength () const
 The method to get cdc mother volume length.
 
int momBound () const
 to get the number of boundary position of the CDC mother volume
 
double momZ (int iBound) const
 Returns boundary position in Z axis of the CDC mother volume.
 
double momRmin (int iBound) const
 Returns inner radius of the CDC mother volume.
 
unsigned cellId (unsigned layerId, const B2Vector3D &position) const
 The method to get cell id based on given layer id and the position.
 
double innerRadiusOuterWall () const
 Returns the inner radius of the outer wall.
 
double outerRadiusOuterWall () const
 Returns the outer radius of the outer wall.
 
double zOuterWall () const
 Returns the length of the outer wall in Z.
 
double zOffsetOuterWall () const
 Returns the offset of the outer wall in z direction.
 
double innerRadiusInnerWall () const
 Returns the inner radius of the inner wall.
 
double outerRadiusInnerWall () const
 Returns the outer radius of the inner wall.
 
double zInnerWall () const
 Returns the length of the inner wall in Z.
 
double zOffsetInnerWall () const
 Returns the offset of the outer wall in z direction.
 
double senseWireDiameter () const
 Returns diameter of the sense wire.
 
double fieldWireDiameter () const
 Returns diameter of the field wire.
 
unsigned nWireLayers () const
 Returns a number of wire layers.
 
unsigned nWiresInLayer (int layerId) const
 Returns wire numbers in a layer.
 
const double * innerRadiusWireLayer () const
 Returns an array of inner radius of wire layers.
 
const double * outerRadiusWireLayer () const
 Returns an array of outer radius of wire layers.
 
const double * zForwardWireLayer () const
 Returns an array of forward z of wire layers.
 
const double * zBackwardWireLayer () const
 Returns an array of backward z of wire layers.
 
double zOffsetWireLayer (unsigned i) const
 Returns the offset of z of the wire layer i.
 
double getMeanT0 () const
 Returns the mean t0 over all wires.
 
const B2Vector3D wireForwardPosition (uint layerId, int cellId, EWirePosition set=c_Base) const
 Returns the forward position of the input sense wire.
 
const B2Vector3D wireForwardPosition (const WireID &wireID, EWirePosition set=c_Base) const
 The same function but in a different input format.
 
const B2Vector3D wireForwardPosition (uint layerId, int cellId, double z, EWirePosition set=c_Base) const
 Returns a virtual forward position corresp. to a tangent to the wire at the input z-position.
 
const B2Vector3D wireForwardPosition (const WireID &wireID, double z, EWirePosition set=c_Base) const
 The same function but in a different input format.
 
const B2Vector3D wireBackwardPosition (uint layerId, int cellId, EWirePosition set=c_Base) const
 Returns the backward position of the input sense wire.
 
const B2Vector3D wireBackwardPosition (const WireID &wireID, EWirePosition set=c_Base) const
 The same function but in a different input format.
 
const B2Vector3D wireBackwardPosition (uint layerId, int cellId, double z, EWirePosition set=c_Base) const
 Returns a virtual backward position corresp. to a tangent to the wire at the input z-position.
 
const B2Vector3D wireBackwardPosition (const WireID &wireID, double z, EWirePosition set=c_Base) const
 The same function but in a different input format.
 
double getWireSagCoef (EWirePosition set, uint layerId, int cellId) const
 Returns coefficient for the sense wire sag.
 
double getThresholdEnerguDeposit () const
 Returns threshold for energy deposit in one G4 step.
 
double getMinTrackLength () const
 Returns the minimum track length required in one G4 step (only secondary particles which pass this criterion are to be saved in MCParticle)
 
bool isWireSagOn () const
 Returns on/off for sense wire sag in FullSim.
 
bool isModifiedLeftRightFlagOn () const
 Returns on/off for modified left/right calculation in FullSim.
 
float getT0 (const WireID &wireID) const
 Returns t0 parameter of the specified sense wire.
 
unsigned short getBoardID (const WireID &wID) const
 Returns frontend board id. corresponding to the wire id.
 
unsigned short getChannelID (const WireID &wID) const
 Returns frontend channel id. corresponding to the wire id.
 
const WireID getWireID (unsigned short bd, unsigned short ch) const
 Returns wire id. corresponding to the board-and-cannel ids.
 
double getTimeWalk (const WireID &wID, unsigned short adcCount) const
 Returns time-walk.
 
void setShiftInSuperLayer ()
 Calculates and saves shifts in super-layers (to be used in searching hits in neighboring cells)
 
signed short getShiftInSuperLayer (unsigned short iSuperLayer, unsigned short iLayer) const
 Returns shift in the super-layer.
 
double senseWireR (int layerId) const
 Returns radius of sense wire in each layer.
 
double senseWireFZ (int layerId) const
 Returns forward z position of sense wire in each layer.
 
double senseWireBZ (int layerId) const
 Returns backward z position of sense wire in each layer.
 
double fieldWireR (int layerId) const
 Returns radius of field wire in each layer.
 
double fieldWireFZ (int layerId) const
 Returns forward z position of field wire in each layer.
 
double fieldWireBZ (int layerId) const
 Returns backward z position of field wire in each layer.
 
int nShifts (int layerId) const
 Returns number shift.
 
double offset (int layerID) const
 Return wire offset in phi direction at endplate.
 
void setSenseWireR (int layerId, double r)
 Set radius of sense wire in each layer.
 
void setSenseWireFZ (int layerId, double fz)
 Set forward z position of sense wires.
 
void setSenseWireBZ (int layerId, double bz)
 set backward z position of sense wires.
 
unsigned short getTdcOffset () const
 Return TDC offset value (default = 0 ch).
 
double getTdcBinWidth () const
 Return TDC bin width (nsec).
 
double getNominalDriftV () const
 Return the nominal drift velocity of He-ethane gas (default: 4.0x10^-3 cm/nsec).
 
double getNominalPropSpeed () const
 Return the nominal propagation speed of the sense wire (default: 27.25 cm/nsec).
 
double getNominalSpaceResol () const
 Return the nominal spatial resolution.
 
int getMaterialDefinitionMode () const
 Return mode for material definition.
 
int getSenseWireZposMode () const
 Return mode for sense wire z position.
 
double getBwdDeltaZ (unsigned short layerID) const
 Return backward 'deltaZ'.
 
double getFwdDeltaZ (unsigned short layerID) const
 Return forward 'deltaZ'.
 
void setNominalSpaceResol (double resol)
 Set the nominal spatial resolution in the unit of um.
 
double getPropSpeedInv (const unsigned int layerID) const
 Get the inversel of propagation speed in the sense wire.
 
bool isBadWire (const WireID &wid)
 Inquire if the wire is totally-dead.
 
bool isDeadWire (const WireID &wid, double &eff)
 Inquire if the wire is dead.
 
bool isHotWire (const WireID &wid)
 Inquire if the wire is hot.
 
void getWireSagEffect (EWirePosition set, unsigned layerID, unsigned cellID, double zw, double &ywb_sag, double &ywf_sag) const
 Compute effects of the sense wire sag.
 
double getDriftV (double dt, unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI) const
 Get the realistic drift velocity.
 
double getDriftLength (double dt, unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI, bool calculateMinTime=true, double minTime=0.) const
 Return the drift dength to the sense wire.
 
double getDriftLength0 (double dt, unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI) const
 Return the drift dength to the sense wire; tentative ver.
 
double getMinDriftTime (unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI) const
 Return the min.
 
double getDriftTime (double dist, unsigned short layer, unsigned short lr, double alpha, double theta) const
 Return the drift time to the sense wire.
 
double getSigma (double dist, unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI) const
 Return the basic resolution of drift length (cm).
 
double getFudgeFactorForSigma (unsigned short target) const
 Return the fuge factor for space resol.
 
unsigned short getOldLeftRight (const B2Vector3D &posOnWire, const B2Vector3D &posOnTrack, const B2Vector3D &momentum) const
 Returns old left/right.
 
unsigned short getNewLeftRightRaw (const B2Vector3D &posOnWire, const B2Vector3D &posOnTrack, const B2Vector3D &momentum) const
 Returns new left/right_raw.
 
double getAlpha (const B2Vector3D &posOnWire, const B2Vector3D &momentum) const
 Returns track incident angle in rphi plane (alpha in rad.).
 
double getTheta (const B2Vector3D &momentum) const
 Returns track incident angle (theta in rad.).
 
unsigned short getOutgoingLR (const unsigned short lr, const double alpha) const
 Converts incoming-lr to outgoing-lr.
 
double getOutgoingAlpha (const double alpha) const
 Converts incoming- to outgoing-alpha.
 
double getOutgoingTheta (const double alpha, const double theta) const
 Converts incoming- to outgoing-theta.
 
void getClosestAlphaPoints (const double alpha, double &wal, unsigned short points[2], unsigned short lrs[2]) const
 Returns the two closest alpha points for the input track incident angle (alpha).
 
void getClosestAlphaPoints4Sgm (const double alpha, double &wal, unsigned short points[2], unsigned short lrs[2]) const
 Returns the two closest alpha points for sigma for the input track incident angle (alpha).
 
void getClosestThetaPoints (const double alpha, const double theta, double &wth, unsigned short points[2]) const
 Returns the two closest theta points for the input track incident angle (theta).
 
void getClosestThetaPoints4Sgm (const double alpha, const double theta, double &wth, unsigned short points[2]) const
 Returns the two closest theta points for sigma for the input track incident angle (theta).
 
void setDesignWirParam (unsigned layerID, unsigned cellID)
 Set the desizend wire parameters.
 
void outputDesignWirParam (unsigned layerID, unsigned cellID) const
 Write the designed wire parameters to the alignment.dat (default).
 
void setDisplacement ()
 Set displacement of sense wire.
 
ushort getNumberOfSenseWires () const
 Get the number of sense wires.
 
ushort getNumberOfFieldWires () const
 Get the number of field wires.
 
ushort getNumberOfSenseLayers () const
 Get the number of sense layers.
 
ushort getNumberOfFieldLayers () const
 Get the number of field layers.
 
ushort getMaxNumberOfSuperLayers () const
 Get the maximum number of super layers.
 
ushort getOffsetOfFirstLayer () const
 Get the offset of the first layer.
 
ushort getOffsetOfFirstSuperLayer () const
 Get the offset of the first super layer.
 
ushort getMaxNumberOfCellsPerLayer () const
 Get the maximum number of cells in one layer.
 

Static Public Member Functions

static CDCGeometryParInstance (const CDCGeometry *=nullptr)
 Static method to get a reference to the CDCGeometryPar instance.
 

Private Member Functions

 CDCGeometryPar (const CDCGeometry *=nullptr)
 Singleton class.
 
 CDCGeometryPar (const CDCGeometryPar &)
 Singleton class.
 
CDCGeometryParoperator= (const CDCGeometryPar &)
 Singleton class.
 

Private Attributes

bool m_debug
 Switch for debug printing.
 
bool m_linearInterpolationOfXT
 Switch for linear interpolation of xt.
 
bool m_linearInterpolationOfSgm
 Switch for linear interpolation of sigma.
 
bool m_XTetc
 Switch for reading x-t etc.
 
bool m_displacement
 Switch for displacement.
 
bool m_misalignment
 Switch for misalignment.
 
bool m_alignment
 Switch for alignment.
 
bool m_XTetc4Recon
 Switch for selecting xt etc.
 
bool m_wireSag
 Switch for sense wire sag.
 
bool m_modLeftRightFlag
 Switch for modified left/right flag.
 
std::string m_version
 The version of geometry parameters.
 
int m_materialDefinitionMode
 Control switch for gas and wire material definition.
 
int m_senseWireZposMode
 Mode for sense wire z position corr.
 
int m_xtFileFormat
 Format of xt input file.
 
int m_xtParamMode
 Mode for xt parameterization.
 
int m_sigmaFileFormat
 Format of sigma input file.
 
int m_sigmaParamMode
 Mode for sigma parameterization.
 
int m_twParamMode
 Mode for tw parameterization.
 
int m_nSLayer
 The number of sense wire layer.
 
int m_nFLayer
 The number of field wire layer.
 
unsigned short m_nAlphaPoints
 No.
 
unsigned short m_nThetaPoints
 No.
 
unsigned short m_nAlphaPoints4Sgm
 No.
 
unsigned short m_nThetaPoints4Sgm
 No.
 
signed short m_shiftInSuperLayer [c_nSuperLayers][8]
 shift in phi-direction wrt the 1st layer in each super layer
 
double m_rWall [4]
 The array to store radius of inner wall and outer wall.
 
double m_zWall [4][2]
 The array to store z position of inner wall and outer wall.
 
double m_rSLayer [c_maxNSenseLayers]
 The array to store radius of sense wire layers.
 
double m_zSForwardLayer [c_maxNSenseLayers]
 The array to store forward z position of sense wire layers.
 
double m_dzSForwardLayer [c_maxNSenseLayers]
 Corrections for forward z position of sense wire layers.
 
double m_zSBackwardLayer [c_maxNSenseLayers]
 The array to store backward z position of sense wire layers.
 
double m_dzSBackwardLayer [c_maxNSenseLayers]
 Corrections for backward z position of sense wire layers.
 
double m_rFLayer [c_maxNFieldLayers]
 The array to store radius of field wire layers.
 
double m_zFForwardLayer [c_maxNFieldLayers]
 The array to store forward z position of field wire layers.
 
double m_zFBackwardLayer [c_maxNFieldLayers]
 The array to store backward z position of field wire layers.
 
double m_offSet [c_maxNSenseLayers]
 The array to store z offset of sense wire layers.
 
double m_cellSize [c_maxNSenseLayers]
 The array to store cell size in each sense wire layer.
 
int m_nShifts [c_maxNSenseLayers]
 The array to store shifted cell number in each sense wire layer.
 
unsigned m_nWires [c_maxNSenseLayers]
 The array to store the wire number in each sense wire layre.
 
double m_senseWireDiameter
 The diameter of sense wires.
 
double m_senseWireTension
 The tension of sense wires.
 
double m_senseWireDensity
 The density of sense wires.
 
double m_fieldWireDiameter
 The diameter of field wires.
 
double m_globalPhiRotation
 Global ratation in phi (rad.); only for sense wires now.
 
double m_momZ [7]
 Z-cordinates of the cdc mother volume (7 segments).
 
double m_momRmin [7]
 R_min of the cdc mother volume (7 segments).
 
double m_thresholdEnergyDeposit
 Energy thresh.
 
double m_minTrackLength
 Minimum track length for G4 step.
 
float m_FWirPos [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_BWirPos [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_WireSagCoef [c_maxNSenseLayers][c_maxNDriftCells]
 Wire sag coefficient for each cell; ibid.
 
float m_FWirPosMisalign [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_BWirPosMisalign [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_WireSagCoefMisalign [c_maxNSenseLayers][c_maxNDriftCells]
 Wire sag coefficient incl.
 
float m_FWirPosAlign [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_BWirPosAlign [c_maxNSenseLayers][c_maxNDriftCells][3]
 Wire position incl.
 
float m_WireSagCoefAlign [c_maxNSenseLayers][c_maxNDriftCells]
 Wire sag coefficient incl.
 
float m_eDepToADCParams [c_maxNSenseLayers][c_maxNDriftCells][7] = {}
 edep-to-ADC conv.
 
float m_alphaPoints [c_maxNAlphaPoints]
 alpha sampling points for xt (rad)
 
float m_thetaPoints [c_maxNThetaPoints]
 theta sampling points for xt (rad)
 
float m_alphaPoints4Sgm [c_maxNAlphaPoints]
 alpha sampling points for sigma (rad)
 
float m_thetaPoints4Sgm [c_maxNThetaPoints]
 theta sampling points for sigma (rad)
 
float m_XT [c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nXTParams]
 XT-relation coefficients for each layer, Left/Right, entrance angle and polar angle.
 
float m_Sigma [c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nSigmaParams]
 position resolution for each layer.
 
float m_propSpeedInv [c_maxNSenseLayers]
 Inverse of propagation speed of the sense wire.
 
float m_t0 [c_maxNSenseLayers][c_maxNDriftCells] = {}
 t0 for each sense-wire (in nsec).
 
float m_timeWalkCoef [c_nBoards][2]
 coefficients for time walk.
 
double m_meanT0
 mean t0 over all wires; should be double.
 
std::map< WireID, unsigned short > m_wireToBoard
 map relating wire-id and board-id.
 
std::map< WireID, unsigned short > m_wireToChannel
 map relating wire-id and channel-id.
 
unsigned short m_boardAndChannelToWire [c_nBoards][48]
 array relating board-channel-id and wire-id.
 
unsigned short m_tdcOffset
 Not used; to be removed later.
 
double m_clockFreq4TDC
 Clock frequency used for TDC (GHz).
 
double m_tdcBinWidth
 TDC bin width (nsec/bin).
 
double m_nominalDriftV
 Nominal drift velocity (4.0x10^-3 cm/nsec).
 
double m_nominalDriftVInv
 Inverse of the nominal drift velocity.
 
double m_nominalPropSpeed
 Nominal propagation speed of the sense wire (27.25 cm/nsec).
 
double m_nominalSpaceResol
 Nominal spatial resolution (0.0130 cm).
 
double m_maxSpaceResol
 max space resolution allowed (cm).
 
double m_fudgeFactorForSigma [3]
 Fuge factor for space resol.
 
DBObjPtr< CDCTimeZeros > * m_t0FromDB
 t0s retrieved from DB.
 
DBObjPtr< CDCBadWires > * m_badWireFromDB
 bad-wires retrieved from DB.
 
DBObjPtr< CDCPropSpeeds > * m_propSpeedFromDB
 prop.
 
DBObjPtr< CDCTimeWalks > * m_timeWalkFromDB
 time-walk coeffs.
 
DBObjPtr< CDCXtRelations > * m_xtRelFromDB
 xt params.
 
DBObjPtr< CDCSpaceResols > * m_sResolFromDB
 sigma params.
 
DBObjPtr< CDCFudgeFactorsForSigma > * m_fFactorFromDB
 fudge factors retrieved from DB.
 
DBArray< CDCChannelMap > * m_chMapFromDB
 channel map retrieved from DB.
 
DBArray< CDCDisplacement > * m_displacementFromDB
 displacement params.
 
DBObjPtr< CDCAlignment > * m_alignmentFromDB
 alignment params.
 
DBObjPtr< CDCMisalignment > * m_misalignmentFromDB
 misalignment params.
 
DBObjPtr< CDCEDepToADCConversions > * m_eDepToADCConversionsFromDB
 Pointer to edep-to-ADC conv.
 
DBObjPtr< HardwareClockSettingsm_clockSettings
 hardware clock settings
 
ushort m_nSenseWires = c_nSenseWires
 Maximum number of Sense Wires.
 
ushort m_nFieldWires = c_nFieldWires
 Maximum number of Field Wires.
 
ushort m_maxNSenseLayers = c_maxNSenseLayers
 Maximum number of Sense Wire Layers.
 
ushort m_maxNFieldLayers = c_maxNFieldLayers
 Maximum number of Field Wire Layers.
 
ushort m_maxNSuperLayers = c_nSuperLayers
 Maximum number of Super Layers.
 
ushort m_firstLayerOffset = 0
 Offset of the first layer (for reduced CDC studies)
 
ushort m_firstSuperLayerOffset = 0
 Offset of the first super layer (for reduced CDC studies)
 
ushort m_maxNCellsPerLayer = c_maxNDriftCells
 Maximum number wires within a layer.
 

Static Private Attributes

static CDCGeometryParm_B4CDCGeometryParDB = 0
 Pointer that saves the instance of this class.
 

Detailed Description

The Class for CDC Geometry Parameters.

This class provides CDC geometry parameters for simulation, reconstruction and so on. These parameters are gotten from gearbox.

Definition at line 51 of file CDCGeometryPar.h.

Member Enumeration Documentation

◆ EWirePosition

Wire position set.

Definition at line 56 of file CDCGeometryPar.h.

56{c_Base = 0, c_Misaligned, c_Aligned};

Constructor & Destructor Documentation

◆ ~CDCGeometryPar()

~CDCGeometryPar ( )
virtual

Destructor.

Definition at line 142 of file CDCGeometryPar.cc.

143{
144 // B2INFO("CDCGeometryPar: destructor called");
145 // if (m_t0FromDB) delete m_t0FromDB;
146 // if (m_badWireFromDB) delete m_badWireFromDB;
147 // if (m_propSpeedFromDB) delete m_propSpeedFromDB;
148 // if (m_timeWalkFromDB) delete m_timeWalkFromDB;
149 // if (m_xtRelFromDB) delete m_xtRelFromDB;
150 // if (m_sResolFromDB) delete m_sResolFromDB;
151 // if (m_chMapFromDB) delete [] m_chMapFromDB;
152 // if (m_displacementFromDB) delete [] m_displacementFromDB;
153 // if (m_chMapFromDB) delete m_chMapFromDB;
154 // if (m_displacementFromDB) delete m_displacementFromDB;
155 // if (m_alignmentFromDB) delete m_alignmentFromDB;
156 // if (m_misalignmentFromDB) delete m_misalignmentFromDB;
157 // B2INFO("CDCGeometryPar: destructor ended");
158}

◆ CDCGeometryPar()

CDCGeometryPar ( const CDCGeometry geom = nullptr)
private

Singleton class.

Definition at line 38 of file CDCGeometryPar.cc.

39{
40
42
43 if (gcp.getT0InputType()) {
45 if ((*m_t0FromDB).isValid()) {
46 (*m_t0FromDB).addCallback(this, &CDCGeometryPar::setT0);
47 }
48 }
49
50 if (gcp.getBwInputType()) {
52 if ((*m_badWireFromDB).isValid()) {
53 (*m_badWireFromDB).addCallback(this, &CDCGeometryPar::setBadWire);
54 }
55 }
56
57 if (gcp.getPropSpeedInputType()) {
59 if ((*m_propSpeedFromDB).isValid()) {
60 (*m_propSpeedFromDB).addCallback(this, &CDCGeometryPar::setPropSpeed);
61 }
62 }
63
64 if (gcp.getTwInputType()) {
66 if ((*m_timeWalkFromDB).isValid()) {
67 (*m_timeWalkFromDB).addCallback(this, &CDCGeometryPar::setTW);
68 }
69 }
70
71 if (gcp.getXtInputType()) {
73 if ((*m_xtRelFromDB).isValid()) {
74 (*m_xtRelFromDB).addCallback(this, &CDCGeometryPar::setXtRel);
75 }
76 }
77
78 if (gcp.getSigmaInputType()) {
80 if ((*m_sResolFromDB).isValid()) {
81 (*m_sResolFromDB).addCallback(this, &CDCGeometryPar::setSResol);
82 }
83 }
84
85 if (gcp.getFFactorInputType()) {
87 if ((*m_fFactorFromDB).isValid()) {
88 (*m_fFactorFromDB).addCallback(this, &CDCGeometryPar::setFFactor);
89 }
90 }
91
92 if (gcp.getChMapInputType()) {
94 if ((*m_chMapFromDB).isValid()) {
95 (*m_chMapFromDB).addCallback(this, &CDCGeometryPar::setChMap);
96 }
97 }
98
99 if (gcp.getDisplacementInputType()) {
101 if ((*m_displacementFromDB).isValid()) {
102 (*m_displacementFromDB).addCallback(this, &CDCGeometryPar::setDisplacement);
103 }
104 }
105
106 if (gcp.getAlignmentInputType()) {
108 if ((*m_alignmentFromDB).isValid()) {
109 (*m_alignmentFromDB).addCallback(this, &CDCGeometryPar::setWirPosAlignParams);
110 }
111 }
112
113 if (gcp.getMisalignment()) {
114 if (gcp.getMisalignmentInputType()) {
116 if ((*m_misalignmentFromDB).isValid()) {
117 (*m_misalignmentFromDB).addCallback(this, &CDCGeometryPar::setWirPosMisalignParams);
118 }
119 }
120 }
121
122 //TODO in future: make a new (singleton?) class and move all EDepToADC things there.
123 if (gcp.getEDepToADCInputType()) {
125 if ((*m_eDepToADCConversionsFromDB).isValid()) {
126 (*m_eDepToADCConversionsFromDB).addCallback(this, &CDCGeometryPar::setEDepToADCConversions);
127 }
128 }
129
130 clear();
131 if (geom) {
132 // B2INFO("CDCGeometryPar: Read Geometry object");
133 readFromDB(*geom);
134 } else {
135 // std::cout <<"readcalled" << std::endl;
136 // read();
137 // B2FATAL("CDCGeometryPar: Strange that readFromDB is not called !");
138 B2WARNING("CDCGeometryPar: Strange that readFromDB is not called! Please make sure that CDC is included in Geometry.");
139 }
140}
The Class for CDC Geometry Control Parameters.
bool getSigmaInputType()
Get input type for sigma.
bool getMisalignmentInputType()
Get input type for wire misalignment.
bool getDisplacementInputType()
Get input type for wire displacement.
bool getAlignmentInputType()
Get input type for wire alignment.
bool getT0InputType()
Get input type for t0.
bool getEDepToADCInputType()
Get input type for edeptoadc.
bool getMisalignment() const
Get misalignment switch.
bool getTwInputType()
Get input type for time-walk.
bool getChMapInputType()
Get input type for channel map.
bool getFFactorInputType()
Get input type for fuge factor.
bool getXtInputType()
Get input type for xt.
bool getBwInputType()
Get input type for bad wire.
bool getPropSpeedInputType()
Get input type for prop.
static CDCGeoControlPar & getInstance()
Static method to get a reference to the CDCGeoControlPar instance.
void setWirPosAlignParams()
Set wire alignment params.
void setXtRel()
Set XT-relation table (from DB) (new).
DBObjPtr< CDCBadWires > * m_badWireFromDB
bad-wires retrieved from DB.
void setT0()
Set t0 parameters (from DB)
void setEDepToADCConversions()
Set edep-to-ADC conversion params.
DBArray< CDCDisplacement > * m_displacementFromDB
displacement params.
DBObjPtr< CDCMisalignment > * m_misalignmentFromDB
misalignment params.
DBObjPtr< CDCSpaceResols > * m_sResolFromDB
sigma params.
void setDisplacement()
Set displacement of sense wire.
DBObjPtr< CDCTimeWalks > * m_timeWalkFromDB
time-walk coeffs.
DBObjPtr< CDCTimeZeros > * m_t0FromDB
t0s retrieved from DB.
void setChMap()
Set channel map (from DB)
DBObjPtr< CDCFudgeFactorsForSigma > * m_fFactorFromDB
fudge factors retrieved from DB.
DBArray< CDCChannelMap > * m_chMapFromDB
channel map retrieved from DB.
void readFromDB(const CDCGeometry &)
Gets geometry parameters from database.
DBObjPtr< CDCXtRelations > * m_xtRelFromDB
xt params.
DBObjPtr< CDCPropSpeeds > * m_propSpeedFromDB
prop.
void setBadWire()
Set bad-wires (from DB)
void setWirPosMisalignParams()
Set wire misalignment params.
void setTW()
Set time-walk parameters.
void setSResol()
Set spatial resolution (from DB).
DBObjPtr< CDCAlignment > * m_alignmentFromDB
alignment params.
DBObjPtr< CDCEDepToADCConversions > * m_eDepToADCConversionsFromDB
Pointer to edep-to-ADC conv.
void setFFactor()
Set fudge factors (from DB).
void addCallback(std::function< void(const std::string &)> callback, bool onDestruction=false)
Add a callback method.
Class for accessing arrays of objects in the database.
Definition: DBArray.h:26
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Optional DBObjPtr: This class behaves the same as the DBObjPtr except that it will not raise errors w...
Definition: DBObjPtr.h:48

Member Function Documentation

◆ calcMeanT0()

void calcMeanT0 ( double  minT0 = 3800,
double  maxT0 = 5800,
int  maxIt = 10,
double  nStdv = 3,
double  epsi = 0.1 
)

Calculate mean t0 in ns (over all good wires)

Parameters
minT0min. of t0 window (ns)
maxT0max. of t0 window (ns)
maxItmax. no. of iterations
nStdvstandard-deviation cut applied for next iteration
epsicriterion for iteration stop (ns)

Definition at line 1387 of file CDCGeometryPar.cc.

1388{
1389 double oldMeanT0 = 0;
1390 unsigned short it1 = 0;
1391 for (unsigned short it = 0; it < maxIt; ++it) {
1392 it1 = it;
1393 double effiSum = 0.;
1394 m_meanT0 = 0.;
1395 double stdvT0 = 0;
1396 for (unsigned short iCL = 0; iCL < c_maxNSenseLayers; ++iCL) {
1397 for (unsigned short iW = 0; iW < m_nWires[iCL]; ++iW) {
1398 if (m_t0[iCL][iW] < minT0 || m_t0[iCL][iW] > maxT0) continue;
1399 const WireID wid = WireID(iCL, iW);
1400 if (isHotWire(wid)) continue;
1401 if (isBadWire(wid)) continue;
1402 double effi = 1.;
1403 isDeadWire(wid, effi);
1404 effiSum += effi;
1405 m_meanT0 += (iCL < m_firstLayerOffset) ? 0. : effi * m_t0[iCL][iW];
1406 stdvT0 += (iCL < m_firstLayerOffset) ? 0. : effi * m_t0[iCL][iW] * m_t0[iCL][iW];
1407 }
1408 }
1409 if (effiSum > 0.) {
1410 m_meanT0 /= effiSum;
1411 stdvT0 /= effiSum;
1412 stdvT0 = sqrt(fabs(stdvT0 - m_meanT0 * m_meanT0));
1413 B2DEBUG(29, it << " " << effiSum << " " << m_meanT0 << " " << stdvT0);
1414 if (fabs(m_meanT0 - oldMeanT0) < epsi) break;
1415 oldMeanT0 = m_meanT0;
1416 minT0 = m_meanT0 - nStdv * stdvT0;
1417 maxT0 = m_meanT0 + nStdv * stdvT0;
1418 } else {
1419 B2FATAL("Wire efficiency sum <= 0!");
1420 }
1421 }
1422 if (it1 == maxIt - 1) B2WARNING("Max. iterations(=" << maxIt << ") needed to calculate the mean t0. Strange.");
1423}
bool isDeadWire(const WireID &wid, double &eff)
Inquire if the wire is dead.
unsigned m_nWires[c_maxNSenseLayers]
The array to store the wire number in each sense wire layre.
bool isHotWire(const WireID &wid)
Inquire if the wire is hot.
double m_meanT0
mean t0 over all wires; should be double.
float m_t0[c_maxNSenseLayers][c_maxNDriftCells]
t0 for each sense-wire (in nsec).
bool isBadWire(const WireID &wid)
Inquire if the wire is totally-dead.
ushort m_firstLayerOffset
Offset of the first layer (for reduced CDC studies)
Class to identify a wire inside the CDC.
Definition: WireID.h:34
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ cellId()

unsigned cellId ( unsigned  layerId,
const B2Vector3D position 
) const

The method to get cell id based on given layer id and the position.

Parameters
layerIdThe given layer id.
positionThe given position to calculate cell id.
Returns
Cell id.

Definition at line 1831 of file CDCGeometryPar.cc.

1832{
1833 if (layerId < m_firstLayerOffset) {
1834 return 0;
1835 }
1836
1837 const unsigned nWires = m_nWires[layerId];
1838
1839 double offset = m_offSet[layerId];
1840 //...Offset modification to be aligned to axial at z=0...
1841 const double phiSize = 2 * M_PI / double(nWires);
1842 /*{
1843 const double phiF = phiSize * offset
1844 + phiSize * 0.5 * double(m_nShifts[layerId]);
1845 const double phiB = phiSize * offset;
1846 const B2Vector3D f(m_rSLayer[layerId] * cos(phiF), m_rSLayer[layerId] * sin(phiF), m_zSForwardLayer[layerId]);
1847 const B2Vector3D b(m_rSLayer[layerId] * cos(phiB), m_rSLayer[layerId] * sin(phiB), m_zSBackwardLayer[layerId]);
1848
1849 const B2Vector3D v = f - b;
1850 const B2Vector3D u = v.Unit();
1851 const double beta = (0 - b.Z()) / u.Z();
1852 const B2Vector3D p = b + beta * u;
1853 double phi0 = - atan2(p.Y(), p.X());
1854 offset += phi0 / (2 * M_PI / double(nWires));
1855 }*/
1856
1857 unsigned j = 0;
1858 for (unsigned i = 0; i < 1; ++i) {
1859 const double phiF = phiSize * (double(i) + offset)
1860 + phiSize * 0.5 * double(m_nShifts[layerId]) + m_globalPhiRotation;
1861 const double phiB = phiSize * (double(i) + offset) + m_globalPhiRotation;
1862 const B2Vector3D f(m_rSLayer[layerId] * cos(phiF), m_rSLayer[layerId] * sin(phiF), m_zSForwardLayer[layerId]);
1863 const B2Vector3D b(m_rSLayer[layerId] * cos(phiB), m_rSLayer[layerId] * sin(phiB), m_zSBackwardLayer[layerId]);
1864 const B2Vector3D v = f - b;
1865 const B2Vector3D u = v.Unit();
1866 const double beta = (position.Z() - b.Z()) / u.Z();
1867 const B2Vector3D p = b + beta * u;
1868 double dPhi = std::atan2(position.Y(), position.X())
1869 - std::atan2(p.Y(), p.X())
1870 + phiSize / 2.;
1871 while (dPhi < 0) dPhi += (2. * M_PI);
1872 j = int(dPhi / phiSize);
1873 while (j >= nWires) j -= nWires;
1874 }
1875
1876 return j;
1877}
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
B2Vector3< DataType > Unit() const
Unit vector parallel to this.
Definition: B2Vector3.h:269
double m_globalPhiRotation
Global ratation in phi (rad.); only for sense wires now.
int m_nShifts[c_maxNSenseLayers]
The array to store shifted cell number in each sense wire layer.
double offset(int layerID) const
Return wire offset in phi direction at endplate.
double m_zSForwardLayer[c_maxNSenseLayers]
The array to store forward z position of sense wire layers.
double m_rSLayer[c_maxNSenseLayers]
The array to store radius of sense wire layers.
double m_offSet[c_maxNSenseLayers]
The array to store z offset of sense wire layers.
double m_zSBackwardLayer[c_maxNSenseLayers]
The array to store backward z position of sense wire layers.

◆ clear()

void clear ( )

Clears.

Definition at line 160 of file CDCGeometryPar.cc.

161{
162 m_version = "unknown";
163 m_nSLayer = 0;
164 m_nFLayer = 0;
166 m_senseWireTension = 0.0;
167 m_senseWireDensity = 0.0;
169
170 m_tdcOffset = 0; //not used; to be removed later
171 m_clockFreq4TDC = 0.0;
172 m_tdcBinWidth = 0.0;
173 m_nominalDriftV = 0.0;
174 m_nominalPropSpeed = 0.0;
176
177 for (unsigned i = 0; i < 4; ++i) {
178 m_rWall[i] = 0;
179 for (unsigned j = 0; j < 2; ++j)
180 m_zWall[i][j] = 0;
181 }
182 for (unsigned i = 0; i < c_maxNSenseLayers; ++i) {
183 m_rSLayer[i] = 0;
184 m_zSForwardLayer[i] = 0;
185 m_dzSForwardLayer[i] = 0;
186 m_zSBackwardLayer[i] = 0;
187 m_dzSBackwardLayer[i] = 0;
188 m_cellSize[i] = 0;
189 m_nWires[i] = 0;
190 m_offSet[i] = 0;
191 m_nShifts[i] = 0;
192 m_propSpeedInv[i] = 0.;
193 }
194 for (unsigned i = 0; i < c_maxNFieldLayers; ++i) {
195 m_rFLayer[i] = 0;
196 m_zFForwardLayer[i] = 0;
197 m_zFBackwardLayer[i] = 0;
198 }
199
200 for (unsigned L = 0; L < c_maxNSenseLayers; ++L) {
201 for (unsigned C = 0; C < c_maxNDriftCells; ++C) {
202 for (unsigned i = 0; i < 3; ++i) {
203 m_FWirPos [L][C][i] = 0.;
204 m_BWirPos [L][C][i] = 0.;
205 m_FWirPosMisalign[L][C][i] = 0.;
206 m_BWirPosMisalign[L][C][i] = 0.;
207 m_FWirPosAlign [L][C][i] = 0.;
208 m_BWirPosAlign [L][C][i] = 0.;
209 }
210 for (unsigned i = 0; i < 7; ++i) {
211 m_eDepToADCParams[L][C][i] = 0.;
212 }
213 m_WireSagCoef [L][C] = 0.;
214 m_WireSagCoefMisalign[L][C] = 0.;
215 m_WireSagCoefAlign [L][C] = 0.;
216 m_t0 [L][C] = 0.;
217 }
218 }
219
220 for (unsigned L = 0; L < c_maxNSenseLayers; ++L) {
221 for (unsigned i = 0; i < 2; ++i) {
222 for (unsigned alpha = 0; alpha < c_maxNAlphaPoints; ++alpha) {
223 for (unsigned theta = 0; theta < c_maxNThetaPoints; ++theta) {
224 for (unsigned xtparam = 0; xtparam < c_nXTParams; ++xtparam) {
225 m_XT[L][i][alpha][theta][xtparam] = 0.;
226 }
227
228 for (unsigned sigmaparam = 0; sigmaparam < c_nSigmaParams; ++sigmaparam) {
229 m_Sigma[L][i][alpha][theta][sigmaparam] = 0.;
230 }
231 }
232 }
233 }
234 }
235
236 for (unsigned board = 0; board < c_nBoards; ++board) {
237 for (unsigned i = 0; i < 2; ++i) {
238 m_timeWalkCoef[board][i] = 0.;
239 }
240 for (unsigned channel = 0; channel < 48; ++channel) {
241 m_boardAndChannelToWire[board][channel] = 0.;
242 }
243 }
244
245 for (unsigned superLayer = 0; superLayer < c_nSuperLayers; ++superLayer) {
246 for (unsigned layer = 0; layer < 8; ++layer) {
247 m_shiftInSuperLayer[superLayer][layer] = 0;
248 }
249 }
250
251}
float m_BWirPosMisalign[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
double m_nominalPropSpeed
Nominal propagation speed of the sense wire (27.25 cm/nsec).
unsigned short m_boardAndChannelToWire[c_nBoards][48]
array relating board-channel-id and wire-id.
float m_WireSagCoef[c_maxNSenseLayers][c_maxNDriftCells]
Wire sag coefficient for each cell; ibid.
float m_eDepToADCParams[c_maxNSenseLayers][c_maxNDriftCells][7]
edep-to-ADC conv.
float m_FWirPosMisalign[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
double m_clockFreq4TDC
Clock frequency used for TDC (GHz).
int m_nFLayer
The number of field wire layer.
float m_XT[c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nXTParams]
XT-relation coefficients for each layer, Left/Right, entrance angle and polar angle.
signed short m_shiftInSuperLayer[c_nSuperLayers][8]
shift in phi-direction wrt the 1st layer in each super layer
std::string m_version
The version of geometry parameters.
unsigned short m_tdcOffset
Not used; to be removed later.
double m_senseWireDiameter
The diameter of sense wires.
double m_dzSBackwardLayer[c_maxNSenseLayers]
Corrections for backward z position of sense wire layers.
int m_nSLayer
The number of sense wire layer.
double m_nominalDriftV
Nominal drift velocity (4.0x10^-3 cm/nsec).
float m_FWirPos[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
float m_WireSagCoefAlign[c_maxNSenseLayers][c_maxNDriftCells]
Wire sag coefficient incl.
float m_FWirPosAlign[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
double m_dzSForwardLayer[c_maxNSenseLayers]
Corrections for forward z position of sense wire layers.
double m_zFForwardLayer[c_maxNFieldLayers]
The array to store forward z position of field wire layers.
double m_fieldWireDiameter
The diameter of field wires.
double m_zFBackwardLayer[c_maxNFieldLayers]
The array to store backward z position of field wire layers.
float m_WireSagCoefMisalign[c_maxNSenseLayers][c_maxNDriftCells]
Wire sag coefficient incl.
double m_cellSize[c_maxNSenseLayers]
The array to store cell size in each sense wire layer.
float m_BWirPosAlign[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
float m_propSpeedInv[c_maxNSenseLayers]
Inverse of propagation speed of the sense wire.
double m_zWall[4][2]
The array to store z position of inner wall and outer wall.
double m_senseWireDensity
The density of sense wires.
float m_timeWalkCoef[c_nBoards][2]
coefficients for time walk.
float m_BWirPos[c_maxNSenseLayers][c_maxNDriftCells][3]
Wire position incl.
float m_Sigma[c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nSigmaParams]
position resolution for each layer.
double m_rFLayer[c_maxNFieldLayers]
The array to store radius of field wire layers.
double m_nominalSpaceResol
Nominal spatial resolution (0.0130 cm).
double m_rWall[4]
The array to store radius of inner wall and outer wall.
double m_tdcBinWidth
TDC bin width (nsec/bin).
double m_senseWireTension
The tension of sense wires.

◆ fieldWireBZ()

double fieldWireBZ ( int  layerId) const
inline

Returns backward z position of field wire in each layer.

Parameters
layerIdThe layer id of field wires.
Returns
The backward z position of field wire in layer layerId.

Definition at line 1299 of file CDCGeometryPar.h.

1300 {
1301 return m_zFBackwardLayer[layerID];
1302 }

◆ fieldWireDiameter()

double fieldWireDiameter ( ) const
inline

Returns diameter of the field wire.

Returns
Diameter of the field wire.

Definition at line 1349 of file CDCGeometryPar.h.

1350 {
1351 return m_fieldWireDiameter;
1352 }

◆ fieldWireFZ()

double fieldWireFZ ( int  layerId) const
inline

Returns forward z position of field wire in each layer.

Parameters
layerIdThe layer id of field wires.
Returns
The forward z position of field wire in layer layerId.

Definition at line 1294 of file CDCGeometryPar.h.

1295 {
1296 return m_zFForwardLayer[layerID];
1297 }

◆ fieldWireR()

double fieldWireR ( int  layerId) const
inline

Returns radius of field wire in each layer.

Parameters
layerIdThe layer id of field wires.
Returns
The radius of field wire in layer layerId.

Definition at line 1289 of file CDCGeometryPar.h.

1290 {
1291 return m_rFLayer[layerID];
1292 }

◆ generateXML()

void generateXML ( const std::string &  of)

Generate an xml file used in gearbox.

Parameters
ofThe file name.

Definition at line 1879 of file CDCGeometryPar.cc.

1880{
1881 //...Open xml file...
1882 std::ofstream ofs(of.c_str(), std::ios::out);
1883 if (! ofs) {
1884 B2ERROR("CDCGeometryPar::read !!! can not open file : "
1885 << of);
1886 }
1887 ofs << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
1888 << endl
1889 << "<Subdetector type=\"CDC\">"
1890 << endl
1891 << " <Name>CDC BelleII </Name>"
1892 << endl
1893 << " <Description>CDC geometry parameters</Description>"
1894 << endl
1895 << " <Version>0</Version>"
1896 << endl
1897 << " <GeoCreator>CDCBelleII</GeoCreator>"
1898 << endl
1899 << " <Content>"
1900 << endl
1901 << " <Rotation desc=\"Rotation of the whole cdc detector (should be the same as beampipe)\" unit=\"mrad\">0.0</Rotation>"
1902 << endl
1903 << " <OffsetZ desc=\"The offset of the whole cdc in z with respect to the IP (should be the same as beampipe)\" unit=\"mm\">0.0</OffsetZ>"
1904 << endl
1905 << " <Material>CDCGas</Material>"
1906 << endl
1907 << endl;
1908
1909 ofs << " <SLayers>" << endl;
1910
1911 for (int i = 0; i < m_nSLayer; i++) {
1912 ofs << " <SLayer id=\"" << i << "\">" << endl;
1913 ofs << " <Radius desc=\"Radius of wires in this layer\" unit=\"mm\">" << senseWireR(i) << "</Radius>" << endl;
1914 ofs << " <BackwardZ desc=\"z position of this wire layer at backward endplate\" unit=\"mm\">" << senseWireBZ(
1915 i) << "</BackwardZ>" << endl;
1916 ofs << " <ForwardZ desc=\"z position of this wire layer at forward endplate\" unit=\"mm\">" << senseWireFZ(
1917 i) << "</ForwardZ>" << endl;
1918// ofs << " <BackwardPhi desc=\"azimuth angle of the first wire in this layer at backward endplate\" unit=\"rad\">" << wireBackwardPosition(i).phi() << "</BackwardPhi>" << endl;
1919// ofs << " <ForwardPhi desc=\"azimuth angle of the first wire in this layer at forward endplate\" unit=\"rad\">" << wireForwardPosition(i).phi() << "</ForwardPhi>" << endl;
1920 ofs << " <NHoles desc=\"the number of holes in this layer, 2*(cell number)\">" << nWiresInLayer(
1921 i) * 2 << "</NHoles>" << endl;
1922 ofs << " <NShift desc=\"the shifted hole number of each wire in this layer\">" << nShifts(i) << "</NShift>" << endl;
1923 ofs << " <Offset desc=\"wire offset in phi direction at endplate\">" << m_offSet[i] << "</Offset>" << endl;
1924 ofs << " </SLayer>" << endl;
1925 }
1926
1927 ofs << " </SLayers>" << endl;
1928 ofs << " <FLayers>" << endl;
1929
1930 for (int i = 0; i < m_nFLayer; i++) {
1931 ofs << " <FLayer id=\"" << i << "\">" << endl;
1932 ofs << " <Radius desc=\"Radius of field wires in this layer\" unit=\"mm\">" << fieldWireR(i) << "</Radius>" << endl;
1933 ofs << " <BackwardZ desc=\"z position of this field wire layer at backward endplate\" unit=\"mm\">" << fieldWireBZ(
1934 i) << "</BackwardZ>" << endl;
1935 ofs << " <ForwardZ desc=\"z position of this field wire layer at forward endplate\" unit=\"mm\">" << fieldWireFZ(
1936 i) << "</ForwardZ>" << endl;
1937 ofs << " </FLayer>" << endl;
1938 }
1939
1940 ofs << " </FLayers>" << endl;
1941
1942 ofs << " <InnerWall name=\"InnerWall\">" << endl;
1943 ofs << " <InnerR desc=\"Inner radius\" unit=\"mm\">" << innerRadiusInnerWall() << "</InnerR>" << endl;
1944 ofs << " <OuterR desc=\"Outer radius\" unit=\"mm\">" << outerRadiusInnerWall() << "</OuterR>" << endl;
1945 ofs << " <BackwardZ desc=\"z position at backward endplate\" unit=\"mm\">" << m_zWall[0][0] << "</BackwardZ>" << endl;
1946 ofs << " <ForwardZ desc=\"z position at forward endplate\" unit=\"mm\">" << m_zWall[0][1] << "</ForwardZ>" << endl;
1947 ofs << " </InnerWall>" << endl;
1948
1949 ofs << " <OuterWall name=\"OuterWall\">" << endl;
1950 ofs << " <InnerR desc=\"Inner radius\" unit=\"mm\">" << innerRadiusOuterWall() << "</InnerR>" << endl;
1951 ofs << " <OuterR desc=\"Outer radius\" unit=\"mm\">" << outerRadiusOuterWall() << "</OuterR>" << endl;
1952 ofs << " <BackwardZ desc=\"z position at backward endplate\" unit=\"mm\">" << m_zWall[2][0] << "</BackwardZ>" << endl;
1953 ofs << " <ForwardZ desc=\"z position at forward endplate\" unit=\"mm\">" << m_zWall[2][1] << "</ForwardZ>" << endl;
1954 ofs << " </OuterWall>" << endl;
1955
1956 ofs << " </Content>" << endl
1957 << "</Subdetector>" << endl;
1958}
double outerRadiusInnerWall() const
Returns the outer radius of the inner wall.
double innerRadiusOuterWall() const
Returns the inner radius of the outer wall.
int nShifts(int layerId) const
Returns number shift.
double fieldWireR(int layerId) const
Returns radius of field wire in each layer.
double senseWireBZ(int layerId) const
Returns backward z position of sense wire in each layer.
unsigned nWiresInLayer(int layerId) const
Returns wire numbers in a layer.
double fieldWireBZ(int layerId) const
Returns backward z position of field wire in each layer.
double senseWireFZ(int layerId) const
Returns forward z position of sense wire in each layer.
double innerRadiusInnerWall() const
Returns the inner radius of the inner wall.
double fieldWireFZ(int layerId) const
Returns forward z position of field wire in each layer.
double outerRadiusOuterWall() const
Returns the outer radius of the outer wall.
double senseWireR(int layerId) const
Returns radius of sense wire in each layer.

◆ getAlpha()

double getAlpha ( const B2Vector3D posOnWire,
const B2Vector3D momentum 
) const

Returns track incident angle in rphi plane (alpha in rad.).

Parameters
posOnWirePosition on the wire at the closest point.
momentumTrack momentum at the closest point.

Definition at line 2795 of file CDCGeometryPar.cc.

2796{
2797 const double wx = posOnWire.X();
2798 const double wy = posOnWire.Y();
2799 const double px = momentum.X();
2800 const double py = momentum.Y();
2801
2802 const double cross = wx * py - wy * px;
2803 const double dot = wx * px + wy * py;
2804
2805 return atan2(cross, dot);
2806}
T dot(GeneralVector< T > a, GeneralVector< T > b)
dot product of two general vectors
Definition: beamHelpers.h:163

◆ getBoardID()

unsigned short getBoardID ( const WireID wID) const
inline

Returns frontend board id. corresponding to the wire id.

Parameters
wIDwire id.
Returns
board id.

Definition at line 570 of file CDCGeometryPar.h.

571 {
572 std::map<WireID, unsigned short>::const_iterator it = m_wireToBoard.find(wID);
573 unsigned short iret = (it != m_wireToBoard.end()) ? it->second : -999;
574 return iret;
575 }
std::map< WireID, unsigned short > m_wireToBoard
map relating wire-id and board-id.

◆ getBwdDeltaZ()

double getBwdDeltaZ ( unsigned short  layerID) const
inline

Return backward 'deltaZ'.

Parameters
[in]layerID(0-55)

Definition at line 794 of file CDCGeometryPar.h.

795 {
796 return m_dzSBackwardLayer[layerID];
797 }

◆ getChannelID()

unsigned short getChannelID ( const WireID wID) const
inline

Returns frontend channel id. corresponding to the wire id.

Parameters
wIDwire id.
Returns
channel id. (0-47)

Definition at line 582 of file CDCGeometryPar.h.

583 {
584 std::map<WireID, unsigned short>::const_iterator it = m_wireToChannel.find(wID);
585 unsigned short iret = (it != m_wireToChannel.end()) ? it->second : -999;
586 return iret;
587 }
std::map< WireID, unsigned short > m_wireToChannel
map relating wire-id and channel-id.

◆ getClosestAlphaPoints()

void getClosestAlphaPoints ( const double  alpha,
double &  wal,
unsigned short  points[2],
unsigned short  lrs[2] 
) const

Returns the two closest alpha points for the input track incident angle (alpha).

Definition at line 2842 of file CDCGeometryPar.cc.

2844{
2845 double alphao = getOutgoingAlpha(alpha);
2846 weight = 1.;
2847
2848 if (alphao < m_alphaPoints[0]) {
2849 points[0] = m_nAlphaPoints - 1;
2850 points[1] = 0;
2851 if (m_nAlphaPoints > 1) {
2852 lrs[0] = abs(lrs[0] - 1); //flip lr
2853 weight = (alphao - (m_alphaPoints[points[0]] - M_PI)) / (m_alphaPoints[points[1]] - (m_alphaPoints[points[0]] - M_PI));
2854 }
2855 } else if (m_alphaPoints[m_nAlphaPoints - 1] <= alphao) {
2856 points[0] = m_nAlphaPoints - 1;
2857 points[1] = 0;
2858 if (m_nAlphaPoints > 1) {
2859 lrs[1] = abs(lrs[1] - 1); //flip lr
2860 weight = (alphao - m_alphaPoints[points[0]]) / (m_alphaPoints[points[1]] + M_PI - m_alphaPoints[points[0]]);
2861 }
2862 } else {
2863 const float* upper = std::upper_bound(m_alphaPoints,
2864 m_alphaPoints + m_nAlphaPoints, alphao);
2865 points[1] = upper - m_alphaPoints;
2866 points[0] = points[1] - 1;
2867 weight = (alphao - m_alphaPoints[points[0]]) / (m_alphaPoints[points[1]] - m_alphaPoints[points[0]]);
2868 }
2869}
float m_alphaPoints[c_maxNAlphaPoints]
alpha sampling points for xt (rad)
double getOutgoingAlpha(const double alpha) const
Converts incoming- to outgoing-alpha.
unsigned short m_nAlphaPoints
No.

◆ getClosestAlphaPoints4Sgm()

void getClosestAlphaPoints4Sgm ( const double  alpha,
double &  wal,
unsigned short  points[2],
unsigned short  lrs[2] 
) const

Returns the two closest alpha points for sigma for the input track incident angle (alpha).

TODO: unify the two getClosestAlphaPoints().

Definition at line 2872 of file CDCGeometryPar.cc.

2874{
2875 double alphao = getOutgoingAlpha(alpha);
2876 weight = 1.;
2877
2878 if (alphao < m_alphaPoints4Sgm[0]) {
2879 points[0] = m_nAlphaPoints4Sgm - 1;
2880 points[1] = 0;
2881 if (m_nAlphaPoints4Sgm > 1) {
2882 lrs[0] = abs(lrs[0] - 1); //flip lr
2883 weight = (alphao - (m_alphaPoints4Sgm[points[0]] - M_PI)) / (m_alphaPoints4Sgm[points[1]] - (m_alphaPoints4Sgm[points[0]] - M_PI));
2884 }
2885 } else if (m_alphaPoints4Sgm[m_nAlphaPoints4Sgm - 1] <= alphao) {
2886 points[0] = m_nAlphaPoints4Sgm - 1;
2887 points[1] = 0;
2888 if (m_nAlphaPoints4Sgm > 1) {
2889 lrs[1] = abs(lrs[1] - 1); //flip lr
2890 weight = (alphao - m_alphaPoints4Sgm[points[0]]) / (m_alphaPoints4Sgm[points[1]] + M_PI - m_alphaPoints4Sgm[points[0]]);
2891 }
2892 } else {
2893 const float* upper = std::upper_bound(m_alphaPoints4Sgm,
2895 points[1] = upper - m_alphaPoints4Sgm;
2896 points[0] = points[1] - 1;
2897 weight = (alphao - m_alphaPoints4Sgm[points[0]]) / (m_alphaPoints4Sgm[points[1]] - m_alphaPoints4Sgm[points[0]]);
2898 }
2899}
unsigned short m_nAlphaPoints4Sgm
No.
float m_alphaPoints4Sgm[c_maxNAlphaPoints]
alpha sampling points for sigma (rad)

◆ getClosestThetaPoints()

void getClosestThetaPoints ( const double  alpha,
const double  theta,
double &  wth,
unsigned short  points[2] 
) const

Returns the two closest theta points for the input track incident angle (theta).

Definition at line 2902 of file CDCGeometryPar.cc.

2903{
2904 const double thetao = getOutgoingTheta(alpha, theta);
2905
2906 if (thetao < m_thetaPoints[0]) {
2907 // points[0] = 0;
2908 // points[1] = 1;
2909 points[0] = 0;
2910 points[1] = 0;
2911 weight = 1.;
2912 } else if (m_thetaPoints[m_nThetaPoints - 1] <= thetao) {
2913 // points[0] = m_nThetaPoints - 2;
2914 // points[1] = m_nThetaPoints - 1;
2915 points[0] = m_nThetaPoints - 1;
2916 points[1] = m_nThetaPoints - 1;
2917 weight = 1.;
2918 } else {
2919 const float* upper = std::upper_bound(m_thetaPoints,
2920 m_thetaPoints + m_nThetaPoints, thetao);
2921 points[1] = upper - m_thetaPoints;
2922 points[0] = points[1] - 1;
2923 weight = (thetao - m_thetaPoints[points[0]]) / (m_thetaPoints[points[1]] - m_thetaPoints[points[0]]);
2924 }
2925}
float m_thetaPoints[c_maxNThetaPoints]
theta sampling points for xt (rad)
double getOutgoingTheta(const double alpha, const double theta) const
Converts incoming- to outgoing-theta.
unsigned short m_nThetaPoints
No.

◆ getClosestThetaPoints4Sgm()

void getClosestThetaPoints4Sgm ( const double  alpha,
const double  theta,
double &  wth,
unsigned short  points[2] 
) const

Returns the two closest theta points for sigma for the input track incident angle (theta).

Definition at line 2928 of file CDCGeometryPar.cc.

2930{
2931 const double thetao = getOutgoingTheta(alpha, theta);
2932
2933 if (thetao < m_thetaPoints4Sgm[0]) {
2934 points[0] = 0;
2935 points[1] = 0;
2936 weight = 1.;
2937 } else if (m_thetaPoints4Sgm[m_nThetaPoints4Sgm - 1] <= thetao) {
2938 points[0] = m_nThetaPoints4Sgm - 1;
2939 points[1] = m_nThetaPoints4Sgm - 1;
2940 weight = 1.;
2941 } else {
2942 const float* upper = std::upper_bound(m_thetaPoints4Sgm,
2944 points[1] = upper - m_thetaPoints4Sgm;
2945 points[0] = points[1] - 1;
2946 weight = (thetao - m_thetaPoints4Sgm[points[0]]) / (m_thetaPoints4Sgm[points[1]] - m_thetaPoints4Sgm[points[0]]);
2947 }
2948}
unsigned short m_nThetaPoints4Sgm
No.
float m_thetaPoints4Sgm[c_maxNThetaPoints]
theta sampling points for sigma (rad)

◆ getDriftLength()

double getDriftLength ( double  dt,
unsigned short  layer,
unsigned short  lr,
double  alpha = 0.,
double  theta = 0.5 * M_PI,
bool  calculateMinTime = true,
double  minTime = 0. 
) const

Return the drift dength to the sense wire.

Parameters
[in]dtDrift time (ns).
[in]layerLayer ID.
[in]lrLeft/Right
[in]alphaincident angle (in rphi plane) w.r.t. the cell (rad).
[in]thetaincident angle (polar angle) (rad).
calculateMinTimecalculate min. drift time inside this function (=true) or feed as input (=false).
minTimeinput min. drift time when calculateMinTime=false.

Definition at line 2286 of file CDCGeometryPar.cc.

2290{
2291 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2292 return 0.;
2293 }
2294
2295 double dist = 0.;
2296
2297 //calculate min. drift time
2298 double minTime = calculateMinTime ? getMinDriftTime(iCLayer, lr, alpha, theta) : inputMinTime;
2299 double delta = time - minTime;
2300
2301 //convert incoming- to outgoing-lr
2302 unsigned short lro = getOutgoingLR(lr, alpha);
2303
2304 // std::cout << m_linearInterpolationOfXT << std::endl;
2305 // exit(-1);
2307 B2FATAL("linearInterpolationOfXT = false is not allowed now !");
2308 } else {
2309 double wal(0.);
2310 unsigned short ial[2] = {0};
2311 unsigned short ilr[2] = {lro, lro};
2312 getClosestAlphaPoints(alpha, wal, ial, ilr);
2313 double wth(0.);
2314 unsigned short ith[2] = {0};
2315 getClosestThetaPoints(alpha, theta, wth, ith);
2316
2317 unsigned short jal(0), jlr(0), jth(0);
2318 double w = 0.;
2319
2320 //use xt reversed at (x=0,t=tmin) for delta<0 ("negative drifttime")
2321 double timep = delta < 0. ? minTime - delta : time;
2322
2323 // std::cout << "iCLayer,alpha,theta,lro= " << iCLayer <<" "<< (180./M_PI)*alpha <<" "<< (180./M_PI)*theta <<" "<< lro << std::endl;
2324
2325 //compute linear interpolation (=weithed average over 4 points) in (alpha-theta) space
2326 for (unsigned k = 0; k < 4; ++k) {
2327 if (k == 0) {
2328 jal = ial[0];
2329 jlr = ilr[0];
2330 jth = ith[0];
2331 w = (1. - wal) * (1. - wth);
2332 } else if (k == 1) {
2333 jal = ial[0];
2334 jlr = ilr[0];
2335 jth = ith[1];
2336 w = (1. - wal) * wth;
2337 } else if (k == 2) {
2338 jal = ial[1];
2339 jlr = ilr[1];
2340 jth = ith[0];
2341 w = wal * (1. - wth);
2342 } else if (k == 3) {
2343 jal = ial[1];
2344 jlr = ilr[1];
2345 jth = ith[1];
2346 w = wal * wth;
2347 }
2348
2349 // std::cout << "k,w= " << k <<" "<< w << std::endl;
2350 // std::cout << "ial[0],[1],jal,wal= " << ial[0] <<" "<< ial[1] <<" "<< jal <<" "<< wal << std::endl;
2351 // std::cout << "ith[0],[1],jth,wth= " << ith[0] <<" "<< ith[1] <<" "<< jth <<" "<< wth << std::endl;
2352
2353 /*
2354 std::cout <<"iCLayer= " << iCLayer << std::endl;
2355 std::cout <<"lr= " << lr << std::endl;
2356 std::cout <<"jal,jth= " << jal <<" "<< jth << std::endl;
2357 std::cout <<"wal,wth= " << wal <<" "<< wth << std::endl;
2358 for (int i=0; i<9; ++i) {
2359 std::cout <<"a= "<< i <<" "<< m_XT[iCLayer][lro][jal][jth][i] << std::endl;
2360 }
2361 */
2362 double boundary = m_XT[iCLayer][jlr][jal][jth][6];
2363
2364 if (timep < boundary) {
2365 if (m_xtParamMode == 1) {
2366 dist += w * ROOT::Math::Chebyshev5(timep, m_XT[iCLayer][jlr][jal][jth][0], m_XT[iCLayer][jlr][jal][jth][1],
2367 m_XT[iCLayer][jlr][jal][jth][2], m_XT[iCLayer][jlr][jal][jth][3], m_XT[iCLayer][jlr][jal][jth][4], m_XT[iCLayer][jlr][jal][jth][5]);
2368 } else {
2369 dist += w * (m_XT[iCLayer][jlr][jal][jth][0] + timep
2370 * (m_XT[iCLayer][jlr][jal][jth][1] + timep
2371 * (m_XT[iCLayer][jlr][jal][jth][2] + timep
2372 * (m_XT[iCLayer][jlr][jal][jth][3] + timep
2373 * (m_XT[iCLayer][jlr][jal][jth][4] + timep
2374 * (m_XT[iCLayer][jlr][jal][jth][5]))))));
2375 }
2376 } else {
2377 dist += w * (m_XT[iCLayer][jlr][jal][jth][7] * (timep - boundary) + m_XT[iCLayer][jlr][jal][jth][8]);
2378 }
2379 // std::cout <<"k,w,dist= " << k <<" "<< w <<" "<< dist << std::endl;
2380 } //end of weighted mean loop
2381 }
2382
2383 dist = fabs(dist);
2384 if (delta < 0.) dist *= -1.;
2385 return dist;
2386
2387}
void getClosestAlphaPoints(const double alpha, double &wal, unsigned short points[2], unsigned short lrs[2]) const
Returns the two closest alpha points for the input track incident angle (alpha).
bool m_linearInterpolationOfXT
Switch for linear interpolation of xt.
unsigned short getOutgoingLR(const unsigned short lr, const double alpha) const
Converts incoming-lr to outgoing-lr.
double getMinDriftTime(unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI) const
Return the min.
void getClosestThetaPoints(const double alpha, const double theta, double &wth, unsigned short points[2]) const
Returns the two closest theta points for the input track incident angle (theta).
int m_xtParamMode
Mode for xt parameterization.

◆ getDriftLength0()

double getDriftLength0 ( double  dt,
unsigned short  layer,
unsigned short  lr,
double  alpha = 0.,
double  theta = 0.5 * M_PI 
) const

Return the drift dength to the sense wire; tentative ver.

Parameters
[in]dtDrift time (ns).
[in]layerLayer ID.
[in]lrLeft/Right
[in]alphaincident angle (in rphi plane) w.r.t. the cell (rad).
[in]thetaincident angle (polar angle) (rad).

Definition at line 2204 of file CDCGeometryPar.cc.

2206{
2207 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2208 return 0.;
2209 }
2210
2211 double dist = 0.;
2212
2213 //convert incoming- to outgoing-lr
2214 unsigned short lro = getOutgoingLR(lr, alpha);
2215
2216 // std::cout << m_linearInterpolationOfXT << std::endl;
2217 // exit(-1);
2219 B2FATAL("linearInterpolationOfXT = false is not allowed now !");
2220 } else {
2221 double wal(0.);
2222 unsigned short ial[2] = {0};
2223 unsigned short ilr[2] = {lro, lro};
2224 getClosestAlphaPoints(alpha, wal, ial, ilr);
2225 double wth(0.);
2226 unsigned short ith[2] = {0};
2227 getClosestThetaPoints(alpha, theta, wth, ith);
2228
2229 unsigned short jal(0), jlr(0), jth(0);
2230 double w = 0.;
2231
2232 //use xt reversed at (x=0,t=tmin) for delta<0 ("negative drifttime")
2233 double timep = time;
2234 // std::cout << "iCLayer,alpha,theta,lro= " << iCLayer <<" "<< (180./M_PI)*alpha <<" "<< (180./M_PI)*theta <<" "<< lro << std::endl;
2235
2236 //compute linear interpolation (=weithed average over 4 points) in (alpha-theta) space
2237 for (unsigned k = 0; k < 4; ++k) {
2238 if (k == 0) {
2239 jal = ial[0];
2240 jlr = ilr[0];
2241 jth = ith[0];
2242 w = (1. - wal) * (1. - wth);
2243 } else if (k == 1) {
2244 jal = ial[0];
2245 jlr = ilr[0];
2246 jth = ith[1];
2247 w = (1. - wal) * wth;
2248 } else if (k == 2) {
2249 jal = ial[1];
2250 jlr = ilr[1];
2251 jth = ith[0];
2252 w = wal * (1. - wth);
2253 } else if (k == 3) {
2254 jal = ial[1];
2255 jlr = ilr[1];
2256 jth = ith[1];
2257 w = wal * wth;
2258 }
2259
2260 double boundary = m_XT[iCLayer][jlr][jal][jth][6];
2261
2262 if (timep < boundary) {
2263 if (m_xtParamMode == 1) {
2264 dist += w * ROOT::Math::Chebyshev5(timep, m_XT[iCLayer][jlr][jal][jth][0], m_XT[iCLayer][jlr][jal][jth][1],
2265 m_XT[iCLayer][jlr][jal][jth][2], m_XT[iCLayer][jlr][jal][jth][3], m_XT[iCLayer][jlr][jal][jth][4], m_XT[iCLayer][jlr][jal][jth][5]);
2266 } else {
2267 dist += w * (m_XT[iCLayer][jlr][jal][jth][0] + timep
2268 * (m_XT[iCLayer][jlr][jal][jth][1] + timep
2269 * (m_XT[iCLayer][jlr][jal][jth][2] + timep
2270 * (m_XT[iCLayer][jlr][jal][jth][3] + timep
2271 * (m_XT[iCLayer][jlr][jal][jth][4] + timep
2272 * (m_XT[iCLayer][jlr][jal][jth][5]))))));
2273 }
2274 } else {
2275 dist += w * (m_XT[iCLayer][jlr][jal][jth][7] * (timep - boundary) + m_XT[iCLayer][jlr][jal][jth][8]);
2276 }
2277 // std::cout <<"k,w,dist= " << k <<" "<< w <<" "<< dist << std::endl;
2278 } //end of weighted mean loop
2279 }
2280
2281 // dist = fabs(dist);
2282 return dist;
2283
2284}

◆ getDriftTime()

double getDriftTime ( double  dist,
unsigned short  layer,
unsigned short  lr,
double  alpha,
double  theta 
) const

Return the drift time to the sense wire.

Parameters
distDrift length (cm).
layerLayer ID.
lrLeft/Right
alphaincident angle (in rphi plane) w.r.t. the cell (rad).
thetaincident angle (polar angle) (rad).

Definition at line 2583 of file CDCGeometryPar.cc.

2585{
2586 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2587 return 0.;
2588 }
2589
2590 //to be replaced with a smarter algorithm...
2591
2592 const double eps = 2.5e-1;
2593 const double maxTrials = 100;
2594
2595 // int ialpha = getAlphaBin(alpha);
2596 // int itheta = getThetaBin(theta);
2597
2598 //convert incoming- to outgoing-lr
2599 // unsigned short lrp = getOutgoingLR(lr, alpha);
2600
2601 double maxTime = 2000.; //in ns (n.b. further reduction, 2->1us could be ok)
2602 // if (m_XT[iCLayer][lrp][ialpha][itheta][7] == 0.) {
2603 // maxTime = m_XT[iCLayer][lrp][ialpha][itheta][6];
2604 // }
2605
2606 double minTime = getMinDriftTime(iCLayer, lr, alpha, theta);
2607 double t0 = minTime;
2608 // std::cout << "minTime,x= " << t0 <<" "<< getDriftLength(t0, iCLayer, lr, alpha, theta) << std::endl;
2609 const bool calMinTime = false;
2610 // double d0 = getDriftLength(t0, iCLayer, lr, alpha, theta, calMinTime, minTime) - dist;
2611 double d0 = - dist;
2612
2613 unsigned i = 0;
2614 double t1 = maxTime;
2615 double time = dist * m_nominalDriftVInv;
2616 while (((t1 - t0) > eps) && (i < maxTrials)) {
2617 time = 0.5 * (t0 + t1);
2618 double d1 = getDriftLength(time, iCLayer, lr, alpha, theta, calMinTime, minTime) - dist;
2619 // std::cout <<"i,dist,t0,t1,d0,d1= " << i <<" "<< dist <<" "<< t0 <<" "<< t1 <<" "<< d0 <<" "<< d1 << std::endl;
2620 if (d0 * d1 > 0.) {
2621 t0 = time;
2622 } else {
2623 t1 = time;
2624 }
2625 ++i;
2626 }
2627
2628 if (i >= maxTrials - 1 || time > maxTime) {
2629 B2WARNING("CDCGeometryPar::getDriftTime " << dist << " " << iCLayer << " " << alpha << " " << lr << " " << t0 << " " << t1 << " " <<
2630 time << " " << d0);
2631 }
2632
2633 // std::cout <<"dist0,dist1= " << dist <<" "<< getDriftLength(time, iCLayer, lr, alpha, theta) <<" "<< getDriftLength(time, iCLayer, lr, alpha, theta) - dist << std::endl;
2634 // std::cout <<"dist0,dist1= " << dist <<" "<< getDriftLength(time, iCLayer, lr, 0., theta) <<" "<< getDriftLength(time, iCLayer, lr, 0., theta) - dist << std::endl;
2635 return time;
2636
2637}
double m_nominalDriftVInv
Inverse of the nominal drift velocity.
double getDriftLength(double dt, unsigned short layer, unsigned short lr, double alpha=0., double theta=0.5 *M_PI, bool calculateMinTime=true, double minTime=0.) const
Return the drift dength to the sense wire.

◆ getDriftV()

double getDriftV ( double  dt,
unsigned short  layer,
unsigned short  lr,
double  alpha = 0.,
double  theta = 0.5 * M_PI 
) const

Get the realistic drift velocity.

Parameters
[in]dtDrift time (ns).
[in]layerLayer ID.
[in]lrLeft/Right
[in]alphaincident angle (in rphi plane) w.r.t. the cell (rad).
[in]thetaincident angle (polar angle) (rad).

Definition at line 2116 of file CDCGeometryPar.cc.

2118{
2119 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2120 return 0.;
2121 }
2122
2123 double dDdt = 0.;
2124
2125 //calculate min. drift time
2126 double minTime = getMinDriftTime(iCLayer, lr, alpha, theta);
2127 double delta = time - minTime;
2128
2129 //convert incoming- to outgoing-lr
2130 unsigned short lro = getOutgoingLR(lr, alpha);
2131
2133 B2FATAL("linearInterpolationOfXT = false is not allowed now !");
2134 } else {
2135 double wal(0.);
2136 unsigned short ial[2] = {0};
2137 unsigned short ilr[2] = {lro, lro};
2138 getClosestAlphaPoints(alpha, wal, ial, ilr);
2139 double wth(0.);
2140 unsigned short ith[2] = {0};
2141 getClosestThetaPoints(alpha, theta, wth, ith);
2142
2143 unsigned short jal(0), jlr(0), jth(0);
2144 double w = 0.;
2145
2146 //use xt reversed at (x=0,t=tmin) for delta<0 ("negative drifttime")
2147 double timep = delta < 0. ? minTime - delta : time;
2148
2149 //compute linear interpolation (=weithed average over 4 points) in (alpha-theta) space
2150 for (unsigned k = 0; k < 4; ++k) {
2151 if (k == 0) {
2152 jal = ial[0];
2153 jlr = ilr[0];
2154 jth = ith[0];
2155 w = (1. - wal) * (1. - wth);
2156 } else if (k == 1) {
2157 jal = ial[0];
2158 jlr = ilr[0];
2159 jth = ith[1];
2160 w = (1. - wal) * wth;
2161 } else if (k == 2) {
2162 jal = ial[1];
2163 jlr = ilr[1];
2164 jth = ith[0];
2165 w = wal * (1. - wth);
2166 } else if (k == 3) {
2167 jal = ial[1];
2168 jlr = ilr[1];
2169 jth = ith[1];
2170 w = wal * wth;
2171 }
2172
2173 double boundary = m_XT[iCLayer][jlr][jal][jth][6];
2174
2175 if (timep < boundary) {
2176 if (m_xtParamMode == 1) {
2177 const double& c1 = m_XT[iCLayer][jlr][jal][jth][1];
2178 const double& c2 = m_XT[iCLayer][jlr][jal][jth][2];
2179 const double& c3 = m_XT[iCLayer][jlr][jal][jth][3];
2180 const double& c4 = m_XT[iCLayer][jlr][jal][jth][4];
2181 const double& c5 = m_XT[iCLayer][jlr][jal][jth][5];
2182 dDdt += w * ROOT::Math::Chebyshev4(timep, c1 + 3.*c3 + 5.*c5, 4.*c2 + 8.*c4, 6.*c3 + 10.*c5, 8.*c4, 10.*c5);
2183 } else {
2184 dDdt += w * (m_XT[iCLayer][jlr][jal][jth][1] + timep
2185 * (2.*m_XT[iCLayer][jlr][jal][jth][2] + timep
2186 * (3.*m_XT[iCLayer][jlr][jal][jth][3] + timep
2187 * (4.*m_XT[iCLayer][jlr][jal][jth][4] + timep
2188 * (5.*m_XT[iCLayer][jlr][jal][jth][5])))));
2189 }
2190 } else {
2191 dDdt += w * m_XT[iCLayer][jlr][jal][jth][7];
2192 }
2193 } //end of weighted mean loop
2194 }
2195
2196 dDdt = fabs(dDdt);
2197 //n.b. following line not needed since dDdt > 0 even for delta < 0
2198 // if (delta < 0.) dDdt *= -1.;
2199 return dDdt;
2200
2201}

◆ getEDepToADCConvFactor()

double getEDepToADCConvFactor ( unsigned short  layer,
unsigned short  cell,
double  edep,
double  dx,
double  costh 
)

Return edep-to-ADC conversion factor.

Parameters
layerno. (0-55)
cellno. (0-)
edepenergy-deposit in the cell(keV).
dxpath length (cm) of the track in the cell.
costhcos(theta) of track.

Definition at line 1650 of file CDCGeometryPar.cc.

1651{
1652 // double convF = (100.0 / 3.2); //keV -> count
1653 //Model assumed here is from CLEO-c:
1654 //Igen = Imea * [1 + alf*Imea/cth] / [1 + gam*Imea/cth];
1655 //cth = |costh| + dlt;
1656 //Igen: original dE/dx; Imea: measured dE/dx with space-charge effect
1657 const double mainF = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][0];
1658 const double& alf = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][1];
1659 const double& gam = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][2];
1660 const double& dlt = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][3];
1661 const double& a = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][4];
1662 const double& b = (iCL < m_firstLayerOffset) ? 0. : m_eDepToADCParams[iCL][iW][5];
1663 const double cth = fabs(costh) + dlt;
1664 const double iGen = edep / dx; // keV/cm
1665 const double tmp = cth - gam * iGen;
1666 const double disc = tmp * tmp + 4.*alf * cth * iGen;
1667
1668 double iMea = 0.;
1669 if (alf == 0.) {
1670 iMea = cth * iGen / tmp;
1671 } else if (disc >= 0.) {
1672 iMea = (-tmp + sqrt(disc)) / (2.*alf);
1673 // if (alf < 0.) {
1674 // B2INFO("alf<0:CHECK");
1675 // B2INFO(-tmp + sqrt(disc)) / (2.*alf));
1676 // B2INFO(-tmp - sqrt(disc)) / (2.*alf));
1677 // }
1678 }
1679
1680 double convF = mainF;
1681 if (iMea > 0.) {
1682 convF = mainF * std::min(iMea / iGen, 1.);
1683 // if (iMea > iGen) B2DEBUG(29, "iMea > iGen " << iMea <<" "<< iGen);
1684 } else {
1685 //TODO: check the following issue more
1686 // B2WARNING("CDCGeometryPar: Measured dE/dx <= 0!");
1687 // B2DEBUG(29, "CDCGeometryPar: Measured dE/dx <= 0!");
1688 // B2DEBUG(29, "iGen,iMea= " << std::setw(15) << std::scientific << std::setprecision(8) << iGen <<" "<< iMea);
1689 // B2DEBUG(29, "dx,mainF,alf,gam,dlt,cth,tmp,disc= " << dx <<" "<< mainF <<" "<< alf <<" "<< gam <<" "<< dlt <<" "<<" "<< tmp <<" "<< disc);
1690 }
1691 convF *= 1. + a * (costh - b);
1692 return convF;
1693}

◆ getEDepToADCMainFactor()

double getEDepToADCMainFactor ( unsigned short  layer,
unsigned short  cell,
double  costh = 0 
)
inline

Return edep-to-ADC conversion main factor (in count/keV)

Parameters
layerno. (0-55)
cellno. (0-)
costhcosine of incident angle (theta) of particle

Definition at line 262 of file CDCGeometryPar.h.

263 {
264 return m_eDepToADCParams[layer][cell][0] + m_eDepToADCParams[layer][cell][4] * (costh - m_eDepToADCParams[layer][cell][5]);
265 };

◆ getEDepToADCSigma()

double getEDepToADCSigma ( unsigned short  layer,
unsigned short  cell 
)
inline

Return sigma for extra smearing of edep to ADC conversion.

Parameters
layerno. (0-55)
cellno. (0-)

Definition at line 271 of file CDCGeometryPar.h.

272 {
273 return m_eDepToADCParams[layer][cell][6];
274 };

◆ getFudgeFactorForSigma()

double getFudgeFactorForSigma ( unsigned short  target) const
inline

Return the fuge factor for space resol.

Parameters
targettarget sigma: =0: for sigma in data reconstruction; =1: for sigma in MC recon.; =2: for sigma in digitization in MC

Definition at line 947 of file CDCGeometryPar.h.

948 {
949 return m_fudgeFactorForSigma[target];
950 }
double m_fudgeFactorForSigma[3]
Fuge factor for space resol.

◆ getFwdDeltaZ()

double getFwdDeltaZ ( unsigned short  layerID) const
inline

Return forward 'deltaZ'.

Parameters
[in]layerID(0-55)

Definition at line 804 of file CDCGeometryPar.h.

805 {
806 return m_dzSForwardLayer[layerID];
807 }

◆ getMaterialDefinitionMode()

int getMaterialDefinitionMode ( ) const
inline

Return mode for material definition.

Return value = 0: define a mixture of gases and wires in the entire tracking volume; =1: define two different mixtures: one for the inner volume (small cell), and the other for the outer volume (normal cell).

Definition at line 771 of file CDCGeometryPar.h.

772 {
774 }
int m_materialDefinitionMode
Control switch for gas and wire material definition.

◆ getMaxNumberOfCellsPerLayer()

ushort getMaxNumberOfCellsPerLayer ( ) const
inline

Get the maximum number of cells in one layer.

Definition at line 1085 of file CDCGeometryPar.h.

1085{ return m_maxNCellsPerLayer;}
ushort m_maxNCellsPerLayer
Maximum number wires within a layer.

◆ getMaxNumberOfSuperLayers()

ushort getMaxNumberOfSuperLayers ( ) const
inline

Get the maximum number of super layers.

Definition at line 1070 of file CDCGeometryPar.h.

1070{ return m_maxNSuperLayers;}
ushort m_maxNSuperLayers
Maximum number of Super Layers.

◆ getMeanT0()

double getMeanT0 ( ) const
inline

Returns the mean t0 over all wires.

Returns
mean t0.

Definition at line 1374 of file CDCGeometryPar.h.

1375 {
1376 return m_meanT0;
1377 }

◆ getMinDriftTime()

double getMinDriftTime ( unsigned short  layer,
unsigned short  lr,
double  alpha = 0.,
double  theta = 0.5 * M_PI 
) const

Return the min.

drift time (ns).

Parameters
[in]layerLayer ID.
[in]lrLeft/Right
[in]alphaincident angle (in rphi plane) w.r.t. the cell (rad).
[in]thetaincident angle (polar angle) (rad).

Definition at line 2389 of file CDCGeometryPar.cc.

2391{
2392 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2393 return 0.;
2394 }
2395
2396 double minTime = 0.;
2397
2398 //convert incoming- to outgoing-lr
2399 unsigned short lro = getOutgoingLR(lr, alpha);
2400
2402 B2FATAL("linearInterpolationOfXT = false is not allowed now !");
2403 } else {
2404 double wal(0.);
2405 unsigned short ial[2] = {0};
2406 unsigned short ilr[2] = {lro, lro};
2407 getClosestAlphaPoints(alpha, wal, ial, ilr);
2408 double wth(0.);
2409 unsigned short ith[2] = {0};
2410 getClosestThetaPoints(alpha, theta, wth, ith);
2411
2412 unsigned short jal(0), jlr(0), jth(0);
2413 double w = 0.;
2414
2415 double c[6] = {0.}, a[6] = {0.};
2416 for (unsigned k = 0; k < 4; ++k) {
2417 if (k == 0) {
2418 jal = ial[0];
2419 jlr = ilr[0];
2420 jth = ith[0];
2421 w = (1. - wal) * (1. - wth);
2422 } else if (k == 1) {
2423 jal = ial[0];
2424 jlr = ilr[0];
2425 jth = ith[1];
2426 w = (1. - wal) * wth;
2427 } else if (k == 2) {
2428 jal = ial[1];
2429 jlr = ilr[1];
2430 jth = ith[0];
2431 w = wal * (1. - wth);
2432 } else if (k == 3) {
2433 jal = ial[1];
2434 jlr = ilr[1];
2435 jth = ith[1];
2436 w = wal * wth;
2437 }
2438
2439 for (int i = 0; i < 5; ++i) {
2440 c[i] += w * m_XT[iCLayer][jlr][jal][jth][i];
2441 }
2442 }
2443
2444 if (m_xtParamMode == 1) { //convert c to coeff for normal-poly if Chebyshev
2445 a[0] = c[0] - c[2] + c[4];
2446 a[1] = c[1] - 3.*c[3] + 5.*c[5];
2447 a[2] = 2.*c[2] - 8.*c[4];
2448 a[3] = 4.*c[3] - 20.*c[5];
2449 a[4] = 8.*c[4];
2450 a[5] = 16.*c[5];
2451 } else { //normal-poly
2452 for (int i = 0; i < 5; ++i) a[i] = c[i];
2453 }
2454
2455 //estimate an initial value
2456 // bool check = false;
2457 // bool nointersection = false;
2458 if (a[2] != 0.) { //2nd-order approx. near t=0
2459 const double det = a[1] * a[1] - 4.*a[2] * a[0];
2460 if (det >= 0.) {
2461 //Choose the solution with dx/dt > 0 which gives x=0
2462 minTime = (-a[1] + sqrt(det)) / (2.*a[2]);
2463 } else {
2464 //Choose the solution with smallest x
2465 // nointersection = true;
2466 minTime = -a[1] / (2.*a[2]);
2467 // cout <<"smallest-x solution= " << minTime << endl;
2468 }
2469 } else if (a[1] != 0.) {
2470 minTime = -a[0] / a[1]; //1st-order approx.
2471 } else {
2472 B2WARNING("CDCGeometryPar::getMinDriftTime: minDriftTime not determined; assume zero.\n" << "layer(#0-55),lr,alpha(rad),theta= " <<
2473 iCLayer << " " << lr << " " << alpha << " " << theta);
2474 return minTime;
2475 }
2476
2477 // double minTime0 = minTime;
2478 //higher-order corr. using Newton method; trial to minimize x^2
2479 double edm; // = 10.; //(cm) (SG: fix to avoid cpp-check warning)
2480 // const double epsi4t = 0.01; //(ns)
2481 // const double epsi4x = 1.e-5; //(cm)
2482 const double epsi4x = 5.e-6; //(cm)
2483 // const unsigned short maxIter = 4;
2484 const unsigned short maxIter = 8;
2485 const double maxDt = 20.; //(ns)
2486 unsigned short nIter = 0;
2487 double minXsq = 1.e10; //(cm^2)
2488 double minMinTime = minTime;
2489 // double told = minTime + 1000.*epsi4t;
2490 // while (fabs(minTime - told) > epsi && nIter <= maxIter) {
2491 for (nIter = 0; nIter <= maxIter; ++nIter) {
2492 // told = minTime;
2493 double t = minTime;
2494 double x = a[0] + t * (a[1] + t * (a[2] + t * (a[3] + t * (a[4] + t * a[5]))));
2495 double x2 = x * x;
2496 if (x2 < minXsq) {
2497 minXsq = x2;
2498 minMinTime = t;
2499 }
2500 double xp = a[1] + t * (2 * a[2] + t * (3 * a[3] + t * (4 * a[4] + t * 5 * a[5])));
2501 double xpp = 2 * a[2] + t * (6 * a[3] + t * (12 * a[4] + t * 20 * a[5]));
2502 double den = xp * xp + x * xpp;
2503 if (den <= 0.) {
2504 den = xp * xp;
2505 }
2506
2507 if (den > 0.) {
2508 //estimated distance to min.
2509 edm = fabs(x * xp) / sqrt(den); //not in distance^2 but in distance
2510 if (edm < epsi4x) break; //converged
2511 }
2512
2513 double dt = 1.; //dt for den=0 (ns)
2514 if (den != 0.) {
2515 dt = x * xp / den;
2516 if (dt >= 0.) {
2517 dt = std::min(dt, maxDt);
2518 } else {
2519 dt = std::max(dt, -maxDt);
2520 }
2521 } else {
2522 B2WARNING("CDCGeometryPar::getMinDriftTime: den = 0\n" << "layer(#0-55),lr,alpha(rad),theta= " <<
2523 iCLayer << " "
2524 << lr <<
2525 " " << alpha << " " << theta);
2526 }
2527 minTime -= dt;
2528 } //end of iteration loop
2529
2530 //choose minMinTime for not-converged case
2531 if (nIter == (maxIter + 1)) minTime = minMinTime;
2532
2533 /*
2534 if (fabs(minTime) > 20.) {
2535 B2WARNING("CDCGeometryPar::getMinDriftTime: |minDriftTime| > 20ns. Ok ?\n" << "layer(#0-55),lr,alpha(rad),theta,minTime(ns)= " <<
2536 iCLayer << " "
2537 << lr <<
2538 " " << alpha << " " << theta << " " << minTime);
2539 }
2540 if (nointersection) {
2541 cout <<"final minTime= " << minTime << endl;
2542 cout <<"final minx = " << a[0] + a[1] * minTime + a[2] *pow(minTime,2) + a[3] *pow(minTime,3) + a[4] *pow(minTime,4) + a[5] *pow(minTime,5) << endl;
2543 }
2544 */
2545 /*
2546 if (check) {
2547 double dmin = 999.;
2548 double tmin = 999.;
2549 for (int i = -10000; i < 10000; ++i) {
2550 double ti = 0.01 * i;
2551 double dl = fabs(getDriftLength0(ti, iCLayer, lr, alpha, theta));
2552 if (dl < dmin) {
2553 dmin = dl;
2554 tmin = ti;
2555 }
2556 }
2557
2558 double smartd = getDriftLength0(minTime, iCLayer, lr, alpha, theta);
2559 if (check) {
2560 // if (fabs(smartd) > dmin && minTime < tmin && fabs(minTime - tmin) > 0.1) {
2561 B2WARNING("CDCGeometryPar::getMinDriftTime \n" << "layer(#0-55),lr,alpha(rad),theta= " <<
2562 iCLayer << " "
2563 << lr <<
2564 " " << alpha << " " << theta);
2565 B2INFO("det, minTime0= " << det << " " << minTime0);
2566 B2INFO("direct search n,tmin,dmin= " << nIter << " " << tmin << " " << dmin);
2567 B2INFO(" smart search n,tmin,dmin= " << nIter << " " << minTime << " " << getDriftLength0(minTime, iCLayer, lr, alpha, theta));
2568
2569 for (int i=-200; i < 200; ++i) {
2570 double ti = 0.25*i;
2571 double dl = getDriftLength0(ti, iCLayer, lr, alpha, theta);
2572 std::cout << ti <<" "<< dl << std::endl;
2573 }
2574 exit(-1);
2575 }
2576 }
2577 */
2578 }
2579
2580 return minTime;
2581}

◆ getMinTrackLength()

double getMinTrackLength ( ) const
inline

Returns the minimum track length required in one G4 step (only secondary particles which pass this criterion are to be saved in MCParticle)

Returns
length (cm)

Definition at line 528 of file CDCGeometryPar.h.

529 {
530 return m_minTrackLength;
531 }
double m_minTrackLength
Minimum track length for G4 step.

◆ getNewLeftRightRaw()

unsigned short getNewLeftRightRaw ( const B2Vector3D posOnWire,
const B2Vector3D posOnTrack,
const B2Vector3D momentum 
) const

Returns new left/right_raw.

Parameters
posOnWirePosition on the wire at the closest point.
posOnTrackPosition on the track at the closest point.
momentumTrack 3-momentum.

Definition at line 2786 of file CDCGeometryPar.cc.

2788{
2789 const double distanceCrossP = ((posOnWire - posOnTrack).Cross(momentum)).Z();
2790 unsigned short int lr = (distanceCrossP > 0.) ? 1 : 0;
2791 return lr;
2792}

◆ getNominalDriftV()

double getNominalDriftV ( ) const
inline

Return the nominal drift velocity of He-ethane gas (default: 4.0x10^-3 cm/nsec).

Definition at line 736 of file CDCGeometryPar.h.

737 {
738 return m_nominalDriftV;
739 }

◆ getNominalPropSpeed()

double getNominalPropSpeed ( ) const
inline

Return the nominal propagation speed of the sense wire (default: 27.25 cm/nsec).

Definition at line 746 of file CDCGeometryPar.h.

747 {
748 return m_nominalPropSpeed;
749 }

◆ getNominalSpaceResol()

double getNominalSpaceResol ( ) const
inline

Return the nominal spatial resolution.

(default: 130 um defined in CDC.xml).

Definition at line 756 of file CDCGeometryPar.h.

757 {
758 return m_nominalSpaceResol;
759 }

◆ getNumberOfFieldLayers()

ushort getNumberOfFieldLayers ( ) const
inline

Get the number of field layers.

Definition at line 1065 of file CDCGeometryPar.h.

1065{ return m_maxNFieldLayers;}
ushort m_maxNFieldLayers
Maximum number of Field Wire Layers.

◆ getNumberOfFieldWires()

ushort getNumberOfFieldWires ( ) const
inline

Get the number of field wires.

Definition at line 1055 of file CDCGeometryPar.h.

1055{ return m_nFieldWires;}
ushort m_nFieldWires
Maximum number of Field Wires.

◆ getNumberOfSenseLayers()

ushort getNumberOfSenseLayers ( ) const
inline

Get the number of sense layers.

Definition at line 1060 of file CDCGeometryPar.h.

1060{ return m_maxNSenseLayers;}
ushort m_maxNSenseLayers
Maximum number of Sense Wire Layers.

◆ getNumberOfSenseWires()

ushort getNumberOfSenseWires ( ) const
inline

Get the number of sense wires.

Definition at line 1050 of file CDCGeometryPar.h.

1050{ return m_nSenseWires;}
ushort m_nSenseWires
Maximum number of Sense Wires.

◆ getOffsetOfFirstLayer()

ushort getOffsetOfFirstLayer ( ) const
inline

Get the offset of the first layer.

Definition at line 1075 of file CDCGeometryPar.h.

1075{ return m_firstLayerOffset;}

◆ getOffsetOfFirstSuperLayer()

ushort getOffsetOfFirstSuperLayer ( ) const
inline

Get the offset of the first super layer.

Definition at line 1080 of file CDCGeometryPar.h.

1080{ return m_firstSuperLayerOffset;}
ushort m_firstSuperLayerOffset
Offset of the first super layer (for reduced CDC studies)

◆ getOldLeftRight()

unsigned short getOldLeftRight ( const B2Vector3D posOnWire,
const B2Vector3D posOnTrack,
const B2Vector3D momentum 
) const

Returns old left/right.

Parameters
posOnWirePosition on the wire at the closest point.
posOnTrackPosition on the track at the closest point.
momentumTrack 3-momentum.

Definition at line 2751 of file CDCGeometryPar.cc.

2753{
2754 unsigned short lr = 0;
2755 double wCrossT = (posOnWire.Cross(posOnTrack)).Z();
2756
2757 if (wCrossT < 0.) {
2758 lr = 0;
2759 } else if (wCrossT > 0.) {
2760 lr = 1;
2761 } else {
2762 if ((posOnTrack - posOnWire).Perp() != 0.) {
2763 double wCrossP = (posOnWire.Cross(momentum)).Z();
2764 if (wCrossP > 0.) {
2765 if (posOnTrack.Perp() > posOnWire.Perp()) {
2766 lr = 0;
2767 } else {
2768 lr = 1;
2769 }
2770 } else if (wCrossP < 0.) {
2771 if (posOnTrack.Perp() < posOnWire.Perp()) {
2772 lr = 0;
2773 } else {
2774 lr = 1;
2775 }
2776 } else {
2777 lr = 0;
2778 }
2779 } else {
2780 lr = 0;
2781 }
2782 }
2783 return lr;
2784}
B2Vector3< DataType > Cross(const B2Vector3< DataType > &p) const
Cross product.
Definition: B2Vector3.h:296
DataType Perp() const
The transverse component (R in cylindrical coordinate system).
Definition: B2Vector3.h:200

◆ getOutgoingAlpha()

double getOutgoingAlpha ( const double  alpha) const

Converts incoming- to outgoing-alpha.

Parameters
alphain rad.

Definition at line 2821 of file CDCGeometryPar.cc.

2822{
2823 //convert incoming- to outgoing-alpha
2824 double alphao = alpha;
2825 if (alpha > 0.5 * M_PI) {
2826 alphao -= M_PI;
2827 } else if (alpha < -0.5 * M_PI) {
2828 alphao += M_PI;
2829 }
2830
2831 return alphao;
2832}

◆ getOutgoingLR()

unsigned short getOutgoingLR ( const unsigned short  lr,
const double  alpha 
) const

Converts incoming-lr to outgoing-lr.

Parameters
lrLeft/Right flag.
alphaTrack incident angle in rphi-plane (rad).

Definition at line 2814 of file CDCGeometryPar.cc.

2815{
2816 unsigned short lro = (fabs(alpha) <= 0.5 * M_PI) ? lr : abs(lr - 1);
2817 return lro;
2818}

◆ getOutgoingTheta()

double getOutgoingTheta ( const double  alpha,
const double  theta 
) const

Converts incoming- to outgoing-theta.

Parameters
alphain rad.
thetain rad.

Definition at line 2834 of file CDCGeometryPar.cc.

2835{
2836 //convert incoming- to outgoing-theta
2837 double thetao = fabs(alpha) > 0.5 * M_PI ? M_PI - theta : theta;
2838 // std::cout << alpha <<" "<< thetao << std::endl;
2839 return thetao;
2840}

◆ getPropSpeedInv()

double getPropSpeedInv ( const unsigned int  layerID) const
inline

Get the inversel of propagation speed in the sense wire.

Parameters
[in]layerIDlayer ID (0-55)

Definition at line 826 of file CDCGeometryPar.h.

827 {
828 return m_propSpeedInv[layerID];
829 }

◆ getSenseWireZposMode()

int getSenseWireZposMode ( ) const
inline

Return mode for sense wire z position.

Return value =0: define at the end-plate (gas side) with old design; =1: define at the bush inside the feedthrough with correction for the diff. betw. final- and old-design.

Definition at line 784 of file CDCGeometryPar.h.

785 {
786 return m_senseWireZposMode;
787 }
int m_senseWireZposMode
Mode for sense wire z position corr.

◆ getShiftInSuperLayer()

signed short getShiftInSuperLayer ( unsigned short  iSuperLayer,
unsigned short  iLayer 
) const

Returns shift in the super-layer.

Parameters
iSuperLayerThe super-layer id.
iLayerThe layer id. in the super-layer

Definition at line 3010 of file CDCGeometryPar.cc.

3011{
3012 return m_shiftInSuperLayer[iSuperLayer][iLayer];
3013}

◆ getSigma()

double getSigma ( double  dist,
unsigned short  layer,
unsigned short  lr,
double  alpha = 0.,
double  theta = 0.5 * M_PI 
) const

Return the basic resolution of drift length (cm).

N.B. A fudge factor may be multiplied at the place where this is called; be careful.

Parameters
distDrift length (cm); negative dist is treated as |dist|.
layerLayer id.
lrLeft/Right.
alphaincident angle (in rphi plane) w.r.t. the cell (rad).
thetaincident angle (polar angle) (rad).

Definition at line 2639 of file CDCGeometryPar.cc.

2641{
2642 if (iCLayer < m_firstLayerOffset || iCLayer >= c_maxNSenseLayers) {
2643 return 0.;
2644 }
2645
2646
2647 double sigma = 0.;
2648 //DriftL0 < 0 for the hit w/driftTime < 0; use |DriftL0| to avoid sigma=nan
2649 const double driftL = fabs(DriftL0);
2650
2651 //convert incoming- to outgoing-lr
2652 unsigned short lro = getOutgoingLR(lr, alpha);
2653
2655 B2FATAL("linearInterpolationOfSgm = false is not allowed now !");
2656 }
2658 double wal(0.);
2659 unsigned short ial[2] = {0};
2660 unsigned short ilr[2] = {lro, lro};
2661 getClosestAlphaPoints4Sgm(alpha, wal, ial, ilr);
2662 double wth(0.);
2663 unsigned short ith[2] = {0};
2664 getClosestThetaPoints4Sgm(alpha, theta, wth, ith);
2665
2666 //compute linear interpolation (=weithed average over 4 points) in (alpha-theta) space
2667 unsigned short jal(0), jlr(0), jth(0);
2668 double w = 0.;
2669 for (unsigned k = 0; k < 4; ++k) {
2670 if (k == 0) {
2671 jal = ial[0];
2672 jlr = ilr[0];
2673 jth = ith[0];
2674 w = (1. - wal) * (1. - wth);
2675 } else if (k == 1) {
2676 jal = ial[0];
2677 jlr = ilr[0];
2678 jth = ith[1];
2679 w = (1. - wal) * wth;
2680 } else if (k == 2) {
2681 jal = ial[1];
2682 jlr = ilr[1];
2683 jth = ith[0];
2684 w = wal * (1. - wth);
2685 } else if (k == 3) {
2686 jal = ial[1];
2687 jlr = ilr[1];
2688 jth = ith[1];
2689 w = wal * wth;
2690 }
2691 // std::cout << "k,w= " << k <<" "<< w << std::endl;
2692 // std::cout << "ial[0],[1],jal,wal= " << ial[0] <<" "<< ial[1] <<" "<< jal <<" "<< wal << std::endl;
2693 // std::cout << "ith[0],[1],jth,wth= " << ith[0] <<" "<< ith[1] <<" "<< jth <<" "<< wth << std::endl;
2694 /*
2695 std::cout <<"iCLayer= " << iCLayer << std::endl;
2696 std::cout <<"lr= " << lr << std::endl;
2697 std::cout <<"jal,jth= " << jal <<" "<< jth << std::endl;
2698 std::cout <<"wal,wth= " << wal <<" "<< wth << std::endl;
2699 for (int i=0; i<9; ++i) {
2700 std::cout <<"a= "<< i <<" "<< m_XT[iCLayer][lro][jal][jth][i] << std::endl;
2701 }
2702 */
2703 const double& P0 = m_Sigma[iCLayer][jlr][jal][jth][0];
2704 const double& P1 = m_Sigma[iCLayer][jlr][jal][jth][1];
2705 const double& P2 = m_Sigma[iCLayer][jlr][jal][jth][2];
2706 const double& P3 = m_Sigma[iCLayer][jlr][jal][jth][3];
2707 const double& P4 = m_Sigma[iCLayer][jlr][jal][jth][4];
2708 const double& P5 = m_Sigma[iCLayer][jlr][jal][jth][5];
2709 const double& P6 = m_Sigma[iCLayer][jlr][jal][jth][6];
2710
2711#if defined(CDC_DEBUG)
2712 cout << "driftL= " << driftL << endl;
2713 cout << "iCLayer= " << iCLayer << " " << jlr << " " << jal << " " << jth << endl;
2714 cout << "P0= " << P0 << endl;
2715 cout << "P1= " << P1 << endl;
2716 cout << "P2= " << P2 << endl;
2717 cout << "P3= " << P3 << endl;
2718 cout << "P4= " << P4 << endl;
2719 cout << "P5= " << P5 << endl;
2720 cout << "P6= " << P6 << endl;
2721#endif
2722 const double P7 = m_sigmaParamMode == 0 ? DBL_MAX : m_Sigma[iCLayer][jlr][jal][jth][7];
2723
2724 if (driftL < P7) {
2725 sigma += w * sqrt(P0 / (driftL * driftL + P1) + P2 * driftL + P3 +
2726 P4 * exp(P5 * (driftL - P6) * (driftL - P6)));
2727 } else {
2728 double forthTermAtP7 = P4 * exp(P5 * (P7 - P6) * (P7 - P6));
2729 const double& P8 = m_Sigma[iCLayer][jlr][jal][jth][8];
2730 if (m_sigmaParamMode == 1) {
2731 double sigmaAtP7 = sqrt(P0 / (P7 * P7 + P1) + P2 * P7 + P3 + forthTermAtP7);
2732 sigma += w * (P8 * (driftL - P7) + sigmaAtP7);
2733 } else if (m_sigmaParamMode == 2) {
2734 double onePls4AtP7 = sqrt(P0 / (P7 * P7 + P1) + forthTermAtP7);
2735 const double onePls4 = P8 * (driftL - P7) + onePls4AtP7;
2736 sigma += w * sqrt(P2 * driftL + P3 + onePls4 * onePls4);
2737 } else if (m_sigmaParamMode == 3) {
2738 forthTermAtP7 = sqrt(forthTermAtP7);
2739 const double forthTerm = P8 * (driftL - P7) + forthTermAtP7;
2740 sigma += w * sqrt(P0 / (driftL * driftL + P1) + P2 * driftL + P3 +
2741 forthTerm * forthTerm);
2742 } //end of mode
2743 } // end of driftL
2744 } //end of for loop
2745 }
2746
2747 sigma = std::min(sigma, m_maxSpaceResol);
2748 return sigma;
2749}
int m_sigmaParamMode
Mode for sigma parameterization.
void getClosestAlphaPoints4Sgm(const double alpha, double &wal, unsigned short points[2], unsigned short lrs[2]) const
Returns the two closest alpha points for sigma for the input track incident angle (alpha).
bool m_linearInterpolationOfSgm
Switch for linear interpolation of sigma.
double m_maxSpaceResol
max space resolution allowed (cm).
void getClosestThetaPoints4Sgm(const double alpha, const double theta, double &wth, unsigned short points[2]) const
Returns the two closest theta points for sigma for the input track incident angle (theta).

◆ getT0()

float getT0 ( const WireID wireID) const
inline

Returns t0 parameter of the specified sense wire.

Parameters
wireIDWire id.
Returns
t0.

Definition at line 555 of file CDCGeometryPar.h.

556 {
557 // std::cout << wireID.getICLayer() <<" "<< wireID.getIWire() << std::endl;
558 unsigned int iclayer = wireID.getICLayer();
559 unsigned int iwire = wireID.getIWire();
560 if (iclayer >= c_maxNSenseLayers) iclayer = c_maxNSenseLayers - 1;
561 if (iwire >= c_maxNDriftCells) iwire = c_maxNDriftCells - 1;
562 return m_t0[iclayer][iwire];
563 }

◆ getTdcBinWidth()

double getTdcBinWidth ( ) const
inline

Return TDC bin width (nsec).

Definition at line 726 of file CDCGeometryPar.h.

727 {
728 return m_tdcBinWidth;
729 }

◆ getTdcOffset()

unsigned short getTdcOffset ( ) const
inline

Return TDC offset value (default = 0 ch).

Definition at line 717 of file CDCGeometryPar.h.

718 {
719 return m_tdcOffset;
720 }

◆ getTheta()

double getTheta ( const B2Vector3D momentum) const

Returns track incident angle (theta in rad.).

Parameters
momentumTrack momentum at the closest point.

Definition at line 2808 of file CDCGeometryPar.cc.

2809{
2810 return atan2(momentum.Perp(), momentum.Z());
2811}

◆ getThresholdEnerguDeposit()

double getThresholdEnerguDeposit ( ) const
inline

Returns threshold for energy deposit in one G4 step.

Returns
threshold (GeV)

Definition at line 519 of file CDCGeometryPar.h.

520 {
522 }
double m_thresholdEnergyDeposit
Energy thresh.

◆ getTimeWalk()

double getTimeWalk ( const WireID wID,
unsigned short  adcCount 
) const
inline

Returns time-walk.

Parameters
wIDwire id
adcCountADC count
Returns
time-walk (in ns)

Definition at line 606 of file CDCGeometryPar.h.

607 {
608 std::map<WireID, unsigned short>::const_iterator it = m_wireToBoard.find(wID);
609 // std::cout <<"SL,L,W, bd#= " << wID.getISuperLayer() <<" "<< wID.getILayer() <<" "<< wID.getIWire() <<" "<< it->second << std::endl;
610 double tw = 0.;
611 if (it != m_wireToBoard.end() && adcCount > 0) {
612 if (m_twParamMode == 0) {
613 tw = m_timeWalkCoef[it->second][0] / sqrt(adcCount);
614 } else if (m_twParamMode == 1) {
615 double p0 = m_timeWalkCoef[it->second][0];
616 double p1 = m_timeWalkCoef[it->second][1];
617 tw = p0 * exp(-p1 * adcCount);
618 }
619 }
620 // std::cout <<"bd#,coef,adc,tw= " << it->second <<" "<< m_timeWalkCoef[it->second] <<" "<< adcCount <<" "<< tw << std::endl;
621 return tw;
622 }
int m_twParamMode
Mode for tw parameterization.

◆ getWireID()

const WireID getWireID ( unsigned short  bd,
unsigned short  ch 
) const
inline

Returns wire id. corresponding to the board-and-cannel ids.

Parameters
bdboard id. (1-300)
chchannel id. (0-47)
Returns
wire id.

Definition at line 595 of file CDCGeometryPar.h.

596 {
597 return WireID(m_boardAndChannelToWire[bd][ch]);
598 }

◆ getWireSagCoef()

double getWireSagCoef ( EWirePosition  set,
uint  layerId,
int  cellId 
) const

Returns coefficient for the sense wire sag.

Parameters
setWire position set; =c_Base, c_Misaligned or c_Aligned
layerIdThe layer id.
cellIdThe cell id.
Returns
Coefficient for the sense wire sag.

Definition at line 1796 of file CDCGeometryPar.cc.

1797{
1798 double coef = m_WireSagCoef[layerID][cellID];
1799 if (set == c_Misaligned) {
1800 coef = m_WireSagCoefMisalign[layerID][cellID];
1801 } else if (set == c_Aligned) {
1802 coef = m_WireSagCoefAlign [layerID][cellID];
1803 }
1804 return coef;
1805}

◆ getWireSagEffect()

void getWireSagEffect ( EWirePosition  set,
unsigned  layerID,
unsigned  cellID,
double  zw,
double &  ywb_sag,
double &  ywf_sag 
) const

Compute effects of the sense wire sag.

Parameters
[in]setWire position set; =c_Base, c_Misaligned or c_Aligned
[in]layerIDLayer ID
[in]cellIDCell ID in the layer
[in]zwZ-coord. (cm) at which the sense wire sag is computed
[out]ywb_sagY-corrd. (cm) of intersection between a tangent and the backward endplate.
[out]ywf_sagY-corrd. (cm) of intersection between a tangent and the forward endplate.
Attention
The tangent is computed from the first derivative of a paraboric wire (due to gravity) defined at Z.

Definition at line 1960 of file CDCGeometryPar.cc.

1962{
1963 //Input
1964 // set : c_Base, c_Misaligned or c_Aligned
1965 // layerID: layer id (0 - 55);
1966 // cellID: cell id in the layer;
1967 // Z: Z-coord. (cm) at which sense wire sag is computed.
1968 //
1969 //Output Yb_sag: Y-corrd. (cm) of intersection of a tangent and the backward endplate.
1970 // Here the tangent is computed from the 1'st derivative of
1971 // a paraboric wire (due to gravity) defined at Z.
1972 // Yf_sag: ibid. but for forward.
1973 //
1974 //N.B.- Maybe replaced with a bit more accurate formula.
1975 // - The electrostatic force effect is not included.
1976
1977 // return early in case of empty layer, i.e. layerID < m_firstLayerOffset
1978 if (layerID < m_firstLayerOffset) {
1979 Yb_sag = 0.;
1980 Yf_sag = 0.;
1981 return;
1982 }
1983
1984 double Xb = 0.;
1985 double Xf = 0.;
1986 double Yb = 0.;
1987 double Yf = 0.;
1988 double Zb = 0.;
1989 double Zf = 0.;
1990 double Coef = 0.;
1991
1992 if (set == c_Aligned) {
1993 Coef = m_WireSagCoefAlign[layerID][cellID];
1994 Yb = m_BWirPosAlign[layerID][cellID][1];
1995 Yf = m_FWirPosAlign[layerID][cellID][1];
1996 if (Coef == 0.) {
1997 Yb_sag = Yb;
1998 Yf_sag = Yf;
1999 return;
2000 }
2001 Xb = m_BWirPosAlign[layerID][cellID][0];
2002 Xf = m_FWirPosAlign[layerID][cellID][0];
2003 Zb = m_BWirPosAlign[layerID][cellID][2];
2004 Zf = m_FWirPosAlign[layerID][cellID][2];
2005
2006 } else if (set == c_Misaligned) {
2007 Coef = m_WireSagCoefMisalign[layerID][cellID];
2008 Yb = m_BWirPosMisalign[layerID][cellID][1];
2009 Yf = m_FWirPosMisalign[layerID][cellID][1];
2010 if (Coef == 0.) {
2011 Yb_sag = Yb;
2012 Yf_sag = Yf;
2013 return;
2014 }
2015 Xb = m_BWirPosMisalign[layerID][cellID][0];
2016 Xf = m_FWirPosMisalign[layerID][cellID][0];
2017 Zb = m_BWirPosMisalign[layerID][cellID][2];
2018 Zf = m_FWirPosMisalign[layerID][cellID][2];
2019
2020 } else if (set == c_Base) {
2021 Coef = m_WireSagCoef[layerID][cellID];
2022 Yb = m_BWirPos[layerID][cellID][1];
2023 Yf = m_FWirPos[layerID][cellID][1];
2024 if (Coef == 0.) {
2025 Yb_sag = Yb;
2026 Yf_sag = Yf;
2027 return;
2028 }
2029 Xb = m_BWirPos[layerID][cellID][0];
2030 Xf = m_FWirPos[layerID][cellID][0];
2031 Zb = m_BWirPos[layerID][cellID][2];
2032 Zf = m_FWirPos[layerID][cellID][2];
2033
2034 } else {
2035 B2FATAL("CDCGeometryPar::getWireSagEffect: called with an invalid set: " << " " << set);
2036 }
2037
2038 const double dx = Xf - Xb;
2039 const double dy = Yf - Yb;
2040 const double dz = Zf - Zb;
2041
2042 const double Zfp = sqrt(dz * dz + dx * dx); // Wire length in z-x plane since Zbp==0
2043 const double Zp = (Z - Zb) * Zfp / dz;
2044
2045 const double Y_sag = (Coef * (Zp - Zfp) + dy / Zfp) * Zp + Yb;
2046 const double dydz = (Coef * (2.*Zp - Zfp) * Zfp + dy) / dz;
2047
2048 Yb_sag = Y_sag + dydz * (Zb - Z);
2049 Yf_sag = Y_sag + dydz * (Zf - Z);
2050
2051}

◆ innerRadiusInnerWall()

double innerRadiusInnerWall ( ) const
inline

Returns the inner radius of the inner wall.

Returns
The inner radius of the inner wall.

Definition at line 1319 of file CDCGeometryPar.h.

1320 {
1321 return m_rWall[0];
1322 }

◆ innerRadiusOuterWall()

double innerRadiusOuterWall ( ) const
inline

Returns the inner radius of the outer wall.

Returns
The inner radius of the outer wall.

Definition at line 1304 of file CDCGeometryPar.h.

1305 {
1306 return m_rWall[2];
1307 }

◆ innerRadiusWireLayer()

const double * innerRadiusWireLayer ( ) const

Returns an array of inner radius of wire layers.

Returns
An array of inner radius of wire layers.

Definition at line 1807 of file CDCGeometryPar.cc.

1808{
1809 static double IRWL[c_maxNSenseLayers] = {0};
1810
1811 IRWL[0] = outerRadiusInnerWall();
1812 for (unsigned i = 1; i < nWireLayers(); i++)
1813 //IRWL[i] = (m_rSLayer[i - 1] + m_rSLayer[i]) / 2.;
1814 IRWL[i] = (i == m_firstLayerOffset) ? outerRadiusInnerWall() : m_rFLayer[i - 1];
1815
1816 return IRWL;
1817}
unsigned nWireLayers() const
Returns a number of wire layers.

◆ Instance()

CDCGeometryPar & Instance ( const CDCGeometry geom = nullptr)
static

Static method to get a reference to the CDCGeometryPar instance.

Returns
A reference to an instance of this class.

Definition at line 32 of file CDCGeometryPar.cc.

33{
36}
The Class for CDC Geometry Parameters.
static CDCGeometryPar * m_B4CDCGeometryParDB
Pointer that saves the instance of this class.

◆ isBadWire()

bool isBadWire ( const WireID wid)
inline

Inquire if the wire is totally-dead.

Definition at line 834 of file CDCGeometryPar.h.

835 {
836 // std::map<unsigned short, float>::iterator it = m_badWire.find(wid.getEWire());
837 // bool torf = (it != m_badWire.end()) ? true : false;
838 // return torf;
839 bool torf = *m_badWireFromDB ? (*m_badWireFromDB)->isBadWire(wid) : false;
840 return torf;
841
842 }

◆ isDeadWire()

bool isDeadWire ( const WireID wid,
double &  eff 
)
inline

Inquire if the wire is dead.

Definition at line 847 of file CDCGeometryPar.h.

848 {
849 bool torf = *m_badWireFromDB ? (*m_badWireFromDB)->isDeadWire(wid, eff) : false;
850 return torf;
851 }

◆ isHotWire()

bool isHotWire ( const WireID wid)
inline

Inquire if the wire is hot.

Definition at line 856 of file CDCGeometryPar.h.

857 {
858 bool torf = *m_badWireFromDB ? (*m_badWireFromDB)->isHotWire(wid) : false;
859 return torf;
860 }

◆ isModifiedLeftRightFlagOn()

bool isModifiedLeftRightFlagOn ( ) const
inline

Returns on/off for modified left/right calculation in FullSim.

Definition at line 544 of file CDCGeometryPar.h.

545 {
546 return m_modLeftRightFlag;
547 }
bool m_modLeftRightFlag
Switch for modified left/right flag.

◆ isWireSagOn()

bool isWireSagOn ( ) const
inline

Returns on/off for sense wire sag in FullSim.

Definition at line 536 of file CDCGeometryPar.h.

537 {
538 return m_wireSag;
539 }
bool m_wireSag
Switch for sense wire sag.

◆ momBound()

int momBound ( ) const

to get the number of boundary position of the CDC mother volume

Returns
The number of boundary position of the CDC mother volume.

◆ momRmin()

double momRmin ( int  iBound) const
inline

Returns inner radius of the CDC mother volume.

Parameters
iBound: The boundary id.
Returns
The inner radius of the specified baoundary position in the CDC mother volume

Definition at line 1239 of file CDCGeometryPar.h.

1240 {
1241 return m_momRmin[iBound];
1242 }
double m_momRmin[7]
R_min of the cdc mother volume (7 segments).

◆ momZ()

double momZ ( int  iBound) const
inline

Returns boundary position in Z axis of the CDC mother volume.

Parameters
iBound: The boundary id.
Returns
The z component of the specified baoundary position in the CDC mother volume

Definition at line 1234 of file CDCGeometryPar.h.

1235 {
1236 return m_momZ[iBound];
1237 }
double m_momZ[7]
Z-cordinates of the cdc mother volume (7 segments).

◆ motherInnerR()

double motherInnerR ( ) const

The method to get cdc mother volume inner R.

Returns
The inner radius of the cdc mother volume.

◆ motherLength()

double motherLength ( ) const

The method to get cdc mother volume length.

Returns
The length of the cdc mother volume.

◆ motherOuterR()

double motherOuterR ( ) const

The method to get cdc mother volume outer R.

Returns
The outer radius of the cdc mother volume.

◆ newReadSigma()

void newReadSigma ( const GearDir gbxParams,
int  mode = 0 
)

Read spatial resolution table in new format.

Parameters
gbxParamsGear Dir.
mode0: read simulation file, 1: read reconstruction file.

Definition at line 957 of file CDCGeometryPar.cc.

958{
959 m_linearInterpolationOfSgm = true; //must be true now
960
961 std::string fileName0 = CDCGeoControlPar::getInstance().getSigmaFile();
962 if (mode == 1) {
963 fileName0 = gbxParams.getString("sigma4ReconFileName");
964 }
965
966 ifstream ifs;
967 // openFile(ifs, fileName0);
968 openFileA(ifs, fileName0);
969
970 //read alpha bin info.
971 unsigned short nAlphaBins = 0;
972 if (ifs >> nAlphaBins) {
973 if (nAlphaBins == 0 || nAlphaBins > c_maxNAlphaPoints) B2FATAL("Fail to read alpha bins !");
974 } else {
975 B2FATAL("Fail to read alpha bins !");
976 }
977 m_nAlphaPoints4Sgm = nAlphaBins;
978 // std:: cout << nAlphaBins << std::endl;
979 double alpha0, alpha1, alpha2;
980 for (unsigned short i = 0; i < nAlphaBins; ++i) {
981 ifs >> alpha0 >> alpha1 >> alpha2;
982 m_alphaPoints4Sgm[i] = alpha2;
983 // std:: cout << alpha2 << std::endl;
984 }
985
986 //read theta bin info.
987 unsigned short nThetaBins = 0;
988 if (ifs >> nThetaBins) {
989 if (nThetaBins == 0 || nThetaBins > c_maxNThetaPoints) B2FATAL("CDCGeometryPar: fail to read theta bins !");
990 } else {
991 B2FATAL("CDCGeometryPar: fail to read theta bins !");
992 }
993 m_nThetaPoints4Sgm = nThetaBins;
994 // std:: cout << nThetaBins << std::endl;
995 double theta0, theta1, theta2;
996
997 for (unsigned short i = 0; i < nThetaBins; ++i) {
998 ifs >> theta0 >> theta1 >> theta2;
999 m_thetaPoints4Sgm[i] = theta2;
1000 // std:: cout << theta2 << std::endl;
1001 }
1002
1003 unsigned short np = 0;
1004 unsigned short iCL, iLR;
1005 double sigma[c_nSigmaParams]; // cppcheck-suppress constVariable
1006 double theta, alpha;
1007
1008 ifs >> m_sigmaParamMode >> np;
1009 // std:: cout << m_sigmaParamMode <<" "<< np << std::endl;
1010 if (m_sigmaParamMode < 0 || m_sigmaParamMode > 4) B2FATAL("CDCGeometryPar: invalid sigma-parameterization mode read !");
1011
1012 if (np > c_nSigmaParams) B2FATAL("CDCGeometryPar: no. of sigma-params. outside limits !");
1013
1014 ifs >> m_maxSpaceResol;
1015
1016 const double epsi = 0.1;
1017
1018 while (ifs >> iCL) {
1019
1020 if (iCL < m_firstLayerOffset) {
1021 continue;
1022 }
1023
1024 ifs >> theta >> alpha >> iLR;
1025 // std::cout << iCL <<" "<< theta <<" "<< alpha <<" "<< iLR << std::endl;
1026 for (int i = 0; i < np; ++i) {
1027 ifs >> sigma[i];
1028 }
1029
1030 int itheta = -99;
1031 for (unsigned short i = 0; i < nThetaBins; ++i) {
1032 if (fabs(theta - m_thetaPoints4Sgm[i]) < epsi) {
1033 itheta = i;
1034 break;
1035 }
1036 }
1037 if (itheta < 0) B2FATAL("CDCGeometryPar: thetas in sigma.dat are inconsistent !");
1038
1039 int ialpha = -99;
1040 for (unsigned short i = 0; i < nAlphaBins; ++i) {
1041 if (fabs(alpha - m_alphaPoints4Sgm[i]) < epsi) {
1042 ialpha = i;
1043 break;
1044 }
1045 }
1046 if (ialpha < 0) B2FATAL("CDCGeometryPar: alphas in sigma.dat are inconsistent !");
1047
1048 for (int i = 0; i < np; ++i) {
1049 m_Sigma[iCL][iLR][ialpha][itheta][i] = sigma[i];
1050 }
1051 } //end of while loop
1052
1053 ifs.close();
1054
1055 //convert unit
1056 const double degrad = M_PI / 180.;
1057 for (unsigned i = 0; i < nAlphaBins; ++i) {
1058 m_alphaPoints4Sgm[i] *= degrad;
1059 }
1060 for (unsigned i = 0; i < nThetaBins; ++i) {
1061 m_thetaPoints4Sgm[i] *= degrad;
1062 }
1063
1064 // std::cout << "end of newreadsigma " << std::endl;
1065}
std::string getSigmaFile() const
Get input file name for sigma.
virtual std::string getString(const std::string &path="") const noexcept(false) override
Get the parameter path as a string.
Definition: GearDir.h:69
void openFileA(std::ifstream &ifs, const std::string &fileName0)
Open a file.
Definition: OpenFile.cc:25

◆ newReadXT()

void newReadXT ( const GearDir gbxParams,
int  mode = 0 
)

Read XT-relation table in new format.

Parameters
[in]gbxParamsGear Dir.
[in]mode0: read simulation file, 1: read reconstruction file.

Definition at line 811 of file CDCGeometryPar.cc.

812{
813 m_linearInterpolationOfXT = true; //must be true now
814
815 std::string fileName0 = CDCGeoControlPar::getInstance().getXtFile();
816 if (mode == 1) {
817 fileName0 = gbxParams.getString("xt4ReconFileName");
818 }
819
820 boost::iostreams::filtering_istream ifs;
821 openFileB(ifs, fileName0);
822 //TODO: use openFile() in cdc/utilities instead of the following 18 lines <- done
823 /*
824 std::string fileName1 = "/data/cdc/" + fileName0;
825 std::string fileName = FileSystem::findFile(fileName1);
826
827 if (fileName == "") {
828 fileName = FileSystem::findFile(fileName0);
829 }
830
831 if (fileName == "") {
832 B2FATAL("CDCGeometryPar: " << fileName1 << " not exist!");
833 } else {
834 B2INFO("CDCGeometryPar: open " << fileName1);
835 if ((fileName.rfind(".gz") != string::npos) && (fileName.length() - fileName.rfind(".gz") == 3)) {
836 ifs.push(boost::iostreams::gzip_decompressor());
837 }
838 ifs.push(boost::iostreams::file_source(fileName));
839 if (!ifs) B2FATAL("CDCGeometryPar: cannot open " << fileName1 << " !");
840 }
841 */
842
843 //read alpha bin info.
844 unsigned short nAlphaBins = 0;
845 if (ifs >> nAlphaBins) {
846 if (nAlphaBins == 0 || nAlphaBins > c_maxNAlphaPoints) B2FATAL("Fail to read alpha bins !");
847 } else {
848 B2FATAL("Fail to read alpha bins !");
849 }
850 m_nAlphaPoints = nAlphaBins;
851 double alpha0, alpha1, alpha2;
852 for (unsigned short i = 0; i < nAlphaBins; ++i) {
853 ifs >> alpha0 >> alpha1 >> alpha2;
854 m_alphaPoints[i] = alpha2;
855 }
856
857 //read theta bin info.
858 unsigned short nThetaBins = 0;
859 if (ifs >> nThetaBins) {
860 if (nThetaBins == 0 || nThetaBins > c_maxNThetaPoints) B2FATAL("CDCGeometryPar: fail to read theta bins !");
861 } else {
862 B2FATAL("CDCGeometryPar: fail to read theta bins !");
863 }
864 m_nThetaPoints = nThetaBins;
865 double theta0, theta1, theta2;
866
867 for (unsigned short i = 0; i < nThetaBins; ++i) {
868 ifs >> theta0 >> theta1 >> theta2;
869 m_thetaPoints[i] = theta2;
870 }
871
872 short np = 0;
873 unsigned short iCL, iLR;
874 const unsigned short npx = c_nXTParams - 1;
875 double xtc[npx];
876 double theta, alpha, dummy1;
877
878 ifs >> m_xtParamMode >> np;
879 if (m_xtParamMode < 0 || m_xtParamMode > 3) B2FATAL("CDCGeometryPar: invalid xt-parameterization mode read !");
880
881 if (np <= 0 || np > npx) B2FATAL("CDCGeometryPar: no. of xt-params. outside limits !");
882
883 const double epsi = 0.1;
884
885 while (ifs >> iCL) {
886
887 if (iCL < m_firstLayerOffset) {
888 continue;
889 }
890
891 ifs >> theta >> alpha >> dummy1 >> iLR;
892 for (int i = 0; i < np; ++i) {
893 ifs >> xtc[i];
894 }
895
896 int itheta = -99;
897 for (unsigned short i = 0; i < nThetaBins; ++i) {
898 if (fabs(theta - m_thetaPoints[i]) < epsi) {
899 itheta = i;
900 break;
901 }
902 }
903 if (itheta < 0) B2FATAL("CDCGeometryPar: thetas in xt.dat are inconsistent !");
904
905 int ialpha = -99;
906 for (unsigned short i = 0; i < nAlphaBins; ++i) {
907 if (fabs(alpha - m_alphaPoints[i]) < epsi) {
908 ialpha = i;
909 break;
910 }
911 }
912 if (ialpha < 0) B2FATAL("CDCGeometryPar: alphas in xt.dat are inconsistent !");
913
914 for (int i = 0; i < np; ++i) {
915 m_XT[iCL][iLR][ialpha][itheta][i] = xtc[i];
916 }
917
918 double boundT = xtc[6];
919 if (m_xtParamMode == 1) {
920 m_XT[iCL][iLR][ialpha][itheta][np] = ROOT::Math::Chebyshev5(boundT, xtc[0], xtc[1], xtc[2], xtc[3], xtc[4], xtc[5]);
921 } else {
922 m_XT[iCL][iLR][ialpha][itheta][np] =
923 xtc[0] + boundT
924 * (xtc[1] + boundT
925 * (xtc[2] + boundT
926 * (xtc[3] + boundT
927 * (xtc[4] + boundT
928 * (xtc[5])))));
929 }
930 } //end of while loop
931
932 // ifs.close();
933 boost::iostreams::close(ifs);
934
935 //convert unit
936 const double degrad = M_PI / 180.;
937 for (unsigned i = 0; i < nAlphaBins; ++i) {
938 m_alphaPoints[i] *= degrad;
939 }
940 for (unsigned i = 0; i < nThetaBins; ++i) {
941 m_thetaPoints[i] *= degrad;
942 }
943
944}
std::string getXtFile() const
Get input file name for xt-relation.
void openFileB(boost::iostreams::filtering_istream &ifs, const std::string &fileName0)
Open a file using boost (to be able to read a gzipped file)
Definition: OpenFile.cc:44

◆ nShifts()

int nShifts ( int  layerId) const
inline

Returns number shift.

Parameters
layerIdThe layer id of sense wires.
Returns
The shifted cell number in layer layerId.

Definition at line 1244 of file CDCGeometryPar.h.

1245 {
1246 return m_nShifts[layerID];
1247 }

◆ nWireLayers()

unsigned nWireLayers ( ) const
inline

Returns a number of wire layers.

Returns
The number of wire layers.

Definition at line 1354 of file CDCGeometryPar.h.

1355 {
1356 return c_maxNSenseLayers;
1357 }

◆ nWiresInLayer()

unsigned nWiresInLayer ( int  layerId) const
inline

Returns wire numbers in a layer.

Parameters
layerIdThe layer id.
Returns
Wire number in layer layerId.

Definition at line 1254 of file CDCGeometryPar.h.

1255 {
1256 return m_nWires[layerID];
1257 }

◆ offset()

double offset ( int  layerID) const
inline

Return wire offset in phi direction at endplate.

Parameters
layerIDlayerID(0-55).
Returns
offset value.

Definition at line 1249 of file CDCGeometryPar.h.

1250 {
1251 return m_offSet[layerID];
1252 }

◆ outerRadiusInnerWall()

double outerRadiusInnerWall ( ) const
inline

Returns the outer radius of the inner wall.

Returns
The outer radius of the inner wall.

Definition at line 1324 of file CDCGeometryPar.h.

1325 {
1326 return m_rWall[1];
1327 }

◆ outerRadiusOuterWall()

double outerRadiusOuterWall ( ) const
inline

Returns the outer radius of the outer wall.

Returns
The outer radius of the outer wall.

Definition at line 1309 of file CDCGeometryPar.h.

1310 {
1311 return m_rWall[3];
1312 }

◆ outerRadiusWireLayer()

const double * outerRadiusWireLayer ( ) const

Returns an array of outer radius of wire layers.

Returns
A array of outer radius of wire layers.

Definition at line 1819 of file CDCGeometryPar.cc.

1820{
1821 static double ORWL[c_maxNSenseLayers] = {0};
1822
1823 ORWL[nWireLayers() - 1] = innerRadiusOuterWall();
1824 for (unsigned i = 0; i < nWireLayers() - 1; i++)
1825 //ORWL[i] = (m_rSLayer[i] + m_rSLayer[i + 1]) / 2.;
1826 ORWL[i] = m_rFLayer[i];
1827
1828 return ORWL;
1829}

◆ outputDesignWirParam()

void outputDesignWirParam ( unsigned  layerID,
unsigned  cellID 
) const

Write the designed wire parameters to the alignment.dat (default).

Parameters
[in]layerIDLayer ID
[in]cellIDCell ID

Definition at line 2090 of file CDCGeometryPar.cc.

2091{
2092
2093 const unsigned L = layerID;
2094 const unsigned C = cellID;
2095
2096 static bool first = true;
2097 static ofstream ofs;
2098 if (first) {
2099 first = false;
2100 ofs.open("alignment.dat");
2101 }
2102
2103 ofs << L << " " << C;
2104
2105 ofs << setiosflags(ios::showpoint | ios::uppercase);
2106
2107 for (int i = 0; i < 3; ++i) ofs << " " << setw(15) << setprecision(8) << m_BWirPos[L][C][i];
2108
2109 for (int i = 0; i < 3; ++i) ofs << " " << setw(15) << setprecision(8) << m_FWirPos[L][C][i];
2110 ofs << setiosflags(ios::fixed);
2111 ofs << " " << setw(4) << setprecision(1) << m_senseWireTension;
2112
2113 ofs << endl;
2114}

◆ Print()

void Print ( ) const

Print some debug information.

Definition at line 1696 of file CDCGeometryPar.cc.

1697{}

◆ readChMap()

void readChMap ( )

Read channel map between wire-id and electronics-id.

Definition at line 1270 of file CDCGeometryPar.cc.

1271{
1272 std::string fileName0 = CDCGeoControlPar::getInstance().getChMapFile();
1273
1274 ifstream ifs;
1275 // openFile(ifs, fileName0);
1276 openFileA(ifs, fileName0);
1277
1278 unsigned short iSL, iL, iW, iB, iC;
1279 unsigned nRead = 0;
1280
1281 while (true) {
1282 // Read a relation
1283 ifs >> iSL >> iL >> iW >> iB >> iC;
1284 if (ifs.eof()) break;
1285 if (iSL >= c_nSuperLayers or iSL < m_firstSuperLayerOffset) continue;
1286
1287 ++nRead;
1288 WireID wID(iSL, iL, iW);
1289 m_wireToBoard.insert(pair<WireID, unsigned short>(wID, iB));
1290 }
1291
1292 if (nRead != m_nSenseWires) B2FATAL("CDCGeometryPar::readChMap: #lines read-in (=" << nRead <<
1293 ") is inconsistent with #sense-wires (="
1294 << m_nSenseWires << ") !");
1295
1296 ifs.close();
1297}
std::string getChMapFile() const
Get input file name for channel map.

◆ readEDepToADC()

void readEDepToADC ( const GearDir gbxParams,
int  mode = 0 
)

Read spatial edep-to-adc conv.

factors.

Parameters
gbxParamsGear Dir.
modedummy now..

Definition at line 1301 of file CDCGeometryPar.cc.

1302{
1303 // B2WARNING("CDCGeometryPar: readEDepToADC is not ready!");
1304 std::string fileName0 = CDCGeoControlPar::getInstance().getEDepToADCFile();
1305 if (mode == 1) {
1306 fileName0 = gbxParams.getString("fudgeFactorFileName");
1307 }
1308
1309 ifstream ifs;
1310 // openFileA(ifs, fileName0);
1311 std::string fileName1 = "/data/cdc/" + fileName0;
1312 std::string fileName = FileSystem::findFile(fileName1, true);
1313
1314 if (fileName == "") {
1315 fileName = FileSystem::findFile(fileName0, true);
1316 }
1317
1318 if (fileName == "") {
1319 B2FATAL("CDC::openFile: " << fileName0 << " not exist!");
1320 } else {
1321 // B2INFO("CDC::openFile: open " << fileName);
1322 B2DEBUG(29, "CDC::openFile: open " << fileName);
1323 ifs.open(fileName.c_str());
1324 if (!ifs) B2FATAL("CDC::openFile: cannot open " << fileName << " !");
1325 }
1326
1327 unsigned short paramMode(0), nParams(0);
1328 ifs >> paramMode >> nParams;
1329 if (paramMode > 1) B2FATAL("Param mode > 1!");
1330 if (nParams > 7) B2FATAL("No. of params. > 7!");
1331 unsigned short groupId(0);
1332 ifs >> groupId;
1333 B2DEBUG(29, paramMode << " " << nParams << " " << groupId);
1334 if (groupId > 0) B2FATAL("GgroupId > 0!");
1335
1336
1337 unsigned short cLMin[c_nSuperLayers], cLMax[c_nSuperLayers]; //min and max clayer per super-layer
1338 cLMin[0] = 0;
1339 cLMax[0] = 7;
1340 for (unsigned int sl = 1; sl < c_nSuperLayers; ++sl) {
1341 cLMin[sl] = cLMax[0] + 6 * sl - 5;
1342 cLMax[sl] = cLMax[0] + 6 * sl;
1343 }
1344
1345 unsigned short id = 0;
1346 double coef = 0.;
1347 unsigned short nRead = 0;
1348 while (ifs >> id) {
1349 for (unsigned short i = 0; i < nParams; ++i) {
1350 ifs >> coef;
1351 for (unsigned short cL = cLMin[id]; cL <= cLMax[id]; ++cL) { //clayer loop
1352 for (unsigned short cell = 0; cell < m_nWires[cL]; ++cell) { //cell loop
1353 m_eDepToADCParams[cL][cell][i] = (cL < m_firstLayerOffset) ? 0 : coef;
1354 // B2DEBUG(29, "cL,cell,i,coef= "<< cL <<" "<< cell <<" "<< i <<" "<< coef);
1355 }
1356 }
1357 }
1358 ++nRead;
1359 if (nRead > c_nSuperLayers) B2FATAL("No. of read in lines > " << c_nSuperLayers << " !");
1360 }
1361
1362 ifs.close();
1363}
std::string getEDepToADCFile() const
Get input file name for edeptoadc.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
Definition: FileSystem.cc:151

◆ readFFactor()

void readFFactor ( const GearDir gbxParams,
int  mode = 0 
)

Read fudge factors.

Parameters
gbxParamsGear Dir.
modedummy now.

Definition at line 1069 of file CDCGeometryPar.cc.

1070{
1071 std::string fileName0 = CDCGeoControlPar::getInstance().getFFactorFile();
1072 if (mode == 1) {
1073 fileName0 = gbxParams.getString("fudgeFactorFileName");
1074 }
1075 B2WARNING("readFFactor is not ready! " << fileName0);
1076 //TODO; implement the following part.
1077}
std::string getFFactorFile() const
Get input file name for fudge factor.

◆ readFromDB()

void readFromDB ( const CDCGeometry geom)

Gets geometry parameters from database.

Definition at line 253 of file CDCGeometryPar.cc.

254{
255 m_globalPhiRotation = geom.getGlobalPhiRotation();
256 // m_globalPhiRotation = geom.getGlobalOffsetC();
257
258 // Get inner wall parameters
259 m_rWall[0] = geom.getInnerWall(2).getRmin();
260 m_zWall[0][0] = geom.getInnerWall(0).getZbwd();
261 m_zWall[0][1] = geom.getInnerWall(0).getZfwd();
262
263 m_rWall[1] = geom.getInnerWall(0).getRmax();
264 m_zWall[1][0] = geom.getInnerWall(0).getZbwd();
265 m_zWall[1][1] = geom.getInnerWall(0).getZbwd();
266
267 // Get outer wall parameters
268 m_rWall[2] = geom.getOuterWall(0).getRmin();
269 m_zWall[2][0] = geom.getOuterWall(0).getZbwd();
270 m_zWall[2][1] = geom.getOuterWall(0).getZfwd();
271
272 m_rWall[3] = geom.getOuterWall(1).getRmax();
273 m_zWall[3][0] = geom.getOuterWall(0).getZbwd();
274 m_zWall[3][1] = geom.getOuterWall(0).getZfwd();
275
276 // Get sense layers parameters
278 m_nSLayer = geom.getNSenseLayers();
279
281 // std::cout << m_materialDefinitionMode << std::endl;
282 if (m_materialDefinitionMode == 0) {
283 B2DEBUG(100, "CDCGeometryPar: Define a mixture of gases and wires in the tracking volume.");
284 } else if (m_materialDefinitionMode == 2) {
285 // B2INFO("CDCGeometryPar: Define all sense and field wires explicitly in the tracking volume.");
286 B2FATAL("CDCGeometryPar: Materialdefinition=2 is disabled for now.");
287 } else {
288 B2FATAL("CDCGeometryPar: Materialdefinition mode you specify is invalid.");
289 }
290
291 // Get mode for wire z-position
293 //Set z corrections (from input data)
294 B2DEBUG(100, "CDCGeometryPar: Sense wire z mode:" << m_senseWireZposMode);
295
296 //
297 // The DB version should be implemented ASAP.
298 //
299 GearDir content = GearDir("/Detector/DetectorComponent[@name=\"CDC\"]/Content/");
300 GearDir gbxParams(content);
301 // if (m_senseWireZposMode == 1) readDeltaz(gbxParams);
302
303
304 //
305 // Sense wires.
306 //
307 for (const auto& sense : geom.getSenseLayers()) {
308 uint layerId = sense.getId();
309
310 m_rSLayer[layerId] = sense.getR();
311 m_zSBackwardLayer[layerId] = sense.getZbwd();
312 m_zSForwardLayer[layerId] = sense.getZfwd();
313 m_nWires[layerId] = sense.getNWires();
314 m_nShifts[layerId] = sense.getNShifts();
315 m_offSet[layerId] = sense.getOffset();
316 m_cellSize[layerId] = 2 * M_PI * m_rSLayer[layerId] / (double) m_nWires[layerId];
317 m_dzSBackwardLayer[layerId] = sense.getDZbwd();
318 m_dzSForwardLayer[layerId] = sense.getDZfwd();
319
320 //correction to z-position
321 if (m_senseWireZposMode == 0) {
322 } else if (m_senseWireZposMode == 1) {
323 // m_zSBackwardLayer[layerId] += m_bwdDz[layerId];
324 // m_zSForwardLayer [layerId] += m_fwdDz[layerId];
325 m_zSBackwardLayer[layerId] += m_dzSBackwardLayer[layerId];
326 m_zSForwardLayer [layerId] -= m_dzSForwardLayer [layerId];
327 } else {
328 B2FATAL("CDCGeometryPar: invalid wire z definition mode specified");
329 }
330
331 //Set design sense-wire related params.
332 const int nWires = m_nWires[layerId];
333 for (int iCell = 0; iCell < nWires; ++iCell) {
334 setDesignWirParam(layerId, iCell);
335 }
336
337 }
338
339 // Get field layers parameters
340 for (const auto& field : geom.getFieldLayers()) {
341 uint layerId = field.getId();
342
343 m_rFLayer[layerId] = field.getR();
344 m_zFBackwardLayer[layerId] = field.getZbwd();
345 m_zFForwardLayer[layerId] = field.getZfwd();
346 }
347
348 // Get sense wire diameter
349 m_senseWireDiameter = geom.getSenseDiameter();
350
351 // Get sense wire tension
352 m_senseWireTension = geom.getSenseTension();
353
354 // // Get sense wire density
355 m_senseWireDensity = 19.3; // g/cm3 <- tentatively hard-coded here
356
357 // Get field wire diameter
358 m_fieldWireDiameter = geom.getFieldDiameter();
359
360 // Get information on the number of (super) layers etc.
361 m_nSenseWires = geom.getNSenseWires();
362 m_nFieldWires = geom.getNFieldWires();
363 m_maxNSenseLayers = geom.getNumberOfSenseLayers();
364 m_maxNFieldLayers = geom.getNumberOfFieldLayers();
365 m_maxNSuperLayers = geom.getMaxNumberOfSuperLayers();
366 m_firstLayerOffset = geom.getOffsetOfFirstLayer();
367 m_firstSuperLayerOffset = geom.getOffsetOfFirstSuperLayer();
368 m_maxNCellsPerLayer = geom.getMaxNumberOfCellsPerLayer();
369
370 //Set various quantities (should be moved to CDC.xml later...)
371 m_clockFreq4TDC = geom.getClockFrequency();
372 if (not m_clockSettings.isValid())
373 B2FATAL("HardwareClockSettings payloads are not valid.");
374 const double officialClockFreq4TDC = 2 * m_clockSettings->getAcceleratorRF(); // in GHz
375 if (abs(m_clockFreq4TDC - officialClockFreq4TDC) / m_clockFreq4TDC > 1.e-4) {
376 B2WARNING("ClockFreq4TDC changed from cdclocal " << scientific << setprecision(6) << m_clockFreq4TDC << " to official " <<
377 officialClockFreq4TDC << " (GHz) (difference larger than 0.01%)");
378 m_clockFreq4TDC = officialClockFreq4TDC;
379 }
380 B2DEBUG(100, "CDCGeometryPar: Clock freq. for TDC= " << m_clockFreq4TDC << " (GHz).");
381 m_tdcBinWidth = 1. / m_clockFreq4TDC; //in ns
382 B2DEBUG(100, "CDCGeometryPar: TDC bin width= " << m_tdcBinWidth << " (ns).");
383
384 m_nominalDriftV = 4.e-3; //in cm/ns
385 m_nominalDriftVInv = 1. / m_nominalDriftV; //in ns/cm
386 m_nominalPropSpeed = 27.25; //in cm/nsec (Belle's result, provided by iwasaki san)
387
388 m_nominalSpaceResol = geom.getNominalSpaceResolution();
390
391 //Set displacement params. (from input data)
393 B2DEBUG(100, "CDCGeometryPar: Load displacement params. (=1); not load (=0):" << m_displacement);
394 if (m_displacement) {
395 if (gcp.getDisplacementInputType()) {
396 B2DEBUG(100, "CDCGeometryPar: Read displacement from DB");
398 } else {
399 readWirePositionParams(c_Base, &geom);
400 }
401 }
402
403 //Set alignment params. (from input data)
405 B2DEBUG(100, "CDCGeometryPar: Load alignment params. (=1); not load (=0):" <<
407 if (m_alignment) {
408 if (gcp.getAlignmentInputType()) {
409 B2DEBUG(100, "CDCGeometryPar: Read alignment from DB");
411 } else {
412 readWirePositionParams(c_Aligned, &geom);
413 }
414 }
415
416 //Set misalignment params. (from input data)
418 B2DEBUG(100, "CDCGeometryPar: Load misalignment params. (=1); not load (=0):" <<
420 if (m_misalignment) {
421 if (gcp.getMisalignmentInputType()) {
422 B2DEBUG(100, "CDCGeometryPar: Read misalignment from DB");
424 } else {
425 readWirePositionParams(c_Misaligned, &geom);
426 }
427 }
428
429 // Get control params. for CDC FullSim
434 if (m_modLeftRightFlag) {
435 B2FATAL("ModifiedLeftRightFlag = true is disabled for now; need to update a G4-related code in framework...");
436 }
437 //N.B. The following two lines are hard-coded since only =1 are used now.
438 m_xtFileFormat = 1;
440
441 m_XTetc = true;
442 if (m_XTetc) {
443 if (gcp.getXtInputType()) {
444 B2DEBUG(100, "CDCGeometryPar: Read xt from DB");
445 setXtRel(); //Set xt param. (from DB)
446 } else {
447 readXT(gbxParams); //Read xt params. (from file)
448 }
449
450 if (gcp.getSigmaInputType()) {
451 B2DEBUG(100, "CDCGeometryPar: Read sigma from DB");
452 setSResol(); //Set sigma param. (from DB)
453 } else {
454 readSigma(gbxParams); //Read sigma params. (from file)
455 }
456
457 if (gcp.getFFactorInputType()) {
458 B2DEBUG(100, "CDCGeometryPar: Read fudge factors from DB");
459 setFFactor(); //Set fudge factors (from DB)
460 } else {
461 readFFactor(gbxParams); //Read fudge factors (from file)
462 }
463
464 if (gcp.getPropSpeedInputType()) {
465 B2DEBUG(100, "CDCGeometryPar: Read prop-speed from DB");
466 setPropSpeed(); //Set prop-speed (from DB)
467 } else {
468 readPropSpeed(gbxParams); //Read propagation speed
469 }
470
471 if (gcp.getT0InputType()) {
472 B2DEBUG(100, "CDCGeometryPar: Read t0 from DB");
473 setT0(); //Set t0 (from DB)
474 } else {
475 readT0(gbxParams); //Read t0 (from file)
476 }
477
478 if (gcp.getBwInputType()) {
479 B2DEBUG(100, "CDCGeometryPar: Read badwire from DB");
480 setBadWire(); //Set bad-wire (from DB)
481 } else {
482 // readBadWire(gbxParams); //Read bad-wire (from file)
483 B2FATAL("Text file input mode for bdwires is disabled now!");
484 }
485
486 if (gcp.getChMapInputType()) {
487 B2DEBUG(100, "CDCGeometryPar: Read ch-map from DB");
488 setChMap(); //Set ch-map (from DB)
489 } else {
490 readChMap(); //Read ch-map
491 }
492
493 if (gcp.getTwInputType()) {
494 B2DEBUG(100, "CDCGeometryPar: Read time-walk from DB");
495 setTW(); //Set time-walk coeffs. (from DB)
496 } else {
497 readTW(gbxParams); //Read time-walk coeffs. (from file)
498 }
499 B2DEBUG(100, "CDCGeometryPar: Time-walk param. mode= " << m_twParamMode);
500
501 if (gcp.getEDepToADCInputType()) {
502 B2DEBUG(29, "CDCGeometryPar: Read EDepToADC from DB");
503 if ((*m_eDepToADCConversionsFromDB).isValid()) {
504 setEDepToADCConversions(); //Set edep-to-adc (from DB)
505 }
506 } else {
507 readEDepToADC(gbxParams); //Read edep-to-adc params. (from file)
508 }
509 }
510
511 m_XTetc4Recon = 0;
512 // B2INFO("CDCGeometryPar: Load x-t etc. params. for reconstruction (=1); not load and use the same ones for digitization (=0):" <<
513 // B2INFO("CDCGeometryPar: Use the same x-t etc. for reconstruction as those used for digitization");
514 if (m_XTetc4Recon) {
515 readXT(gbxParams, 1);
516 readSigma(gbxParams, 1);
517 readPropSpeed(gbxParams, 1);
518 readT0(gbxParams, 1);
519 readTW(gbxParams, 1);
520 }
521
522 //calculate and save shifts in super-layers
524
525}
bool getDebug() const
Get debug flag.
double getMaterialDefinitionMode() const
Get material definition mode.
bool getAlignment() const
Get alignment switch.
bool getDisplacement() const
Get displacement switch.
int getSenseWireZposMode() const
Get sense wire z position mode.
void readSigma(const GearDir &gbxParams, int mode=0)
Read spatial resolution table.
void readTW(const GearDir &gbxParams, int mode=0)
Read time-walk parameter.
void readT0(const GearDir &gbxParams, int mode=0)
Read t0 parameters (from a file).
bool m_alignment
Switch for alignment.
void readEDepToADC(const GearDir &gbxParams, int mode=0)
Read spatial edep-to-adc conv.
void setDesignWirParam(unsigned layerID, unsigned cellID)
Set the desizend wire parameters.
bool m_XTetc
Switch for reading x-t etc.
void setShiftInSuperLayer()
Calculates and saves shifts in super-layers (to be used in searching hits in neighboring cells)
bool m_XTetc4Recon
Switch for selecting xt etc.
DBObjPtr< HardwareClockSettings > m_clockSettings
hardware clock settings
bool m_debug
Switch for debug printing.
void readWirePositionParams(EWirePosition set, const CDCGeometry *geom)
Read displacement or (mis)alignment params from text file.
bool m_displacement
Switch for displacement.
void readPropSpeed(const GearDir &gbxParams, int mode=0)
Read the propagation speed along the sense wire.
int m_xtFileFormat
Format of xt input file.
int m_sigmaFileFormat
Format of sigma input file.
void readChMap()
Read channel map between wire-id and electronics-id.
bool m_misalignment
Switch for misalignment.
void readFFactor(const GearDir &gbxParams, int mode=0)
Read fudge factors.
void readXT(const GearDir &gbxParams, int mode=0)
Read XT-relation table.
bool getModLeftRightFlag() const
Get modified left/right flag.
double getMinTrackLength() const
Get minimum track length.
double getThresholdEnergyDeposit() const
Get threshold for Energy Deposit;.
static CDCSimControlPar & getInstance()
Static method to get a reference to the CDCSimControlPar instance.
bool getWireSag() const
Get wiresag flag.
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31

◆ readPropSpeed()

void readPropSpeed ( const GearDir gbxParams,
int  mode = 0 
)

Read the propagation speed along the sense wire.

Parameters
gbxParamsGear Dir.
mode0: read simulation file, 1: read reconstruction file.

Definition at line 1081 of file CDCGeometryPar.cc.

1082{
1083 std::string fileName0 = CDCGeoControlPar::getInstance().getPropSpeedFile();
1084 if (mode == 1) {
1085 fileName0 = gbxParams.getString("propSpeed4ReconFileName");
1086 }
1087
1088 ifstream ifs;
1089 // openFile(ifs, fileName0);
1090 openFileA(ifs, fileName0);
1091
1092 uint iL;
1093 double speed;
1094 unsigned nRead = 0;
1095
1096 while (true) {
1097 ifs >> iL >> speed;
1098 if (ifs.eof()) break;
1099
1100 ++nRead;
1101
1102 m_propSpeedInv[iL] = (iL < m_firstLayerOffset) ? 0 : 1. / speed;
1103
1104 if (m_debug) B2DEBUG(150, iL << " " << speed);
1105 }
1106
1107 if (nRead != c_maxNSenseLayers) B2FATAL("CDCGeometryPar::readPropSpeed: #lines read-in (=" << nRead <<
1108 ") is inconsistent with total #layers (=" << c_maxNSenseLayers << ") !");
1109
1110 ifs.close();
1111}
std::string getPropSpeedFile() const
Get input file name for prop-speed.

◆ readSigma()

void readSigma ( const GearDir gbxParams,
int  mode = 0 
)

Read spatial resolution table.

Parameters
gbxParamsGear Dir.
mode0: read simulation file, 1: read reconstruction file.

Definition at line 948 of file CDCGeometryPar.cc.

949{
950 if (m_sigmaFileFormat == 0) {
951 // oldReadSigma(gbxParams, mode);
952 } else {
953 newReadSigma(gbxParams, mode);
954 }
955}
void newReadSigma(const GearDir &gbxParams, int mode=0)
Read spatial resolution table in new format.

◆ readT0()

void readT0 ( const GearDir gbxParams,
int  mode = 0 
)

Read t0 parameters (from a file).

Parameters
gbxParamsGear Dir.
mode0: read simulation file, 1: read reconstruction file.

Definition at line 1149 of file CDCGeometryPar.cc.

1150{
1151 std::string fileName0 = CDCGeoControlPar::getInstance().getT0File();
1152 if (mode == 1) {
1153 fileName0 = gbxParams.getString("t04ReconFileName");
1154 }
1155
1156 ifstream ifs;
1157 // openFile(ifs, fileName0);
1158 openFileA(ifs, fileName0);
1159
1160 uint iL(0), iC(0);
1161 float t0(0);
1162 unsigned nRead = 0;
1163
1164 while (true) {
1165 ifs >> iL >> iC >> t0;
1166
1167 if (iL < m_firstLayerOffset) {
1168 continue;
1169 }
1170
1171 if (ifs.eof()) break;
1172
1173 ++nRead;
1174
1175 m_t0[iL][iC] = (iL < m_firstLayerOffset) ? 0. : t0;
1176
1177 if (m_debug) {
1178 B2DEBUG(150, iL << " " << iC << " " << t0);
1179 }
1180 }
1181
1182 if (nRead != m_nSenseWires) B2FATAL("CDCGeometryPar::readT0: #lines read-in (=" << nRead <<
1183 ") is inconsistent with total #sense wires (=" << m_nSenseWires << ") !");
1184
1185 ifs.close();
1186
1187 calcMeanT0();
1188}
std::string getT0File() const
Get input file name for t0.
void calcMeanT0(double minT0=3800, double maxT0=5800, int maxIt=10, double nStdv=3, double epsi=0.1)
Calculate mean t0 in ns (over all good wires)

◆ readTW()

void readTW ( const GearDir gbxParams,
int  mode = 0 
)

Read time-walk parameter.

Parameters
gbxParamsGear Dir.
mode0: read simulation file, 1: read reconstruction file.

Definition at line 1230 of file CDCGeometryPar.cc.

1231{
1232 std::string fileName0 = CDCGeoControlPar::getInstance().getTwFile();
1233 if (mode == 1) {
1234 fileName0 = gbxParams.getString("tw4ReconFileName");
1235 }
1236
1237 ifstream ifs;
1238 // openFile(ifs, fileName0);
1239 openFileA(ifs, fileName0);
1240
1241 unsigned short nPars(0);
1242 ifs >> m_twParamMode >> nPars;
1243 if (m_twParamMode > 1) {
1244 B2FATAL("CDCGeometryPar::readTW: invalid mode specified!");
1245 }
1246 if (nPars > 2) {
1247 B2FATAL("CDCGeometryPar::readTW: invalid #params specified!");
1248 }
1249
1250 unsigned iBoard = 0;
1251 unsigned nRead = 0;
1252 // Read board id and coefficients
1253 while (ifs >> iBoard) {
1254 for (unsigned short i = 0; i < nPars; ++i) {
1255 ifs >> m_timeWalkCoef[iBoard][i];
1256 }
1257 ++nRead;
1258 }
1259
1260 if (nRead != c_nBoards) B2FATAL("CDCGeometryPar::readTW: #lines read-in (=" << nRead << ") is inconsistent with #boards (=" <<
1261 c_nBoards
1262 << ") !");
1263
1264 ifs.close();
1265}
std::string getTwFile() const
Get input file name for time-walk.

◆ readWirePositionParams()

void readWirePositionParams ( EWirePosition  set,
const CDCGeometry geom 
)

Read displacement or (mis)alignment params from text file.

Parameters
[in]setWire position set, i.e. c_Base, c_Misaliged or c_Aligned.
[in]geomPointer to DB CDCGeometry db object.

Definition at line 572 of file CDCGeometryPar.cc.

573{
574
575 std::string fileName0;
577 if (geom) {
578 if (set == c_Base) {
579 fileName0 = gcp.getDisplacementFile();
580 } else if (set == c_Misaligned) {
581 fileName0 = gcp.getMisalignmentFile();
582 } else if (set == c_Aligned) {
583 fileName0 = gcp.getAlignmentFile();
584 }
585 } else {
586 if (set == c_Base) {
587 fileName0 = gcp.getDisplacementFile();
588 } else if (set == c_Misaligned) {
589 fileName0 = gcp.getMisalignmentFile();
590 } else if (set == c_Aligned) {
591 fileName0 = gcp.getAlignmentFile();
592 }
593 }
594
595 // ifstream ifs;
596 // openFile(ifs, fileName0);
597 boost::iostreams::filtering_istream ifs;
598 openFileB(ifs, fileName0);
599
600 uint iL(0), iC(0);
601 const int np = 3;
602 double back[np], fwrd[np], tension;
603 unsigned nRead = 0;
604
605 while (true) {
606 ifs >> iL >> iC;
607 for (int i = 0; i < np; ++i) {
608 ifs >> back[i];
609 }
610 for (int i = 0; i < np; ++i) {
611 ifs >> fwrd[i];
612 }
613 // if (set != c_Base) ifs >> tension;
614 ifs >> tension;
615
616 if (ifs.eof()) break;
617
618 if (iL < m_firstLayerOffset) {
619 continue;
620 }
621
622 ++nRead;
623
624 for (int i = 0; i < np; ++i) {
625 if (set == c_Base) {
626 m_BWirPos[iL][iC][i] += (iL < m_firstLayerOffset) ? 0 : back[i];
627 m_FWirPos[iL][iC][i] += (iL < m_firstLayerOffset) ? 0 : fwrd[i];
628 } else if (set == c_Misaligned) {
629 m_BWirPosMisalign[iL][iC][i] = m_BWirPos[iL][iC][i] + ((iL < m_firstLayerOffset) ? 0 : back[i]);
630 m_FWirPosMisalign[iL][iC][i] = m_FWirPos[iL][iC][i] + ((iL < m_firstLayerOffset) ? 0 : fwrd[i]);
631 } else if (set == c_Aligned) {
632 m_BWirPosAlign[iL][iC][i] = m_BWirPos[iL][iC][i] + ((iL < m_firstLayerOffset) ? 0 : back[i]);
633 m_FWirPosAlign[iL][iC][i] = m_FWirPos[iL][iC][i] + ((iL < m_firstLayerOffset) ? 0 : fwrd[i]);
634 }
635 }
636
637 // double baseTension = 0.;
638
639 if (set == c_Base) {
641 (8.*(m_senseWireTension + tension));
642 // std::cout <<"base iL, iC, m_senseWireTension, tension= " << iL <<" " << iC <<" "<< m_senseWireTension <<" "<< tension << std::endl;
643 } else if (set == c_Misaligned) {
644 double baseTension = M_PI * m_senseWireDensity * m_senseWireDiameter * m_senseWireDiameter / (8.* m_WireSagCoef[iL][iC]);
646 m_senseWireDiameter / (8.* (baseTension + tension));
647 // std::cout <<"misa iL, iC,basetension, tension= " << iL <<" " << iC <<" "<< baseTension <<" "<< tension << std::endl;
648 } else if (set == c_Aligned) {
649 double baseTension = M_PI * m_senseWireDensity * m_senseWireDiameter * m_senseWireDiameter / (8.* m_WireSagCoef[iL][iC]);
651 m_senseWireDiameter / (8.*(baseTension + tension));
652 // std::cout <<"algn iL, iC,basetension, tension= " << iL <<" " << iC <<" "<< baseTension <<" "<< tension << std::endl;
653 }
654 // std::cout << "baseTension,tension= " << baseTension <<" "<< tension << std::endl;
655
656 /*
657 if (m_debug) {
658 std::cout << iL << " " << iC;
659 for (int i = 0; i < np; ++i) cout << " " << back[i];
660 for (int i = 0; i < np; ++i) cout << " " << fwrd[i];
661 std::cout << " " << tension << std::endl;
662 }
663 */
664
665 }
666
667 if (nRead != m_nSenseWires) B2FATAL("CDCGeometryPar::readWirePositionParams: #lines read-in (=" << nRead <<
668 ") is inconsistent with total #sense wires (=" << m_nSenseWires << ") !");
669
670 // ifs.close();
671 boost::iostreams::close(ifs);
672}
std::string getDisplacementFile() const
Get input file name for wire displacement.
std::string getMisalignmentFile() const
Get input file name for wire misalignment.
std::string getAlignmentFile() const
Get input file name for wire alignment.

◆ readXT()

void readXT ( const GearDir gbxParams,
int  mode = 0 
)

Read XT-relation table.

Parameters
[in]gbxParamsGear Dir.
[in]mode0: read simulation file, 1: read reconstruction file.

Definition at line 800 of file CDCGeometryPar.cc.

801{
802 if (m_xtFileFormat == 0) {
803 // oldReadXT(gbxParams, mode);
804 } else {
805 newReadXT(gbxParams, mode);
806 }
807}
void newReadXT(const GearDir &gbxParams, int mode=0)
Read XT-relation table in new format.

◆ senseWireBZ()

double senseWireBZ ( int  layerId) const
inline

Returns backward z position of sense wire in each layer.

Parameters
layerIdThe layer id.
Returns
The backward z position of sense wire in layer layerId.

Definition at line 1284 of file CDCGeometryPar.h.

1285 {
1286 return m_zSBackwardLayer[layerID];
1287 }

◆ senseWireDiameter()

double senseWireDiameter ( ) const
inline

Returns diameter of the sense wire.

Returns
Diameter of the sense wire.

Definition at line 1344 of file CDCGeometryPar.h.

1345 {
1346 return m_senseWireDiameter;
1347 }

◆ senseWireFZ()

double senseWireFZ ( int  layerId) const
inline

Returns forward z position of sense wire in each layer.

Parameters
layerIdThe layer id.
Returns
The forward z position of sense wire in layer layerId.

Definition at line 1279 of file CDCGeometryPar.h.

1280 {
1281 return m_zSForwardLayer[layerID];
1282 }

◆ senseWireR()

double senseWireR ( int  layerId) const
inline

Returns radius of sense wire in each layer.

Parameters
layerIdThe layer id.
Returns
The radius of sense wire in layer layerId.

Definition at line 1274 of file CDCGeometryPar.h.

1275 {
1276 return m_rSLayer[layerID];
1277 }

◆ setBadWire()

void setBadWire ( )

Set bad-wires (from DB)

Definition at line 1427 of file CDCGeometryPar.cc.

1428{
1429 // m_badWire = (*m_badWireFromDB)->getWires();
1430 calcMeanT0();
1431}

◆ setChMap()

void setChMap ( )

Set channel map (from DB)

Definition at line 1588 of file CDCGeometryPar.cc.

1589{
1590 for (const auto& cm : (*m_chMapFromDB)) {
1591 const unsigned short isl = cm.getISuperLayer();
1592 if (isl >= c_nSuperLayers or isl < m_firstSuperLayerOffset) continue;
1593 const uint il = cm.getILayer();
1594 const int iw = cm.getIWire();
1595 const int iBd = cm.getBoardID();
1596 const WireID wID(isl, il, iw);
1597 m_wireToBoard.insert(pair<WireID, unsigned short>(wID, iBd));
1598 const int iCh = cm.getBoardChannel();
1599 m_wireToChannel.insert(pair<WireID, unsigned short>(wID, iCh));
1600 m_boardAndChannelToWire[iBd][iCh] = wID.getEWire();
1601 }
1602}

◆ setDesignWirParam()

void setDesignWirParam ( unsigned  layerID,
unsigned  cellID 
)

Set the desizend wire parameters.

Parameters
[in]layerIDLayer ID
[in]cellIDCell ID

Definition at line 2053 of file CDCGeometryPar.cc.

2054{
2055 const unsigned L = layerID;
2056 const unsigned C = cellID;
2057
2058 const double offset = m_offSet[L];
2059 //...Offset modification to be aligned to axial at z=0...
2060 const double phiSize = 2 * M_PI / double(m_nWires[L]);
2061
2062 const double phiF = phiSize * (double(C) + offset)
2063 + phiSize * 0.5 * double(m_nShifts[L]) + m_globalPhiRotation;
2064
2065 m_FWirPos[L][C][0] = (L < m_firstLayerOffset) ? 0. : m_rSLayer[L] * cos(phiF);
2066 m_FWirPos[L][C][1] = (L < m_firstLayerOffset) ? 0. : m_rSLayer[L] * sin(phiF);
2067 m_FWirPos[L][C][2] = (L < m_firstLayerOffset) ? 0. : m_zSForwardLayer[L];
2068
2069 const double phiB = phiSize * (double(C) + offset) + m_globalPhiRotation;
2070
2071 m_BWirPos[L][C][0] = (L < m_firstLayerOffset) ? 0. : m_rSLayer[L] * cos(phiB);
2072 m_BWirPos[L][C][1] = (L < m_firstLayerOffset) ? 0. : m_rSLayer[L] * sin(phiB);
2073 m_BWirPos[L][C][2] = (L < m_firstLayerOffset) ? 0. : m_zSBackwardLayer[L];
2074
2075 for (int i = 0; i < 3; ++i) {
2076 m_FWirPosMisalign[L][C][i] = (L < m_firstLayerOffset) ? 0. : m_FWirPos[L][C][i];
2077 m_BWirPosMisalign[L][C][i] = (L < m_firstLayerOffset) ? 0. : m_BWirPos[L][C][i];
2078 m_FWirPosAlign [L][C][i] = (L < m_firstLayerOffset) ? 0. : m_FWirPos[L][C][i];
2079 m_BWirPosAlign [L][C][i] = (L < m_firstLayerOffset) ? 0. : m_BWirPos[L][C][i];
2080 }
2081
2083 (8. * m_senseWireTension);
2084 // m_WireSagCoef [L][C] = 0.;
2085 m_WireSagCoefMisalign[L][C] = (L < m_firstLayerOffset) ? 0. : m_WireSagCoef[L][C];
2086 m_WireSagCoefAlign [L][C] = (L < m_firstLayerOffset) ? 0. : m_WireSagCoef[L][C];
2087
2088}

◆ setDisplacement()

void setDisplacement ( )

Set displacement of sense wire.

Definition at line 2951 of file CDCGeometryPar.cc.

2952{
2953 // std::cout <<"setDisplacement called" << std::endl;
2954 for (const auto& disp : (*m_displacementFromDB)) {
2955 // const int iLayer0 = disp.getICLayer();
2956 // const int iWire0 = disp.getIWire();
2957 const int iLayer = WireID(disp.getEWire()).getICLayer();
2958 const int iWire = WireID(disp.getEWire()).getIWire();
2959 // if (iLayer0 != iLayer) B2FATAL("Layer0 != Layer");
2960 // if (iWire0 != iWire) B2FATAL("Wire0 != Wire");
2961 m_FWirPos[iLayer][iWire][0] += (iLayer < m_firstLayerOffset) ? 0. : disp.getXFwd();
2962 m_FWirPos[iLayer][iWire][1] += (iLayer < m_firstLayerOffset) ? 0. : disp.getYFwd();
2963 m_FWirPos[iLayer][iWire][2] += (iLayer < m_firstLayerOffset) ? 0. : disp.getZFwd();
2964 m_BWirPos[iLayer][iWire][0] += (iLayer < m_firstLayerOffset) ? 0. : disp.getXBwd();
2965 m_BWirPos[iLayer][iWire][1] += (iLayer < m_firstLayerOffset) ? 0. : disp.getYBwd();
2966 m_BWirPos[iLayer][iWire][2] += (iLayer < m_firstLayerOffset) ? 0. : disp.getZBwd();
2967 m_WireSagCoef[iLayer][iWire] = (iLayer < m_firstLayerOffset) ? 0. : M_PI * m_senseWireDensity * m_senseWireDiameter *
2968 m_senseWireDiameter / (8.*
2969 (m_senseWireTension + disp.getTension()));
2970 // std::cout <<"setdisp iL, iC, nominaltension, tension= " << iLayer <<" " << iWire <<" "<< m_senseWireTension <<" "<< disp.getTension() << std::endl;
2971 }
2972}
unsigned short getICLayer() const
Getter for continuous layer numbering.
Definition: WireID.cc:24
unsigned short getIWire() const
Getter for wire within the layer.
Definition: WireID.h:145

◆ setEDepToADCConversions()

void setEDepToADCConversions ( )

Set edep-to-ADC conversion params.

(from DB)

Definition at line 1605 of file CDCGeometryPar.cc.

1606{
1607 unsigned short groupId = (*m_eDepToADCConversionsFromDB)->getGroupID();
1608 unsigned short nEnt = (*m_eDepToADCConversionsFromDB)->getEntries();
1609 if (groupId == 0) { //per super-layer mode
1610 if (nEnt > c_nSuperLayers) B2FATAL("CDCGeometryPar:: group-id " << groupId << " and #entries " << nEnt << " are inconsistent!");
1611 } else if (groupId == 1) { //per layer mode
1612 if (nEnt > c_maxNSenseLayers) B2FATAL("CDCGeometryPar:: group-id " << groupId << " and #entries " << nEnt << " are inconsistent!");
1613 } else {
1614 B2FATAL("CDCGeometryPar:: Invalid group-id " << groupId << " specified !");
1615 }
1616
1617 unsigned short cLMin[c_nSuperLayers], cLMax[c_nSuperLayers]; //min and max clayer per super-layer
1618 cLMin[0] = 0;
1619 cLMax[0] = 7;
1620 for (unsigned int sl = 1; sl < c_nSuperLayers; ++sl) {
1621 cLMin[sl] = cLMax[0] + 6 * sl - 5;
1622 cLMax[sl] = cLMax[0] + 6 * sl;
1623 }
1624
1625 for (unsigned short id = 0; id < nEnt; ++id) {
1626 unsigned short np = ((*m_eDepToADCConversionsFromDB)->getParams(id)).size();
1627 if (np > 7) B2FATAL("CDCGeometryPar:: No. of edep-to-ADC conversion params. > 7");
1628 if (groupId == 0) { //per super-layer; id=super-layer
1629 for (unsigned short cL = cLMin[id]; cL <= cLMax[id]; ++cL) { //clayer loop
1630 for (unsigned short cell = 0; cell < m_nWires[cL]; ++cell) { //cell loop
1631 for (unsigned short i = 0; i < np; ++i) {
1632 m_eDepToADCParams[cL][cell][i] = (cL < m_firstLayerOffset) ? 0. : ((*m_eDepToADCConversionsFromDB)->getParams(id))[i];
1633 }
1634 }
1635 }
1636 } else if (groupId == 1) { //per clayer; id=clayer
1637 for (unsigned short cell = 0; cell < m_nWires[id]; ++cell) { //cell loop
1638 for (unsigned short i = 0; i < np; ++i) {
1639 m_eDepToADCParams[id][cell][i] = (id < m_firstLayerOffset) ? 0. : ((*m_eDepToADCConversionsFromDB)->getParams(id))[i];
1640 }
1641 }
1642 } else if (groupId == 2) { //per wire
1643 //not ready
1644 B2FATAL("CDCGeometryPar::setEDepToADCConversions(): groupId=2 not ready!");
1645 }
1646 }
1647}

◆ setFFactor()

void setFFactor ( )

Set fudge factors (from DB).

Definition at line 1560 of file CDCGeometryPar.cc.

1561{
1562 unsigned short groupId = (*m_fFactorFromDB)->getGroupID();
1563 unsigned short nEnt = (*m_fFactorFromDB)->getEntries();
1564 B2DEBUG(29, "setFFactor called: groupId,nEnt= " << groupId << " " << nEnt);
1565
1566 if (groupId == 0) { //per all-layers mode
1567 } else {
1568 B2FATAL("CDCGeometryPar:: Invalid group-id " << groupId << " specified!");
1569 }
1570
1571 for (unsigned short id = 0; id < nEnt; ++id) {
1572 unsigned short np = ((*m_fFactorFromDB)->getFactors(id)).size();
1573 if (np != 3) B2FATAL("CDCGeometryPar:: No. of fudge factors != 3!");
1574 for (unsigned short i = 0; i < np; ++i) {
1575 m_fudgeFactorForSigma[i] = ((*m_fFactorFromDB)->getFactors(id))[i];
1576 B2DEBUG(29, i << " " << m_fudgeFactorForSigma[i]);
1577 }
1578 }
1579
1583 B2DEBUG(29, "fudge factors= " << m_fudgeFactorForSigma[0] << " " << m_fudgeFactorForSigma[1] << " " << m_fudgeFactorForSigma[2]);
1584}
double getAddFudgeFactorForSigmaForMC() const
Get additional fudge factor for space resol for MC.
double getAddFudgeFactorForSigmaForData() const
Get additional fudge factor for space resol for data.

◆ setNominalSpaceResol()

void setNominalSpaceResol ( double  resol)
inline

Set the nominal spatial resolution in the unit of um.

Parameters
[in]resolspatial resolution (um)

Definition at line 815 of file CDCGeometryPar.h.

816 {
817 m_nominalSpaceResol = resol;
818 }

◆ setPropSpeed()

void setPropSpeed ( )

Set prop.

-speeds (from DB).

Definition at line 1435 of file CDCGeometryPar.cc.

1436{
1437 for (unsigned short iCL = 0; iCL < (*m_propSpeedFromDB)->getEntries(); ++iCL) {
1438 m_propSpeedInv[iCL] = (iCL < m_firstLayerOffset) ? 0. : 1. / (*m_propSpeedFromDB)->getSpeed(iCL);
1439 }
1440}

◆ setSenseWireBZ()

void setSenseWireBZ ( int  layerId,
double  bz 
)
inline

set backward z position of sense wires.

Parameters
layerIdThe layer id of sense wire.
bzThe backward position of sense wires in layer layerId.

Definition at line 1269 of file CDCGeometryPar.h.

1270 {
1271 m_zSBackwardLayer[layerId] = bz;
1272 }

◆ setSenseWireFZ()

void setSenseWireFZ ( int  layerId,
double  fz 
)
inline

Set forward z position of sense wires.

Parameters
layerIdThe layer id of sense wire.
fzThe forward position of sense wires in layer layerId.

Definition at line 1264 of file CDCGeometryPar.h.

1265 {
1266 m_zSForwardLayer[layerId] = fz;
1267 }

◆ setSenseWireR()

void setSenseWireR ( int  layerId,
double  r 
)
inline

Set radius of sense wire in each layer.

Parameters
layerIdThe layer id of sense wires.
rThe radius of sense wires in layer layerId.

Definition at line 1259 of file CDCGeometryPar.h.

1260 {
1261 m_rSLayer[layerId] = r;
1262 }

◆ setShiftInSuperLayer()

void setShiftInSuperLayer ( )

Calculates and saves shifts in super-layers (to be used in searching hits in neighboring cells)

Definition at line 2975 of file CDCGeometryPar.cc.

2976{
2977 const unsigned short nLayers[c_nSuperLayers] = {8, 6, 6, 6, 6, 6, 6, 6, 6}; //tentative
2978
2979 for (unsigned short SLayer = 0; SLayer < c_nSuperLayers; ++SLayer) {
2980 unsigned short firstCLayer = 0;
2981 for (unsigned short i = 0; i < SLayer; ++i) {
2982 firstCLayer += nLayers[i];
2983 }
2984 // std::cout <<"SLayer,firstCLayer= " << SLayer <<" "<< firstCLayer << std::endl;
2985
2986 B2Vector3D firstBPos = wireBackwardPosition(firstCLayer, 0);
2987 for (unsigned short Layer = 0; Layer < nLayers[SLayer]; ++Layer) {
2988 unsigned short CLayer = firstCLayer + Layer;
2989
2990 if (CLayer == firstCLayer) {
2991 m_shiftInSuperLayer[SLayer][Layer] = 0;
2992
2993 } else if (CLayer == firstCLayer + 1) {
2994 B2Vector3D BPos = wireBackwardPosition(CLayer, 0);
2995 m_shiftInSuperLayer[SLayer][Layer] = (BPos.Cross(firstBPos)).Z() > 0. ? -1 : 1;
2996 // std::cout <<"CLayer,Layer,shift= " << CLayer <<" "<< Layer <<" "<< m_shiftInSuperLayer[SLayer][Layer] <<" "<< (BPos.Cross(firstBPos)).Z() << std::endl;
2997
2998 } else {
2999 if (Layer % 2 == 0) {
3000 m_shiftInSuperLayer[SLayer][Layer] = 0;
3001 } else {
3002 m_shiftInSuperLayer[SLayer][Layer] = m_shiftInSuperLayer[SLayer][1];
3003 }
3004 }
3005 // std::cout <<"CLayer,Layer,shift= " << CLayer <<" "<< Layer <<" "<< m_shiftInSuperLayer[SLayer][Layer] << std::endl;
3006 }
3007 }
3008}
const B2Vector3D wireBackwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the backward position of the input sense wire.

◆ setSResol()

void setSResol ( )

Set spatial resolution (from DB).

Definition at line 1517 of file CDCGeometryPar.cc.

1518{
1519 m_linearInterpolationOfSgm = true; //must be true now
1520
1521 // std::cout <<"setSResol called" << std::endl;
1522 m_nAlphaPoints4Sgm = (*m_sResolFromDB)->getNoOfAlphaBins();
1523 for (unsigned short i = 0; i < m_nAlphaPoints4Sgm; ++i) {
1524 m_alphaPoints4Sgm[i] = (*m_sResolFromDB)->getAlphaPoint(i);
1525 // std::cout << m_alphaPoints4Sgm[i]*180./M_PI << std::endl;
1526 }
1527
1528 m_nThetaPoints4Sgm = (*m_sResolFromDB)->getNoOfThetaBins();
1529 for (unsigned short i = 0; i < m_nThetaPoints4Sgm; ++i) {
1530 m_thetaPoints4Sgm[i] = (*m_sResolFromDB)->getThetaPoint(i);
1531 // std::cout << m_thetaPoints4Sgm[i]*180./M_PI << std::endl;
1532 }
1533
1534 // std::cout << "m_nAlphaPoints4Sgm= " << m_nAlphaPoints4Sgm << std::endl;
1535 // std::cout << "m_nThetaPoints4Sgm= " << m_nThetaPoints4Sgm << std::endl;
1536
1537 m_sigmaParamMode = (*m_sResolFromDB)->getSigmaParamMode();
1538
1539 m_maxSpaceResol = (*m_sResolFromDB)->getMaxSpaceResol();
1540
1541 for (unsigned short iCL = 0; iCL < c_maxNSenseLayers; ++iCL) {
1542 for (unsigned short iLR = 0; iLR < 2; ++iLR) {
1543 for (unsigned short iA = 0; iA < m_nAlphaPoints4Sgm; ++iA) {
1544 for (unsigned short iT = 0; iT < m_nThetaPoints4Sgm; ++iT) {
1545 const std::vector<float> params = (*m_sResolFromDB)->getSigmaParams(iCL, iLR, iA, iT);
1546 unsigned short np = params.size();
1547 // std::cout <<"np4sigma= " << np << std::endl;
1548 for (unsigned short i = 0; i < np; ++i) {
1549 m_Sigma[iCL][iLR][iA][iT][i] = (iCL < m_firstLayerOffset) ? 0. : params[i];
1550 }
1551 }
1552 }
1553 }
1554 }
1555
1556}

◆ setT0()

void setT0 ( )

Set t0 parameters (from DB)

Definition at line 1367 of file CDCGeometryPar.cc.

1368{
1369 for (unsigned short iCL = 0; iCL < c_maxNSenseLayers; ++iCL) {
1370 for (unsigned short iW = 0; iW < c_maxNDriftCells; ++iW) {
1371 m_t0[iCL][iW] = 0.;
1372 }
1373 }
1374
1375 for (auto const& ent : (*m_t0FromDB)->getT0s()) {
1376 const WireID wid = WireID(ent.first);
1377 const unsigned short iCL = wid.getICLayer();
1378 const unsigned short iW = wid.getIWire();
1379 m_t0[iCL][iW] = (iCL < m_firstLayerOffset) ? 0. : ent.second;
1380 }
1381
1382 calcMeanT0();
1383}

◆ setTW()

void setTW ( )

Set time-walk parameters.

Definition at line 1444 of file CDCGeometryPar.cc.

1445{
1446 // (*m_timeWalkFromDB)->dump();
1447 m_twParamMode = (*m_timeWalkFromDB)->getTwParamMode();
1448
1449 for (unsigned short iBd = 0; iBd < (*m_timeWalkFromDB)->getEntries(); ++iBd) {
1450 int np = ((*m_timeWalkFromDB)->getTimeWalkParams(iBd)).size();
1451 for (int i = 0; i < np; ++i) {
1452 m_timeWalkCoef[iBd][i] = ((*m_timeWalkFromDB)->getTimeWalkParams(iBd))[i];
1453 }
1454 }
1455}

◆ setWirPosAlignParams()

void setWirPosAlignParams ( )

Set wire alignment params.

from DB.

Definition at line 676 of file CDCGeometryPar.cc.

677{
678 // Layer alignment
679 for (unsigned iL = 0; iL < c_maxNSenseLayers; ++iL) {
680
681 if (iL < m_firstLayerOffset) {
682 continue;
683 }
684
685 // wire number 511 = no wire
686 auto layerID = WireID(iL, 511);
687
688 // Alignment parameters for layer iL
689 double d_layerXbwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerX);
690 double d_layerYbwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerY);
691 double d_layerPhiBwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerPhi);
692
693 double d_layerXfwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerDx) + d_layerXbwd;
694 double d_layerYfwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerDy) + d_layerYbwd;
695 double d_layerPhiFwd = (*m_alignmentFromDB)->get(layerID, CDCAlignment::layerDPhi) + d_layerPhiBwd;
696
697 for (unsigned iC = 0; iC < m_nWires[iL]; ++iC) {
698 // Positions (nominal+displacement) of wire-ends of wire iC in layer iL
699 double wireXbwd = m_BWirPos[iL][iC][0];
700 double wireYbwd = m_BWirPos[iL][iC][1];
701 double wireZbwd = m_BWirPos[iL][iC][2];
702
703 double wireXfwd = m_FWirPos[iL][iC][0];
704 double wireYfwd = m_FWirPos[iL][iC][1];
705 double wireZfwd = m_FWirPos[iL][iC][2];
706
707 // Aligned positions of wire-ends are obtained by rotating "nominal+displacement" positions and shifting them using
708 // common parameters for layer rotation and shifts (at corresponding end-caps)
709 m_BWirPosAlign[iL][iC][0] = d_layerXbwd + cos(d_layerPhiBwd) * wireXbwd + sin(d_layerPhiBwd) * wireYbwd;
710 m_BWirPosAlign[iL][iC][1] = d_layerYbwd - sin(d_layerPhiBwd) * wireXbwd + cos(d_layerPhiBwd) * wireYbwd;
711 m_BWirPosAlign[iL][iC][2] = wireZbwd;
712
713 m_FWirPosAlign[iL][iC][0] = d_layerXfwd + cos(d_layerPhiFwd) * wireXfwd + sin(d_layerPhiFwd) * wireYfwd;
714 m_FWirPosAlign[iL][iC][1] = d_layerYfwd - sin(d_layerPhiFwd) * wireXfwd + cos(d_layerPhiFwd) * wireYfwd;
715 m_FWirPosAlign[iL][iC][2] = wireZfwd;
716 } //end of cell loop
717 } //end of layer loop
718
719 const int np = 3;
720 double back[np], fwrd[np];
721
722 for (unsigned iL = 0; iL < c_maxNSenseLayers; ++iL) {
723
724 if (iL < m_firstLayerOffset) {
725 continue;
726 }
727
728 for (unsigned iC = 0; iC < m_nWires[iL]; ++iC) {
729 // std::cout << "iLiC= " << iL <<" "<< iC << std::endl;
730 WireID wire(iL, iC);
731 back[0] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireBwdX);
732 back[1] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireBwdY);
733 back[2] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireBwdZ);
734
735 fwrd[0] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireFwdX);
736 fwrd[1] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireFwdY);
737 fwrd[2] = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireFwdZ);
738
739 for (int i = 0; i < np; ++i) {
740 // On top of the wire-end positions corrected for layer alignment, we apply possible
741 // fine corrections per wire
742 m_BWirPosAlign[iL][iC][i] += back[i];
743 m_FWirPosAlign[iL][iC][i] += fwrd[i];
744 }
745
746 // double baseTension = 0.;
747 double baseTension = M_PI * m_senseWireDensity * m_senseWireDiameter * m_senseWireDiameter / (8.* m_WireSagCoef[iL][iC]);
748 double tension = (*m_alignmentFromDB)->get(wire, CDCAlignment::wireTension);
749 // std::cout << back[0] <<" "<< back[1] <<" "<< back[2] <<" "<< fwrd[0] <<" "<< fwrd[1] <<" "<< fwrd[2] <<" "<< tension << std::endl;
750 m_WireSagCoefAlign[iL][iC] = M_PI * m_senseWireDensity *
751 m_senseWireDiameter * m_senseWireDiameter / (8.*(baseTension + tension));
752 // std::cout << "baseTension,tension= " << baseTension <<" "<< tension << std::endl;
753 } //end of layer loop
754 } //end of cell loop
755}
static const baseType layerDPhi
Layer rotation in global X-Y plane (gamma) dPhi = forward - backward endplate.
Definition: CDCAlignment.h:61
static const baseType layerDy
Layer shift in global Y dY = forward - backward endplate.
Definition: CDCAlignment.h:59
static const baseType wireBwdZ
Wire Z position w.r.t. nominal on backward endplate.
Definition: CDCAlignment.h:33
static const baseType layerDx
Layer shift in global X dX = forward - backward endplate.
Definition: CDCAlignment.h:57
static const baseType wireBwdY
Wire Y position w.r.t. nominal on backward endplate.
Definition: CDCAlignment.h:31
static const baseType wireFwdZ
Wire Z position w.r.t. nominal on forward endplate.
Definition: CDCAlignment.h:39
static const baseType wireFwdY
Wire Y position w.r.t. nominal on forward endplate.
Definition: CDCAlignment.h:37
static const baseType wireFwdX
Wire X position w.r.t. nominal on forward endplate.
Definition: CDCAlignment.h:35
static const baseType wireBwdX
Wire X position w.r.t. nominal on backward endplate.
Definition: CDCAlignment.h:29
static const baseType layerY
Layer shift in global Y at backward endplate.
Definition: CDCAlignment.h:52
static const baseType layerX
Layer shift in global X at backward endplate.
Definition: CDCAlignment.h:50
static const baseType layerPhi
Layer rotation in global X-Y plane (gamma) at backward endplate.
Definition: CDCAlignment.h:54
static const baseType wireTension
Wire tension w.r.t. nominal (=50. ?)
Definition: CDCAlignment.h:43

◆ setWirPosMisalignParams()

void setWirPosMisalignParams ( )

Set wire misalignment params.

from DB.

Definition at line 760 of file CDCGeometryPar.cc.

761{
762 const int np = 3;
763 double back[np], fwrd[np];
764
765 for (unsigned iL = 0; iL < c_maxNSenseLayers; ++iL) {
766
767 if (iL < m_firstLayerOffset) {
768 continue;
769 }
770
771 for (unsigned iC = 0; iC < m_nWires[iL]; ++iC) {
772 // std::cout << "iLiC= " << iL <<" "<< iC << std::endl;
773 WireID wire(iL, iC);
774 back[0] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireBwdX);
775 back[1] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireBwdY);
776 back[2] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireBwdZ);
777
778 fwrd[0] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireFwdX);
779 fwrd[1] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireFwdY);
780 fwrd[2] = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireFwdZ);
781
782 for (int i = 0; i < np; ++i) {
783 m_BWirPosMisalign[iL][iC][i] = m_BWirPos[iL][iC][i] + back[i];
784 m_FWirPosMisalign[iL][iC][i] = m_FWirPos[iL][iC][i] + fwrd[i];
785 }
786
787 // double baseTension = 0.;
788 double baseTension = M_PI * m_senseWireDensity * m_senseWireDiameter * m_senseWireDiameter / (8.* m_WireSagCoef[iL][iC]);
789 double tension = (*m_misalignmentFromDB)->get(wire, CDCMisalignment::wireTension);
790 // std::cout << back[0] <<" "<< back[1] <<" "<< back[2] <<" "<< fwrd[0] <<" "<< fwrd[1] <<" "<< fwrd[2] <<" "<< tension << std::endl;
792 m_senseWireDiameter * m_senseWireDiameter / (8.*(baseTension + tension));
793 // std::cout << "baseTension,tension= " << baseTension <<" "<< tension << std::endl;
794 } //end of layer loop
795 } //end of cell loop
796}
static const baseType wireBwdZ
Wire Z position w.r.t. nominal on backward endplate.
static const baseType wireBwdY
Wire Y position w.r.t. nominal on backward endplate.
static const baseType wireFwdZ
Wire Z position w.r.t. nominal on forward endplate.
static const baseType wireFwdY
Wire Y position w.r.t. nominal on forward endplate.
static const baseType wireFwdX
Wire X position w.r.t. nominal on forward endplate.
static const baseType wireBwdX
Wire X position w.r.t. nominal on backward endplate.
static const baseType wireTension
Wire tension w.r.t. nominal (=50. ?)

◆ setXtRel()

void setXtRel ( )

Set XT-relation table (from DB) (new).

Definition at line 1459 of file CDCGeometryPar.cc.

1460{
1461 m_linearInterpolationOfXT = true; //must be true now
1462
1463 // std::cout <<"setXtRelation called" << std::endl;
1464 m_nAlphaPoints = (*m_xtRelFromDB)->getNoOfAlphaBins();
1465 for (unsigned short i = 0; i < m_nAlphaPoints; ++i) {
1466 m_alphaPoints[i] = (*m_xtRelFromDB)->getAlphaPoint(i);
1467 // std::cout << m_alphaPoints[i]*180./M_PI << std::endl;
1468 }
1469
1470 m_nThetaPoints = (*m_xtRelFromDB)->getNoOfThetaBins();
1471 for (unsigned short i = 0; i < m_nThetaPoints; ++i) {
1472 m_thetaPoints[i] = (*m_xtRelFromDB)->getThetaPoint(i);
1473 // std::cout << m_thetaPoints[i]*180./M_PI << std::endl;
1474 }
1475
1476 m_xtParamMode = (*m_xtRelFromDB)->getXtParamMode();
1477
1478 for (unsigned short iCL = 0; iCL < c_maxNSenseLayers; ++iCL) {
1479 if (iCL < m_firstLayerOffset) {
1480 // m_XT is initialized to 0, but reading
1481 // (*m_xtRelFromDB)->getXtParams(iCL, iLR, iA, iT)
1482 // could fail if iCL < m_firstLayerOffset, thus continue as m_XT would be set to 0 in this case anyway
1483 continue;
1484 }
1485 for (unsigned short iLR = 0; iLR < 2; ++iLR) {
1486 for (unsigned short iA = 0; iA < m_nAlphaPoints; ++iA) {
1487 for (unsigned short iT = 0; iT < m_nThetaPoints; ++iT) {
1488 const std::vector<float> params = (*m_xtRelFromDB)->getXtParams(iCL, iLR, iA, iT);
1489 unsigned short np = params.size();
1490 // std::cout <<"np4xt= " << np << std::endl;
1491 for (unsigned short i = 0; i < np; ++i) {
1492 m_XT[iCL][iLR][iA][iT][i] = params[i];
1493 }
1494
1495 double boundT = m_XT[iCL][iLR][iA][iT][6];
1496 if (m_xtParamMode == 1) {
1497 m_XT[iCL][iLR][iA][iT][np] = ROOT::Math::Chebyshev5(boundT, m_XT[iCL][iLR][iA][iT][0], m_XT[iCL][iLR][iA][iT][1],
1498 m_XT[iCL][iLR][iA][iT][2], m_XT[iCL][iLR][iA][iT][3], m_XT[iCL][iLR][iA][iT][4], m_XT[iCL][iLR][iA][iT][5]);
1499 } else {
1500 m_XT[iCL][iLR][iA][iT][np] =
1501 m_XT[iCL][iLR][iA][iT][0] + boundT
1502 * (m_XT[iCL][iLR][iA][iT][1] + boundT
1503 * (m_XT[iCL][iLR][iA][iT][2] + boundT
1504 * (m_XT[iCL][iLR][iA][iT][3] + boundT
1505 * (m_XT[iCL][iLR][iA][iT][4] + boundT
1506 * (m_XT[iCL][iLR][iA][iT][5])))));
1507 }
1508 }
1509 }
1510 }
1511 }
1512
1513}

◆ version()

std::string version ( ) const
inline

Returns the version of cdc geometry parameters.

Returns
The version of the cdc geometry parameters.

Definition at line 1229 of file CDCGeometryPar.h.

1230 {
1231 return m_version;
1232 }

◆ wireBackwardPosition() [1/4]

const B2Vector3D wireBackwardPosition ( const WireID wireID,
double  z,
EWirePosition  set = c_Base 
) const
inline

The same function but in a different input format.

Definition at line 500 of file CDCGeometryPar.h.

501 {
502 return wireBackwardPosition(wireID.getICLayer(), wireID.getIWire(), z, set);
503 }

◆ wireBackwardPosition() [2/4]

const B2Vector3D wireBackwardPosition ( const WireID wireID,
EWirePosition  set = c_Base 
) const
inline

The same function but in a different input format.

Definition at line 485 of file CDCGeometryPar.h.

486 {
487 return wireBackwardPosition(wireID.getICLayer(), wireID.getIWire(), set);
488 }

◆ wireBackwardPosition() [3/4]

const B2Vector3D wireBackwardPosition ( uint  layerId,
int  cellId,
double  z,
EWirePosition  set = c_Base 
) const

Returns a virtual backward position corresp. to a tangent to the wire at the input z-position.

Parameters
layerIdThe layer id. of the wire
cellIdThe wire id. of the wire
zz-position
setWire position set; =c_Base, c_Misaligned or c_Aligned
Returns
The virtual backward position of the wire.

Definition at line 1772 of file CDCGeometryPar.cc.

1773{
1774 // return early in case of empty layer, i.e. layerID < m_firstLayerOffset
1775 if (layerID < m_firstLayerOffset) {
1776 return B2Vector3D(0, 0, 0);
1777 }
1778
1779 double yb_sag = 0.;
1780 double yf_sag = 0.;
1781 getWireSagEffect(set, layerID, cellID, z, yb_sag, yf_sag);
1782
1783 B2Vector3D wPos(m_BWirPosAlign[layerID][cellID][0], yb_sag,
1784 m_BWirPosAlign[layerID][cellID][2]);
1785 if (set == c_Misaligned) {
1786 wPos.SetX(m_BWirPosMisalign[layerID][cellID][0]);
1787 wPos.SetZ(m_BWirPosMisalign[layerID][cellID][2]);
1788 } else if (set == c_Base) {
1789 wPos.SetX(m_BWirPos [layerID][cellID][0]);
1790 wPos.SetZ(m_BWirPos [layerID][cellID][2]);
1791 }
1792
1793 return wPos;
1794}
void getWireSagEffect(EWirePosition set, unsigned layerID, unsigned cellID, double zw, double &ywb_sag, double &ywf_sag) const
Compute effects of the sense wire sag.
B2Vector3< double > B2Vector3D
typedef for common usage with double
Definition: B2Vector3.h:516

◆ wireBackwardPosition() [4/4]

const B2Vector3D wireBackwardPosition ( uint  layerId,
int  cellId,
EWirePosition  set = c_Base 
) const

Returns the backward position of the input sense wire.

Parameters
layerIdThe layer id. of the wire
cellIdThe wire id. of the wire
setWire position set; =c_Base, c_Misaligned or c_Aligned
Returns
The backward position of the wire.

Definition at line 1748 of file CDCGeometryPar.cc.

1749{
1750 // return early in case of empty layer, i.e. layerID < m_firstLayerOffset
1751 if (layerID < m_firstLayerOffset) {
1752 return B2Vector3D(0, 0, 0);
1753 }
1754
1755 B2Vector3D wPos(m_BWirPosAlign[layerID][cellID][0],
1756 m_BWirPosAlign[layerID][cellID][1],
1757 m_BWirPosAlign[layerID][cellID][2]);
1758
1759 if (set == c_Misaligned) {
1760 wPos.SetX(m_BWirPosMisalign[layerID][cellID][0]);
1761 wPos.SetY(m_BWirPosMisalign[layerID][cellID][1]);
1762 wPos.SetZ(m_BWirPosMisalign[layerID][cellID][2]);
1763 } else if (set == c_Base) {
1764 wPos.SetX(m_BWirPos [layerID][cellID][0]);
1765 wPos.SetY(m_BWirPos [layerID][cellID][1]);
1766 wPos.SetZ(m_BWirPos [layerID][cellID][2]);
1767 }
1768
1769 return wPos;
1770}

◆ wireForwardPosition() [1/4]

const B2Vector3D wireForwardPosition ( const WireID wireID,
double  z,
EWirePosition  set = c_Base 
) const
inline

The same function but in a different input format.

Definition at line 469 of file CDCGeometryPar.h.

471 {
472 return wireForwardPosition(wireID.getICLayer(), wireID.getIWire(), z, set);
473 }
const B2Vector3D wireForwardPosition(uint layerId, int cellId, EWirePosition set=c_Base) const
Returns the forward position of the input sense wire.

◆ wireForwardPosition() [2/4]

const B2Vector3D wireForwardPosition ( const WireID wireID,
EWirePosition  set = c_Base 
) const
inline

The same function but in a different input format.

Definition at line 454 of file CDCGeometryPar.h.

455 {
456 return wireForwardPosition(wireID.getICLayer(), wireID.getIWire(), set);
457 }

◆ wireForwardPosition() [3/4]

const B2Vector3D wireForwardPosition ( uint  layerId,
int  cellId,
double  z,
EWirePosition  set = c_Base 
) const

Returns a virtual forward position corresp. to a tangent to the wire at the input z-position.

Parameters
layerIdThe layer id. of the wire
cellIdThe wire id. of the wire
zz-position
setWire position set; =c_Base, c_Misaligned or c_Aligned
Returns
The virtual forward position of the wire.

Definition at line 1724 of file CDCGeometryPar.cc.

1725{
1726 // return early in case of empty layer, i.e. layerID < m_firstLayerOffset
1727 if (layerID < m_firstLayerOffset) {
1728 return B2Vector3D(0, 0, 0);
1729 }
1730
1731 double yb_sag = 0.;
1732 double yf_sag = 0.;
1733 getWireSagEffect(set, layerID, cellID, z, yb_sag, yf_sag);
1734
1735 B2Vector3D wPos(m_FWirPosAlign[layerID][cellID][0], yf_sag,
1736 m_FWirPosAlign[layerID][cellID][2]);
1737 if (set == c_Misaligned) {
1738 wPos.SetX(m_FWirPosMisalign[layerID][cellID][0]);
1739 wPos.SetZ(m_FWirPosMisalign[layerID][cellID][2]);
1740 } else if (set == c_Base) {
1741 wPos.SetX(m_FWirPos [layerID][cellID][0]);
1742 wPos.SetZ(m_FWirPos [layerID][cellID][2]);
1743 }
1744
1745 return wPos;
1746}

◆ wireForwardPosition() [4/4]

const B2Vector3D wireForwardPosition ( uint  layerId,
int  cellId,
EWirePosition  set = c_Base 
) const

Returns the forward position of the input sense wire.

Parameters
layerIdThe layer id. of the wire
cellIdThe wire id. of the wire
setWire position set; =c_Base, c_Misaligned or c_Aligned
Returns
The forward position of the wire.

Definition at line 1699 of file CDCGeometryPar.cc.

1700{
1701 // return early in case of empty layer, i.e. layerID < m_firstLayerOffset
1702 if (layerID < m_firstLayerOffset) {
1703 return B2Vector3D(0, 0, 0);
1704 }
1705
1706 // std::cout <<"cdcgeopar::fwdpos set= " << set << std::endl;
1707 B2Vector3D wPos(m_FWirPosAlign[layerID][cellID][0],
1708 m_FWirPosAlign[layerID][cellID][1],
1709 m_FWirPosAlign[layerID][cellID][2]);
1710
1711 if (set == c_Misaligned) {
1712 wPos.SetX(m_FWirPosMisalign[layerID][cellID][0]);
1713 wPos.SetY(m_FWirPosMisalign[layerID][cellID][1]);
1714 wPos.SetZ(m_FWirPosMisalign[layerID][cellID][2]);
1715 } else if (set == c_Base) {
1716 wPos.SetX(m_FWirPos [layerID][cellID][0]);
1717 wPos.SetY(m_FWirPos [layerID][cellID][1]);
1718 wPos.SetZ(m_FWirPos [layerID][cellID][2]);
1719 }
1720
1721 return wPos;
1722}

◆ zBackwardWireLayer()

const double * zBackwardWireLayer ( ) const
inline

Returns an array of backward z of wire layers.

Returns
An array of backward z.

Definition at line 1364 of file CDCGeometryPar.h.

1365 {
1366 return m_zSBackwardLayer;
1367 }

◆ zForwardWireLayer()

const double * zForwardWireLayer ( ) const
inline

Returns an array of forward z of wire layers.

Returns
An array of forward z.

Definition at line 1359 of file CDCGeometryPar.h.

1360 {
1361 return m_zSForwardLayer;
1362 }

◆ zInnerWall()

double zInnerWall ( ) const
inline

Returns the length of the inner wall in Z.

Returns
The length of the inner wall.

Definition at line 1329 of file CDCGeometryPar.h.

1330 {
1331 return (m_zWall[0][1] - m_zWall[0][0]);
1332 }

◆ zOffsetInnerWall()

double zOffsetInnerWall ( ) const
inline

Returns the offset of the outer wall in z direction.

Returns
The z offset of the outer wall.

Definition at line 1339 of file CDCGeometryPar.h.

1340 {
1341 return (m_zWall[0][0] + zInnerWall() / 2);
1342 }
double zInnerWall() const
Returns the length of the inner wall in Z.

◆ zOffsetOuterWall()

double zOffsetOuterWall ( ) const
inline

Returns the offset of the outer wall in z direction.

Returns
The z offset of the outer wall.

Definition at line 1334 of file CDCGeometryPar.h.

1335 {
1336 return (m_zWall[2][0] + zOuterWall() / 2);
1337 }
double zOuterWall() const
Returns the length of the outer wall in Z.

◆ zOffsetWireLayer()

double zOffsetWireLayer ( unsigned  i) const
inline

Returns the offset of z of the wire layer i.

Parameters
iThe layer id.
Returns
The z offset of wire layer i.

Definition at line 1369 of file CDCGeometryPar.h.

1370 {
1371 return (m_zSBackwardLayer[i] + (m_zSForwardLayer[i] - m_zSBackwardLayer[i]) / 2);
1372 }

◆ zOuterWall()

double zOuterWall ( ) const
inline

Returns the length of the outer wall in Z.

Returns
The length of the outer wall.

Definition at line 1314 of file CDCGeometryPar.h.

1315 {
1316 return (m_zWall[2][1] - m_zWall[2][0]);
1317 }

Member Data Documentation

◆ m_alignment

bool m_alignment
private

Switch for alignment.

Definition at line 1101 of file CDCGeometryPar.h.

◆ m_alignmentFromDB

DBObjPtr<CDCAlignment>* m_alignmentFromDB
private

alignment params.

retrieved from DB.

Definition at line 1207 of file CDCGeometryPar.h.

◆ m_alphaPoints

float m_alphaPoints[c_maxNAlphaPoints]
private

alpha sampling points for xt (rad)

Definition at line 1168 of file CDCGeometryPar.h.

◆ m_alphaPoints4Sgm

float m_alphaPoints4Sgm[c_maxNAlphaPoints]
private

alpha sampling points for sigma (rad)

Definition at line 1170 of file CDCGeometryPar.h.

◆ m_B4CDCGeometryParDB

CDCGeometryPar * m_B4CDCGeometryParDB = 0
staticprivate

Pointer that saves the instance of this class.

Definition at line 1213 of file CDCGeometryPar.h.

◆ m_badWireFromDB

DBObjPtr<CDCBadWires>* m_badWireFromDB
private

bad-wires retrieved from DB.

Definition at line 1199 of file CDCGeometryPar.h.

◆ m_boardAndChannelToWire

unsigned short m_boardAndChannelToWire[c_nBoards][48]
private

array relating board-channel-id and wire-id.

Definition at line 1184 of file CDCGeometryPar.h.

◆ m_BWirPos

float m_BWirPos[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

displacement at the backward endplate for each cell; ibid.

Definition at line 1156 of file CDCGeometryPar.h.

◆ m_BWirPosAlign

float m_BWirPosAlign[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

alignment at the backward endplate for each cell; ibid.

Definition at line 1164 of file CDCGeometryPar.h.

◆ m_BWirPosMisalign

float m_BWirPosMisalign[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

misalignment at the backward endplate for each cell; ibid.

Definition at line 1160 of file CDCGeometryPar.h.

◆ m_cellSize

double m_cellSize[c_maxNSenseLayers]
private

The array to store cell size in each sense wire layer.

Definition at line 1135 of file CDCGeometryPar.h.

◆ m_chMapFromDB

DBArray<CDCChannelMap>* m_chMapFromDB
private

channel map retrieved from DB.

Definition at line 1205 of file CDCGeometryPar.h.

◆ m_clockFreq4TDC

double m_clockFreq4TDC
private

Clock frequency used for TDC (GHz).

Definition at line 1189 of file CDCGeometryPar.h.

◆ m_clockSettings

DBObjPtr<HardwareClockSettings> m_clockSettings
private

hardware clock settings

Definition at line 1211 of file CDCGeometryPar.h.

◆ m_debug

bool m_debug
private

Switch for debug printing.

Definition at line 1095 of file CDCGeometryPar.h.

◆ m_displacement

bool m_displacement
private

Switch for displacement.

Definition at line 1099 of file CDCGeometryPar.h.

◆ m_displacementFromDB

DBArray<CDCDisplacement>* m_displacementFromDB
private

displacement params.

retrieved from DB.

Definition at line 1206 of file CDCGeometryPar.h.

◆ m_dzSBackwardLayer

double m_dzSBackwardLayer[c_maxNSenseLayers]
private

Corrections for backward z position of sense wire layers.

Definition at line 1130 of file CDCGeometryPar.h.

◆ m_dzSForwardLayer

double m_dzSForwardLayer[c_maxNSenseLayers]
private

Corrections for forward z position of sense wire layers.

Definition at line 1128 of file CDCGeometryPar.h.

◆ m_eDepToADCConversionsFromDB

DBObjPtr<CDCEDepToADCConversions>* m_eDepToADCConversionsFromDB
private

Pointer to edep-to-ADC conv.

params. from DB.

Definition at line 1209 of file CDCGeometryPar.h.

◆ m_eDepToADCParams

float m_eDepToADCParams[c_maxNSenseLayers][c_maxNDriftCells][7] = {}
private

edep-to-ADC conv.

params.

Definition at line 1166 of file CDCGeometryPar.h.

◆ m_fFactorFromDB

DBObjPtr<CDCFudgeFactorsForSigma>* m_fFactorFromDB
private

fudge factors retrieved from DB.

Definition at line 1204 of file CDCGeometryPar.h.

◆ m_fieldWireDiameter

double m_fieldWireDiameter
private

The diameter of field wires.

Definition at line 1142 of file CDCGeometryPar.h.

◆ m_firstLayerOffset

ushort m_firstLayerOffset = 0
private

Offset of the first layer (for reduced CDC studies)

Definition at line 1220 of file CDCGeometryPar.h.

◆ m_firstSuperLayerOffset

ushort m_firstSuperLayerOffset = 0
private

Offset of the first super layer (for reduced CDC studies)

Definition at line 1221 of file CDCGeometryPar.h.

◆ m_fudgeFactorForSigma

double m_fudgeFactorForSigma[3]
private

Fuge factor for space resol.

Definition at line 1196 of file CDCGeometryPar.h.

◆ m_FWirPos

float m_FWirPos[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

displacement at the forward endplate for each cell; to be implemented in a smarter way.

Definition at line 1155 of file CDCGeometryPar.h.

◆ m_FWirPosAlign

float m_FWirPosAlign[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

alignment at the forward endplate for each cell; ibid.

Definition at line 1163 of file CDCGeometryPar.h.

◆ m_FWirPosMisalign

float m_FWirPosMisalign[c_maxNSenseLayers][c_maxNDriftCells][3]
private

Wire position incl.

misalignment at the forward endplate for each cell; ibid.

Definition at line 1159 of file CDCGeometryPar.h.

◆ m_globalPhiRotation

double m_globalPhiRotation
private

Global ratation in phi (rad.); only for sense wires now.

Definition at line 1144 of file CDCGeometryPar.h.

◆ m_linearInterpolationOfSgm

bool m_linearInterpolationOfSgm
private

Switch for linear interpolation of sigma.

Definition at line 1097 of file CDCGeometryPar.h.

◆ m_linearInterpolationOfXT

bool m_linearInterpolationOfXT
private

Switch for linear interpolation of xt.

Definition at line 1096 of file CDCGeometryPar.h.

◆ m_materialDefinitionMode

int m_materialDefinitionMode
private

Control switch for gas and wire material definition.

Definition at line 1108 of file CDCGeometryPar.h.

◆ m_maxNCellsPerLayer

ushort m_maxNCellsPerLayer = c_maxNDriftCells
private

Maximum number wires within a layer.

Definition at line 1222 of file CDCGeometryPar.h.

◆ m_maxNFieldLayers

ushort m_maxNFieldLayers = c_maxNFieldLayers
private

Maximum number of Field Wire Layers.

Definition at line 1218 of file CDCGeometryPar.h.

◆ m_maxNSenseLayers

ushort m_maxNSenseLayers = c_maxNSenseLayers
private

Maximum number of Sense Wire Layers.

Definition at line 1217 of file CDCGeometryPar.h.

◆ m_maxNSuperLayers

ushort m_maxNSuperLayers = c_nSuperLayers
private

Maximum number of Super Layers.

Definition at line 1219 of file CDCGeometryPar.h.

◆ m_maxSpaceResol

double m_maxSpaceResol
private

max space resolution allowed (cm).

Definition at line 1195 of file CDCGeometryPar.h.

◆ m_meanT0

double m_meanT0
private

mean t0 over all wires; should be double.

Definition at line 1180 of file CDCGeometryPar.h.

◆ m_minTrackLength

double m_minTrackLength
private

Minimum track length for G4 step.

Definition at line 1153 of file CDCGeometryPar.h.

◆ m_misalignment

bool m_misalignment
private

Switch for misalignment.

Definition at line 1100 of file CDCGeometryPar.h.

◆ m_misalignmentFromDB

DBObjPtr<CDCMisalignment>* m_misalignmentFromDB
private

misalignment params.

retrieved from DB.

Definition at line 1208 of file CDCGeometryPar.h.

◆ m_modLeftRightFlag

bool m_modLeftRightFlag
private

Switch for modified left/right flag.

Definition at line 1105 of file CDCGeometryPar.h.

◆ m_momRmin

double m_momRmin[7]
private

R_min of the cdc mother volume (7 segments).


Definition at line 1147 of file CDCGeometryPar.h.

◆ m_momZ

double m_momZ[7]
private

Z-cordinates of the cdc mother volume (7 segments).

Definition at line 1146 of file CDCGeometryPar.h.

◆ m_nAlphaPoints

unsigned short m_nAlphaPoints
private

No.

of alpha points for xt.

Definition at line 1117 of file CDCGeometryPar.h.

◆ m_nAlphaPoints4Sgm

unsigned short m_nAlphaPoints4Sgm
private

No.

of alpha points for sigma.

Definition at line 1119 of file CDCGeometryPar.h.

◆ m_nFieldWires

ushort m_nFieldWires = c_nFieldWires
private

Maximum number of Field Wires.

Definition at line 1216 of file CDCGeometryPar.h.

◆ m_nFLayer

int m_nFLayer
private

The number of field wire layer.

Definition at line 1116 of file CDCGeometryPar.h.

◆ m_nominalDriftV

double m_nominalDriftV
private

Nominal drift velocity (4.0x10^-3 cm/nsec).

Definition at line 1191 of file CDCGeometryPar.h.

◆ m_nominalDriftVInv

double m_nominalDriftVInv
private

Inverse of the nominal drift velocity.

Definition at line 1192 of file CDCGeometryPar.h.

◆ m_nominalPropSpeed

double m_nominalPropSpeed
private

Nominal propagation speed of the sense wire (27.25 cm/nsec).

Definition at line 1193 of file CDCGeometryPar.h.

◆ m_nominalSpaceResol

double m_nominalSpaceResol
private

Nominal spatial resolution (0.0130 cm).

Definition at line 1194 of file CDCGeometryPar.h.

◆ m_nSenseWires

ushort m_nSenseWires = c_nSenseWires
private

Maximum number of Sense Wires.

Definition at line 1215 of file CDCGeometryPar.h.

◆ m_nShifts

int m_nShifts[c_maxNSenseLayers]
private

The array to store shifted cell number in each sense wire layer.

Definition at line 1136 of file CDCGeometryPar.h.

◆ m_nSLayer

int m_nSLayer
private

The number of sense wire layer.

Definition at line 1115 of file CDCGeometryPar.h.

◆ m_nThetaPoints

unsigned short m_nThetaPoints
private

No.

of theta points for xt.

Definition at line 1118 of file CDCGeometryPar.h.

◆ m_nThetaPoints4Sgm

unsigned short m_nThetaPoints4Sgm
private

No.

of theta points for sigma.

Definition at line 1120 of file CDCGeometryPar.h.

◆ m_nWires

unsigned m_nWires[c_maxNSenseLayers]
private

The array to store the wire number in each sense wire layre.

Definition at line 1137 of file CDCGeometryPar.h.

◆ m_offSet

double m_offSet[c_maxNSenseLayers]
private

The array to store z offset of sense wire layers.

Definition at line 1134 of file CDCGeometryPar.h.

◆ m_propSpeedFromDB

DBObjPtr<CDCPropSpeeds>* m_propSpeedFromDB
private

prop.

-speeds retrieved from DB.

Definition at line 1200 of file CDCGeometryPar.h.

◆ m_propSpeedInv

float m_propSpeedInv[c_maxNSenseLayers]
private

Inverse of propagation speed of the sense wire.

Definition at line 1175 of file CDCGeometryPar.h.

◆ m_rFLayer

double m_rFLayer[c_maxNFieldLayers]
private

The array to store radius of field wire layers.

Definition at line 1131 of file CDCGeometryPar.h.

◆ m_rSLayer

double m_rSLayer[c_maxNSenseLayers]
private

The array to store radius of sense wire layers.

Definition at line 1126 of file CDCGeometryPar.h.

◆ m_rWall

double m_rWall[4]
private

The array to store radius of inner wall and outer wall.

Definition at line 1123 of file CDCGeometryPar.h.

◆ m_senseWireDensity

double m_senseWireDensity
private

The density of sense wires.

Definition at line 1141 of file CDCGeometryPar.h.

◆ m_senseWireDiameter

double m_senseWireDiameter
private

The diameter of sense wires.

Definition at line 1139 of file CDCGeometryPar.h.

◆ m_senseWireTension

double m_senseWireTension
private

The tension of sense wires.

Definition at line 1140 of file CDCGeometryPar.h.

◆ m_senseWireZposMode

int m_senseWireZposMode
private

Mode for sense wire z position corr.

Definition at line 1109 of file CDCGeometryPar.h.

◆ m_shiftInSuperLayer

signed short m_shiftInSuperLayer[c_nSuperLayers][8]
private

shift in phi-direction wrt the 1st layer in each super layer

Definition at line 1121 of file CDCGeometryPar.h.

◆ m_Sigma

float m_Sigma[c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nSigmaParams]
private

position resolution for each layer.

Definition at line 1174 of file CDCGeometryPar.h.

◆ m_sigmaFileFormat

int m_sigmaFileFormat
private

Format of sigma input file.

Definition at line 1112 of file CDCGeometryPar.h.

◆ m_sigmaParamMode

int m_sigmaParamMode
private

Mode for sigma parameterization.

Definition at line 1113 of file CDCGeometryPar.h.

◆ m_sResolFromDB

DBObjPtr<CDCSpaceResols>* m_sResolFromDB
private

sigma params.

retrieved from DB.

Definition at line 1203 of file CDCGeometryPar.h.

◆ m_t0

float m_t0[c_maxNSenseLayers][c_maxNDriftCells] = {}
private

t0 for each sense-wire (in nsec).

Definition at line 1176 of file CDCGeometryPar.h.

◆ m_t0FromDB

DBObjPtr<CDCTimeZeros>* m_t0FromDB
private

t0s retrieved from DB.

Definition at line 1198 of file CDCGeometryPar.h.

◆ m_tdcBinWidth

double m_tdcBinWidth
private

TDC bin width (nsec/bin).

Definition at line 1190 of file CDCGeometryPar.h.

◆ m_tdcOffset

unsigned short m_tdcOffset
private

Not used; to be removed later.

Definition at line 1188 of file CDCGeometryPar.h.

◆ m_thetaPoints

float m_thetaPoints[c_maxNThetaPoints]
private

theta sampling points for xt (rad)

Definition at line 1169 of file CDCGeometryPar.h.

◆ m_thetaPoints4Sgm

float m_thetaPoints4Sgm[c_maxNThetaPoints]
private

theta sampling points for sigma (rad)

Definition at line 1171 of file CDCGeometryPar.h.

◆ m_thresholdEnergyDeposit

double m_thresholdEnergyDeposit
private

Energy thresh.

for G4 step

Definition at line 1152 of file CDCGeometryPar.h.

◆ m_timeWalkCoef

float m_timeWalkCoef[c_nBoards][2]
private

coefficients for time walk.

Definition at line 1177 of file CDCGeometryPar.h.

◆ m_timeWalkFromDB

DBObjPtr<CDCTimeWalks>* m_timeWalkFromDB
private

time-walk coeffs.

retrieved from DB.

Definition at line 1201 of file CDCGeometryPar.h.

◆ m_twParamMode

int m_twParamMode
private

Mode for tw parameterization.

Definition at line 1114 of file CDCGeometryPar.h.

◆ m_version

std::string m_version
private

The version of geometry parameters.

Definition at line 1107 of file CDCGeometryPar.h.

◆ m_wireSag

bool m_wireSag
private

Switch for sense wire sag.

Definition at line 1104 of file CDCGeometryPar.h.

◆ m_WireSagCoef

float m_WireSagCoef[c_maxNSenseLayers][c_maxNDriftCells]
private

Wire sag coefficient for each cell; ibid.

Definition at line 1157 of file CDCGeometryPar.h.

◆ m_WireSagCoefAlign

float m_WireSagCoefAlign[c_maxNSenseLayers][c_maxNDriftCells]
private

Wire sag coefficient incl.

alignment for each cell; ibid.

Definition at line 1165 of file CDCGeometryPar.h.

◆ m_WireSagCoefMisalign

float m_WireSagCoefMisalign[c_maxNSenseLayers][c_maxNDriftCells]
private

Wire sag coefficient incl.

misalignment for each cell; ibid.

Definition at line 1161 of file CDCGeometryPar.h.

◆ m_wireToBoard

std::map<WireID, unsigned short> m_wireToBoard
private

map relating wire-id and board-id.

Definition at line 1182 of file CDCGeometryPar.h.

◆ m_wireToChannel

std::map<WireID, unsigned short> m_wireToChannel
private

map relating wire-id and channel-id.

Definition at line 1183 of file CDCGeometryPar.h.

◆ m_XT

float m_XT[c_maxNSenseLayers][2][c_maxNAlphaPoints][c_maxNThetaPoints][c_nXTParams]
private

XT-relation coefficients for each layer, Left/Right, entrance angle and polar angle.


Definition at line 1173 of file CDCGeometryPar.h.

◆ m_XTetc

bool m_XTetc
private

Switch for reading x-t etc.

params..

Definition at line 1098 of file CDCGeometryPar.h.

◆ m_XTetc4Recon

bool m_XTetc4Recon
private

Switch for selecting xt etc.

Definition at line 1102 of file CDCGeometryPar.h.

◆ m_xtFileFormat

int m_xtFileFormat
private

Format of xt input file.

Definition at line 1110 of file CDCGeometryPar.h.

◆ m_xtParamMode

int m_xtParamMode
private

Mode for xt parameterization.

Definition at line 1111 of file CDCGeometryPar.h.

◆ m_xtRelFromDB

DBObjPtr<CDCXtRelations>* m_xtRelFromDB
private

xt params.

retrieved from DB (new).

Definition at line 1202 of file CDCGeometryPar.h.

◆ m_zFBackwardLayer

double m_zFBackwardLayer[c_maxNFieldLayers]
private

The array to store backward z position of field wire layers.

Definition at line 1133 of file CDCGeometryPar.h.

◆ m_zFForwardLayer

double m_zFForwardLayer[c_maxNFieldLayers]
private

The array to store forward z position of field wire layers.

Definition at line 1132 of file CDCGeometryPar.h.

◆ m_zSBackwardLayer

double m_zSBackwardLayer[c_maxNSenseLayers]
private

The array to store backward z position of sense wire layers.

Definition at line 1129 of file CDCGeometryPar.h.

◆ m_zSForwardLayer

double m_zSForwardLayer[c_maxNSenseLayers]
private

The array to store forward z position of sense wire layers.

Definition at line 1127 of file CDCGeometryPar.h.

◆ m_zWall

double m_zWall[4][2]
private

The array to store z position of inner wall and outer wall.

Definition at line 1124 of file CDCGeometryPar.h.


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