Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CaloWaveformSim Class Reference

#include <coresoftware/blob/master/simulation/g4simulation/g4waveformsim/CaloWaveformSim.h>

+ Inheritance diagram for CaloWaveformSim:
+ Collaboration diagram for CaloWaveformSim:

Public Types

enum  NoiseType { NOISE_NONE = 0, NOISE_GAUSSIAN = 1, NOISE_TREE = 2 }
 

Public Member Functions

 CaloWaveformSim (const std::string &name="CaloWaveformSim")
 
 ~CaloWaveformSim () override
 
int Init (PHCompositeNode *topNode) override
 
int process_event (PHCompositeNode *topNode) override
 
int End (PHCompositeNode *topNode) override
 Called at the end of all processing.
 
void set_detector_type (CaloTowerDefs::DetectorSystem dettype)
 
void set_detector (const std::string &detector)
 
void set_fieldname (const std::string &fieldname)
 
void set_calibName (const std::string &calibName)
 
void set_overrideCalibName (bool overrideCalibName)
 
void set_overrideFieldName (bool overrideFieldName)
 
void set_templatefile (const std::string &templatefile)
 
void set_nsamples (int _nsamples)
 
void set_pedestalsamples (int _pedestalsamples)
 
void set_noise_type (NoiseType noiseType)
 
void set_fixpedestal (int _fixpedestal)
 
void set_gaussian_noise (int _gaussian_noise)
 
void set_deltaT (float _deltaT)
 
void set_timewidth (float _timewidth)
 
void set_peakpos (float _peakpos)
 
LightCollectionModelget_light_collection_model ()
 
- Public Member Functions inherited from SubsysReco
 ~SubsysReco () override
 
virtual int EndRun (const int)
 Called at the end of each run.
 
virtual int InitRun (PHCompositeNode *)
 
virtual int Reset (PHCompositeNode *)
 Reset.
 
virtual int ResetEvent (PHCompositeNode *)
 Clean up after each event.
 
void Print (const std::string &="ALL") const override
 
- Public Member Functions inherited from Fun4AllBase
virtual ~Fun4AllBase ()
 
virtual const std::string Name () const
 Returns the name of this module.
 
virtual void Name (const std::string &name)
 Sets the name of this module.
 
