CMS 3D CMS Logo

Functions
printPixelTrackerMap.cc File Reference
#include "DQM/TrackerRemapper/interface/Phase1PixelSummaryMap.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 21 of file printPixelTrackerMap.cc.

References dir2webdir::argc, GCPpyPlots::argv, DummyCfis::c, DMR_cfg::cerr, gather_cfg::cout, Phase1PixelSummaryMap::createTrackerBaseMap(), ALCARECOPPSCalTrackBasedSel_cff::detid, geometryDiff::file, Phase1PixelSummaryMap::fillTrackerMap(), mps_fire::i, makeListRunsInFiles::inputFile, mps_splice::line, Phase1PixelSummaryMap::printTrackerMap(), showHelp(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

◆ showHelp()

void showHelp ( const std::string &  scriptName)

Definition at line 14 of file printPixelTrackerMap.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  << " --input-file <filename> Specify the input file\n"
17  << " --h or --help Show this help message\n"
18  << " <detid> Provide DetId (list of DetIds)\n";
19 }