File indexing completed on 2024-04-06 12:22:58
0001 void test_AnyMap(){
0002
0003
0004 TSQLServer *db=TSQLServer::Connect("oracle://pccmsecdb:1521/ecalh4db","read01","XXXpasswordXXX");
0005
0006 gStyle->SetOptStat(0);
0007 gStyle->SetOptFit();
0008 gStyle->SetPalette(1,0);
0009 c1 = new TCanvas("c1","The Map",200,10,600,400);
0010 c1->SetGrid();
0011
0012
0013
0014 temp_chan = new TH2F("temp_chan","SM map", 85, -0.5, 84.5,20,-0.5, 19.5 );
0015 temp_chan->SetMaximum(8.);
0016 temp_chan->SetMinimum(3.);
0017
0018
0019
0020 char * sql="SELECT count(mon_run_iov.iov_id) from channelview, MON_LASER_BLUE_DAT , mon_run_iov , run_iov, run_tag, run_dat WHERE run_iov.iov_id=mon_run_iov.RUN_IOV_ID and channelview.id2=10 and mon_run_iov.iov_id=MON_LASER_BLUE_DAT.iov_id and channelview.logic_id=MON_LASER_BLUE_DAT.logic_id and channelview.name=channelview.maps_to and run_iov.tag_id=run_tag.tag_id and run_tag.LOCATION_ID=1 and run_dat.iov_id=run_iov.iov_id and run_dat.logic_id= 1041130013" ;
0021
0022 char * sql="SELECT channelview.id1, channelview.id2, CAST( MON_LASER_BLUE_DAT.APD_OVER_PN_MEAN AS NUMBER), run_iov.run_num from channelview,MON_LASER_BLUE_DAT , mon_run_iov, run_iov WHERE mon_run_iov.iov_id=(select mon_run_iov.iov_id from mon_run_iov where subrun_start=(select max(SUBRUN_START) from MON_RUN_IOV, RUN_IOV, RUN_TAG, run_type_def where RUN_iov.tag_id=RUN_tag.tag_id and RUN_tag.LOCATION_ID=1 and run_IOV.iov_id=mon_run_iov.run_iov_id and run_type_def.config_ver=1 and run_type_def.def_id=run_tag.RUN_TYPE_ID and run_type_def.run_type='LASER')) and run_iov.iov_id=mon_run_iov.run_iov_id and mon_run_iov.iov_id=MON_LASER_BLUE_DAT.iov_id and channelview.logic_id=MON_LASER_BLUE_DAT.logic_id and channelview.name=channelview.maps_to order by id1, id2 " ;
0023
0024 TSQLResult *res=db->Query(sql);
0025
0026 float temp=0;
0027 int chan=0;
0028 int j=0;
0029 int run_num=0;
0030 do {
0031 j++;
0032 TSQLRow *row1=res->Next();
0033 TOracleRow * row2=(TOracleRow *)row1;
0034
0035 for (int i=0; i<res->GetFieldCount();i++) {
0036
0037 if(i==1) chan=atoi( row2->GetField(i));
0038 if(i==2) temp=atof( row2->GetField(i));
0039 if(i==3) run_num==atoi( row2->GetField(i));
0040 }
0041
0042
0043 Float_t tpippo= (Float_t)temp;
0044 Float_t tchanx= (Float_t) ((chan-1)/20) ;
0045 Float_t tchany= (Float_t) ((chan-1)%20) ;
0046 temp_chan->Fill(tchanx, tchany, tpippo);
0047
0048
0049 delete row2;
0050
0051 } while (j<1700);
0052 cout << "run number: " << run_num << endl;
0053 cout <<"loop done "<< endl;
0054
0055
0056
0057
0058
0059
0060
0061 temp_chan->Draw("colz");
0062 c1->Update();
0063
0064
0065
0066 printf("end \n");
0067
0068 delete res;
0069 delete db;
0070
0071 }