hi -

it has long been that the methods that dereference a const
datavector&lt;t&gt; (operator[], etc), return a `const t*',
even though the value_type is `t*'.

however, datavector&lt;t&gt;::const_iterator has been inconsistent with this,
in that dereferencing the iterator returns a `t*'.

we are trying to change this feature of datavector::const_iterator, so that
dereferencing it will also return a `const t*', consistent with
datavector.  we hope this will help catch instances where
data objects are unintentionally modified.

these changes are in datamodel-00-23-21.
unfortunately, this requires some changes in client packages.
(this is being tested in mig7.)

here are the changes in jetexamples that were
required to be compatible with these changes.
(the changes to the two packages are coupled.)


+verbatim+
index: src/lisbontutorial.cxx
===================================================================
--- src/lisbontutorial.cxx	(revision 447210)
+++ src/lisbontutorial.cxx	(working copy)
@@ -197,7 +197,8 @@
   for (; jetitr != jetitre; ++jetitr) {   
     
     // a pointer to the current jet
-    jet * myjet = (*jetitr);
+    // fixme: can modify jets in sg!
+    jet * myjet = const_cast&lt;jet*&gt; (*jetitr);
 
     m_jlog  &lt;&lt;  &quot; current jet is # &quot;&lt;&lt; currentjet &lt;&lt; &quot;  --------------------------------- &quot;&lt;&lt; std::endl;
 
-verbatim-


note, however, that this cast is needed because this code is explicitly
retrieving jets from sg and overwriting the jets' data.
recall that exactly this sort of thing is what caused the recent
jet kinematics bug.

now, this code is not used in production jobs, so fixing this is perhaps
not critical.  however, it may be setting a bad example for people,
if bits of code are copied from this package to elsewhere.  so what's
done here should probably be rethought.

i had this additionsl changes to fix gcc 4.6 warnings about unused variables.

+verbatim+
index: src/jettests.cxx
===================================================================
--- src/jettests.cxx	(revision 447210)
+++ src/jettests.cxx	(working copy)
@@ -484,10 +484,10 @@
   const analysis::trackassociation *tpc = jet-&gt;getassociation&lt;analysis::trackassociation&gt;(&quot;tracks&quot;);
   const analysis::muonassociation *mc = jet-&gt;getassociation&lt;analysis::muonassociation&gt;(&quot;muons&quot;);
   const analysis::electronassociation *ec = jet-&gt;getassociation&lt;analysis::electronassociation&gt;(&quot;electrons&quot;);
-  int ntrk_j=0, nmu_j=0, nel_j=0;
-  if(tpc) ntrk_j = tpc-&gt;ntracks();
-  if(mc) nmu_j = mc-&gt;size();
-  if(ec) nel_j = ec-&gt;size();
+  //int ntrk_j=0, nmu_j=0, nel_j=0;
+  //if(tpc) ntrk_j = tpc-&gt;ntracks();
+  //if(mc) nmu_j = mc-&gt;size();
+  //if(ec) nel_j = ec-&gt;size();
   //
   // loop over tracks in a jet
   if(tpc) {
-verbatim-


