CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelHDQMInspector.cc
Go to the documentation of this file.
5 #include <string>
6 #include <vector>
7 #include <memory>
8 #include <algorithm>
9 
11 #include <TSystem.h>
12 
13 using namespace std;
14 
15 string const Condition = "0@SUMOFF_nclusters_OffTrack@yMean > 0";
16 string const BlackList = "";
17 // string const WhiteList = ""; // set a runs & range such as: "123,321,456,108000-109000";
18 
23 void runSiPixelInspector( const string & dbName, const string &tagName, const string & Password, const string & whiteListFile,
24  const int Start, const int End, const int nRuns )
25 {
26  HDQMInspectorConfigSiPixel PixelConfig;
27  DQMHistoryCreateTrend makeTrend(&PixelConfig);
28 
29  // Database and output configuration
30  makeTrend.setDB(dbName,tagName,"/afs/cern.ch/cms/DB/conddb");
31  makeTrend.setDebug(0);
32  makeTrend.setDoStat(1);
33  makeTrend.setSkip99s(true);
34  makeTrend.setBlackList(BlackList);
35  // makeTrend.setWhiteList(WhiteList);
36  //makeTrend.setSeparator("@@#@@"); // TO change the seperator
37  makeTrend.setWhiteListFromFile(whiteListFile);
38 
39  // Definition of trends
40  typedef DQMHistoryTrendsConfig Trend;
41  vector<Trend> config;
42  config.push_back(Trend( "1@SUMOFF_adc@yMean", "adc_yMean_Barrel.gif", 0, Condition, "", Start, End, nRuns ));
43  config.push_back(Trend( "6@SUMOFF_adc@yMean", "adc_yMean_Endcap.gif", 0, Condition, "", Start, End, nRuns ));
44  config.push_back(Trend( "0@SUMOFF_charge_OffTrack@yMean", "charge_OffTrack_yMean.gif", 0, Condition, "", Start, End, nRuns ));
45  config.push_back(Trend( "1@SUMOFF_charge_OnTrack@yMean", "charge_OnTrack_yMean_Barrel.gif", 0, Condition, "", Start, End, nRuns ));
46  config.push_back(Trend( "6@SUMOFF_charge_OnTrack@yMean", "charge_OnTrack_yMean_Endcap.gif", 0, Condition, "", Start, End, nRuns ));
47  config.push_back(Trend( "0@SUMOFF_nRecHits@yMean", "nRecHits_yMean.gif", 0, Condition, "", Start, End, nRuns ));
48  config.push_back(Trend( "0@SUMOFF_nclusters_OffTrack@yMean", "nclusters_OffTrack_yMean.gif", 0, Condition, "", Start, End, nRuns ));
49  config.push_back(Trend( "0@SUMOFF_nclusters_OnTrack@yMean", "nclusters_OnTrack_yMean.gif", 0, Condition, "", Start, End, nRuns ));
50  config.push_back(Trend( "0@SUMOFF_ndigis@yMean", "ndigis_yMean.gif", 0, Condition, "", Start, End, nRuns ));
51  config.push_back(Trend( "0@SUMOFF_size_OffTrack@yMean", "size_OffTrack_yMean.gif", 0, Condition, "", Start, End, nRuns ));
52  config.push_back(Trend( "0@SUMOFF_size_OnTrack@yMean", "size_OnTrack_yMean.gif", 0, Condition, "", Start, End, nRuns ));
53  config.push_back(Trend( "0@ntracks_generalTracks@NTracksPixOverAll", "NTracksPixOverAll.gif", 0, Condition, "", Start, End, nRuns ));
54  config.push_back(Trend( "0@ntracks_generalTracks@NTracksFPixOverBPix", "NTracksFPixOverBPix.gif", 0, Condition, "", Start, End, nRuns ));
55 
56  config.push_back(Trend( "0@bigEventRate@yMean", "bigEventRate_yMean.gif", 0, Condition, "", Start, End, nRuns ));
57  config.push_back(Trend( "0@bigFpixClusterEventRate@yMean", "bigFpixClusterEventRate_yMean.gif", 0, Condition, "", Start, End, nRuns ));
58  config.push_back(Trend( "0@pixEventRate@yMean", "pixEventRate_yMean.gif", 0, Condition, "", Start, End, nRuns ));
59 
60  // Creation of trends
61  for_each(config.begin(), config.end(), makeTrend);
62 
63  // Close the output file
64  makeTrend.closeFile();
65 }
66 
68 void SiPixelHDQMInspector( const string & dbName, const string &tagName, const string & password, const std::string & whiteListFile,
69  const int start, const int end )
70 {
71  runSiPixelInspector( dbName, tagName, password, whiteListFile, start, end, 0 );
72 }
73 
75 void SiPixelHDQMInspector( const string & dbName, const string & tagName, const string & password, const std::string & whiteListFile,
76  const int nRuns )
77 {
78  runSiPixelInspector( dbName, tagName, password, whiteListFile, 0, 0, nRuns );
79 }
80 
81 int main (int argc, char* argv[])
82 {
83  gSystem->Load( "libFWCoreFWLite" );
85 
86  if (argc != 6 && argc != 7) {
87  cerr << "Usage: " << argv[0] << " [Database] [TagName] [Password] [WhiteListFile] [NRuns] " << endl;
88  cerr << "Or: " << argv[0] << " [Database] [TagName] [Password] [WhiteListFile] [FirstRun] [LastRun] " << endl;
89  return 1;
90  }
91 
92  if (argc == 6) {
93  cout << "Creating trends for NRuns = " << argv[5] << " for tag: " << argv[2] << endl;
94  SiPixelHDQMInspector( argv[1], argv[2], argv[3], argv[4], atoi(argv[5]) );
95  } else if(argc == 7) {
96  cout << "Creating trends for range: " << argv[5] << " " << argv[6] << " for tag: " << argv[2] << endl;
97  SiPixelHDQMInspector( argv[1], argv[2], argv[3], argv[4], atoi(argv[5]), atoi(argv[6]) );
98  }
99 
100  return 0;
101 }
void runSiPixelInspector(const string &dbName, const string &tagName, const string &Password, const string &whiteListFile, const int Start, const int End, const int nRuns)
tuple start
Check for commandline option errors.
Definition: dqm_diff.py:58
void setWhiteListFromFile(const std::string &listFileName)
void setDebug(const int i)
string dbName
Definition: EcalCondDB.py:76
int main(int argc, char **argv)
void setSkip99s(bool const in)
void setDB(std::string dbName, std::string dbTag, std::string authPath="")
string const Condition
string const BlackList
#define end
Definition: vmac.h:37
void SiPixelHDQMInspector(const string &dbName, const string &tagName, const string &password, const std::string &whiteListFile, const int start, const int end)
Simple method to create the trends. The actual operations are performed in runSiPixelInspector.
void setBlackList(const std::string &listItems)
tuple argc
Definition: dir2webdir.py:38
static void enable()
enable automatic library loading
tuple cout
Definition: gather_cfg.py:121
void setDoStat(const int i)