39#define G_FPMTFLAG "GCOMSelection::fpmtflag(int&)"
40#define G_USE_D1_GET "GCOMSelection::use_d1(int&)"
41#define G_USE_D1_SET "GCOMSelection::use_d1(int&, bool&)"
42#define G_USE_D2_GET "GCOMSelection::use_d2(int&)"
43#define G_USE_D2_SET "GCOMSelection::use_d2(int&, bool&)"
118 if (
this != &select) {
195 for (
int i = 0; i < 7; ++i) {
198 for (
int i = 0; i < 14; ++i) {
234 else if (event.
theta() < -1.0e3) {
294 int id2 = (
event.modcom()-1)/7 + 1;
295 int id1 =
event.modcom() - (id2-1) * 7;
301 int d1status = status.
d1status(tjd, id1);
302 int d2status = status.
d2status(tjd, id2);
316 else if (d1status != 1) {
320 else if (d2status < 1) {
327 else if (d2status > 1) {
346 double dsq = dx*dx + dy*dy;
367 int id2 = (
event.modcom()-1)/7 + 1;
368 int id1 =
event.modcom() - (id2-1) * 7;
402 " specified for failed PMT flag for D2 modules. "
403 "Please specify 0, 1 or 2.";
424 if (id1 < 0 || id1 > 6) {
425 std::string msg =
"Invalid D1 module identifier "+
gammalib::str(id1)+
426 " specified. The D1 module identifier needs to be "
427 "comprised within 0 and 6.";
445 if (id1 < 0 || id1 > 6) {
446 std::string msg =
"Invalid D1 module identifier "+
gammalib::str(id1)+
447 " specified. The D1 module identifier needs to be "
448 "comprised within 0 and 6.";
469 if (id2 < 0 || id2 > 13) {
470 std::string msg =
"Invalid D2 module identifier "+
gammalib::str(id2)+
471 " specified. The D2 module identifier needs to be "
472 "comprised within 0 and 13.";
490 if (id2 < 0 || id2 > 13) {
491 std::string msg =
"Invalid D2 module identifier "+
gammalib::str(id2)+
492 " specified. The D2 module identifier needs to be "
493 "comprised within 0 and 13.";
556 if (use.length() == 7) {
557 for (
int i = 0; i < 7; ++i) {
566 if (use.length() == 14) {
567 for (
int i = 0; i < 14; ++i) {
610 for (
int i = 0; i < 7; ++i) {
616 for (
int i = 0; i < 14; ++i) {
645 hdu.
card(
"D1EMIN",
m_e1_min,
"[MeV] Minimum D1 energy deposit");
646 hdu.
card(
"D1EMAX",
m_e1_max,
"[MeV] Maximum D1 energy deposit");
649 hdu.
card(
"D2EMIN",
m_e2_min,
"[MeV] Minimum D2 energy deposit");
650 hdu.
card(
"D2EMAX",
m_e2_max,
"[MeV] Maximum D2 energy deposit");
672 std::string d1use =
"0000000";
673 for (
int i = 0; i < 7; ++i) {
678 hdu.
card(
"D1USE", d1use,
"D1 module usage");
681 std::string d2use =
"00000000000000";
682 for (
int i = 0; i < 14; ++i) {
687 hdu.
card(
"D2USE", d2use,
"D2 module usage");
707 for (
int i = 0; i < 7; ++i) {
709 std::string com =
"Number of events in D1 module "+
gammalib::str(i+1);
712 for (
int i = 0; i < 14; ++i) {
714 std::string com =
"Number of events in D2 module "+
gammalib::str(i+1);
719 hdu.
card(
"ND2FPM",
m_num_fpmt,
"Number of events excluded due to failed PMTs");
769 result.append(
"=== GCOMSelection ===");
822 for (
int i = 0; i < 7; ++i) {
826 result.append(
" [use]");
829 result.append(
" [don't use]");
834 for (
int i = 0; i < 14; ++i) {
838 result.append(
" [use]");
841 result.append(
" [don't use]");
916 for (
int i = 0; i < 7; ++i) {
919 for (
int i = 0; i < 14; ++i) {
956 for (
int i = 0; i < 7; ++i) {
959 for (
int i = 0; i < 14; ++i) {
986 for (
int i = 0; i < 7; ++i) {
989 for (
int i = 0; i < 14; ++i) {
COMPTEL event atom class definition.
COMPTEL selection set class definition.
COMPTEL instrument status class definition.
Implementation of support function used by COMPTEL classes.
Abstract FITS extension base class definition.
COMPTEL event atom class.
void reflag(const int &reflag)
Set rejection flag.
void veto(const int &veto)
Set veto flag.
void e1(const float &e1)
Set D1 module energy deposit.
void theta(const float &theta)
Set scatter zenith angle.
void modcom(const int &modcom)
Set mini telescope.
void psd(const float &psd)
Set PSD value.
const GTime & time(void) const
Return event time.
void tof(const float &tof)
Set TOF value.
void e2(const float &e2)
Set D2 module energy deposit.
COMPTEL selection set class.
GPulsar m_pulsar
Pulsar information.
int m_num_d1module_off
Number of events excluded since D1 module off.
virtual GCOMSelection * clone(void) const
Clone COMPTEL selection set.
int m_num_d2module_off
Number of events excluded since D2 module off.
int m_tof_min
Minimum TOF window.
int m_num_reflag_min
Number of events below rejection flag threshold.
virtual ~GCOMSelection(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL selection set.
int m_vetoflag_max
Maximum veto flag.
GCOMSelection & operator=(const GCOMSelection &select)
Assignment operator.
GCOMSelection(void)
Void constructor.
const int & fpmtflag(void) const
Return failed PMT flag for D2 modules.
int m_num_invalid_modcom
Number of events with invalid minitelescopes.
void copy_members(const GCOMSelection &select)
Copy class members.
GModelTemporalPhaseCurve m_orbital_phase_curve
Orbital phase curve.
void read(const GFitsHDU &hdu)
Read selection set from FITS HDU keywords.
int m_num_vetoflag_max
Number of events above veto flag threshold.
double m_e2_max
Maximum D2 energy deposit (MeV)
int m_reflag_max
Maximum rejection flag.
bool m_use_d2[14]
D2 module usage.
bool m_use_d1[7]
D1 module usage.
void write(GFitsHDU &hdu) const
Write selection set keywords into FITS HDU.
bool use_event(const GCOMEventAtom &event) const
Check if event should be used.
GPhases m_orbital_phases
Phases for orbital phase selection.
void init_statistics(void) const
Initialise selection statistics.
double m_e1_min
Minimum D1 energy deposit (MeV)
void free_members(void)
Delete class members.
int m_num_reflag_max
Number of events above rejection flag threshold.
int m_vetoflag_min
Minimum veto flag.
int m_num_e1_max
Number of events above E1 threshold.
int m_num_e2_max
Number of events above E2 threshold.
int m_num_e1_min
Number of events below E1 threshold.
int m_num_psd_max
Number of events above PSD threshold.
int m_num_d2[14]
Number of events per D2 module.
int m_num_no_scatter
Number of events without scatter angle.
const bool & use_d1(const int &id1) const
Return D1 module usage flag.
const bool & use_d2(const int &id2) const
Return D2 module usage flag.
void orbital_period(const double &period, const GTime &time)
Set orbital period.
int m_psd_max
Maximum PSD window.
virtual void clear(void)
Clear COMPTEL selection set.
int m_num_events_used
Number of used events.
int m_num_e2_min
Number of events below E2 threshold.
GPhases m_pulsar_phases
Phases for pulse phase selection.
void init_members(void)
Initialise class members.
int m_reflag_min
Minimum rejection flag.
int m_num_events_checked
Number of checked events.
double m_e2_min
Minimum D2 energy deposit (MeV)
int m_num_vetoflag_min
Number of events below veto flag threshold.
int m_tof_max
Maximum TOF window.
int m_num_tof_max
Number of events above TOF threshold.
int m_num_tof_min
Number of events below TOF threshold.
double m_e1_max
Maximum D1 energy deposit (MeV)
int m_num_d1[7]
Number of events per D1 module.
int m_num_events_rejected
Number of rejected events.
int m_psd_min
Minimum PSD window.
int m_num_fpmt
Number of events excluded due to failed PMT.
int m_num_psd_min
Number of events below PSD threshold.
COMPTEL instrument status class.
int d2status(const int &tjd, const int &module) const
Return D2 module status.
int d1status(const int &tjd, const int &module) const
Return D1 module status.
Abstract FITS extension base class.
bool has_card(const int &cardno) const
Check existence of header card.
double real(const std::string &keyname) const
Return card value as double precision.
std::string string(const std::string &keyname) const
Return card value as string.
GFitsHeaderCard & card(const int &cardno)
Return header card.
int integer(const std::string &keyname) const
Return card value as integer.
double f1(void) const
Return first frequency derivative at reference Modified Julian Day.
double f0(void) const
Return frequency at reference Modified Julian Day.
double f2(void) const
Return second frequency derivative at reference Modified Julian Day.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print phase curve information.
virtual void clear(void)
Clear phase curve.
double phase(void) const
Return phase at reference Modified Julian Day.
GTime mjd(void) const
Return reference Modified Julian Day.
std::string print(const GChatter &chatter=NORMAL) const
Print phase intervals.
bool is_empty(void) const
Signal if there are no phase intervals.
void clear(void)
Clear phase intervals.
virtual void clear(void)
Clear Pulsar.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print Pulsar.
bool is_empty(void) const
Signals if there are no ephemerides for pulsar.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
const double & com_exd2r(const int &id2)
Return D2 module exclusion region radius.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
const double & com_exd2x(const int &id2)
Return D2 module exclusion region X position.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
const double & com_exd2y(const int &id2)
Return D2 module exclusion region Y position.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.