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) {
227 if (event.
modcom() < 1 ||
event.modcom() > 98) {
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;
400 if (fpmtflag < 0 || fpmtflag > 2) {
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) {
void clear(void)
Clear phase intervals.
COMPTEL instrument status class.
COMPTEL instrument status class definition.
const bool & use_d2(const int &id2) const
Return D2 module usage flag.
void modcom(const int &modcom)
Set mini telescope.
void copy_members(const GCOMSelection &select)
Copy class members.
int m_num_d2[14]
Number of events per D2 module.
bool has_card(const int &cardno) const
Check existence of header card.
int m_vetoflag_max
Maximum veto flag.
int m_num_d1module_off
Number of events excluded since D1 module off.
int m_num_tof_max
Number of events above TOF threshold.
int m_reflag_min
Minimum rejection flag.
bool m_use_d1[7]
D1 module usage.
Abstract FITS extension base class.
GTime mjd(void) const
Return reference Modified Julian Day.
COMPTEL event atom class definition.
void reflag(const int &reflag)
Set rejection flag.
void theta(const float &theta)
Set scatter zenith angle.
int m_tof_max
Maximum TOF window.
void tof(const float &tof)
Set TOF value.
double m_e2_max
Maximum D2 energy deposit (MeV)
double m_e2_min
Minimum D2 energy deposit (MeV)
void e2(const float &e2)
Set D2 module energy deposit.
bool is_empty(void) const
Signals if there are no ephemerides for pulsar.
double f2(void) const
Return second frequency derivative at reference Modified Julian Day.
COMPTEL selection set class.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
int m_reflag_max
Maximum rejection flag.
const double & com_exd2r(const int &id2)
Return D2 module exclusion region radius.
int m_vetoflag_min
Minimum veto flag.
bool is_empty(void) const
Signal if there are no phase intervals.
Implementation of support function used by COMPTEL classes.
const int & fpmtflag(void) const
Return failed PMT flag for D2 modules.
Abstract FITS extension base class definition.
GModelTemporalPhaseCurve m_orbital_phase_curve
Orbital phase curve.
COMPTEL selection set class definition.
double real(const std::string &keyname) const
Return card value as double precision.
void free_members(void)
Delete class members.
void write(GFitsHDU &hdu) const
Write selection set keywords into FITS HDU.
int m_psd_max
Maximum PSD window.
const double & com_exd2y(const int &id2)
Return D2 module exclusion region Y position.
void veto(const int &veto)
Set veto flag.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print Pulsar.
int m_num_reflag_max
Number of events above rejection flag threshold.
void orbital_period(const double &period, const GTime &time)
Set orbital period.
GCOMSelection(void)
Void constructor.
int com_tjd(const GTime &time)
Convert GTime in COMPTEL TJD.
int m_num_e1_min
Number of events below E1 threshold.
void init_members(void)
Initialise class members.
int m_psd_min
Minimum PSD window.
double f0(void) const
Return frequency at reference Modified Julian Day.
void init_statistics(void) const
Initialise selection statistics.
const double & com_exd2x(const int &id2)
Return D2 module exclusion region X position.
int m_num_d2module_off
Number of events excluded since D2 module off.
GCOMSelection & operator=(const GCOMSelection &select)
Assignment operator.
virtual ~GCOMSelection(void)
Destructor.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL selection set.
int integer(const std::string &keyname) const
Return card value as integer.
void psd(const float &psd)
Set PSD value.
double m_e1_max
Maximum D1 energy deposit (MeV)
int m_num_e2_max
Number of events above E2 threshold.
GPulsar m_pulsar
Pulsar information.
int d1status(const int &tjd, const int &module) const
Return D1 module status.
const bool & use_d1(const int &id1) const
Return D1 module usage flag.
int m_num_events_rejected
Number of rejected events.
bool m_use_d2[14]
D2 module usage.
virtual GCOMSelection * clone(void) const
Clone COMPTEL selection set.
int m_num_vetoflag_min
Number of events below veto flag threshold.
double phase(void) const
Return phase at reference Modified Julian Day.
int m_num_reflag_min
Number of events below rejection flag threshold.
const GTime & time(void) const
Return event time.
bool use_event(const GCOMEventAtom &event) const
Check if event should be used.
int d2status(const int &tjd, const int &module) const
Return D2 module status.
void e1(const float &e1)
Set D1 module energy deposit.
int m_num_invalid_modcom
Number of events with invalid minitelescopes.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print phase curve information.
int m_num_events_checked
Number of checked events.
GPhases m_pulsar_phases
Phases for pulse phase selection.
int m_num_fpmt
Number of events excluded due to failed PMT.
int m_num_tof_min
Number of events below TOF threshold.
virtual void clear(void)
Clear COMPTEL selection set.
int m_num_psd_max
Number of events above PSD threshold.
std::string string(const std::string &keyname) const
Return card value as string.
int m_num_no_scatter
Number of events without scatter angle.
double f1(void) const
Return first frequency derivative at reference Modified Julian Day.
int m_num_psd_min
Number of events below PSD threshold.
virtual void clear(void)
Clear Pulsar.
double m_e1_min
Minimum D1 energy deposit (MeV)
void read(const GFitsHDU &hdu)
Read selection set from FITS HDU keywords.
std::string parformat(const std::string &s, const int &indent=0)
Convert string in parameter format.
int m_num_e2_min
Number of events below E2 threshold.
GPhases m_orbital_phases
Phases for orbital phase selection.
GFitsHeaderCard & card(const int &cardno)
Return header card.
std::string print(const GChatter &chatter=NORMAL) const
Print phase intervals.
int m_num_events_used
Number of used events.
int m_num_vetoflag_max
Number of events above veto flag threshold.
int m_tof_min
Minimum TOF window.
int m_num_e1_max
Number of events above E1 threshold.
int m_num_d1[7]
Number of events per D1 module.
virtual void clear(void)
Clear phase curve.
COMPTEL event atom class.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.