Hi Slava,

The point is to have the ability to use this function in
a code templated upon the type of rechit: HBHERecHit,
HFRecHit, HORecHit, etc. This is useful because only the
HBHERecHit class has the methods setRawEnergy and eraw.

Inclusion of  "Alignment/Geners/interface/IOIsClassType.hh"
does not cause a linker dependency. I don't think there could
be a problem there.

You don't want to have an extra, let say, boolean parameter
in the template (with the idea to use it in a switch) because
the code will not compile.

You don't want to have an extra template parameter in the
template because you would have to specialize the whole template,
and there could be many such templates.

You do not want to have a dummy setRawEnergy / eraw() in other
Hcal classes because a) the users of those classes might not realize
that they are dummy and b) it is not your business to decide what
value dummy eraw() should return -- it should be up to the user. At
the same time, you do not want to hamper eraw() with an additional
argument for those cases when that additional argument is not needed.

That code belongs in DataFormats/HcalRecHit because it is to be used
with various Hcal rechit classes defined in that package. There is no
better place for it.

This class is not parsed by ROOT.

Hope this answers all of the design concerns.

Regards,
Igor

On 04/01/2014 05:46 AM, slava77 wrote:
>
> In DataFormats/HcalRecHit/interface/rawEnergy.h:
>
> > @@ -0,0 +1,104 @@
> > +#ifndef DATAFORMATS_HCALRECHIT_RAWENERGY_H
>
> What's the point of this?
>
> DataFormats can't depend on Alignment packages.
> If I parsed this correctly, this is needed for some templated code that would either call or not this set method.
> IMHO, it's cleaner just to add a parameter to that template with an argument explicitly controlling this method is called.
> A dummy inline setRawEnergy in other Hcal classes is even more transparent.
>
> If you still like it so much, I think this code does not belong in DataFromats.
>
> @Dr15Jones <https://github.com/Dr15Jones> @ktf <https://github.com/ktf> would ROOT parse this well?
>
> —
> Reply to this email directly or view it on GitHub <https://github.com/cms-sw/cmssw/pull/3102/files#r11155206>.
>