CMS 3D CMS Logo

Functions
printPixelLayersDisksMap.cc File Reference
#include "DQM/TrackerRemapper/interface/Phase1PixelMaps.h"
#include <cstdint>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
#include "TCanvas.h"
#include "TStyle.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 
void showHelp (const std::string &scriptName)
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

===============================================================================================================================================================================================


variant2: for each run define phi-averaged A for normalization channel (Dref,16) and then, divide Rijk on it, i.e. get RRijk




















































































eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=29 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=19

eta=17

eta=25

eta=23

eta=22

eta=21

eta=26

eta=24

eta=20

eta=19

eta=18

eta=27 L1=1

eta=25 L1=1

eta=23 L1=1

eta=22 L1=1

eta=21 L1=1

eta=26 L1=1

eta=24 L1=1

eta=20 L1=1

eta=19 L1=1

eta=18 L1=1

eta=17 L1=1

eta=28 L7=1

eta=27 L7=1

eta=25 L7=1

eta=23 L7=1

eta=22 L7=1

eta=21 L7=1

eta=26 L7=1

eta=24 L7=1

eta=20 L7=1

eta=19 L7=1

eta=18 L7=1

eta=17 L7=1

eta=27

eta=28

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:







Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Sticking ADC counts in neughbouring TS for HB:

Sticking ADC counts in neughbouring TS for HE:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:





Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:





Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:

Prepare maps of good/bad channels:

Definition at line 22 of file printPixelLayersDisksMap.cc.

References dir2webdir::argc, GCPpyPlots::argv, Phase1PixelMaps::beautifyAllHistograms(), Phase1PixelMaps::book(), DummyCfis::c, DMR_cfg::cerr, gather_cfg::cout, ALCARECOPPSCalTrackBasedSel_cff::detid, Phase1PixelMaps::drawSummaryMaps(), geometryDiff::file, Phase1PixelMaps::fill(), mps_fire::i, makeListRunsInFiles::inputFile, mps_splice::line, showHelp(), and AlCaHLTBitMon_QueryRunRegistry::string.

22  {
24  std::vector<std::pair<uint32_t, float>> detidValues;
25 
26  // If no arguments are passed or --h/--help is passed, show the help message
27  if (argc == 1) {
28  showHelp(argv[0]);
29  return 0;
30  }
31 
32  // Parse command line arguments
33  for (int i = 1; i < argc; ++i) {
34  std::string arg = argv[i];
35 
36  if (arg == "--h" || arg == "--help") {
37  showHelp(argv[0]);
38  return 0; // Exit after displaying help
39  } else if (arg == "--input-file" && i + 1 < argc) {
40  gStyle->SetPalette(kRainbow);
41  gStyle->SetNumberContours(256);
42  inputFile = argv[++i];
43  } else {
44  gStyle->SetPalette(1);
45  // Treat as DetId list if no --input-file is provided
46  try {
47  uint32_t detid = std::stoul(arg);
48  detidValues.emplace_back(detid, 1.0); // Default value is 1.0
49  } catch (const std::invalid_argument&) {
50  std::cerr << "Invalid DetId: " << arg << "\n";
51  showHelp(argv[0]);
52  return 1;
53  }
54  }
55  }
56 
57  // If --input-file is provided, read from file
58  if (!inputFile.empty()) {
59  std::ifstream file(inputFile);
60  if (!file) {
61  std::cerr << "Error: Unable to open input file " << inputFile << std::endl;
62  return 1;
63  }
64 
66  while (std::getline(file, line)) {
67  std::istringstream iss(line);
68  uint32_t detid;
69  float value = 1.0; // Default value
70 
71  iss >> detid;
72  if (iss >> value) { // If a second column exists, read it as value
73  detidValues.emplace_back(detid, value);
74  } else {
75  detidValues.emplace_back(detid, 1.0);
76  }
77  }
78  }
79 
80  // Create the map and fill it
81  Phase1PixelMaps theMap("COLZ0A L"); // needed to not show the axis
82  TCanvas c = TCanvas("c", "c", 1200, 800);
83  theMap.book("mytest", "Marked modules", "input values");
84  for (const auto& [detid, value] : detidValues) {
85  theMap.fill("mytest", detid, value);
86  }
87 
88  theMap.beautifyAllHistograms();
89  theMap.drawSummaryMaps("mytest", c);
90  c.SaveAs("Phase1PixelMaps_Summary.png");
91 
92  std::cout << "Filled tracker map with " << detidValues.size() << " detids." << std::endl;
93 
94  return 0;
95 }
A arg
Definition: Factorize.h:31
Definition: value.py:1
void showHelp(const std::string &scriptName)

◆ showHelp()

void showHelp ( const std::string &  scriptName)

Definition at line 14 of file printPixelLayersDisksMap.cc.

References gather_cfg::cout, and Herwig7_Dummy_ReadLHE_GEN_SIM::scriptName.

Referenced by main().

14  {
15  std::cout << "Usage: " << scriptName << " [options] <detid>\n"
16  << "Options:\n"
17  << " --input-file <filename> Specify the input file\n"
18  << " --h or --help Show this help message\n"
19  << " <detid> Provide DetId (list of DetIds)\n";
20 }