Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
25 # pragma warning( disable : 1572 )
33 if ( cmd.
find(
"genconf" ) != std::string::npos )
return;
35 info() <<
"Read handler called for property: " << p <<
endmsg;
45 info() <<
"Update handler called for property: " << os.
str() <<
endmsg;
60 if ( cmd.
find(
"genconf" ) != std::string::npos )
return;
63 info() <<
"Before Initialization......" <<
endmsg;
84 info() <<
"PDouble = " << os.
str() <<
endmsg;
100 info() <<
"After Initialization having read the JobOptions file..." <<
endmsg;
122 info() <<
"PDouble = " << os.
str() <<
endmsg;
134 for (
unsigned int i = 0; i < doublearrayunits.size(); i++ ) {
136 if ( doublearrayunits[i] != doublearray[i] ) {
137 error() <<
format(
"DoubleArrayWithUnits[%d] = %g and should be %g", i, doublearrayunits[i], doublearray[i] )
140 info() <<
format(
"DoubleArrayWithUnits[%d] = %g", i, doublearrayunits[i] ) <<
endmsg;
147 info() <<
"===============Checking Property Verifier ===============" <<
endmsg;
149 info() <<
"Playing with PropertyVerifiers..." <<
endmsg;
151 p_int.verifier().setBounds( 0, 200 );
156 info() <<
format(
"PInt= %d [should be 155, bounds are %d, %d]", (
int)
p_int, (
int)
p_int.verifier().lower(),
157 (
int)
p_int.verifier().upper() )
161 }
catch ( ... ) { info() <<
"Got an exception when setting a value outside bounds" <<
endmsg; }
162 info() <<
"PInt= " <<
p_int <<
" [should be 155]" <<
endmsg;
167 info() <<
"===============Checking Property CallBaks ===============" <<
endmsg;
170 info() <<
"Accessing PDouble ... " <<
endmsg;
173 info() <<
"Value obtained is: " << d <<
endmsg;
175 info() <<
"Updating PDouble ... " <<
endmsg;
182 info() <<
"==========Checking Accesing Properties by string=========" <<
endmsg;
187 error() <<
"Unable to locate the ApplicationMgr" <<
endmsg;
190 appmgr->getProperty(
"ExtSvc", value ).ignore();
191 info() <<
" Got property ApplicationMgr.ExtSvc = " << value <<
";" <<
endmsg;
193 appmgr->setPropertyRepr(
"ExtSvc",
"[\"EvtDataSvc/EventDataSvc\", \"DetDataSvc/DetectorDataSvc\"]" ).ignore();
194 info() <<
" Set property ApplicationMgr.ExtSvc = "
195 <<
" [\"EvtDataSvc/EventDataSvc\", \"DetDataSvc/DetectorDataSvc\"]"
197 appmgr->getProperty(
"ExtSvc", value ).ignore();
198 info() <<
" Got property ApplicationMgr.ExtSvc = " << value <<
";" <<
endmsg;
200 appmgr->setPropertyRepr(
"ExtSvc",
"[ 'EventDataSvc', 'DetectorDataSvc']" ).ignore();
201 info() <<
" Set property ApplicationMgr.ExtSvc = "
202 <<
" [ 'EventDataSvc', 'DetectorDataSvc']"
204 appmgr->getProperty(
"ExtSvc", value ).ignore();
205 info() <<
" Got property ApplicationMgr.ExtSvc = " << value <<
";" <<
endmsg;
216 for (
auto&
c : cases ) {
221 if ( !sc || (
p_bool != std::get<1>(
c ) ) ) {
222 error() <<
"PBool can not be set to " << std::get<0>(
c ) <<
endmsg;
227 if ( !sc || (
m_bool != std::get<1>(
c ) ) ) { error() <<
"Bool can not be set to " << std::get<0>(
c ) <<
endmsg; }
233 newlog <<
MSG::DEBUG <<
"This should be printed if threshold is DEBUG" <<
endmsg;
234 newlog <<
MSG::INFO <<
"This should be printed if threshold is INFO" <<
endmsg;
236 newlog <<
MSG::ERROR <<
"This should be printed if threshold is ERROR" <<
endmsg;
237 newlog <<
MSG::FATAL <<
"This should be printed if threshold is FATAL" <<
endmsg;
244 info() <<
"=================================================" <<
endmsg;
246 auto opt_items =
opts.items();
247 ostream_joiner( info() <<
"Dump of the property catalogue:\n", opt_items,
'\n',
249 return os << std::get<0>( item ) <<
": " << std::get<1>( item );
252 info() <<
"=================================================" <<
endmsg;
255 opts.set(
name() +
'.' +
"PInt",
"154" );
256 info() <<
"PInt= " <<
p_int <<
" [should be 154]" <<
endmsg;
261 info() <<
"Try to assign invalid value to DoubleArray" <<
endmsg;
262 opts.set(
name() +
'.' +
"DoubleArray",
"{\"12.12\", \"13.13\"}" );
266 info() <<
"Try to assign invalid value to StringMap" <<
endmsg;
267 opts.set(
name() +
'.' +
"StringMap",
"{\"one\", {\"une\", \"eins\"}}" );
273 info() <<
"=================================================" <<
endmsg;
280 info() <<
"executing...." <<
endmsg;
287 info() <<
"finalizing...." <<
endmsg;
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Gaudi::Property< std::vector< double > > m_doublearray
Gaudi::Property< std::vector< double > > m_emptyarray
StatusCode initialize() override
Three mandatory member functions of any algorithm.
Gaudi::Property< std::vector< std::string > > m_stringarray
Gaudi::Property< std::vector< std::string > > p_stringarray
const std::string & name() const override
The identifying name of the algorithm object.
Gaudi::Property< std::map< std::string, std::string > > m_strmap
Gaudi::PropertyWithReadHandler< double > p_double
Alias for backward compatibility.
Gaudi::Property< bool > p_bool
Gaudi::Property< std::vector< std::pair< int, int > > > u_intpairarray
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
PropertyAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor of this form must be provided.
void readHandler(Gaudi::Details::PropertyBase &)
Callbacks for properties.
Gaudi::Property< std::vector< double > > p_doublearray
Gaudi::Property< std::vector< long long > > m_int64array
Gaudi::Property< std::string > p_string
Gaudi::Property< unsigned long long > m_uint64
Gaudi::Property< std::vector< bool > > p_boolarray
StatusCode setPropertyRepr(const std::string &n, const std::string &r) override
set the property from name and value string representation
const ValueType & value() const
Gaudi::Property< std::vector< int > > m_intarray
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Gaudi::Property< std::vector< double > > u_doublearrayunits
ParsingErrorPolicy setParsingErrorPolicy(ParsingErrorPolicy p)
Gaudi::Property< std::vector< std::pair< double, double > > > u_doublepairarray
Gaudi::Property< std::string > m_string
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Gaudi::CheckedProperty< int > p_int
Gaudi::Property< std::vector< unsigned long long > > m_uint64array
constexpr static const auto SUCCESS
StatusCode execute() override
Gaudi::Property< bool > m_bool
#define DECLARE_COMPONENT(type)
GAUDI_API const std::vector< std::string > cmdLineArgs()
Command line arguments including executable name as arg[0] as vector of strings.
void updateHandler(Gaudi::Details::PropertyBase &)
Gaudi::Property< std::vector< bool > > m_boolarray
Gaudi::Property< double > m_double
Gaudi::Property< std::vector< int > > p_intarray
constexpr static const auto FAILURE
StatusCode finalize() override
Gaudi::Property< long long > m_int64
Gaudi::Property< int > m_int
These data members are used in the execution of this algorithm They are set in the initialization pha...
Gaudi::Property< std::vector< double > > u_doublearray
const char * what() const override
method from std::exception
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})