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 jetcalib that were required to be
compatible with these changes.

+verbatim+
index: src/buildjetsamplingtool.cxx
===================================================================
--- src/buildjetsamplingtool.cxx	(revision 447210)
+++ src/buildjetsamplingtool.cxx	(working copy)
@@ -103,14 +103,14 @@
 
 
 // *************************
-jetsampling * buildjetsamplingtool::fill_js( jet * recojet)
+jetsampling * buildjetsamplingtool::fill_js( const jet * recojet)
 {
   m_msg &lt;&lt; msg::debug &lt;&lt; &quot;inside fill_js( jet * recojet )&quot; &lt;&lt; endreq;
   return (fill_js( recojet, null, null) );
 }
 
 // *************************
-jetsampling * buildjetsamplingtool::fill_js( jet * recojet, jet * ntjjet, jet * picjet) 
+jetsampling * buildjetsamplingtool::fill_js( const jet * recojet, const jet * ntjjet, jet * picjet) 
 {
   m_msg &lt;&lt; msg::debug &lt;&lt; &quot;inside fill_js( jet * recojet, jet * ntjjet, jet * picjet)&quot; &lt;&lt; endreq;
 
@@ -222,7 +222,7 @@
 }
 
 // *************************
-jet * buildjetsamplingtool::nearest_truth_jet( jet * recojet, const jetcollection * jetcont)
+const jet * buildjetsamplingtool::nearest_truth_jet( const jet * recojet, const jetcollection * jetcont)
 {
   m_msg &lt;&lt; msg::debug &lt;&lt; &quot;inside buildjetsamplingtool::nearest_truth_jet( jet* recojet, const jetcollection* jetcont)&quot;&lt;&lt;endreq;
 
@@ -249,7 +249,7 @@
   double phir = (recojet)-&gt;phi();
 
   // define the output truth jet 
-  jet *truthjet = null;
+  const jet *truthjet = null;
 
   int ntjets = jetcont-&gt;size();
   m_msg &lt;&lt; msg::debug 
@@ -310,7 +310,7 @@
 
 
 // *************************
-jet * buildjetsamplingtool::nearest_truth_jet( jet * recojet, const std::string&amp; truthjetsgkey)
+const jet * buildjetsamplingtool::nearest_truth_jet( const jet * recojet, const std::string&amp; truthjetsgkey)
 {
   m_msg &lt;&lt; msg::debug &lt;&lt; &quot;inside buildjetsamplingtool::nearest_truth_jet( jet* recojet, const string&amp; truthjetsgkey)&quot;&lt;&lt;endreq;
 
@@ -328,7 +328,7 @@
 }
 
 // *************************
-jet * buildjetsamplingtool::particle_in_cone( jet * recojet, const jetcollection * partjcont, const float coner)
+jet * buildjetsamplingtool::particle_in_cone( const jet * recojet, const jetcollection * partjcont, const float coner)
 {
   m_msg &lt;&lt; msg::debug &lt;&lt; &quot;inside buildjetsamplingtool::particle_in_cone( jet * recojet, const jetcollection * partjcont, const float coner)&quot; &lt;&lt; endreq;
 
@@ -390,7 +390,7 @@
 }
 
 // *************************
-jet * buildjetsamplingtool::particle_in_cone( jet * recojet, const std::string&amp; particlesgkey, const float coner)
+jet * buildjetsamplingtool::particle_in_cone( const jet * recojet, const std::string&amp; particlesgkey, const float coner)
 {
   // retrive the particle or proto jet collection from storegate     
   jetcollection * partjcont = null;
index: src/jetsamplingcalibalg.cxx
===================================================================
--- src/jetsamplingcalibalg.cxx	(revision 447210)
+++ src/jetsamplingcalibalg.cxx	(working copy)
@@ -174,7 +174,7 @@
   std::vector&lt;jet*&gt;::iterator firstl = m_jetp.begin();
   std::vector&lt;jet*&gt;::iterator lastl  = m_jetp.end();
  
-  std::list&lt;jet*&gt;::iterator ijet = m_jreco.begin();
+  std::list&lt;const jet*&gt;::iterator ijet = m_jreco.begin();
 
   int i = 0;
   for (itrl=firstl;itrl!=lastl;++itrl,++ijet,++i){
@@ -204,7 +204,7 @@
 }
 
 jetsampling*
-jetsamplingcalibalg::sample(jet* rcj, jet* mcj)
+jetsamplingcalibalg::sample(const jet* rcj, const jet* mcj)
 {  
 
   jetclassifier* jc = new jetclassifier();
@@ -225,7 +225,7 @@
 
   js-&gt;set_hlv_rec( rcj-&gt;constituent_sum4mom() ); // set ucalibrated jet four vector 
   js-&gt;set_hlv_pic( mcj-&gt;hlv() ); // set pic jet four vector
-  jet* ntj = this-&gt;nearest_truth_jet( rcj );   
+  const jet* ntj = this-&gt;nearest_truth_jet( rcj );   
   js-&gt;set_hlv_ntj( ntj-&gt;hlv() ); // set nearest truth jet four vector 
   if (!m_atlfast) js-&gt;set_hlv_h1( rcj-&gt;hlv() ); // set calib jet (h1)
 
@@ -285,12 +285,12 @@
   std::vector&lt;double&gt; phiv;
   std::vector&lt;int&gt;    jetf;
 
-  std::list&lt;jet*&gt;::const_iterator jeti;
-  std::list&lt;jet*&gt;::const_iterator jetb = m_jreco.begin();
-  std::list&lt;jet*&gt;::const_iterator jete = m_jreco.end(); 
+  std::list&lt;const jet*&gt;::const_iterator jeti;
+  std::list&lt;const jet*&gt;::const_iterator jetb = m_jreco.begin();
+  std::list&lt;const jet*&gt;::const_iterator jete = m_jreco.end(); 
 
-  std::list&lt;jet*&gt;::const_iterator pjetb = m_jparticle.begin();
-  std::list&lt;jet*&gt;::const_iterator pjete = m_jparticle.end(); 
+  std::list&lt;const jet*&gt;::const_iterator pjetb = m_jparticle.begin();
+  std::list&lt;const jet*&gt;::const_iterator pjete = m_jparticle.end(); 
 
   for ( jeti = jetb ;jeti != jete; ++jeti ) {
     double etaj = (*jeti)-&gt;eta();
@@ -331,8 +331,8 @@
 
 }
 
-jet*
-jetsamplingcalibalg::nearest_truth_jet( jet* jri )
+const jet*
+jetsamplingcalibalg::nearest_truth_jet( const jet* jri )
 {  
   // defining truth: find the nearest 'truth particle' jet
 
@@ -341,11 +341,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.begin(); 
-  std::list&lt;jet*&gt;::iterator jte = m_jtruth.end(); 
+  std::list&lt;const jet*&gt;::iterator jti; 
+  std::list&lt;const jet*&gt;::iterator jtb = m_jtruth.begin(); 
+  std::list&lt;const jet*&gt;::iterator jte = m_jtruth.end(); 
   
   //std::cout &lt;&lt; &quot; jt size = &quot; &lt;&lt; m_jtruth.size() &lt;&lt; std::endl;
 
index: src/buildjetsamplingtool.h
===================================================================
--- src/buildjetsamplingtool.h	(revision 447210)
+++ src/buildjetsamplingtool.h	(working copy)
@@ -39,16 +39,16 @@
   double dummy( int input );
 
   /** returns the pointer to the jet sampling collection */
-  jetsampling * fill_js( jet * recojet );
-  jetsampling * fill_js( jet * recojet, jet * ntjjet, jet * picjet );
+  jetsampling * fill_js( const jet * recojet );
+  jetsampling * fill_js( const jet * recojet, const jet * ntjjet, jet * picjet );
 
   /** returns the nearests jet within the input jet collection */
-  jet * nearest_truth_jet( jet * recojet, const std::string&amp; truthjetsgkey);
-  jet * nearest_truth_jet( jet * recojet, const jetcollection * partcont);
+  const jet * nearest_truth_jet( const jet * recojet, const std::string&amp; truthjetsgkey);
+  const jet * nearest_truth_jet( const jet * recojet, const jetcollection * partcont);
 
   /** returns the jet formed by all the particles within a cone coner */
-  jet * particle_in_cone( jet * recojet, const std::string&amp; particlesgkey, const float coner);
-  jet * particle_in_cone( jet * recojet, const jetcollection * partjcont, const float coner);
+  jet * particle_in_cone( const jet * recojet, const std::string&amp; particlesgkey, const float coner);
+  jet * particle_in_cone( const jet * recojet, const jetcollection * partjcont, const float coner);
 
   /** sets the m_atlfast flag */
   void setisatlfast( bool flag ) { m_atlfast = flag; };
index: src/buildjetsamplingalg.cxx
===================================================================
--- src/buildjetsamplingalg.cxx	(revision 447210)
+++ src/buildjetsamplingalg.cxx	(working copy)
@@ -167,7 +167,7 @@
   jetcollection::const_iterator jetitre = jetcont-&gt;end();
   for (; jetitr != jetitre; ++jetitr)
     {
-      jet * truthjet = null;
+      const jet * truthjet = null;
       jet * picjet = null;
       if (m_truth) {
 	truthjet = m_buildjetsamplingtool-&gt;nearest_truth_jet(  (*jetitr), truthjetcont );
index: src/constituentsbasedjetcalibration.cxx
===================================================================
--- src/constituentsbasedjetcalibration.cxx	(revision 447210)
+++ src/constituentsbasedjetcalibration.cxx	(working copy)
@@ -192,17 +192,17 @@
   unsigned int nit=0;
   for(jetcollection::const_iterator tjetiter=tjc-&gt;begin(); tjetiter!=tjc-&gt;end() &amp;&amp; nit&lt;m_nleading; ++tjetiter, ++nit) // start loop over tjc
   {
-    jet* tjet = (*tjetiter);
+    const jet* tjet = (*tjetiter);
 
-    std::vector&lt; std::pair&lt;double,jet*&gt; &gt; dr_tjet_list;
+    std::vector&lt; std::pair&lt;double,const jet*&gt; &gt; dr_tjet_list;
 
     for(jetcollection::const_iterator rjetiter=rjc-&gt;begin(); rjetiter!=rjc-&gt;end(); ++rjetiter) // start loop over rjc
-    { dr_tjet_list.push_back(std::pair&lt;double,jet*&gt;(tjet-&gt;hlv().deltar((*rjetiter)-&gt;hlv()),(*rjetiter))); }
+    { dr_tjet_list.push_back(std::pair&lt;double,const jet*&gt;(tjet-&gt;hlv().deltar((*rjetiter)-&gt;hlv()),(*rjetiter))); }
     sort(dr_tjet_list.begin(),dr_tjet_list.end());
 
     if(!dr_tjet_list.empty() &amp;&amp; dr_tjet_list.at(0).first&lt;m_dr_match &amp;&amp; tjet-&gt;et()&gt;m_truthjetetcut) // matching &amp; et cut
     {
-      jet* rjet = dr_tjet_list.at(0).second;
+      const jet* rjet = dr_tjet_list.at(0).second;
 
       int ieta = (int)(m_neta*((fabs(rjet-&gt;eta())-m_etamin)/(m_etamax-m_etamin)));
 
index: jetcalib/jetsamplingcalibalg.h
===================================================================
--- jetcalib/jetsamplingcalibalg.h	(revision 447210)
+++ jetcalib/jetsamplingcalibalg.h	(working copy)
@@ -36,9 +36,9 @@
     statuscode finalize();
 
 private:
-    jetsampling* sample(jet*,jet*);
+    jetsampling* sample(const jet*,const jet*);
     void particle_in_jet();
-    jet* nearest_truth_jet( jet* );
+    const jet* nearest_truth_jet( const jet* );
 
     void do_jetsampling(navigationtoken&lt;calocell,double&gt; celltoken);
     void do_jetsums(navigationtoken&lt;calocell,double&gt; celltoken);
@@ -51,9 +51,9 @@
     std::string                              m_jetscontainerloc;
     double                                                  m_r;
 
-    std::list&lt; jet* &gt; m_jparticle;
-    std::list&lt; jet* &gt; m_jtruth;
-    std::list&lt; jet* &gt; m_jreco;
+    std::list&lt; const jet* &gt; m_jparticle;
+    std::list&lt; const jet* &gt; m_jtruth;
+    std::list&lt; const jet* &gt; m_jreco;
     std::vector&lt; jet* &gt; m_jetp;
 
     jetcollection*                                     m_jetvec;
index: jetcalib/ibuildjetsamplingtool.h
===================================================================
--- jetcalib/ibuildjetsamplingtool.h	(revision 447210)
+++ jetcalib/ibuildjetsamplingtool.h	(working copy)
@@ -40,16 +40,16 @@
   virtual double dummy( int input ) = 0;
 
   /// virtual method to fill an entry of the jetsampling collection
-  virtual jetsampling* fill_js( jet * recojet ) = 0;
-  virtual jetsampling * fill_js( jet * recojet, jet * ntjjet, jet * picjet ) =0;
+  virtual jetsampling* fill_js( const jet * recojet ) = 0;
+  virtual jetsampling * fill_js( const jet * recojet, const jet * ntjjet, jet * picjet ) =0;
 
   /// virtual method to calculate nearest-truth-jet
-  virtual jet * nearest_truth_jet( jet * recojet, const std::string&amp; truthjetsgkey) = 0;
-  virtual jet * nearest_truth_jet( jet * recojet, const jetcollection * jetcont) = 0;
+  virtual const jet * nearest_truth_jet( const jet * recojet, const std::string&amp; truthjetsgkey) = 0;
+  virtual const jet * nearest_truth_jet( const jet * recojet, const jetcollection * jetcont) = 0;
 
   /// virtual method to calcualte pariticle-in-cone jet
-  virtual jet * particle_in_cone( jet * recojet, const std::string&amp; particlesgkey, const float coner) = 0;
-  virtual jet * particle_in_cone( jet * recojet, const jetcollection* partjcont, const float coner) = 0;
+  virtual jet * particle_in_cone( const jet * recojet, const std::string&amp; particlesgkey, const float coner) = 0;
+  virtual jet * particle_in_cone( const jet * recojet, const jetcollection* partjcont, const float coner) = 0;
 
   /// virtual method to set the atlfast flat
   virtual void setisatlfast( bool flag ) = 0;
-verbatim-

i also had these changes to fix warnings about unused variables.

+verbatim+
index: src/jetsamplingcalibtool.cxx
===================================================================
--- src/jetsamplingcalibtool.cxx	(revision 447210)
+++ src/jetsamplingcalibtool.cxx	(working copy)
@@ -202,7 +202,7 @@
 
   int count = 0;
   double f  = 1.0;
-  double f0 = 1.0;
+  //double f0 = 1.0;
 
   do {
     double ec = 0;
@@ -219,7 +219,7 @@
     f = fabs(ec-er)/er;
 
     er = ec;
-    f0 = f;
+    //f0 = f;
 
     if ( etf*er &lt; m_etcut ) na = 1;  // check on the calibrated et and m_etcut
     
@@ -289,7 +289,7 @@
 
   int count = 0;
   double f  = 1.0;
-  double f0 = 1.0;
+  //double f0 = 1.0;
 
   do {
     double ec = 0;
@@ -306,7 +306,7 @@
     f = fabs(ec-er)/er;
 
     er = ec;
-    f0 = f;
+    //f0 = f;
 
     if ( etf*er &lt; m_etcut ) return er*1000.;  // check on the calibrated et and m_etcut
 
index: src/calibrator.cxx
===================================================================
--- src/calibrator.cxx	(revision 447210)
+++ src/calibrator.cxx	(working copy)
@@ -95,7 +95,7 @@
   int count = 0;
   //  double etemp = er;
   double f  = 1.0;
-  double f0 = 1.0;
+  //double f0 = 1.0;
   
   do {
     double ec = 0;
@@ -111,7 +111,7 @@
     f = fabs(ec-er)/er;  
 
     er = ec;
-    f0 = f;
+    //f0 = f;
     
     if ( etf*er &lt; m_etcut ) return 0.0;  // check on the calibrated et and m_etcut   
 
-verbatim-
