5 #pragma warning(disable:2259)
11 #pragma warning(disable:4996)
47 if ( 0 == name.find (
"/stat/" ) ){
return std::string( name , 6 ) ; }
55 if ( 0 == obj ) {
return rel ; }
57 if ( 0 == reg ) {
return rel ; }
60 if ( rel .
empty() ) {
return histoAddr ( name ) ; }
61 if (
'/' == name[name.size()-1] ||
62 '/' == rel[0] ) {
return histoAddr ( name + rel ) ; }
63 return histoAddr ( name +
"/" + rel ) ;
83 if (!hObj->annotation().addItem(
"id", obj.substr(1)))
84 hObj->annotation().setValue(
"id", obj.substr(1));
88 if (!hObj->annotation().addItem(
"id", obj))
89 hObj->annotation().setValue(
"id", obj);
98 TH3D *h3d = Gaudi::getRepresentation<IHistogram3D,TH3D>(h);
100 TH2D *h2d =
dynamic_cast<TH2D*
>(h3d->Project3D(dir.c_str()));
115 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
116 if(0 != b)
return b->print(s);
118 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
124 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
125 if(0 != b)
return b->write(s);
127 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
133 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(h);
134 if(0 != b)
return b->write(file_name);
136 log <<
MSG::ERROR <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase."
148 if (tmp.rfind(
SEPARATOR) == tmp.length()-1) {
153 (tmp.substr(0,sep),tmp.substr(sep,tmp.length()-sep));
163 if (tmpPath.rfind(
SEPARATOR) == tmpPath.length()-1) {
164 tmpPath.erase(tmpPath.rfind(
SEPARATOR),1);
172 std::string rest(tmpPath, sep+1, tmpPath.length()-sep);
188 if (0 != directory) {
195 log <<
MSG::ERROR <<
"Unable to create the histogram directory: "
196 << parentDir <<
"/" << subDir <<
endmsg;
203 log <<
MSG::ERROR <<
"Unable to create the histogram directory: "
204 << parentDir <<
"/" << subDir <<
endmsg;
226 tok.
analyse(ident.substr(loc+1,ident.length()),
" ",
"",
"",
"=",
"'",
"'");
229 CSTR tag = (*i).tag();
233 filename = (*i).value();
242 if (typ.length() > 0) {
246 entryname += logname;
251 filename,entryname,0,
'O');
255 filename,entryname,0,
'O');
261 log <<
MSG::INFO <<
"Added stream file:" << filename
262 <<
" as " << logname <<
endmsg;
269 log <<
MSG::ERROR <<
"Cannot add " << ident <<
" invalid filename!" <<
endmsg;
279 status =
setRoot(
"/stat", rootObj);
286 status =
service(
"HistogramPersistencySvc",svc,
true);
310 <<
" Path='" << ih->first <<
"'"
311 <<
" Description " << ih->second <<
endmsg ;
322 (
CSTR name,
const IHistogram2D& h,
int idxY1,
int idxY2) {
325 int firstbin = Gaudi::Axis::toRootIndex(idxY1,h.yAxis().bins());
326 int lastbin = Gaudi::Axis::toRootIndex(idxY2,h.yAxis().bins());
330 throw GaudiException(
"Cannot cast 2D histogram to H2D to create sliceX `"
337 throw GaudiException(
"Cannot create sliceX `" + name +
"' of 2D histogram!",
358 throw GaudiException(
"Cannot create sliceY `"+name+
"' of 2D histogram!",
365 if ( hist )
delete hist;
372 if ( m_defs1D.empty () )
376 if ( m_defs1D.end() == ifound )
381 <<
" Redefine the parameters for the histogram '" + hn +
"' to be "
385 m_mods1D.insert ( hn ) ;
386 return i_book ( pPar , rel , ifound ->
second.title () ,
388 ( ifound ->
second.title () ,
389 ifound ->
second.bins () ,
390 ifound ->
second.lowEdge () ,
391 ifound ->
second.lowEdge () ) ) ;
406 "Histograms with predefined parameters" ) ;
417 inline size_t removeLeading
421 m.
end() != it ; ++it )
423 if ( 0 == it->first.find ( lead ) )
426 Gaudi::Histo1DDef hdef = it->second ;
429 return 1 + removeLeading ( m , lead ) ;
439 removeLeading (
m_defs1D ,
"/stat/" ) ;
455 log <<
MSG::DEBUG <<
" Path='" << (*ih) <<
"'" ;
457 if (
m_defs1D.
end() != im ) { log <<
" " << im->second ; }