/[PAMELA software]/quicklook/QLflightTmtc_Header/TmtcTemperature.cpp
ViewVC logotype

Diff of /quicklook/QLflightTmtc_Header/TmtcTemperature.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pam-fi, Tue Jun 20 11:10:38 2006 UTC revision 1.6 by pam-fi, Sun Jul 9 06:40:08 2006 UTC
# Line 210  void TmtcTemperature(TString base, TStri Line 210  void TmtcTemperature(TString base, TStri
210      return;      return;
211    }    }
212    
213    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 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"};  
214    
215   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"};
216    
217    
218    const Int_t size = nevents;    const Int_t size = nevents;
# Line 238  string titolocc[] ={"IPM1","IPM2","IPM3" Line 237  string titolocc[] ={"IPM1","IPM2","IPM3"
237          ev[0]=0;          ev[0]=0;
238          records[0]=0;          records[0]=0;
239          OBT[0]=tmr->TM_RECORD_OBT;          OBT[0]=tmr->TM_RECORD_OBT;
240        }else if (fmod(i, 50)==0 || ((tmr->TM_RECORD_OBT)<OBT[i-1]) || (i==(size-1)) ){        }else if (fmod(i, 35)==0 || ((tmr->TM_RECORD_OBT)<OBT[i-1]) || (i==(size-1)) ){
241          //}else if ((fmod(i, 20)==0) || (i==(size-1)) ){          //}else if ((fmod(i, 20)==0) || (i==(size-1)) ){
242          tot=tot+1;          tot=tot+1;
243          if (recordstotmax<recordstot) recordstotmax=recordstot;          if (recordstotmax<recordstot) recordstotmax=recordstot;
# Line 251  string titolocc[] ={"IPM1","IPM2","IPM3" Line 250  string titolocc[] ={"IPM1","IPM2","IPM3"
250    }      }  
251    
252    
   
253    const Int_t lungmax=16*recordstotmax;    const Int_t lungmax=16*recordstotmax;
254    const Int_t lungmin=6*recordstotmax;    const Int_t lungmin=6*recordstotmax;
255        
256      Float_t xrecordobtcc[lungmax], yccdiagacq[lungmax], ythana[lungmax], xrecordobtth[lungmax], xrecordobtdea[lungmin], ydea[lungmin], xrecordobtcc_1[lungmax], xrecordobtcc_1d[lungmax], xrecordobtcc_1u[lungmax], yccdiagacq_1[lungmax], yccdiagacq_1d[lungmax], yccdiagacq_1u[lungmax],  ythana_1[lungmax], xrecordobtth_1[lungmax], xrecordobtdea_1[lungmin], ydea_1[lungmin];  
257        
258     Double_t xrecordobtcc[lungmax], yccdiagacq[lungmax], ythana[lungmax], xrecordobtth[lungmax], xrecordobtdea[lungmin], ydea[lungmin], xrecordobtcc_1[lungmax], xrecordobtcc_1d[lungmax], xrecordobtcc_1u[lungmax], yccdiagacq_1[lungmax], yccdiagacq_1d[lungmax], yccdiagacq_1u[lungmax],  ythana_1[lungmax], xrecordobtth_1[lungmax], xrecordobtdea_1[lungmin], ydea_1[lungmin], limth[lungmax], limvolt1[lungmin], limvolt2[lungmin], limvolt3[lungmin];      Float_t yccdiagacq_11u[lungmax], yccdiagacq_11d[lungmax], yccipm12u[lungmax], yccipm12d[lungmax], yccipmkk1u[lungmax], yccipmkk1d[lungmax], yccipmerror[lungmax],  yccipmerror2[lungmax];
     
    Double_t yccdiagacq_11u[lungmax], yccdiagacq_11d[lungmax], yccipm12u[lungmax], yccipm12d[lungmax], yccipmkk1u[lungmax], yccipmkk1d[lungmax], yccipmerror[lungmax],  yccipmerror2[lungmax];  
   
259    
260    
261   /////ciclo sulle pagine////////////////////   /////ciclo sulle pagine////////////////////
# Line 274  string titolocc[] ={"IPM1","IPM2","IPM3" Line 270  string titolocc[] ={"IPM1","IPM2","IPM3"
270     Canvasthdea->SetFillColor(10);     Canvasthdea->SetFillColor(10);
271     Canvasthdea->Divide(4,4);     Canvasthdea->Divide(4,4);
272        
     
