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


+verbatim+
index: missinget/mettrackselectortool.h
===================================================================
--- missinget/mettrackselectortool.h	(revision 447210)
+++ missinget/mettrackselectortool.h	(working copy)
@@ -70,7 +70,7 @@
   statuscode buildmutracks();
   bool select(const rec::trackparticle*, const caloclustercontainer* );
   bool extrapolatetocalo(const rec::trackparticle*,float&amp;,float&amp;);
-  calocluster *tracktoclusterassociation(const rec::trackparticle*, const caloclustercontainer*,const float, const float, const float);
+  const calocluster *tracktoclusterassociation(const rec::trackparticle*, const caloclustercontainer*,const float, const float, const float);
   bool isinbarrel(const rec::trackparticle*);
   void sortdown(int,float*,int*,bool);
  protected:
index: src/metrefinedclustertool.cxx
===================================================================
--- src/metrefinedclustertool.cxx	(revision 447210)
+++ src/metrefinedclustertool.cxx	(working copy)
@@ -804,7 +804,7 @@
       }
       float drcut = 4;
 
-      calocluster *assoclus = m_trackselectortool-&gt;tracktoclusterassociation(trk,&amp;selclus,extreta,extrphi,drcut);
+      const calocluster *assoclus = m_trackselectortool-&gt;tracktoclusterassociation(trk,&amp;selclus,extreta,extrphi,drcut);
       if (assoclus){
 	clustertrack entry(assoclus,trk);
 	clustertrack_holder.push_back(entry);     
index: src/mettrackmatching.cxx
===================================================================
--- src/mettrackmatching.cxx	(revision 447210)
+++ src/mettrackmatching.cxx	(working copy)
@@ -47,7 +47,8 @@
 	{
 	  if ( std::find(etrks.begin(),etrks.end(),*ftrk) == etrks.end() )
 	    {
-	      lot.push_back(*ftrk);
+              // fixme: cast neeed for copying between containers.
+	      lot.push_back(const_cast&lt;rec::trackparticle*&gt; (*ftrk));
 	    }
 	}
      }
index: src/mettrackselectortool.cxx
===================================================================
--- src/mettrackselectortool.cxx	(revision 447210)
+++ src/mettrackselectortool.cxx	(working copy)
@@ -294,7 +294,7 @@
  //veto tracks associated to clusters already used 
  if (extracalo){
    float drcut = 8.;
-   calocluster *assousedclus= tracktoclusterassociation(trk,associatedclus, extreta,extrphi, drcut);  
+   const calocluster *assousedclus= tracktoclusterassociation(trk,associatedclus, extreta,extrphi, drcut);  
    //not use tracks assiciated to objetcs  
    if (assousedclus) return false;
 
@@ -399,8 +399,8 @@
   }
 }
 
-calocluster* mettrackselectortool::tracktoclusterassociation(const rec::trackparticle *trk,const caloclustercontainer* cluscontainer, const float extreta, const float extrphi, const float  dr){
-  calocluster *assoclus = null;
+const calocluster* mettrackselectortool::tracktoclusterassociation(const rec::trackparticle *trk,const caloclustercontainer* cluscontainer, const float extreta, const float extrphi, const float  dr){
+  const calocluster *assoclus = null;
   const trk::measuredperigee* perigeepv = m_tracktovertextool-&gt;perigeeatvertex(*trk);
   double charge_tk = trk-&gt;charge();
   double px_tk     = perigeepv-&gt;momentum()[trk::px];
@@ -423,10 +423,10 @@
   
   double emax = 0.;
 
-  bool isassociated = false;
-  float assodr = -1;
+  //bool isassociated = false;
+  //float assodr = -1;
   for(caloclustercontainer::const_iterator clusiter = cluscontainer-&gt;begin(); clusiter != cluscontainer-&gt;end(); clusiter++) {
-    calocluster* pclus = *clusiter;
+    const calocluster* pclus = *clusiter;
     double deta = extreta-pclus-&gt;eta();
     double dphi = extrphi-pclus-&gt;phi()-cphi;
     static double pi = 3.1416;
@@ -436,9 +436,9 @@
     double ptot = pclus-&gt;e();            
     if(ptot&gt;emax&amp;&amp;dr&lt;dr){
       emax = ptot;
-      isassociated = true;	
+      //isassociated = true;	
       assoclus = pclus;
-      assodr = dr;
+      //assodr = dr;
     }
   }
   delete perigeepv;
-verbatim-

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

+verbatim+
index: src/metdmtool.cxx
===================================================================
--- src/metdmtool.cxx	(revision 447210)
+++ src/metdmtool.cxx	(working copy)
@@ -193,13 +193,13 @@
 	    int dmhit_type     = 0 ;
 	    int dmhit_sampling = 0 ;
 	    int dmhit_region   = 0 ;
-	    double dmhit_ieta     = 0.;
-	    double dmhit_iphi     = 0.;
+	    //double dmhit_ieta     = 0.;
+	    //double dmhit_iphi     = 0.;
 	    double dmhit_etotal   = 0.; 
-	    double dmhit_em       = 0.; 
-	    double dmhit_nonem    = 0.; 
-	    double dmhit_invisible= 0.; 
-	    double dmhit_escaped  = 0.; 
+	    //double dmhit_em       = 0.; 
+	    //double dmhit_nonem    = 0.; 
+	    //double dmhit_invisible= 0.; 
+	    //double dmhit_escaped  = 0.; 
 	    double pxdm           = 0.;
 	    double pydm           = 0.;
 	    double ptdm           = 0.;
@@ -222,15 +222,15 @@
 	      dmhit_type     = m_calodm_id-&gt;dmat(id);	 // type 	      
 	      dmhit_sampling = m_calodm_id-&gt;sampling(id);  // sampling       
 	      dmhit_region   = m_calodm_id-&gt;region(id);    // region	      
-	      dmhit_ieta     = m_calodm_id-&gt;eta(id);       // eta		   
-	      dmhit_iphi     = m_calodm_id-&gt;phi(id);       // phi	
+	      //dmhit_ieta     = m_calodm_id-&gt;eta(id);       // eta		   
+	      //dmhit_iphi     = m_calodm_id-&gt;phi(id);       // phi	
 	      dmhit_etotal   = (*it)-&gt;energytotal();
-	      dmhit_em       = (*it)-&gt;energyem(); 	      
-	      dmhit_nonem    = (*it)-&gt;energynonem();	      
-	      dmhit_invisible= (*it)-&gt;energyinvisible();        
-	      dmhit_escaped  = (*it)-&gt;energyescaped();	
+	      //dmhit_em       = (*it)-&gt;energyem(); 	      
+	      //dmhit_nonem    = (*it)-&gt;energynonem();	      
+	      //dmhit_invisible= (*it)-&gt;energyinvisible();        
+	      //dmhit_escaped  = (*it)-&gt;energyescaped();	
 	      dmhit_key      = abs(dmhit_subdet)*1000+dmhit_type*100+dmhit_sampling*10+dmhit_region;	 
-	      
+              
 	      /* report &lt;&lt; msg::verbose &lt;&lt;&quot; dmhit_subdet= &quot;   &lt;&lt; dmhit_subdet
 		 &lt;&lt;&quot; dmhit_type= &quot;     &lt;&lt; dmhit_type
 		 &lt;&lt;&quot; dmhit_sampling= &quot; &lt;&lt; dmhit_sampling
-verbatim-
