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.

here are the changes in jetsimtools that were required to be
compatible with these changes.

+verbatim+
index: src/jetparticleinconetool.cxx
===================================================================
--- src/jetparticleinconetool.cxx	(revision 447210)
+++ src/jetparticleinconetool.cxx	(working copy)
@@ -78,7 +78,7 @@
 
   // create containers
   m_jetl = new std::list&lt; jet* &gt;();
-  m_jparticle = new std::list&lt; jet* &gt;();
+  m_jparticle = new std::list&lt; const jet* &gt;();
 
   // get truth particle container 
   const datahandle&lt; jetcollection &gt; pjetov;
@@ -147,9 +147,9 @@
   std::list&lt;jet*&gt;::const_iterator jetb = m_jreco-&gt;begin();
   std::list&lt;jet*&gt;::const_iterator jete = m_jreco-&gt;end(); 
 
-  std::list&lt;jet*&gt;::const_iterator pjeti;
-  std::list&lt;jet*&gt;::const_iterator pjetb = m_jparticle-&gt;begin();
-  std::list&lt;jet*&gt;::const_iterator pjete = m_jparticle-&gt;end(); 
+  std::list&lt;const jet*&gt;::const_iterator pjeti;
+  std::list&lt;const jet*&gt;::const_iterator pjetb = m_jparticle-&gt;begin();
+  std::list&lt;const jet*&gt;::const_iterator pjete = m_jparticle-&gt;end(); 
 
   int psiz = m_jreco-&gt;size();
   //  int vsiz = m_jparticle-&gt;size();
index: src/jetsofttruthtool.cxx
===================================================================
--- src/jetsofttruthtool.cxx	(revision 447210)
+++ src/jetsofttruthtool.cxx	(working copy)
@@ -196,8 +196,8 @@
   if (msglvl( msg::info )) msg( msg::info ) &lt;&lt; &quot; total number of truth particles (before removing) &quot; &lt;&lt; protojetcollection-&gt;size() &lt;&lt; endreq;
   if (msglvl( msg::info )) msg( msg::info ) &lt;&lt; &quot; total number of jet to be checked &quot; &lt;&lt; m_jtruth.size() &lt;&lt; endreq;
 
-  std::list&lt; jet* &gt;::const_iterator first = m_jtruth.begin();
-  std::list&lt; jet* &gt;::const_iterator last  = m_jtruth.end();
+  std::list&lt; const jet* &gt;::const_iterator first = m_jtruth.begin();
+  std::list&lt; const jet* &gt;::const_iterator last  = m_jtruth.end();
 
   int ijet = 0;
   int tinj = 0;
index: src/jetnearesttruthjettool.cxx
===================================================================
--- src/jetnearesttruthjettool.cxx	(revision 447210)
+++ src/jetnearesttruthjettool.cxx	(working copy)
@@ -78,7 +78,7 @@
 
   // create containers
   m_jetl = new std::list&lt; jet* &gt;();
-  m_jtruth = new std::list&lt; jet* &gt;();
+  m_jtruth = new std::list&lt; const jet* &gt;();
 
   // get truth particle container 
   const datahandle&lt; jetcollection &gt; pjetov;
@@ -105,7 +105,8 @@
   jetcollection_t::const_iterator rjete = jetov-&gt;end(); 
 
   for ( rjet = rjetb; rjet != rjete ; ++rjet) {
-    m_jetl-&gt;push_back( nearest_truth_jet( *rjet ) );
+    // fixme: const_cast
+    m_jetl-&gt;push_back( const_cast&lt;jet*&gt; (nearest_truth_jet( *rjet )) );
   }
   
   // create jet from particle within a cone
@@ -139,7 +140,7 @@
   return statuscode::success;
 }
 