273     TCanvas *Canvasvoltdea = new TCanvas("Tmtc_5", base, 1280, 1024);     TCanvas *Canvasvoltdea = new TCanvas("Tmtc_5", base, 1280, 1024);
274     Canvasvoltdea->SetFillColor(10);     Canvasvoltdea->SetFillColor(10);
275     Canvasvoltdea->Divide(2,3);     Canvasvoltdea->Divide(2,3);
# Line 284  string titolocc[] ={"IPM1","IPM2","IPM3" Line 279  string titolocc[] ={"IPM1","IPM2","IPM3"
279        
280     for (Int_t i = ev[interval]; i < ev[interval+1]; i++){     //ciclo su un sottogruppo     for (Int_t i = ev[interval]; i < ev[interval+1]; i++){     //ciclo su un sottogruppo
281       // cout<<"ciclo da "<<ev[interval]<<" a "<< ev[interval+1]<<"\n";       // cout<<"ciclo da "<<ev[interval]<<" a "<< ev[interval+1]<<"\n";
282    
283       tmtcBr->GetEntry(i);         tmtcBr->GetEntry(i);  
284       l=0;       l=0;
285       m=0;       m=0;
# Line 373  string titolocc[] ={"IPM1","IPM2","IPM3" Line 369  string titolocc[] ={"IPM1","IPM2","IPM3"
369           if (yccdiagacq_11d[i]==-1  && yccdiagacq_1d[i]==-1)   yccipmkk1d[i]=-1;           if (yccdiagacq_11d[i]==-1  && yccdiagacq_1d[i]==-1)   yccipmkk1d[i]=-1;
370           else yccipmkk1d[i]=0;           else yccipmkk1d[i]=0;
371           if (k==7 || k==9) {           if (k==7 || k==9) {
372             if (yccipmkk1u[i]==1  && yccipm12d[i]==0 && yccipm12u[i]==0) yccipmerror[i]=1;             /* if (yccipmkk1u[i]==1  && yccipm12d[i]==0 && yccipm12u[i]==0) yccipmerror[i]=1;
373             else if (yccipmkk1d[i]==-1 && yccipm12d[i]==0 && yccipm12u[i]==0 || (yccipmkk1d[i]==-1 && yccipm12u[i]==1)) yccipmerror[i]=-1;             else if (yccipmkk1d[i]==-1 && yccipm12d[i]==0 && yccipm12u[i]==0 || (yccipmkk1d[i]==-1 && yccipm12u[i]==1)) yccipmerror[i]=-1;
374               else  yccipmerror[i]=0;*/
375               if ((yccipmkk1u[i]==1  && ydea[6*i]<0.65  &&  ydea[6*i+1]>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;
376               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;
377             else  yccipmerror[i]=0;             else  yccipmerror[i]=0;
378           }           }
379         }         }
380         if (k==6 || k==7 || k==8 || k==9) {         if (k==6 || k==7 || k==8 || k==9) {
381           if (yccdiagacq_1d[i]==-1 && yccipm12u[i]==1) yccipmerror2[i]=-1;           /*if (yccdiagacq_1d[i]==-1 && yccipm12u[i]==1) yccipmerror2[i]=-1;
382             else yccipmerror2[i]=0;*/
383             if (yccdiagacq_1d[i]==-1 && ydea[6*i]<0.65 && ydea[6*i+1]<0.65) yccipmerror2[i]=-1;
384           else yccipmerror2[i]=0;           else yccipmerror2[i]=0;
385         }         }
386         if (k==13) {         if (k==13) {
387           if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==0 && yccipm12u[i]==0)  yccdiagacq_1d[i]==-1;     //psb on           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
388           if (yccdiagacq_1u[i]==1  && yccipm12u[i]==1)   yccdiagacq_1u[i]==1;                        //psb off           if (yccdiagacq_1u[i]==1  && ydea[6*i]<0.65  &&  ydea[6*i+1]<0.65)   yccdiagacq_1u[i]==1;   //psb off
389           if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==-1) yccipmerror[i]=-1;           /*if (yccdiagacq_1d[i]==-1 && yccipm12d[i]==-1) yccipmerror[i]=-1;
390           else if (yccdiagacq_1u[i]==1  && yccipm12d[i]==0 && yccipm12u[i]==0) yccipmerror[i]=1;           else if (yccdiagacq_1u[i]==1  && yccipm12d[i]==0 && yccipm12u[i]==0) yccipmerror[i]=1;
391           else yccipmerror[i]=0;                                                                     //psb alarm           else yccipmerror[i]=0;*/      
392             if (yccdiagacq_1d[i]==-1 && ydea[6*i]<0.65  &&  ydea[6*i+1]<0.65) yccipmerror[i]=-1;
393             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;
394             else yccipmerror[i]=0;                                                                    //psb alarm
395         }         }
396         if (k==15) {         if (k==15) {
397           yccdiagacq_11u[i]=0;           yccdiagacq_11u[i]=0;
# Line 713  string titolocc[] ={"IPM1","IPM2","IPM3" Line 717  string titolocc[] ={"IPM1","IPM2","IPM3"
717        
718     // TH Graph     // TH Graph
719     Canvasthdea->cd();     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() <<":  " <<titoloth[k] ;  
        graph->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");  
      }  
    }  
