24 for (
int i=0;
i<2; ++
i)
25 for (
int j=0;
j<2; ++
j)
26 for (
int k=0;
k<40; ++
k)
27 for (
int m=0;
m<40; ++
m) {
28 fed_[
i][
j][
k][
m] = -1;
29 kchip_[
i][
j][
k][
m] = -1;
32 for (
int i=0;
i<56; ++
i) {
35 slinkCRCStatus_[
i] = -1;
36 for (
int j=0;
j<36; ++
j)
37 fiberStatus_[
i][
j] = -1;
40 int nLines_,
z, iz, ip, ix, iy, fed, kchip, pace, bundle, fiber, optorx;
42 file.open(lookup_.fullPath().c_str());
43 if( file.is_open() ) {
47 for (
int i=0;
i<nLines_; ++
i) {
48 file>> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
51 fed_[z-1][ip-1][ix-1][iy-1] = fed;
52 kchip_[z-1][ip-1][ix-1][iy-1] = kchip;
53 fiber_[z-1][ip-1][ix-1][iy-1] = (fiber-1)+(optorx-1)*12;
57 cout<<
"ESIntegrityClient : Look up table file can not be found in "<<lookup_.fullPath().c_str()<<endl;
69 hOrbitNumberDiff_ = 0;
83 if ( debug_ )
cout <<
"ESIntegrityClient: beginJob" << endl;
91 if ( debug_ )
cout <<
"ESIntegrityClient: beginRun" << endl;
101 if ( debug_ )
cout <<
"ESIntegrityClient: endJob, ievt = " << ievt_ << endl;
109 if ( debug_ )
cout <<
"ESIntegrityClient: endRun, jevt = " << jevt_ << endl;
119 dqmStore_->setCurrentFolder( prefixME_ +
"/ESIntegrityClient" );
121 for (
int i=0 ;
i<2; ++
i)
122 for (
int j=0 ;
j<2; ++
j) {
123 int iz = (
i==0)? 1:-1;
124 snprintf(histo, 200,
"ES Integrity Summary 1 Z %d P %d", iz,
j+1);
125 meFED_[
i][
j] = dqmStore_->book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
126 meFED_[
i][
j]->setAxisTitle(
"Si X", 1);
127 meFED_[
i][
j]->setAxisTitle(
"Si Y", 2);
129 snprintf(histo, 200,
"ES Integrity Summary 2 Z %d P %d", iz,
j+1);
130 meKCHIP_[
i][
j] = dqmStore_->book2D(histo, histo, 40, 0.5, 40.5, 40, 0.5, 40.5);
131 meKCHIP_[
i][
j]->setAxisTitle(
"Si X", 1);
132 meKCHIP_[
i][
j]->setAxisTitle(
"Si Y", 2);
138 if ( ! enableCleanup_ )
return;
144 double nDI_FedErr[56];
145 for (
int i=0;
i<56; ++
i) nDI_FedErr[
i] = 0;
149 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES FEDs used for data taking");
150 hFED_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hFED_ );
152 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES Fiber Off");
153 hFiberOff_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hFiberOff_ );
155 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES Fiber Bad Status");
156 hFiberBadStatus_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hFiberBadStatus_ );
158 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES SLink CRC Errors");
159 hSLinkCRCErr_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hSLinkCRCErr_ );
164 for (
int i=1;
i<=56; ++
i)
165 if (nevFEDs < hFED_->GetBinContent(
i))
166 nevFEDs = (
int) hFED_->GetBinContent(
i);
170 for (
int i=1;
i<=56; ++
i) {
172 if (hFED_->GetBinContent(
i) > 0)
176 if (hSLinkCRCErr_->GetBinContent(
i) > 0)
177 slinkCRCStatus_[
i-1] = 1;
179 for (
int j=0;
j<36; ++
j) {
180 if (hFiberBadStatus_) {
181 if (hFiberBadStatus_->GetBinContent(
i,
j+1) > 0)
182 fiberStatus_[
i-1][
j] = 2;
184 fiberStatus_[
i-1][
j] = 1;
187 if (hFiberOff_->GetBinContent(
i,
j+1) > 0) {
188 fiberStatus_[
i-1][
j] = 0;
194 me = dqmStore_->get(prefixME_ +
"/ESRawDataTask/ES L1A DCC errors");
195 hL1ADiff_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hL1ADiff_ );
197 me = dqmStore_->get(prefixME_ +
"/ESRawDataTask/ES BX DCC errors");
198 hBXDiff_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hBXDiff_ );
200 me = dqmStore_->get(prefixME_ +
"/ESRawDataTask/ES Orbit Number DCC errors");
201 hOrbitNumberDiff_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hOrbitNumberDiff_ );
203 for (
int i=1;
i<=56; ++
i) {
204 if (hL1ADiff_ && hBXDiff_) {
205 if (hL1ADiff_->GetBinContent(
i) > 0 || hBXDiff_->GetBinContent(
i) > 0) {
206 syncStatus_[
i-1] = 1;
207 if (hL1ADiff_->GetBinContent(
i) > nDI_FedErr[
i-1]) nDI_FedErr[
i-1] = hL1ADiff_->GetBinContent(
i);
208 if (hBXDiff_->GetBinContent(
i) > nDI_FedErr[
i-1]) nDI_FedErr[
i-1] = hBXDiff_->GetBinContent(
i);
215 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES KChip Flag 1 Error codes");
216 hKF1_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hKF1_ );
218 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES KChip Flag 2 Error codes");
219 hKF2_ = UtilsClient::getHisto<TH2F*>( me, cloneME_, hKF2_ );
221 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES KChip BC mismatch with OptoRX");
222 hKBC_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hKBC_ );
224 me = dqmStore_->get(prefixME_ +
"/ESIntegrityTask/ES KChip EC mismatch with OptoRX");
225 hKEC_ = UtilsClient::getHisto<TH1F*>( me, cloneME_, hKEC_ );
227 Int_t kchip_xval[1550];
228 for (
int i=0;
i<1550; ++
i) {
232 for (
int j=1;
j<16; ++
j) {
234 if (hKF1_->GetBinContent(
i,
j+1)>0) {
240 if (hKF2_->GetBinContent(
i,
j+1)>0) {
247 if (hKBC_->GetBinContent(
i)>0) {
253 if (hKEC_->GetBinContent(
i)>0) {
258 if (kErr>1) xval = 7;
259 kchip_xval[
i] = xval;
263 for (
int iz=0; iz<2; ++iz)
264 for (
int ip=0; ip<2; ++ip)
265 for (
int ix=0; ix<40; ++ix)
266 for (
int iy=0; iy<40; ++iy) {
267 if (fed_[iz][ip][ix][iy] == -1)
continue;
268 if (fedStatus_[fed_[iz][ip][ix][iy]-520]==-1 || fiberStatus_[fed_[iz][ip][ix][iy]-520][fiber_[iz][ip][ix][iy]] == 0)
269 kchip_xval[kchip_[iz][ip][ix][iy]-1] = 0;
270 if ((kchip_[iz][ip][ix][iy]-2) >= 0)
271 meKCHIP_[iz][ip]->setBinContent(ix+1, iy+1, kchip_xval[kchip_[iz][ip][ix][iy]-2]);
276 for (
int iz=0; iz<2; ++iz)
277 for (
int ip=0; ip<2; ++ip)
278 for (
int ix=0; ix<40; ++ix)
279 for (
int iy=0; iy<40; ++iy) {
281 if (fed_[iz][ip][ix][iy] == -1)
continue;
284 if (fedStatus_[fed_[iz][ip][ix][iy]-520] == 1) {
287 if (hFED_->GetBinContent(fed_[iz][ip][ix][iy]-520+1) == nevFEDs)
295 if (fiberStatus_[fed_[iz][ip][ix][iy]-520][fiber_[iz][ip][ix][iy]] == 2) {
299 if (fiberStatus_[fed_[iz][ip][ix][iy]-520][fiber_[iz][ip][ix][iy]] == 0) {
302 if (kchip_xval[kchip_[iz][ip][ix][iy]-1] != 3 && kchip_xval[kchip_[iz][ip][ix][iy]-1] != 0) {
306 if (syncStatus_[fed_[iz][ip][ix][iy]-520] == 1) {
310 if (slinkCRCStatus_[fed_[iz][ip][ix][iy]-520] == 1) {
314 if (nErr > 1) xval = 7;
315 }
else if (fedStatus_[fed_[iz][ip][ix][iy]-520] == -1) {
void softReset(bool flag)
SoftReset.
T getUntrackedParameter(std::string const &, T const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
void beginRun(void)
BeginRun.
static void cleanup(const Factory::MakerMap::value_type &v)
virtual ~ESIntegrityClient()
Destructor.
void cleanup(void)
Cleanup.
void beginJob(DQMStore *dqmStore)
BeginJob.
Ecal Monitor Utils for Client.
ESIntegrityClient(const edm::ParameterSet &ps)
Constructor.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void analyze(void)
Analyze.