Changeset 286 in Idarraga


Ignore:
Timestamp:
Apr 20, 2012, 5:36:54 PM (12 years ago)
Author:
idarraga
Message:
 
Location:
mafalda
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • mafalda/AnalysisCore/MediPixAnalysisCore.cpp

    r222 r286  
    199199                m_scheduledForDisconnection.clear();
    200200
     201                // Clean up stuff cleanable on an event per event basis
     202                theManager->CleanUpCalibMap();
     203
    201204        }
    202205
  • mafalda/AnalysisCore/MediPixAnalysisManager.h

    r240 r286  
    9191        };
    9292
    93         inline Double_t GetMatrixElementMCEdep(Int_t col, Int_t row)
    94         {
     93        inline Double_t GetMatrixElementMCEdep(Int_t col, Int_t row) {
    9594                return analysisCore->m_frameXC_TruthE[row*analysisCore->fWidth + col];
    96                 //return analysisCore->m_frameMatrixMCEdep[col][row];
    97         };
     95        };
     96
     97        void SetCalibEnergy(Int_t xy, Double_t e) {
     98                m_frameCalibEnergyMap[xy] = (Int_t)e;
     99        };
     100        Int_t GetCalibEnergy(Int_t xy) {
     101                return m_frameCalibEnergyMap[xy];
     102        };
     103
     104        void CleanUpCalibMap(){
     105                m_frameCalibEnergyMap.clear();
     106        }
    98107
    99108        std::map<int,int> GetTOTMap()
     
    218227
    219228        inline TApplication * GetApplication()
    220                                                                 {return analysisCore->g_theApp;};
     229    {return analysisCore->g_theApp;};
     230
     231        void SetCalibEnergy(Int_t col, Int_t row, Double_t e);
     232        Int_t GetCalibEnergy(Int_t col, Int_t row);
    221233
    222234private:
     235
     236        // Data after Calibration.  This is held here.  Does not belong to the Core as it
     237        // doesn't come from data
     238        std::map<int,int> m_frameCalibEnergyMap;
    223239
    224240        MediPixAnalysisCore * analysisCore;
  • mafalda/MPXViewer/MPXViewer.cpp

    r179 r286  
    5353        feedBackInfo_New->autoAdjust = true;
    5454        feedBackInfo_New->m_plotTOT = true;
     55        feedBackInfo_New->m_plotCalib = false;
    5556        feedBackInfo_New->m_plotLvl1 = false;
    5657        feedBackInfo_New->m_plotMC = false;
     
    6263        feedBackInfo_Old->autoAdjust = true;
    6364        feedBackInfo_Old->m_plotTOT = true;
     65        feedBackInfo_Old->m_plotCalib = false;
    6466        feedBackInfo_Old->m_plotLvl1 = false;
    6567        feedBackInfo_Old->m_plotMC = false;
     
    239241
    240242                if ( feedBackInfo_New->m_plotTOT ) {
    241                         l1->DrawLatex(xposT, yposT + 5, "TOT");
     243                        l1->DrawLatex(xposT, yposT*1.05, "TOT");
     244                } else if ( feedBackInfo_New->m_plotCalib ) {
     245                        l1->DrawLatex(xposT, yposT*1.05, "Energy");
     246                        l1->DrawLatex(xposT, yposT*1.01, "[keV]");
    242247                } else if ( feedBackInfo_New->m_plotLvl1 ) {
    243                         l1->DrawLatex(xposT, yposT + 5, "LVL1");
     248                        l1->DrawLatex(xposT, yposT*1.05, "LVL1");
    244249                } else if ( feedBackInfo_New->m_plotMC ){
    245                         l1->DrawLatex(xposT, yposT + 5, "MC");
    246                         l1->DrawLatex(xposT, yposT + 1, "[keV]");
     250                        l1->DrawLatex(xposT, yposT*1.05, "MC");
     251                        l1->DrawLatex(xposT, yposT*1.01, "[keV]");
    247252                } else if ( feedBackInfo_New->m_plotTruthMC ){
    248                         l1->DrawLatex(xposT, yposT + 5, "TruthMC");
    249                         l1->DrawLatex(xposT, yposT + 1, "[keV]");
     253                        l1->DrawLatex(xposT, yposT*1.05, "TruthMC");
     254                        l1->DrawLatex(xposT, yposT*1.01, "[keV]");
    250255                }
    251256
     
    431436                {
    432437
    433                         if ( feedBackInfo_New->m_plotTOT ) {
     438                        if ( feedBackInfo_New->m_plotTOT ) {  // plot TOT or counts
    434439
    435440                                histFrame->Fill(colItr, rowItr, GetMatrixElement(colItr, rowItr));
    436441
    437 
    438                         } else if ( feedBackInfo_New->m_plotLvl1 ) {
     442                        }  else if ( feedBackInfo_New->m_plotCalib ) {  // plot Energy through Calib
     443
     444                                // lvl1 case, lvl1 is put to -1 if there is no lvl1 info available
     445                                if( GetCalibEnergy(colItr, rowItr) <= 0){
     446                                        histFrame->Fill(colItr, rowItr, 0);
     447                                }else{
     448                                        histFrame->Fill(colItr, rowItr, GetCalibEnergy(colItr, rowItr));
     449                                }
     450
     451                        } else if ( feedBackInfo_New->m_plotLvl1 ) {  // plot LVL1 info
    439452
    440453                                // lvl1 case, lvl1 is put to -1 if there is no lvl1 info available
     
    445458                                }
    446459
     460                        } else if ( feedBackInfo_New->m_plotTruthMC ) { // plot MC info
     461
     462                                histFrame->Fill(colItr, rowItr, GetMatrixElementMCEdep(colItr, rowItr));
    447463
    448464                        }
     465
     466
     467
    449468                }
    450469        }
  • mafalda/MPXViewer/ViewerControl.cpp

    r179 r286  
    327327        contentsSwitchPlot->AddFrame(m_plotSwitchTOT, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 2, 2));
    328328
     329        // Plot switch: Energy through calib
     330        m_plotSwitchCalib = new TGRadioButton(contentsSwitchPlot, "Enegy(calib)");
     331        m_plotSwitchCalib->SetOn(false, false); // tot by default
     332        m_plotSwitchCalib->Connect("Toggled(Bool_t)", "MPXViewerControl", this, "TooglePlotValue_Calib()");
     333        contentsSwitchPlot->AddFrame(m_plotSwitchCalib, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 2, 2));
     334
    329335        m_plotSwitchLvl1 = new TGRadioButton(contentsSwitchPlot, "lvl1");
    330336        m_plotSwitchLvl1->SetOn(false, false);
     
    563569void MPXViewerControl::TooglePlotValue_TOT(){
    564570        m_plotSwitchTOT->SetOn     (true, true);
     571        m_plotSwitchCalib->SetOn   (false, false);
    565572        m_plotSwitchLvl1->SetOn    (false, false);
    566573        m_plotSwitchMC->SetOn      (false, false);
     
    568575        feedBackInfoControl->SetPlotExclusive(__TOT);
    569576}
     577void MPXViewerControl::TooglePlotValue_Calib(){
     578        m_plotSwitchTOT->SetOn     (false, false);
     579        m_plotSwitchCalib->SetOn     (true, true);
     580        m_plotSwitchLvl1->SetOn    (false, false);
     581        m_plotSwitchMC->SetOn      (false, false);
     582        m_plotSwitchTruthMC->SetOn (false, false);
     583        feedBackInfoControl->SetPlotExclusive(__Calib);
     584}
     585
    570586void MPXViewerControl::TooglePlotValue_lvl1(){
    571587        m_plotSwitchTOT->SetOn     (false, false);
     588        m_plotSwitchCalib->SetOn   (false, false);
    572589        m_plotSwitchLvl1->SetOn    (true, true);
    573590        m_plotSwitchMC->SetOn      (false, false);
     
    577594void MPXViewerControl::TooglePlotValue_MC(){
    578595        m_plotSwitchTOT->SetOn     (false, false);
     596        m_plotSwitchCalib->SetOn   (false, false);
    579597        m_plotSwitchLvl1->SetOn    (false, false);
    580598        m_plotSwitchMC->SetOn      (true, true);
     
    584602void MPXViewerControl::TooglePlotValue_TMC(){
    585603        m_plotSwitchTOT->SetOn     (false, false);
     604        m_plotSwitchCalib->SetOn   (false, false);
    586605        m_plotSwitchLvl1->SetOn    (false, false);
    587606        m_plotSwitchMC->SetOn      (false, false);
     
    798817void MPXViewerControl::DisconnectAndRun(){
    799818
     819        // Optional save config
     820        SaveConfiguration();
     821
    800822        // Through the feedBack MPXViewer will Schedule itself for disconnection
    801823        feedBackInfoControl->m_disconnect = true;
  • mafalda/MPXViewer/ViewerControl.h

    r179 r286  
    106106typedef enum {
    107107        __TOT = 0,
     108        __Calib,
    108109        __LVL1,
    109110        __MC,
     
    120121  Bool_t autoAdjust;
    121122  Bool_t m_plotTOT;
     123  Bool_t m_plotCalib;
    122124  Bool_t m_plotLvl1;
    123125  Bool_t m_plotMC;
     
    131133
    132134  void SetPlotExclusive(plotVar i){
    133           if(i == __TOT)      { m_plotTOT = true;  m_plotLvl1 = false; m_plotMC = false; m_plotTruthMC = false; }
    134           if(i == __LVL1)     { m_plotTOT = false; m_plotLvl1 = true;  m_plotMC = false; m_plotTruthMC = false; }
    135           if(i == __MC)       { m_plotTOT = false; m_plotLvl1 = false; m_plotMC = true;  m_plotTruthMC = false; }
    136           if(i == __TRUTH_MC) { m_plotTOT = false; m_plotLvl1 = false; m_plotMC = false; m_plotTruthMC = true; }
     135          if(i == __TOT)      { m_plotTOT = true;  m_plotCalib = false; m_plotLvl1 = false; m_plotMC = false; m_plotTruthMC = false; }
     136          if(i == __Calib)      { m_plotTOT = false;  m_plotCalib = true; m_plotLvl1 = false; m_plotMC = false; m_plotTruthMC = false; }
     137          if(i == __LVL1)     { m_plotTOT = false; m_plotCalib = false; m_plotLvl1 = true;  m_plotMC = false; m_plotTruthMC = false; }
     138          if(i == __MC)       { m_plotTOT = false; m_plotCalib = false; m_plotLvl1 = false; m_plotMC = true;  m_plotTruthMC = false; }
     139          if(i == __TRUTH_MC) { m_plotTOT = false; m_plotCalib = false; m_plotLvl1 = false; m_plotMC = false; m_plotTruthMC = true; }
    137140  };
    138141
     
    224227   // Plot switches
    225228   TGRadioButton * m_plotSwitchTOT;
     229   TGRadioButton * m_plotSwitchCalib;
    226230   TGRadioButton * m_plotSwitchLvl1;
    227231   TGRadioButton * m_plotSwitchMC; // energy with digitizer effects
     
    274278  void ToogleAutoAdjust();
    275279  void TooglePlotValue_TOT();
     280  void TooglePlotValue_Calib();
    276281  void TooglePlotValue_lvl1();
    277282  void TooglePlotValue_MC();
Note: See TracChangeset for help on using the changeset viewer.