5 #include "DQM/SiStripMonitorHardware/interface/CMHistograms.hh"
9 CMHistograms::CMHistograms()
13 for (
unsigned int i(0);
i<500;
i++){
19 CMHistograms::~CMHistograms()
24 std::ostringstream* pDebugStream
27 getConfigForHistogram(medianAPV1vsAPV0_,
"MedianAPV1vsAPV0",iConfig,pDebugStream);
28 getConfigForHistogram(medianAPV0minusAPV1_,
"MedianAPV0minusAPV1",iConfig,pDebugStream);
30 getConfigForHistogram(meanCMPerFedvsFedId_,
"MeanCMPerFedvsFedId",iConfig,pDebugStream);
31 getConfigForHistogram(meanCMPerFedvsTime_,
"MeanCMPerFedvsTime",iConfig,pDebugStream);
32 getConfigForHistogram(variationsPerFedvsFedId_,
"VariationsPerFedvsFedId",iConfig,pDebugStream);
33 getConfigForHistogram(variationsPerFedvsTime_,
"VariationsPerFedvsTime",iConfig,pDebugStream);
35 getConfigForHistogram(medianAPV1vsAPV0perFED_,
"MedianAPV1vsAPV0perFED",iConfig,pDebugStream);
36 getConfigForHistogram(medianAPV0minusAPV1perFED_,
"MedianAPV0minusAPV1perFED",iConfig,pDebugStream);
38 getConfigForHistogram(medianperChannel_,
"MedianperChannel",iConfig,pDebugStream);
39 getConfigForHistogram(medianAPV0minusAPV1perChannel_,
"MedianAPV0minusAPV1perChannel",iConfig,pDebugStream);
42 getConfigForHistogram(tkMapConfig_,
"TkHistoMap",iConfig,pDebugStream);
44 if (iConfig.
exists(
"FedIdVec")){
45 std::vector<unsigned int> lIdVec = iConfig.
getUntrackedParameter<std::vector<unsigned int> >(
"FedIdVec");
46 for (
unsigned int i(0);
i<lIdVec.size();
i++){
47 if (lIdVec.at(
i) < 500) doFed_[lIdVec.at(
i)] =
true;
56 bookFEDHistograms(aFedId);
62 for (
unsigned iEle(0); iEle<aVec.size(); iEle++){
64 CMvalues lVal = aVec[iEle];
66 if (lVal.Medians.first >= 1024 || lVal.Medians.second >= 1024) {
67 std::cout <<
"----- WARNING ! New max found: " << lVal.Medians.first <<
" " << lVal.Medians.second <<
" " << __FILE__ <<
" " << __LINE__ << std::endl;
70 fillHistogram(medianAPV1vsAPV0_,lVal.Medians.first,lVal.Medians.second);
71 fillHistogram(medianAPV0minusAPV1_,lVal.Medians.first-lVal.Medians.second);
73 lMean += lVal.Medians.first + lVal.Medians.second;
74 lPrevMean += lVal.PreviousMedians.first + lVal.PreviousMedians.second;
77 fillHistogram(medianAPV1vsAPV0perFEDMap_[aFedId],lVal.Medians.first,lVal.Medians.second);
78 fillHistogram(medianAPV0minusAPV1perFEDMap_[aFedId],lVal.Medians.first-lVal.Medians.second);
79 fillHistogram(medianperChannelMap_[aFedId][lVal.ChannelID],lVal.Medians.first);
80 fillHistogram(medianAPV0minusAPV1perChannelMap_[aFedId][lVal.ChannelID],lVal.Medians.first-lVal.Medians.second);
85 if (aVec.size() > 0) {
86 lMean = lMean / (2*aVec.size());
87 lPrevMean = lPrevMean / (2*aVec.size());
90 fillHistogram(meanCMPerFedvsFedId_,aFedId,lMean);
91 fillHistogram(meanCMPerFedvsTime_,aTime,lMean);
92 fillHistogram(variationsPerFedvsFedId_,aFedId,lMean-lPrevMean);
93 fillHistogram(variationsPerFedvsTime_,aTime,lMean-lPrevMean);
99 void CMHistograms::bookTopLevelHistograms(
DQMStore* dqm)
109 histosBooked_.resize(siStripFedIdMax+1,
false);
111 std::string lDir = dqm_->pwd()+
"/";
117 dqm_->setCurrentFolder(lDir);
119 book2DHistogram(medianAPV1vsAPV0_,
121 "median APV1 vs APV0",
122 250,0,1024,250,0,1024,
123 "median APV0",
"median APV1");
125 bookHistogram(medianAPV0minusAPV1_,
126 "MedianAPV0minusAPV1",
127 "median APV0 - median APV1",
129 "median APV0 - median APV1");
132 bookProfile(meanCMPerFedvsFedId_,
133 "MeanCMPerFedvsFedId",
135 440,50,490,-1000,1000,
136 "fedID",
"<CM>^{FED}");
138 bookProfile(meanCMPerFedvsTime_,
139 "MeanCMPerFedvsTime",
142 "Time",
"<CM>^{FED}");
145 bookProfile(variationsPerFedvsFedId_,
146 "VariationsPerFedvsFedId",
148 440,50,490,-1000,1000,
149 "fedID",
"<CM>^{FED}_{t}-<CM>^{FED}_{t-1}");
151 bookProfile(variationsPerFedvsTime_,
152 "VariationsPerFedvsTime",
155 "Time",
"<CM>^{FED}_{t}-<CM>^{FED}_{t-1}");
162 if (tkMapConfig_.enabled){
164 tkmapCM_[0] =
new TkHistoMap(
"SiStrip/TkHisto",
"TkHMap_MeanCMAPV",0.,500);
165 tkmapCM_[1] =
new TkHistoMap(
"SiStrip/TkHisto",
"TkHMap_RmsCMAPV",0.,500);
166 tkmapCM_[2] =
new TkHistoMap(
"SiStrip/TkHisto",
"TkHMap_MeanCMAPV0minusAPV1",-500.,500);
167 tkmapCM_[3] =
new TkHistoMap(
"SiStrip/TkHisto",
"TkHMap_RmsCMAPV0minusAPV1",-500.,500);
180 void CMHistograms::bookFEDHistograms(
unsigned int fedId)
182 if (!histosBooked_[fedId]) {
186 std::stringstream fedIdStream;
187 fedIdStream << fedId;
189 dqm_->setCurrentFolder(fedKey.path());
191 book2DHistogram(medianAPV1vsAPV0perFED_,
192 medianAPV1vsAPV0perFEDMap_[fedId],
193 "MedianAPV1vsAPV0forFED"+fedIdStream.str(),
194 "median APV1 vs APV0 for FED "+fedIdStream.str(),
198 bookHistogram(medianAPV0minusAPV1perFED_,
199 medianAPV0minusAPV1perFEDMap_[fedId],
200 "MedianAPV0minusAPV1forFED"+fedIdStream.str(),
201 "median APV0 - median APV1 for FED "+fedIdStream.str(),
206 bookChannelsHistograms(fedId);
208 histosBooked_[fedId] =
true;
212 void CMHistograms::bookChannelsHistograms(
unsigned int fedId)
215 std::stringstream fedIdStream;
216 fedIdStream << fedId;
218 dqm_->setCurrentFolder(fedKey.path());
224 std::ostringstream lName0,lTitle0,lName1,lTitle1,lName2,lTitle2;
225 lName0 <<
"MedianForFed" << fedId <<
"Channel" << iCh;
226 lTitle0 <<
"Median for FED/Ch " << fedId <<
"/" << iCh ;
227 lName2 <<
"MedianAPV0minusAPV1ForFed" << fedId <<
"Channel" << iCh;
228 lTitle2 <<
"Median APV0-APV1 for FED/Ch " << fedId <<
"/" << iCh ;
230 bookHistogram(medianperChannel_,
231 medianperChannelMap_[fedId][iCh],
238 bookHistogram(medianAPV0minusAPV1perChannel_,
239 medianAPV0minusAPV1perChannelMap_[fedId][iCh],
249 void CMHistograms::bookAllFEDHistograms()
255 for (
unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++) {
256 bookFEDHistograms(iFed);
260 bool CMHistograms::tkHistoMapEnabled(
unsigned int aIndex){
261 return tkMapConfig_.enabled;
264 TkHistoMap * CMHistograms::tkHistoMapPointer(
unsigned int aIndex){
266 return tkmapCM_[aIndex];
T getUntrackedParameter(std::string const &, T const &) const
A container class for generic run and event-related info, information required by the commissioning a...
bool exists(std::string const ¶meterName) const
checks if a parameter exists
Constants and enumerated types for FED/FEC systems.
static const uint16_t FEDCH_PER_FED