20 #include "GaudiKernel/ITHistSvc.h"
25 m_testsPerSurface(100),
28 m_surfaceAttempts(6,0),
29 m_surfaceSuccessful(6,0),
31 m_surfaceNamesSet(6,false),
43 ATH_MSG_INFO(
"Test statistics output ---------------------- (start) -------------");
44 for (
size_t it = 0;
it < m_surfaces.size(); ++
it){
45 if (m_surfaceNamesSet[
it]){
46 ATH_MSG_INFO(
"Tested " << m_surfaces[
it] <<
" created "<< m_surfaceNames[
it] <<
" objects.");
47 ATH_MSG_INFO(
" -> Result [ attempts / successful (percentage)] : "
48 << m_surfaceAttempts[
it] <<
" / " << m_surfaceSuccessful[
it]
49 <<
" ( " <<
double(m_surfaceSuccessful[
it])/m_surfaceAttempts[
it] <<
" )" );
52 ATH_MSG_INFO(
"Test statistics output ----------------------- (end) --------------");
59 if ( m_surfaceBuilder.retrieve().isFailure() ){
60 ATH_MSG_FATAL(
"Could not retrieve surface builder. Aborting.");
61 return StatusCode::FAILURE;
64 return StatusCode::SUCCESS;
83 ++m_surfaces[
static_cast<int>(sType)];
86 if (!m_surfaceNamesSet[
static_cast<int>(sType)]) {
87 m_surfaceNames[
static_cast<int>(sType)] =
sf->name();
88 m_surfaceNamesSet[
static_cast<int>(sType)] =
true;
91 TString
treeName =
"IntersectionTest_Event";
93 TTree* currentTree =
new TTree(
treeName.Data(),
"Intersection");
95 TTree* currentInfoTree =
new TTree(
treeName.Data(),
"Surface Information");
97 SmartIF<ITHistSvc> tHistSvc;
98 if (m_writeTTree && (tHistSvc = service(
"THistSvc")).
isValid()) {
99 ATH_MSG_FATAL(
"initialize() Could not find Hist Service! Aborting." );
100 return StatusCode::FAILURE;
103 TString fullTreeName = m_treeFolder+
"Intersection_Event";
104 fullTreeName += m_eventCounter;
105 fullTreeName +=
"_Number";
107 fullTreeName +=
"_"+
sf->name();
109 if (m_writeTTree && tHistSvc->regTree(fullTreeName.Data(), currentTree).isFailure()) {
110 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree! Aborting." );
112 return StatusCode::FAILURE;
115 TString fullInfoTreeName = m_treeFolder+
"SurfaceInfo_Event";
116 fullInfoTreeName += m_eventCounter;
117 fullInfoTreeName +=
"_Number";
118 fullInfoTreeName +=
it;
119 fullInfoTreeName +=
"_"+
sf->name();
120 if (m_writeTTree && tHistSvc->regTree(fullInfoTreeName.Data(), currentInfoTree).isFailure()) {
121 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree! Aborting." );
122 delete currentInfoTree;
123 return StatusCode::FAILURE;
132 intersectionBranch.
initForWrite(*currentTree,
"Intersection_",3);
135 for (
size_t ist = 0; ist < m_testsPerSurface; ++ist){
147 direction = direction.normalized();
152 ++m_surfaceAttempts[
static_cast<int>(sType)];
155 ++m_surfaceSuccessful[
static_cast<int>(sType)];
166 if (m_writeTTree) currentInfoTree->Fill();
171 return StatusCode::SUCCESS;