00001 #include <TH2.h>
00002 #include <vector>
00003 #include "StEemcTriggerSimu.h"
00004
00005 #include "StMuDSTMaker/COMMON/StMuEvent.h"
00006
00007 #include "EEfeeTPTree.h"
00008 #include "EEfeeTP.h"
00009 #include "EEdsm0Tree.h"
00010 #include "EEdsm1Tree.h"
00011 #include "EMCdsm2Tree.h"
00012 #include "EEdsm3.h"
00013
00014
00015
00016
00017 void
00018 StEemcTriggerSimu::compareADCfee_TRG0(){
00019
00020
00021 int i;
00022 for(i=0;i<EEfeeTPTree::mxTP;i++) {
00023 EEfeeTP *feeTP=feeTPTreeADC->TP(i);
00024
00025
00026 int trgHT=dsm0TreeTRG->getInpHT6bit(i);
00027 int trgTPsum=dsm0TreeTRG->getInpTP6bit(i);
00028
00029 int delHT=feeTP->getOutHT()-trgHT;
00030 int delTPsum=feeTP->getOutTPsum()-trgTPsum;
00031 bool isBad=false;
00032
00033
00034 hA[10]->Fill(i,trgHT);
00035 hA[11]->Fill(i,feeTP->getOutHT());
00036 if(delHT!=0) {
00037 hA[12]->Fill(i,delHT);
00038 hA[13]->Fill(i);
00039 isBad=true;
00040
00041
00042 }
00043
00044
00045 hA[20]->Fill(i,trgTPsum);
00046 hA[21]->Fill(i,feeTP->getOutTPsum());
00047 if(delTPsum!=0) {
00048 hA[22]->Fill(i,delTPsum);
00049 hA[23]->Fill(i);
00050 isBad=true;
00051
00052 }
00053
00054
00055
00056 }
00057
00058 }
00059
00060
00061
00062
00063 void
00064 StEemcTriggerSimu::compareTRG0_TRG1(){
00065
00066 int ch;
00067
00068
00069 bool isGood=true;
00070 for(ch=0;ch<12;ch++) {
00071
00072 int inpTrgTPsum=dsm1TreeTRG->getInpTPsum(ch);
00073 int emuTrgTPsum=dsm0TreeTRG->getOutTPsum(ch);
00074
00075 hA[150]->Fill(ch, inpTrgTPsum);
00076 hA[151]->Fill(ch, emuTrgTPsum);
00077
00078 if(inpTrgTPsum!=emuTrgTPsum) {
00079 hA[152]->Fill(ch, emuTrgTPsum-inpTrgTPsum);
00080 hA[157]->Fill(ch, emuTrgTPsum-inpTrgTPsum);
00081 hA[153]->Fill(ch);
00082 if(!mMCflag) printf("BaD TPsum(ch=%d) out0=%d inp1=%d del=%d\n", ch, emuTrgTPsum, inpTrgTPsum, emuTrgTPsum-inpTrgTPsum );
00083 isGood=false;
00084 }
00085
00086 int inpTrgHT=dsm1TreeTRG->getInpHT2bit(ch);
00087 int emuTrgHT=dsm0TreeTRG->getOutHT2bit(ch);
00088
00089 hA[160]->Fill(ch, inpTrgHT);
00090 hA[161]->Fill(ch, emuTrgHT);
00091
00092 if(inpTrgHT!=emuTrgHT) {
00093 hA[162]->Fill(ch, emuTrgHT-inpTrgHT);
00094 hA[163]->Fill(ch);
00095 isGood=false;
00096 if(!mMCflag) printf("BaD HT2bit(ch=%d) out0=%d inp1=%d del=%d\n",ch, emuTrgHT, inpTrgHT, emuTrgHT-inpTrgHT );
00097 }
00098
00099 int inpTrgHTTP=dsm1TreeTRG->getInpHTTP2bit(ch);
00100 int emuTrgHTTP=dsm0TreeTRG->getOutHTTP2bit(ch);
00101
00102 hA[170]->Fill(ch, inpTrgHTTP);
00103 hA[171]->Fill(ch, emuTrgHTTP);
00104
00105 if(inpTrgHTTP!=emuTrgHTTP) {
00106 hA[172]->Fill(ch, emuTrgHTTP-inpTrgHTTP);
00107 hA[173]->Fill(ch);
00108 isGood=false;
00109 if(!mMCflag) printf("BaD HTTP2bit(ch=%d) out0=%d inp1=%d del=%d\n", ch, emuTrgHTTP, inpTrgHTTP, emuTrgHTTP-inpTrgHTTP );
00110 }
00111
00112
00113 int inpTrgTP=dsm1TreeTRG->getInpTP2bit(ch);
00114 int emuTrgTP=dsm0TreeTRG->getOutTP2bit(ch);
00115
00116 hA[180]->Fill(ch, inpTrgTP);
00117 hA[181]->Fill(ch, emuTrgTP);
00118
00119 if(inpTrgTP!=emuTrgTP) {
00120 hA[182]->Fill(ch, emuTrgTP-inpTrgTP);
00121 hA[183]->Fill(ch);
00122 isGood=false;
00123 if(!mMCflag) printf("BaD TP2bit(ch=%d) out0=%d inp1=%d del=%d\n", ch, emuTrgTP, inpTrgTP, emuTrgTP-inpTrgTP );
00124 }
00125
00126 int inpTrg16bit=dsm1TreeTRG->getInp16bit(ch);
00127 int emuTrg16bit=dsm0TreeTRG->getOut16bit(ch);
00128
00129 hA[190]->Fill(ch, inpTrg16bit);
00130 hA[191]->Fill(ch, emuTrg16bit);
00131
00132 if(inpTrg16bit!=emuTrg16bit) {
00133 hA[192]->Fill(ch, emuTrg16bit-inpTrg16bit);
00134 hA[193]->Fill(ch);
00135 isGood=false;
00136 if(!mMCflag) printf("BaD TP2bit(ch=%d) out0=%d inp1=%d del=%d\n", ch, emuTrgTP, inpTrgTP, emuTrgTP-inpTrgTP );
00137 }
00138
00139 }
00140
00141
00142 if(!isGood) {
00143 dsm0TreeTRG->print();
00144 dsm1TreeTRG->print();
00145 }
00146
00147 }
00148
00149
00150
00151
00152 void
00153 StEemcTriggerSimu::compareTRG1_TRG2(){
00154
00155
00156
00157
00158 int ibr=0;
00159 int ch;
00160 int outJPdiff[2],outHTdiff[2],outHTTPdiff[2],outTPdiff[2];
00161 int inpJPdiff[2],inpHTdiff[2],inpHTTPdiff[2],inpTPdiff[2];
00162
00163 for(ch=0;ch<2;ch++) {
00164
00165 int outE=dsm1TreeTRG->getOutEsum5bit(ch);
00166 int inpE=dsm2TreeTRG->getInpEsum5bit(ibr,ch);
00167
00168
00169
00170
00171
00172 hA[501]->Fill(ch, outE);
00173
00174 if(outE!=inpE) {
00175 dsm1TreeTRG->print();
00176
00177 hA[502]->Fill(ch, outE-inpE);
00178 hA[503]->Fill(ch);
00179
00180 if(!mMCflag) printf("BaD 3JP Esum5bit(ch=%d) out1=%d inp2=%d diff=%d\n",ch, outE,inpE,outE-inpE);
00181
00182 }
00183
00184 int outJP=dsm1TreeTRG->getOutJP2bit(ch);
00185 int inpJP=dsm2TreeTRG->getInpJP2bit(ibr,ch);
00186
00187 outJPdiff[ch]=outJP;
00188 inpJPdiff[ch]=inpJP;
00189
00190
00191
00192
00193 hA[510]->Fill(ch, inpJP);
00194 hA[511]->Fill(ch, outJP);
00195
00196 if(outJP!=inpJP) {
00197
00198 dsm1TreeTRG->print();
00199
00200 hA[512]->Fill(ch, outJP-inpJP);
00201 hA[513]->Fill(ch);
00202
00203 if(!mMCflag) printf("BaD 3JP JP2bit(ch=%d) out1=%d inp2=%d diff=%d\n",ch, outJP,inpJP,outJP-inpJP);
00204
00205 }
00206
00207 int outHT=dsm1TreeTRG->getOutHT2bit(ch);
00208 int inpHT=dsm2TreeTRG->getInpHT2bit(ibr,ch);
00209
00210 outHTdiff[ch]=outHT;
00211 inpHTdiff[ch]=inpHT;
00212
00213
00214
00215 hA[510]->Fill(ch+3, inpHT);
00216 hA[511]->Fill(ch+3, outHT);
00217
00218 if(outHT!=inpHT) {
00219 dsm1TreeTRG->print();
00220
00221 hA[512]->Fill(ch+3, outHT-inpHT);
00222 hA[513]->Fill(ch+3);
00223
00224 if(!mMCflag) printf("BaD 3JP HT2bit(ch=%d) out1=%d inp2=%d diff=%d\n",ch, outHT,inpHT,outHT-inpHT);
00225
00226 }
00227
00228 int outHTTP=dsm1TreeTRG->getOutHTTP1bit(ch);
00229 int inpHTTP=dsm2TreeTRG->getInpHTTP1bit(ibr,ch);
00230
00231 outHTTPdiff[ch]=outHTTP;
00232 inpHTTPdiff[ch]=inpHTTP;
00233
00234
00235
00236 hA[510]->Fill(ch+6, inpHTTP);
00237 hA[511]->Fill(ch+6, outHTTP);
00238
00239 if(outHTTP!=inpHTTP) {
00240
00241 dsm1TreeTRG->print();
00242
00243 hA[512]->Fill(ch+6, outHTTP-inpHTTP);
00244 hA[513]->Fill(ch+6);
00245
00246 if(!mMCflag) printf("BaD 3JP HTTP1bit(ch=%d) out1=%d inp2=%d diff=%d\n",ch, outHTTP,inpHTTP,outHTTP-inpHTTP);
00247
00248 }
00249
00250 int outTP=dsm1TreeTRG->getOutTP1bit(ch);
00251 int inpTP=dsm2TreeTRG->getInpTP1bit(ibr,ch);
00252
00253 outTPdiff[ch]=outTP;
00254 inpTPdiff[ch]=inpTP;
00255
00256
00257
00258 hA[510]->Fill(ch+9, inpTP);
00259 hA[511]->Fill(ch+9, outTP);
00260
00261 if(outTP!=inpTP) {
00262
00263 dsm1TreeTRG->print();
00264
00265 hA[512]->Fill(ch+9, outTP-inpTP);
00266 hA[513]->Fill(ch+9);
00267
00268 if(!mMCflag) printf("BaD 3JP TP1bit(ch=%d) out1=%d inp2=%d diff=%d\n",ch, outTP,inpTP,outTP-inpTP);
00269
00270 }
00271
00272 }
00273
00274 hA[520]->Fill(1,inpJPdiff[1]-inpJPdiff[0]);
00275 hA[520]->Fill(4,inpHTdiff[1]-inpHTdiff[0]);
00276 hA[520]->Fill(7,inpHTTPdiff[1]-inpHTTPdiff[0]);
00277 hA[520]->Fill(10,inpTPdiff[1]-inpTPdiff[0]);
00278
00279 hA[521]->Fill(1,outJPdiff[1]-outJPdiff[0]);
00280 hA[521]->Fill(4,outHTdiff[1]-outHTdiff[0]);
00281 hA[521]->Fill(7,outHTTPdiff[1]-outHTTPdiff[0]);
00282 hA[521]->Fill(10,outTPdiff[1]-outTPdiff[0]);
00283
00284
00285 }
00286
00287
00288
00289
00290 void
00291 StEemcTriggerSimu::compareTRG2_TRG3(){
00292
00293 int outEndcapJP2bit = dsm2TreeTRG->getOutEndcapJP2bit();
00294 int inpEndcapJP2bit = dsm3TRG->getEndcapJPthr2bit();
00295 int chan=0;
00296
00297 hA[600]->Fill(chan,inpEndcapJP2bit);
00298 hA[601]->Fill(chan,outEndcapJP2bit);
00299
00300 if( outEndcapJP2bit != inpEndcapJP2bit){
00301 printf("!!! BAD EndcapJP2bit out2 = %d, inp3 = %d, diff=%d\n", outEndcapJP2bit, inpEndcapJP2bit, outEndcapJP2bit-inpEndcapJP2bit);
00302 hA[602]->Fill(chan,inpEndcapJP2bit-outEndcapJP2bit);
00303 hA[603]->Fill(chan);
00304 }
00305
00306 int outEndcapHT2bit = dsm2TreeTRG->getOutEndcapHT2bit();
00307 int inpEndcapHT2bit = dsm3TRG->getEndcapHTthr2bit();
00308 chan=1;
00309
00310 hA[600]->Fill(chan,inpEndcapHT2bit);
00311 hA[601]->Fill(chan,outEndcapHT2bit);
00312
00313 if( outEndcapHT2bit != inpEndcapHT2bit){
00314 printf("!!! BAD EndcapHT2bit out2 = %d, inp3 = %d, diff=%d\n", outEndcapHT2bit, inpEndcapHT2bit, outEndcapHT2bit-inpEndcapHT2bit);
00315 hA[602]->Fill(chan,inpEndcapHT2bit-outEndcapHT2bit);
00316 hA[603]->Fill(chan);
00317 }
00318
00319 int outEndcapSum1bit = dsm2TreeTRG->getOutEndcapSum1bit();
00320 int inpEndcapSum1bit = dsm3TRG->getEndcapEsumthr1bit();
00321 chan=2;
00322
00323 hA[600]->Fill(chan,inpEndcapSum1bit);
00324 hA[601]->Fill(chan,outEndcapSum1bit);
00325
00326
00327 if( outEndcapSum1bit != inpEndcapSum1bit){
00328 printf("!!! BAD EndcapSum1bit out2 = %d, inp3 = %d, diff=%d\n", outEndcapSum1bit, inpEndcapSum1bit, outEndcapSum1bit-inpEndcapSum1bit);
00329 hA[602]->Fill(chan,inpEndcapSum1bit-outEndcapSum1bit);
00330 hA[603]->Fill(chan);
00331 }
00332
00333 int outEndcapHTTP1bit = dsm2TreeTRG->getOutEndcapHTTP1bit();
00334 int inpEndcapHTTP1bit = dsm3TRG->getEndcapHTTPthr1bit();
00335 chan=3;
00336
00337 hA[600]->Fill(chan,inpEndcapHTTP1bit);
00338 hA[601]->Fill(chan,outEndcapHTTP1bit);
00339
00340 if( outEndcapHTTP1bit != inpEndcapHTTP1bit){
00341 printf("!!! BAD EndcapHTTP1bit out2 = %d, inp3 = %d, diff=%d\n", outEndcapHTTP1bit, inpEndcapHTTP1bit, outEndcapHTTP1bit-inpEndcapHTTP1bit);
00342 hA[602]->Fill(chan,inpEndcapHTTP1bit-outEndcapHTTP1bit);
00343 hA[603]->Fill(chan);
00344 }
00345
00346 int outEndcapTP1bit = dsm2TreeTRG->getOutEndcapTP1bit();
00347 int inpEndcapTP1bit = dsm3TRG->getEndcapTPthr1bit();
00348 chan=4;
00349
00350 hA[600]->Fill(chan,inpEndcapTP1bit);
00351 hA[601]->Fill(chan,outEndcapTP1bit);
00352
00353 if( outEndcapTP1bit != inpEndcapTP1bit){
00354 printf("!!! BAD EndcapTP1bit out2 = %d, inp3 = %d, diff=%d\n", outEndcapTP1bit, inpEndcapTP1bit, outEndcapTP1bit-inpEndcapTP1bit);
00355 hA[602]->Fill(chan,inpEndcapTP1bit-outEndcapTP1bit);
00356 hA[603]->Fill(chan);
00357 }
00358
00359
00360 int outBarreJP2bit = dsm2TreeTRG->getOutBarreJP2bit();
00361 int inpBarreJP2bit = dsm3TRG->getBarreJPthr2bit();
00362 int ch=0;
00363
00364 hA[610]->Fill(ch,inpBarreJP2bit);
00365 hA[611]->Fill(ch,outBarreJP2bit);
00366
00367 if( outBarreJP2bit != inpBarreJP2bit){
00368 printf("!!! BAD BarreJP2bit out2 = %d, inp3 = %d, diff=%d\n", outBarreJP2bit, inpBarreJP2bit, outBarreJP2bit-inpBarreJP2bit);
00369 hA[612]->Fill(ch,inpBarreJP2bit-outBarreJP2bit);
00370 hA[613]->Fill(ch);
00371 }
00372
00373 int outBarreHT2bit = dsm2TreeTRG->getOutBarreHT2bit();
00374 int inpBarreHT2bit = dsm3TRG->getBarreHTthr2bit();
00375 ch=1;
00376
00377 hA[610]->Fill(ch,inpBarreHT2bit);
00378 hA[611]->Fill(ch,outBarreHT2bit);
00379
00380 if( outBarreHT2bit != inpBarreHT2bit){
00381 printf("!!! BAD BarreHT2bit out2 = %d, inp3 = %d, diff=%d\n", outBarreHT2bit, inpBarreHT2bit, outBarreHT2bit-inpBarreHT2bit);
00382 hA[612]->Fill(ch,inpBarreHT2bit-outBarreHT2bit);
00383 hA[613]->Fill(ch);
00384 }
00385
00386 int outBarreSum1bit = dsm2TreeTRG->getOutBarreSum1bit();
00387 int inpBarreSum1bit = dsm3TRG->getBarreEsumThr1bit();
00388 ch=2;
00389
00390 hA[610]->Fill(ch,inpBarreSum1bit);
00391 hA[611]->Fill(ch,outBarreSum1bit);
00392
00393 if( outBarreSum1bit != inpBarreSum1bit){
00394 printf("!!! BAD BarreSum1bit out2 = %d, inp3 = %d, diff=%d\n", outBarreSum1bit, inpBarreSum1bit, outBarreSum1bit-inpBarreSum1bit);
00395 hA[612]->Fill(ch,inpBarreSum1bit-outBarreSum1bit);
00396 hA[613]->Fill(ch);
00397 }
00398
00399 int outBarreHTTP1bit = dsm2TreeTRG->getOutBarreHTTP1bit();
00400 int inpBarreHTTP1bit = dsm3TRG->getBarreHTTPthr1bit();
00401 ch=3;
00402
00403 hA[610]->Fill(ch,inpBarreHTTP1bit);
00404 hA[611]->Fill(ch,outBarreHTTP1bit);
00405
00406 if( outBarreHTTP1bit != inpBarreHTTP1bit){
00407 printf("!!! BAD BarreHTTP1bit out2 = %d, inp3 = %d, diff=%d\n", outBarreHTTP1bit, inpBarreHTTP1bit, outBarreHTTP1bit-inpBarreHTTP1bit);
00408 hA[612]->Fill(ch,inpBarreHTTP1bit-outBarreHTTP1bit);
00409 hA[613]->Fill(ch);
00410 }
00411
00412 int outBarreTP1bit = dsm2TreeTRG->getOutBarreTP1bit();
00413 int inpBarreTP1bit = dsm3TRG->getBarreTPthr1bit();
00414 ch=4;
00415
00416 hA[610]->Fill(ch,inpBarreTP1bit);
00417 hA[611]->Fill(ch,outBarreTP1bit);
00418
00419 if( outBarreTP1bit != inpBarreTP1bit){
00420 printf("!!! BAD BarreTP1bit out2 = %d, inp3 = %d, diff=%d\n", outBarreTP1bit, inpBarreTP1bit, outBarreTP1bit-inpBarreTP1bit);
00421 hA[612]->Fill(ch,inpBarreTP1bit-outBarreTP1bit);
00422 hA[613]->Fill(ch);
00423 }
00424 #if 0
00425 int outBarreJPSi1bit = dsm2TreeTRG->getOutBarreJPSi1bit();
00426 int inpBarreJPSi1bit = dsm3TRG->getJpsi1bit();
00427
00428 if( outBarreJPSi1bit != inpBarreJPSi1bit){
00429 printf("!!! BAD BarreJPSi1bit out2 = %d, inp3 = %d, diff=%d\n", outBarreJPSi1bit, inpBarreJPSi1bit, outBarreJPSi1bit-inpBarreJPSi1bit);
00430 }
00431
00432 #endif
00433 int outEtot1bit = dsm2TreeTRG->getOutEtot1bit();
00434 int inpEtot1bit = dsm3TRG->getEtotThr1bit();
00435 int cha=0;
00436
00437 hA[620]->Fill(cha,inpEtot1bit);
00438 hA[621]->Fill(cha,outEtot1bit);
00439
00440 if( outEtot1bit != outEtot1bit){
00441 printf("!!! BAD Etot1bit out2 = %d, inp3 = %d, diff=%d\n", outEtot1bit, inpEtot1bit, outEtot1bit-inpEtot1bit);
00442 hA[622]->Fill(cha,inpEtot1bit-outEtot1bit);
00443 hA[623]->Fill(cha);
00444 }
00445
00446 int outBarreSum = dsm2TreeTRG->getIntBarreSum();
00447 if ( (outBarreSum<76) && (outBarreSum>64) ){
00448 hA[690]->Fill(cha, outBarreSum);
00449 }
00450 }
00451
00452
00453
00454 void
00455 StEemcTriggerSimu::compareADC0_TRG1(){
00456
00457 int ch;
00458
00459 bool isGood=true;
00460 for(ch=0;ch<12;ch++) {
00461
00462 int inpTrgTPsum=dsm1TreeTRG->getInpTPsum(ch);
00463 int emuTrgTPsum=dsm0TreeADC->getOutTPsum(ch);
00464
00465
00466 hA[154]->Fill(ch, emuTrgTPsum);
00467
00468 if(inpTrgTPsum!=emuTrgTPsum) {
00469 hA[155]->Fill(ch, emuTrgTPsum-inpTrgTPsum);
00470 hA[158]->Fill(ch, emuTrgTPsum-inpTrgTPsum);
00471 hA[156]->Fill(ch);
00472
00473 if(!mMCflag) printf("BaD TPsum(ch=%d) emu-out0=%d inp1=%d del=%d\n", ch, emuTrgTPsum, inpTrgTPsum, emuTrgTPsum-inpTrgTPsum );
00474 isGood=false;
00475 }
00476
00477 int inpTrgHT=dsm1TreeTRG->getInpHT2bit(ch);
00478 int emuTrgHT=dsm0TreeADC->getOutHT2bit(ch);
00479
00480
00481 hA[164]->Fill(ch, emuTrgHT);
00482
00483 if(inpTrgHT!=emuTrgHT) {
00484 hA[165]->Fill(ch, emuTrgHT-inpTrgHT);
00485 hA[166]->Fill(ch);
00486
00487 isGood=false;
00488 if(!mMCflag) printf("BaD HT2bit(ch=%d) emu-out0=%d inp1=%d del=%d\n",ch, emuTrgHT, inpTrgHT, emuTrgHT-inpTrgHT );
00489 }
00490
00491 int inpTrgHTTP=dsm1TreeTRG->getInpHTTP2bit(ch);
00492 int emuTrgHTTP=dsm0TreeADC->getOutHTTP2bit(ch);
00493
00494
00495 hA[174]->Fill(ch, emuTrgHTTP);
00496
00497 if(inpTrgHTTP!=emuTrgHTTP) {
00498 hA[175]->Fill(ch, emuTrgHTTP-inpTrgHTTP);
00499 hA[176]->Fill(ch);
00500
00501 isGood=false;
00502 if(!mMCflag) printf("BaD HTTP2bit(ch=%d) emu-out0=%d inp1=%d del=%d\n", ch, emuTrgHTTP, inpTrgHTTP, emuTrgHTTP-inpTrgHTTP );
00503 }
00504
00505 int inpTrgTP=dsm1TreeTRG->getInpTP2bit(ch);
00506 int emuTrgTP=dsm0TreeADC->getOutTP2bit(ch);
00507
00508
00509 hA[184]->Fill(ch, emuTrgTP);
00510
00511 if(inpTrgTP!=emuTrgTP) {
00512 hA[185]->Fill(ch, emuTrgTP-inpTrgTP);
00513 hA[186]->Fill(ch);
00514
00515 isGood=false;
00516 if(!mMCflag) printf("BaD TP2bit(ch=%d) emu-out0=%d inp1=%d del=%d\n", ch, emuTrgTP, inpTrgTP, emuTrgTP-inpTrgTP );
00517 }
00518
00519 }
00520
00521 if(!isGood) {
00522
00523
00524 printf("!!!\n");
00525 }
00526
00527 }
00528
00529
00530
00531 void
00532 StEemcTriggerSimu::compareADC1_TRG2(){
00533
00534 int ibr=0;
00535 int ch;
00536 int outJPdiff[2],outHTdiff[2],outHTTPdiff[2],outTPdiff[2];
00537 int inpJPdiff[2],inpHTdiff[2],inpHTTPdiff[2],inpTPdiff[2];
00538
00539 for(ch=0;ch<2;ch++) {
00540
00541 int outJP=dsm1TreeADC->getOutJP2bit(ch);
00542 int inpJP=dsm2TreeTRG->getInpJP2bit(ibr,ch);
00543
00544 outJPdiff[ch]=outJP;
00545 inpJPdiff[ch]=inpJP;
00546
00547
00548
00549
00550
00551 hA[514]->Fill(ch, outJP);
00552
00553 if(outJP!=inpJP) {
00554
00555
00556
00557
00558 hA[515]->Fill(ch, outJP-inpJP);
00559 hA[516]->Fill(ch);
00560
00561 if(!mMCflag) printf("BaD 3JP JP2bit(ch=%d) emu-out1=%d inp2=%d diff=%d\n",ch, outJP,inpJP,outJP-inpJP);
00562
00563 }
00564
00565 int outHT=dsm1TreeADC->getOutHT2bit(ch);
00566 int inpHT=dsm2TreeTRG->getInpHT2bit(ibr,ch);
00567
00568 outHTdiff[ch]=outHT;
00569 inpHTdiff[ch]=inpHT;
00570
00571
00572
00573
00574 hA[514]->Fill(ch+3, outHT);
00575
00576 if(outHT!=inpHT) {
00577
00578
00579
00580 hA[515]->Fill(ch+3, outHT-inpHT);
00581 hA[516]->Fill(ch+3);
00582
00583 if(!mMCflag) printf("BaD 3JP HT2bit(ch=%d) emu-out1=%d inp2=%d diff=%d\n",ch, outHT,inpHT,outHT-inpHT);
00584
00585 }
00586
00587 int outHTTP=dsm1TreeADC->getOutHTTP1bit(ch);
00588 int inpHTTP=dsm2TreeTRG->getInpHTTP1bit(ibr,ch);
00589
00590 outHTTPdiff[ch]=outHTTP;
00591 inpHTTPdiff[ch]=inpHTTP;
00592
00593
00594
00595
00596 hA[514]->Fill(ch+6, outHTTP);
00597
00598 if(outHTTP!=inpHTTP) {
00599
00600
00601
00602
00603 hA[515]->Fill(ch+6, outHTTP-inpHTTP);
00604 hA[516]->Fill(ch+6);
00605
00606 if(!mMCflag) printf("BaD 3JP HTTP1bit(ch=%d) emu-out1=%d inp2=%d diff=%d\n",ch, outHTTP,inpHTTP,outHTTP-inpHTTP);
00607
00608 }
00609
00610 int outTP=dsm1TreeADC->getOutTP1bit(ch);
00611 int inpTP=dsm2TreeTRG->getInpTP1bit(ibr,ch);
00612
00613 outTPdiff[ch]=outTP;
00614 inpTPdiff[ch]=inpTP;
00615
00616
00617
00618
00619 hA[514]->Fill(ch+9, outTP);
00620
00621 if(outTP!=inpTP) {
00622
00623
00624
00625
00626 hA[515]->Fill(ch+9, outTP-inpTP);
00627 hA[516]->Fill(ch+9);
00628
00629 if(!mMCflag) printf("BaD 3JP TP1bit(ch=%d) emu-out1=%d inp2=%d diff=%d\n",ch, outTP,inpTP,outTP-inpTP);
00630
00631 }
00632
00633 }
00634
00635
00636
00637 for(ibr=0;ibr<EMCdsm2Tree::Nbe2;ibr++) {
00638 for(ch=0;ch<2;ch++) {
00639 int jch = 2*ibr+ch;
00640 int outE = dsm2TreeADC->getInpEsum5bit(ibr,ch);
00641 int inpE = dsm2TreeTRG->getInpEsum5bit(ibr,ch);
00642
00643 hA[500]->Fill(jch, inpE);
00644 hA[504]->Fill(jch, outE);
00645
00646 if(outE!=inpE) {
00647 hA[505]->Fill(jch, outE-inpE);
00648 hA[506]->Fill(jch);
00649 if(!mMCflag) printf("BaD Esum5bit(ibr=%d,ch=%d) adcOut1=%d trgInp2=%d diff=%d\n",ibr,ch, outE,inpE,outE-inpE);
00650 }
00651 }
00652 }
00653 }
00654
00655
00656
00657 void
00658 StEemcTriggerSimu::compareADC2_TRG3(){
00659
00660 int outEtot=dsm2TreeADC->getOutEtot1bit();
00661 int inpEtot=dsm3TRG->getEtotThr1bit();
00662
00663 int ch=0;
00664
00665
00666 hA[624]->Fill(ch, outEtot);
00667
00668 if(outEtot!=inpEtot){
00669
00670 hA[625]->Fill(ch, outEtot-inpEtot);
00671 hA[626]->Fill(ch);
00672
00673 if(!mMCflag) printf("BaD Etot 1bit emu-out2=%d inp3=%d, diff=%d\n", outEtot, inpEtot, outEtot-inpEtot);
00674 }
00675 }
00676
00677
00678
00679 void
00680 StEemcTriggerSimu::DSM2EsumSpectra(){
00681
00682 int BarreEsum = dsm2TreeTRG->getIntBarreSum();
00683 int adcBarreEsum = dsm2TreeADC->getIntBarreSum();
00684
00685
00686
00687 hA[550]->Fill(BarreEsum);
00688 hA[560]->Fill(BarreEsum);
00689 hA[551]->Fill(adcBarreEsum);
00690
00691 if(BarreEsum!=adcBarreEsum){
00692 int chB=1;
00693 hA[556]->Fill(chB);
00694 }
00695
00696 int EndcapEsum = dsm2TreeTRG->getIntEndcapSum();
00697 int adcEndcapEsum = dsm2TreeADC->getIntEndcapSum();
00698
00699
00700
00701 hA[552]->Fill(EndcapEsum);
00702 hA[562]->Fill(EndcapEsum);
00703 hA[553]->Fill(adcEndcapEsum);
00704
00705 if(EndcapEsum!=adcEndcapEsum){
00706 int chE=4;
00707 hA[556]->Fill(chE);
00708 }
00709
00710 int Etot = dsm2TreeTRG->getIntEtot();
00711 int adcEtot = dsm2TreeADC->getIntEtot();
00712
00713 hA[554]->Fill(Etot);
00714 hA[564]->Fill(Etot);
00715 hA[555]->Fill(adcEtot);
00716
00717 if(Etot!=adcEtot){
00718 int chT=7;
00719 hA[556]->Fill(chT);
00720 }
00721
00722 }
00723
00724
00725
00726
00727
00728
00729
00730
00731