Changeset 11850 for trunk


Ignore:
Timestamp:
08/08/11 19:40:10 (13 years ago)
Author:
tbretz
Message:
Added the possibility to switch off the drs calibration display - does only work yet in case of update of the service.
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/FactGui.h

    r11847 r11850  
    12081208            delete d1;
    12091209            delete d2;
     1210            d0 = 0;
     1211            d1 = 0;
     1212            d2 = 0;
    12101213            hf = 0;
    12111214        }
     1215        const int roi = fEventData->Roi>0 ? fEventData->Roi : 1;
     1216
     1217        c->cd();
    12121218
    12131219        if (!hf)
    12141220        {
    1215             c->cd();
    1216 
    1217             const int roi = fEventData->Roi>0 ? fEventData->Roi : 1;
    1218 
    12191221            hf = new TH1F("Frame", "", roi, -0.5, roi-0.5);
    12201222            hf->SetDirectory(0);
     
    12411243            h->SetMarkerColor(kBlue);
    12421244
    1243 
     1245            hf->Draw("");
     1246
     1247            if (dynamic_cast<TH2*>(h))
     1248                h->Draw("col same");
     1249        }
     1250
     1251        if (d0 && !(fDrsCalibBaselineOn->isChecked() && fDrsCalibBaseline->value()>0))
     1252        {
     1253            delete d0;
     1254            d0 = 0;
     1255        }
     1256        if (d1 && !(fDrsCalibGainOn->isChecked() && fDrsCalibGain->value()>0))
     1257        {
     1258            delete d1;
     1259            d1 = 0;
     1260        }
     1261        if (d2 && !(fDrsCalibTrgOffsetOn->isChecked() && fDrsCalibTrgOffset->value()>0))
     1262        {
     1263            delete d2;
     1264            d2 = 0;
     1265        }
     1266
     1267        if (!d0 && fDrsCalibBaselineOn->isChecked() && fDrsCalibBaseline->value()>0)
     1268        {
    12441269            d0 = new TH1F("DrsCalib0", "", roi, -0.5, roi-0.5);
    12451270            d0->SetDirectory(0);
     
    12481273            d0->SetMarkerColor(kRed);
    12491274            d0->SetLineColor(kRed);
    1250 
     1275            d0->Draw("PEX0same");
     1276        }
     1277
     1278        if (!d1 && fDrsCalibGainOn->isChecked() && fDrsCalibGain->value()>0)
     1279        {
    12511280            d1 = new TH1F("DrsCalib1", "", roi, -0.5, roi-0.5);
    12521281            d1->SetDirectory(0);
     
    12541283            d1->SetMarkerStyle(kFullDotSmall);
    12551284            d1->SetMarkerColor(kMagenta);
    1256             d1->SetLineColor(kMagenta);
    1257 
     1285            d1->SetLineColor(kMagenta);
     1286            d1->Draw("PEX0same");
     1287        }
     1288
     1289        if (!d2 && fDrsCalibTrgOffsetOn->isChecked() && fDrsCalibTrgOffset->value()>0)
     1290        {
    12581291            d2 = new TH1F("DrsCalib2", "", roi, -0.5, roi-0.5);
    12591292            d2->SetDirectory(0);
     
    12611294            d2->SetMarkerStyle(kFullDotSmall);
    12621295            d2->SetMarkerColor(kGreen);
    1263             d2->SetLineColor(kGreen);
    1264 
    1265             hf->Draw("");
    1266 
    1267             if (dynamic_cast<TH2*>(h))
    1268                 h->Draw("col same");
    1269 
    1270             d0->Draw("PEX0same");
    1271             d1->Draw("PEX0same");
     1296            d2->SetLineColor(kGreen);
    12721297            d2->Draw("PEX0same");
    1273 
    1274             if (!dynamic_cast<TH2*>(h))
    1275                 h->Draw("PLsame");
    1276 
    1277             gPad = NULL;
    1278         }
     1298        }
     1299
     1300        if (!dynamic_cast<TH2*>(h) && !c->GetListOfPrimitives()->FindObject(h))
     1301            h->Draw("PLsame");
    12791302
    12801303        // -----------------------------------------------------------
     
    13011324        const int16_t start = fEventData->StartPix[p];
    13021325
    1303         if (fDrsCalibBaseline->value()==0  || start<0)
     1326        fDrsCalibBaseline->setEnabled(fDrsCalibBaseline->value()>0);
     1327        fDrsCalibGain->setEnabled(fDrsCalibGain->value()>0);
     1328        fDrsCalibTrgOffset->setEnabled(fDrsCalibTrgOffset->value()>0);
     1329
     1330        if (d0)//fDrsCalibBaseline->value()==0  || start<0)
    13041331            d0->Reset();
    1305         if (fDrsCalibGain->value()==0      || start<0)
     1332        if (d1)//fDrsCalibGain->value()==0      || start<0)
    13061333            d1->Reset();
    1307         if (fDrsCalibTrgOffset->value()==0 || start<0)
     1334        if (d2)//fDrsCalibTrgOffset->value()==0 || start<0)
    13081335            d2->Reset();
    13091336
    13101337        if (!dynamic_cast<TH2*>(h))
    13111338            h->Reset();
    1312         d0->SetEntries(0);
    1313         d1->SetEntries(0);
    1314         d2->SetEntries(0);
     1339        if (d0)
     1340            d0->SetEntries(0);
     1341        if (d1)
     1342            d1->SetEntries(0);
     1343        if (d2)
     1344            d2->SetEntries(0);
    13151345
    13161346        for (int i=0; i<fEventData->Roi; i++)
     
    13231353                continue;
    13241354
    1325             if (fDrsCalibBaseline->value()>0)
     1355            if (d0)
    13261356            {
    13271357                d0->SetBinContent(i+1, fDrsCalibration[1440*1024*0 + p*1024+(start+i)%1024]);
     
    13291359
    13301360            }
    1331             if (fDrsCalibGain->value()>0)
     1361            if (d1)
    13321362            {
    13331363                d1->SetBinContent(i+1, fDrsCalibration[1440*1024*2 + p*1024+(start+i)%1024]);
    13341364                d1->SetBinError(i+1,   fDrsCalibration[1440*1024*3 + p*1024+(start+i)%1024]);
    13351365            }
    1336             if (fDrsCalibTrgOffset->value()>0)
     1366            if (d2)
    13371367            {
    13381368                d2->SetBinContent(i+1, fDrsCalibration[1440*1024*4 + p*1024 + i]);
     
    13951425        h2.SetDirectory(0);
    13961426        hd.SetLineColor(h->GetLineColor());
    1397         h0.SetLineColor(d0->GetLineColor());
    1398         h1.SetLineColor(d1->GetLineColor());
    1399         h2.SetLineColor(d2->GetLineColor());
     1427        if (d0)
     1428            h0.SetLineColor(d0->GetLineColor());
     1429        if (d1)
     1430            h1.SetLineColor(d1->GetLineColor());
     1431        if (d2)
     1432            h2.SetLineColor(d2->GetLineColor());
    14001433
    14011434        for (int i=0; i<fEventData->Roi; i++)
     
    14031436            if (!dynamic_cast<TH2*>(h))
    14041437                hd.Fill(h->GetBinContent(i+1));
    1405             h0.Fill(d0->GetBinContent(i+1));
    1406             h1.Fill(d1->GetBinContent(i+1));
    1407             h2.Fill(d2->GetBinContent(i+1));
     1438            if (d0)
     1439                h0.Fill(d0->GetBinContent(i+1));
     1440            if (d1)
     1441                h1.Fill(d1->GetBinContent(i+1));
     1442            if (d2)
     1443                h2.Fill(d2->GetBinContent(i+1));
    14081444        }
    14091445
  • trunk/FACT++/gui/design.ui

    r11847 r11850  
    1111    <x>0</x>
    1212    <y>0</y>
    13     <width>1206</width>
     13    <width>1236</width>
    1414    <height>885</height>
    1515   </rect>
     
    5353      </property>
    5454      <property name="currentIndex">
    55        <number>7</number>
     55       <number>5</number>
    5656      </property>
    5757      <property name="documentMode">
     
    39743974                  </item>
    39753975                  <item>
     3976                   <spacer name="horizontalSpacer_54">
     3977                    <property name="orientation">
     3978                     <enum>Qt::Horizontal</enum>
     3979                    </property>
     3980                    <property name="sizeHint" stdset="0">
     3981                     <size>
     3982                      <width>40</width>
     3983                      <height>20</height>
     3984                     </size>
     3985                    </property>
     3986                   </spacer>
     3987                  </item>
     3988                  <item>
    39763989                   <widget class="QGroupBox" name="groupBox_10">
    39773990                    <property name="title">
     
    72197232              </item>
    72207233              <item>
    7221                <widget class="QSpinBox" name="fDrsCalibBaseline">
    7222                 <property name="alignment">
    7223                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    7224                 </property>
    7225                 <property name="readOnly">
    7226                  <bool>true</bool>
    7227                 </property>
    7228                 <property name="buttonSymbols">
    7229                  <enum>QAbstractSpinBox::NoButtons</enum>
    7230                 </property>
    7231                 <property name="prefix">
    7232                  <string/>
    7233                 </property>
    7234                 <property name="maximum">
    7235                  <number>9999</number>
    7236                 </property>
    7237                </widget>
     7234               <layout class="QHBoxLayout" name="horizontalLayout_40">
     7235                <property name="topMargin">
     7236                 <number>0</number>
     7237                </property>
     7238                <item>
     7239                 <widget class="QCheckBox" name="fDrsCalibBaselineOn">
     7240                  <property name="sizePolicy">
     7241                   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
     7242                    <horstretch>0</horstretch>
     7243                    <verstretch>0</verstretch>
     7244                   </sizepolicy>
     7245                  </property>
     7246                  <property name="minimumSize">
     7247                   <size>
     7248                    <width>0</width>
     7249                    <height>0</height>
     7250                   </size>
     7251                  </property>
     7252                  <property name="maximumSize">
     7253                   <size>
     7254                    <width>20</width>
     7255                    <height>16777215</height>
     7256                   </size>
     7257                  </property>
     7258                  <property name="text">
     7259                   <string/>
     7260                  </property>
     7261                  <property name="checked">
     7262                   <bool>true</bool>
     7263                  </property>
     7264                 </widget>
     7265                </item>
     7266                <item>
     7267                 <widget class="QSpinBox" name="fDrsCalibBaseline">
     7268                  <property name="alignment">
     7269                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     7270                  </property>
     7271                  <property name="readOnly">
     7272                   <bool>true</bool>
     7273                  </property>
     7274                  <property name="buttonSymbols">
     7275                   <enum>QAbstractSpinBox::NoButtons</enum>
     7276                  </property>
     7277                  <property name="prefix">
     7278                   <string/>
     7279                  </property>
     7280                  <property name="maximum">
     7281                   <number>9999</number>
     7282                  </property>
     7283                 </widget>
     7284                </item>
     7285               </layout>
    72387286              </item>
    72397287              <item>
     
    72457293              </item>
    72467294              <item>
    7247                <widget class="QSpinBox" name="fDrsCalibGain">
    7248                 <property name="alignment">
    7249                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    7250                 </property>
    7251                 <property name="readOnly">
    7252                  <bool>true</bool>
    7253                 </property>
    7254                 <property name="buttonSymbols">
    7255                  <enum>QAbstractSpinBox::NoButtons</enum>
    7256                 </property>
    7257                 <property name="prefix">
    7258                  <string/>
    7259                 </property>
    7260                 <property name="maximum">
    7261                  <number>9999</number>
    7262                 </property>
    7263                </widget>
     7295               <layout class="QHBoxLayout" name="horizontalLayout_41">
     7296                <property name="topMargin">
     7297                 <number>0</number>
     7298                </property>
     7299                <item>
     7300                 <widget class="QCheckBox" name="fDrsCalibGainOn">
     7301                  <property name="sizePolicy">
     7302                   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
     7303                    <horstretch>0</horstretch>
     7304                    <verstretch>0</verstretch>
     7305                   </sizepolicy>
     7306                  </property>
     7307                  <property name="minimumSize">
     7308                   <size>
     7309                    <width>0</width>
     7310                    <height>0</height>
     7311                   </size>
     7312                  </property>
     7313                  <property name="maximumSize">
     7314                   <size>
     7315                    <width>20</width>
     7316                    <height>16777215</height>
     7317                   </size>
     7318                  </property>
     7319                  <property name="text">
     7320                   <string/>
     7321                  </property>
     7322                  <property name="checked">
     7323                   <bool>true</bool>
     7324                  </property>
     7325                 </widget>
     7326                </item>
     7327                <item>
     7328                 <widget class="QSpinBox" name="fDrsCalibGain">
     7329                  <property name="alignment">
     7330                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     7331                  </property>
     7332                  <property name="readOnly">
     7333                   <bool>true</bool>
     7334                  </property>
     7335                  <property name="buttonSymbols">
     7336                   <enum>QAbstractSpinBox::NoButtons</enum>
     7337                  </property>
     7338                  <property name="prefix">
     7339                   <string/>
     7340                  </property>
     7341                  <property name="maximum">
     7342                   <number>9999</number>
     7343                  </property>
     7344                 </widget>
     7345                </item>
     7346               </layout>
    72647347              </item>
    72657348              <item>
     
    72717354              </item>
    72727355              <item>
    7273                <widget class="QSpinBox" name="fDrsCalibTrgOffset">
    7274                 <property name="alignment">
    7275                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
    7276                 </property>
    7277                 <property name="readOnly">
    7278                  <bool>true</bool>
    7279                 </property>
    7280                 <property name="buttonSymbols">
    7281                  <enum>QAbstractSpinBox::NoButtons</enum>
    7282                 </property>
    7283                 <property name="prefix">
    7284                  <string/>
    7285                 </property>
    7286                 <property name="maximum">
    7287                  <number>9999</number>
    7288                 </property>
    7289                </widget>
     7356               <layout class="QHBoxLayout" name="horizontalLayout_42">
     7357                <property name="topMargin">
     7358                 <number>0</number>
     7359                </property>
     7360                <item>
     7361                 <widget class="QCheckBox" name="fDrsCalibTrgOffsetOn">
     7362                  <property name="sizePolicy">
     7363                   <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
     7364                    <horstretch>0</horstretch>
     7365                    <verstretch>0</verstretch>
     7366                   </sizepolicy>
     7367                  </property>
     7368                  <property name="minimumSize">
     7369                   <size>
     7370                    <width>0</width>
     7371                    <height>0</height>
     7372                   </size>
     7373                  </property>
     7374                  <property name="maximumSize">
     7375                   <size>
     7376                    <width>20</width>
     7377                    <height>16777215</height>
     7378                   </size>
     7379                  </property>
     7380                  <property name="text">
     7381                   <string/>
     7382                  </property>
     7383                  <property name="checked">
     7384                   <bool>true</bool>
     7385                  </property>
     7386                 </widget>
     7387                </item>
     7388                <item>
     7389                 <widget class="QSpinBox" name="fDrsCalibTrgOffset">
     7390                  <property name="alignment">
     7391                   <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
     7392                  </property>
     7393                  <property name="readOnly">
     7394                   <bool>true</bool>
     7395                  </property>
     7396                  <property name="buttonSymbols">
     7397                   <enum>QAbstractSpinBox::NoButtons</enum>
     7398                  </property>
     7399                  <property name="prefix">
     7400                   <string/>
     7401                  </property>
     7402                  <property name="maximum">
     7403                   <number>9999</number>
     7404                  </property>
     7405                 </widget>
     7406                </item>
     7407               </layout>
    72907408              </item>
    72917409             </layout>
     
    1310513223     <x>0</x>
    1310613224     <y>0</y>
    13107      <width>1206</width>
     13225     <width>1236</width>
    1310813226     <height>21</height>
    1310913227    </rect>
Note: See TracChangeset for help on using the changeset viewer.