Changeset 286 in Idarraga
- Timestamp:
- Apr 20, 2012, 5:36:54 PM (12 years ago)
- Location:
- mafalda
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
mafalda/AnalysisCore/MediPixAnalysisCore.cpp
r222 r286 199 199 m_scheduledForDisconnection.clear(); 200 200 201 // Clean up stuff cleanable on an event per event basis 202 theManager->CleanUpCalibMap(); 203 201 204 } 202 205 -
mafalda/AnalysisCore/MediPixAnalysisManager.h
r240 r286 91 91 }; 92 92 93 inline Double_t GetMatrixElementMCEdep(Int_t col, Int_t row) 94 { 93 inline Double_t GetMatrixElementMCEdep(Int_t col, Int_t row) { 95 94 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 } 98 107 99 108 std::map<int,int> GetTOTMap() … … 218 227 219 228 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); 221 233 222 234 private: 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; 223 239 224 240 MediPixAnalysisCore * analysisCore; -
mafalda/MPXViewer/MPXViewer.cpp
r179 r286 53 53 feedBackInfo_New->autoAdjust = true; 54 54 feedBackInfo_New->m_plotTOT = true; 55 feedBackInfo_New->m_plotCalib = false; 55 56 feedBackInfo_New->m_plotLvl1 = false; 56 57 feedBackInfo_New->m_plotMC = false; … … 62 63 feedBackInfo_Old->autoAdjust = true; 63 64 feedBackInfo_Old->m_plotTOT = true; 65 feedBackInfo_Old->m_plotCalib = false; 64 66 feedBackInfo_Old->m_plotLvl1 = false; 65 67 feedBackInfo_Old->m_plotMC = false; … … 239 241 240 242 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]"); 242 247 } else if ( feedBackInfo_New->m_plotLvl1 ) { 243 l1->DrawLatex(xposT, yposT +5, "LVL1");248 l1->DrawLatex(xposT, yposT*1.05, "LVL1"); 244 249 } 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]"); 247 252 } 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]"); 250 255 } 251 256 … … 431 436 { 432 437 433 if ( feedBackInfo_New->m_plotTOT ) { 438 if ( feedBackInfo_New->m_plotTOT ) { // plot TOT or counts 434 439 435 440 histFrame->Fill(colItr, rowItr, GetMatrixElement(colItr, rowItr)); 436 441 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 439 452 440 453 // lvl1 case, lvl1 is put to -1 if there is no lvl1 info available … … 445 458 } 446 459 460 } else if ( feedBackInfo_New->m_plotTruthMC ) { // plot MC info 461 462 histFrame->Fill(colItr, rowItr, GetMatrixElementMCEdep(colItr, rowItr)); 447 463 448 464 } 465 466 467 449 468 } 450 469 } -
mafalda/MPXViewer/ViewerControl.cpp
r179 r286 327 327 contentsSwitchPlot->AddFrame(m_plotSwitchTOT, new TGLayoutHints(kLHintsTop | kLHintsLeft, 5, 5, 2, 2)); 328 328 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 329 335 m_plotSwitchLvl1 = new TGRadioButton(contentsSwitchPlot, "lvl1"); 330 336 m_plotSwitchLvl1->SetOn(false, false); … … 563 569 void MPXViewerControl::TooglePlotValue_TOT(){ 564 570 m_plotSwitchTOT->SetOn (true, true); 571 m_plotSwitchCalib->SetOn (false, false); 565 572 m_plotSwitchLvl1->SetOn (false, false); 566 573 m_plotSwitchMC->SetOn (false, false); … … 568 575 feedBackInfoControl->SetPlotExclusive(__TOT); 569 576 } 577 void 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 570 586 void MPXViewerControl::TooglePlotValue_lvl1(){ 571 587 m_plotSwitchTOT->SetOn (false, false); 588 m_plotSwitchCalib->SetOn (false, false); 572 589 m_plotSwitchLvl1->SetOn (true, true); 573 590 m_plotSwitchMC->SetOn (false, false); … … 577 594 void MPXViewerControl::TooglePlotValue_MC(){ 578 595 m_plotSwitchTOT->SetOn (false, false); 596 m_plotSwitchCalib->SetOn (false, false); 579 597 m_plotSwitchLvl1->SetOn (false, false); 580 598 m_plotSwitchMC->SetOn (true, true); … … 584 602 void MPXViewerControl::TooglePlotValue_TMC(){ 585 603 m_plotSwitchTOT->SetOn (false, false); 604 m_plotSwitchCalib->SetOn (false, false); 586 605 m_plotSwitchLvl1->SetOn (false, false); 587 606 m_plotSwitchMC->SetOn (false, false); … … 798 817 void MPXViewerControl::DisconnectAndRun(){ 799 818 819 // Optional save config 820 SaveConfiguration(); 821 800 822 // Through the feedBack MPXViewer will Schedule itself for disconnection 801 823 feedBackInfoControl->m_disconnect = true; -
mafalda/MPXViewer/ViewerControl.h
r179 r286 106 106 typedef enum { 107 107 __TOT = 0, 108 __Calib, 108 109 __LVL1, 109 110 __MC, … … 120 121 Bool_t autoAdjust; 121 122 Bool_t m_plotTOT; 123 Bool_t m_plotCalib; 122 124 Bool_t m_plotLvl1; 123 125 Bool_t m_plotMC; … … 131 133 132 134 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; } 137 140 }; 138 141 … … 224 227 // Plot switches 225 228 TGRadioButton * m_plotSwitchTOT; 229 TGRadioButton * m_plotSwitchCalib; 226 230 TGRadioButton * m_plotSwitchLvl1; 227 231 TGRadioButton * m_plotSwitchMC; // energy with digitizer effects … … 274 278 void ToogleAutoAdjust(); 275 279 void TooglePlotValue_TOT(); 280 void TooglePlotValue_Calib(); 276 281 void TooglePlotValue_lvl1(); 277 282 void TooglePlotValue_MC();
Note: See TracChangeset
for help on using the changeset viewer.