--- eventviewer/flight/src/FEVdetector.cpp 2007/11/08 11:05:34 1.21 +++ eventviewer/flight/src/FEVdetector.cpp 2008/05/23 15:54:28 1.26 @@ -1016,17 +1016,18 @@ // if ( level.file == 2 ){ cintcom.str(""); - cintcom << "PamLevel2 *L2 = (PamLevel2*)0x" << hex; + cintcom << "PamLevel2 *L2 = (PamLevel2*)" << hex; //con const e l2 funziona cintcom << L2; gROOT->ProcessLine(cintcom.str().c_str()); + // printf(" comando: %s \n",cintcom.str().c_str()); } else { cintcom.str(""); - cintcom << "TTree *otr = (TTree*)0x" << hex; + cintcom << "TTree *otr = (TTree*)" << hex; cintcom << otr; gROOT->ProcessLine(cintcom.str().c_str()); // cintcom.str(""); - cintcom << "struct Variables &var = (struct Variables &)0x" << hex; + cintcom << "struct Variables &var = (struct Variables &)" << hex; cintcom << &var; gROOT->ProcessLine(cintcom.str().c_str()); }; @@ -1448,10 +1449,10 @@ text->DrawLatex(var.xxvc+0.17*var.sfx,var.yxvc-0.08*var.sfy,"CAS1"); text->DrawLatex(var.xyvc-0.192*var.sfx,var.yyvc-0.08*var.sfy,"CAS4"); text->DrawLatex(var.xyvc+0.17*var.sfx,var.yyvc-0.08*var.sfy,"CAS3"); - text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); - text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); - text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); - text->DrawLatex(var.xyvc+0.13*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); + text->DrawLatex(var.xxvc-0.222*var.sfx,var.yxvc+0.48*var.sfy,"CARD2"); + text->DrawLatex(var.xxvc+0.185*var.sfx,var.yxvc+0.48*var.sfy,"CARD3"); + text->DrawLatex(var.xyvc-0.190*var.sfx,var.yyvc+0.48*var.sfy,"CARD1"); + text->DrawLatex(var.xyvc+0.16*var.sfx,var.yyvc+0.48*var.sfy,"CARD4"); text->DrawLatex(var.xxvc-0.192*var.sfx,var.yxvc+0.39*var.sfy,"CAT3"); text->DrawLatex(var.xxvc+0.155*var.sfx,var.yxvc+0.39*var.sfy,"CAT4"); text->DrawLatex(var.xyvc-0.170*var.sfx,var.yyvc+0.39*var.sfy,"CAT2"); @@ -1579,6 +1580,7 @@ // // print infos on terminal // + // if ( !var.selex ){ printf(" File: %s \n",var.thefilename.Data()); if ( !s4pulser && !calotrig ){ printf(" Pkt_num: %i - Progressive number: %i \n",(int)headc,thisentry+1); @@ -1589,7 +1591,7 @@ if ( calotrig ){ printf(" Pkt_num: %i - Progressive number: %i - CALO trigger -\n",(int)headc,thisentry+1); }; - printf(" On Board Time: %i (delta %i) [ms]\n",OBT,DOBT); + printf(" On Board Time: %u (delta %i) [ms]\n",OBT,DOBT); const char *trc2 = trcs; printf(" TRIGGER: %s \n",trc2); printf(" AC: CARD hit = %i CAT hit = %i CAS hit = %i \n",var.hcard,var.hcat,var.hcas); @@ -1601,6 +1603,7 @@ printf(" CALO: NSTRIP = %i QTOT = %i [MIP]\n",var.nstrip,var.qtot); printf(" S4: %.2f [MIP] TOF: beta = %.2f \n",var.s4sig,var.beta[4]); printf(" ND: Trigger: neutrons = %i - Background: upper = %i lower = %i \n",var.trup,var.bkup,var.bkbo); + // }; // } @@ -1911,6 +1914,7 @@ if ( !var.TOF ) return; // Int_t tt = 0; + Int_t rj = 0; // // force level0, i.e. show patterntrig variable! // @@ -2104,7 +2108,9 @@ Float_t s12p = 0.055; ocolo = 10; TPolyLine *ftof12ya[6]; + rj=6; for ( Int_t j=0; j<6; j++){ + rj--; Float_t xc1[4]={ (s12p*j), s12p*(j), s12p*(j+1), (s12p*j)}; Float_t yc1[4]={ -ws13, 0., 0., -ws13}; Float_t xc[4]; @@ -2120,10 +2126,10 @@ } else { colo = 1; }; - ColorMIP(ms12a[j],colo); + ColorMIP(ms12a[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt12[0][j] == 4095. ) colo = noadc; + if ( mt12[0][rj] == 4095. ) colo = noadc; // ftof12ya[j]->SetFillColor(colo); ftof12ya[j]->SetLineWidth(1); @@ -2133,7 +2139,9 @@ // B s12p = 0.055; TPolyLine *ftof12yb[6]; + rj=6; for ( Int_t j=0; j<6; j++){ + rj--; Float_t xc1[4]={ (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; Float_t xc[4]; @@ -2149,10 +2157,10 @@ } else { colo = 1; }; - ColorMIP(ms12b[j],colo); + ColorMIP(ms12b[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt12[1][j] == 4095. ) colo = noadc; + if ( mt12[1][rj] == 4095. ) colo = noadc; // ftof12yb[j]->SetFillColor(colo); ftof12yb[j]->SetLineWidth(1); @@ -2186,7 +2194,9 @@ Float_t s21p = 0.075; ocolo = 10; TPolyLine *ftof21ya[2]; + rj=2; for ( Int_t j=0; j<2; j++){ + rj--; Float_t xc1[4]={ s21p*(j-1), s21p*(j-1), s21p*j, s21p*(j-1)}; Float_t yc1[4]={ 0., ws2, ws2, 0.}; Float_t xc[4]; @@ -2202,10 +2212,10 @@ } else { colo = 1; }; - ColorMIP(ms21a[j],colo); + ColorMIP(ms21a[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt21[0][j] == 4095. ) colo = noadc; + if ( mt21[0][rj] == 4095. ) colo = noadc; // ftof21ya[j]->SetFillColor(colo); ftof21ya[j]->SetLineWidth(1); @@ -2215,7 +2225,9 @@ // B s21p = 0.075; TPolyLine *ftof21yb[2]; + rj=2; for ( Int_t j=0; j<2; j++){ + rj--; Float_t xc1[4]={ s21p*(j-1), s21p*j, s21p*j, s21p*(j-1)}; Float_t yc1[4]={ 0., 0., ws2, 0.}; Float_t xc[4]; @@ -2231,10 +2243,10 @@ } else { colo = 1; }; - ColorMIP(ms21b[j],colo); + ColorMIP(ms21b[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt21[1][j] == 4095. ) colo = noadc; + if ( mt21[1][rj] == 4095. ) colo = noadc; // ftof21yb[j]->SetFillColor(colo); ftof21yb[j]->SetLineWidth(1); @@ -2349,7 +2361,9 @@ Float_t s31p = 0.060; ocolo = 10; TPolyLine *ftof31xa[3]; + rj=3; for ( Int_t j=0; j<3; j++){ + rj--; Float_t xc1[4]={ (s31p*j), (s31p*j), s31p*(j+1), (s31p*j)}; Float_t yc1[4]={ 0., ws13, ws13, 0.}; Float_t xc[4]; @@ -2365,10 +2379,10 @@ } else { colo = 1; }; - ColorMIP(ms31a[j],colo); + ColorMIP(ms31a[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt31[0][j] == 4095. ) colo = noadc; + if ( mt31[0][rj] == 4095. ) colo = noadc; // ftof31xa[j]->SetFillColor(colo); ftof31xa[j]->SetLineWidth(1); @@ -2378,7 +2392,9 @@ // B s31p = 0.060; TPolyLine *ftof31xb[3]; + rj=3; for ( Int_t j=0; j<3; j++){ + rj--; Float_t xc1[4]={ (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; Float_t yc1[4]={ 0., 0., ws13, 0.}; Float_t xc[4]; @@ -2394,10 +2410,10 @@ } else { colo = 1; }; - ColorMIP(ms31b[j],colo); + ColorMIP(ms31b[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt31[1][j] == 4095. ) colo = noadc; + if ( mt31[1][rj] == 4095. ) colo = noadc; // ftof31xb[j]->SetFillColor(colo); ftof31xb[j]->SetLineWidth(1); @@ -2429,7 +2445,9 @@ Float_t s32p = 0.050; ocolo = 10; TPolyLine *ftof32ya[3]; + rj=3; for ( Int_t j=0; j<3; j++){ + rj--; Float_t xc1[4]={ (s32p*j), (s32p*j), s32p*(j+1), (s32p*j)}; Float_t yc1[4]={ -ws13, 0., 0., -ws13}; Float_t xc[4]; @@ -2445,10 +2463,10 @@ } else { colo = 1; }; - ColorMIP(ms32a[j],colo); + ColorMIP(ms32a[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt32[0][j] == 4095. ) colo = noadc; + if ( mt32[0][rj] == 4095. ) colo = noadc; // ftof32ya[j]->SetFillColor(colo); ftof32ya[j]->SetLineWidth(1); @@ -2457,7 +2475,9 @@ }; s32p = 0.050; TPolyLine *ftof32yb[3]; + rj=3; for ( Int_t j=0; j<3; j++){ + rj--; Float_t xc1[4]={ (s32p*j), s32p*(j+1), s32p*(j+1), (s32p*j)}; Float_t yc1[4]={ -ws13, -ws13, 0., -ws13}; Float_t xc[4]; @@ -2473,10 +2493,10 @@ } else { colo = 1; }; - ColorMIP(ms32b[j],colo); + ColorMIP(ms32b[rj],colo); // if ( colo != 10 ) ocolo = colo; - if ( mt32[1][j] == 4095. ) colo = noadc; + if ( mt32[1][rj] == 4095. ) colo = noadc; // ftof32yb[j]->SetFillColor(colo); ftof32yb[j]->SetLineWidth(1); @@ -2920,15 +2940,20 @@ ftof11y->Draw(); TPolyLine *sftof11[8]; tt = 1; - if ( level.file == -1 ) tt = 8; + rj=1; + if ( level.file == -1 ){ + tt = 8; + rj = 8; + }; for ( Int_t j=0; j 0.164 ) higp = 0.164; - if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[j] != 0.))){ + if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp11[rj] != 0.))){ Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; Float_t nxc[5]; @@ -2953,7 +2978,9 @@ Float_t s12p = 0.055; ocolo = 10; TPolyLine *ftof12y[6]; + rj = 6; for ( Int_t j=0; j<6; j++){ + rj--; Float_t nxc1[5]={ (s12p*j), (s12p*j), s12p*(j+1), s12p*(j+1), (s12p*j)}; Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; Float_t nxc[5]; @@ -2970,9 +2997,9 @@ colo = 1; }; if ( level.file == -1 ){ - ColorMIP(ms12a[j]+ms12b[j],colo); + ColorMIP(ms12a[rj]+ms12b[rj],colo); } else { - ColorTOFMIP(ms12a[j]+ms12b[j],colo); + ColorTOFMIP(ms12a[rj]+ms12b[rj],colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3039,7 +3066,9 @@ Float_t s21p = 0.075; ocolo = 10; TPolyLine *ftof21y[2]; + rj=2; for ( Int_t j=0; j<2; j++){ + rj--; Float_t nxc1[5]={ s21p*(j-1), s21p*(j-1), s21p*j,s21p*j, s21p*(j-1)}; Float_t nyc1[5]={ 0., ws2, ws2, 0., 0.}; Float_t nxc[5]; @@ -3056,9 +3085,9 @@ colo = 1; }; if ( level.file == -1 ){ - ColorMIP(ms21a[j]+ms21b[j],colo); + ColorMIP(ms21a[rj]+ms21b[rj],colo); } else { - ColorTOFMIP(ms21a[j]+ms21b[j],colo); + ColorTOFMIP(ms21a[rj]+ms21b[rj],colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3175,16 +3204,21 @@ ftof22y->Draw(); TPolyLine *sftof22[2]; tt = 1; - if ( level.file == -1 ) tt = 2; + rj = 1; + if ( level.file == -1 ){ + tt = 2; + rj = 2; + }; for (Int_t j=0; j 0.074 ) higp = 0.074; - if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[j] != 0.))){ + if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp22[rj] != 0.))){ Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; Float_t nyc1[5]={ -0.0015, -0.0015, -ws2+0.0015, -ws2+0.0015, -0.0015}; Float_t nxc[5]; @@ -3204,7 +3238,7 @@ }; }; // - + //daquiinbasso // // S31 X-view // @@ -3261,16 +3295,21 @@ ftof31y->Draw(); TPolyLine *sftof31[3]; tt = 1; - if ( level.file == -1 ) tt = 3; + rj = 1; + if ( level.file == -1 ){ + tt = 3; + rj = 3; + }; for (Int_t j=0; j 0.074 ) higp = 0.074; - if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[j] != 0.))){ + if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp31[rj] != 0.))){ Float_t nxc1[5]={ lowp, higp, higp, lowp, lowp}; Float_t nyc1[5]={ 0.0015, 0.0015, ws13-0.0015, ws13-0.0015, 0.0015}; Float_t nxc[5]; @@ -3297,7 +3336,9 @@ Float_t s32p = 0.050; ocolo = 10; TPolyLine *ftof32y[3]; + rj = 3; for ( Int_t j=0; j<3; j++){ + rj--; Float_t nxc1[5]={ (s32p*j), (s32p*j), s32p*(j+1),s32p*(j+1), (s32p*j)}; Float_t nyc1[5]={ -ws13, 0., 0., -ws13, -ws13}; Float_t nxc[5]; @@ -3314,9 +3355,9 @@ colo = 1; }; if ( level.file == -1 ){ - ColorMIP(ms32a[j]+ms32b[j],colo); + ColorMIP(ms32a[rj]+ms32b[rj],colo); } else { - ColorTOFMIP(ms32a[j]+ms32b[j],colo); + ColorTOFMIP(ms32a[rj]+ms32b[rj],colo); }; // if ( colo != 10 ) ocolo = colo; @@ -5030,9 +5071,9 @@ for (Int_t m = 0; m<3; m++){ if ( trk->signcluster[l][m] != 0. ){ if ( planeno == 10 ) { - x = 1024 - trk->addrcluster[l][m]; - } else { x = trk->addrcluster[l][m]; + } else { + x = 1024 - trk->addrcluster[l][m]; }; linea = new TLine(14.+x,0.01,14.+x,0.3); linea->SetLineWidth(2); @@ -5102,7 +5143,7 @@ trkpad[planepad]->cd(); trkpad[planepad]->Range(-7.05,0.,7.05,8.); for (Int_t img=0; img<2; img++){ - x = singlet->coord[img]; + x = -singlet->coord[img]; Float_t xsig = singlet->sgnl; if ( xsig > 8. ) xsig = 8.; // @@ -5159,7 +5200,7 @@ // x = track->xm[plane]; Float_t xsig = track->dedx_x[plane]; - if ( track->xgood[plane] ){ + if ( track->XGood(plane) ){ //if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; if ( var.bw ){ @@ -5187,9 +5228,9 @@ planepad = plane * 2; trkpad[planepad]->cd(); trkpad[planepad]->Range(-7.05,0.,7.05,8.); - x = track->ym[plane]; + x = -track->ym[plane]; xsig = track->dedx_y[plane]; - if ( track->ygood[plane] ){ + if ( track->YGood(plane) ){ // if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; if ( var.bw ){ @@ -5249,11 +5290,11 @@ for (Int_t plane = 0; plane<6; plane++){ // x = track->xm[plane]; - Float_t y = track->ym[plane]; + Float_t y = -track->ym[plane]; Float_t xsig = track->dedx_x[plane]; Float_t ysig = track->dedx_y[plane]; // if ( x > -100 && y > -100. ){ - if ( track->xgood[plane] && track->ygood[plane] ){ + if ( track->XGood(plane) && track->YGood(plane) ){ if ( var.bw ){ sigcol1 = -1; sigcol2 = -1; @@ -5371,8 +5412,8 @@ for (Int_t sing = 0; sing < min(totsx,totsy); sing++){ // x = arrax->At(orderx->At(sing)); - Float_t y1 = array1->At(ordery->At(sing)); - Float_t y2 = array2->At(ordery->At(sing)); + Float_t y1 = -array1->At(ordery->At(sing)); + Float_t y2 = -array2->At(ordery->At(sing)); Float_t xsig = sigarrax->At(orderx->At(sing)); Float_t ysig = sigarray->At(ordery->At(sing)); if ( x > -100 && y1 > -100. ){ @@ -5465,14 +5506,14 @@ for (Int_t m = 0; m<3; m++){ if ( trk->signcluster[l][m] != 0. ){ if ( planeno == 10 ) { - x = 1024 - trk->addrcluster[l][m]; - } else { x = trk->addrcluster[l][m]; + } else { + x = 1024 - trk->addrcluster[l][m]; }; x += 1024.; if ( trk->signcluster[l][m]> ysig ){ ysig = trk->signcluster[l][m]; - yh1[ncro] = x-1024.; + yh1[ncro] = x - 1024.; yh2[ncro] = x; }; }; @@ -5500,14 +5541,14 @@ for (Int_t m = 0; m<3; m++){ if ( trk->signcluster[e][m] != 0. ){ if ( planeno == 10 ) { - x = 1024 - trk->addrcluster[e][m]; - } else { x = trk->addrcluster[e][m]; + } else { + x = 1024 - trk->addrcluster[e][m]; }; x += 1024.; if ( trk->signcluster[e][m]> ysig ){ ysig = trk->signcluster[e][m]; - yh1[ncro] = x-1024.; + yh1[ncro] = x - 1024.; yh2[ncro] = x; }; }; @@ -5580,7 +5621,7 @@ }; for (Int_t plane = 0; plane < 22; plane++){ calx[plane] = (L2->GetCaloLevel2()->cbar[plane][0]/100.)*var.sfx + var.xxvc;; - caly[plane] = (L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; + caly[plane] = (-L2->GetCaloLevel2()->cbar[plane][1]/100.)*var.sfx + var.xyvc; // calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; calzx[plane] = zpiano[plane] + var.yxvc; calzy[plane] = zpiano[plane] + var.yyvc; @@ -5629,7 +5670,7 @@ // for (Int_t plane = 0; plane < 22; plane++){ calx[plane] = (ctra->tbar[plane][0]/100.)*var.sfx + var.xxvc;; - caly[plane] = (ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; + caly[plane] = (-ctra->tbar[plane][1]/100.)*var.sfx + var.xyvc; // calzx[plane] = zpiano[plane] -5.81*var.sfy/1000. + var.yxvc; calzx[plane] = zpiano[plane] + var.yxvc; calzy[plane] = zpiano[plane] + var.yyvc; @@ -5721,17 +5762,17 @@ if ( !ifail ){ for ( Int_t e = 0; e < npoint ; e++) { tx[e] = ((float)tr->x[e]/100.)*var.sfx + var.xxvc; - ty[e] = ((float)tr->y[e]/100.)*var.sfx + var.xyvc; + ty[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xyvc; if ( e < 50 ) { - ptx1[e] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; + ptx1[e] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; pty1[e] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; } else { - ptx2[e-50] = ((float)tr->y[e]/100.)*var.sfx + var.xcat; + ptx2[e-50] = (-(float)tr->y[e]/100.)*var.sfx + var.xcat; pty2[e-50] = ((float)tr->x[e]/100.)*var.sfy + var.ycat; }; if ( e > 84 ) { tx1[e-85] = ((float)tr->x[e]/100.)*var.nds4 + var.xxvc; - ty1[e-85] = ((float)tr->y[e]/100.)*var.nds4 + var.xyvc; + ty1[e-85] = (-(float)tr->y[e]/100.)*var.nds4 + var.xyvc; tzx1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yxvc; tzy1[e-85] = (0.112)*var.sfy+((float)zin[e]/100.)*var.sfy + var.yyvc; }; @@ -5971,7 +6012,7 @@ Xview->Draw("box same"); }; if ( l == 1 ) { - Yview->Fill(n,21-m,1.); + Yview->Fill(95-n,21-m,1.); pd2->cd(); Yview->Draw("box same"); }; @@ -6200,7 +6241,7 @@ Xview->Draw("box same"); }; if ( l == 1 ) { - Yview->Fill(n,21-m,1.); + Yview->Fill(96-n,21-m,1.); pd2->cd(); Yview->Draw("box same"); }; @@ -6292,12 +6333,13 @@ Int_t l; Int_t m; Int_t n; - Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n); + Bool_t satura = false; + Float_t mip = L2->GetCaloLevel1()->DecodeEstrip(ii,l,m,n,satura); if ( var.bw ){ colo = -1; } else { colo = 1; - }; + }; ColorMIP(mip,colo); if ( l == 0 ) { xvev.str(""); @@ -6306,7 +6348,11 @@ xvev << " " << l; gDirectory->Delete(xvev.str().c_str()); TH2F *Xview = new TH2F(xvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); - Xview->SetFillColor(colo); + if ( satura ){ + Xview->SetFillColor(kBlack); + } else { + Xview->SetFillColor(colo); + }; Xview->Fill(n,21-m,1.); pd1->cd(); Xview->Draw("box same"); @@ -6318,8 +6364,12 @@ yvev << " " << l; gDirectory->Delete(yvev.str().c_str()); TH2F *Yview = new TH2F(yvev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); - Yview->SetFillColor(colo); - Yview->Fill(n,21-m,1.); + if ( satura ){ + Yview->SetFillColor(kBlack); + } else { + Yview->SetFillColor(colo); + }; + Yview->Fill(96-n,21-m,1.); pd2->cd(); Yview->Draw("box same"); };