<commit_before>//************************************************************/
//
//	Data Format Header
//
//	Outlines the SPXDataFormat class, which describes the
//	formats available for experimental data.
//	The options are:
//
//		spectrum_t1s 	(DF_SPECTRUM_T1S)
//		spectrum_t1a 	(DF_SPECTRUM_T1A)
//		spectrum_t2s 	(DF_SPECTRUM_T2S)
//		spectrum_t2a 	(DF_SPECTRUM_T2A)
//		spectrum_t3s	(DF_SPECTRUM_T3S)
//		spectrum_t3a	(DF_SPECTRUM_T3A)
//		herafitter		(DF_HERAFITTER)
//
//	@Author: 	<NAME>, <NAME>, <NAME> - CERN ATLAS
//	@Date:		08.10.2014
//	@Email:		<EMAIL>
//
//************************************************************/

#ifndef SPXDATAFORMAT_H
#define SPXDATAFORMAT_H

//Bitfields for determining band format
const int DF_INVALID =			-1;
const int DF_SPECTRUM_T1S = 	(1 << 0);	//0b00000001
const int DF_SPECTRUM_T1A = 	(1 << 1);	//0b00000010
const int DF_SPECTRUM_T2S = 	(1 << 2);	//0b00000100
const int DF_SPECTRUM_T2A =		(1 << 3);	//0b00001000
const int DF_SPECTRUM_T3S = 	(1 << 4);	//0b00010000
const int DF_SPECTRUM_T3A = 	(1 << 5);	//0b00100000
const int DF_HERAFITTER =		(1 << 6);	//0b01000000

class SPXDataFormat {

public:
	SPXDataFormat () : format(0) {}
	SPXDataFormat(unsigned int format) {
		this->format = format;
	}
	explicit SPXDataFormat(std::string s);

	void Parse(std::string s);
	void Print(void);
	std::string ToString(void) const;
	bool IsEmpty(void) const;
	bool IsValid(void) const;

	void Clear(void) {
		format = 0;
	}

	static bool GetDebug(void) {
		return debug;
	}

	static void SetDebug(bool b) {
		debug = b;
	}

	int GetFormat(void) const {
		return (int)format;
	}

	bool Is(unsigned int mask) const {
		if(format == mask) {
			return true;
		} else {
			return false;
		}
	}

	bool IsSymmetric(void) const {
		if(this->IsValid()) {
			if(format == DF_SPECTRUM_T1S) {
				return true;
			}

			if(format == DF_SPECTRUM_T2S) {
				return true;
			}
		}

		return false;
	}

	bool IsAsymmetric(void) const {
		if(this->IsValid()) {
			if(format == DF_SPECTRUM_T1A) {
				return true;
			}

			if(format == DF_SPECTRUM_T2A) {
				return true;
			}
		}

		return false;
	}

	bool IsSpectrumT1S(void) const {
		if((format == DF_SPECTRUM_T1S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT1A(void) const {
		if((format == DF_SPECTRUM_T1A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT2S(void) const {
		if((format == DF_SPECTRUM_T2S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT2A(void) const {
		if((format == DF_SPECTRUM_T2A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT3S(void) const {
		if((format == DF_SPECTRUM_T3S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT3A(void) const {
		if((format == DF_SPECTRUM_T3A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsHERAFitter(void) const {
		if((format == DF_HERAFITTER) && this->IsValid()) {
			return true;
		}

		return false;
	}

private:
	static bool debug;
	unsigned int format;
};

#endif
<commit_msg>Fixed segfault issue: Added T3S/A to ::IsSymmetric and ::IsAsymmetric<commit_after>//************************************************************/
//
//	Data Format Header
//
//	Outlines the SPXDataFormat class, which describes the
//	formats available for experimental data.
//	The options are:
//
//		spectrum_t1s 	(DF_SPECTRUM_T1S)
//		spectrum_t1a 	(DF_SPECTRUM_T1A)
//		spectrum_t2s 	(DF_SPECTRUM_T2S)
//		spectrum_t2a 	(DF_SPECTRUM_T2A)
//		spectrum_t3s	(DF_SPECTRUM_T3S)
//		spectrum_t3a	(DF_SPECTRUM_T3A)
//		herafitter		(DF_HERAFITTER)
//
//	@Author: 	<NAME>, <NAME>, <NAME> - CERN ATLAS
//	@Date:		08.10.2014
//	@Email:		<EMAIL>
//
//************************************************************/

#ifndef SPXDATAFORMAT_H
#define SPXDATAFORMAT_H

//Bitfields for determining band format
const int DF_INVALID =			-1;
const int DF_SPECTRUM_T1S = 	(1 << 0);	//0b00000001
const int DF_SPECTRUM_T1A = 	(1 << 1);	//0b00000010
const int DF_SPECTRUM_T2S = 	(1 << 2);	//0b00000100
const int DF_SPECTRUM_T2A =		(1 << 3);	//0b00001000
const int DF_SPECTRUM_T3S = 	(1 << 4);	//0b00010000
const int DF_SPECTRUM_T3A = 	(1 << 5);	//0b00100000
const int DF_HERAFITTER =		(1 << 6);	//0b01000000

class SPXDataFormat {

public:
	SPXDataFormat () : format(0) {}
	SPXDataFormat(unsigned int format) {
		this->format = format;
	}
	explicit SPXDataFormat(std::string s);

	void Parse(std::string s);
	void Print(void);
	std::string ToString(void) const;
	bool IsEmpty(void) const;
	bool IsValid(void) const;

	void Clear(void) {
		format = 0;
	}

	static bool GetDebug(void) {
		return debug;
	}

	static void SetDebug(bool b) {
		debug = b;
	}

	int GetFormat(void) const {
		return (int)format;
	}

	bool Is(unsigned int mask) const {
		if(format == mask) {
			return true;
		} else {
			return false;
		}
	}

	bool IsSymmetric(void) const {
		if(this->IsValid()) {
			if(format == DF_SPECTRUM_T1S) {
				return true;
			}

			if(format == DF_SPECTRUM_T2S) {
				return true;
			}

			if(format == DF_SPECTRUM_T3S) {
				return true;
			}
		}

		return false;
	}

	bool IsAsymmetric(void) const {
		if(this->IsValid()) {
			if(format == DF_SPECTRUM_T1A) {
				return true;
			}

			if(format == DF_SPECTRUM_T2A) {
				return true;
			}

			if(format == DF_SPECTRUM_T3A) {
				return true;
			}

			//@TODO Is all HERAFitter data asymmetric?
			if(format == DF_HERAFITTER) {
				return true;
			}
		}

		return false;
	}

	bool IsSpectrumT1S(void) const {
		if((format == DF_SPECTRUM_T1S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT1A(void) const {
		if((format == DF_SPECTRUM_T1A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT2S(void) const {
		if((format == DF_SPECTRUM_T2S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT2A(void) const {
		if((format == DF_SPECTRUM_T2A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT3S(void) const {
		if((format == DF_SPECTRUM_T3S) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsSpectrumT3A(void) const {
		if((format == DF_SPECTRUM_T3A) && this->IsValid()) {
			return true;
		}

		return false;
	}

	bool IsHERAFitter(void) const {
		if((format == DF_HERAFITTER) && this->IsValid()) {
			return true;
		}

		return false;
	}

private:
	static bool debug;
	unsigned int format;
};

#endif

{'fraction_non_alphanumeric': 0.1728871067242443, 'fraction_numerical': 0.03809376927822332, 'mean_word_length': 3.4387405886379194, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1833253', 'n_tokens_mistral': 3105, 'n_tokens_neox': 2680, 'n_words': 552}