Yes, it can be done this way. The difference is that,
if in the future one decides to extend other rec hit
classes with non-dummy setRawEnergy / eraw()
methods, rawEnergy.h would have to be updated
as well. As the necessity of this update is not documented
anywhere, I'd prefer to have the code that would
do the right thing automatically.

Regards,
Igor

On 04/01/2014 09:12 AM, slava77 wrote:
>
> In DataFormats/HcalRecHit/interface/rawEnergy.h:
>
> > @@ -0,0 +1,104 @@
> > +#ifndef DATAFORMATS_HCALRECHIT_RAWENERGY_H
> |template<T>
> void rawEnergySet(T& h, float v){};
>
> rawEnergySet<HBHERecHit>(HBHERecHit& h, float v){h.setRawEnergy(v);}
> |
>
> takes a few less lines and achieves about the same .. maybe I missed somth more subtle
>
> —
> Reply to this email directly or view it on GitHub <https://github.com/cms-sw/cmssw/pull/3102/files#r11161300>.
>