5 #pragma warning(disable:2259)
11 #pragma warning(disable:4996)
48 if ( 0 == name.find (
"/stat/" ) ){
return std::string( name , 6 ) ; }
56 if ( 0 == obj ) {
return rel ; }
58 if ( 0 == reg ) {
return rel ; }
61 if ( rel .
empty() ) {
return histoAddr ( name ) ; }
62 if (
'/' == name[name.size()-1] ||
63 '/' == rel[0] ) {
return histoAddr ( name + rel ) ; }
64 return histoAddr ( name +
"/" + rel ) ;
84 if (!hObj->annotation().addItem(
"id", obj.substr(1)))
85 hObj->annotation().setValue(
"id", obj.substr(1));
89 if (!hObj->annotation().addItem(
"id", obj))
90 hObj->annotation().setValue(
"id", obj);
99 TH3D *h3d = Gaudi::getRepresentation<IHistogram3D,TH3D>(h);
101 TH2D *h2d =
dynamic_cast<TH2D*
>(h3d->Project3D(dir.c_str()));
116 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
117 if(0 != b)
return b->print(s);
119 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
125 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
126 if(0 != b)
return b->write(s);
128 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
134 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
135 if(0 != b)
return b->write(file_name);
137 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
149 if (tmp.rfind(
SEPARATOR) == tmp.length()-1) {
154 (tmp.substr(0,sep),tmp.substr(sep,tmp.length()-sep));
164 if (tmpPath.rfind(
SEPARATOR) == tmpPath.length()-1) {
165 tmpPath.erase(tmpPath.rfind(
SEPARATOR),1);
173 std::string rest(tmpPath, sep+1, tmpPath.length()-sep);
189 if (0 != directory) {
196 log <<
MSG::ERROR <<
"Unable to create the histogram directory: "
197 << parentDir <<
"/" << subDir <<
endmsg;
204 log <<
MSG::ERROR <<
"Unable to create the histogram directory: "
205 << parentDir <<
"/" << subDir <<
endmsg;
227 tok.
analyse(ident.substr(loc+1,ident.length()),
" ",
"",
"",
"=",
"'",
"'");
230 CSTR tag = (*i).tag();
234 filename = (*i).value();
243 if (typ.length() > 0) {
247 entryname += logname;
252 filename,entryname,0,
'O');
256 filename,entryname,0,
'O');
262 log <<
MSG::INFO <<
"Added stream file:" << filename
263 <<
" as " << logname <<
endmsg;
270 log <<
MSG::ERROR <<
"Cannot add " << ident <<
" invalid filename!" <<
endmsg;
280 status =
setRoot(
"/stat", rootObj);
287 status =
service(
"HistogramPersistencySvc",svc,
true);
311 <<
" Path='" << ih->first <<
"'"
312 <<
" Description " << ih->second <<
endmsg ;
323 (
CSTR name,
const IHistogram2D& h,
int idxY1,
int idxY2) {
326 int firstbin = Gaudi::Axis::toRootIndex(idxY1,h.yAxis().bins());
327 int lastbin = Gaudi::Axis::toRootIndex(idxY2,h.yAxis().bins());
331 throw GaudiException(
"Cannot cast 2D histogram to H2D to create sliceX `"
338 throw GaudiException(
"Cannot create sliceX `" + name +
"' of 2D histogram!",
359 throw GaudiException(
"Cannot create sliceY `"+name+
"' of 2D histogram!",
366 if ( hist )
delete hist;
373 if ( m_defs1D.empty () )
377 if ( m_defs1D.end() == ifound )
382 <<
" Redefine the parameters for the histogram '" + hn +
"' to be "
386 m_mods1D.insert ( hn ) ;
387 return i_book ( pPar , rel , ifound ->
second.title () ,
389 ( ifound ->
second.title () ,
390 ifound ->
second.bins () ,
391 ifound ->
second.lowEdge () ,
392 ifound ->
second.lowEdge () ) ) ;
407 "Histograms with predefined parameters" ) ;
418 inline size_t removeLeading
422 m.
end() != it ; ++it )
424 if ( 0 == it->first.find ( lead ) )
427 Gaudi::Histo1DDef hdef = it->second ;
430 return 1 + removeLeading ( m , lead ) ;
440 removeLeading (
m_defs1D ,
"/stat/" ) ;
456 log <<
MSG::DEBUG <<
" Path='" << (*ih) <<
"'" ;
458 if (
m_defs1D.
end() != im ) { log <<
" " << im->second ; }