72 if(NUM_BUNCHES > 3564)
77 if(XMAX <= 0) XMAX = 3564;
80 if((Style.compare(
"History")==0) || (NBINS == 0)){
81 NBINS = (
unsigned int)(XMAX-XMIN);
95 unsigned int HLXHFMapTemp[] = {31,32,33,34,35,18,
106 for(
int iHLX = 0; iHLX < 36; ++iHLX ){
107 HLXHFMap[iHLX] = HLXHFMapTemp[iHLX];
130 for(
unsigned int iWedge = 0; iWedge < 18 && iWedge <
NUM_HLX; ++iWedge )
132 std::ostringstream tempStreamer;
133 tempStreamer << std::dec << std::setw(2) << std::setfill(
'0') << (iWedge+1);
135 std::ostringstream wedgeNum;
136 wedgeNum << std::dec << (iWedge % 18) + 1;
141 "HF+ Wedge "+wedgeNum.str()+
": Below Threshold 1 - Set 1",
144 "HF+ Wedge "+wedgeNum.str()+
": Between Threshold 1 & 2 - Set 1",
147 "HF+ Wedge "+wedgeNum.str()+
": Above Threshold 2 - Set 1",
150 "HF+ Wedge "+wedgeNum.str()+
": Below Threshold 1 - Set 2",
153 "HF+ Wedge "+wedgeNum.str()+
": Between Threshold 1 & 2 - Set 2",
156 "HF+ Wedge "+wedgeNum.str()+
": Above Threshold 2 - Set 2",
159 "HF+ Wedge "+wedgeNum.str()+
": Transverse Energy",
169 for(
unsigned int iWedge=18; iWedge <
NUM_HLX; ++iWedge )
171 std::ostringstream tempStreamer;
172 tempStreamer << std::dec << std::setw(2) << std::setfill(
'0') << (iWedge+1);
174 std::ostringstream wedgeNum;
175 wedgeNum << std::dec << (iWedge % 18) + 1;
179 "HF- Wedge "+wedgeNum.str()+
": Below Threshold 1 - Set 1",
182 "HF- Wedge "+wedgeNum.str()+
": Between Threshold 1 & 2 - Set 1",
185 "HF- Wedge "+wedgeNum.str()+
": Above Threshold 2 - Set 1",
188 "HF- Wedge "+wedgeNum.str()+
": Below Threshold 1 - Set 2",
191 "HF- Wedge "+wedgeNum.str()+
": Between Threshold 1 & 2 - Set 2",
194 "HF- Wedge "+wedgeNum.str()+
": Above Threshold 2 - Set 2",
197 "HF- Wedge "+wedgeNum.str()+
": Transverse Energy",
205 for(
unsigned int iWedge = 0; iWedge <
NUM_HLX; ++iWedge ){
212 ETSum[iWedge]-> setResetMe(
true);
216 if(
Style.compare(
"BX") == 0){
221 }
else if(
Style.compare(
"Distribution")==0){
228 for(
unsigned int iWedge=0; iWedge <
NUM_HLX; ++iWedge )
251 std::string CompEtSumYTitle =
"E_{T} Sum per active tower";
252 std::string CompOccYTitle =
"Occupancy per active tower";
259 "Occupancy Below Threshold 1 - Set 1",
260 NUM_HLX, 0, NUM_HLX );
265 "Occupancy Between Threshold 1 & 2 - Set 1",
266 NUM_HLX, 0, NUM_HLX );
271 "Occupancy Above Threshold 2 - Set 1",
272 NUM_HLX, 0, NUM_HLX );
277 "Occupancy Below Threshold 1 - Set 2",
278 NUM_HLX, 0, NUM_HLX);
283 "Occupancy Between Threshold 1 & 2 - Set 2",
284 NUM_HLX, 0, NUM_HLX);
289 "Occupancy Above Threshold 2 - Set 2",
290 NUM_HLX, 0, NUM_HLX);
302 int EtSumBins = 10000;
310 std::string AvgOccYTitle =
"Average Tower Occupancy";
314 NUM_HLX, 0, NUM_HLX, EtSumBins, EtSumMin, EtSumMax);
319 "Average Occupancy Below Threshold 1 - Set1",
320 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
325 "Average Occupancy Between Threhold 1 & 2 - Set1",
326 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
331 "Average Occupancy Above Threshold 2 - Set1",
332 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
337 "Average Occupancy Below Threshold 1 - Set2",
338 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
343 "Average Occupancy Between Threshold 1 & 2 - Set2",
344 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
349 "Average Occupancy Above Threshold 2 - Set2",
350 NUM_HLX, 0, NUM_HLX, OccBins, OccMin, OccMax, errorOpt.c_str());
358 std::string LumiEtSumYTitle =
"Luminosity: E_{T} Sum";
359 std::string LumiOccYTitle =
"Luminosity: Occupancy";
402 std::string sumYTitle =
"Occupancy Sum (Below+Above+Between)";
453 std::string HistLumiErrorYTitle =
"Luminosity Error (%)";
459 MAX_LS, 0.5, (
double)
MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
464 MAX_LS, 0.5, (
double)
MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
470 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
475 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
480 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
485 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
490 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
495 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
500 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
505 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
510 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
515 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
520 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
525 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax );
544 MAX_LS, 0.5, (
double)
MAX_LS+0.5, EtSumBins, EtSumMin, EtSumMax);
549 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax);
554 MAX_LS, 0.5, (
double)
MAX_LS+0.5, OccBins, OccMin, OccMax);
608 128, 0.5, (
double)128+0.5);
613 128, 0.5, (
double)128+0.5);
618 128, 0.5, (
double)128+0.5);
623 128, 0.5, (
double)128+0.5);
628 128, 0.5, (
double)128+0.5);
633 128, 0.5, (
double)128+0.5);
638 for(
size_t i=0,
e = systems.size();
i<
e; ++
i ){
639 std::cout <<
"Systems " << systems[
i] << std::endl;
707 summaryHist->GetYaxis()->SetBinLabel(1,
"HF-");
708 summaryHist->GetYaxis()->SetBinLabel(2,
"HF+");
709 summaryHist->GetXaxis()->SetTitle(
"Wedge #");
715 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
716 unsigned int iWedge =
HLXHFMap[iHLX] + 1;
717 unsigned int iEta = 2;
718 if( iWedge >= 19 ){ iEta = 1; iWedge -= 18; }
747 std::cout <<
"Successfully connected." << std::endl;
758 timeval startruntime;
759 gettimeofday(&startruntime,
NULL);
809 std::ostringstream tempStreamer;
815 char rewrite[64]; sprintf(rewrite,
"\\1Run %d/\\2/Run summary", runNumber_);
819 for(
size_t i = 0,
e = systems.size();
i !=
e; ++
i )
820 if (systems[
i] !=
"Reference")
824 "^(Reference/)?([^/]+)",
838 cout <<
"SetPort: " <<
listenPort <<
" Success: " << errorCode << endl;
840 cout <<
"AquireMode: " <<
AquireMode <<
" Success: " << errorCode << endl;
859 std::cout <<
"Successfully connected." << std::endl;
882 <<
"is less than required minumum (" << MinLSBeforeSave
883 <<
"). File will not be saved!" << std::endl;
888 std::cout <<
"** Here in end run **" << std::endl;
933 for(
int iBin = 1; iBin<128; ++iBin )
953 if( fillBin == 1 ) recentOldBinContent = 0;
957 if( fillBin == 1 ) recentOldBinContent = 0;
961 if( fillBin == 1 ) recentOldBinContent = 0;
966 if( fillBin == 1 ) recentOldBinError = 0;
970 if( fillBin == 1 ) recentOldBinError = 0;
974 if( fillBin == 1 ) recentOldBinError = 0;
991 if( etDenom < 1
e-10 ) etDenom = 1
e-10;
993 if( occ1Denom < 1
e-10 ) occ1Denom = 1
e-10;
995 if( occ2Denom < 1
e-10 ) occ2Denom = 1
e-10;
1004 if(
lsBinOld == 0 ) histOldBinContent = 0;
1008 if(
lsBinOld == 0 ) histOldBinContent = 0;
1012 if(
lsBinOld == 0 ) histOldBinContent = 0;
1017 if(
lsBinOld == 0 ) histOldBinError = 0;
1021 if(
lsBinOld == 0 ) histOldBinError = 0;
1025 if(
lsBinOld == 0 ) histOldBinError = 0;
1029 sectionInstantSumEt = 0;
1031 sectionInstantSumOcc1 = 0;
1033 sectionInstantSumOcc2 = 0;
1051 for(
int iHLX = 0; iHLX < (int)
NUM_HLX; ++iHLX ){
1052 unsigned int utotal1= 0;
1053 unsigned int utotal2 = 0;
1054 unsigned int iWedge =
HLXHFMap[iHLX];
1058 for(
unsigned int iBX = 0; iBX <
NUM_BUNCHES; ++iBX ){
1061 unsigned int norm[2] = {0,0};
1065 if( norm[0] == 0 ) norm[0]=1;
1069 if( norm[1] == 0 ) norm[1]=1;
1071 double normEt = section.
etSum[iHLX].
data[iBX]/(double)(norm[0]+norm[1]);
1080 if( iBX < NUM_BUNCHES-100 )
1127 if(
Style.compare(
"BX") == 0)
1131 int iBin = Set1BelowHist->FindBin((
float)iBX);
1136 normOccSet1Below += oldNormOccSet1Below;
1139 normOccSet2Below += oldNormOccSet2Below;
1143 normOccSet1Between += oldNormOccSet1Between;
1146 normOccSet2Between += oldNormOccSet2Between;
1150 normOccSet1Above += oldNormOccSet1Above;
1153 normOccSet2Above += oldNormOccSet2Above;
1157 normEt += oldNormEt;
1161 Set1Below[iWedge]-> setBinContent(iBin, normOccSet1Below );
1163 Set1Above[iWedge]-> setBinContent(iBin, normOccSet1Above );
1164 Set2Below[iWedge]-> setBinContent(iBin, normOccSet2Below );
1166 Set2Above[iWedge]-> setBinContent(iBin, normOccSet2Above );
1167 ETSum[iWedge]-> setBinContent(iBin, normEt);
1177 else if(
Style.compare(
"Dist")==0)
1192 if( (NUM_BUNCHES-100)>0 )
1194 total1 = (double)utotal1/(
double)(NUM_BUNCHES-100);
1195 total2 = (double)utotal2/(
double)(NUM_BUNCHES-100);
1208 double max[4] = {-1000.0,-1000.0,-1000.0,-1000.0};
1209 int bxmax[4] = {-1,-1,-1,-1};
1210 for(
unsigned int iBX = 0; iBX <
NUM_BUNCHES; ++iBX ){
1218 bxmax[3] = bxmax[2];
1220 bxmax[2] = bxmax[1];
1222 bxmax[1] = bxmax[0];
1227 bxmax[3] = bxmax[2];
1229 bxmax[2] = bxmax[1];
1234 bxmax[3] = bxmax[2];
1242 int iBin = iBX - (int)
XMIN + 1;
1243 if( iBin <=
int(
XMAX-
XMIN) && iBin >= 1 ){
1290 for(
int iM = 0; (iM<4)&&flag; ++iM ){
1292 for(
int iN = 0; iN < 3; ++iN ){
1293 if( bxmax[iN+1] < bxmax[iN] ){
1294 int tmp = bxmax[iN];
1295 bxmax[iN] = bxmax[iN+1];
1298 double tmp2 = max[iN];
1299 max[iN] = max[iN+1];
1317 double minX = tmpHist->GetBinLowEdge(1);
1318 double maxX = tmpHist->GetBinLowEdge(tmpHist->GetNbinsX()+1);
1348 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1350 unsigned int iWedge =
HLXHFMap[iHLX];
1361 float total = nActvTwrsSet1 + nActvTwrsSet2;
1369 if(nActvTwrsSet1 > 0){
1380 if( nActvTwrsSet2 > 0){
1405 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1406 unsigned int iWedge =
HLXHFMap[iHLX] + 1;
1434 float overall = 0.0;
1435 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1436 unsigned int iWedge =
HLXHFMap[iHLX] + 1;
1437 unsigned int iEta = 2;
1440 if( iWedge >= 19 ){ iEta = 1; iWedge -= 18; }
1445 overall /= (float)NUM_HLX;
1446 if( overall > 1.0 ) overall = 0.0;
1453 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX )
1554 double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0;
1555 if(b!=
NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT;
1556 return deltaT/1000.0;
double sectionInstantSumEt
MonitorElement * HistAvgOccBetweenSet1HFP
MonitorElement * HFCompareOccAboveSet1
EventNumber_t event() const
MonitorElement * Set2Between[36]
MonitorElement * processLatency_
The UTC time of the last event.
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * HistInstantLumiOccSet1
MonitorElement * HFCompareOccAboveSet2
MonitorElement * RecentIntegratedLumiOccSet2
MonitorElement * MaxInstLumiBX4
unsigned int totalNibbles_[36]
MonitorElement * processTimeStamp_
The UTC time of the first event processed.
float InstantOccLumiErr[2]
void setBinContent(int binx, double content)
set content of bin (1-D)
unsigned int HLXHFMap[36]
int SetPort(unsigned short int)
MonitorElement * HistAvgLumiOccSet2
unsigned int secNumLength
MonitorElement * HistAvgOccBelowSet2HFM
MonitorElement * RecentIntegratedLumiEtSum
MonitorElement * LumiIntegratedEtSum
std::vector< std::string > getSubdirs(void) const
MonitorElement * SumAllOccSet1
MonitorElement * LumiInstantOccSet2
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * AvgOccBetweenSet2
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
MonitorElement * AvgOccBelowSet1
MonitorElement * HistAvgEtSumHFM
MonitorElement * AvgOccAboveSet2
MonitorElement * HistAvgEtSumHFP
MonitorElement * HistAvgOccAboveSet1HFP
MonitorElement * LumiInstantEtSum
void cd(void)
go to top directory (ie. root)
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::string OccYAxisTitle
MonitorElement * LumiAvgOccSet2
MonitorElement * cmsswVer_
Current working directory of the job.
MonitorElement * HistInstantLumiOccSet2Error
MonitorElement * processEventRate_
Time elapsed since the last event.
MonitorElement * MissingDQMDataCheck
LUMI_SECTION_SUB_HEADER hdr
MonitorElement * HistInstantLumiOccSet2
MonitorElement * LumiInstantOccSet1
MonitorElement * HistAvgOccAboveSet1HFM
std::string OutputFilePrefix
MonitorElement * LumiIntegratedOccSet1
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double sectionInstantErrSumEt
double sectionInstantErrSumOcc2
unsigned int set2AboveIndex
MonitorElement * Set1Below[36]
void SetIP(std::string IP)
MonitorElement * bookFloat(const char *name)
Book float.
std::string eventInfoFolderHLX_
MonitorElement * HistInstantLumiEtSumError
MonitorElement * eventId_
UTC time of the run start.
MonitorElement * processId_
Number of collector updates (TBD)
MonitorElement * MaxInstLumiBX1
MonitorElement * reportSummaryMap_
MonitorElement * HistAvgOccBelowSet1HFP
MonitorElement * HFCompareEtSum
MonitorElement * runStartTimeStamp_
MonitorElement * Set1Between[36]
MonitorElement * bookString(const char *name, const char *value)
Book string.
unsigned int set2BetweenIndex
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
double sectionInstantSumOcc1
unsigned int set2BelowIndex
double sectionInstantSumOcc2
MonitorElement * HistIntegratedLumiOccSet1
MonitorElement * RecentInstantLumiOccSet1
MonitorElement * HistIntegratedLumiOccSet2
MonitorElement * BXvsTimeAvgEtSumHFM
MonitorElement * HistAvgOccBetweenSet2HFM
MonitorElement * AvgOccAboveSet1
MonitorElement * HistInstantLumiOccSet1Error
HCAL_HLX::LUMI_SECTION lumiSection
MonitorElement * hostName_
of event processed so far
MonitorElement * HFCompareOccBelowSet1
MonitorElement * ETSum[36]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
void setVerbose(unsigned level)
MonitorElement * Set2Below[36]
void softReset(MonitorElement *me)
MonitorElement * MaxInstLumiBXNum2
float OccLumiErr[2][4096]
MonitorElement * MaxInstLumiBX2
MonitorElement * SumAllOccSet2
MonitorElement * AvgEtSum
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
MonitorElement * HistAvgOccAboveSet2HFM
OCCUPANCY_SECTION occupancy[36]
MonitorElement * LumiAvgEtSum
MonitorElement * eventTimeStamp_
MonitorElement * BXvsTimeAvgEtSumHFP
MonitorElement * HistAvgOccBetweenSet1HFM
MonitorElement * RecentIntegratedLumiOccSet1
MonitorElement * MaxInstLumiBXNum4
std::string getReleaseVersion()
MonitorElement * HistAvgLumiOccSet1
MonitorElement * HistAvgOccAboveSet2HFP
unsigned int MinLSBeforeSave
MonitorElement * HistAvgOccBelowSet1HFM
MonitorElement * RecentInstantLumiOccSet2
MonitorElement * Set2Above[36]
MonitorElement * HistAvgLumiEtSum
MonitorElement * HistIntegratedLumiEtSum
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
MonitorElement * HistAvgOccBelowSet2HFP
MonitorElement * processEvents_
Avg # of events in programmable window (default: 5 min)
double sectionInstantNorm
MonitorElement * MaxInstLumiBXNum3
MonitorElement * MaxInstLumiBX3
TH1F * getTH1F(void) const
double sectionInstantErrSumOcc1
unsigned int previousSection
std::string subSystemName_
MonitorElement * processName_
Hostname of the local machine.
void FillEventInfo(const LUMI_SECTION &, const edm::Event &e)
double getUTCtime(timeval *a, timeval *b=NULL)
unsigned int runNumLength
int ReceiveLumiSection(HCAL_HLX::LUMI_SECTION &localSection)
MonitorElement * Set1Above[36]
MonitorElement * processStartTimeStamp_
The PID associated with this job.
void EndRun(bool saveFile=true)
unsigned int expectedNibbles_
std::vector< std::vector< double > > tmp
int SetMode(unsigned char)
MonitorElement * MaxInstLumiBXNum1
MonitorElement * AvgOccBelowSet2
double getBinContent(int binx) const
get content of bin (1-D)
HLXMonitor(const edm::ParameterSet &)
void tagContents(const std::string &path, unsigned int myTag)
tag all children of folder (does NOT include subfolders)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
std::string OccXAxisTitle
MonitorElement * HistInstantLumiEtSum
MonitorElement * HFCompareOccBetweenSet2
unsigned int set1BelowIndex
static const int STATUS_OK
unsigned int lumiSectionCount
std::string eventInfoFolder_
MonitorElement * LumiIntegratedOccSet2
MonitorElement * HFCompareOccBelowSet2
MonitorElement * HFCompareOccBetweenSet1
void FillHistograms(const LUMI_SECTION &)
volatile std::atomic< bool > shutdown_flag false
void showDirStructure(void) const
MonitorElement * LumiAvgOccSet1
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * workingDir_
DQM "name" of the job (eg, Hcal or DT)
MonitorElement * AvgOccBetweenSet1
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * RecentInstantLumiEtSum
TimeValue_t value() const
edm::Timestamp time() const
MonitorElement * reportSummary_
MonitorElement * HistAvgOccBetweenSet2HFP
void setCurrentFolder(const std::string &fullpath)
unsigned int set1AboveIndex
MonitorElement * lumisecId_
unsigned int set1BetweenIndex
void FillHistoHFCompare(const LUMI_SECTION &)