Index: trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
===================================================================
--- trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 632)
+++ trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx	(revision 633)
@@ -229,5 +229,7 @@
   histMean =  histPmt->GetMean() ;   
   
-  histPmt->SetContent( ValRazmik) ; 
+  for (i=0;i<41;i++){
+    histPmt->SetBinContent(i,ValRazmik[i]);
+  }
 
   histMean =  histPmt->GetMean() ; 
@@ -455,5 +457,7 @@
   histMean =  histPmt->GetMean() ;   
   
-  histPmt->SetContent( ValRazmik) ; 
+  for (i=0;i<41;i++){
+    histPmt->SetBinContent(i,ValRazmik[i]);
+  }
 
   histMean =  histPmt->GetMean() ; 
@@ -794,4 +798,57 @@
 
 
+void MTrigger::SetNSB( Int_t iPix, Float_t resp[TRIGGER_TIME_SLICES]){
+  // ================================================================
+  //
+  //     Sets the information in the array for the analog signal
+  //     from a given array
+  //
+
+  if ( iPix < 0 ) {
+    cout << "     ERROR: in MTrigger::SetNSB()    " << endl ; 
+    cout << "     ERROR: Pixel Id < 0 ---> Exit " << endl ; 
+    exit (1) ; 
+  }
+  else if ( iPix >= CAMERA_PIXELS ) {
+    cout << "     ERROR: in MTrigger::SetNSB()    " << endl ; 
+    cout << "     ERROR: Pixel Id > CAMERA_PIXELS ---> Exit " << endl ; 
+    exit (1) ; 
+  }
+  else if ( iPix >= TRIGGER_PIXELS ) {
+    //
+    //  We have not to fill information in the trigger part. 
+    //
+  }
+  else {  
+    //
+    // we have a trigger pixel and we fill it 
+    //
+    Int_t i ; 
+
+    //
+    //  but at the beginning we must check if this pixel is
+    //  hitted the first time
+    //
+    
+    if ( used[iPix] == FALSE ) {
+      used [iPix] = TRUE ; 
+      
+      for (i=0; i < TRIGGER_TIME_SLICES; i++ ) {
+	a_sig[iPix][i] = 0. ; 
+	d_sig[iPix][i] = 0. ; 
+      }
+    }
+
+    //
+    //  look over the response signal and put it in the signal line
+    //
+
+    for ( i = 0 ; i<TRIGGER_TIME_SLICES; i++ ) {
+      
+      a_sig[iPix][i] = resp[i];
+    }
+
+  }
+}
 
 void MTrigger::ElecNoise() {
@@ -876,4 +933,26 @@
   
 }
+
+void MTrigger::GetMapDiskriminator(Byte_t *map){
+  //=============================================================
+  //
+  //   Gives a map of the fired pixels (Bool_t  dknt [TRIGGER_PIXELS])
+  //   in an array of Byte_t (each byte has the information for 8 pixels)
+  //
+
+  Int_t i,ii;
+
+  for(i=0;i<TRIGGER_PIXELS/8+1;i++){
+    map[i]=0;
+  }
+
+  for(i=0;i<TRIGGER_PIXELS;i++){
+    ii=(Int_t)i/8;
+    if (dknt[i]==TRUE){
+      map[ii]=map[ii]+(Int_t)pow(2,i-ii*8);
+    }
+  }
+}
+
 
 void MTrigger::Diskriminate() {
