5 #include "DQM/SiStripMonitorHardware/interface/CMHistograms.hh" 9 CMHistograms::CMHistograms()
11 for (
unsigned int i(0);
i<500;
i++){
17 CMHistograms::~CMHistograms()
22 std::ostringstream* pDebugStream
25 getConfigForHistogram(medianAPV1vsAPV0_,
"MedianAPV1vsAPV0",iConfig,pDebugStream);
26 getConfigForHistogram(medianAPV0minusAPV1_,
"MedianAPV0minusAPV1",iConfig,pDebugStream);
28 getConfigForHistogram(meanCMPerFedvsFedId_,
"MeanCMPerFedvsFedId",iConfig,pDebugStream);
29 getConfigForHistogram(meanCMPerFedvsTime_,
"MeanCMPerFedvsTime",iConfig,pDebugStream);
30 getConfigForHistogram(variationsPerFedvsFedId_,
"VariationsPerFedvsFedId",iConfig,pDebugStream);
31 getConfigForHistogram(variationsPerFedvsTime_,
"VariationsPerFedvsTime",iConfig,pDebugStream);
33 getConfigForHistogram(medianAPV1vsAPV0perFED_,
"MedianAPV1vsAPV0perFED",iConfig,pDebugStream);
34 getConfigForHistogram(medianAPV0minusAPV1perFED_,
"MedianAPV0minusAPV1perFED",iConfig,pDebugStream);
36 getConfigForHistogram(medianperChannel_,
"MedianperChannel",iConfig,pDebugStream);
37 getConfigForHistogram(medianAPV0minusAPV1perChannel_,
"MedianAPV0minusAPV1perChannel",iConfig,pDebugStream);
40 getConfigForHistogram(tkMapConfig_,
"TkHistoMap",iConfig,pDebugStream);
42 if (iConfig.
exists(
"FedIdVec")){
43 std::vector<unsigned int> lIdVec = iConfig.
getUntrackedParameter<std::vector<unsigned int> >(
"FedIdVec");
44 for (
unsigned int i(0);
i<lIdVec.size();
i++){
45 if (lIdVec.at(
i) < 500) doFed_[lIdVec.at(
i)] =
true;
50 void CMHistograms::fillHistograms(
const std::vector<CMvalues>& aVec,
float aTime,
unsigned int aFedId)
55 for (
unsigned iEle(0); iEle<aVec.size(); iEle++){
57 CMvalues lVal = aVec[iEle];
59 if (lVal.Medians.first >= 1024 || lVal.Medians.second >= 1024) {
60 std::cout <<
"----- WARNING ! New max found: " << lVal.Medians.first <<
" " << lVal.Medians.second <<
" " << __FILE__ <<
" " << __LINE__ << std::endl;
63 fillHistogram(medianAPV1vsAPV0_,lVal.Medians.first,lVal.Medians.second);
64 fillHistogram(medianAPV0minusAPV1_,lVal.Medians.first-lVal.Medians.second);
66 lMean += lVal.Medians.first + lVal.Medians.second;
67 lPrevMean += lVal.PreviousMedians.first + lVal.PreviousMedians.second;
70 fillHistogram(medianAPV1vsAPV0perFEDMap_[aFedId],lVal.Medians.first,lVal.Medians.second);
71 fillHistogram(medianAPV0minusAPV1perFEDMap_[aFedId],lVal.Medians.first-lVal.Medians.second);
72 fillHistogram(medianperChannelMap_[aFedId][lVal.ChannelID],lVal.Medians.first);
73 fillHistogram(medianAPV0minusAPV1perChannelMap_[aFedId][lVal.ChannelID],lVal.Medians.first-lVal.Medians.second);
79 lMean = lMean / (2*aVec.size());
80 lPrevMean = lPrevMean / (2*aVec.size());
83 fillHistogram(meanCMPerFedvsFedId_,aFedId,lMean);
84 fillHistogram(meanCMPerFedvsTime_,aTime,lMean);
85 fillHistogram(variationsPerFedvsFedId_,aFedId,lMean-lPrevMean);
86 fillHistogram(variationsPerFedvsTime_,aTime,lMean-lPrevMean);
98 histosBooked_.resize(siStripFedIdMax+1,
false);
106 book2DHistogram(ibooker , medianAPV1vsAPV0_,
108 "median APV1 vs APV0",
109 250,0,1024,250,0,1024,
110 "median APV0",
"median APV1");
112 bookHistogram(ibooker, medianAPV0minusAPV1_,
113 "MedianAPV0minusAPV1",
114 "median APV0 - median APV1",
116 "median APV0 - median APV1");
119 bookProfile(ibooker , meanCMPerFedvsFedId_,
120 "MeanCMPerFedvsFedId",
122 440,50,490,-1000,1000,
123 "fedID",
"<CM>^{FED}");
125 bookProfile(ibooker , meanCMPerFedvsTime_,
126 "MeanCMPerFedvsTime",
129 "Time",
"<CM>^{FED}");
132 bookProfile(ibooker , variationsPerFedvsFedId_,
133 "VariationsPerFedvsFedId",
135 440,50,490,-1000,1000,
136 "fedID",
"<CM>^{FED}_{t}-<CM>^{FED}_{t-1}");
138 bookProfile(ibooker , variationsPerFedvsTime_,
139 "VariationsPerFedvsTime",
142 "Time",
"<CM>^{FED}_{t}-<CM>^{FED}_{t-1}");
149 if (tkMapConfig_.enabled){
150 tkmapCM_[0] = std::make_unique<TkHistoMap>(tkDetMap,
"SiStrip/TkHisto",
"TkHMap_MeanCMAPV",0.,
true);
151 tkmapCM_[1] = std::make_unique<TkHistoMap>(tkDetMap,
"SiStrip/TkHisto",
"TkHMap_RmsCMAPV",0.,
true);
152 tkmapCM_[2] = std::make_unique<TkHistoMap>(tkDetMap,
"SiStrip/TkHisto",
"TkHMap_MeanCMAPV0minusAPV1",-500.,
true);
153 tkmapCM_[3] = std::make_unique<TkHistoMap>(tkDetMap,
"SiStrip/TkHisto",
"TkHMap_RmsCMAPV0minusAPV1",-500.,
true);
156 tkmapCM_[0] =
nullptr;
157 tkmapCM_[1] =
nullptr;
158 tkmapCM_[2] =
nullptr;
159 tkmapCM_[3] =
nullptr;
164 bookFEDHistograms(ibooker , i);
170 if (!histosBooked_[fedId]) {
174 std::stringstream fedIdStream;
175 fedIdStream <<
fedId;
179 book2DHistogram(ibooker , medianAPV1vsAPV0perFED_,
180 medianAPV1vsAPV0perFEDMap_[fedId],
181 "MedianAPV1vsAPV0forFED"+fedIdStream.str(),
182 "median APV1 vs APV0 for FED "+fedIdStream.str(),
186 bookHistogram(ibooker , medianAPV0minusAPV1perFED_,
187 medianAPV0minusAPV1perFEDMap_[fedId],
188 "MedianAPV0minusAPV1forFED"+fedIdStream.str(),
189 "median APV0 - median APV1 for FED "+fedIdStream.str(),
194 bookChannelsHistograms(ibooker , fedId);
196 histosBooked_[
fedId] =
true;
200 void CMHistograms::bookChannelsHistograms(
DQMStore::IBooker & ibooker ,
unsigned int fedId)
203 std::stringstream fedIdStream;
204 fedIdStream <<
fedId;
212 std::ostringstream lName0,lTitle0,lName1,lTitle1,lName2,lTitle2;
213 lName0 <<
"MedianForFed" << fedId <<
"Channel" << iCh;
214 lTitle0 <<
"Median for FED/Ch " << fedId <<
"/" << iCh ;
215 lName2 <<
"MedianAPV0minusAPV1ForFed" << fedId <<
"Channel" << iCh;
216 lTitle2 <<
"Median APV0-APV1 for FED/Ch " << fedId <<
"/" << iCh ;
218 bookHistogram(ibooker , medianperChannel_,
219 medianperChannelMap_[fedId][iCh],
226 bookHistogram(ibooker , medianAPV0minusAPV1perChannel_,
227 medianAPV0minusAPV1perChannelMap_[fedId][iCh],
243 for (
unsigned int iFed = siStripFedIdMin; iFed <= siStripFedIdMax; iFed++) {
244 bookFEDHistograms(ibooker , iFed);
248 bool CMHistograms::tkHistoMapEnabled(
unsigned int aIndex){
249 return tkMapConfig_.enabled;
252 TkHistoMap * CMHistograms::tkHistoMapPointer(
unsigned int aIndex){
254 return tkmapCM_[aIndex].get();
T getUntrackedParameter(std::string const &, T const &) const
static const uint16_t FED_ID_MIN
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
void setCurrentFolder(const std::string &fullpath)
Constants and enumerated types for FED/FEC systems.
const std::string & pwd()
static const uint16_t FEDCH_PER_FED
static const uint16_t FED_ID_MAX