ctools  2.0.0
 All Classes Namespaces Files Functions Variables Macros Pages
ctobssim Class Reference

Observation simulator tool. More...

#include <ctobssim.hpp>

Inheritance diagram for ctobssim:
ctobservation ctool GApplication

Public Member Functions

 ctobssim (void)
 Void constructor. More...
 
 ctobssim (const GObservations &obs)
 Observations constructor. More...
 
 ctobssim (int argc, char *argv[])
 Command line constructor. More...
 
 ctobssim (const ctobssim &app)
 Copy constructor. More...
 
virtual ~ctobssim (void)
 Destructor. More...
 
ctobssimoperator= (const ctobssim &app)
 Assignment operator. More...
 
void clear (void)
 Clear ctobssim tool. More...
 
void process (void)
 Process the ctobssim tool. More...
 
void save (void)
 Save the selected event list(s) More...
 
void publish (const std::string &name="")
 Publish event lists. More...
 
const double & max_rate (void) const
 Return maximum photon rate. More...
 
void max_rate (const double &max_rate)
 Set maximum photon rate. More...
 
void models (const GModels &models)
 Set models for simulation. More...
 
- Public Member Functions inherited from ctobservation
 ctobservation (const std::string &name, const std::string &version)
 Name constructor. More...
 
 ctobservation (const std::string &name, const std::string &version, const GApplicationPars &pars)
 Application parameters constructor. More...
 
 ctobservation (const std::string &name, const std::string &version, int argc, char *argv[])
 Command line constructor. More...
 
 ctobservation (const std::string &name, const std::string &version, const GObservations &obs)
 Observations constructor. More...
 
 ctobservation (const ctobservation &app)
 Copy constructor. More...
 
virtual ~ctobservation (void)
 Destructor. More...
 
ctobservationoperator= (const ctobservation &app)
 Assignment operator. More...
 
void obs (const GObservations &obs)
 Set observation container. More...
 
const GObservations & obs (void) const
 Return observation container. More...
 
- Public Member Functions inherited from ctool
 ctool (const std::string &name, const std::string &version)
 Name constructor. More...
 
 ctool (const std::string &name, const std::string &version, const GApplicationPars &pars)
 Application parameter constructor. More...
 
 ctool (const std::string &name, const std::string &version, int argc, char *argv[])
 Command line constructor. More...
 
 ctool (const ctool &app)
 Copy constructor. More...
 
virtual ~ctool (void)
 Destructor. More...
 
ctooloperator= (const ctool &app)
 Assignment operator. More...
 
virtual void run (void)
 Run ctool. More...
 
virtual void execute (void)
 Execute ctool. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const ctobssim &app)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void get_parameters (void)
 Get application parameters. More...
 
void simulate_source (GCTAObservation *obs, const GModels &models, GRan &ran, GLog *wrklog=NULL)
 Simulate source events from photon list. More...
 
void simulate_interval (GCTAObservation *obs, const GCTAResponseIrf *rsp, GCTAEventList *events, const GModels &models, const GTime &tmin, const GTime &tmax, const GEnergy &etrue_min, const GEnergy &etrue_max, const GEnergy &ereco_min, const GEnergy &ereco_max, const GSkyDir &dir, const double &rad, const double &area, GRan &ran, GLog *wrklog, int &indent, std::vector< int > &nphotons, std::vector< int > &nevents)
 Simulate source events for a time and energy interval. More...
 
void simulate_time_slice (GCTAObservation *obs, const GCTAResponseIrf *rsp, GCTAEventList *events, const GModelSky *model, const int &mc_id, const GTime &tstart, const GTime &tstop, const GEnergy &etrue_min, const GEnergy &etrue_max, const GEnergy &ereco_min, const GEnergy &ereco_max, const GSkyDir &dir, const double &rad, const double &area, GRan &ran, GLog *wrklog, int &indent, int &nphotons, int &nevents)
 Simulate source events for a time slice. More...
 
GEbounds get_ebounds (const GEbounds &ebounds) const
 Get energy boundaries. More...
 
