Index: trunk/src/FrogUtil.cc
===================================================================
--- trunk/src/FrogUtil.cc	(revision 182)
+++ trunk/src/FrogUtil.cc	(revision 183)
@@ -41,4 +41,5 @@
 using namespace FROG_COORD;
 
+const float twopi = 6.2831;
 
 FrogDisplay::FrogDisplay() {}
@@ -508,46 +509,40 @@
 
   double dphi  = 6.283185307179586476925286766559 /NumPhi;
-  for(double phi=0; phi<=6.2831/frac;phi+=dphi){
+  for(double phi=0; phi<=twopi/frac;phi+=dphi){
 
     FROG_Element_Primitive_CustomSurface* trackerCone1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,    
-												  rayCone*sin(phi)      ,rayCone*cos(phi)       ,-Lenght_Tracker/2,
-												  rayCone*sin(phi+dphi) ,rayCone*cos(phi+dphi)  ,-Lenght_Tracker/2,
-												  0                 , 0                 , 0,
-                                                                                                  0                 , 0                 , 0
-												  );
-
+	  rayCone*sin(phi)      ,rayCone*cos(phi)       ,-Lenght_Tracker/2,
+	  rayCone*sin(phi+dphi) ,rayCone*cos(phi+dphi)  ,-Lenght_Tracker/2,
+	  0                 , 0                 , 0,
+          0                 , 0                 , 0);
     Tracker->addDaughter(trackerCone1);   DetIdCountTracker++;					
 
     FROG_Element_Primitive_CustomSurface* trackerCone2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,    
-												  0                 , 0                  ,0,
-												  0                 , 0                  ,0,
-												  rayCone*sin(phi)      , rayCone*cos(phi)       , Lenght_Tracker/2,
-												  rayCone*sin(phi+dphi) , rayCone*sin(phi+dphi)  , Lenght_Tracker/2
-												  );
+	  0                 , 0                  ,0,
+	  0                 , 0                  ,0,
+	  rayCone*sin(phi)      , rayCone*cos(phi)       , Lenght_Tracker/2,
+	  rayCone*sin(phi+dphi) , rayCone*sin(phi+dphi)  , Lenght_Tracker/2);
     Tracker->addDaughter(trackerCone2);   DetIdCountTracker++;		
     
     
     FROG_Element_Primitive_CustomSurface* trackerB = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,    
-											      ray*sin(phi)        ,ray*cos(phi)       ,-Lenght_Tracker*0.5, 
-											      ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  ,-Lenght_Tracker*0.5,
-											      ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  , Lenght_Tracker*0.5,
-											      ray*sin(phi)        ,ray*cos(phi)       , Lenght_Tracker*0.5);
-    
+      ray*sin(phi)        ,ray*cos(phi)       ,-Lenght_Tracker*0.5, 
+      ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  ,-Lenght_Tracker*0.5,
+      ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  , Lenght_Tracker*0.5,
+      ray*sin(phi)        ,ray*cos(phi)       , Lenght_Tracker*0.5);
     Tracker->addDaughter(trackerB);   DetIdCountTracker++;
     
     FROG_Element_Primitive_CustomSurface* trackerEndCap1 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
-												    rayCone*sin(phi)      , rayCone*cos(phi)      ,  -(Lenght_Tracker)/2,
-												    rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) ,  -(Lenght_Tracker)/2,
-												    ray*sin(phi+dphi)     , ray*cos(phi+dphi)     ,  -(Lenght_Tracker)/2,
-												    ray*sin(phi)          , ray*cos(phi)          ,  -(Lenght_Tracker)/2
-												    );
+      rayCone*sin(phi)      , rayCone*cos(phi)      ,  -(Lenght_Tracker)/2,
+      rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) ,  -(Lenght_Tracker)/2,
+      ray*sin(phi+dphi)     , ray*cos(phi+dphi)     ,  -(Lenght_Tracker)/2,
+      ray*sin(phi)          , ray*cos(phi)          ,  -(Lenght_Tracker)/2);
     Tracker->addDaughter(trackerEndCap1);   DetIdCountTracker++;
     
     FROG_Element_Primitive_CustomSurface* trackerEndCap2 = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountTracker*10,