-jet*
+const jet*
 jetnearesttruthjettool::nearest_truth_jet( jet* jri )
 {
   // defining truth: find the nearest 'truth particle' jet
@@ -148,11 +149,11 @@
   double etar =  (jri)-&gt;eta();
   double phir =  (jri)-&gt;phi();
 
-  jet* j(0);
+  const jet* j(0);
 
-  std::list&lt;jet*&gt;::iterator jti;
-  std::list&lt;jet*&gt;::iterator jtb = m_jtruth-&gt;begin();
-  std::list&lt;jet*&gt;::iterator jte = m_jtruth-&gt;end();
+  std::list&lt;const jet*&gt;::iterator jti;
+  std::list&lt;const jet*&gt;::iterator jtb = m_jtruth-&gt;begin();
+  std::list&lt;const jet*&gt;::iterator jte = m_jtruth-&gt;end();
 
   // std::cout &lt;&lt; &quot; jt size = &quot; &lt;&lt; m_jtruth-&gt;size() &lt;&lt; std::endl;
 
index: jetsimtools/jetnearesttruthjettool.h
===================================================================
--- jetsimtools/jetnearesttruthjettool.h	(revision 447210)
+++ jetsimtools/jetnearesttruthjettool.h	(working copy)
@@ -31,13 +31,13 @@
   virtual statuscode finalize();
 
 private:
-  jet* nearest_truth_jet( jet* );
+  const jet* nearest_truth_jet( jet* );
   
   std::string                              m_inputtruthjetloc;  
   std::string                             m_outputtruthjetloc;
   double                                                  m_r;
   
-  std::list&lt; jet* &gt;*                                 m_jtruth;
+  std::list&lt; const jet* &gt;*                                 m_jtruth;
   std::list&lt; jet* &gt;*                                  m_jreco;
   std::list&lt; jet* &gt;*                                   m_jetl;
   
index: jetsimtools/jetparticleinconetool.h
===================================================================
--- jetsimtools/jetparticleinconetool.h	(revision 447210)
+++ jetsimtools/jetparticleinconetool.h	(working copy)
@@ -37,7 +37,7 @@
   std::string                             m_outputtruthjetloc;
   double                                                  m_r;
   
-  std::list&lt; jet* &gt;*                              m_jparticle;
+  std::list&lt; const jet* &gt;*                              m_jparticle;
   std::list&lt; jet* &gt;*                                  m_jreco;
   std::list&lt; jet* &gt;*                                   m_jetl;
   
index: jetsimtools/jetsofttruthtool.h
===================================================================
--- jetsimtools/jetsofttruthtool.h	(revision 447210)
+++ jetsimtools/jetsofttruthtool.h	(working copy)
@@ -50,7 +50,7 @@
   std::string m_truthjetcontainerloc;
   bool   m_addinfo;
 
-  std::list&lt;jet*&gt; m_jtruth;
+  std::list&lt;const jet*&gt; m_jtruth;
   std::list&lt;jet*&gt; m_jet;
 
   ///////////
-verbatim-


i also had these changes to get rid of warnings about unused variables:

+verbatim+
index: src/jetparticleextrapolationtool.cxx
===================================================================
--- src/jetparticleextrapolationtool.cxx	(revision 447210)
+++ src/jetparticleextrapolationtool.cxx	(working copy)
@@ -203,7 +203,7 @@
 	  const hepmc::genparticle * genpart = (*it);
 	  if( !genperigee ) continue;
 	  const trk::parametersbase* result  = 0;
-	  calocell_id::calosample sample;
+	  //calocell_id::calosample sample;
        	  trk::particlehypothesis particle = trk::undefined;	  
 	  if (fabs(genperigee-&gt;eta()) &lt; 4.9){
 	      /// identifying stable particles
@@ -279,15 +279,15 @@
 		      if (particle!=0 &amp;&amp; abs(particle) &lt; 3400){
 			///check if extrapolated particle is in emb
 			if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::emb2,offset,particle))!=0 &amp;&amp; (fabs(result-&gt;position().z())&lt;3130)){
-			  sample = calocell_id::emb2;
+			  //sample = calocell_id::emb2;
 			}
 			///check if extrapolated particle is in eme
 			else if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::eme2,offset,particle))!=0 &amp;&amp; fabs(result-&gt;position().perp())&lt; 2800 &amp;&amp; fabs(result-&gt;position().perp())&gt; 300){
-			  sample = calocell_id::eme2;
+			  //sample = calocell_id::eme2;
 			}
 			/// check if extrapolated particle is in fcal
 			else if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::fcal0,offset,particle))!=0 &amp;&amp; fabs(result-&gt;position().perp())&lt; 450 &amp;&amp; fabs(result-&gt;position().perp())&gt; 67){
-			  sample = calocell_id::fcal0;
+			  //sample = calocell_id::fcal0;
 			}
 			///if sample is still emb, means that we didn't hit calo
 			else 
