--- eventviewer/flight/src/FEVdetector.cpp 2007/11/08 11:05:34 1.21 +++ eventviewer/flight/src/FEVdetector.cpp 2014/11/04 15:03:27 1.39 @@ -72,6 +72,7 @@ #include // extern Bool_t existfile(TString); +extern Bool_t NODB; // using namespace std; @@ -95,6 +96,11 @@ var.showcal = false; var.showrun = false; var.showac = false; + L2 = 0; +} + +void FEVdetector::Reset(){ + L2 = NULL; } void FEVdetector::checkctrlword(){ @@ -112,6 +118,7 @@ var.INFOS = 0; var.VINFOS = 0; var.PALETTE = 0; + var.PATTRIG = 1; if ( *ctrlword & (1<<0) ) { var.PALETTE = 1; }; @@ -139,6 +146,9 @@ if ( *ctrlword & (1<<8) ) { var.TOF = 1; }; + if ( *ctrlword & (1<<9) ) { + var.PATTRIG = 1; + }; } void FEVdetector::SetDDEC(TString de){ @@ -206,7 +216,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 +404,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); // @@ -414,7 +427,8 @@ TBranchElement *tb = (TBranchElement*)branch_array->At(l); Int_t type = tb->GetType(); Int_t atype = tb->GetStreamerType() - 20; - Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; + // Int_t len = (tb->GetInfo()->GetLengths())[tb->GetID()]; + Int_t len = tb->GetInfo()->GetLength(tb->GetID()); Int_t length = min(len,dlen); // // printf("Branches : type is %i type is %i tb getname %s slen %i slength %i\n",atype,type,tb->GetName(),len,length); @@ -429,6 +443,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 +456,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 +471,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 +486,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 +524,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 +625,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 +639,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() ){ @@ -636,7 +661,8 @@ TBranchElement *stb = (TBranchElement*)tb->FindBranch(name); Int_t stype = stb->GetType(); Int_t satype = stb->GetStreamerType() - 20; - Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; + // Int_t slen = (stb->GetInfo()->GetLengths())[stb->GetID()]; + Int_t slen = stb->GetInfo()->GetLength(stb->GetID()); Int_t slength = min(slen,dlen); // printf("SubBranches : atype is %i type is %i tb getname %s slen %i slength %i\n",satype,stype,stb->GetName(),slen,slength); switch (stype){ @@ -665,11 +691,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 +711,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 +731,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 +745,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 +774,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 +821,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 +832,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 +858,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 +869,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 +892,8 @@ break; }; }; - // pamgui->DIALOG(0,o); printf("%s\n",o); + pamgui->DIALOG(4,zz); }; @@ -1016,17 +1065,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 +1107,16 @@ // if ( level.file == 2 ){ // - printf(" %s \n",ddec.Data()); + // printf(" %s \n",ddec.Data()); if ( !L2 ){ + // printf(" l2 constructor\n"); L2 = new PamLevel2("",file.Data(),ddec.Data()); + if ( NODB ) L2->NoDBconnections(); otr = L2->GetPamTree(); - 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()); // @@ -1216,6 +1267,250 @@ // } +bool bit(int decimal, char pos) +{ + return( (decimal>>pos)%2 ); +} +// +// THE PATTERN TRIGGER +// +void FEVdetector::ShowTRG(){ + // + if ( level.file != 2 ) return; + // + if ( !var.TRG ) return; + // + int S11[8]; + S11[0] = 0; + S11[1] = 0; + S11[2] = 0; + S11[3] = 0; + S11[4] = 0; + S11[5] = 0; + S11[6] = 0; + S11[7] = 0; + + int S12[6]; + S12[0] = 0; + S12[1] = 0; + S12[2] = 0; + S12[3] = 0; + S12[4] = 0; + S12[5] = 0; + + int S21[2]; + S21[0] = 0; + S21[1] = 0; + + int S22[2]; + S22[0] = 0; + S22[1] = 0; + + int S31[3]; + S31[0] = 0; + S31[1] = 0; + S31[2] = 0; + + int S32[3]; + S32[0] = 0; + S32[1] = 0; + S32[2] = 0; + + //S3 + if ( bit(L2->GetTrigLevel2()->patterntrig[2],0) ) S31[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],1) ) S31[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],2) ) S31[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],3) ) S31[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],4) ) S31[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],5) ) S31[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],6) ) S32[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],7) ) S32[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],8) ) S32[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],9) ) S32[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],10) ) S32[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[2],11) ) S32[2]++; + //S2 + if ( bit(L2->GetTrigLevel2()->patterntrig[3],0) ) S21[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],1) ) S21[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],2) ) S21[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],3) ) S21[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],4) ) S22[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],5) ) S22[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],6) ) S22[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[3],7) ) S22[1]++; + //S12 + if ( bit(L2->GetTrigLevel2()->patterntrig[4],0) ) S12[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],1) ) S12[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],2) ) S12[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],3) ) S12[3]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],4) ) S12[4]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],5) ) S12[5]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],6) ) S12[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],7) ) S12[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],8) ) S12[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],9) ) S12[3]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],10) ) S12[4]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[4],11) ) S12[5]++; + //S11 + if ( bit(L2->GetTrigLevel2()->patterntrig[5],0) ) S11[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],1) ) S11[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],2) ) S11[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],3) ) S11[3]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],4) ) S11[4]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],5) ) S11[5]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],6) ) S11[6]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],7) ) S11[7]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],8) ) S11[0]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],9) ) S11[1]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],10) ) S11[2]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],11) ) S11[3]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],12) ) S11[4]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],13) ) S11[5]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],14) ) S11[6]++; + if ( bit(L2->GetTrigLevel2()->patterntrig[5],15) ) S11[7]++; + + + // + Int_t rj = 0; + Float_t xs2x = var.xxvc; + Float_t ys2x = var.yxvc + 0.36*var.sfy; + Float_t xs2y = var.xyvc; + Float_t ys2y = var.yyvc + 0.36*var.sfy; + Float_t ws2 = 0.005; + Float_t ws13 = 0.007; + Int_t noadc; + if ( var.bw ){ + noadc=12; + } else { + noadc=kRed; + }; + // + // S11 X-view + // + Float_t s11p = 0.051; + TPolyLine *ftrg11x[8]; + for ( Int_t j=0; j<8; j++){ + Float_t nxc1[5]={ (s11p*j), (s11p*j), s11p*(j+1), s11p*(j+1), (s11p*j)}; + Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; + Float_t nxc[5]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2x + (-0.204+nxc1[i])*var.sfx; + nyc[i] = ys2x + (0.295+nyc1[i])*var.sfy; + }; + ftrg11x[j] = new TPolyLine(5,nxc,nyc); + ftrg11x[j]->SetLineColor(noadc); + ftrg11x[j]->SetLineWidth(S11[j]); + if ( S11[j] ) ftrg11x[j]->Draw(); + }; + // + // S12 Y-view + // + Float_t s12p = 0.055; + TPolyLine *ftrg12y[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]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2y + (-0.165+nxc1[i])*var.sfx; + nyc[i] = ys2y + (0.295+nyc1[i])*var.sfy; + }; + ftrg12y[j] = new TPolyLine(5,nxc,nyc); + ftrg12y[j]->SetLineColor(noadc); + ftrg12y[j]->SetLineWidth(S12[rj]); + if ( S12[rj] ) ftrg12y[j]->Draw(); + }; + + + // + // S21 Y-view + // + Float_t s21p = 0.075; + TPolyLine *ftrg21y[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]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2y + nxc1[i]*var.sfx; + nyc[i] = ys2y + nyc1[i]*var.sfy; + // printf(" TRG i %i x %f y %f \n",i,nxc[i],nyc[i]); + }; + ftrg21y[j] = new TPolyLine(5,nxc,nyc); + ftrg21y[j]->SetLineColor(noadc); + ftrg21y[j]->SetLineWidth(S21[j]); + if ( S21[j]) ftrg21y[j]->Draw(); + }; + + // + // S22 X-view + // + Float_t s22p = 0.090; + TPolyLine *ftrg22x[2]; + for ( Int_t j=0; j<2; j++){ + Float_t nxc1[5]={ s22p*(j-1), s22p*(j-1), s22p*j, s22p*j, s22p*(j-1)}; + Float_t nyc1[5]={ -ws2, 0., 0., -ws2, -ws2}; + Float_t nxc[5]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2x + nxc1[i]*var.sfx; + nyc[i] = ys2x + nyc1[i]*var.sfy; + }; + ftrg22x[j] = new TPolyLine(5,nxc,nyc); + ftrg22x[j]->SetLineColor(noadc); + ftrg22x[j]->SetLineWidth(S22[j]); + if ( S22[j] ) ftrg22x[j]->Draw(); + }; + // + // S31 X-view + // + Float_t s31p = 0.060; + TPolyLine *ftrg31x[3]; + for ( Int_t j=0; j<3; j++){ + Float_t nxc1[5]={ (s31p*j), (s31p*j), s31p*(j+1), s31p*(j+1), (s31p*j)}; + Float_t nyc1[5]={ 0., ws13, ws13, 0., 0.}; + Float_t nxc[5]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2x + (-0.090+nxc1[i])*var.sfx; + nyc[i] = ys2x + (-0.488+nyc1[i])*var.sfy; + }; + ftrg31x[j] = new TPolyLine(5,nxc,nyc); + ftrg31x[j]->SetLineColor(noadc); + ftrg31x[j]->SetLineWidth(S31[j]); + if ( S31[j] ) ftrg31x[j]->Draw(); + }; + + // + // S32 Y-view + // + Float_t s32p = 0.050; + TPolyLine *ftrg32y[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]; + Float_t nyc[5]; + for (Int_t i = 0; i<5 ; i++) { + nxc[i]= xs2y + (-0.075+nxc1[i])*var.sfx; + nyc[i] = ys2y + (-0.488+nyc1[i])*var.sfy; + }; + ftrg32y[j] = new TPolyLine(5,nxc,nyc); + ftrg32y[j]->SetLineColor(noadc); + ftrg32y[j]->SetLineWidth(S32[rj]); + if ( S32[rj] ) ftrg32y[j]->Draw(); + } +} + void FEVdetector::DisplayEvent(){ TLatex *text=new TLatex(); stringstream testo; @@ -1231,6 +1526,15 @@ thefigure->cd(); ShowTOF(); // + // show pattern trigger if the case + // + thefigure->cd(); + if ( var.PATTRIG ){ + ShowTRG(); + thefigure->Modified(); + thefigure->Update(); + } + // // show anticounters // thefigure->cd(); @@ -1327,6 +1631,10 @@ testo3 << "S4: ";// << setprecision(2); testo3 << var.s4sig << " [MIP] TOF: #beta = "; testo3 << setprecision(3) << var.beta[4]; + if ( level.file == 2 ){ + testo3 << " SVL cutoff: "; + testo3 << setprecision(3) << L2->GetOrbitalInfo()->GetCutoffSVL();//quiquiqui + } text->DrawLatex(0.33,txthi,testo3.str().c_str()); txthi -= 0.03; testo3.str(""); @@ -1448,10 +1756,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 +1887,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 +1898,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 +1910,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 +2221,7 @@ if ( !var.TOF ) return; // Int_t tt = 0; + Int_t rj = 0; // // force level0, i.e. show patterntrig variable! // @@ -1940,6 +2251,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; @@ -2104,7 +2422,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 +2440,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 +2453,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 +2471,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 +2508,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 +2526,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 +2539,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 +2557,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 +2675,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 +2693,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 +2706,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 +2724,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 +2759,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 +2777,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 +2789,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 +2807,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); @@ -2707,17 +3041,18 @@ // // Bool_t repeat = true; - Int_t numtr = 1; -// Int_t numtr = 0; + // Int_t numtr = 1; + Int_t numtr = 0; Int_t repuntil = 0; + Int_t repuntiltr = 0; // // var.tofraw = 0; // if ( level.file == 2 ) repuntil = L2->GetToFLevel2()->ntrk(); // printf("repuntil = %i \n",repuntil); - //if ( level.file == 2 ) repuntil = L2->GetTrkLevel2()->GetNTracks(); - //repuntil = L2->GetNTracks(); + if ( level.file == 2 ) repuntiltr = L2->GetTrkLevel2()->GetNTracks(); + // repuntiltr = L2->GetNTracks(); // while ( repeat ){ // printf("B repuntil = %i \n",repuntil); @@ -2726,13 +3061,14 @@ // // ToFTrkVar *ptt = 0; -// PamTrack *ptrack = 0; + PamTrack *ptrack = 0; Float_t adc[4][12]; Float_t tdc[4][12]; memset(adc,0,4*12*sizeof(Float_t)); memset(tdc,0,4*12*sizeof(Float_t)); // // + Int_t myseq = 0; // if ( repuntil == 0 || var.tofraw ){ if ( repuntil == 1 || var.tofraw ){ numtr = 0; @@ -2740,13 +3076,23 @@ repeat = false; } else { // +// printf(" deH_ \n"); // - if ( numtr >= repuntil-1 ) repeat = false; - // - // printf(" numtr is %i \n",numtr); - ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); - //ptrack = L2->GetTrack(numtr); - //ptt = ptrack->GetToFTrack(); + if ( numtr == 0 ){ +// printf(" ques \n"); + ptt = L2->GetToFLevel2()->GetToFTrkVar(0); + myseq = 0; +// printf(" que \n"); + + } else { + if ( numtr >= (repuntiltr-1) ) repeat = false; + // + printf(" numtr is %i \n",numtr); + // ptt = L2->GetToFLevel2()->GetToFTrkVar(numtr); + ptrack = L2->GetTrack(numtr-1); + ptt = ptrack->GetToFTrack(); + myseq = ptt->trkseqno + 1; + }; }; // xp11[0] = 0.; @@ -2760,20 +3106,22 @@ // ii = 2; // - Int_t myseq = ptt->trkseqno + 1; + // Int_t myseq = ptt->trkseqno + 1; + // +// printf(" qui \n"); L2->GetToFLevel2()->GetMatrix(myseq,adc,tdc); // - // printf(" qua \n"); +// printf(" qua \n"); // - for ( Int_t i = 0; i<8; i++ ) { - if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ - ms11a[i] = adc[ch11a[i]][hb11a[i]]; - }; - if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ - ms11b[i] = adc[ch11b[i]][hb11b[i]]; - }; - // xp11[i] = 0.; - }; + // for ( Int_t i = 0; i<8; i++ ) { + // if ( adc[ch11a[i]][hb11a[i]] < 1000. ){ + // ms11a[i] = adc[ch11a[i]][hb11a[i]]; + // }; + // if ( adc[ch11b[i]][hb11b[i]] < 1000. ){ + // ms11b[i] = adc[ch11b[i]][hb11b[i]]; + // }; + // xp11[i] = 0.; + // }; Int_t nmtof = 0; Float_t mtof = 0.; @@ -2890,7 +3238,7 @@ if ( level.file == -1 ){ ColorMIP(ms11a[j]+ms11b[j],colo); } else { - ColorTOFMIP(ms11a[j]+ms11b[j],colo); + ColorTOFMIP((ms11a[j]+ms11b[j])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -2920,17 +3268,22 @@ 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 nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -2953,7 +3306,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 +3325,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])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3014,7 +3369,7 @@ if ( higp > 0.203 ) higp = 0.203; if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp12[j] != 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 nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -3039,7 +3394,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]; @@ -3047,6 +3404,7 @@ for (Int_t i = 0; i<5 ; i++) { nxc[i]= xs2y + nxc1[i]*var.sfx; nyc[i] = ys2y + nyc1[i]*var.sfy; + // printf(" TOF i %i x %f y %f \n",i,nxc[i],nyc[i]); }; ftof21y[j] = new TPolyLine(5,nxc,nyc); ftof21y[j]->SetLineColor(1); @@ -3056,9 +3414,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])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3100,7 +3458,7 @@ if ( higp > 0.089 ) higp = 0.089; if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp21[j] != 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.}; + Float_t nyc1[5]={ 0.0015, 0.0015, (float)(ws2-0.0015), (float)(ws2-0.0015), 0.}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -3144,7 +3502,7 @@ if ( level.file == -1 ){ ColorMIP(ms22a[j]+ms22b[j],colo); } else { - ColorTOFMIP(ms22a[j]+ms22b[j],colo); + ColorTOFMIP((ms22a[j]+ms22b[j])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3175,18 +3533,23 @@ 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 nyc1[5]={ -0.0015, -0.0015, (float)(-ws2+0.0015), (float)(-ws2+0.0015), -0.0015}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -3204,7 +3567,7 @@ }; }; // - + //daquiinbasso // // S31 X-view // @@ -3230,7 +3593,7 @@ if ( level.file == -1 ){ ColorMIP(ms31a[j]+ms31b[j],colo); } else { - ColorTOFMIP(ms31a[j]+ms31b[j],colo); + ColorTOFMIP((ms31a[j]+ms31b[j])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3261,18 +3624,23 @@ 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 nyc1[5]={ 0.0015, 0.0015, (float)(ws13-0.0015), (float)(ws13-0.0015), 0.0015}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -3297,7 +3665,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 +3684,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])/2.,colo); }; // if ( colo != 10 ) ocolo = colo; @@ -3358,7 +3728,7 @@ if ( higp > 0.089 ) higp = 0.089; if ( lowp < higp && ( level.file == -1 || (level.file == 2 && xp32[j] != 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 nyc1[5]={ -0.0015, -0.0015, (float)(-ws13+0.0015), (float)(-ws13+0.0015), -0.0015}; Float_t nxc[5]; Float_t nyc[5]; for (Int_t i = 0; i<5 ; i++) { @@ -3734,10 +4104,10 @@ // if ( true ){ // PMTs - Float_t xc1[5]={ 0., 0.014*var.sfx, 0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1), -var.sfx*var.sfx*pmt1*cos(apmt1), 0.}; - Float_t yc1[5]={ 0., 0.011*var.sfy, 0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1), var.sfy*var.sfy*pmt1*sin(apmt1), 0.}; - Float_t xc2[5]={ 0., 0.011*var.sfx, 0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2), -pmt2*var.sfx*var.sfx*cos(apmt2), 0.}; - Float_t yc2[5]={ 0., 0.015*var.sfy, 0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2), var.sfy*pmt2*var.sfy*sin(apmt2), 0.}; + Float_t xc1[5]={ 0., (float)(0.014*var.sfx), (float)(0.014*var.sfx-var.sfx*var.sfx*pmt1*cos(apmt1)), (float)(-var.sfx*var.sfx*pmt1*cos(apmt1)), 0.}; + Float_t yc1[5]={ 0., (float)(0.011*var.sfy), (float)(0.011*var.sfy+var.sfy*var.sfy*pmt1*sin(apmt1)), (float)(var.sfy*var.sfy*pmt1*sin(apmt1)), 0.}; + Float_t xc2[5]={ 0., (float)(0.011*var.sfx), (float)(0.011*var.sfx-pmt2*var.sfx*var.sfx*cos(apmt2)), (float)(-pmt2*var.sfx*var.sfx*cos(apmt2)), 0.}; + Float_t yc2[5]={ 0., (float)(0.015*var.sfy), (float)(0.015*var.sfy+var.sfy*pmt2*var.sfy*sin(apmt2)), (float)(var.sfy*pmt2*var.sfy*sin(apmt2)), 0.}; // SCINTs Float_t xcc1[10]={-0.149, -0.090165, -0.090165, -0.149, -0.242, -0.257, -0.212, -0.257, -0.242, -0.149}; Float_t ycc1[10]={ 0.169, 0.108165, -0.108165, -0.169, -0.169, -0.158, 0., 0.158, 0.169, 0.169}; @@ -5030,9 +5400,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 +5472,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.; // @@ -5158,8 +5528,8 @@ trkpad[planepad]->Range(-8.1,0.,8.1,8.); // x = track->xm[plane]; - Float_t xsig = track->dedx_x[plane]; - if ( track->xgood[plane] ){ + Float_t xsig = fabs(track->dedx_x[plane]); + if ( track->XGood(plane) ){ //if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; if ( var.bw ){ @@ -5167,12 +5537,12 @@ } 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); linea->Draw(); - Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; + Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; TPolyLine *tlinea = new TPolyLine(5,tx,tz); tlinea->SetLineWidth(1); @@ -5187,9 +5557,9 @@ planepad = plane * 2; trkpad[planepad]->cd(); trkpad[planepad]->Range(-7.05,0.,7.05,8.); - x = track->ym[plane]; - xsig = track->dedx_y[plane]; - if ( track->ygood[plane] ){ + x = -track->ym[plane]; + xsig = fabs(track->dedx_y[plane]); + if ( track->YGood(plane) ){ // if ( x > -100 ){ if ( xsig > 8. ) xsig = 8.; if ( var.bw ){ @@ -5197,12 +5567,12 @@ } 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); linea->Draw(); - Float_t tx[5] = {x-0.3, x+0.3, x+0.3, x-0.3, x-0.3}; + Float_t tx[5] = {(float)(x-0.3), (float)(x+0.3), (float)(x+0.3), (float)(x-0.3), (float)(x-0.3)}; Float_t tz[5] = {0., 0., 0.5, 0.5, 0.}; TPolyLine *tlinea = new TPolyLine(5,tx,tz); tlinea->SetLineColor(dcol); @@ -5249,11 +5619,11 @@ for (Int_t plane = 0; plane<6; plane++){ // 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 y = -track->ym[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 ( track->XGood(plane) && track->YGood(plane) ){ if ( var.bw ){ sigcol1 = -1; sigcol2 = -1; @@ -5371,8 +5741,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 +5835,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 +5870,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 +5950,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 +5999,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; @@ -5670,8 +6040,8 @@ // printf("qua \n"); Int_t npoint = 100; Float_t zin[100]; - Double_t xout[100]; - Double_t yout[100]; + // Double_t xout[100]; + // Double_t yout[100]; Int_t ifail = 0; Int_t trcol = 10; // @@ -5689,8 +6059,8 @@ Float_t tzy1[15]; // for ( Int_t e = 0; e < 100 ; e++) { - xout[e] = 0.; - yout[e] = 0.; + // xout[e] = 0.; + // yout[e] = 0.; // tx[e] = 0.; ty[e] = 0.; @@ -5716,22 +6086,23 @@ // 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++) { 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; }; @@ -5864,8 +6235,8 @@ // stringstream xevent; stringstream yevent; - Float_t sdexy[2][22][96]; - Float_t sdexyc[2][22][96]; + // Float_t sdexy[2][22][96]; + // Float_t sdexyc[2][22][96]; // for (Int_t m = 0; m < 22; m++){ for (Int_t l = 0; l < 2; l++){ @@ -5880,11 +6251,11 @@ // // determine what kind of event we are going to analyze // - bool isCOMP = 0; - bool isFULL = 0; + // bool isCOMP = 0; + // bool isFULL = 0; bool isRAW = 0; - if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; - if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; + // if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; + // if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; // // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc @@ -5894,9 +6265,9 @@ for (Int_t nn = 0; nn < 96; nn++){ if ( nn%16 == 0 ) pre++; evento.base[l][m][pre] = calib.calbase[l][m][pre]; - sdexy[l][m][nn] = evento.dexy[l][m][nn]; + // sdexy[l][m][nn] = evento.dexy[l][m][nn]; evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; - sdexyc[l][m][nn] = evento.dexy[l][m][nn]; + // sdexyc[l][m][nn] = evento.dexy[l][m][nn]; evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; }; }; @@ -5971,7 +6342,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"); }; @@ -5992,7 +6363,7 @@ // Define variables // UInt_t etime = var.etime; - Float_t estrip[2][22][96], ener, basel,sdexy[2][22][96],sdexyc[2][22][96]; + Float_t estrip[2][22][96], ener, basel;//,sdexy[2][22][96],sdexyc[2][22][96]; Int_t badstrip = 0; qtot = 0.; nstrip = 0; @@ -6088,11 +6459,11 @@ // // determine what kind of event we are going to analyze // - bool isCOMP = 0; - bool isFULL = 0; + // bool isCOMP = 0; + // bool isFULL = 0; bool isRAW = 0; - if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; - if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; + // if ( de->stwerr[se] & (1 << 16) ) isCOMP = 1; + // if ( de->stwerr[se] & (1 << 17) ) isFULL = 1; if ( de->stwerr[se] & (1 << 3) ) isRAW = 1; // // save the prevoius energy deposit and calibration in sbase, sdexy, sdexyc @@ -6102,9 +6473,9 @@ for (Int_t nn = 0; nn < 96; nn++){ if ( nn%16 == 0 ) pre++; evento.base[l][m][pre] = calib.calbase[l][m][pre]; - sdexy[l][m][nn] = evento.dexy[l][m][nn]; + // sdexy[l][m][nn] = evento.dexy[l][m][nn]; evento.dexy[l][m][nn] = de->dexy[l][m][nn] ; - sdexyc[l][m][nn] = evento.dexy[l][m][nn]; + // sdexyc[l][m][nn] = evento.dexy[l][m][nn]; evento.dexyc[l][m][nn] = de->dexy[l][m][nn] ; }; }; @@ -6113,14 +6484,14 @@ // Int_t done = 0; Int_t rdone = 0; - Int_t fdone = 0; + // Int_t fdone = 0; pre = -1; for (Int_t n =0 ; n < 96; n++){ if ( n%16 == 0 ) { pre++; done = 0; rdone = 0; - fdone = 0; + // fdone = 0; }; // // baseline check and calculation @@ -6200,7 +6571,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"); }; @@ -6287,17 +6658,19 @@ // stringstream xvev; stringstream yvev; - for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ + // for (Int_t ii = 0; ii < L2->GetCaloLevel2()->nstrip; ii++){ + for (Int_t ii = 0; ii < L2->GetCaloLevel1()->istrip; ii++){ Int_t colo; 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 +6679,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 +6695,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"); }; @@ -6332,7 +6713,7 @@ } void FEVdetector::Calo1stcalib(){ - Float_t estrip[2][22][96]; + // Float_t estrip[2][22][96]; // // this is the value of the mip for each strip. To be changed when we will have the real values // @@ -6350,7 +6731,7 @@ for (Int_t k = 0; k < 22; k++ ){ for (Int_t l = 0; l < 96; l++ ){ calib.calped[m][k][l] = 0. ; - estrip[m][k][l] = 0.; + // estrip[m][k][l] = 0.; }; }; }