--- eventviewer/flight/src/FEVdetector.cpp 2007/11/29 15:53:10 1.25 +++ eventviewer/flight/src/FEVdetector.cpp 2009/08/11 13:03:42 1.29 @@ -97,6 +97,10 @@ var.showac = false; } +void FEVdetector::Reset(){ + L2 = NULL; +} + void FEVdetector::checkctrlword(){ var.SHOWDEC = 0; var.TOF = 0; @@ -206,7 +210,7 @@ void FEVdetector::GetEntry(Int_t i){ thisentry = i; if ( level.file == 2 ){ - L2->Clear(); + // L2->Clear(); // printf("qui\n"); L2->GetEntry(i); if ( var.showall ){ @@ -394,14 +398,17 @@ Int_t dlen = 10; // char o[200000]; + char zz[200000]; char col[13]; char col2[13]; // setcolor(col,RESET, GREEN, WHITE); sprintf(o,"%s======> EVENT:%i\n",col, thisentry); + sprintf(zz,"======> EVENT:%i\n", thisentry); // setcolor(col,RESET, RED, WHITE); sprintf(o,"%s%sBranch %s\n",o,col,b1->GetName()); + sprintf(zz,"%sBranch %s\n",zz,b1->GetName()); setcolor(col,RESET, BLACK, WHITE); sprintf(o,"%s%s",o,col); // @@ -429,6 +436,7 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s =",o,col,((TBranch*)branch_array->At(l))->GetName(),col2); + sprintf(zz,"%s %-15s =",zz,((TBranch*)branch_array->At(l))->GetName()); // j = 0; // @@ -441,8 +449,10 @@ while ( j < length ){ if ( j < length -1 ){ sprintf(o,"%s %i ,",o,(Int_t)tb->GetValue(j,0)); + sprintf(zz,"%s %i ,",zz,(Int_t)tb->GetValue(j,0)); } else { sprintf(o,"%s %i",o,(Int_t)tb->GetValue(j,0)); + sprintf(zz,"%s %i",zz,(Int_t)tb->GetValue(j,0)); }; j++; }; @@ -454,8 +464,10 @@ while ( j < length ){ if ( j < length -1 ){ sprintf(o,"%s %u ,",o,(UInt_t)tb->GetValue(j,0)); + sprintf(zz,"%s %u ,",zz,(UInt_t)tb->GetValue(j,0)); } else { sprintf(o,"%s %u",o,(UInt_t)tb->GetValue(j,0)); + sprintf(zz,"%s %u",zz,(UInt_t)tb->GetValue(j,0)); }; j++; }; @@ -467,8 +479,10 @@ while ( j < length ){ if ( j < length -1 ){ sprintf(o,"%s %f ,",o,tb->GetValue(j,0)); + sprintf(zz,"%s %f ,",zz,tb->GetValue(j,0)); } else { sprintf(o,"%s %f",o,tb->GetValue(j,0)); + sprintf(zz,"%s %f",zz,tb->GetValue(j,0)); }; j++; }; @@ -503,6 +517,7 @@ // printf("ciao %s \n",pr->Data()); // }; sprintf(o,"%s TString - not implemented yet -",o); + sprintf(zz,"%s TString - not implemented yet -",zz); }; // // TArray @@ -603,10 +618,12 @@ // sprintf(o,"%s\n",o); // sprintf(o,"%s TArray - not implemented yet -",o); + sprintf(zz,"%s TArray - not implemented yet -",zz); // }; // sprintf(o,"%s\n",o); + sprintf(zz,"%s\n",zz); break; case 3: // @@ -615,6 +632,7 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s = %d\n",o,col,tb->GetName(), col2, tb->GetNdata()); + sprintf(zz,"%s %-15s = %d\n",zz,tb->GetName(), tb->GetNdata()); // if ( tb->GetNdata() ){ @@ -665,11 +683,14 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); + sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); while ( j < cl->GetEntriesFast() ){ if ( j < cl->GetEntriesFast() -1 ){ sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,slength)); + sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,slength)); } else { sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,slength)); + sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,slength)); }; j++; }; @@ -682,11 +703,14 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); + sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); while ( j < cl->GetEntriesFast() ){ if ( j < cl->GetEntriesFast() -1 ){ sprintf(o,"%s %f ,",o,stb->GetValue(j,slength)); + sprintf(zz,"%s %f ,",zz,stb->GetValue(j,slength)); } else { sprintf(o,"%s %f",o,stb->GetValue(j,slength)); + sprintf(zz,"%s %f",zz,stb->GetValue(j,slength)); }; j++; }; @@ -699,6 +723,7 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); + sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); Bool_t bold = true; while ( j < tb->GetNdata() ){ if ( bold ){ @@ -712,12 +737,15 @@ while ( jj < slength ){ if ( jj < slength-1 ){ sprintf(o,"%s %f ,",o,stb->GetValue(j,jj,true)); + sprintf(zz,"%s %f ,",zz,stb->GetValue(j,jj,true)); } else { sprintf(o,"%s %f",o,stb->GetValue(j,jj,true)); + sprintf(zz,"%s %f",zz,stb->GetValue(j,jj,true)); }; jj++; }; if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); + if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); if ( !bold ){ bold = true; } else { @@ -738,17 +766,21 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %-15s%s = ",o,col,foglia->GetName(),col2); + sprintf(zz,"%s %-15s = ",zz,foglia->GetName()); while ( j < tb->GetNdata() ){ Int_t jj = 0; while ( jj < slength ){ if ( jj < slength-1 ){ sprintf(o,"%s %i ,",o,(Int_t)stb->GetValue(j,jj,true)); + sprintf(zz,"%s %i ,",zz,(Int_t)stb->GetValue(j,jj,true)); } else { sprintf(o,"%s %i",o,(Int_t)stb->GetValue(j,jj,true)); + sprintf(zz,"%s %i",zz,(Int_t)stb->GetValue(j,jj,true)); }; jj++; }; if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); + if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); j++; }; }; @@ -781,6 +813,7 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); + sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); // while ( j < tb->GetNdata() ){ // @@ -791,12 +824,15 @@ while ( jj < arlen ){ if ( jj < arlen-1 ){ sprintf(o,"%s %i ,",o,arr->At(jj)); + sprintf(zz,"%s %i ,",zz,arr->At(jj)); } else { sprintf(o,"%s %i",o,arr->At(jj)); + sprintf(zz,"%s %i",zz,arr->At(jj)); }; jj++; }; if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); + if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); j++; }; }; @@ -814,6 +850,7 @@ setcolor(col,RESET, BLUE, WHITE); setcolor(col2,RESET, BLACK, WHITE); sprintf(o,"%s%s %s[%i]%s = ",o,col,foglia->GetName(),arr->GetSize(),col2); + sprintf(zz,"%s %s[%i] = ",zz,foglia->GetName(),arr->GetSize()); // while ( j < tb->GetNdata() ){ // @@ -824,17 +861,21 @@ while ( jj < arlen ){ if ( jj < arlen-1 ){ sprintf(o,"%s %f ,",o,arr->At(jj)); + sprintf(zz,"%s %f ,",zz,arr->At(jj)); } else { sprintf(o,"%s %f",o,arr->At(jj)); + sprintf(zz,"%s %f",zz,arr->At(jj)); }; jj++; }; if ( j < tb->GetNdata() -1 ) sprintf(o,"%s ,",o); + if ( j < tb->GetNdata() -1 ) sprintf(zz,"%s ,",zz); j++; }; }; }; sprintf(o,"%s\n",o); + sprintf(zz,"%s\n",zz); break; }; }; @@ -843,8 +884,8 @@ break; }; }; - // pamgui->DIALOG(0,o); printf("%s\n",o); + pamgui->DIALOG(4,zz); }; @@ -1016,17 +1057,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()); }; @@ -1057,15 +1099,15 @@ // if ( level.file == 2 ){ // - printf(" %s \n",ddec.Data()); + // printf(" %s \n",ddec.Data()); if ( !L2 ){ L2 = new PamLevel2("",file.Data(),ddec.Data()); otr = L2->GetPamTree(); - printf(" l2 constructor\n"); + // printf(" l2 constructor\n"); // printf(" abst %u obt %u qtot %f \n",L2->GetOrbitalInfo()->absTime,L2->GetOrbitalInfo()->OBT,L2->GetCaloLevel2()->qtot); } else { // - printf(" l2 already exist \n"); + // printf(" l2 already exist \n"); otr = L2->GetPamTree(gSystem->DirName(file.Data()),file.Data(),ddec.Data()); L2->GetRunTree(gSystem->DirName(file.Data()),file.Data()); // @@ -1943,6 +1985,13 @@ Float_t mt31[2][3]; Float_t mt32[2][3]; // + memset(mt11,0,2*8*sizeof(Float_t)); + memset(mt12,0,2*6*sizeof(Float_t)); + memset(mt21,0,2*2*sizeof(Float_t)); + memset(mt22,0,2*2*sizeof(Float_t)); + memset(mt31,0,2*3*sizeof(Float_t)); + memset(mt32,0,2*3*sizeof(Float_t)); + // Int_t S3 = 0; Int_t S2 = 0; Int_t S12 = 0; @@ -5198,7 +5247,7 @@ trkpad[planepad]->Range(-8.1,0.,8.1,8.); // x = track->xm[plane]; - Float_t xsig = track->dedx_x[plane]; + Float_t xsig = fabs(track->dedx_x[plane]); if ( track->XGood(plane) ){ //if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; @@ -5207,7 +5256,7 @@ } else { sigcol2 = 1; }; - ColorTRKMIP(track->dedx_x[plane],sigcol2,0); + ColorTRKMIP(fabs(track->dedx_x[plane]),sigcol2,0); linea = new TLine(x,0.01,x,xsig); linea->SetLineWidth(2); linea->SetLineColor(sigcol2); @@ -5228,7 +5277,7 @@ trkpad[planepad]->cd(); trkpad[planepad]->Range(-7.05,0.,7.05,8.); x = -track->ym[plane]; - xsig = track->dedx_y[plane]; + xsig = fabs(track->dedx_y[plane]); if ( track->YGood(plane) ){ // if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; @@ -5237,7 +5286,7 @@ } else { sigcol2 = 1; }; - ColorTRKMIP(track->dedx_y[plane],sigcol2,0); + ColorTRKMIP(fabs(track->dedx_y[plane]),sigcol2,0); linea = new TLine(x,0.01,x,xsig); linea->SetLineWidth(2); linea->SetLineColor(sigcol2); @@ -5290,8 +5339,8 @@ // x = track->xm[plane]; Float_t y = -track->ym[plane]; - Float_t xsig = track->dedx_x[plane]; - Float_t ysig = track->dedx_y[plane]; + Float_t xsig = fabs(track->dedx_x[plane]); + Float_t ysig = fabs(track->dedx_y[plane]); // if ( x > -100 && y > -100. ){ if ( track->XGood(plane) && track->YGood(plane) ){ if ( var.bw ){ @@ -5756,7 +5805,8 @@ // Trajectory *tr = new Trajectory(npoint,zin); // - ifail = track->DoTrack2(tr); + // ifail = track->DoTrack2(tr); + ifail = track->DoTrack(tr); // if ( !ifail ){ for ( Int_t e = 0; e < npoint ; e++) { @@ -6332,12 +6382,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(""); @@ -6346,7 +6397,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"); @@ -6358,7 +6413,11 @@ 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); + if ( satura ){ + Yview->SetFillColor(kBlack); + } else { + Yview->SetFillColor(colo); + }; Yview->Fill(96-n,21-m,1.); pd2->cd(); Yview->Draw("box same");