Skip to content
Snippets Groups Projects
Commit 44a43aaf authored by mam-mih-val's avatar mam-mih-val
Browse files

enum -> enum class

parent 6f49b556
No related branches found
No related tags found
No related merge requests found
......@@ -26,10 +26,10 @@ void CorrelationTask::FillCorrelations() {
// Q1 * Psi_RP
if (config_->IsSimulation()) {
for (const auto& qn : config_->GetQvectorsConfig()) {
AddQ1Q1Correlations(qn, config_->GetPsiQvector(), u1Q1_EVENT_PLANE); // <Qa, Qb> / |Qb|, because the magnitude of PsiRp-vector must be 1
AddQ1Q1Correlations(qn, config_->GetPsiQvector(), Q1Q1_CORRELATION_TYPES::u1Q1_EVENT_PLANE); // <Qa, Qb> / |Qb|, because the magnitude of PsiRp-vector must be 1
}
for (const auto& qn : config_->GetChannelConfig()) {
AddQ1Q1Correlations(qn, config_->GetPsiQvector(), u1Q1_EVENT_PLANE); // <Qa, Qb> / |Qb|, because the magnitude of PsiRp-vector must be 1
AddQ1Q1Correlations(qn, config_->GetPsiQvector(), Q1Q1_CORRELATION_TYPES::u1Q1_EVENT_PLANE); // <Qa, Qb> / |Qb|, because the magnitude of PsiRp-vector must be 1
}
}
// // Q1_channel * Q1_track
......@@ -81,24 +81,24 @@ void CorrelationTask::Run() {
std::cout << "Done." << std::endl;
}
void CorrelationTask::AddQ1Q1Correlations(const Qn::QvectorConfig& a, const Qn::QvectorConfig& b, int type){
void CorrelationTask::AddQ1Q1Correlations(const Qn::QvectorConfig& a, const Qn::QvectorConfig& b, Q1Q1_CORRELATION_TYPES type){
using function2_t = const std::function<double(const Qn::QVector &a, const Qn::QVector &b)>;
std::string a_name = a.GetName() + "_" + a.GetLastStepName();
std::string b_name = b.GetName() + "_" + b.GetLastStepName();
static std::vector<std::pair<std::string, function2_t>> corr_func;
switch (type) {
case SCALAR_PRODUCT:
corr_func = Qn::Q1Q1(non_zero_only_);
break;
case Q1Q1_EVENT_PLANE:
corr_func = Qn::Q1Q1EP(non_zero_only_);
break;
case u1Q1_EVENT_PLANE:
corr_func = Qn::u1Q1EP(non_zero_only_);
break;
default:
std::cerr << "CorrelationTask::AddQ1Q1Correlations: Unknown type of correlations" << std::endl;
abort();
case Q1Q1_CORRELATION_TYPES::SCALAR_PRODUCT:
corr_func = Qn::Q1Q1(non_zero_only_);
break;
case Q1Q1_CORRELATION_TYPES::Q1Q1_EVENT_PLANE:
corr_func = Qn::Q1Q1EP(non_zero_only_);
break;
case Q1Q1_CORRELATION_TYPES::u1Q1_EVENT_PLANE:
corr_func = Qn::u1Q1EP(non_zero_only_);
break;
default:
std::cerr << "CorrelationTask::AddQ1Q1Correlations: Unknown type of correlations" << std::endl;
abort();
}
for (const auto& cor : corr_func) {
......
......@@ -17,21 +17,21 @@
class CorrelationTask {
public:
enum Q1Q1_CORRELATION_TYPES{
enum class Q1Q1_CORRELATION_TYPES{
SCALAR_PRODUCT=0,
Q1Q1_EVENT_PLANE,
u1Q1_EVENT_PLANE
};
CorrelationTask() = delete;
CorrelationTask(const std::string& file, const std::string& treename);
void AddQ1Q1Correlation(const std::string&a_name, const std::string&b_name, int type=SCALAR_PRODUCT){
void AddQ1Q1Correlation(const std::string&a_name, const std::string&b_name, Q1Q1_CORRELATION_TYPES type){
AddQ1Q1Correlations(config_->GetQvectorConfig(a_name), config_->GetQvectorConfig(b_name), type);
}
void Run();
private:
void FillCorrelations();
void AddQ1Q1Correlations(const Qn::QvectorConfig& a, const Qn::QvectorConfig& b, int type);
void AddQ1Q1Correlations(const Qn::QvectorConfig& a, const Qn::QvectorConfig& b, Q1Q1_CORRELATION_TYPES type);
void AddQ2Q1Q1Correlations(const Qn::QvectorTracksConfig& t, const Qn::QvectorConfig& a, const Qn::QvectorConfig& b);
TFile* in_file_{nullptr};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment