21 std::cout <<
"<HcalZDCMonitor::setup> Setting up histograms" << std::endl;
24 std::cout <<
"<HcalZDCMonitor::setup> Getting variable values from cfg files" << std::endl;
31 std::cout <<
"<HcalZDCMonitor::setup> Setting up Histograms" << std::endl;
106 for (
int i = 0;
i < 5; ++
i) {
108 sprintf(title,
"h_ZDCP_EMChan_%i_Pulse",
i + 1);
109 sprintf(name,
"ZDC Plus EM Section Pulse for channel %i",
i + 1);
114 sprintf(title,
"h_ZDCM_EMChan_%i_Pulse",
i + 1);
115 sprintf(name,
"ZDC Minus EM Section Pulse for channel %i",
i + 1);
120 sprintf(title,
"h_ZDCP_EMChan_%i_Charge",
i + 1);
121 sprintf(name,
"ZDC Plus EM Section Charge for channel %i",
i + 1);
126 sprintf(title,
"h_ZDCM_EMChan_%i_Charge",
i + 1);
127 sprintf(name,
"ZDC Minus EM Section Charge for channel %i",
i + 1);
132 sprintf(title,
"h_ZDCP_EMChan_%i_TSMean",
i + 1);
133 sprintf(name,
"ZDC Plus EM Section TSMean for channel %i",
i + 1);
138 sprintf(title,
"h_ZDCM_EMChan_%i_TSMean",
i + 1);
139 sprintf(name,
"ZDC Minus EM Section TSMean for channel %i",
i + 1);
145 for (
int i = 0;
i < 4; ++
i) {
147 sprintf(title,
"h_ZDCP_HADChan_%i_Pulse",
i + 1);
148 sprintf(name,
"ZDC Plus HAD Section Pulse for channel %i",
i + 1);
153 sprintf(title,
"h_ZDCM_HADChan_%i_Pulse",
i + 1);
154 sprintf(name,
"ZDC Minus HAD Section Pulse for channel %i",
i + 1);
159 sprintf(title,
"h_ZDCP_HADChan_%i_Charge",
i + 1);
160 sprintf(name,
"ZDC Plus HAD Section Charge for channel %i",
i + 1);
165 sprintf(title,
"h_ZDCM_HADChan_%i_Charge",
i + 1);
166 sprintf(name,
"ZDC Minus HAD Section Charge for channel %i",
i + 1);
171 sprintf(title,
"h_ZDCP_HADChan_%i_TSMean",
i + 1);
172 sprintf(name,
"ZDC Plus HAD Section TSMean for channel %i",
i + 1);
177 sprintf(title,
"h_ZDCM_HADChan_%i_TSMean",
i + 1);
178 sprintf(name,
"ZDC Minus HAD Section TSMean for channel %i",
i + 1);
186 for (
int i = 0;
i < 5; ++
i) {
188 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Energy",
i+1);
189 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
194 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Energy",
i+1);
195 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
200 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Timing",
i+1);
201 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
206 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Timing",
i+1);
207 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
213 for (
int i = 0;
i < 4; ++
i) {
215 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Energy",
i+1);
216 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
221 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Energy",
i+1);
222 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
227 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Timing",
i+1);
228 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
233 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Timing",
i+1);
234 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
245 std::cout <<
"<HcalZDCMonitor::processEvent> Processing Event..." << std::endl;
258 std::vector<double> fData;
259 double digiThresh = 99.5;
261 int digiSaturation = 127;
265 digi_iter != digi.
end(); ++digi_iter)
269 int iSide = digi_iter->id().zside();
270 int iSection = digi_iter->id().section();
271 int iChannel = digi_iter->id().channel();
273 unsigned int fTS = digi_iter->
size();
274 while (fData.size()<fTS)
275 fData.push_back(-999);
276 while (fData.size()>fTS)
280 bool saturated =
false;
281 for (
unsigned int i = 0;
i < fTS; ++
i)
284 fData[
i]=digi[
i].nominal_fC();
285 if (digi[
i].
adc()==digiSaturation){
292 fTSMean =
getTime(fData, 4, 6, fSum);
294 if (saturated==
true){
301 for (
unsigned int i = 0;
i < fTS; ++
i) {
304 if (fSum > digiThresh) {
311 for (
unsigned int i = 0;
i < fTS; ++
i) {
314 if (fSum > digiThresh) {
321 else if (iSection == 2)
324 for (
unsigned int i = 0;
i < fTS; ++
i) {
327 if (fSum > digiThresh) {
333 for (
unsigned int i = 0;
i < fTS; ++
i) {
336 if (fSum > digiThresh) {
349 rechit_iter != rechit.
end(); ++rechit_iter)
352 int Section = (rechit_iter->id()).section();
353 int Channel = (rechit_iter->id()).channel();
415 double weightedTime = 0.;
418 double digiThreshf = 99.5;
420 for (
unsigned int ts=ts_min; ts<=ts_max; ++ts) {
421 if (fData[ts] > digiThreshf){
422 weightedTime += ts * fData[ts];
428 Time = weightedTime / SumT;
441 for (
int i = 0;
i < 5; ++
i) {
454 for (
int i = 0;
i < 4; ++
i) {
int adc(sample_type sample)
get the ADC sample (12 bits)
MonitorElement * h_ZDCP_HAD_TSMean[4]
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * h_ZDCP_HAD_RecHitTiming[4]
MonitorElement * h_ZDCM_EM_Pulse[5]
MonitorElement * h_ZDCM_HAD_TSMean[4]
MonitorElement * h_ZDCM_EM_TSMean[5]
MonitorElement * h_ZDCM_EM_RecHitTiming[5]
MonitorElement * h_2D_TSMean
MonitorElement * h_ZDCM_HAD_RecHitTiming[4]
virtual void setup(const edm::ParameterSet &ps, DQMStore::IBooker &ib)
MonitorElement * h_ZDCP_EM_RecHitEnergy[5]
MonitorElement * bookInt(Args &&...args)
std::vector< ZDCDataFrame >::const_iterator const_iterator
MonitorElement * h_ZDCP_EM_Pulse[5]
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * h_ZDCP_EM_TSMean[5]
MonitorElement * h_ZDCM_EM_Charge[5]
void setup(const edm::ParameterSet &ps, DQMStore::IBooker &ib)
MonitorElement * h_ZDCP_HAD_Charge[4]
MonitorElement * book1D(Args &&...args)
MonitorElement * h_2D_saturation
MonitorElement * h_2D_charge
MonitorElement * h_2D_RecHitTime
MonitorElement * h_ZDCM_HAD_Charge[4]
MonitorElement * h_ZDCM_HAD_RecHitEnergy[4]
const_iterator end() const
void endLuminosityBlock(void)
double getTime(const std::vector< double > &fData, unsigned int ts_min, unsigned int ts_max, double &fSum)
MonitorElement * h_2D_RecHitEnergy
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
MonitorElement * h_ZDCP_HAD_Pulse[4]
MonitorElement * h_ZDCM_EM_RecHitEnergy[5]
MonitorElement * h_ZDCP_HAD_RecHitEnergy[4]
MonitorElement * h_ZDCP_EM_Charge[5]
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const_iterator begin() const
MonitorElement * h_ZDCP_EM_RecHitTiming[5]
MonitorElement * h_ZDCM_HAD_Pulse[4]