720     //thermistors number=16     //thermistors number=16
721     if (tr->GetBranch("Records.TM_TH_ANA[16]")){     if (tr->GetBranch("Records.TM_TH_ANA[16]")){
722       for (Int_t k =0; k<16; k++){       for (Int_t k =0; k<16; k++){
723         for (Int_t i = 0; i < recordstot; i++){         for (Int_t i = 0; i < recordstot; i++){
724           ythana_1[i]= ythana[16*i+k];           ythana_1[i]= ythana[16*i+k];
725           xrecordobtth_1[i]= xrecordobtth[16*i+k];           xrecordobtth_1[i]= xrecordobtth[16*i+k];
          limth[i] = 45;  
726         }         }
727         Canvasthdea->cd(k+1);         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() <<":  " <<titoloth[k] ;  
        graph->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();  
728                
729         TGraph *threcord = new TGraph(recordstot, xrecordobtth_1, ythana_1);         TGraph *threcord = new TGraph(recordstot, xrecordobtth_1, ythana_1);
730         threcord->SetLineColor(kBlue);         threcord->SetLineColor(kBlue);
731         threcord->SetMarkerColor(kBlue);         threcord->SetMarkerColor(kBlue);
732         threcord->SetMarkerStyle(21);         threcord->SetMarkerStyle(21);
733         threcord->Draw("C");         threcord->SetMinimum(-10);
734           threcord->SetMaximum(60);
735           threcord->GetXaxis()->SetTitle("OBT");
736           threcord->GetXaxis()->CenterTitle();
737           threcord->GetYaxis()->SetTitle("Temperature value (°C)");
738           threcord->GetYaxis()->CenterTitle();
739           oss.str("");
740           oss << filename.Data() <<":  " <<titoloth[k] ;
741           threcord->SetTitle(oss.str().c_str());
742          
743           Double_t xmin=threcord->GetXaxis()->GetXmin();
744           Double_t xmax=threcord->GetXaxis()->GetXmax();
745           if (k==10 || k==11 ) {
746             TPaveText *pt = new TPaveText (.45,.75,.55,.82);
747             pt->AddText("OFF");
748             pt->SetBorderSize(1);
749             pt->Draw();
750             threcord->Draw("ACsame");
751             TF1 *func1 = new TF1("func1", "50");
752             func1->SetRange(xmin,xmax);
753             func1->SetLineColor(2);
754             func1->SetLineStyle(1);
755             func1->SetLineWidth(2);
756             func1->Draw("same");
757             pt->Draw();
758           }else {
759             TPaveText *pt = new TPaveText (.45,.7,.55,.77);
760             pt->AddText("OFF");
761             pt->SetBorderSize(1);
762             pt->Draw();
763             threcord->Draw("ACsame");
764             TF1 *func1 = new TF1("func1", "45");
765             func1->SetRange(xmin,xmax);
766             func1->SetLineColor(2);
767             func1->SetLineStyle(1);
768             func1->SetLineWidth(2);
769             func1->Draw("same");
770             pt->Draw();
771           }
772        
773    
774    
775       }       }
776     }       }  
777        
# Line 796  string titolocc[] ={"IPM1","IPM2","IPM3" Line 781  string titolocc[] ={"IPM1","IPM2","IPM3"
781       for (Int_t i = 0; i < recordstot; i++){       for (Int_t i = 0; i < recordstot; i++){
782         ydea_1[i]= ydea[6*i + k];         ydea_1[i]= ydea[6*i + k];
783         xrecordobtdea_1[i]= xrecordobtdea[6*i+k];         xrecordobtdea_1[i]= xrecordobtdea[6*i+k];
        limvolt1[i]= 0.65;  
        limvolt2[i]= 3.15;        
        limvolt3[i]= 4.25;  
784       }       }
785       Canvasvoltdea->cd(k+1);       Canvasvoltdea->cd(k+1);
786       TGraph *graph1 = new TGraph(recordstot, xrecordobtth_1, limvolt1);  
787       TPaveText *pt = new TPaveText (.84,.13,.92,.19);       TPaveText *pt = new TPaveText (.84,.13,.92,.19);
788       pt->AddText("OFF");       pt->AddText("OFF");
789       pt->SetBorderSize(1);       pt->SetBorderSize(1);
# Line 810  string titolocc[] ={"IPM1","IPM2","IPM3" Line 792  string titolocc[] ={"IPM1","IPM2","IPM3"
792       pt1->AddText("ON");       pt1->AddText("ON");
793       pt1->SetBorderSize(1);       pt1->SetBorderSize(1);
794       pt1->Draw();       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 "<<k+1<<" Voltage";  
      graph1->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");  
