Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 2360)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 2361)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.60 $
+// $Revision: 1.61 $
 // $Author: blanch $ 
-// $Date: 2003-09-23 16:50:55 $
+// $Date: 2003-09-25 17:09:20 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -1293,7 +1293,7 @@
       for(UInt_t ui=0;
 	  ui<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels(); ui++){
-	diffnsb_phepns[ict][ui] = (Int_t(meanNSB*factorNSB_ct*100+0.5))/100.0 * 
-	  (*((MGeomCam*)(camgeom.UncheckedAt(ict))))[ui].GetD()*
+	const Float_t size=
 	  (*((MGeomCam*)(camgeom.UncheckedAt(ict))))[ui].GetD();
+	diffnsb_phepns[ict][ui] = (Int_t(meanNSB*factorNSB_ct*100*size*size+0.5))/(100.0*size*size) * size*size;
       }
     }
@@ -1307,5 +1307,5 @@
 	zenfactor = pow(10., -0.4 * ext[j] );
 	
-	for(UInt_t ui=0; ui<((MGeomCam*)(camgeom.UncheckedAt(0)))->GetNumPixels();ui++){
+	for(UInt_t ui=0; ui<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();ui++){
 	  nsb_phepns[ict][ui]+=diffnsb_phepns[ict][ui]/iNUMWAVEBANDS + zenfactor *nsbrate_phepns[ui][j];
 	  nsb_phepns_rotated[ict][ui]=nsb_phepns[ict][ui];
@@ -1665,5 +1665,5 @@
 	  for(int ict=0;ict<ct_Number;ict++){
 	    
-	    for(UInt_t ui=0;ui<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();ui++)
+	    for(UInt_t ui=0;ui<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();ui++){
 	      if(nsb_phepns_rotated[ict][ui]>0.0){
 		if((*((MGeomCam*)(camgeom.UncheckedAt(ict))))[ui].GetD()>(*((MGeomCam*)(camgeom.UncheckedAt(ict))))[0].GetD()){
@@ -1683,4 +1683,5 @@
 		Fadc_CT[ict]->AddSignal(ui,nsb_fadcresp);
 	      }
+	    }
 	  }
 	
@@ -1867,4 +1868,5 @@
 			    i<((MGeomCam*)(camgeom.UncheckedAt(0)))
 			      ->GetNumPixels();i++){
+			  if(!Fadc_CT[0]->IsPixelUsed(i)) continue;
 			  for (j=0;j<FADC_SLICES;j++){
 			    fadcValues->AddAt(Fadc_CT[0]->GetFadcSignal(i,j),j);
@@ -2103,4 +2105,5 @@
 		      i<((MGeomCam*)(camgeom.UncheckedAt(ict)))->GetNumPixels();
 		      i++){
+		    if(!Fadc_CT[ict]->IsPixelUsed(i)) continue;
 		    for (j=0;j<FADC_SLICES;j++){
 		      fadcValues->AddAt(Fadc_CT[ict]->GetFadcSignal(i,j),j);
@@ -4043,4 +4046,8 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.60  2003/09/23 16:50:55  blanch
+// WE do not read ct_file anymore since all Telescope information is
+// in the reflector or in MGeomCam.
+//
 // Revision 1.58  2003/09/15 09:59:53  blanch
 // The concept of the camera prgoram has not changed but this version has
