Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EnergyCalibFit.m File Reference

Go to the source code of this file.

Functions

 DataSet (i).E
 
 fprintf ('processing%s\n', filename)
 
end DrawDataSet (DataSet, ones(1, Ndata), 'Inputs')
 
 SaveCanvas (['EnergyCalibFIt'], gcf)
 
 disp (object_function(ones(1, Ndata+N_Runs-1), DataSet, 10))
 
 disp (object_function(ones(1, Ndata+N_Runs-1), DataSet, 2))
 
 disp (object_function(ones(1, Ndata+N_Runs-1), DataSet, 1))
 
 DrawDataSet (DataSet, calib_const,'Optimized')
 
 dlmwrite (filename,[total_E calib_total_E])
 
end save ('fit.mat')
 
 save ('goodfit.mat')
 

Variables

clear all close all const double Es []
 
const double runs []
 
 RunList
 
 N_Runs = size(RunList, 2)
 
 sim_const = 2.409/100
 
 sim_stat = 11.77/100
 
 Ndata = 20
 
Readin global DataSet DataSet =struct('run',{},'E',{},'DE',{},'data',{})
 
for i
 
 filename = sprintf('beam_0000%d-0000_DSTReader.root_DrawPrototype2EMCalTower_Prototype2_DSTReader.dat', DataSet(i).run )
 
 data = textread(filename)
 
 total_E = sum(data, 2)
 
 options = optimset('Display','iter','TolFun',10000, 'MaxFunEvals', 100000,'MaxIter',100000,'PlotFcns',@optimplotfval )
 
 x
 
 calib_const = abs(x(1:Ndata))
 
 calib_total_E = sum( DataSet(i).data* calib_const', 2)
 

Function Documentation

DataSet ( i  )
disp ( object_function(ones(1, Ndata+N_Runs-1), DataSet, 10)  )

Referenced by PHG4GDMLWriteSolids::BooleanWrite(), and PHG4GDMLWriteStructure::TraverseVolumeTree().

+ Here is the caller graph for this function:

disp ( object_function(ones(1, Ndata+N_Runs-1), DataSet, 2)  )
disp ( object_function(ones(1, Ndata+N_Runs-1), DataSet, 1)  )
dlmwrite ( filename  )
end DrawDataSet ( DataSet  ,
ones(1, Ndata ,
'Inputs'   
)
DrawDataSet ( DataSet  ,
calib_const  ,
'Optimized'   
)
save ( 'goodfit.mat'  )
SaveCanvas ( gcf  )

Variable Documentation

calib_const = abs(x(1:Ndata))

Definition at line 77 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 77 of file EnergyCalibFit.m

calib_total_E = sum( DataSet(i).data* calib_const', 2)

Definition at line 89 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 89 of file EnergyCalibFit.m

DataSet(N_Runs data = textread(filename)

Definition at line 36 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 36 of file EnergyCalibFit.m

Readin global DataSet DataSet =struct('run',{},'E',{},'DE',{},'data',{})

Definition at line 24 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 24 of file EnergyCalibFit.m

Referenced by TPCMLDataInterface::process_event().

clear all close all const double Es[]
Initial value:
=
% { 2, 3 , 4, 8, 12 , 16 }

Definition at line 7 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 7 of file EnergyCalibFit.m

Referenced by DrawEMCalTower_Resolution(), DrawPrototype2EMCalTower_Resolution(), and DrawPrototype2EMCalTower_ResolutionRecalib().

filename = sprintf('beam_0000%d-0000_DSTReader.root_DrawPrototype2EMCalTower_Prototype2_DSTReader.dat', DataSet(i).run )

Definition at line 32 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 32 of file EnergyCalibFit.m

Referenced by TpcSpaceChargeMatrixInversion::add_from_file(), Acts::Python::addMagneticField(), ana_hijbkg(), ActsExamples::CsvSpacePointReader::CsvSpacePointReader(), daq_device_file::daq_device_file(), daq_device_filenumbers::daq_device_filenumbers(), ActsExamples::determineEventFilesRange(), DirectPhotonPythia::DirectPhotonPythia(), OnCalServer::dumpHistos(), Fun4AllHistoManager::dumpHistos(), ElectronID::ElectronID(), HydroFromFile::EvolveHydro(), PHG4Reco::export_geometry(), Fun4All_Calo(), Fun4All_EMCal(), Fun4All_EMCal_Hist(), Fun4All_EMCal_sp(), Fun4All_TrkrClusteringSeeding(), Fun4All_TrkrHitSet_Unpacker(), Jetscape::TrentoInitial::GenCenTab(), generate_ep_dis(), TSQLImportClient::GET(), GetSimRejCurve(), CDBInterface::getUrl(), groot100(), handle_this_child(), HFFastSim::HFFastSim(), HFJetTruthTrigger::HFJetTruthTrigger(), HFMLTriggerHepMCTrigger::HFMLTriggerHepMCTrigger(), HFMLTriggerInterface::HFMLTriggerInterface(), HFMLTriggerOccupancy::HFMLTriggerOccupancy(), OnlMonClient::htmlNamer(), daq_device_filenumbers::identify(), daq_device_file::identify(), init(), Jetscape::PartonPrinter::Init(), initialise(), PHG4Reco::InitRun(), likelihood(), MachineLearning_CSV(), main(), minBiasRecoAna(), OnlineAnalysis(), Hydroinfo_MUSIC::output_temperature_evolution(), plot_histos(), prdfoStream::prdfoStream(), daq_device_filenumbers::put_data(), daq_device_file::put_data(), Quarkonia2LeptonsMC::Quarkonia2LeptonsMC(), ActsExamples::CsvSpacePointReader::read(), Martini::readElasticRateOmega(), Martini::readElasticRateQ(), ReadFieldMap(), readFile(), HydroinfoH5::readHydroinfoH5(), NcollListFromFile::ReadNbcList(), IPGlasmaWrapper::ReadNbcList(), Martini::readRadiativeRate(), OnlMonHtml::registerPage(), planarity::run_on_biconnected(), FieldMaps::SaveMaps(), MyMonDraw::SavePlot(), LL1MonDraw::SavePlot(), DaqMonDraw::SavePlot(), ZdcMonDraw::SavePlot(), CemcMonDraw::SavePlot(), TpcMonDraw::SavePlot(), SepdMonDraw::SavePlot(), HcalMonDraw::SavePlot(), PktSizeMonDraw::SavePlot(), MvtxMonDraw::SavePlot(), TpotMonDraw::SavePlot(), BbcMonDraw::SavePlot(), InttMonDraw::SavePlot(), PHFieldConfigv1::set_filename(), TpcSpaceChargeMatrixInversion::set_outputfile(), TpcDirectLaserReconstruction::set_outputfile(), TpcSpaceChargeReconstruction::set_outputfile(), PHG4TpcPadBaselineShift::setFileName(), HydroinfoH5::setHydroFiles(), Fun4AllHistoManager::setOutfileName(), SecondaryVertexFinder::setOutfileName(), sPHAnalysis::sPHAnalysis(), sPHAnalysis_calo::sPHAnalysis_calo(), OnlMonServer::WriteHistoFile(), HydroinfoH5::writeHydroBlock(), writeTimeOrderedDistortions(), and zdc_calib().

Save out for i
Initial value:
= 1:N_Runs
DataSet(i).run = RunList(2,i)

Definition at line 26 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 26 of file EnergyCalibFit.m

N_Runs = size(RunList, 2)

Definition at line 16 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 16 of file EnergyCalibFit.m

Ndata = 20

Definition at line 20 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 20 of file EnergyCalibFit.m

options = optimset('Display','iter','TolFun',10000, 'MaxFunEvals', 100000,'MaxIter',100000,'PlotFcns',@optimplotfval )

Definition at line 58 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 58 of file EnergyCalibFit.m

RunList
Initial value:
= [
2, 3 , 4, 8, 12 , 16
2042,2040, 2039, 2038, 2067, 2063
]

Definition at line 12 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 12 of file EnergyCalibFit.m

const double runs[]
Initial value:
=
% { 2042,2040, 2039, 2038, 2067, 2063 }

Definition at line 9 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 9 of file EnergyCalibFit.m

Referenced by DrawPrototype2EMCalTower_Resolution(), DrawPrototype2EMCalTower_ResolutionRecalib(), and main().

sim_const = 2.409/100

Definition at line 18 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 18 of file EnergyCalibFit.m

sim_stat = 11.77/100

Definition at line 19 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 19 of file EnergyCalibFit.m

total_E = sum(data, 2)

Definition at line 39 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 39 of file EnergyCalibFit.m

x
Initial value:
= fminsearch(@(x) object_function(x,DataSet, 10),ones(1, Ndata + N_Runs -1),...

Definition at line 60 of file EnergyCalibFit.m.

View newest version in sPHENIX GitHub at line 60 of file EnergyCalibFit.m