-												    rayCone*sin(phi)      , rayCone*cos(phi)      ,  (Lenght_Tracker)/2,
-												    rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) ,  (Lenght_Tracker)/2,
-												    ray*sin(phi+dphi)     , ray*cos(phi+dphi)     ,  (Lenght_Tracker)/2,
-												    ray*sin(phi)          , ray*cos(phi)          ,  (Lenght_Tracker)/2
-												    );
+      rayCone*sin(phi)      , rayCone*cos(phi)      ,  (Lenght_Tracker)/2,
+      rayCone*sin(phi+dphi) , rayCone*cos(phi+dphi) ,  (Lenght_Tracker)/2,
+      ray*sin(phi+dphi)     , ray*cos(phi+dphi)     ,  (Lenght_Tracker)/2,
+      ray*sin(phi)          , ray*cos(phi)          ,  (Lenght_Tracker)/2);
     Tracker->addDaughter(trackerEndCap2);   DetIdCountTracker++;
     
@@ -568,50 +563,44 @@
   if(ray<rayConeF)ray=rayConeF;
    
-  for(double phi=0; phi<=6.2831/frac;phi+=dphi){
+  for(double phi=0; phi<=twopi/frac;phi+=dphi){
     
     //BARREL
     FROG_Element_Primitive_CustomSurface* caloB = new FROG_Element_Primitive_CustomSurface(9100000+DetIdCountCalo*10,
-											   ray*sin(phi)        ,ray*cos(phi)       ,-Lenght_Calo*0.5,  
-											   ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  ,-Lenght_Calo*0.5,
-											   ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  , Lenght_Calo*0.5,
-											   ray*sin(phi)        ,ray*cos(phi)       , Lenght_Calo*0.5
-											   );
-    
+     ray*sin(phi)        ,ray*cos(phi)       ,-Lenght_Calo*0.5,  
+     ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  ,-Lenght_Calo*0.5,
+     ray*sin(phi+dphi)   ,ray*cos(phi+dphi)  , Lenght_Calo*0.5,
+     ray*sin(phi)        ,ray*cos(phi)       , Lenght_Calo*0.5);
     CALO->addDaughter(caloB);   DetIdCountCalo++;
     
     //Partial cone + side
     FROG_Element_Primitive_CustomSurface* caloEndCap1a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10,
-												  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Tracker)/2,
-												  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Tracker)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Calo)/2,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Calo)/2
-												  );
+          rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Tracker)/2,
+	  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Tracker)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Calo)/2,
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Calo)/2);
     CALO->addDaughter(caloEndCap1a);   DetIdCountCalo++;
     
     //Close Endcap + side
     FROG_Element_Primitive_CustomSurface* caloEndCap1b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Calo)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Calo)/2,
-												  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_Calo)/2,
-												  ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_Calo)/2
-												  );
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Calo)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Calo)/2,
+	  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_Calo)/2,
+	  ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_Calo)/2);
     CALO->addDaughter(caloEndCap1b);   DetIdCountCalo++;
     
     //Partial cone - side
     FROG_Element_Primitive_CustomSurface* caloEndCap2a = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountCalo*10,
-												  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Tracker)/2,
-												  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Tracker)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Calo)/2,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Calo)/2
-												  );
+	  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Tracker)/2,
+	  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Tracker)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Calo)/2,
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Calo)/2);
     CALO->addDaughter(caloEndCap2a);   DetIdCountCalo++;
     
     //Close Endcap - side
     FROG_Element_Primitive_CustomSurface* caloEndCap2b = new FROG_Element_Primitive_CustomSurface(9200000+DetIdCountTracker*10,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Calo)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Calo)/2,
-												  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  -(Lenght_Calo)/2,
-												  ray*sin(phi)           , ray*cos(phi)           ,  -(Lenght_Calo)/2
-												  );
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Calo)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Calo)/2,
+	  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  -(Lenght_Calo)/2,
+	  ray*sin(phi)           , ray*cos(phi)           ,  -(Lenght_Calo)/2);
     CALO->addDaughter(caloEndCap2b);   DetIdCountCalo++;
     
@@ -632,51 +621,45 @@
   if(ray<rayConeF)ray=rayConeF;
  
