Skip to content

Instantly share code, notes, and snippets.

@mmusich
Created June 14, 2023 21:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmusich/bd45499eb4db291018b178f1a76cdf14 to your computer and use it in GitHub Desktop.
Save mmusich/bd45499eb4db291018b178f1a76cdf14 to your computer and use it in GitHub Desktop.
/*
// 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