double get_area (GCTAObservation *obs, const GEnergy &emin, const GEnergy &emax) const
 Get simulation area (cm^2) More...
 
double get_model_flux (const GModelSky *model, const GEnergy &emin, const GEnergy &emax, const GSkyDir &centre, const double &radius, const int &indent, GLog *wrklog)
 Determine sky model flux. More...
 
void simulate_background (GCTAObservation *obs, const GModels &models, GRan &ran, GLog *wrklog=NULL)
 Simulate background events from model. More...
 
void set_mc_id_names (GCTAObservation *obs, const GModels &models, GLog *wrklog=NULL)
 Set correspondance between Monte Carlo identifier and model names. More...
 
void save_fits (void)
 Save event list in FITS format. More...
 
void save_xml (void)
 Save event list(s) in XML format. More...
 
std::string outfile (const int &index)
 Return output filename. More...
 
- Protected Member Functions inherited from ctobservation
GCTAObservation * first_unbinned_observation (void)
 Return first unbinned CTA observation. More...
 
GCTAObservation * next_unbinned_observation (void)
 Return next unbinned CTA observation. More...
 
const GCTAObservation * first_unbinned_observation (void) const
 Return first unbinned CTA observation (const version) More...
 
const GCTAObservation * next_unbinned_observation (void) const
 Return next unbinned CTA observation (const version) More...
 
void read_ogip_keywords (GFitsHDU *hdu) const
 Read OGIP keywords from FITS HDU. More...
 
void write_ogip_keywords (GFitsHDU *hdu) const
 Write OGIP keywords in FITS HDU. More...
 
void set_obs_statistic (const std::string &statistic)
 Set fit statistic for CTA observations. More...
 
void set_obs_bounds ()
 Set observation boundaries for CTA observations. More...
 
void save_events_fits (void)
 Save event list in FITS format. More...
 
void save_events_xml (void)
 Save event list(s) in XML format. More...
 
void init_members (void)
 Initialise class members. More...
 
void copy_members (const ctobservation &app)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
- Protected Member Functions inherited from ctool
void init_members (void)
 Initialise class members. More...
 
void copy_members (const ctool &app)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void sync_pfiles (void)
 Synchronise parameter files. More...
 
const bool & read_ahead (void) const
 Signal whether parameters should be read ahead. More...
 
void setup_observations (GObservations &obs, const bool &response=true, const bool &list=true, const bool &cube=true)
 Setup observation container. More...
 
void setup_models (GObservations &obs, const std::string &name="")
 Setup model container. More...
 
GEbounds create_ebounds (void)
 Create energy boundaries from user parameters. More...
 
GEnergies create_energies (void)
 Create energies from user parameters. More...
 
GSkyMap create_map (const GObservations &obs)
 Create a skymap from user parameters. More...
 
GCTAEventCube create_cube (const GObservations &obs)
 Create a CTA event cube from user parameters. More...
 
GCTAObservation create_cta_obs (void)
 Create a CTA observation from User parameters. More...
 
void require_inobs (const std::string &method)
 Throws exception if inobs parameter is not valid. More...
 
void require_inobs_nolist (const std::string &method)
 
void require_inobs_nocube (const std::string &method)
 Throws exception if inobs parameter is a counts cube. More...
 
GCTARoi get_roi (const GCTAPointing &pnt=GCTAPointing())
 Return RoI from User parameters. More...
 
GEbounds get_ebounds (void)
 Return energy boundaries from User parameters. More...
 
GGti get_gti (const GTimeReference &ref)
 Return Good Time Intervals from User parameter. More...
 
GCTAPointing get_pointing (void)
 Return CTA pointing from User parameters. More...
 
GSkyDir get_skydir (void)
 Return sky direction from User parameters. More...
 
std::string set_outfile_name (const std::string &filename)
 Set output file name. More...
 
bool is_stacked (void)
 Query user parameters for stacked analysis. More...
 
bool is_onoff (void)
 Query user parameters for On/Off analysis. More...
 
void log_parameters (const GChatter &chatter)
 Log application parameters. More...
 