@@ -306,15 +306,15 @@
 	      if (particle!=0 &amp;&amp; abs(particle) &lt; 3400){
 		///check if extrapolated particle is in emb
 		if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::emb2,offset,particle))!=0 &amp;&amp; (fabs(result-&gt;position().z())&lt;3130)){
-		  sample = calocell_id::emb2;
+		  //sample = calocell_id::emb2;
 		}
 		///check if extrapolated particle is in eme
 		else if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::eme2,offset,particle))!=0 &amp;&amp; fabs(result-&gt;position().perp())&lt; 2800 &amp;&amp; fabs(result-&gt;position().perp())&gt; 300){
-		  sample = calocell_id::eme2;
+		  //sample = calocell_id::eme2;
 		}
 		/// check if extrapolated particle is in fcal
 		else if ((result = m_extrapolatetocalo-&gt;extrapolate(genperigee,calocell_id::fcal0,offset,particle))!=0 &amp;&amp; fabs(result-&gt;position().perp())&lt; 450 &amp;&amp; fabs(result-&gt;position().perp())&gt; 67){
-		  sample = calocell_id::fcal0;
+		  //sample = calocell_id::fcal0;
 		}
 		///if sample is still emb, means that we didn't hit calo
 		else 
@@ -342,10 +342,10 @@
       heplorentzvector jetkine(0,0,0,0);
       for ( ; firstcluster != lastcluster; firstcluster++ ){
 	if (*firstcluster) {
-	  double clustereta=0,clusterphi=0;
+	  //double clustereta=0,clusterphi=0;
 	  const calocluster *clus = dynamic_cast&lt;const calocluster *&gt; (*firstcluster);
-	  clustereta = (*firstcluster)-&gt;eta();
-	  clusterphi = (*firstcluster)-&gt;phi();
+	  //clustereta = (*firstcluster)-&gt;eta();
+	  //clusterphi = (*firstcluster)-&gt;phi();
 
 	  /// dynamic dr matching
 	  /*double dr = 0;
index: src/jetatlfastcalibratortool.cxx
===================================================================
--- src/jetatlfastcalibratortool.cxx	(revision 447210)
+++ src/jetatlfastcalibratortool.cxx	(working copy)
@@ -96,7 +96,7 @@
 
   // calibrated energy
 
-  double calenergy = 0;
+  //double calenergy = 0;
 
   // loop over the jets 
   
@@ -112,7 +112,7 @@
     
     // calibrate jets via the iatlfastcalibrator
     
-    calenergy = atl_calibrator-&gt;calibrate(ajet);
+    /*calenergy =*/ atl_calibrator-&gt;calibrate(ajet);
     
     if (msglvl( msg::verbose )) msg( msg::verbose ) &lt;&lt; &quot; cjet e = &quot; &lt;&lt; ajet-&gt;e()/1000. 
 	&lt;&lt; &quot; eta = &quot; &lt;&lt; ajet-&gt;eta() 
index: src/jetsofttruthtool.cxx
===================================================================
--- src/jetsofttruthtool.cxx	(revision 447210)
+++ src/jetsofttruthtool.cxx	(working copy)
@@ -217,7 +217,7 @@
       jetcollection_t::iterator itrp  = protojetcollection-&gt;begin();
       jetcollection_t::iterator itrpe = protojetcollection-&gt;end();
 
-      int match_found = 0;
+      //int match_found = 0;
 
       for ( ; itrp!=itrpe; ++itrp) {  // loop through all the particles
 	
@@ -226,7 +226,7 @@
 	double denergy = (*itrp)-&gt;e() - (*itrc)-&gt;e();
 	
 	if (deta==0. &amp;&amp; dphi==0. &amp;&amp; denergy==0.) {
-	  match_found = 1;
+	  //match_found = 1;
 	  itrp = jetcollectionhelper::remove_object(protojetcollection, itrp);
 	  break;
 	}
index: src/jetpartonselectortool.cxx
===================================================================
--- src/jetpartonselectortool.cxx	(revision 447210)
+++ src/jetpartonselectortool.cxx	(working copy)
@@ -97,23 +97,23 @@
 
   int dau = 0;
   int mother = 0;
-  int dstat = 0;
+  //int dstat = 0;
   int mstat = 0;
   std::vector&lt;const hepmc::genparticle*&gt; daughters = getdaughters(gp);
   std::vector&lt;const hepmc::genparticle*&gt; mothers = getmothers(gp);
   std::vector&lt;const hepmc::genparticle*&gt; ancestors;
   std::vector&lt;const hepmc::genparticle*&gt; granddaughters;      
-  const hepmc::genparticle* themother(0);
+  //const hepmc::genparticle* themother(0);
 
   if ( daughters.size() &gt; 0 ){
     dau = (daughters[0])-&gt;pdg_id();
-    dstat = (daughters[0])-&gt;status();
+    //dstat = (daughters[0])-&gt;status();
     granddaughters = getdaughters(daughters[0]);      
   }
   if ( mothers.size() &gt; 0 ){
     mother = (mothers[0])-&gt;pdg_id();
     mstat = (mothers[0])-&gt;status();
-    themother = mothers[0];
+    //themother = mothers[0];
   }
       
   //pythia case
@@ -194,10 +194,10 @@
   const hepmc::genparticle *gp = tp-&gt;genparticle();
 
   //heplorentzvector hlv = convertto( gp-&gt;momentum() );
-  int dau = 0;
+  //int dau = 0;
   int mother = 0;
-  int dstat = 0;
-  int mstat = 0;
+  //int dstat = 0;
+  //int mstat = 0;
   std::vector&lt;const hepmc::genparticle*&gt; daughters = getdaughters(gp);
   std::vector&lt;const hepmc::genparticle*&gt; mothers = getmothers(gp);
   std::vector&lt;const hepmc::genparticle*&gt; ancestors;
@@ -205,13 +205,13 @@
   const hepmc::genparticle* themother(0);
   
   if ( daughters.size() &gt; 0 ){
-    dau = (daughters[0])-&gt;pdg_id();
-    dstat = (daughters[0])-&gt;status();
+    //dau = (daughters[0])-&gt;pdg_id();
+    //dstat = (daughters[0])-&gt;status();
     granddaughters = getdaughters(daughters[0]);      
   }
   if ( mothers.size() &gt; 0 ){
     mother = (mothers[0])-&gt;pdg_id();
-    mstat = (mothers[0])-&gt;status();
+    //mstat = (mothers[0])-&gt;status();
     themother = mothers[0];
   }
 
index: src/atlfastsamplingcalibrator.cxx
===================================================================
--- src/atlfastsamplingcalibrator.cxx	(revision 447210)
+++ src/atlfastsamplingcalibrator.cxx	(working copy)
@@ -134,7 +134,7 @@
   double emenergy = er;
   int count = 0;
   double f = 1.0;
-  double f0 = 1.0;
+  //double f0 = 1.0;
 
 
   std::vector&lt;double&gt; weight;
@@ -148,7 +148,7 @@
     ec = weight[0] * e_em + weight[1] * e_had;
     f = fabs(ec-er)/er;
     er = ec;
-    f0 = f;
+    //f0 = f;
     count += 1;
 
   } while (f&gt;0.005 &amp;&amp; count &lt; 10);
-verbatim-
