Re: Bug in PndEmcHitProducer [message #10533 is a reply to message #10529] |
Wed, 14 April 2010 20:01 |
Elwin Dijck
Messages: 16 Registered: June 2009 Location: Groningen, The Netherland...
|
occasional visitor |
From: *mxp.dsl.internl.net
|
|
Hi all,
I don't think there was any problem with undefined values: if you try to access an element in a std::map that is not in the map using the []-operator, that element will be added with its default value. The default 'constructor' float() is not undefined and will simply give 0.0, so the usage of fTrackEnergy with += will work properly without explicit initialization.
However it is indeed true that fTrackTime needs initialization here, in the old code the result would always be the default value of zero since point_time is never < 0.
Regards,
Elwin
|
|
|