void log_observations (const GChatter &chatter, const GObservations &obs, const std::string &what="Observation")
 Log observation container. More...
 
void log_models (const GChatter &chatter, const GModels &models, const std::string &what="Model")
 Log model container. More...
 
void set_response (GObservations &obs)
 Set response for all CTA observations in container. More...
 
std::vector< bool > set_edisp (GObservations &obs, const bool &edisp) const
 Set energy dispersion to CTA observations. More...
 
void restore_edisp (GObservations &obs, const std::vector< bool > &edisp) const
 Restore energy dispersion flags of CTA observations. More...
 
void set_obs_response (GCTAObservation *obs)
 Set response for CTA observation. More...
 
GObservations get_observations (const bool &get_response=true)
 Get observation container. More...
 
GSkyDir get_mean_pointing (const GObservations &obs)
 Derives mean pointing from CTA observations. More...
 
size_t get_current_rss (void)
 Get current resident set size (physical memory use) in Bytes. More...
 
std::string get_obs_header (const GObservation *obs) const
 Return observation header string. More...
 
GEnergies insert_energy_boundaries (const GEnergies &energies, const GCTAObservation &obs)
 Insert observation energy boundaries into list of energies. More...
 
std::vector< bool > cube_layer_usage (const GEbounds &cube_ebounds, const GEbounds &list_ebounds) const
 Determine the counts cube layer usage. More...
 
std::string get_gtiname (const std::string &filename, const std::string &evtname) const
 Get Good Time Intervals extension name. More...
 
void save_event_list (const GCTAObservation *obs, const std::string &infile, const std::string &evtname, const std::string &gtiname, const std::string &outfile) const
 Save event list into FITS file. More...
 
std::string warn_too_few_energies (const GEnergies &energies) const
 Set warning string if there are too few energies. More...
 
std::string warn_xml_suffix (const GFilename &filename) const
 Set warning string if file has no .xml suffix. More...
 
void provide_help (void) const
 Dump help text in the console. More...
 

Protected Attributes

std::string m_outevents
 Output events file. More...
 
std::string m_prefix
 Prefix for multiple event lists. More...
 
int m_startindex
 Start index for multiple event lists. More...
 
int m_seed
 Random number generator seed. More...
 
int m_eslices
 Number of energy slices. More...
 
bool m_apply_edisp
 Apply energy dispersion? More...
 
double m_max_rate
 Maximum photon rate. More...
 
GModels m_models
 Optionally provided models. More...
 
bool m_save_and_dispose
 Save and dispose immediately. More...
 
int m_max_photons
 Maximum number of photons/slice. More...
 
std::vector< GRan > m_rans
 Random number generators. More...
 
int m_event_id
 Event identifier. More...
 
- Protected Attributes inherited from ctobservation
GObservations m_obs
 Observation container. More...
 
- Protected Attributes inherited from ctool
bool m_read_ahead
 Read ahead output parameters. More...
 
bool m_use_xml
 Use XML file instead of FITS file for observations. More...
 

Detailed Description

Observation simulator tool.

This class simulates CTA observation(s) using Monte Carlo sampling of the source and background models. The class supports simulation of data of multiple CTA observations in one shot. If multiple CTA observations are processed and the save method is called, events FITS files will be written for each observation.

Definition at line 50 of file ctobssim.hpp.

Constructor & Destructor Documentation

ctobssim::ctobssim ( void  )

Void constructor.

Constructs an empty ctobssim tool.

Definition at line 74 of file ctobssim.cpp.

References init_members().

ctobssim::ctobssim ( const GObservations &  obs)
explicit

Observations constructor.

Parameters
[in]obsObservation container.

Constructs ctobssim tool from an observation container.

Definition at line 91 of file ctobssim.cpp.

References init_members().

ctobssim::ctobssim ( int  argc,
char *  argv[] 
)

Command line constructor.

Parameters
[in]argcNumber of arguments in command line.
[in]argvArray of command line arguments.

Constructs ctobssim tool using command line arguments for user parameter setting.

Definition at line 111 of file ctobssim.cpp.

References init_members().

ctobssim::ctobssim ( const ctobssim app)

Copy constructor.

Parameters
[in]appApplication.

Constructs ctobssim tool from another ctobssim instance.

Definition at line 129 of file ctobssim.cpp.

References copy_members(), and init_members().

ctobssim::~ctobssim ( void  )
virtual

Destructor.

Destructs ctobssim tool.

Definition at line 147 of file ctobssim.cpp.

References free_members().

Member Function Documentation

void ctobssim::clear ( void  )
virtual

Clear ctobssim tool.

Clears ctobssim tool.

Implements ctobservation.

Definition at line 206 of file ctobssim.cpp.

References free_members(), ctool::free_members(), ctobservation::free_members(), init_members(), ctool::init_members(), and ctobservation::init_members().

void ctobssim::copy_members ( const ctobssim app)
protected

Copy class members.

Parameters
[in]appApplication.

Definition at line 569 of file ctobssim.cpp.

References m_apply_edisp, m_eslices, m_event_id, m_max_photons, m_max_rate, m_models, m_outevents, m_prefix, m_rans, m_save_and_dispose, m_seed, and m_startindex.

Referenced by ctobssim(), and operator=().

void ctobssim::free_members ( void  )
protected

Delete class members.

Definition at line 595 of file ctobssim.cpp.

Referenced by clear(), operator=(), and ~ctobssim().

double ctobssim::get_area ( GCTAObservation *  obs,
const GEnergy &  emin,
const GEnergy &  emax 
) const
protected

Get simulation area (cm^2)

Parameters
[in]obsPointer on CTA observation.
[in]eminMinimum true energy.
[in]emaxMaximum true energy.
Returns
Simulation area (cm^2).

Get the simulation area for an energy interval in units of cm^2. This is done by extracting the maximum effective area value within the energy range [emin,emax] and by multiplying this value by 2 for security. The effective area is sampled at 100 energy values within the energy interval.

Definition at line 1303 of file ctobssim.cpp.

References G_GET_AREA.

Referenced by simulate_source().

GEbounds ctobssim::get_ebounds ( const GEbounds &  ebounds) const
protected

Get energy boundaries.

Parameters
[in]eboundsEnergy boundaries of events.
Returns
Energy boundaries for simulation.

Get the energy boundaries for the source simulation.

Todo:
Need to take care of the (rare) case that there are distinct energy boundaries in the event list. In that case we need to create mixed energy boundaries.

Definition at line 1280 of file ctobssim.cpp.

References m_eslices.

double ctobssim::get_model_flux ( const GModelSky *  model,
const GEnergy &  emin,
const GEnergy &  emax,
const GSkyDir &  centre,
const double &  radius,
const int &  indent,
GLog *  wrklog 
)
protected

Determine sky model flux.

Parameters
[in]modelSky model.
[in]eminMinimum energy.
[in]emaxMaximum energy.
[in]centreCentre of region for photon rate determination.
[in]radiusRadius of region for photon rate determination (degrees).
[in]indentIndent for logging.
[in,out]wrklogPointer to logger.
Returns
Model flux (photons/cm2/sec).

Definition at line 1350 of file ctobssim.cpp.

Referenced by simulate_interval().

void ctobssim::get_parameters ( void  )
protected

Get application parameters.

Get all task parameters from parameter file or (if required) by querying the user. Most parameters are only required if no observation exists so far in the observation container. In this case, a single CTA observation will be added to the container, using the definition provided in the parameter file.

Definition at line 611 of file ctobssim.cpp.

References G_GET_PARAMETERS, ctool::get_observations(), ctool::log_parameters(), m_apply_edisp, m_eslices, m_max_rate, m_models, ctobservation::m_obs, m_rans, m_seed, m_startindex, cscripts.mputils::nthreads(), ctool::read_ahead(), ctool::require_inobs_nocube(), ctobservation::set_obs_bounds(), and ctool::setup_observations().

Referenced by process().

void ctobssim::init_members ( void  )
protected

Initialise class members.