virtual void Verbosity (const int ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual void Verbosity (enu_Verbosity ival)
 Sets the verbosity of this module (0 by default=quiet).
 
virtual int Verbosity () const
 Gets the verbosity of this module.
 

Private Member Functions

void maphitetaphi (PHG4Hit *g4hit, unsigned short &etabin, unsigned short &phibin, float &correction)
 
double template_function (double *x, double *par)
 
void CreateNodeTree (PHCompositeNode *topNode)
 

Private Attributes

CaloTowerDefs::DetectorSystem m_dettype {CaloTowerDefs::CEMC}
 
std::string m_detector {"CEMC"}
 
std::string m_fieldname {"Femc_datadriven_qm1_correction"}
 
std::string m_calibName {"cemc_pi0_twrSlope_v1"}
 
bool m_overrideCalibName {false}
 
bool m_overrideFieldName {false}
 
CDBTTreecdbttree {nullptr}
 
std::string m_templatefile {"waveformtemptempohcalcosmic.root"}
 
TProfile * h_template {nullptr}
 
TowerInfoContainerm_CaloWaveformContainer {nullptr}
 
TowerInfoContainerm_PedestalContainer {nullptr}
 
std::vector< std::vector< float > > m_waveforms = {{}}
 
int m_runNumber {0}
 
int m_nsamples {31}
 
int m_nchannels {24576}
 
int m_pedestalsamples {12}
 
float m_sampletime {50. / 3.}
 
int m_fixpedestal {1500}
 
int m_gaussian_noise {3}
 
float m_deltaT {100.}
 
float m_timeshiftwidth {0.}
 
float m_peakpos {6.}
 
gsl_rng * m_RandomGenerator {nullptr}
 
PHG4CylinderCellGeom_Spacalv1geo {nullptr}
 
const PHG4CylinderGeom_Spacalv3layergeom {nullptr}
 
float m_sampling_fraction = {1.0}
 
unsigned int(* encode_tower )(const unsigned int etabin, const unsigned int phibin)
 
unsigned int(* decode_tower )(const unsigned int tower_key)
 
LightCollectionModel light_collection_model
 
NoiseType m_noiseType {NOISE_TREE}
 

Additional Inherited Members

- Protected Member Functions inherited from SubsysReco
 SubsysReco (const std::string &name="NONAME")
 

Detailed Description

Definition at line 28 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 28 of file CaloWaveformSim.h

Member Enumeration Documentation

Enumerator:
NOISE_NONE 
NOISE_GAUSSIAN 
NOISE_TREE 

Definition at line 35 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 35 of file CaloWaveformSim.h

Constructor & Destructor Documentation

CaloWaveformSim::CaloWaveformSim ( const std::string &  name = "CaloWaveformSim")

Definition at line 48 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 48 of file CaloWaveformSim.cc

CaloWaveformSim::~CaloWaveformSim ( )
override

Definition at line 53 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 53 of file CaloWaveformSim.cc

References m_RandomGenerator.

Member Function Documentation

void CaloWaveformSim::CreateNodeTree ( PHCompositeNode topNode)
private

Definition at line 391 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 391 of file CaloWaveformSim.cc

References PHCompositeNode::addNode(), CaloTowerDefs::CEMC, CaloTowerDefs::DETECTOR_INVALID, PHNodeIterator::findFirst(), CaloTowerDefs::HCALIN, CaloTowerDefs::HCALOUT, m_CaloWaveformContainer, m_detector, m_dettype, and PHWHERE.

Referenced by Init().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int CaloWaveformSim::End ( PHCompositeNode topNode)
overridevirtual

Called at the end of all processing.

Reimplemented from SubsysReco.

Definition at line 385 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 385 of file CaloWaveformSim.cc

References Fun4AllReturnCodes::EVENT_OK.

LightCollectionModel& CaloWaveformSim::get_light_collection_model ( )
inline

Definition at line 129 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 129 of file CaloWaveformSim.h

References light_collection_model.

int CaloWaveformSim::Init ( PHCompositeNode )
overridevirtual

Called during initialization. Typically this is where you can book histograms, and e.g. register them to Fun4AllServer (so they can be output to file using Fun4AllServer::dumpHistos() method).

Reimplemented from SubsysReco.

Definition at line 58 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 58 of file CaloWaveformSim.cc

References assert, cdbttree, CaloTowerDefs::CEMC, CreateNodeTree(), TowerInfoDefs::decode_emcal(), TowerInfoDefs::decode_hcal(), decode_tower, Acts::UnitConstants::e, TowerInfoDefs::encode_emcal(), TowerInfoDefs::encode_hcal(), encode_tower, Fun4AllReturnCodes::EVENT_OK, EventHeader::get_RunNumber(), CDBInterface::getUrl(), gsl_rng_set(), h_template, CaloTowerDefs::HCALIN, CaloTowerDefs::HCALOUT, CDBInterface::instance(), m_calibName, m_detector, m_dettype, m_fieldname, m_nchannels, m_nsamples, m_overrideCalibName, m_overrideFieldName, m_RandomGenerator, m_runNumber, m_sampling_fraction, m_templatefile, m_waveforms, seed, and Fun4AllBase::Verbosity().

+ Here is the call graph for this function:

void CaloWaveformSim::maphitetaphi ( PHG4Hit g4hit,
unsigned short &  etabin,
unsigned short &  phibin,
float &  correction 
)
private
void CaloWaveformSim::set_calibName ( const std::string &  calibName)
inline

Definition at line 67 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 67 of file CaloWaveformSim.h

References m_calibName, and m_overrideCalibName.

void CaloWaveformSim::set_deltaT ( float  _deltaT)
inline

Definition at line 113 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 113 of file CaloWaveformSim.h

References m_deltaT.

void CaloWaveformSim::set_detector ( const std::string &  detector)
inline

Definition at line 57 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 57 of file CaloWaveformSim.h

References m_detector.

void CaloWaveformSim::set_detector_type ( CaloTowerDefs::DetectorSystem  dettype)
inline

Definition at line 52 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 52 of file CaloWaveformSim.h

References m_dettype.

void CaloWaveformSim::set_fieldname ( const std::string &  fieldname)
inline

Definition at line 62 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 62 of file CaloWaveformSim.h

References m_fieldname.

void CaloWaveformSim::set_fixpedestal ( int  _fixpedestal)
inline

Definition at line 103 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 103 of file CaloWaveformSim.h

References m_fixpedestal.

void CaloWaveformSim::set_gaussian_noise ( int  _gaussian_noise)
inline

Definition at line 108 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 108 of file CaloWaveformSim.h

References m_gaussian_noise.

void CaloWaveformSim::set_noise_type ( NoiseType  noiseType)
inline

Definition at line 98 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 98 of file CaloWaveformSim.h

References m_noiseType.

void CaloWaveformSim::set_nsamples ( int  _nsamples)
inline

Definition at line 88 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 88 of file CaloWaveformSim.h

References m_nsamples.

void CaloWaveformSim::set_overrideCalibName ( bool  overrideCalibName)
inline

Definition at line 73 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 73 of file CaloWaveformSim.h

References m_overrideCalibName.

void CaloWaveformSim::set_overrideFieldName ( bool  overrideFieldName)
inline

Definition at line 78 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 78 of file CaloWaveformSim.h

References m_overrideFieldName.

void CaloWaveformSim::set_peakpos ( float  _peakpos)
inline

Definition at line 123 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 123 of file CaloWaveformSim.h

References m_peakpos.

void CaloWaveformSim::set_pedestalsamples ( int  _pedestalsamples)
inline

Definition at line 93 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 93 of file CaloWaveformSim.h

References m_pedestalsamples.

void CaloWaveformSim::set_templatefile ( const std::string &  templatefile)
inline

Definition at line 83 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 83 of file CaloWaveformSim.h

References m_templatefile.

void CaloWaveformSim::set_timewidth ( float  _timewidth)
inline

Definition at line 118 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 118 of file CaloWaveformSim.h

References m_timeshiftwidth.

double CaloWaveformSim::template_function ( double x,
double par 
)
private

Definition at line 42 of file CaloWaveformSim.cc.

View newest version in sPHENIX GitHub at line 42 of file CaloWaveformSim.cc

References h_template, and v1.

Referenced by process_event().

+ Here is the caller graph for this function:

Member Data Documentation

CDBTTree* CaloWaveformSim::cdbttree {nullptr}
private

Definition at line 138 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 138 of file CaloWaveformSim.h

Referenced by Init(), and process_event().

unsigned int(* CaloWaveformSim::decode_tower)(const unsigned int tower_key)
inlineprivate

Definition at line 162 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 162 of file CaloWaveformSim.h

Referenced by Init(), and process_event().

unsigned int(* CaloWaveformSim::encode_tower)(const unsigned int etabin, const unsigned int phibin)
inlineprivate

Definition at line 161 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 161 of file CaloWaveformSim.h

Referenced by Init(), and process_event().

PHG4CylinderCellGeom_Spacalv1* CaloWaveformSim::geo {nullptr}
private

Definition at line 157 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 157 of file CaloWaveformSim.h

Referenced by maphitetaphi(), and process_event().

TProfile* CaloWaveformSim::h_template {nullptr}
private

Definition at line 140 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 140 of file CaloWaveformSim.h

Referenced by Init(), and template_function().

const PHG4CylinderGeom_Spacalv3* CaloWaveformSim::layergeom {nullptr}
private

Definition at line 158 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 158 of file CaloWaveformSim.h

Referenced by maphitetaphi(), and process_event().

LightCollectionModel CaloWaveformSim::light_collection_model
private

Definition at line 166 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 166 of file CaloWaveformSim.h

Referenced by get_light_collection_model(), and maphitetaphi().

std::string CaloWaveformSim::m_calibName {"cemc_pi0_twrSlope_v1"}
private

Definition at line 135 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 135 of file CaloWaveformSim.h

Referenced by Init(), and set_calibName().

TowerInfoContainer* CaloWaveformSim::m_CaloWaveformContainer {nullptr}
private

Definition at line 141 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 141 of file CaloWaveformSim.h

Referenced by CreateNodeTree(), and process_event().

float CaloWaveformSim::m_deltaT {100.}
private

Definition at line 152 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 152 of file CaloWaveformSim.h

Referenced by process_event(), and set_deltaT().

std::string CaloWaveformSim::m_detector {"CEMC"}
private

Definition at line 133 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 133 of file CaloWaveformSim.h

Referenced by CreateNodeTree(), Init(), process_event(), and set_detector().

CaloTowerDefs::DetectorSystem CaloWaveformSim::m_dettype {CaloTowerDefs::CEMC}
private

Definition at line 132 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 132 of file CaloWaveformSim.h

Referenced by CreateNodeTree(), Init(), maphitetaphi(), process_event(), and set_detector_type().

std::string CaloWaveformSim::m_fieldname {"Femc_datadriven_qm1_correction"}
private

Definition at line 134 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 134 of file CaloWaveformSim.h

Referenced by Init(), process_event(), and set_fieldname().

int CaloWaveformSim::m_fixpedestal {1500}
private

Definition at line 150 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 150 of file CaloWaveformSim.h

Referenced by process_event(), and set_fixpedestal().

int CaloWaveformSim::m_gaussian_noise {3}
private

Definition at line 151 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 151 of file CaloWaveformSim.h

Referenced by process_event(), and set_gaussian_noise().

int CaloWaveformSim::m_nchannels {24576}
private

Definition at line 147 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 147 of file CaloWaveformSim.h

Referenced by Init(), and process_event().

NoiseType CaloWaveformSim::m_noiseType {NOISE_TREE}
private

Definition at line 168 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 168 of file CaloWaveformSim.h

Referenced by process_event(), and set_noise_type().

int CaloWaveformSim::m_nsamples {31}
private

Definition at line 146 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 146 of file CaloWaveformSim.h

Referenced by Init(), process_event(), and set_nsamples().

bool CaloWaveformSim::m_overrideCalibName {false}
private

Definition at line 136 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 136 of file CaloWaveformSim.h

Referenced by Init(), set_calibName(), and set_overrideCalibName().

bool CaloWaveformSim::m_overrideFieldName {false}
private

Definition at line 137 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 137 of file CaloWaveformSim.h

Referenced by Init(), and set_overrideFieldName().

float CaloWaveformSim::m_peakpos {6.}
private

Definition at line 154 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 154 of file CaloWaveformSim.h

Referenced by process_event(), and set_peakpos().

TowerInfoContainer* CaloWaveformSim::m_PedestalContainer {nullptr}
private

Definition at line 142 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 142 of file CaloWaveformSim.h

Referenced by process_event().

int CaloWaveformSim::m_pedestalsamples {12}
private

Definition at line 148 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 148 of file CaloWaveformSim.h

Referenced by process_event(), and set_pedestalsamples().

gsl_rng* CaloWaveformSim::m_RandomGenerator {nullptr}
private

Definition at line 155 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 155 of file CaloWaveformSim.h

Referenced by Init(), process_event(), and ~CaloWaveformSim().

int CaloWaveformSim::m_runNumber {0}
private

Definition at line 145 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 145 of file CaloWaveformSim.h

Referenced by Init().

float CaloWaveformSim::m_sampletime {50. / 3.}
private

Definition at line 149 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 149 of file CaloWaveformSim.h

Referenced by process_event().

float CaloWaveformSim::m_sampling_fraction = {1.0}
private

Definition at line 159 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 159 of file CaloWaveformSim.h

Referenced by Init(), and process_event().

std::string CaloWaveformSim::m_templatefile {"waveformtemptempohcalcosmic.root"}
private

Definition at line 139 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 139 of file CaloWaveformSim.h

Referenced by Init(), and set_templatefile().

float CaloWaveformSim::m_timeshiftwidth {0.}
private

Definition at line 153 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 153 of file CaloWaveformSim.h

Referenced by process_event(), and set_timewidth().

std::vector<std::vector<float> > CaloWaveformSim::m_waveforms = {{}}
private

Definition at line 144 of file CaloWaveformSim.h.

View newest version in sPHENIX GitHub at line 144 of file CaloWaveformSim.h

Referenced by Init(), and process_event().


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