--- quicklook/QLflightTmtc_Header/TmtcTemperature.cpp 2006/06/17 11:02:09 1.1.1.1 +++ quicklook/QLflightTmtc_Header/TmtcTemperature.cpp 2006/07/06 17:01:08 1.5 @@ -1,3 +1,5 @@ + + /** * TmtcTemperature * author Marcelli @@ -209,9 +211,9 @@ } -string titolocc[] ={"IPM1","IPM2","IPM3","IPM4","IPM5","IPM6","KHB_HOT","KHB_COLD","IDAQ_HOT","IDAQ_COLD","VCB_STANDBY","VRL_HOT","VRL_COLD","PSB","TOFHV_HOT","TOFHV_COLD"}; +string titolocc[] ={"IPM1 input","IPM2 input","IPM3 input","IPM4 input","IPM5 input","IPM6 input","KHB_HOT","KHB_COLD","IDAQ_HOT","IDAQ_COLD","VCB_STANDBY","VRL_HOT","VRL_COLD","PSB","TOFHV_HOT","TOFHV_COLD"}; - string titoloth[] ={"IPM_TH","S1_TH","S4_TH","S4_ND_PLATE_TH","TRK_TH1","TRK_TH2","FLUID_IN_TH","FLUID_OUT_TH","VME_TH","DCDC_TH","CPU_TH1","CPU_TH2", "IPM_CPU_TH", "VRL_TH1", "VRL_TH2", "VME_COOL_TH"}; + string titoloth[] ={"IPM_TH","S1_TH","S4_TH","S4_ND_PLATE_TH","TRK_TH1","TRK_TH2","FLUID_IN_TH","FLUID_OUT_TH","VME_TH1","DCDC_TH","CPU_TH1","CPU_TH2", "IPM_CPU_TH", "VRL_TH1", "VRL_TH2", "VME_TH2"}; const Int_t size = nevents; @@ -236,7 +238,7 @@ ev[0]=0; records[0]=0; OBT[0]=tmr->TM_RECORD_OBT; - }else if (fmod(i, 50)==0 || ((tmr->TM_RECORD_OBT)TM_RECORD_OBT)3.15 && ydea[6*i+1]<4.25) || (yccipmkk1u[i]==1 && ydea[6*i+1]<0.65 && ydea[6*i]>3.15 && ydea[6*i]<4.25)) yccipmerror[i]=1; + else if ((yccipmkk1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]>3.15 && ydea[6*i+1]<4.25) || (yccipmkk1d[i]==-1 && ydea[6*i+1]<0.65 && ydea[6*i]>3.15 && ydea[6*i]<4.25) || (yccipmkk1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]<0.65)) yccipmerror[i]=-1; else yccipmerror[i]=0; } } if (k==6 || k==7 || k==8 || k==9) { - if (yccdiagacq_1d[i]==-1 && yccipm12u[i]==1) yccipmerror2[i]=-1; + /*if (yccdiagacq_1d[i]==-1 && yccipm12u[i]==1) yccipmerror2[i]=-1; + else yccipmerror2[i]=0;*/ + if (yccdiagacq_1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]<0.65) yccipmerror2[i]=-1; else yccipmerror2[i]=0; } if (k==13) { - if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==0 && yccipm12u[i]==0) yccdiagacq_1d[i]==-1; //psb on - if (yccdiagacq_1u[i]==1 && yccipm12u[i]==1) yccdiagacq_1u[i]==1; //psb off - if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==-1) yccipmerror[i]=-1; + if ((yccdiagacq_1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]>3.15 && ydea[6*i+1]<4.25) || (yccdiagacq_1d[i]==-1 && ydea[6*i+1]<0.65 && ydea[6*i]>3.15 && ydea[6*i]<4.25)) yccdiagacq_1d[i]==-1; //psb on + if (yccdiagacq_1u[i]==1 && ydea[6*i]<0.65 && ydea[6*i+1]<0.65) yccdiagacq_1u[i]==1; //psb off + /*if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==-1) yccipmerror[i]=-1; else if (yccdiagacq_1u[i]==1 && yccipm12d[i]==0 && yccipm12u[i]==0) yccipmerror[i]=1; - else yccipmerror[i]=0; //psb alarm + else yccipmerror[i]=0;*/ + if (yccdiagacq_1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]<0.65) yccipmerror[i]=-1; + else if ((yccdiagacq_1u[i]==1 && ydea[6*i]<0.65 && ydea[6*i+1]>3.15 && ydea[6*i+1]<4.25) || (yccdiagacq_1u[i]==1 && ydea[6*i+1]<0.65 && ydea[6*i]>3.15 && ydea[6*i]<4.25)) yccipmerror[i]=1; + else yccipmerror[i]=0; //psb alarm } if (k==15) { yccdiagacq_11u[i]=0; @@ -711,80 +721,61 @@ // TH Graph Canvasthdea->cd(); - //thermistors number 12 - if (tr->GetBranch("Records.TM_TH_ANA[12]")){ - for (Int_t k =0; k<12; k++){ - for (Int_t i = 0; i < recordstot; i++){ - ythana_1[i]= ythana[12*i+k]; - xrecordobtth_1[i]= xrecordobtth[12*i+k]; - limth[i] = 45; - } - Canvasthdea->cd(k+1); - TGraph *graph = new TGraph(recordstot, xrecordobtth_1, limth); - graph->SetMarkerColor(50); - graph->SetLineColor(50); - graph->SetMarkerStyle(21); - graph->SetMarkerSize(0.3); - graph->SetMinimum(-10); - graph->SetMaximum(60); - graph->GetXaxis()->SetTitle("OBT"); - graph->GetXaxis()->CenterTitle(); - graph->GetYaxis()->SetTitle("Temperature value (°C)"); - graph->GetYaxis()->CenterTitle(); - oss.str(""); - oss << filename.Data() <<": " <SetTitle(oss.str().c_str()); - - TPaveText *pt = new TPaveText (.45,.7,.55,.77); - pt->AddText("OFF"); - pt->SetBorderSize(1); - pt->Draw(); - graph->Draw("ACP"); - pt->Draw(); - - TGraph *threcord = new TGraph(recordstot, xrecordobtth_1, ythana_1); - threcord->SetLineColor(kBlue); - threcord->SetMarkerColor(kBlue); - threcord->SetMarkerStyle(21); - threcord->Draw("C"); - } - } //thermistors number=16 if (tr->GetBranch("Records.TM_TH_ANA[16]")){ for (Int_t k =0; k<16; k++){ for (Int_t i = 0; i < recordstot; i++){ ythana_1[i]= ythana[16*i+k]; xrecordobtth_1[i]= xrecordobtth[16*i+k]; - limth[i] = 45; } Canvasthdea->cd(k+1); - TGraph *graph = new TGraph(recordstot, xrecordobtth_1, limth); - graph->SetMarkerColor(50); - graph->SetLineColor(50); - graph->SetMarkerStyle(21); - graph->SetMarkerSize(0.3); - graph->SetMinimum(-10); - graph->SetMaximum(60); - graph->GetXaxis()->SetTitle("OBT"); - graph->GetXaxis()->CenterTitle(); - graph->GetYaxis()->SetTitle("Temperature value (°C)"); - graph->GetYaxis()->CenterTitle(); - oss.str(""); - oss << filename.Data() <<": " <SetTitle(oss.str().c_str()); - - TPaveText *pt = new TPaveText (.45,.7,.55,.77); - pt->AddText("OFF"); - pt->SetBorderSize(1); - pt->Draw(); - graph->Draw("ACP"); - pt->Draw(); TGraph *threcord = new TGraph(recordstot, xrecordobtth_1, ythana_1); threcord->SetLineColor(kBlue); threcord->SetMarkerColor(kBlue); threcord->SetMarkerStyle(21); - threcord->Draw("C"); + threcord->SetMinimum(-10); + threcord->SetMaximum(60); + threcord->GetXaxis()->SetTitle("OBT"); + threcord->GetXaxis()->CenterTitle(); + threcord->GetYaxis()->SetTitle("Temperature value (°C)"); + threcord->GetYaxis()->CenterTitle(); + oss.str(""); + oss << filename.Data() <<": " <SetTitle(oss.str().c_str()); + + Double_t xmin=threcord->GetXaxis()->GetXmin(); + Double_t xmax=threcord->GetXaxis()->GetXmax(); + if (k==10 || k==11 ) { + TPaveText *pt = new TPaveText (.45,.75,.55,.82); + pt->AddText("OFF"); + pt->SetBorderSize(1); + pt->Draw(); + threcord->Draw("ACsame"); + TF1 *func1 = new TF1("func1", "50"); + func1->SetRange(xmin,xmax); + func1->SetLineColor(2); + func1->SetLineStyle(1); + func1->SetLineWidth(2); + func1->Draw("same"); + pt->Draw(); + }else { + TPaveText *pt = new TPaveText (.45,.7,.55,.77); + pt->AddText("OFF"); + pt->SetBorderSize(1); + pt->Draw(); + threcord->Draw("ACsame"); + TF1 *func1 = new TF1("func1", "45"); + func1->SetRange(xmin,xmax); + func1->SetLineColor(2); + func1->SetLineStyle(1); + func1->SetLineWidth(2); + func1->Draw("same"); + pt->Draw(); + } + + + } } @@ -794,12 +785,9 @@ for (Int_t i = 0; i < recordstot; i++){ ydea_1[i]= ydea[6*i + k]; xrecordobtdea_1[i]= xrecordobtdea[6*i+k]; - limvolt1[i]= 0.65; - limvolt2[i]= 3.15; - limvolt3[i]= 4.25; } Canvasvoltdea->cd(k+1); - TGraph *graph1 = new TGraph(recordstot, xrecordobtth_1, limvolt1); + TPaveText *pt = new TPaveText (.84,.13,.92,.19); pt->AddText("OFF"); pt->SetBorderSize(1); @@ -808,40 +796,6 @@ pt1->AddText("ON"); pt1->SetBorderSize(1); pt1->Draw(); - graph1->SetMarkerColor(50); - graph1->SetLineColor(50); - graph1->SetMarkerStyle(21); - graph1->SetMarkerSize(0.3); - graph1->SetMinimum(0.0); - graph1->SetMaximum(5.0); - graph1->GetXaxis()->SetTitle("OBT"); - graph1->GetXaxis()->CenterTitle(); - graph1->GetYaxis()->SetTitle("Voltage value (V)"); - graph1->GetYaxis()->CenterTitle(); - oss.str(""); - oss << filename.Data()<<": IPM "<SetTitle(oss.str().c_str()); - graph1->Draw("ACP"); - pt1->Draw(); - pt->Draw(); - - TGraph *graph2 = new TGraph(recordstot, xrecordobtth_1, limvolt2); - graph2->SetMarkerColor(50); - graph2->SetLineColor(50); - graph2->SetMarkerStyle(21); - graph2->SetMarkerSize(0.2); - graph2->SetMinimum(0.0); - graph2->SetMaximum(5.0); - graph2->Draw("CP"); - - TGraph *graph3 = new TGraph(recordstot, xrecordobtth_1, limvolt3); - graph3->SetMarkerColor(50); - graph3->SetLineColor(50); - graph3->SetMarkerStyle(21); - graph3->SetMarkerSize(0.2); - graph3->SetMinimum(0.0); - graph3->SetMaximum(5.0); - graph3->Draw("CP"); TGraph *dearecord = new TGraph(recordstot, xrecordobtdea_1, ydea_1); dearecord->SetLineColor(kBlue); @@ -849,7 +803,43 @@ dearecord->SetMarkerStyle(21); dearecord->SetMarkerSize(0.5); dearecord->SetMarkerColor(kBlue); - dearecord->Draw("CPL"); + dearecord->SetMinimum(0.0); + dearecord->SetMaximum(5.0); + dearecord->GetXaxis()->SetTitle("OBT"); + dearecord->GetXaxis()->CenterTitle(); + dearecord->GetYaxis()->SetTitle("Voltage value (V)"); + dearecord->GetYaxis()->CenterTitle(); + oss.str(""); + oss << filename.Data()<<": IPM "<SetTitle(oss.str().c_str()); + dearecord->Draw("ACPLsame"); + + Double_t xmin=dearecord->GetXaxis()->GetXmin(); + Double_t xmax=dearecord->GetXaxis()->GetXmax(); + TF1 *func1 = new TF1("func1", "0.65"); + func1->SetRange(xmin, xmax); + func1->SetLineColor(2); + func1->SetLineStyle(1); + func1->SetLineWidth(2); + func1->Draw("Csame"); + + TF1 *func2 = new TF1("func2", "3.15"); + func2->SetRange(xmin, xmax); + func2->SetLineColor(2); + func2->SetLineStyle(1); + func2->SetLineWidth(2); + func2->Draw("Csame"); + + TF1 *func3 = new TF1("func3", "4.25"); + func3->SetRange(xmin, xmax); + func3->SetLineColor(2); + func3->SetLineStyle(1); + func3->SetLineWidth(2); + func3->Draw("Csame"); + + + pt1->Draw(); + pt->Draw(); }