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/)?([^/]+)",
837 cout <<
"SetPort: " <<
listenPort <<
" Success: " << errorCode << endl;
839 cout <<
"AquireMode: " <<
AquireMode <<
" Success: " << errorCode << endl;
858 std::cout <<
"Successfully connected." << std::endl;
881 <<
"is less than required minumum (" << MinLSBeforeSave
882 <<
"). File will not be saved!" << std::endl;
887 std::cout <<
"** Here in end run **" << std::endl;
932 for(
int iBin = 1; iBin<128; ++iBin )
952 if( fillBin == 1 ) recentOldBinContent = 0;
956 if( fillBin == 1 ) recentOldBinContent = 0;
960 if( fillBin == 1 ) recentOldBinContent = 0;
965 if( fillBin == 1 ) recentOldBinError = 0;
969 if( fillBin == 1 ) recentOldBinError = 0;
973 if( fillBin == 1 ) recentOldBinError = 0;
990 if( etDenom < 1
e-10 ) etDenom = 1
e-10;
992 if( occ1Denom < 1
e-10 ) occ1Denom = 1
e-10;
994 if( occ2Denom < 1
e-10 ) occ2Denom = 1
e-10;
1003 if(
lsBinOld == 0 ) histOldBinContent = 0;
1007 if(
lsBinOld == 0 ) histOldBinContent = 0;
1011 if(
lsBinOld == 0 ) histOldBinContent = 0;
1016 if(
lsBinOld == 0 ) histOldBinError = 0;
1020 if(
lsBinOld == 0 ) histOldBinError = 0;
1024 if(
lsBinOld == 0 ) histOldBinError = 0;
1028 sectionInstantSumEt = 0;
1030 sectionInstantSumOcc1 = 0;
1032 sectionInstantSumOcc2 = 0;
1050 for(
int iHLX = 0; iHLX < (int)
NUM_HLX; ++iHLX ){
1051 unsigned int utotal1= 0;
1052 unsigned int utotal2 = 0;
1053 unsigned int iWedge =
HLXHFMap[iHLX];
1057 for(
unsigned int iBX = 0; iBX <
NUM_BUNCHES; ++iBX ){
1060 unsigned int norm[2] = {0,0};
1064 if( norm[0] == 0 ) norm[0]=1;
1068 if( norm[1] == 0 ) norm[1]=1;
1070 double normEt = section.
etSum[iHLX].
data[iBX]/(double)(norm[0]+norm[1]);
1079 if( iBX < NUM_BUNCHES-100 )
1126 if(
Style.compare(
"BX") == 0)
1130 int iBin = Set1BelowHist->FindBin((
float)iBX);
1135 normOccSet1Below += oldNormOccSet1Below;
1138 normOccSet2Below += oldNormOccSet2Below;
1142 normOccSet1Between += oldNormOccSet1Between;
1145 normOccSet2Between += oldNormOccSet2Between;
1149 normOccSet1Above += oldNormOccSet1Above;
1152 normOccSet2Above += oldNormOccSet2Above;
1156 normEt += oldNormEt;
1160 Set1Below[iWedge]-> setBinContent(iBin, normOccSet1Below );
1162 Set1Above[iWedge]-> setBinContent(iBin, normOccSet1Above );
1163 Set2Below[iWedge]-> setBinContent(iBin, normOccSet2Below );
1165 Set2Above[iWedge]-> setBinContent(iBin, normOccSet2Above );
1166 ETSum[iWedge]-> setBinContent(iBin, normEt);
1176 else if(
Style.compare(
"Dist")==0)
1191 if( (NUM_BUNCHES-100)>0 )
1193 total1 = (double)utotal1/(
double)(NUM_BUNCHES-100);
1194 total2 = (double)utotal2/(
double)(NUM_BUNCHES-100);
1207 double max[4] = {-1000.0,-1000.0,-1000.0,-1000.0};
1208 int bxmax[4] = {-1,-1,-1,-1};
1209 for(
unsigned int iBX = 0; iBX <
NUM_BUNCHES; ++iBX ){
1217 bxmax[3] = bxmax[2];
1219 bxmax[2] = bxmax[1];
1221 bxmax[1] = bxmax[0];
1226 bxmax[3] = bxmax[2];
1228 bxmax[2] = bxmax[1];
1233 bxmax[3] = bxmax[2];
1241 int iBin = iBX - (int)
XMIN + 1;
1242 if( iBin <=
int(
XMAX-
XMIN) && iBin >= 1 ){
1289 for(
int iM = 0; (iM<4)&&flag; ++iM ){
1291 for(
int iN = 0; iN < 3; ++iN ){
1292 if( bxmax[iN+1] < bxmax[iN] ){
1293 int tmp = bxmax[iN];
1294 bxmax[iN] = bxmax[iN+1];
1297 double tmp2 = max[iN];
1298 max[iN] = max[iN+1];
1316 double minX = tmpHist->GetBinLowEdge(1);
1317 double maxX = tmpHist->GetBinLowEdge(tmpHist->GetNbinsX()+1);
1347 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1349 unsigned int iWedge =
HLXHFMap[iHLX];
1360 float total = nActvTwrsSet1 + nActvTwrsSet2;
1368 if(nActvTwrsSet1 > 0){
1379 if( nActvTwrsSet2 > 0){
1404 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1405 unsigned int iWedge =
HLXHFMap[iHLX] + 1;
1433 float overall = 0.0;
1434 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX ){
1435 unsigned int iWedge =
HLXHFMap[iHLX] + 1;
1436 unsigned int iEta = 2;
1439 if( iWedge >= 19 ){ iEta = 1; iWedge -= 18; }
1444 overall /= (float)NUM_HLX;
1445 if( overall > 1.0 ) overall = 0.0;
1452 for(
unsigned int iHLX = 0; iHLX <
NUM_HLX; ++iHLX )
1553 double deltaT=(*a).tv_sec*1000.0+(*a).tv_usec/1000.0;
1554 if(b!=
NULL) deltaT=(*b).tv_sec*1000.0+(*b).tv_usec/1000.0 - deltaT;
1555 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
ET_SUM_SECTION etSum[HCAL_HLX_MAX_HLXS]
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
float data[HCAL_HLX_MAX_BUNCHES]
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.
uint32_t data[6][HCAL_HLX_MAX_BUNCHES]
MonitorElement * HistInstantLumiOccSet2Error
MonitorElement * processEventRate_
Time elapsed since the last event.
MonitorElement * MissingDQMDataCheck
LUMI_SECTION_SUB_HEADER hdr
MonitorElement * HistInstantLumiOccSet2
MonitorElement * LumiInstantOccSet1
MonitorElement * HistAvgOccAboveSet1HFM
float OccLumi[2][HCAL_HLX_MAX_BUNCHES]
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_
const T & max(const T &a, const T &b)
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
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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]
float ETLumi[HCAL_HLX_MAX_BUNCHES]
void softReset(MonitorElement *me)
MonitorElement * MaxInstLumiBXNum2
MonitorElement * MaxInstLumiBX2
MonitorElement * SumAllOccSet2
MonitorElement * AvgEtSum
MonitorElement * nUpdates_
These MEs are either static or updated upon each analyze() call.
MonitorElement * HistAvgOccAboveSet2HFM
MonitorElement * LumiAvgEtSum
MonitorElement * eventTimeStamp_
MonitorElement * BXvsTimeAvgEtSumHFP
MonitorElement * HistAvgOccBetweenSet1HFM
OCCUPANCY_SECTION occupancy[HCAL_HLX_MAX_HLXS]
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
float ETLumiErr[HCAL_HLX_MAX_BUNCHES]
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)
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 &)
float OccLumiErr[2][HCAL_HLX_MAX_BUNCHES]