Index: trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 408)
+++ trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx	(revision 435)
@@ -21,7 +21,7 @@
 //
 // $RCSfile: camera.cxx,v $
-// $Revision: 1.10 $
-// $Author: MagicSol $ 
-// $Date: 2000-07-04 14:10:20 $
+// $Revision: 1.11 $
+// $Author: harald $ 
+// $Date: 2000-09-21 11:47:33 $
 //
 ////////////////////////////////////////////////////////////////////////
@@ -62,4 +62,5 @@
 #include "MMcEvt.h"
 #include "MMcTrig.hxx"
+#include "MHeaderTrig.hxx"
 
 /*!@" 
@@ -437,7 +438,11 @@
 
   int ntrigger = 0;           //@< number of triggers in the whole file
+  int btrigger = 0;           //@< trigger flag
   int ithrescount;            //@< counter for loop over threshold trigger
   int imulticount;            //@< counter for loop over multiplicity trigger
   int itopocount;             //@< counter for loop over topology trigger
+  int icontrigger;            //@< number of trigger conditions to be analised
+  UShort_t numPix;            //@< number of sets of fadc written counts
+
   float fpixelthres[TRIGGER_PIXELS];
 
@@ -533,6 +538,11 @@
   Trigger_Loop = get_Trigger_Loop(&Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop);
 
+  icontrigger =(Trigger_loop_uthres-Trigger_loop_lthres+1)*
+    (Trigger_loop_umult-Trigger_loop_lmult+1)*
+    (Trigger_loop_utop-Trigger_loop_ltop+1);
+
   if (!Trigger_Loop){
     get_Trigger_Single (&Trigger_threshold, &Trigger_multiplicity, &Trigger_topology);
+    icontrigger=1;
   }
 
@@ -675,5 +685,23 @@
   MTrigger  Trigger(Trigger_gate_length, Trigger_response_ampl, Trigger_response_fwhm);         //@< A instance of the Class MTrigger 
 
-  MMcTrig *McTrig   = new MMcTrig() ; 
+  //  Initialise McTrig information class if we want to save trigger informtion
+
+  MMcTrig **McTrig; 
+  MHeaderTrig **HeaderTrig; 
+
+  if (Write_McTrig){
+
+    McTrig = new MMcTrig * [icontrigger];
+  
+    for (i=0;i<icontrigger;i++) {
+      McTrig[i] = new MMcTrig();
+    }
+
+    HeaderTrig = new MHeaderTrig * [icontrigger];
+  
+    for (i=0;i<icontrigger;i++) {
+      HeaderTrig[i] = new MHeaderTrig();
+    }
+  }
 
   MFadc fadc ;                //@< A instance of the Class MFadc
@@ -682,5 +710,14 @@
   // Prepare the raw data output
 
-  MRawEvt *Evt   = new MRawEvt() ; 
+  MRawEvt **Evt;
+
+  if (Write_RawEvt) {
+    Evt = new MRawEvt * [icontrigger]; 
+
+    for (i=0;i<icontrigger;i++) {
+      Evt[i] = new MRawEvt();
+    }
+  }
+
   MMcEvt  *McEvt = new MMcEvt (); 
 
@@ -691,37 +728,107 @@
   TFile outfile_temp ( rootname , "RECREATE" ); 
 
-  
+  Int_t bsize=128000; Int_t split=1;
+
+  //      create a Tree for the Header Event
+  TTree HeaderTree("HeaderTree","Header of Run");
+  
+  //      define branches of Header Tree
+
+  char help[4];  
+
+  if(!Trigger_Loop && Write_McTrig){
+    
+    HeaderTree.Branch("MHeaderTrig","MHeaderTrig", 
+		 &HeaderTrig[0], bsize, split);    
+  }
+  if (Trigger_Loop && Write_McTrig){
+    for(char branchname[10],i=0;i<icontrigger;i++){
+      
+      sprintf(help,"%i",i+1);
+      strcpy (branchname, "MHeaderTrig");
+      strcat (branchname, & help[0]);
+      strcat (branchname, ".");
+      HeaderTree.Branch(branchname,"MHeaderTrig", 
+		     &HeaderTrig[i], bsize, split);
+    }
+  }  
+
+  //  Fill branches
+  
+  if(!Trigger_Loop && Write_McTrig){
+
+    HeaderTrig[0]->SetTopology((Short_t) Trigger_topology);
+    HeaderTrig[0]->SetMultiplicity((Short_t) Trigger_multiplicity);
+    for(i=0;i<TRIGGER_PIXELS;i++){
+      fpixelthres[i]=(Float_t)Trigger_threshold;
+    }
+    HeaderTrig[0]->SetThreshold( fpixelthres);
+
+  }
+  if(Trigger_Loop && Write_McTrig){
+
+    for (int iconcount=0,ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){
+      for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){
+	for(itopocount=0;itopocount<=Trigger_loop_utop-Trigger_loop_ltop;itopocount++){
+	  HeaderTrig[iconcount]->SetTopology((Short_t) itopocount+Trigger_loop_ltop);
+	  HeaderTrig[iconcount]->SetMultiplicity((Short_t) imulticount+Trigger_loop_lmult);
+	  for(i=0;i<TRIGGER_PIXELS;i++){
+	    fpixelthres[i]=(Float_t)(ithrescount+Trigger_loop_lthres);
+	  }
+	  HeaderTrig[iconcount]->SetThreshold( fpixelthres);
+	  iconcount++;
+	}
+      }   
+    }
+  }
+
+  //  Fill the Header Tree with the current leaves of each branch
+  HeaderTree.Fill() ;
+	    
+
   //      create a Tree for the Event data stream 
   TTree EvtTree("EvtTree","Events of Run");
 
-  Int_t bsize=128000; Int_t split=1;
+  if (Write_McEvt){
+
+    EvtTree.Branch("MMcEvt","MMcEvt", 
+		   &McEvt, bsize, split);  
+  }
 
   if(!Trigger_Loop){
     
-    EvtTree.Branch("MRawEvt","MRawEvt", 
-		   &Evt, bsize, split);
-  }
-
-  EvtTree.Branch("MMcEvt","MMcEvt", 
-		 &McEvt, bsize, split);
-  
-  EvtTree.Branch("MMcTrig","MMcTrig", 
-		 &McTrig, bsize, split);
-
-  
-  //      create a Tree for the Event data stream 
-  TTree EvtTree_loop("EvtTree","Events of Run");
+    if (Write_RawEvt){
+      EvtTree.Branch("MRawEvt","MRawEvt", 
+		     &Evt[0], bsize, split);
+    }
+    if (Write_McTrig){
+      EvtTree.Branch("MMcTrig","MMcTrig", 
+		     &McTrig[0], bsize, split);
+    }    
+  }
+  else{
+    if (Write_McTrig){
+      for(char branchname[10],i=0;i<icontrigger;i++){
+      
+	sprintf(help,"%i",i+1);
+	strcpy (branchname, "MMcTrig");
+	strcat (branchname, & help[0]);
+	strcat (branchname, ".");
+	EvtTree.Branch(branchname,"MMcTrig", 
+		       &McTrig[i], bsize, split);
+      }
+    }
+  }  
 
   if (Trigger_Loop && Write_RawEvt){
-    
-    EvtTree_loop.Branch("MRawEvt","MRawEvt", 
-			&Evt, bsize, split);
-    
-    EvtTree_loop.Branch("MMcEvt","MMcEvt", 
-			&McEvt, bsize, split);
-    
-    EvtTree_loop.Branch("MMcTrig","MMcTrig", 
-			&McTrig, bsize, split);
-    
+    for(char branchname[10],i=0;i<icontrigger;i++){
+      
+      sprintf(help,"%i",i+1);
+      strcpy (branchname, "MRawEvt");
+      strcat (branchname, & help[0]);
+      strcat (branchname, ".");
+      EvtTree.Branch(branchname,"MRawEvt", 
+		     &Evt[i], bsize, split);
+    }
   }
 
@@ -853,23 +960,10 @@
     if(!isA( flag, FLAG_START_OF_RUN )){
 
-      //We write some trigger information in data file before exit
-
-      datafile<<ntshow<<" event(s), with a total of "<<ntcph<<" C.photons"<<endl;
-      if (Trigger_Loop){
-	datafile<<"Fraction of triggers: "<<endl;
-	for (ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){
-	  for (imulticount=Trigger_loop_lmult;imulticount<=Trigger_loop_umult;imulticount++){
-	    for(itopocount=Trigger_loop_ltop;itopocount<=Trigger_loop_utop;itopocount++){
-	      datafile<<"Thres "<<ithrescount<<", Multi "<<imulticount<<", Topo"<<itopocount<<": ";
-	      datafile<<((float)ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop] / ((float)ntshow) * 100.0)<<"% ("<<ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]<<" out of "<<ntshow<<")"<<endl;
-	    }
-	  }   
-	}
-      }
-      else{
-	datafile<<"Fraction of triggers: "<<((float)ntrigger) / ((float)ntshow) * 100.0<<" ("<<ntrigger<<" out of "<<ntshow<<" )"<<endl;
-      }
       //  We exit
-      error( SIGNATURE, "Expected start of run flag, but found: %s\n", flag );
+      //error( SIGNATURE, "Expected start of run flag, but found: %s\n", flag );
+      //  We break the main loop
+      cout<<"Warning: Expected start of run flag, but found:"<<flag<<endl;
+      cout<<"         We break the main loop"<<endl;
+      break;      
     }
     else { // found start of run
@@ -1064,4 +1158,5 @@
 	
 	cout << "Total number of phes: " << inumphe <<endl;
+	
 
 	//++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -1084,10 +1179,11 @@
 	//   
 	Trigger.ElecNoise() ;
+	
 	fadc.ElecNoise() ;
-	
+
 	//   We study several trigger conditons
 	if(Trigger_Loop){
 	  //  Loop over trigger threshold
-	  for (ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){
+	  for (int iconcount=0,ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){
 	    for (i=0;i<TRIGGER_PIXELS;i++)
 	      fpixelthres[i]=(float) ithrescount;
@@ -1103,4 +1199,8 @@
 	    //   CHANNEL_THRESHOLD. 
 	    //
+	    
+	    //  Set trigger flags to zero
+	    Lev1=Lev2=0;
+	    btrigger=0;
 
 	    //  loop over multiplicity of trigger configuration
@@ -1110,43 +1210,43 @@
 
 	      Lev0=(Short_t) Trigger.ZeroLevel();
-	      if (Lev0>0 || Write_All_Images){
-		Lev1=Lev2=0;
-
+	      if (Lev0>0 || Write_All_Images || btrigger){
+		
 		//  loop over topologies
 		for(itopocount=Trigger_loop_ltop;itopocount<=Trigger_loop_utop;itopocount++){
+		  Lev1=Lev2=0;
+		
 		  if(itopocount==0 && imulticount>7) continue;
 		  if(itopocount==2 && imulticount<3) continue;
 		  Trigger.SetTopology(itopocount);
 		  Trigger.ClearFirst();
-
+		  
 		  //
 		  //   Start the First Level Trigger simulation
 		  //
-		  McTrig->SetFirstLevel (Lev1=Trigger.FirstLevel());
+		  Lev1=Trigger.FirstLevel();
+		  if (Write_McTrig)
+		    McTrig[iconcount]->SetFirstLevel (Lev1);
 		  if(Lev1>0) {
+		    btrigger= 1;
 		    ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]++;
-		    McTrig->SetTopology(itopocount);
-		    McTrig->SetMultiplicity(imulticount);
-		    McTrig->SetThreshold(fpixelthres);		  
 		  }
-		  if(Lev1==0 && Write_All_Images){
-		    McTrig->SetTopology(itopocount);
-		    McTrig->SetMultiplicity(imulticount);
-		    McTrig->SetThreshold(fpixelthres);
+		  
+		  if(Lev1==0 && (Write_All_Images || btrigger)){
+		    btrigger= 1;
 		    Lev1=1;
 		  }
+		  numPix=0;
 		  for (Int_t ii=0;ii<Lev1;ii++){
-		    McTrig->SetTime(Trigger.GetFirstLevelTime(ii));
-		    McTrig->SetPixel(Trigger.GetFirstLevelPixel(ii));
+		    if (Write_McTrig)
+		      McTrig[iconcount]->SetTime(Trigger.GetFirstLevelTime(ii),ii+1);
+		    if (Write_McTrig)
+		      McTrig[iconcount]->SetPixel(Trigger.GetFirstLevelPixel(ii),ii+1);
+		    
+		    //
+		    //  fill inside the class fadc the member output
+		    //
+
 		    fadc.TriggeredFadc(Trigger.GetFirstLevelTime(ii));
-
-		    //   fill pixel information
-		    
-		    for(i=0;i<iMAXNUMPIX;i++){
-		      for (j=0;j<SLICES_MFADC;j++){
-			fadcValues[j]=fadc.GetFadcSignal(i,j);
-		      }
-		    }
-
+	    
 		    if( Write_RawEvt ){
 		      //
@@ -1154,63 +1254,62 @@
 		      //
 		      
-		      Evt->FillHeader ( (UShort_t) (ntshow + nshow) ,  20 ) ; 
-		      
+		      Evt[iconcount]->FillHeader ( (UInt_t) (ntshow + nshow),(Float_t) (nshow*10000+iconcount*100+ii),0 );
 		      //   fill pixel information
-		      
-		      Evt->FillPixel(i,fadcValues);
-		    
-		      //
-		      //   fill the MMcEvt with all information  
-		      //
-		    
-		      McEvt->Fill( (UShort_t) mcevth.get_primary() , 
-				   mcevth.get_energy(), 
-				   mcevth.get_theta(), 
-				   mcevth.get_phi(), 
-				   mcevth.get_core(),
-				   mcevth.get_coreX(),
-				   mcevth.get_coreY(),
-				   impactD,
-				   ulli, ulli, 
-				   (UShort_t) ncph, 
-				   ulli, 
-				   (UShort_t) ncph) ; 
-		      //   We don not count phtons out of the camera.	
-		      
-		      //
-		      //    write it out to the file outfile
-		      // 
-		    
-		      EvtTree_loop.Fill() ;
-
-		      //    clear all
-		      Evt->Clear() ; 
-		      McEvt->Clear() ;  
+		      for(i=0;i<ct_NPixels;i++){
+			for (j=0;j<SLICES_MFADC;j++){
+			  fadcValues[j]=fadc.GetFadcSignal(i,j);
+			}
+			Evt[iconcount]->FillPixel(i+1000*ii,&numPix,fadcValues);
+		      }
 		    }
 		  }
 		  //
-		  //   fill the MMcEvt with all information  
+		  // Increase counter of analised trigger conditions
 		  //
-		  
-		  McEvt->Fill( (UShort_t) mcevth.get_primary() , 
-			       mcevth.get_energy(), 
-			       mcevth.get_theta(), 
-			       mcevth.get_phi(), 
-			       mcevth.get_core(),
-			       mcevth.get_coreX(),
-			       mcevth.get_coreY(),
-			       impactD,
-			       ulli, ulli, 
-			       (UShort_t) ncph, 
-			       ulli, 
-			       (UShort_t) ncph) ;
-
-		  EvtTree.Fill() ;
-	
-		  McTrig->Clear() ;
+		  iconcount++;
 		}
 	      }
-	      else break;
+	      else{
+		break;
+	      }
 	    }
+	    if (!btrigger) break;
+	  }
+	  if (btrigger){
+
+	    //
+	    //   fill the MMcEvt with all information  
+	    //
+
+	    if (Write_McEvt) {
+	      McEvt->Fill( (UShort_t) mcevth.get_primary() , 
+			   mcevth.get_energy(), 
+			   mcevth.get_theta(), 
+			   mcevth.get_phi(), 
+			   mcevth.get_core(),
+			   mcevth.get_coreX(),
+			   mcevth.get_coreY(),
+			   impactD,
+			   ulli, ulli, 
+			   (UShort_t) ncph, 
+			   ulli, 
+			   (UShort_t) ncph) ;
+	    }
+	    //  Fill the Tree with the current leaves of each branch
+	    i=EvtTree.Fill() ;
+    
+	    //  Clear the branches
+	    if(Write_McTrig){
+	      for(i=0;i<icontrigger;i++){
+		McTrig[i]->Clear() ;
+	      }
+	    }
+	    if( Write_RawEvt ){
+	      for(i=0;i<icontrigger;i++){
+		Evt[i]->Clear() ;
+	      }
+	    }
+	    if (Write_McEvt)
+	      McEvt->Clear() ;  
 	  }
 	}
@@ -1245,5 +1344,7 @@
 	  
 	  if ( Lev0 > 0 || Write_All_Images) {
-	    McTrig->SetFirstLevel (Lev1= Trigger.FirstLevel());
+	    Lev1= Trigger.FirstLevel();
+	    if (Write_McTrig)
+	      McTrig[0]->SetFirstLevel (Lev1);
 	  }
 	  if (Lev1>0){
@@ -1253,49 +1354,57 @@
 	    Lev1=1;
 	  }
-	  McTrig->SetTopology(Trigger.GetTopology());
-	  McTrig->SetMultiplicity(Trigger.GetMultiplicity());
-	  for(i=0;i<TRIGGER_PIXELS;i++){
-	    fpixelthres[i]=Trigger.GetThreshold(i);
-	  }
-	  McTrig->SetThreshold(fpixelthres);
-
+
+	  numPix=0;
 	  for(Int_t ii=0;ii<Lev1;ii++){
 	    //  Loop over different level one triggers
+
+	    //
+	    //   fill inside class fadc the member output
+	    //
 	    fadc.TriggeredFadc(Trigger.GetFirstLevelTime(ii));
-	    McTrig->SetTime(Trigger.GetFirstLevelTime(ii));
-	    McTrig->SetPixel(Trigger.GetFirstLevelPixel(ii));
-	    
-	    //
-	    //  Fill the header of this event 
-	    //
-	    
-	    Evt->FillHeader ( (UShort_t) (ntshow + nshow) ,  20 ) ; 
-	    
-	    //   fill pixel information
-	    
-	    for(i=0;i<iMAXNUMPIX;i++){
-	      for (j=0;j<SLICES_MFADC;j++){
-		fadcValues[j]=fadc.GetFadcSignal(i,j);
+
+	    if (Write_McTrig)
+	      McTrig[0]->SetTime(Trigger.GetFirstLevelTime(ii),ii+1);
+
+	    if (Write_McTrig)
+	      McTrig[0]->SetPixel(Trigger.GetFirstLevelPixel(ii),ii+1);
+
+	    //  Fill Evt information
+
+	    if (Write_RawEvt){
+
+	      //
+	      //  Fill the header of this event 
+	      //
+	      
+	      Evt[0]->FillHeader ( (UShort_t) (ntshow + nshow) ,  20 ) ; 
+	      
+	      //   fill pixel information
+	      
+	      for(i=0;i<ct_NPixels;i++){
+		for (j=0;j<SLICES_MFADC;j++){
+		  fadcValues[j]=fadc.GetFadcSignal(i,j);
+		}
+		Evt[0]->FillPixel(i,&numPix,fadcValues);
 	      }
-	      Evt->FillPixel(i,fadcValues);
-	    }
-	    
+	    }	    
 	    //
 	    //   fill the MMcEvt with all information  
 	    //
 	    
-	    McEvt->Fill( (UShort_t) mcevth.get_primary() , 
-			 mcevth.get_energy(), 
-			 mcevth.get_theta(), 
-			 mcevth.get_phi(), 
-			 mcevth.get_core(),
-			 mcevth.get_coreX(),
-			 mcevth.get_coreY(),
-			 impactD,
-			 ulli, ulli, 
-			 (UShort_t) ncph, 
-			 ulli, 
-			 (UShort_t) ncph) ; 
-	    
+	    if (Write_McEvt){
+	      McEvt->Fill( (UShort_t) mcevth.get_primary() , 
+			   mcevth.get_energy(), 
+			   mcevth.get_theta(), 
+			   mcevth.get_phi(), 
+			   mcevth.get_core(),
+			   mcevth.get_coreX(),
+			   mcevth.get_coreY(),
+			   impactD,
+			   ulli, ulli, 
+			   (UShort_t) ncph, 
+			   ulli, 
+			   (UShort_t) ncph) ; 
+	    }
 	    //   We don not count photons out of the camera.	
 	    
@@ -1327,8 +1436,8 @@
 	    
 	    //    clear all
-	    Evt->Clear() ; 
-	    McEvt->Clear() ; 
+	    if (Write_RawEvt) Evt[0]->Clear() ; 
+	    if (Write_McEvt) McEvt->Clear() ; 
 	  } 
-	  McTrig->Clear() ;
+	  if (Write_McTrig) McTrig[0]->Clear() ;
 	}
 		
@@ -1383,5 +1492,5 @@
 	  log(SIGNATURE, "End of file . . .\n");
 	  still_in_loop  = FALSE;
-	  
+  
 	  if ((! Data_From_STDIN) && ( !feof(inputfile) )){
 	    
@@ -1394,9 +1503,9 @@
 	    
 	  }
+	  
+	  fread( flag, SIZE_OF_FLAGS, 1, inputfile );
 
 	} // end if found end of file
       } // end if found end of run
-
-      fread( flag, SIZE_OF_FLAGS, 1, inputfile );
 
     } // end if else found start of run
@@ -1407,4 +1516,5 @@
   //--
 
+  HeaderTree.Write() ;
   EvtTree.Write() ; 
   outfile_temp.Write() ;
@@ -1416,18 +1526,9 @@
   
   TFile outfile ( rootname , "RECREATE" ); 
+  HeaderTree.Write() ;
   EvtTree.Write() ; 
   outfile.Write() ;
   outfile.Close() ; 
 
-  if(Trigger_Loop && Write_RawEvt){
-    //++
-    // put the Event to the special root file
-    //--
-    TFile outfile_loop( rootname_loop , "RECREATE" );
-    EvtTree_loop.Write() ; 
-    outfile_loop.Write() ;
-
-    outfile_loop.Close() ; 
-  }
   // close input file
   
@@ -2352,5 +2453,6 @@
   b = pcam->dpixdiameter_cm / 2. * pcam->dpixsizefactor[ipixnum];
   a = pcam->dpixdiameter_cm / sqrt(3.) * pcam->dpixsizefactor[ipixnum];
-  c = 1. - 1./sqrt(3.);
+  c = 1./sqrt(3.);
+
   if((ipixnum < 0)||(ipixnum >= pcam->inumpixels)){
     fprintf(stderr, "Error in bpoint_is_in_pix: invalid pixel number %d\n", ipixnum);
@@ -2543,5 +2645,5 @@
     cx = photon.get_x();
     cy = photon.get_y(); 
-	  
+  
     // get wavelength
 	  
@@ -2573,5 +2675,5 @@
       }
     }
-	   
+
     if(ipixnum==-1){// the photon is in none of the pixels
 
@@ -2585,5 +2687,13 @@
       continue;
     }
-	  	  
+
+    if(ipixnum==0) {// the phton is in the central pixel, which is not used for trigger
+      // read next CPhoton
+
+      fread ( flag, SIZE_OF_FLAGS, 1, sp );
+      
+      // go to beginning of loop, the photon is lost
+      continue;
+    }
     //+++
     // QE simulation
@@ -2596,4 +2706,5 @@
     // check if wl is inside table; outside the table, QE is assumed to be zero
 
+    
     if((wl < qept[0][0]) || (wl > qept[0][pointsQE-1])){
 
@@ -2619,11 +2730,11 @@
 
     qe = lin_interpol(qept[0][k-1], qept[1][k-1], qept[0][k], qept[1][k], wl) / 100.0;
-    
+
     // if random > quantum efficiency, reject it
-	        
-    if ( RandomNumber > qe ) {
+
+    if ( (RandomNumber) > qe ) {
 
       // cout << " lost\n"; 
-	    
+
       // read next Photon
 
@@ -2955,4 +3066,11 @@
 //
 // $Log: not supported by cvs2svn $
+// Revision 1.10  2000/07/04 14:10:20  MagicSol
+// Some changes have been done in the root output file. The RawEvt tree is only
+// stored in the single trigger mode.
+// The trigger input parameters are also given by the general input card.
+// The diffuse NSB and the star NSB have been decoupled. Now the contribution of
+// each one can be studied seperately.
+//
 // Revision 1.9  2000/06/13 13:25:24  blanch
 // The multiple arrays have been replaced, since they do not work
