24 <<
" --input-file <filename> Specify the input file\n" 25 <<
" --input-ROCs <filename> Specify the input ROCs file\n" 26 <<
" --region <barrel|forward|full> Specify the region (default: full)\n" 27 <<
" --h or --help Show this help message\n" 28 <<
" <detid> Provide DetId (list of DetIds)\n";
47 if (regionStr ==
"barrel") {
49 }
else if (regionStr ==
"forward") {
51 }
else if (regionStr ==
"full") {
54 throw std::invalid_argument(
"Invalid region value");
59 static constexpr std::array<int, 3> k_height = {{1200, 600, 1600}};
64 std::vector<std::pair<uint32_t, float>> detidValues;
65 std::vector<std::pair<uint32_t, std::bitset<16>>> detidRocs;
74 for (
int i = 1;
i <
argc; ++
i) {
77 if (
arg ==
"--h" ||
arg ==
"--help") {
80 }
else if (
arg ==
"--input-file" &&
i + 1 <
argc) {
82 }
else if (
arg ==
"--input-ROCs" &&
i + 1 <
argc) {
83 inputROCsFile =
argv[++
i];
84 }
else if (
arg ==
"--region" &&
i + 1 <
argc) {
88 }
catch (
const std::invalid_argument&) {
89 std::cerr <<
"Invalid value for --region: " << regionArg <<
"\n";
97 detidValues.emplace_back(
detid, 1.0);
98 }
catch (
const std::invalid_argument&) {
116 std::istringstream iss(
line);
124 detidValues.emplace_back(
detid, 1.0);
130 if (!inputROCsFile.empty()) {
131 std::ifstream
file(inputROCsFile);
133 std::cerr <<
"Error: Unable to open input ROCs file " << inputROCsFile << std::endl;
139 std::istringstream iss(
line);
142 iss >>
detid >> rocBits;
144 if (rocBits.length() == 16) {
145 std::bitset<16>
rocs(rocBits);
148 std::cerr <<
"Error: Invalid ROC bits string for detid " <<
detid << std::endl;
158 for (
const auto& [
detid,
value] : detidValues) {
163 for (
const auto& [
detid,
rocs] : detidRocs) {
171 TCanvas
canvas(
"Summary",
"Summary", 1200, k_height[static_cast<int>(
region)]);
185 std::cout <<
"Filled Phase1 Pixel ROC map with " << detidValues.size() + detidRocs.size() <<
" detids." << std::endl;
void drawMaps(TCanvas &canvas, const std::string &text="")
void showHelp(const std::string &scriptName)
Region parseRegion(const std::string ®ionStr)
void drawBarrelMaps(TCanvas &canvas, const std::string &text="")
void fillWholeModule(const uint32_t &detid, double value)
void drawForwardMaps(TCanvas &canvas, const std::string &text="")
std::string regionToString(Region region)
int main(int argc, char *argv[])
void fillSelectedRocs(const uint32_t &detid, const std::bitset< 16 > &theROCs, double value)