The thrown area is fixed to pi*(2500^2) m2, which is the same value that is used in the Monte Carlo simulations (information from Konrad Bernloehr)

< Maximum number of photons / time slice

Definition at line 537 of file ctobssim.cpp.

References m_apply_edisp, m_eslices, m_event_id, m_max_photons, m_max_rate, m_models, m_outevents, m_prefix, m_rans, m_save_and_dispose, m_seed, and m_startindex.

Referenced by clear(), ctobssim(), and operator=().

const double & ctobssim::max_rate ( void  ) const
inline

Return maximum photon rate.

Returns
Reference to maximum photon rate.

Definition at line 165 of file ctobssim.hpp.

References m_max_rate.

Referenced by max_rate().

void ctobssim::max_rate ( const double &  max_rate)
inline

Set maximum photon rate.

Parameters
[in]max_rateMaximum photon rate.

Definition at line 177 of file ctobssim.hpp.

References m_max_rate, and max_rate().

void ctobssim::models ( const GModels &  models)
inline

Set models for simulation.

Parameters
[in]modelsModel container.

Sets the model container that should be used for simulations. If a model container exists already in the input observations the model container will be overwritten. The models will not be queried, and any model specified using the "inmodel" parameter will be ignored.

Definition at line 195 of file ctobssim.hpp.

References m_models.

Referenced by process().

ctobssim & ctobssim::operator= ( const ctobssim app)

Assignment operator.

Parameters
[in]appctobssim tool.
Returns
ctobssim tool.

Assigns ctobssim tool.

Definition at line 171 of file ctobssim.cpp.

References copy_members(), free_members(), init_members(), and ctobservation::operator=().

std::string ctobssim::outfile ( const int &  index)
protected

Return output filename.

Parameters
[in]indexObservation index
Returns
Output filename

Return output filename for observation with index.

Definition at line 1792 of file ctobssim.cpp.

References m_outevents, m_prefix, m_startindex, and ctool::m_use_xml.

Referenced by process(), and save_xml().

void ctobssim::process ( void  )
virtual

Process the ctobssim tool.

Gets the user parameters, loops over all CTA observations in the observation container, and simulate events for each observation.

Implements ctobservation.

Definition at line 235 of file ctobssim.cpp.

References ctool::get_obs_header(), get_parameters(), ctool::log_observations(), m_apply_edisp, ctobservation::m_obs, m_rans, m_save_and_dispose, m_startindex, ctool::m_use_xml, models(), ctobservation::obs(), outfile(), publish(), ctool::read_ahead(), ctool::restore_edisp(), ctool::set_edisp(), set_mc_id_names(), simulate_background(), and simulate_source().

void ctobssim::publish ( const std::string &  name = "")

Publish event lists.

Parameters
[in]nameEvent list name.

Definition at line 476 of file ctobssim.cpp.

References CTOBSSIM_NAME, ctobservation::m_obs, ctool::m_use_xml, and ctobservation::obs().

Referenced by process().

void ctobssim::save ( void  )
virtual

Save the selected event list(s)

This method saves the selected event list(s) into FITS file(s). There are two modes, depending on the m_use_xml flag.

If m_use_xml is true, all selected event list(s) will be saved into FITS files, where the output filenames are constructued from the input filenames by prepending the m_prefix string to name. Any path information will be stripped form the input name, hence event files will be written into the local working directory (unless some path information is present in the prefix). In addition, an XML file will be created that gathers the filename information for the selected event list(s). If an XML file was present on input, all metadata information will be copied from this input file.

If m_use_xml is false, the selected event list will be saved into a FITS file.

Implements ctobservation.

Definition at line 451 of file ctobssim.cpp.

References ctobservation::m_obs, ctool::m_use_xml, save_fits(), and save_xml().

void ctobssim::save_fits ( void  )
protected

Save event list in FITS format.

Save the event list as a FITS file. The filename of the FITS file is specified by the outfile parameter.

Definition at line 1692 of file ctobssim.cpp.

References ctobservation::m_obs, m_outevents, m_save_and_dispose, and ctobservation::obs().

Referenced by save().

void ctobssim::save_xml ( void  )
protected

Save event list(s) in XML format.

Save the event list(s) into FITS files and write the file path information into a XML file. The filename of the XML file is specified by the outfile parameter, the filename(s) of the event lists are built by prepending a prefix to the input event list filenames. Any path present in the input filename will be stripped, i.e. the event list(s) will be written in the local working directory (unless a path is specified in the prefix).

Definition at line 1730 of file ctobssim.cpp.

References ctobservation::m_obs, m_outevents, m_save_and_dispose, ctobservation::obs(), outfile(), and ctool::warn_xml_suffix().

Referenced by save().

void ctobssim::set_mc_id_names ( GCTAObservation *  obs,
const GModels &  models,
GLog *  wrklog = NULL 
)
protected

Set correspondance between Monte Carlo identifier and model names.

Parameters
[in]obsPointer on CTA observation.
[in]modelsModels.
[in]wrklogPointer to logger.

Sets the correspondance between Monte Carlo identifier and model names. The method collects all Monte Carlo identifiers from the event list and sets the corresponding source names using the GCTAEventList::set_mc_id_names method.

Definition at line 1611 of file ctobssim.cpp.

Referenced by process().

void ctobssim::simulate_background ( GCTAObservation *  obs,
const GModels &  models,
GRan &  ran,
GLog *  wrklog = NULL 
)
protected

Simulate background events from model.

Parameters
[in]obsPointer on CTA observation.
[in]modelsModels.
[in]ranRandom number generator.
[in]wrklogPointer to logger.

Simulate background events from models. The events are stored as event list in the observation.

This method does nothing if the observation pointer is NULL.

Definition at line 1486 of file ctobssim.cpp.

References m_event_id.

Referenced by process().

void ctobssim::simulate_interval ( GCTAObservation *  obs,
const GCTAResponseIrf *  rsp,
GCTAEventList *  events,
const GModels &  models,
const GTime &  tmin,
const GTime &  tmax,
const GEnergy &  etrue_min,
const GEnergy &  etrue_max,
const GEnergy &  ereco_min,
const GEnergy &  ereco_max,
const GSkyDir &  dir,
const double &  rad,
const double &  area,
GRan &  ran,
GLog *  wrklog,
int &  indent,
std::vector< int > &  nphotons,
std::vector< int > &  nevents 
)
protected

Simulate source events for a time and energy interval.

Parameters
[in]obsPointer on CTA observation.
[in]rspPointer on CTA IRF response.
[in,out]eventsPointer on CTA event list.
[in]modelsModel list.
[in]tminStart time.
[in]tmaxStop time.
[in]etrue_minMinimum true energy.
[in]etrue_maxMaximum true energy.
[in]ereco_minMinimum reconstructed energy.
[in]ereco_maxMaximum reconstructed energy.
[in]dirSimulation cone centre.
[in]radSimulation cone radius (degrees).
[in]areaSimulation area (cm^2).
[in,out]ranRandom number generator.
[in]wrklogPointer to logger.
[in,out]indentLogger indent.
[in,out]nphotonsNumber of photons for all models.
[in,out]neventsNumber of events for all models.

Simulate source events for a time and energy interval.

Definition at line 969 of file ctobssim.cpp.

References G_SIMULATE_INTERVAL, get_model_flux(), m_max_photons, m_max_rate, and simulate_time_slice().

Referenced by simulate_source().

void ctobssim::simulate_source ( GCTAObservation *  obs,
const GModels &  models,
GRan &  ran,
GLog *  wrklog = NULL 
)
protected

Simulate source events from photon list.

Parameters
[in]obsPointer on CTA observation.
[in]modelsModel list.
[in,out]ranRandom number generator.
[in]wrklogPointer to logger.

Simulate source events from a photon list for a given CTA observation and all source models. The events are stored in form of an event list in the observation.

The method will loop over all Good Time Intervals (GTI) to perform the simulations. Within a given GTI the requested energy range is split into a number of energy slices so that the simulation area can be adapted to the effective area of the instrument (this avoids simulating a large number of sources photons at low energies while accepting only few of them do to the small effective area). In case that the flux of a source is large, the simulation may be done within time slices so that the memory requirements won't get too large.

