/// @file AllPixGeoDsc.hh /// @brief Header file for the Allpix geometry description class. #ifndef AllPixGeoDsc_h #define AllPixGeoDsc_h 1 #include "globals.hh" // GEANT4 include statements. #include "G4ThreeVector.hh" // ROOT include statements. #include "TROOT.h" #include #include #include using namespace std; /// @brief A class for Allpix geometry descriptions. /// /// @author J. Idarraga (principle author - idarraga@cern.ch) /// @author T. Whyntie (editor, CERN\@school - t.whyntie@qmul.ac.uk) /// @date 2010 (ed. February 2014) class AllPixGeoDsc { public: /// @brief The constructor AllPixGeoDsc(); /// @brief The destructor. ~AllPixGeoDsc(); // Number of pixels G4int GetNPixelsX(){return m_npix_x;}; G4int GetNPixelsY(){return m_npix_y;}; G4int GetNPixelsZ(){return m_npix_z;}; G4int GetNPixelsTotXY(){return GetNPixelsX()*GetNPixelsY();}; // Planar layout // /// @brief Get the resistivity of the sensor. inline G4double GetResistivity() { return m_resistivity; }; //G4int GetHalfNPixelsX(){return GetNPixelsX()/2;}; // half number of pixels // //G4int GetHalfNPixelsY(){return GetNPixelsY()/2;}; //G4int GetHalfNPixelsZ(){return GetNPixelsZ()/2;}; // Pixel dimensions G4double GetPixelX(){return 2.*GetHalfPixelX();}; G4double GetPixelY(){return 2.*GetHalfPixelY();}; G4double GetPixelZ(){return 2.*GetHalfPixelZ();}; G4double GetHalfPixelX(){return m_pixsize_x;}; // half pixel size // G4double GetHalfPixelY(){return m_pixsize_y;}; G4double GetHalfPixelZ(){return m_pixsize_z;}; // Sensor --> It will be positioned with respect to the wrapper !! // G4double GetSensorXOffset(){return m_sensor_posx;}; G4double GetSensorYOffset(){return m_sensor_posy;}; G4double GetSensorZOffset(){return GetHalfPCBZ();}; // See relation with GetHalfWrapperDZ() G4double GetSensorExcessHTop(){return m_sensor_gr_excess_htop;}; G4double GetSensorExcessHBottom(){return m_sensor_gr_excess_hbottom;}; G4double GetSensorExcessHRight(){return m_sensor_gr_excess_hright;}; G4double GetSensorExcessHLeft(){return m_sensor_gr_excess_hleft;}; // PCB --> It will be positioned with respect to the wrapper !! G4double GetHalfPCBX(){return m_pcb_hx;}; G4double GetHalfPCBY(){return m_pcb_hy;}; G4double GetHalfPCBZ(){return m_pcb_hz;}; G4double GetPCBX(){return 2.*GetPCBX();}; G4double GetPCBY(){return 2.*GetPCBX();}; G4double GetPCBZ(){return 2.*GetPCBX();}; // Wrapper accessor methods. inline G4double GetHalfWrapperDX() { return GetHalfPCBX(); }; inline G4double GetHalfWrapperDY() { return GetHalfPCBY(); }; G4double GetHalfWrapperDZ(); // World G4double GetHalfWorldDX(){return 10000.*mm;};//GetNPixelsX()*GetPixelX();}; G4double GetHalfWorldDY(){return 10000.*mm;};//GetNPixelsY()*GetPixelX();}; G4double GetHalfWorldDZ(){return 15000.*mm;};//GetPixelZ();}; G4double GetWorldDX(){return 2.*GetHalfWorldDX();}; G4double GetWorldDY(){return 2.*GetHalfWorldDY();}; G4double GetWorldDZ(){return 2.*GetHalfWorldDZ();}; /// @brief Get the MIP total (what???). /// /// @return The MIP total. inline G4int GetMIPTot() { return m_MIP_Tot; } /// @brief Get the MIP charge. /// /// @return The MIP charge. inline G4double GetMIPCharge() { return m_MIP_Charge; } G4int GetCounterDepth(){return m_Counter_Depth;} G4double GetClockUnit(){return m_Clock_Unit;} G4double GetChipNoise(){return m_Chip_Noise;} G4double GetThreshold(){return m_Chip_Threshold;} G4double GetCrossTalk(){return m_Cross_Talk;} G4double GetSaturationEnergy(){return m_Saturation_Energy;} /////////////////////////////////////// // Set void SetID(G4int val){ m_ID = val; } void SetNPixelsX(G4int val){ m_npix_x = val; }; void SetNPixelsY(G4int val){ m_npix_y = val; }; void SetNPixelsZ(G4int val){ m_npix_z = val; }; void SetPixSizeX(G4double val){ m_pixsize_x = val; } void SetPixSizeY(G4double val){ m_pixsize_y = val; } void SetPixSizeZ(G4double val){ m_pixsize_z = val; } // The readout chip. inline void SetChipHX(G4double val) { m_chip_hx = val; }; inline void SetChipHY(G4double val) { m_chip_hy = val; }; inline void SetChipHZ(G4double val) { m_chip_hz = val; }; // These are all determined by the sensor position, right? // inline void SetChipPosX(G4double val) { m_chip_posx = val; }; // // inline void SetChipPosY(G4double val) { m_chip_posy = val; }; // // inline void SetChipPosZ(G4double val) { m_chip_posz = val; }; inline G4double GetChipDX() { return 2.*m_chip_hx*mm; } inline G4double GetChipDY() { return 2.*m_chip_hy*mm; } inline G4double GetChipDZ() { return 2.*m_chip_hz*mm; } inline G4double GetHalfChipDX() { return m_chip_hx*mm; } inline G4double GetHalfChipDY() { return m_chip_hy*mm; } inline G4double GetHalfChipDZ() { return m_chip_hz*mm; } // G4ThreeVector GetReadoutChipPosFromPCBCentre(); // Sensor properties accessor methods. inline void SetSensorHX(G4double val) { m_sensor_hx = val; } inline void SetSensorHY(G4double val) { m_sensor_hy = val; } inline void SetSensorHZ(G4double val) { m_sensor_hz = val; } inline G4double GetHalfSensorX() { return m_sensor_hx; }; inline G4double GetHalfSensorY() { return m_sensor_hy; }; inline G4double GetHalfSensorZ() { return m_sensor_hz; }; inline G4double GetSensorX() { return 2. * GetHalfSensorX(); }; inline G4double GetSensorY() { return 2. * GetHalfSensorY(); }; inline G4double GetSensorZ() { return 2. * GetHalfSensorZ(); }; G4ThreeVector GetSensorPosFromPcbCentre(); inline void SetSensorPosX(G4double val) { m_sensor_posx = val; }; inline G4double GetSensorPosX() { return m_sensor_posx; } inline void SetSensorPosY(G4double val) { m_sensor_posy = val; }; inline G4double GetSensorPosY() { return m_sensor_posy; } inline void SetSensorPosZ(G4double val) { m_sensor_posz = val; }; inline G4double GetSensorPosZ() { return m_sensor_posz; } inline void SetSensorExcessHTop(G4double val) { m_sensor_gr_excess_htop = val; } inline void SetSensorExcessHBottom(G4double val) { m_sensor_gr_excess_hbottom = val; } inline void SetSensorExcessHRight(G4double val) { m_sensor_gr_excess_hright = val; } inline void SetSensorExcessHLeft(G4double val) { m_sensor_gr_excess_hleft = val; } /////////////////////////////////////////////////// // Digitizer void SetSensorDigitizer(G4String valS){ m_digitizer = valS; } // The PCB inline void SetPCBHX(G4double val) { m_pcb_hx = val; } inline void SetPCBHY(G4double val) { m_pcb_hy = val; } inline void SetPCBHZ(G4double val) { m_pcb_hz = val; } // The copper base plate inline void SetCuBaseDX (G4double val) { m_CuBase_Dx = val; } inline void SetCuBaseDY (G4double val) { m_CuBase_Dy = val; } inline void SetCuBaseDZ (G4double val) { m_CuBase_Dz = val; } inline G4double GetCuBaseDX() { return m_CuBase_Dx; } inline G4double GetCuBaseDY() { return m_CuBase_Dy; } inline G4double GetCuBaseDZ() { return m_CuBase_Dz; } inline G4double GetHalfCuBaseDX() { return 0.5*m_CuBase_Dx; } inline G4double GetHalfCuBaseDY() { return 0.5*m_CuBase_Dy; } inline G4double GetHalfCuBaseDZ() { return 0.5*m_CuBase_Dz; } inline void SetCuBaseOffsetX(G4double val) { m_CuBase_OffsetX = val; } inline void SetCuBaseOffsetY(G4double val) { m_CuBase_OffsetY = val; } inline G4double GetCuBaseOffsetX() { return m_CuBase_OffsetX; } inline G4double GetCuBaseOffsetY() { return m_CuBase_OffsetY; } G4ThreeVector GetCuBasePosFromPCBCentre(); // The aluminium foil coating //---------------------------- inline void SetAlFoilThickness(G4double thk) { m_alFoilThk = thk; } inline G4double GetAlFoilThickness() { return m_alFoilThk; } /// @brief Get half of the aluminium foil thickness. /// /// @return Half of the aluminium foil thickness. inline G4double GetHalfAlFoilDZ() { return m_alFoilThk/2.0; } void SetResistivity(G4double val){ m_resistivity = val; } void SetMIPTot(G4int val){ m_MIP_Tot = val; } void SetMIPCharge(G4double val){ m_MIP_Charge = val; } void SetCounterDepth(G4int val){ m_Counter_Depth = val; } void SetClockUnit(G4double val){ m_Clock_Unit = val; } void SetChipNoise(G4double val){ m_Chip_Noise = val; } void SetThreshold(G4double val){ m_Chip_Threshold = val; } void SetCrossTalk(G4double val){ m_Cross_Talk = val; } void SetSaturationEnergy(G4double val){ m_Saturation_Energy = val; } // Temporal information accessor methods //--------------------------------------- /// @brief Set the detector acquisition time. /// /// @param [in] The acquisition time [s]. inline void SetAcqTime(Double_t acqtime) { m_acqTime = acqtime; } /// @brief Get the detector acquisition time. /// /// @return The detector acquisition time [s]. inline Double_t GetAcqTime() { return m_acqTime; } // Detector settings //------------------- /// @brief Set the detector polarity (0 - negative, 1 - positive). /// /// @param [in] pol The polarity. inline void SetPolarity(Int_t pol) { m_Polarity = pol; } /// @brief Get the detector polarity. /// /// @return The detector polarity. inline Int_t GetPolarity() { return m_Polarity; } /// @brief Set the bias voltage. /// /// @param [in] hv The bias voltage [V]. inline void SetHV(Double_t hv) { m_HV = hv; } /// @brief Get the bias voltage (HV). /// /// @return The bias voltage [V]. Double_t GetHV() { return m_HV; } inline void SetDacIkrum( Int_t val) { m_dacs[ 0] = val; } inline void SetDacDisc( Int_t val) { m_dacs[ 1] = val; } inline void SetDacPreamp( Int_t val) { m_dacs[ 2] = val; } inline void SetDacBuffAnalogA(Int_t val) { m_dacs[ 3] = val; } inline void SetDacBuffAnalogB(Int_t val) { m_dacs[ 4] = val; } inline void SetDacHist( Int_t val) { m_dacs[ 5] = val; } inline void SetDacThl( Int_t val) { m_dacs[ 6] = val; } inline void SetDacThlCoarse( Int_t val) { m_dacs[ 7] = val; } inline void SetDacVcas( Int_t val) { m_dacs[ 8] = val; } inline void SetDacFbk( Int_t val) { m_dacs[ 9] = val; } inline void SetDacGnd( Int_t val) { m_dacs[10] = val; } inline void SetDacThs( Int_t val) { m_dacs[11] = val; } inline void SetDacBiasLvds( Int_t val) { m_dacs[12] = val; } inline void SetDacRefLvds( Int_t val) { m_dacs[13] = val; } /// @brief Get the DAC settings for the detector. /// /// @return A vector of the DAC settings for the detector. inline vector GetDACs() { return m_dacs; } /// @brief Set the Medipix clock frequency. /// /// @param [in] mpxc The Medipix clock setting [MHz]. inline void SetMpxClock(Double_t mpxc) { m_MpxClock = mpxc; } /// @brief Get the Medipix clock frequency setting. /// /// @return The Medipix clock frequency setting [MHz]. inline Double_t GetMpxClock() { return m_MpxClock; } /// @brief Set the Timepix clock frequency. /// /// @param [in] tpxc The Timepix clock setting (0x00 - 10MHz). inline void SetTpxClock(Byte_t tpxc) { m_TpxClock = tpxc; } /// @brief Get the Timepix clock frequency setting. /// /// @return The Timepix clock frequency setting. inline Double_t GetTpxClock() { return m_TpxClock; } /// @brief Set the back side preamp enabled flag. /// /// @param [in] bsenabled Is the back side preamp enabled? inline void SetBsActive(Bool_t bsenabled) { m_BS_active = bsenabled; } /// @brief Is the back side preamp enabled? /// /// @return Is the back side preamp enabled? inline Bool_t GetBsActive() { return m_BS_active; } /// @brief Set the calibration filename. /// /// @param [in] val The calibration file name. inline void SetCalibFile(G4String val) { m_calibFile = val; } /// @brief Get the calibration file name. /// /// @return The calibration file name. inline G4String GetCalibFile() { return m_calibFile; } // Detector information //---------------------- inline void SetChipID(G4String chipid) { m_chipId = chipid; } inline G4String GetChipID() { return m_chipId; } inline void SetCustomName(G4String val) { m_customName = val; } inline G4String GetCustomName() { return m_customName; } inline void SetFirmware(G4String val) { m_firmware = val; } inline G4String GetFirmware() { return m_firmware; } inline void SetInterface(G4String val) { m_interface = val; } inline G4String GetInterface() { return m_interface; } inline void SetMpxType(G4int val) { m_MpxType = val; } inline G4int GetMpxType() { return m_MpxType; } inline void SetAppFilterFile(G4String val) { m_appFilterFile = val; } inline G4String GetAppFilterFile() { return m_appFilterFile; } inline void SetAppFilters(G4String val) { m_appFilters = val; } inline G4String GetAppFilters() { return m_appFilters; } /////////////////////////////////////////////////// // operators //void operator=(AllPixGeoDsc &); /////////////////////////////////////////////////// // names void SetHitsCollectionName(G4String si){ m_hitsCollectionName = si; }; void SetDigitCollectionName(G4String si){ m_digitCollectionName = si; }; G4String GetHitsCollectionName(){ return m_hitsCollectionName; }; G4String GetDigitCollectionName(){ return m_digitCollectionName; }; G4String GetSensorDigitizer(){return m_digitizer;}; /////////////////////////////////////////////////// // extras void Dump(); private: /// @brief The detector ID (integer). G4int m_ID; G4int m_npix_x; G4int m_npix_y; G4int m_npix_z; G4double m_pixsize_x; G4double m_pixsize_y; G4double m_pixsize_z; // The sensor //------------ /// @brief Half of the sensor width. G4double m_sensor_hx; G4double m_sensor_hy; G4double m_sensor_hz; G4double m_sensor_posx; G4double m_sensor_posy; G4double m_sensor_posz; // The guard ring //---------------- G4double m_sensor_gr_excess_htop; G4double m_sensor_gr_excess_hbottom; G4double m_sensor_gr_excess_hright; G4double m_sensor_gr_excess_hleft; // The readout chip //------------------ G4double m_chip_hx; G4double m_chip_hy; G4double m_chip_hz; G4double m_chip_posx; G4double m_chip_posy; G4double m_chip_posz; G4double m_pcb_hx; G4double m_pcb_hy; G4double m_pcb_hz; // Copper base plate properties G4double m_CuBase_Dx; //! Width of the Copper base plate. G4double m_CuBase_Dy; //! Height of the Copper base plate. G4double m_CuBase_Dz; //! Length of the Copper base plate. G4double m_CuBase_OffsetX; //!< Offset of the copper base in x from the sensor position. G4double m_CuBase_OffsetY; //!< Offset of the copper base in y from the sensor position. // The aluminium foil sensor coating //----------------------------------- /// @brief The foil coating thickness. G4double m_alFoilThk; /// @brief The digitizer name. G4String m_digitizer; /// @brief The hits collection name. G4String m_hitsCollectionName; /// @brief The digit collection name. G4String m_digitCollectionName; G4double m_WaferXpos; G4double m_WaferYpos; /// @brief Resistivity of the sensor [Ohm m] /// /// Units? [Ohm m] is common - what does 10,000 sound like? G4double m_resistivity; G4int m_MIP_Tot; G4double m_MIP_Charge; G4int m_Counter_Depth; G4double m_Clock_Unit; G4double m_Chip_Noise; G4double m_Chip_Threshold; G4double m_Cross_Talk; G4double m_Saturation_Energy; // Temporal information //---------------------- /// @brief The detector acquisition time [s]. Double_t m_acqTime; // Detector settings //------------------- /// @brief The detector polarity (0 = negative, 1 = positive). Int_t m_Polarity; /// @brief The bias voltage [V]. Double_t m_HV; /// @brief The detector DAC settings. vector m_dacs; /// @brief The Medipix clock frequency [MHz]. Double_t m_MpxClock; /// @brief The Timepix clock frequency setting. /// /// 0x00: 10 MHz. Byte_t m_TpxClock; /// @brief Is the back side preamp enabled? Bool_t m_BS_active; /// @brief The calibration filename. G4String m_calibFile; // Detector information //---------------------- /// @brief The chip ID. G4String m_chipId; /// @brief The detector's custom name. G4String m_customName; /// @brief The detector firmware version. G4String m_firmware; /// @brief The detector interface type. G4String m_interface; /// @brief The type of Medipix detector. G4int m_MpxType; /// @brief The filter file name to use. G4String m_appFilterFile; /// @brief The filters applied to the data acquisition. G4String m_appFilters; };//end of AllPixGeoDsc class definition. #endif