22 void print_histogram( TH1*
h )
25 std::cout <<
"TpcLoadDistortionCorrection::InitRun - name: " << h->GetName() << std::endl;
26 for(
const auto& axis:{h->GetXaxis(), h->GetYaxis(), h->GetZaxis() } )
31 <<
" " << axis->GetName()
32 <<
" bins: " << axis->GetNbins()
33 <<
" min: " << axis->GetXmin()
34 <<
" max: " << axis->GetXmax()
38 std::cout << std::endl;
60 std::cout <<
"TpcLoadDistortionCorrection::InitRun - RUN Node missing, quitting" << std::endl;
65 for (
int i=0;
i<3;
i++){
70 auto distortion_correction_object = findNode::getClass<TpcDistortionCorrectionContainer>( topNode,
m_node_name[
i] );
71 if( !distortion_correction_object )
73 std::cout <<
"TpcLoadDistortionCorrection::InitRun - creating TpcDistortionCorrectionContainer in node " <<
m_node_name[
i] << std::endl;
76 runNode->addNode(
node);
79 std::cout <<
"TpcLoadDistortionCorrection::InitRun - reading corrections from " <<
m_correction_filename[
i] << std::endl;
83 std::cout <<
"TpcLoadDistortionCorrection::InitRun - cannot open " <<
m_correction_filename[
i] << std::endl;
87 const std::array<const std::string,2>
extension = {{
"_negz",
"_posz" }};
88 for(
int j =0;
j < 2; ++
j )
90 distortion_correction_object->m_hDPint[
j] =
dynamic_cast<TH1*
>(distortion_tfile->Get(Form(
"hIntDistortionP%s", extension[
j].c_str())));
assert( distortion_correction_object->m_hDPint[
j] );
91 distortion_correction_object->m_hDRint[
j] =
dynamic_cast<TH1*
>(distortion_tfile->Get(Form(
"hIntDistortionR%s", extension[
j].c_str())));
assert( distortion_correction_object->m_hDRint[
j] );
92 distortion_correction_object->m_hDZint[
j] =
dynamic_cast<TH1*
>(distortion_tfile->Get(Form(
"hIntDistortionZ%s", extension[
j].c_str())));
assert( distortion_correction_object->m_hDZint[
j] );
96 distortion_correction_object->dimensions = distortion_correction_object->m_hDPint[0]->GetDimension();
99 assert( distortion_correction_object->dimensions == 2 || distortion_correction_object->dimensions == 3 );
104 distortion_correction_object->m_hDPint[0], distortion_correction_object->m_hDPint[1],
105 distortion_correction_object->m_hDRint[0], distortion_correction_object->m_hDRint[1],
106 distortion_correction_object->m_hDZint[0], distortion_correction_object->m_hDZint[1] } )
107 { print_histogram( h ); }