Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 6710)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 6712)
@@ -1,5 +1,5 @@
 ////!////////////////////////////////////////////////////////////////////
 //
-// camera                
+// camera               
 //
 // @file        camera.cxx
@@ -221,5 +221,5 @@
 
 //@: PMT time jitter
-static  float pmt_jitter=0.25;
+static  float pmt_jitter;
 
   
@@ -4135,11 +4135,24 @@
 
   float time;
-  float pmtjit;
+  float *pmtjit;
+
+  pmtjit = new float[camgeom->GetNumPixels()];
 
   // reset variables
 
-  for ( i=0; i<camgeom->GetNumPixels(); ++i )
-    nphe[i] = 0.0;
-
+  TRandom random;
+  random.SetSeed(seed);
+  
+  for ( i = 0; i < camgeom->GetNumPixels(); ++i )
+    {
+      nphe[i] = 0.0;
+      //
+      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
+      // not accept negative times!)
+      //
+      do 
+	pmtjit[i] = random.Gaus(3.*pmt_jitter, pmt_jitter);
+      while (pmtjit[i] < 0.);
+    }
 
   *itotnphe = 0;
@@ -4147,7 +4160,4 @@
 
   radius_mm = camgeom->GetMaxRadius();
-
-  TRandom random;
-  random.SetSeed(seed);
 
   float C1, C2, C3, rho;
@@ -4319,17 +4329,9 @@
     nphe[ipixnum] += 1.0;
 
-    //
-    // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
-    // not accept negative times!)
-    //
-    do 
-      pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
-    while(pmtjit<0.);
-
     // store the new photoelectron
 
     fadc->Fill(ipixnum,
-	       (time-*tmin_ns) + pmtjit + fadc_jitter, 
-	       trigger->FillShow(ipixnum, time-*tmin_ns + pmtjit + fadc_jitter),
+	       (time-*tmin_ns) + pmtjit[ipixnum] + fadc_jitter, 
+	       trigger->FillShow(ipixnum, time-*tmin_ns + pmtjit[ipixnum] + fadc_jitter),
 	       !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
     
@@ -4859,18 +4861,30 @@
   float radius_mm, focal_dist_mm;
   int   total_photons;
-  float pmtjit;
+  float *pmtjit;
 
   static UInt_t seed = (UInt_t)(get_seeds(0)*get_seeds(1));
 
+  pmtjit = new float[camgeom->GetNumPixels()];
+
   // reset variables
 
+  TRandom random;
+  random.SetSeed(seed);
+
   for ( uint i = 0; i < camgeom->GetNumPixels(); i++ )
-    nphe[i] = 0.0;
+    {
+      nphe[i] = 0.0;
+
+      //
+      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
+      // not accept negative times!)
+      //
+      do 
+	pmtjit[i] = random.Gaus(3.*pmt_jitter, pmt_jitter);
+      while(pmtjit[i]<0.);
+    }
 
   *itotnphe = 0;
   *nphot = 0;
-
-  TRandom random;
-  random.SetSeed(seed);
 
   //
@@ -4887,4 +4901,5 @@
   // dish to the edge of the camera:
   float cos_epsilon_max = cos(atan2(radius_mm, focal_dist_mm));
+
 
 
@@ -5029,16 +5044,8 @@
       nphe[ipixnum] += 1.;
 
-      //
-      // PMT time jitter: gaussian, not negative (MTrigger::FillShow does
-      // not accept negative times!)
-      //
-      do 
-	pmtjit = random.Gaus(3.*pmt_jitter, pmt_jitter);
-      while(pmtjit<0.);
-
       // store the new photoelectron
 
-      fadc->Fill(ipixnum, time + pmtjit + fadc_jitter, 
-		 trigger->FillShow(ipixnum, time + pmtjit + fadc_jitter),
+      fadc->Fill(ipixnum, time + pmtjit[ipixnum] + fadc_jitter, 
+		 trigger->FillShow(ipixnum, time + pmtjit[ipixnum] + fadc_jitter),
 		 !((*camgeom)[ipixnum].GetD()>(*camgeom)[0].GetD()));
     
@@ -5061,4 +5068,9 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.96  2005/03/01 21:57:01  moralejo
+//
+//  Set parameters for the shape of the low gain pulse in the FADC to more
+//  precise values. Low gain pulse from real data was provided by H. Bartko.
+//
 // Revision 1.95  2005/03/01 20:13:17  moralejo
 //  Added comments