-  for(double phi=0; phi<=6.2831/frac;phi+=dphi){
+  for(double phi=0; phi<=twopi/frac;phi+=dphi){
     
     //BARREL
     FROG_Element_Primitive_CustomSurface* muonB = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
-											   ray*sin(phi)      ,ray*cos(phi)       ,-Lenght_Muon*0.5,    
-											   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  ,-Lenght_Muon*0.5,
-											   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_Muon*0.5,
-											   ray*sin(phi)      ,ray*cos(phi)       , Lenght_Muon*0.5);
-    
+	   ray*sin(phi)      ,ray*cos(phi)       ,-Lenght_Muon*0.5,    
+	   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  ,-Lenght_Muon*0.5,
+	   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_Muon*0.5,
+	   ray*sin(phi)      ,ray*cos(phi)       , Lenght_Muon*0.5);
     MUON->addDaughter(muonB);   DetIdCountMuon++;
     
     //Partial cone + side
     FROG_Element_Primitive_CustomSurface* muonEndCap1a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
-												  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Calo)/2,
-												  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Calo)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Muon)/2,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Muon)/2
-												  );
+	  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Calo)/2,
+	  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Calo)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Muon)/2,
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Muon)/2);
     MUON->addDaughter(muonEndCap1a);   DetIdCountMuon++;
     
     //Close Endcap + side
     FROG_Element_Primitive_CustomSurface* muonEndCap1b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Muon)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Muon)/2,
-												  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_Muon)/2,
-												  ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_Muon)/2
-												  );
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_Muon)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_Muon)/2,
+	  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_Muon)/2,
+	  ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_Muon)/2);
     MUON->addDaughter(muonEndCap1b);   DetIdCountMuon++;
     
     //Partial cone - side
     FROG_Element_Primitive_CustomSurface* muonEndCap2a = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
-												  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Calo)/2,
-												  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Calo)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Muon)/2,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Muon)/2
-												  );
+	  rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Calo)/2,
+	  rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Calo)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Muon)/2,
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Muon)/2);
     MUON->addDaughter(muonEndCap2a);   DetIdCountMuon++;
     
     //Close Endcap - side
     FROG_Element_Primitive_CustomSurface* muonEndCap2b = new FROG_Element_Primitive_CustomSurface(9300000+DetIdCountMuon*10,
-												  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Muon)/2,
-												  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Muon)/2,
-												  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  -(Lenght_Muon)/2,
-												  ray*sin(phi)           , ray*cos(phi)           ,  -(Lenght_Muon)/2
-												  );
+	  rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_Muon)/2,
+	  rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_Muon)/2,
+	  ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  -(Lenght_Muon)/2,
+	  ray*sin(phi)           , ray*cos(phi)           ,  -(Lenght_Muon)/2);
     MUON->addDaughter(muonEndCap2b);   DetIdCountMuon++;
-    
   }
   
@@ -693,64 +676,53 @@
   ray=tan(EtaToTheta(DET->CEN_max_calo_cen))*Lenght_CaloFwd;
    
-  for(double phi=0; phi<=6.2831/frac;phi+=dphi){
-    
+  for(double phi=0; phi<=twopi/frac;phi+=dphi){
     
     //Partial cone + side
     FROG_Element_Primitive_CustomSurface* caloFWDEndCap1a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
-												     rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Muon)/2,
-												     rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Muon)/2,
-												     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_CaloFwd)/2,
-												     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_CaloFwd)/2
-												     );
+     rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  (Lenght_Muon)/2,
+     rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  (Lenght_Muon)/2,
+     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_CaloFwd)/2,
+     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_CaloFwd)/2);
     CALOFWD->addDaughter(caloFWDEndCap1a);   DetIdCountCaloFwd++;
     
     //Close Endcap + side
     FROG_Element_Primitive_CustomSurface* caloFWDEndCap1b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
-												     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_CaloFwd)/2,
-												     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_CaloFwd)/2,
-												     ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_CaloFwd)/2,
-												     ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_CaloFwd)/2
-												     );
+     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  (Lenght_CaloFwd)/2,
+     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  (Lenght_CaloFwd)/2,
+     ray*sin(phi+dphi)      , ray*cos(phi+dphi)      ,  (Lenght_CaloFwd)/2,
+     ray*sin(phi)           , ray*cos(phi)           ,  (Lenght_CaloFwd)/2);
     CALOFWD->addDaughter(caloFWDEndCap1b);   DetIdCountCaloFwd++;
 												     
     //BARREL
     FROG_Element_Primitive_CustomSurface* caloFWDB1 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10,
