21 std::cout <<
"<HcalZDCMonitor::setup> Setting up histograms" << std::endl;
24 std::cout <<
"<HcalZDCMonitor::setup> Getting variable values from cfg files" << std::endl;
32 std::cout <<
"<HcalZDCMonitor::setup> Setting up Histograms" << std::endl;
107 for (
int i = 0;
i < 5; ++
i) {
109 sprintf(title,
"h_ZDCP_EMChan_%i_Pulse",
i + 1);
110 sprintf(name,
"ZDC Plus EM Section Pulse for channel %i",
i + 1);
115 sprintf(title,
"h_ZDCM_EMChan_%i_Pulse",
i + 1);
116 sprintf(name,
"ZDC Minus EM Section Pulse for channel %i",
i + 1);
121 sprintf(title,
"h_ZDCP_EMChan_%i_Charge",
i + 1);
122 sprintf(name,
"ZDC Plus EM Section Charge for channel %i",
i + 1);
127 sprintf(title,
"h_ZDCM_EMChan_%i_Charge",
i + 1);
128 sprintf(name,
"ZDC Minus EM Section Charge for channel %i",
i + 1);
133 sprintf(title,
"h_ZDCP_EMChan_%i_TSMean",
i + 1);
134 sprintf(name,
"ZDC Plus EM Section TSMean for channel %i",
i + 1);
139 sprintf(title,
"h_ZDCM_EMChan_%i_TSMean",
i + 1);
140 sprintf(name,
"ZDC Minus EM Section TSMean for channel %i",
i + 1);
146 for (
int i = 0;
i < 4; ++
i) {
148 sprintf(title,
"h_ZDCP_HADChan_%i_Pulse",
i + 1);
149 sprintf(name,
"ZDC Plus HAD Section Pulse for channel %i",
i + 1);
154 sprintf(title,
"h_ZDCM_HADChan_%i_Pulse",
i + 1);
155 sprintf(name,
"ZDC Minus HAD Section Pulse for channel %i",
i + 1);
160 sprintf(title,
"h_ZDCP_HADChan_%i_Charge",
i + 1);
161 sprintf(name,
"ZDC Plus HAD Section Charge for channel %i",
i + 1);
166 sprintf(title,
"h_ZDCM_HADChan_%i_Charge",
i + 1);
167 sprintf(name,
"ZDC Minus HAD Section Charge for channel %i",
i + 1);
172 sprintf(title,
"h_ZDCP_HADChan_%i_TSMean",
i + 1);
173 sprintf(name,
"ZDC Plus HAD Section TSMean for channel %i",
i + 1);
178 sprintf(title,
"h_ZDCM_HADChan_%i_TSMean",
i + 1);
179 sprintf(name,
"ZDC Minus HAD Section TSMean for channel %i",
i + 1);
187 for (
int i = 0;
i < 5; ++
i) {
189 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Energy",
i+1);
190 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
195 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Energy",
i+1);
196 sprintf(name,
"ZDC EM Section Rechit Energy for channel %i",
i+1);
201 sprintf(title,
"h_ZDCP_EMChan_%i_RecHit_Timing",
i+1);
202 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
207 sprintf(title,
"h_ZDCM_EMChan_%i_RecHit_Timing",
i+1);
208 sprintf(name,
"ZDC EM Section Rechit Timing for channel %i",
i+1);
214 for (
int i = 0;
i < 4; ++
i) {
216 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Energy",
i+1);
217 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
222 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Energy",
i+1);
223 sprintf(name,
"ZDC HAD Section Rechit Energy for channel %i",
i+1);
228 sprintf(title,
"h_ZDCP_HADChan_%i_RecHit_Timing",
i+1);
229 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
234 sprintf(title,
"h_ZDCM_HADChan_%i_RecHit_Timing",
i+1);
235 sprintf(name,
"ZDC HAD Section Rechit Timing for channel %i",
i+1);
247 std::cout <<
"<HcalZDCMonitor::processEvent> Processing Event..." << std::endl;
260 std::vector<double> fData;
261 double digiThresh = 99.5;
263 int digiSaturation = 127;
267 digi_iter != digi.
end(); ++digi_iter)
271 int iSide = digi_iter->id().zside();
272 int iSection = digi_iter->id().section();
273 int iChannel = digi_iter->id().channel();
275 unsigned int fTS = digi_iter->
size();
276 while (fData.size()<fTS)
277 fData.push_back(-999);
278 while (fData.size()>fTS)
282 bool saturated =
false;
283 for (
unsigned int i = 0;
i < fTS; ++
i)
286 fData[
i]=digi[
i].nominal_fC();
287 if (digi[
i].
adc()==digiSaturation){
294 fTSMean =
getTime(fData, 4, 6, fSum);
296 if (saturated==
true){
303 for (
unsigned int i = 0;
i < fTS; ++
i) {
306 if (fSum > digiThresh) {
313 for (
unsigned int i = 0;
i < fTS; ++
i) {
316 if (fSum > digiThresh) {
323 else if (iSection == 2)
326 for (
unsigned int i = 0;
i < fTS; ++
i) {
329 if (fSum > digiThresh) {
335 for (
unsigned int i = 0;
i < fTS; ++
i) {
338 if (fSum > digiThresh) {
351 rechit_iter != rechit.
end(); ++rechit_iter)
354 int Side = (rechit_iter->id()).zside();
355 int Section = (rechit_iter->id()).section();
356 int Channel = (rechit_iter->id()).channel();
418 double weightedTime = 0.;
421 double digiThreshf = 99.5;
423 for (
unsigned int ts=ts_min; ts<=ts_max; ++ts) {
424 if (fData[ts] > digiThreshf){
425 weightedTime += ts * fData[ts];
431 Time = weightedTime / SumT;
444 for (
int i = 0;
i < 5; ++
i) {
457 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 * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * h_ZDCM_EM_RecHitTiming[5]
MonitorElement * h_2D_TSMean
MonitorElement * h_ZDCM_HAD_RecHitTiming[4]
MonitorElement * h_ZDCP_EM_RecHitEnergy[5]
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]
MonitorElement * h_ZDCP_HAD_Charge[4]
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
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
MonitorElement * h_ZDCP_HAD_Pulse[4]
MonitorElement * h_ZDCM_EM_RecHitEnergy[5]
MonitorElement * h_ZDCP_HAD_RecHitEnergy[4]
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 * 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)
void setCurrentFolder(const std::string &fullpath)
const_iterator begin() const
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * h_ZDCP_EM_RecHitTiming[5]
MonitorElement * h_ZDCM_HAD_Pulse[4]