This method does nothing if the observation pointer is NULL. It verifies if the observation has a CTA IRF response.

Definition at line 748 of file ctobssim.cpp.

References g_roi_margin, G_SIMULATE_SOURCE, get_area(), ctool::get_ebounds(), and simulate_interval().

Referenced by process().

void ctobssim::simulate_time_slice ( GCTAObservation *  obs,
const GCTAResponseIrf *  rsp,
GCTAEventList *  events,
const GModelSky *  model,
const int &  mc_id,
const GTime &  tstart,
const GTime &  tstop,
const GEnergy &  etrue_min,
const GEnergy &  etrue_max,
const GEnergy &  ereco_min,
const GEnergy &  ereco_max,
const GSkyDir &  dir,
const double &  rad,
const double &  area,
GRan &  ran,
GLog *  wrklog,
int &  indent,
int &  nphotons,
int &  nevents 
)
protected

Simulate source events for a time slice.

Parameters
[in]obsPointer on CTA observation.
[in]rspPointer on CTA response.
[in,out]eventsPointer on CTA event list.
[in]modelModel.
[in]mc_idMonte Carlo identifier of model.
[in]tstartStart time.
[in]tstopStop time.
[in]etrue_minMinimum true energy.
[in]etrue_maxMaximum true energy.
[in]ereco_minMinimum reconstructed energy.
[in]ereco_maxMaximum reconstructed energy.
[in]dirSimulation cone centre.
[in]radSimulation cone radius (degrees).
[in]areaSimulation area (cm^2).
[in,out]ranRandom number generator.
[in]wrklogPointer to logger.
[in,out]indentLogger indent.
[in,out]nphotonsNumber of photons.
[in,out]neventsNumber of events.

Simulate source events for a time slice.

Definition at line 1169 of file ctobssim.cpp.

References m_event_id.

Referenced by simulate_interval().

Member Data Documentation

bool ctobssim::m_apply_edisp
protected

Apply energy dispersion?

Definition at line 147 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), init_members(), and process().

int ctobssim::m_eslices
protected

Number of energy slices.

Definition at line 146 of file ctobssim.hpp.

Referenced by copy_members(), get_ebounds(), get_parameters(), and init_members().

int ctobssim::m_event_id
protected

Event identifier.

Definition at line 155 of file ctobssim.hpp.

Referenced by copy_members(), init_members(), simulate_background(), and simulate_time_slice().

int ctobssim::m_max_photons
protected

Maximum number of photons/slice.

Definition at line 153 of file ctobssim.hpp.

Referenced by copy_members(), init_members(), and simulate_interval().

double ctobssim::m_max_rate
protected

Maximum photon rate.

Definition at line 148 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), init_members(), max_rate(), and simulate_interval().

GModels ctobssim::m_models
protected

Optionally provided models.

Definition at line 151 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), init_members(), and models().

std::string ctobssim::m_outevents
protected

Output events file.

Definition at line 142 of file ctobssim.hpp.

Referenced by copy_members(), init_members(), outfile(), save_fits(), and save_xml().

std::string ctobssim::m_prefix
protected

Prefix for multiple event lists.

Definition at line 143 of file ctobssim.hpp.

Referenced by copy_members(), init_members(), and outfile().

std::vector<GRan> ctobssim::m_rans
protected

Random number generators.

Definition at line 154 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), init_members(), and process().

bool ctobssim::m_save_and_dispose
mutableprotected

Save and dispose immediately.

Definition at line 152 of file ctobssim.hpp.

Referenced by copy_members(), init_members(), process(), save_fits(), and save_xml().

int ctobssim::m_seed
protected

Random number generator seed.

Definition at line 145 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), and init_members().

int ctobssim::m_startindex
protected

Start index for multiple event lists.

Definition at line 144 of file ctobssim.hpp.

Referenced by copy_members(), get_parameters(), init_members(), outfile(), and process().


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