26 for (
int i=0;
i<2;
i++)
27 for (
int j=0;
j<2;
j++)
28 for (
int k=0;
k<40;
k++)
29 for (
int m=0;
m<40;
m++) {
30 hPed_[
i][
j][
k][
m] = 0;
31 hTotN_[
i][
j][
k][
m] = 0;
43 if ( debug_ )
cout <<
"ESPedestalClient: beginJob" << endl;
52 if ( debug_ )
cout <<
"ESPedestalClient: beginRun" << endl;
61 if ( debug_ )
cout <<
"ESPedestalClient: endJob, ievt = " << ievt_ << endl;
68 if ( verbose_ )
cout<<
"ESPedestalClient: Fit Pedestal"<<endl;
70 for (
int i=0;
i<nLines_; ++
i) {
72 iz = (senZ_[
i]==1) ? 0:1;
74 for (
int is=0; is<32; ++is) {
76 string dirname = prefixME_ +
"/ESPedestalTask/";
77 sprintf(hname,
"ADC Z %d P %d X %d Y %d Str %d", senZ_[
i], senP_[i], senX_[i], senY_[i], is+1);
80 if (meFit==0)
continue;
81 TH1F *rootHisto = meFit->
getTH1F();
82 rootHisto->Fit(
"fg",
"Q",
"", 500, 1800);
83 rootHisto->Fit(
"fg",
"RQ",
"", fg->GetParameter(1)-2.*fg->GetParameter(2),fg->GetParameter(1)+2.*fg->GetParameter(2));
84 hPed_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1]->setBinContent(is+1, (
int)(fg->GetParameter(1)+0.5));
85 hTotN_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1]->setBinContent(is+1, fg->GetParameter(2));
92 if ( verbose_ )
cout<<
"ESPedestalClient: Use Histogram Mean"<<endl;
94 for (
int i=0;
i<nLines_; ++
i) {
96 iz = (senZ_[
i]==1) ? 0:1;
98 for (
int is=0; is<32; ++is) {
100 string dirname = prefixME_ +
"/ESPedestalTask/";
101 sprintf(hname,
"ADC Z %d P %d X %d Y %d Str %d", senZ_[
i], senP_[i], senX_[i], senY_[i], is+1);
104 if (meMean==0)
continue;
105 TH1F *rootHisto = meMean->
getTH1F();
107 hPed_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1]->setBinContent(is+1, (
int)(rootHisto->GetMean()+0.5));
108 hTotN_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1]->setBinContent(is+1, rootHisto->GetRMS());
119 if ( debug_ )
cout <<
"ESPedestalClient: endRun, jevt = " << jevt_ << endl;
127 int iz, ip, ix, iy,
fed, kchip, pace, bundle, fiber, optorx;
130 file.open(lookup_.fullPath().c_str());
131 if( file.is_open() ) {
135 for (
int i=0;
i<nLines_; ++
i) {
136 file>> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
145 cout<<
"ESPedestalClient : Look up table file can not be found in "<<lookup_.fullPath().c_str()<<endl;
149 dqmStore_->setCurrentFolder(prefixME_+
"/ESPedestalClient");
152 for (
int i=0;
i<nLines_; ++
i) {
154 iz = (senZ_[
i]==1) ? 0:1;
156 sprintf(hname,
"Ped Z %d P %d X %d Y %d", senZ_[
i], senP_[i], senX_[i], senY_[i]);
157 hPed_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1] = dqmStore_->book1D(hname, hname, 32, 0, 32);
159 sprintf(hname,
"Total Noise Z %d P %d X %d Y %d", senZ_[i], senP_[i], senX_[i], senY_[i]);
160 hTotN_[iz][senP_[
i]-1][senX_[
i]-1][senY_[
i]-1] = dqmStore_->book1D(hname, hname, 32, 0, 32);
163 fg =
new TF1(
"fg",
"gaus");
169 if( ! enableCleanup_ )
return;
171 if ( debug_ )
cout <<
"ESPedestalClient: cleanup" << endl;
173 for (
int i=0;
i<2;
i++)
174 for (
int j=0;
j<2;
j++)
175 for (
int k=0;
k<40;
k++)
176 for (
int m=0;
m<40;
m++) {
177 hPed_[
i][
j][
k][
m] = 0;
178 hTotN_[
i][
j][
k][
m] = 0;
T getUntrackedParameter(std::string const &, T const &) const
void beginJob(DQMStore *dqmStore)
ESPedestalClient(const edm::ParameterSet &ps)
static void cleanup(const Factory::MakerMap::value_type &v)
virtual ~ESPedestalClient()
TH1F * getTH1F(void) const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")