795            
796       TGraph *dearecord = new TGraph(recordstot, xrecordobtdea_1, ydea_1);       TGraph *dearecord = new TGraph(recordstot, xrecordobtdea_1, ydea_1);
797       dearecord->SetLineColor(kBlue);       dearecord->SetLineColor(kBlue);
# Line 851  string titolocc[] ={"IPM1","IPM2","IPM3" Line 799  string titolocc[] ={"IPM1","IPM2","IPM3"
799       dearecord->SetMarkerStyle(21);       dearecord->SetMarkerStyle(21);
800       dearecord->SetMarkerSize(0.5);       dearecord->SetMarkerSize(0.5);
801       dearecord->SetMarkerColor(kBlue);       dearecord->SetMarkerColor(kBlue);
802       dearecord->Draw("CPL");       dearecord->SetMinimum(0.0);
803         dearecord->SetMaximum(5.0);
804         dearecord->GetXaxis()->SetTitle("OBT");
805         dearecord->GetXaxis()->CenterTitle();
806         dearecord->GetYaxis()->SetTitle("Voltage value (V)");
807         dearecord->GetYaxis()->CenterTitle();
808         oss.str("");
809         oss <<  filename.Data()<<": IPM "<<k+1<<" output";
810         dearecord->SetTitle(oss.str().c_str());
811         dearecord->Draw("ACPLsame");
812    
813         Double_t xmin=dearecord->GetXaxis()->GetXmin();
814         Double_t xmax=dearecord->GetXaxis()->GetXmax();
815         TF1 *func1 = new TF1("func1", "0.65");
816         func1->SetRange(xmin, xmax);
817         func1->SetLineColor(2);
818         func1->SetLineStyle(1);
819         func1->SetLineWidth(2);
820         func1->Draw("Csame");
821    
822         TF1 *func2 = new TF1("func2", "3.15");
823         func2->SetRange(xmin, xmax);
824         func2->SetLineColor(2);
825         func2->SetLineStyle(1);
826         func2->SetLineWidth(2);
827         func2->Draw("Csame");
828    
829         TF1 *func3 = new TF1("func3", "4.25");
830         func3->SetRange(xmin, xmax);
831         func3->SetLineColor(2);
832         func3->SetLineStyle(1);
833         func3->SetLineWidth(2);
834         func3->Draw("Csame");
835    
836    
837         pt1->Draw();
838         pt->Draw();
839     }     }
840        
841        

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23