-											   ray*sin(phi)      ,ray*cos(phi)       , Lenght_Muon*0.5,    
-											   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_Muon*0.5,
-											   ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_CaloFwd*0.5,
-											   ray*sin(phi)      ,ray*cos(phi)       , Lenght_CaloFwd*0.5);
-    
+     ray*sin(phi)      ,ray*cos(phi)       , Lenght_Muon*0.5,    
+     ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_Muon*0.5,
+     ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , Lenght_CaloFwd*0.5,
+     ray*sin(phi)      ,ray*cos(phi)       , Lenght_CaloFwd*0.5);
     CALOFWD->addDaughter(caloFWDB1);   DetIdCountCaloFwd++;
-
-
-    									   
     
     //Partial cone - side
     FROG_Element_Primitive_CustomSurface* caloFWDEndCap2a = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
-												     rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Muon)/2,
-												     rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Muon)/2,
-												     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_CaloFwd)/2,
-												     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_CaloFwd)/2
-												     );
+     rayConeD*sin(phi)      , rayConeD*cos(phi)      ,  -(Lenght_Muon)/2,
+     rayConeD*sin(phi+dphi) , rayConeD*cos(phi+dphi) ,  -(Lenght_Muon)/2,
+     rayConeF*sin(phi+dphi) , rayConeF*cos(phi+dphi) ,  -(Lenght_CaloFwd)/2,
+     rayConeF*sin(phi)      , rayConeF*cos(phi)      ,  -(Lenght_CaloFwd)/2);
     CALOFWD->addDaughter(caloFWDEndCap2a);   DetIdCountCaloFwd++;
    
     //Close Endcap - side
     FROG_Element_Primitive_CustomSurface* caloFWDEndCap2b = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountCaloFwd*10,
-												     rayConeF*sin(phi)       , rayConeF*cos(phi)      ,  -(Lenght_CaloFwd)/2,
-												     rayConeF*sin(phi+dphi)  , rayConeF*cos(phi+dphi) ,  -(Lenght_CaloFwd)/2,
-												     ray*sin(phi+dphi)       , ray*cos(phi+dphi)      ,  -(Lenght_CaloFwd)/2,
-												     ray*sin(phi)            , ray*cos(phi)           ,  -(Lenght_CaloFwd)/2);
-    
+     rayConeF*sin(phi)       , rayConeF*cos(phi)      ,  -(Lenght_CaloFwd)/2,
+     rayConeF*sin(phi+dphi)  , rayConeF*cos(phi+dphi) ,  -(Lenght_CaloFwd)/2,
+     ray*sin(phi+dphi)       , ray*cos(phi+dphi)      ,  -(Lenght_CaloFwd)/2,
+     ray*sin(phi)            , ray*cos(phi)           ,  -(Lenght_CaloFwd)/2);
     CALOFWD->addDaughter(caloFWDEndCap2b);   DetIdCountCaloFwd++;
 
     //BARREL
     FROG_Element_Primitive_CustomSurface* caloFWDB2 = new FROG_Element_Primitive_CustomSurface(9400000+DetIdCountMuon*10,
-											       ray*sin(phi)      ,ray*cos(phi)       , -Lenght_Muon*0.5,    
-											       ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , -Lenght_Muon*0.5,
-											       ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , -Lenght_CaloFwd*0.5,
-											       ray*sin(phi)      ,ray*cos(phi)       , -Lenght_CaloFwd*0.5);
-    
+       ray*sin(phi)      ,ray*cos(phi)       , -Lenght_Muon*0.5,    
+       ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , -Lenght_Muon*0.5,
+       ray*sin(phi+dphi) ,ray*cos(phi+dphi)  , -Lenght_CaloFwd*0.5,
+       ray*sin(phi)      ,ray*cos(phi)       , -Lenght_CaloFwd*0.5);
     CALOFWD->addDaughter(caloFWDB2);   DetIdCountCaloFwd++;
-
   }
   
