GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GLATObservation.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GLATObservation.cpp - Fermi LAT observation class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2008-2018 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GLATObservation.cpp
23  * @brief Fermi LAT observation class implementation
24  * @author Juergen Knoedlseder
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "GException.hpp"
32 #include "GObservationRegistry.hpp"
33 #include "GLATObservation.hpp"
34 #include "GLATEventList.hpp"
35 #include "GLATEventCube.hpp"
36 #include "GLATRoi.hpp"
37 #include "GLATException.hpp"
38 #include "GFits.hpp"
39 #include "GTools.hpp"
40 #include "GEnergy.hpp"
41 
42 /* __ Globals ____________________________________________________________ */
44 const GObservationRegistry g_obs_lat_registry(&g_obs_lat_seed);
45 
46 /* __ Method name definitions ____________________________________________ */
47 #define G_RESPONSE "GLATObservation::response(GResponse&)"
48 #define G_READ "GLATObservation::read(GXmlElement&)"
49 #define G_WRITE "GLATObservation::write(GXmlElement&)"
50 
51 /* __ Macros _____________________________________________________________ */
52 
53 /* __ Coding definitions _________________________________________________ */
54 
55 /* __ Debug definitions __________________________________________________ */
56 
57 
58 /*==========================================================================
59  = =
60  = Constructors/destructors =
61  = =
62  ==========================================================================*/
63 
64 /***********************************************************************//**
65  * @brief Void constructor
66  ***************************************************************************/
68 {
69  // Initialise members
70  init_members();
71 
72  // Return
73  return;
74 }
75 
76 
77 /***********************************************************************//**
78  * @brief XML constructor
79  *
80  * @param[in] xml XML element.
81  *
82  * Constructs a LAT observation from the information that is found in an
83  * XML element.
84  ***************************************************************************/
86 {
87  // Initialise members
88  init_members();
89 
90  // Read XML
91  read(xml);
92 
93  // Return
94  return;
95 }
96 
97 
98 /***********************************************************************//**
99  * @brief Copy constructor
100  *
101  * @param[in] obs LAT observation.
102  ***************************************************************************/
104 {
105  // Initialise members
106  init_members();
107 
108  // Copy members
109  copy_members(obs);
110 
111  // Return
112  return;
113 }
114 
115 
116 /***********************************************************************//**
117  * @brief Destructor
118  ***************************************************************************/
120 {
121  // Free members
122  free_members();
123 
124  // Return
125  return;
126 }
127 
128 
129 /*==========================================================================
130  = =
131  = Operators =
132  = =
133  ==========================================================================*/
134 
135 /***********************************************************************//**
136  * @brief Assignment operator
137  *
138  * @param[in] obs Fermi/LAT observation.
139  * @return Fermi/LAT observation.
140  ***************************************************************************/
142 {
143  // Execute only if object is not identical
144  if (this != &obs) {
145 
146  // Copy base class members
147  this->GObservation::operator=(obs);
148 
149  // Free members
150  free_members();
151 
152  // Initialise members
153  init_members();
154 
155  // Copy members
156  copy_members(obs);
157 
158  } // endif: object was not identical
159 
160  // Return this object
161  return *this;
162 }
163 
164 
165 /*==========================================================================
166  = =
167  = Public methods =
168  = =
169  ==========================================================================*/
170 
171 /***********************************************************************//**
172  * @brief Clear Fermi/LAT observation
173  ***************************************************************************/
175 {
176  // Free members
177  free_members();
179 
180  // Initialise members
182  init_members();
183 
184  // Return
185  return;
186 }
187 
188 
189 /***********************************************************************//**
190  * @brief Clone Fermi/LAT observation
191  *
192  * @return Pointer to deep copy of Fermi/LAT observation.
193  ***************************************************************************/
195 {
196  return new GLATObservation(*this);
197 }
198 
199 
200 /***********************************************************************//**
201  * @brief Set response function
202  *
203  * @param[in] rsp Response function.
204  *
205  * @exception GLATException::bad_response_type
206  * Specified response in not of type GLATResponse.
207  *
208  * Sets the response function for the observation. The argument has to be of
209  * type GLATResponse, otherwise an exception is thrown.
210  ***************************************************************************/
212 {
213  // Get pointer on LAT response
214  const GLATResponse* latrsp = dynamic_cast<const GLATResponse*>(&rsp);
215  if (latrsp == NULL) {
217  }
218 
219  // Copy response function
220  m_response = *latrsp;
221 
222  // Return
223  return;
224 }
225 
226 
227 /***********************************************************************//**
228  * @brief Set response function
229  *
230  * @param[in] irfname Name of instrument response function.
231  *
232  * Set the LAT response function using the IRF name and the path to the
233  * calibration database. The IRF name has to be one of
234  *
235  * name (is equivalent to front+back)
236  * name::front
237  * name::back
238  * name::psf(0-3)
239  * name::edisp(0-3)
240  *
241  * where name is the response name (for example "P8R2_SOURCE_V6"). Note that
242  * the name is case sensitive, but the event typ is not case sensitive.
243  ***************************************************************************/
244 void GLATObservation::response(const std::string& irfname)
245 {
246  // Clear LAT response function
247  m_response.clear();
248 
249  // Load instrument response function
250  m_response.load(irfname);
251 
252  // Return
253  return;
254 }
255 
256 
257 /***********************************************************************//**
258  * @brief Read observation from XML element
259  *
260  * @param[in] xml XML element.
261  *
262  * @exception GException::xml_invalid_parnum
263  * Invalid number of parameters found in XML element.
264  * @exception GException::xml_invalid_parnames
265  * Invalid parameter names found in XML element.
266  *
267  * Reads information for a LAT observation from an XML element. The expected
268  * format of the XML element is
269  *
270  * <observation name="..." id="..." instrument="LAT">
271  * <parameter name="FT1" file="..."/>
272  * <parameter name="FT2" file="..."/>
273  * <parameter name="LiveTimeCube" file="..."/>
274  * <parameter name="IRF" file="..."/>
275  * </observation>
276  *
277  * for an unbinned observation and
278  *
279  * <observation name="..." id="..." instrument="LAT">
280  * <parameter name="CountsMap" file="..."/>
281  * <parameter name="ExposureMap" file="..."/>
282  * <parameter name="LiveTimeCube" file="..."/>
283  * <parameter name="IRF" value="..."/>
284  * </observation>
285  *
286  * for a binned observation.
287  ***************************************************************************/
289 {
290  // Clear observation
291  clear();
292 
293  // Initialise attributes
294  std::string ft1file = "";
295  std::string ft2file = "";
296  std::string ltfile = "";
297  std::string cntfile = "";
298  std::string expfile = "";
299  std::string irfname = "";
300 
301  // Determine number of parameter nodes in XML element
302  int npars = xml.elements("parameter");
303 
304  // Verify that XML element has exactly 4 parameters
305  if (xml.elements() != 4 || npars != 4) {
307  "LAT observation requires exactly 4 parameters.");
308  }
309 
310  // Extract parameters
311  int npar1[] = {0, 0, 0, 0};
312  int npar2[] = {0, 0, 0, 0};
313  for (int i = 0; i < npars; ++i) {
314 
315  // Get parameter element
316  const GXmlElement* par = xml.element("parameter", i);
317 
318  // Handle Unbinned format
319  if (par->attribute("name") == "FT1") {
320  ft1file = par->attribute("file");
321  npar1[0]++;
322  }
323  else if (par->attribute("name") == "FT2") {
324  ft2file = par->attribute("file");
325  npar1[1]++;
326  }
327 
328  // Handle Binned format
329  else if (par->attribute("name") == "CountsMap") {
330  cntfile = par->attribute("file");
331  npar2[0]++;
332  }
333  else if (par->attribute("name") == "ExposureMap") {
334  expfile = par->attribute("file");
335  npar2[1]++;
336  }
337 
338  // Handle common parameters
339  else if (par->attribute("name") == "LiveTimeCube") {
340  ltfile = par->attribute("file");
341  npar1[2]++;
342  npar2[2]++;
343  }
344  else if (par->attribute("name") == "IRF") {
345  irfname = par->attribute("value");
346  npar1[3]++;
347  npar2[3]++;
348  }
349 
350  } // endfor: looped over all parameters
351 
352  // Verify that all parameters were found
353  bool unbin_ok = (npar1[0] == 1 && npar1[1] == 1 && npar1[2] == 1 && npar1[3] == 1);
354  bool bin_ok = (npar2[0] == 1 && npar2[1] == 1 && npar2[2] == 1 && npar2[3] == 1);
355  if (!bin_ok && !unbin_ok) {
357  "Require either \"FT1\", \"FT2\", \"LiveTimeCube\", and \"IRF\""
358  " or \"CountsMap\", \"ExposureMap\", \"LiveTimeCube\", and"
359  " \"IRF\" parameters.");
360  }
361 
362  // Load data
363  if (unbin_ok) {
364 
365  // Expand file names
366  ft1file = gammalib::xml_file_expand(xml, ft1file);
367  ft2file = gammalib::xml_file_expand(xml, ft2file);
368  ltfile = gammalib::xml_file_expand(xml, ltfile);
369 
370  // Load files
371  load_unbinned(ft1file, ft2file, ltfile);
372  }
373  else {
374 
375  // Expand file names
376  cntfile = gammalib::xml_file_expand(xml, cntfile);
377  expfile = gammalib::xml_file_expand(xml, expfile);
378  ltfile = gammalib::xml_file_expand(xml, ltfile);
379 
380  // Load files
381  load_binned(cntfile, expfile, ltfile);
382  }
383 
384  // Set response function
385  response(irfname);
386 
387  // Return
388  return;
389 }
390 
391 
392 /***********************************************************************//**
393  * @brief Write observation into XML element
394  *
395  * @param[in] xml XML element.
396  *
397  * @exception GException::no_list
398  * No valid CTA event list or event cube found.
399  * @exception GException::xml_invalid_parnum
400  * Invalid number of parameters found in XML element.
401  * @exception GException::xml_invalid_parnames
402  * Invalid parameter names found in XML element.
403  *
404  * Writes information for a LAT observation into an XML element. The expected
405  * format of the XML element is
406  *
407  * <observation name="..." id="..." instrument="LAT">
408  * <parameter name="FT1" file="..."/>
409  * <parameter name="FT2" file="..."/>
410  * <parameter name="LiveTimeCube" file="..."/>
411  * <parameter name="IRF" file="..."/>
412  * </observation>
413  *
414  * for an unbinned observation and
415  *
416  * <observation name="..." id="..." instrument="LAT">
417  * <parameter name="CountsMap" file="..."/>
418  * <parameter name="ExposureMap" file="..."/>
419  * <parameter name="LiveTimeCube" file="..."/>
420  * <parameter name="IRF" value="..."/>
421  * </observation>
422  *
423  * for a binned observation.
424  *
425  * @todo We should create a special exception that informs that there is
426  * neither a valid LAT event list nor a valid LAT counts map in this
427  * observations.
428  ***************************************************************************/
430 {
431  // Determine if we deal with a binned or unbinned observation
432  const GLATEventList* list = dynamic_cast<const GLATEventList*>(m_events);
433  const GLATEventCube* cube = dynamic_cast<const GLATEventCube*>(m_events);
434  if (list == NULL && cube == NULL) {
436  }
437 
438  // Set event list flag
439  bool is_list = (list != NULL);
440 
441  // If XML element has 0 nodes then append 4 parameter nodes
442  if (xml.elements() == 0) {
443  if (is_list) {
444  xml.append(GXmlElement("parameter name=\"FT1\""));
445  xml.append(GXmlElement("parameter name=\"FT2\""));
446  xml.append(GXmlElement("parameter name=\"LiveTimeCube\""));
447  xml.append(GXmlElement("parameter name=\"IRF\""));
448  }
449  else {
450  xml.append(GXmlElement("parameter name=\"CountsMap\""));
451  xml.append(GXmlElement("parameter name=\"ExposureMap\""));
452  xml.append(GXmlElement("parameter name=\"LiveTimeCube\""));
453  xml.append(GXmlElement("parameter name=\"IRF\""));
454  }
455  }
456 
457  // Verify that XML element has exactly 4 parameters
458  if (xml.elements() != 4 || xml.elements("parameter") != 4) {
460  "LAT observation requires exactly 4 parameters.");
461  }
462 
463  // Set or update parameter attributes
464  int npar[] = {0, 0, 0, 0};
465  for (int i = 0; i < 4; ++i) {
466 
467  // Get parameter element
468  GXmlElement* par = xml.element("parameter", i);
469 
470  // Handle FT1
471  if (par->attribute("name") == "FT1") {
472  par->attribute("file", gammalib::xml_file_reduce(xml, m_ft1file));
473  npar[0]++;
474  }
475 
476  // Handle CountsMap
477  else if (par->attribute("name") == "CountsMap") {
478  par->attribute("file", gammalib::xml_file_reduce(xml, m_cntfile));
479  npar[0]++;
480  }
481 
482  // Handle FT2
483  else if (par->attribute("name") == "FT2") {
484  par->attribute("file", gammalib::xml_file_reduce(xml, m_ft2file));
485  npar[1]++;
486  }
487 
488  // Handle ExposureMap
489  else if (par->attribute("name") == "ExposureMap") {
490  par->attribute("file", gammalib::xml_file_reduce(xml, m_expfile));
491  npar[1]++;
492  }
493 
494  // Handle LiveTimeCube
495  else if (par->attribute("name") == "LiveTimeCube") {
496  par->attribute("file", gammalib::xml_file_reduce(xml, m_ltfile));
497  npar[2]++;
498  }
499 
500  // Handle IRF
501  else if (par->attribute("name") == "IRF") {
502  std::string irfname = "";
503  irfname = m_response.rspname();
504  par->attribute("value", irfname);
505  npar[3]++;
506  }
507 
508  } // endfor: looped over all parameters
509 
510  // Verify that all required parameters are present
511  if (npar[0] != 1 || npar[1] != 1 || npar[2] != 1 || npar[3] != 1) {
513  "Require either \"FT1\", \"FT2\", \"LiveTimeCube\", and \"IRF\""
514  " or \"CountsMap\", \"ExposureMap\", \"LiveTimeCube\", and"
515  " \"IRF\" parameters.");
516  }
517 
518  // Return
519  return;
520 }
521 
522 
523 /***********************************************************************//**
524  * @brief Print LAT observation information
525  *
526  * @param[in] chatter Chattiness.
527  * @return String containing LAT observation information.
528  ***************************************************************************/
529 std::string GLATObservation::print(const GChatter& chatter) const
530 {
531  // Initialise result string
532  std::string result;
533 
534  // Continue only if chatter is not silent
535  if (chatter != SILENT) {
536 
537  // Append header
538  result.append("=== GLATObservation ===");
539 
540  // Append information
541  result.append("\n"+gammalib::parformat("Name")+name());
542  result.append("\n"+gammalib::parformat("Identifier")+id());
543  result.append("\n"+gammalib::parformat("Instrument")+instrument());
544  result.append("\n"+gammalib::parformat("Statistic")+statistic());
545  result.append("\n"+gammalib::parformat("Ontime"));
546  result.append(gammalib::str(ontime())+" s");
547  result.append("\n"+gammalib::parformat("Livetime"));
548  result.append(gammalib::str(livetime())+" s");
549 
550  // Append detailed information
551  GChatter reduced_chatter = gammalib::reduce(chatter);
552  if (reduced_chatter > SILENT) {
553 
554  // Append response
555  result.append("\n"+m_response.print(reduced_chatter));
556 
557  // Append livetime cube
558  if (m_ltcube != NULL) {
559  result.append("\n"+m_ltcube->print(reduced_chatter));
560  }
561  else {
562  result.append("\n"+gammalib::parformat("LAT livetime cube"));
563  result.append("undefined");
564  }
565 
566  // Append events
567  if (m_events != NULL) {
568  result.append("\n"+m_events->print(reduced_chatter));
569  }
570 
571  } // endif: appended detailed information
572 
573  } // endif: chatter was not silent
574 
575  // Return result
576  return result;
577 }
578 
579 
580 /***********************************************************************//**
581  * @brief Load data for unbinned analysis
582  *
583  * @param[in] ft1name FT1 FITS filename.
584  * @param[in] ft2name FT2 FITS filename.
585  * @param[in] ltcube_name Livetime cube FITS filename
586  *
587  * @todo So far nothing is done with the ft2 file and the ltcube file.
588  * Loading of the relevant information needs to be implemented.
589  ***************************************************************************/
590 void GLATObservation::load_unbinned(const std::string& ft1name,
591  const std::string& ft2name,
592  const std::string& ltcube_name)
593 {
594  // Delete any existing event container (do not call clear() as we do not
595  // want to delete the response function)
596  if (m_events != NULL) delete m_events;
597  m_events = NULL;
598 
599  // Allocate event list
601 
602  // Assign event list as the observation's event container
603  m_events = events;
604 
605  // Open FITS file
606  GFits file(ft1name);
607 
608  // Read event list
609  events->read(file);
610 
611  // Read observation attributes from EVENTS extension
612  //GFitsHDU* hdu = file.hdu("EVENTS");
613  //read_attributes(hdu);
614 
615  // Close FITS file
616  file.close();
617 
618  // Optionally allocate and load livetime cube
619  if (ltcube_name.length() > 0) {
620  m_ltcube = new GLATLtCube;
621  m_ltcube->load(ltcube_name);
622  }
623 
624  // Store filenames
625  m_ft1file = ft1name;
626  m_ft2file = ft2name;
627  m_ltfile = ltcube_name;
628 
629  // Return
630  return;
631 }
632 
633 
634 /***********************************************************************//**
635  * @brief Load data for binned analysis
636  *
637  * @param[in] cntmap_name Counts map or Source map FITS filename
638  * @param[in] expmap_name Binned explosure map FITS filename
639  * @param[in] ltcube_name Livetime cube FITS filename
640  *
641  * @todo So far nothing is done with the expmap file.
642  * Approriate loading needs to be implemented.
643  ***************************************************************************/
644 void GLATObservation::load_binned(const std::string& cntmap_name,
645  const std::string& expmap_name,
646  const std::string& ltcube_name)
647 {
648  // Delete old events and livetime cube. We do not call clear() here
649  // since we want to preserve any existing response function.
650  if (m_events != NULL) delete m_events;
651  if (m_ltcube != NULL) delete m_ltcube;
652  m_events = NULL;
653  m_ltcube = NULL;
654 
655  // Allocate event cube
657 
658  // Assign event cube as the observation's event container
659  m_events = events;
660 
661  // Load event list
662  events->load(cntmap_name);
663 
664  // Optionally allocate and load livetime cube
665  if (ltcube_name.length() > 0) {
666  m_ltcube = new GLATLtCube;
667  m_ltcube->load(ltcube_name);
668  }
669 
670  // Store filenames
671  m_cntfile = cntmap_name;
672  m_expfile = expmap_name;
673  m_ltfile = ltcube_name;
674 
675  // Return
676  return;
677 }
678 
679 
680 /*==========================================================================
681  = =
682  = Private methods =
683  = =
684  ==========================================================================*/
685 
686 /***********************************************************************//**
687  * @brief Initialise class members
688  ***************************************************************************/
690 {
691  // Initialise members
692  m_ft1file.clear();
693  m_ft2file.clear();
694  m_ltfile.clear();
695  m_cntfile.clear();
696  m_expfile.clear();
697  m_response.clear();
698  m_ltcube = NULL;
699 
700  // Return
701  return;
702 }
703 
704 
705 /***********************************************************************//**
706  * @brief Copy class members
707  *
708  * @param[in] obs LAT observation.
709  ***************************************************************************/
711 {
712  // Copy members
713  m_ft1file = obs.m_ft1file;
714  m_ft2file = obs.m_ft2file;
715  m_ltfile = obs.m_ltfile;
716  m_cntfile = obs.m_cntfile;
717  m_expfile = obs.m_expfile;
718  m_response = obs.m_response;
719 
720  // Clone members
721  if (obs.m_ltcube != NULL) m_ltcube = obs.m_ltcube->clone();
722 
723  // Return
724  return;
725 }
726 
727 
728 /***********************************************************************//**
729  * @brief Delete class members
730  ***************************************************************************/
732 {
733  // Free memory
734  if (m_ltcube != NULL) delete m_ltcube;
735 
736  // Mark memory as free
737  m_ltcube = NULL;
738 
739  // Return
740  return;
741 }
std::string m_ltfile
Lifetime cube filename.
void init_members(void)
Initialise class members.
const std::string & statistic(void) const
Return optimizer statistic.
Fermi/LAT observation class.
const GLATObservation g_obs_lat_seed
Fermi/LAT observation class definition.
std::string m_ft2file
FT2 filename.
Energy value class definition.
virtual void read(const GXmlElement &xml)
Read observation from XML element.
void load(const GFilename &filename)
Load livetime cube from FITS file.
Definition: GLATLtCube.cpp:389
#define G_READ
void copy_members(const GLATObservation &obs)
Copy class members.
GEvents * m_events
Pointer to event container.
GLATObservation(void)
Void constructor.
virtual void load(const GFilename &filename)
Load LAT event cube from FITS file.
XML element node class.
Definition: GXmlElement.hpp:47
Fermi/LAT Response class.
void load(const std::string &rspname)
Load Fermi LAT response from calibration database.
void free_members(void)
Delete class members.
virtual int elements(void) const
Return number of GXMLElement children of node.
Definition: GXmlNode.cpp:580
Gammalib tools definition.
FITS file class.
Definition: GFits.hpp:63
virtual GLATObservation * clone(void) const
Clone Fermi/LAT observation.
FITS file class interface definition.
Fermi/LAT region of interest class definition.
GLATLtCube * clone(void) const
Clone livetime cube.
Definition: GLATLtCube.cpp:378
std::string print(const GChatter &chatter=NORMAL) const
Print livetime cube information.
Definition: GLATLtCube.cpp:501
const std::string & rspname(void) const
Return response name.
GFilename xml_file_reduce(const GXmlElement &xml, const std::string &filename)
Reduce file name provided for writing as XML attribute.
Definition: GTools.cpp:1713
GLATObservation & operator=(const GLATObservation &obs)
Assignment operator.
std::string m_ft1file
FT1 filename.
virtual void clear(void)
Clear response.
virtual ~GLATObservation(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print LAT observation information.
void free_members(void)
Delete class members.
virtual void clear(void)
Clear Fermi/LAT observation.
virtual double livetime(void) const
Return livetime.
const GXmlAttribute * attribute(const int &index) const
Return attribute.
LAT exception handler interface definition.
GLATLtCube * m_ltcube
Pointer to livetime cube.
virtual double ontime(void) const
Return ontime.
#define G_RESPONSE
void load_binned(const std::string &cntmap_name, const std::string &expmap_name, const std::string &ltcube_name)
Load data for binned analysis.
Interface definition for the observation registry class.
const std::string & name(void) const
Return observation name.
Observation registry class definition.
virtual void write(GXmlElement &xml) const
Write observation into XML element.
GChatter
Definition: GTypemaps.hpp:33
Fermi/LAT event cube class definition.
Fermi/LAT event cube class.
void init_members(void)
Initialise class members.
Abstract observation base class.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print Fermi-LAT response information.
#define G_WRITE
Fermi/LAT event list class.
std::string m_expfile
Exposure map filename.
virtual GXmlElement * element(const int &index)
Return pointer to GXMLElement child.
Definition: GXmlNode.cpp:634
Fermi/LAT event list class definition.
virtual const GLATResponse * response(void) const
Return Fermi/LAT response function.
GChatter reduce(const GChatter &chatter)
Reduce chattiness by one level.
Definition: GTypemaps.hpp:65
virtual GObservation & operator=(const GObservation &obs)
Assignment operator.
virtual GEvents * events(void)
Return events.
Exception handler interface definition.
virtual void read(const GFits &file)
Read LAT events from FITS file.
std::string m_cntfile
Counts map filename.
virtual std::string instrument(void) const
Return instrument name.
virtual GXmlNode * append(const GXmlNode &node)
Append XML child node.
Definition: GXmlNode.cpp:284
Abstract instrument response base class.
Definition: GResponse.hpp:67
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
Definition: GTools.cpp:1022
GLATResponse m_response
Instrument response functions.
void close(void)
Close FITS file.
Definition: GFits.cpp:1314
Interface for the Fermi LAT livetime cube.
Definition: GLATLtCube.hpp:59
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
void load_unbinned(const std::string &ft1name, const std::string &ft2name, const std::string &ltcube_name)
Load data for unbinned analysis.
GFilename xml_file_expand(const GXmlElement &xml, const std::string &filename)
Expand file name provided as XML attribute for loading.
Definition: GTools.cpp:1683
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
Definition: GTools.cpp:413