Created
June 14, 2023 21:21
-
-
Save mmusich/bd45499eb4db291018b178f1a76cdf14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
// defaults (Run-3) | |
double pMass = 0.938; // GeV (proton) | |
double E = 6800; // GeV (beam energy) | |
std::regex pattern("20\\d{2}"); // Regular expression pattern to match "20" followed by two digits | |
std::smatch matches; | |
if (std::regex_search(tagname, matches, pattern)) { | |
int secondTwoDigits = std::stoi(matches[1].str()); | |
if (secondTwoDigits <= 11) { | |
E = 3500.; | |
} else if (secondTwoDigits == 12) { | |
E = 4000.; | |
} else if (secondTwoDigits > 12 && secondTwoDigits < 19) { | |
E = 6500.; | |
} else if (secondTwoDigits >= 19) { | |
E = 6800.; | |
} | |
} | |
if (tagname.find("HI") != std::string::npos || tagname.find("PbPb") != std::string::npos) { | |
pMass = 193.7; // GeV (lead) | |
E = 522340.; | |
} | |
double gammaFact = E / pMass; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment