RE: TCONS problems.

From: Valery Fine (Faine) (fine@bnl.gov)
Date: Sun Jun 06 1999 - 02:38:02 MEST


> 
> Hi Rooters, 
> 
> this macro is an excerpt from g2root *.C ouput. It draws a part of 
> CDF muon system. 
> 
> running this macro with root v2_21_06 produces wrong output 
> (attached gif file  'old.gif'). With the root version v2_22_00 
> result is fine (attached file 'new.gif'). 
> 
> Is it a problem with v2_21_06 in general? Or our root version v2_21_06 
> is corrupted (I have the same problem with v2_21_08 though).
>  
> {
> TRotMatrix *rot12496 = new TRotMatrix("rot12496","rot12496",90,0,90,90,180,0);
> TCONS *CMXA          = new TCONS("CMXA","CMXA","void",104.14,564,625,381,442,311.75,228.25); 
> TNode* Node1439      = new TNode("CMXA1","CMXA1",CMXA,0,0,-454.66,rot12496);
> Node1439->cd();
> Node1439->Draw();                                        
> }
> 
> I'd be happy if you could hint on how to fix this using 'old' root 
> version since transition to v2_22_## will not happen soon here. 
  there was a bug with TCONS ctor definition, namely the order of the parameters doesn't match with 
  those from GEANT,

  ROOT 2.22
  ========
   TCONS(Text_t *name, Text_t *title, Text_t *material, Float_t dz, Float_t rmin1, Float_t rmax1,
              Float_t rmin2, Float_t rmax2, Float_t phi1, Float_t phi2);

   TCONS(Text_t *name, Text_t *title, Text_t *material, Float_t rmax1, Float_t dz
                          , Float_t phi1, Float_t phi2, Float_t rmax2 = 0);

  ROOT > 2.22
  ========
        TCONS(Text_t *name, Text_t *title, Text_t *material, Float_t rmin1, Float_t rmax1,
              Float_t rmin2, Float_t rmax2, Float_t dz, Float_t phi1,
              Float_t phi2);


  As one may realize the 4th parameter was "Float_t rmin1" and 8th parameter was "Float_t dz"
  The new version has made it in line with  GEANT docs and g2root code as well, namely:

     the 4th parameter  is  "Float_t dz"                   and 
     the  8th parameter is "Float_t rmax2" 

   So to use OLD ROOT one has to moved that 4th parameter (which is a real "dz" 
   value but "rmin1")  to 8th place where  the "old" ROOT expects it to see.

 TCONS *CMXA = new TCONS("CMXA","CMXA","void",104.14, 564, 625,381, 442,         311.75,228.25); 
 TCONS *CMXA = new TCONS("CMXA","CMXA","void",        564, 625,381, 442, 104.14, 311.75,228.25); 

   But you should not forget to move it back just you will switch to > 2.22 version
   of ROOT in future.

    Hope this helps
                            Valery

 PS. PARA shapes should be drawn fine as well (compare the output of the tutorials/shapes.C
       macro done with "old" and new"  ROOT versions.
 



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:34 MET