Changeset 11802 for trunk


Ignore:
Timestamp:
08/05/11 21:27:58 (14 years ago)
Author:
tbretz
Message:
Added persistant raw data display mode.
Location:
trunk/FACT++/gui
Files:
2 edited

Legend:

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

    r11798 r11802  
    2626#include "TSystem.h"
    2727#include "TGraph.h"
    28 #include "TH1.h"
     28#include "TH2.h"
    2929#include "TBox.h"
    3030#include "TStyle.h"
     
    11781178        TH1 *d2 = dynamic_cast<TH1*>(c->FindObject("DrsCalib2"));
    11791179
    1180         if (hf && hf->GetNbinsX()!=fEventData->Roi)
     1180        if ((hf && hf->GetNbinsX()!=fEventData->Roi) ||
     1181            (dynamic_cast<TH2*>(h) && !fAdcPersistant->isChecked()) ||
     1182            (!dynamic_cast<TH2*>(h) && fAdcPersistant->isChecked()))
    11811183        {
    11821184            delete hf;
     
    11971199            hf->SetDirectory(0);
    11981200            hf->SetBit(kCanDelete);
    1199             hf->SetStats(kFALSE);
    1200             hf->SetYTitle("Voltage [mV]");
    1201             hf->GetXaxis()->CenterTitle();
    1202             hf->GetYaxis()->CenterTitle();
    1203             hf->SetMinimum(-1026);
    1204             hf->SetMaximum(1025);
    1205 
    1206             h = new TH1F("EventData", "", roi, -0.5, roi-0.5);
     1201            hf->SetStats(kFALSE);
     1202            hf->SetYTitle("Voltage [mV]");
     1203            hf->GetXaxis()->CenterTitle();
     1204            hf->GetYaxis()->CenterTitle();
     1205            hf->SetMinimum(-1250);
     1206            hf->SetMaximum(2150);
     1207
     1208            if (!fAdcPersistant->isChecked())
     1209                h = new TH1F("EventData", "", roi, -0.5, roi-0.5);
     1210            else
     1211            {
     1212                h = new TH2F("EventData", "", roi, -0.5, roi-0.5, 3301, -1150.5, 2150.5);
     1213                h->SetContour(50);
     1214                gStyle->SetPalette(1, 0);
     1215            }
     1216
    12071217            h->SetDirectory(0);
    12081218            h->SetBit(kCanDelete);
    1209             h->SetMarkerStyle(kFullDotMedium);
    1210             h->SetMarkerColor(kBlue);
     1219            h->SetMarkerStyle(kFullDotMedium);
     1220            h->SetMarkerColor(kBlue);
     1221
    12111222
    12121223            d0 = new TH1F("DrsCalib0", "", roi, -0.5, roi-0.5);
     
    12321243
    12331244            hf->Draw("");
     1245
     1246            if (dynamic_cast<TH2*>(h))
     1247                h->Draw("col same");
     1248
    12341249            d0->Draw("PEX0same");
    12351250            d1->Draw("PEX0same");
    1236             d2->Draw("PEX0same");
    1237             h->Draw("PLsame");
     1251            d2->Draw("PEX0same");
     1252
     1253            if (!dynamic_cast<TH2*>(h))
     1254                h->Draw("PLsame");
    12381255
    12391256            gPad = NULL;
     
    12691286            d2->Reset();
    12701287
    1271         h->SetEntries(0);
     1288        if (!dynamic_cast<TH2*>(h))
     1289            h->Reset();
    12721290        d0->SetEntries(0);
    12731291        d1->SetEntries(0);
     
    12761294        for (int i=0; i<fEventData->Roi; i++)
    12771295        {
    1278             h->SetBinContent(i+1, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
     1296            //if (dynamic_cast<TH2*>(h))
     1297                h->Fill(i, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
     1298            //else
     1299            //    h->SetBinContent(i+1, reinterpret_cast<float*>(fEventData->Adc_Data)[p*fEventData->Roi+i]);
    12791300            if (start<0)
    12801301                continue;
     
    12991320
    13001321        // -----------------------------------------------------------
    1301 
    1302         if (fAdcDynamicScale->isChecked())
     1322        if (fAdcDynamicScale->isEnabled() && fAdcDynamicScale->isChecked())
    13031323        {
    13041324            h->SetMinimum();
     
    13081328            hf->SetMaximum(h->GetMaximum());
    13091329        }
    1310         if (fAdcManualScale->isChecked())
     1330        if (fAdcManualScale->isEnabled() && fAdcManualScale->isChecked())
    13111331        {
    13121332            if (h->GetMinimumStored()==-1111)
     
    13221342        }
    13231343
    1324         if (fAdcAutoScale->isChecked())
     1344        if (fAdcAutoScale->isEnabled() && fAdcAutoScale->isChecked())
    13251345        {
    13261346            h->SetMinimum();
     
    13311351            if (h->GetMaximum()>hf->GetMaximum())
    13321352                hf->SetMaximum(h->GetMaximum());
     1353        }
     1354
     1355        if (dynamic_cast<TH2*>(h))
     1356        {
     1357            h->SetMinimum();
     1358            h->SetMaximum();
    13331359        }
    13341360
     
    13531379        for (int i=0; i<fEventData->Roi; i++)
    13541380        {
    1355             hd.Fill(h->GetBinContent(i+1));
     1381            if (!dynamic_cast<TH2*>(h))
     1382                hd.Fill(h->GetBinContent(i+1));
    13561383            h0.Fill(d0->GetBinContent(i+1));
    13571384            h1.Fill(d1->GetBinContent(i+1));
  • trunk/FACT++/gui/design.ui

    r11797 r11802  
    1111    <x>0</x>
    1212    <y>0</y>
    13     <width>1316</width>
    14     <height>965</height>
     13    <width>1186</width>
     14    <height>850</height>
    1515   </rect>
    1616  </property>
     
    5353      </property>
    5454      <property name="currentIndex">
    55        <number>2</number>
     55       <number>5</number>
    5656      </property>
    5757      <property name="documentMode">
     
    68936893              </item>
    68946894              <item>
     6895               <spacer name="verticalSpacer_55">
     6896                <property name="orientation">
     6897                 <enum>Qt::Vertical</enum>
     6898                </property>
     6899                <property name="sizeType">
     6900                 <enum>QSizePolicy::Fixed</enum>
     6901                </property>
     6902                <property name="sizeHint" stdset="0">
     6903                 <size>
     6904                  <width>20</width>
     6905                  <height>10</height>
     6906                 </size>
     6907                </property>
     6908               </spacer>
     6909              </item>
     6910              <item>
     6911               <widget class="QCheckBox" name="fAdcPersistant">
     6912                <property name="text">
     6913                 <string>Persistant</string>
     6914                </property>
     6915               </widget>
     6916              </item>
     6917              <item>
    68956918               <spacer name="verticalSpacer_32">
    68966919                <property name="orientation">
     
    87398762     <x>0</x>
    87408763     <y>0</y>
    8741      <width>1316</width>
     8764     <width>1186</width>
    87428765     <height>21</height>
    87438766    </rect>
     
    89809003   <property name="minimumSize">
    89819004    <size>
    8982      <width>287</width>
    8983      <height>803</height>
     9005     <width>241</width>
     9006     <height>687</height>
    89849007    </size>
    89859008   </property>
     
    99089931   <hints>
    99099932    <hint type="sourcelabel">
    9910      <x>918</x>
    9911      <y>647</y>
     9933     <x>1080</x>
     9934     <y>772</y>
    99129935    </hint>
    99139936    <hint type="destinationlabel">
    9914      <x>773</x>
    9915      <y>739</y>
     9937     <x>774</x>
     9938     <y>821</y>
    99169939    </hint>
    99179940   </hints>
     
    99249947   <hints>
    99259948    <hint type="sourcelabel">
    9926      <x>907</x>
     9949     <x>1069</x>
    99279950     <y>109</y>
    99289951    </hint>
     
    99409963   <hints>
    99419964    <hint type="sourcelabel">
    9942      <x>979</x>
    9943      <y>647</y>
     9965     <x>1141</x>
     9966     <y>772</y>
    99449967    </hint>
    99459968    <hint type="destinationlabel">
    9946      <x>937</x>
    9947      <y>739</y>
     9969     <x>938</x>
     9970     <y>821</y>
    99489971    </hint>
    99499972   </hints>
     
    99569979   <hints>
    99579980    <hint type="sourcelabel">
    9958      <x>1014</x>
    9959      <y>647</y>
     9981     <x>1176</x>
     9982     <y>772</y>
    99609983    </hint>
    99619984    <hint type="destinationlabel">
    9962      <x>925</x>
    9963      <y>739</y>
     9985     <x>926</x>
     9986     <y>821</y>
    99649987    </hint>
    99659988   </hints>
     
    99729995   <hints>
    99739996    <hint type="sourcelabel">
    9974      <x>968</x>
     9997     <x>1130</x>
    99759998     <y>109</y>
    99769999    </hint>
     
    998810011   <hints>
    998910012    <hint type="sourcelabel">
    9990      <x>1003</x>
     10013     <x>1165</x>
    999110014     <y>109</y>
    999210015    </hint>
     
    1000410027   <hints>
    1000510028    <hint type="sourcelabel">
    10006      <x>946</x>
    10007      <y>570</y>
     10029     <x>1108</x>
     10030     <y>695</y>
    1000810031    </hint>
    1000910032    <hint type="destinationlabel">
    10010      <x>1003</x>
    10011      <y>571</y>
     10033     <x>1165</x>
     10034     <y>696</y>
    1001210035    </hint>
    1001310036   </hints>
     
    1002010043   <hints>
    1002110044    <hint type="sourcelabel">
    10022      <x>907</x>
     10045     <x>1069</x>
    1002310046     <y>105</y>
    1002410047    </hint>
     
    1003610059   <hints>
    1003710060    <hint type="sourcelabel">
    10038      <x>968</x>
     10061     <x>1130</x>
    1003910062     <y>105</y>
    1004010063    </hint>
     
    1005210075   <hints>
    1005310076    <hint type="sourcelabel">
    10054      <x>1003</x>
     10077     <x>1165</x>
    1005510078     <y>105</y>
    1005610079    </hint>
     
    1010010123   <hints>
    1010110124    <hint type="sourcelabel">
    10102      <x>946</x>
    10103      <y>570</y>
     10125     <x>1108</x>
     10126     <y>695</y>
    1010410127    </hint>
    1010510128    <hint type="destinationlabel">
    10106      <x>1003</x>
    10107      <y>571</y>
     10129     <x>1165</x>
     10130     <y>696</y>
    1010810131    </hint>
    1010910132   </hints>
     
    1021210235   <hints>
    1021310236    <hint type="sourcelabel">
    10214      <x>907</x>
    10215      <y>371</y>
     10237     <x>1069</x>
     10238     <y>442</y>
    1021610239    </hint>
    1021710240    <hint type="destinationlabel">
     
    1022810251   <hints>
    1022910252    <hint type="sourcelabel">
    10230      <x>968</x>
    10231      <y>371</y>
     10253     <x>1130</x>
     10254     <y>442</y>
    1023210255    </hint>
    1023310256    <hint type="destinationlabel">
     
    1024410267   <hints>
    1024510268    <hint type="sourcelabel">
    10246      <x>1003</x>
    10247      <y>371</y>
     10269     <x>1165</x>
     10270     <y>442</y>
    1024810271    </hint>
    1024910272    <hint type="destinationlabel">
     
    1025310276   </hints>
    1025410277  </connection>
     10278  <connection>
     10279   <sender>fAdcPersistant</sender>
     10280   <signal>toggled(bool)</signal>
     10281   <receiver>fAdcAutoScale</receiver>
     10282   <slot>setDisabled(bool)</slot>
     10283   <hints>
     10284    <hint type="sourcelabel">
     10285     <x>1086</x>
     10286     <y>423</y>
     10287    </hint>
     10288    <hint type="destinationlabel">
     10289     <x>1113</x>
     10290     <y>382</y>
     10291    </hint>
     10292   </hints>
     10293  </connection>
     10294  <connection>
     10295   <sender>fAdcPersistant</sender>
     10296   <signal>toggled(bool)</signal>
     10297   <receiver>fAdcDynamicScale</receiver>
     10298   <slot>setDisabled(bool)</slot>
     10299   <hints>
     10300    <hint type="sourcelabel">
     10301     <x>1152</x>
     10302     <y>431</y>
     10303    </hint>
     10304    <hint type="destinationlabel">
     10305     <x>1153</x>
     10306     <y>367</y>
     10307    </hint>
     10308   </hints>
     10309  </connection>
     10310  <connection>
     10311   <sender>fAdcPersistant</sender>
     10312   <signal>toggled(bool)</signal>
     10313   <receiver>fAdcManualScale</receiver>
     10314   <slot>setDisabled(bool)</slot>
     10315   <hints>
     10316    <hint type="sourcelabel">
     10317     <x>1134</x>
     10318     <y>420</y>
     10319    </hint>
     10320    <hint type="destinationlabel">
     10321     <x>1127</x>
     10322     <y>342</y>
     10323    </hint>
     10324   </hints>
     10325  </connection>
    1025510326 </connections>
    1025610327</ui>
Note: See TracChangeset for help on using the changeset viewer.