diff --git a/Makefile b/Makefile
index 5e6465c0e32c3b8b4bb9a857d0ac35e1f6a810ab..232d58a3e27f5421e4068ba5bd00b6cd47dc225e 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@
 CC = g++
 
 TESTS = check-lago
-TARGETS = raw sol example
+TARGETS = raw sol example dump
 CFLAGS = -Wall
 
 all: $(TESTS) $(TARGETS)
@@ -42,6 +42,9 @@ sol: sol.cc lago_file.h lago_data.h
 example: example.cc lago_file.h lago_data.h
 	$(CC) -o $@ $< $(CFLAGS)
 
+dump: dump.cc lago_file.h lago_data.h
+	$(CC) -o $@ $< $(CFLAGS)
+
 .PHONY: clean
 
 clean:
diff --git a/dump.cc b/dump.cc
new file mode 100644
index 0000000000000000000000000000000000000000..aeb9ef1d7e662a50c350240441c0d4e803097608
--- /dev/null
+++ b/dump.cc
@@ -0,0 +1,69 @@
+/*  dump.cc  --  LAGO dump of pulses, mainly intended to debug and develop classes
+ *  
+ *  Copyright (C) 2016-TODAY The LAGO Project, http://lagoproject.org, lago-pi@lagoproject.org
+ *
+ *  Original authors: Hernán Asorey
+ *  e-mail: asoreyh@cab.cnea.gov.ar  (asoreyh@gmail.com)
+ *  Laboratorio Detección de Partículas y Radiación (LabDPR)
+ *  Centro Atómico Bariloche - San Carlos de Bariloche, Argentina 
+ */
+
+/* LICENSE BSD-3-Clause BSD-3-Clause
+Copyright (c) 2012, The LAGO Project
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*  -*- coding: utf8 -*-
+ *  try to preserve encoding  */
+/************************************************************************/
+#define _FILE_OFFSET_BITS 64
+
+#include "lago_defs.h"
+#include "lago_data.h"
+#include "lago_file.h"
+
+using namespace std;
+
+#define MAXPULSEPERSEC 1000000
+
+// This is just an example to use LAGO libraries
+
+int main (int argc, char **argv) {
+	if (argc < 2) {
+		cerr << "Error: data file is needed. Please check." << endl;
+		cerr << endl;
+		cerr << "Usage: " << argv[0] << " <file>" << endl;
+		return 1;
+	}
+	LagoFile Input;
+	int NbPulses=0;
+	LagoGeneric Data;
+	LagoEvent *Pulse;
+	Pulse=(LagoEvent*)malloc(MAXPULSEPERSEC*sizeof(LagoEvent));
+	for (int i=0;i<MAXPULSEPERSEC;i++) 
+		Pulse[i].Init();
+	Input.Open(argv[1]);
+	Input.SetForce(1);
+  
+  //
+  // File reading and processing
+  //
+  cerr << "Reading file" << endl;
+  while(NbPulses!=-1) {
+    NbPulses=Input.ReadOneSecond(&Data,Pulse,MAXPULSEPERSEC);
+	for (int j=CHANNELS-1; j>=0; j--)
+		cout << Pulse[0].IsTriggered(j) << " ";
+	cout << endl;
+  }
+  return 0;
+}
diff --git a/lago_data.h b/lago_data.h
index 355aa041363f76c23b47006d2c43d0fbae474518..c5f582542ed171c9c0b75bfbdf5e2b2b842416dd 100644
--- a/lago_data.h
+++ b/lago_data.h
@@ -110,7 +110,7 @@ class LagoEvent {
 	}
 
     int GetBase(int channel) {
-      return trace[channel][0];
+      return GetPulseBase(channel);
     }
 
     int GetValAtTrigger(int channel) {
@@ -123,8 +123,10 @@ class LagoEvent {
         // negative pulse for Boyita and other detectors where pulse
         // can become negative due to the shaper response
         for (int i=0;i<currentbinfilled;i++) 
-          if (trace[channel][i]>BASELINE) charge+=trace[channel][i]-BASELINE;
-          else charge+=BASELINE-trace[channel][i];
+          if (trace[channel][i]>BASELINE) 
+			  charge+=trace[channel][i]-BASELINE;
+          else 
+			  charge+=BASELINE-trace[channel][i];
       } else {
         for (int i=0;i<currentbinfilled;i++) 
           charge+=trace[channel][i];
@@ -138,9 +140,29 @@ class LagoEvent {
     }
 
     void dump() {
-      std::cout << "# " << trigger << " " << counter << " " << clockcount << std::endl;
-      for (int i=0;i<currentbinfilled;i++) 
-        std::cout << trace[0][i] << " " << trace[1][i] << " " << trace[2][i] << std::endl;
+      std::cout 
+		  << "# trg: " << trigger << " cnt: " << counter << " clk: " << clockcount << " " 
+		  << std::endl;
+	  for (int i=0; i<currentbinfilled; i++) {
+		  std::cout << "# " << i+1 << ": ";
+		  for (int j=0; j<CHANNELS; j++) {
+			  std::cout << trace[j][i] << " ";
+		  }
+		  std::cout << std::endl;
+	  }
+	  std::cout << "# bl: ";
+	  for (int j=0; j<CHANNELS; j++)
+			  std::cout << GetPulseBase(j) << " "; 
+	  std::cout << std::endl;
+	  std::cout << "# pk: ";
+	  for (int j=0; j<CHANNELS; j++)
+			  std::cout << GetPeak(j) << " "; 
+	  std::cout << std::endl;
+	  std::cout << "# cg: ";
+	  for (int j=0; j<CHANNELS; j++)
+			  std::cout << GetCharge(j) << " "; 
+	  std::cout << std::endl;
+	  std::cout << std::endl;
     }
 };
 
diff --git a/raw.cc b/raw.cc
index b20c45a229411a076717a205032958d861fbfc7f..6b5365aa3896faade1e6a3b666544ca6274d511f 100644
--- a/raw.cc
+++ b/raw.cc
@@ -83,6 +83,9 @@ double tim_ap = 0., tim_map = 0.;
 // ALL PULSE DATA ANALYSIS
 int all_trg = 0;
 
+// USE ONLY PULSES TRIGGERED AT CHANNEL FOR CALIBRATION HISTOGRAMS
+int icaltrg = 0; // No! by default
+int chargetmp = 0, peaktmp = 0;
 // DATA STREAMS
 ofstream cal, tim;
 FILE *scl, *sol, *all, *rte, *flx, *mon;
@@ -132,8 +135,7 @@ void TreatSecond(LagoGeneric *Data, LagoEvent*Pulse, int NbPulses) {
 
 	// processing pulses
 	for (int i=0; i<NbPulses; i++) {
-
-		// only count for triggered channel
+		// impossing external trigger
 		int trg_drop = 0;
 		if (itrg)
 			for (int j=0; j<CHANNELS; j++)
@@ -142,15 +144,24 @@ void TreatSecond(LagoGeneric *Data, LagoEvent*Pulse, int NbPulses) {
 						trg_drop++;
 		if (itrg && trg_drop)
 			continue;
-		//count all channels, not only those triggered
+		//we can use this pulse 
 		for (int j=0; j<CHANNELS; j++) {
-			Peak[j][Pulse[i].GetPeak(j)]++;
-			Charge[j][Pulse[i].GetCharge(j,ineg[j])]++;
+			peaktmp = Pulse[i].GetPeak(j);
+			chargetmp = Pulse[i].GetCharge(j,ineg[j]);
+			if (icaltrg) {
+				if (Pulse[i].IsTriggered(j)) {
+					Peak[j][peaktmp]++;
+					Charge[j][chargetmp]++;
+				}
+			} else {
+				Peak[j][peaktmp]++;
+				Charge[j][chargetmp]++;
+			}
 			Base[j][Pulse[i].GetBase(j)]++;
 			scl_flux[j]++;
 			if (iscl) {
 				scl_idx = (int)(Pulse[i].clockcount / SCL_CLOCK);
-				scl_peak = Pulse[i].GetPeak(j);
+				scl_peak = peaktmp;
 				if (isclg)
 					scl_peak += BASELINE;
 				for (int k=0; k<SCL_LEVELS; k++) {
@@ -323,8 +334,7 @@ void TreatSecond(LagoGeneric *Data, LagoEvent*Pulse, int NbPulses) {
 
 void Usage(char *prog, int verbose=0)
 {
-	cout << "\t" << PROJECT << endl;
-	cout << "\tData analysis suite for the LAGO Project (L0 -> L1)" << endl; 
+	cout << "\t" << PROJECT << " " << CODEVERSION << endl;
 	cout << endl;
 	cout << "\t(c) 2012-Today, The LAGO Project, http://lagoproject.org" << endl;
 	cout << "\t(c) 2012, LabDPR, http://labdpr.cab.cnea.gov.ar" << endl;
@@ -332,9 +342,13 @@ void Usage(char *prog, int verbose=0)
 	cout << "\tThe LAGO Project, lago@lagoproject.org" << endl;
 	cout << endl;
 	cout << "\tDPR Lab. 2012" << endl;
-	cout << "\tH. Asorey, asoreyh@cab.cnea.gov.ar" << endl;
+	cout << "\tX. Bertou and H. Asorey, asoreyh@cab.cnea.gov.ar" << endl;
 	cout << endl;
-	cout << "Usage: " << prog << " [modifiers] <options> <values> raw_file" << endl;
+	cout << "\tRaw data analysis suite for the LAGO Project (L0 -> L1)" << endl; 
+	cout << "Usage: " << prog << " [modifiers] <options> <values> <raw_file>[.dat[.bz2]]" << endl;
+	cout << endl;
+	cout << "\tIf 'raw_file' does not exist, switch to STDIN and use <raw_file> as" << endl;
+    cout << "\tbasename for the output files." << endl;
 	cout << endl;
 	cout << "\tOptions and values:"<< endl;
 	cout << "\t-t <a/p> \tproduces .tim time difference histogram file,"  << endl;
@@ -366,11 +380,14 @@ void Usage(char *prog, int verbose=0)
 	cout << "\t-m\tproduces the .mon monitoring file" << endl;
 	cout << "\t-f\tforce analysis for older data versions than " << CODEVERSION << endl;
 	cout << "\t-z\tproduces bzip2 compressed files (solar and scaler data)"<<endl;
-	cout << "\t-l\tproduces .scl scaler data file (old lago analysis)"<<endl;
 	cout << "\t-g\tproduces .scl scaler data file (old lago analysis), but" << endl;
 	cout << "\t  \tabsolute thresholds (should be used with -l)" << endl;
 	cout << "\t-a\tproduces the .all.bz2 compressed file containing charge," << endl;
 	cout << "\t  \tpeak, dc and dt, rise time and fall time for all pulses" << endl;
+	cout << "\t-i\tOnly include pulses that trigger each channel to fill" << endl; 
+	cout << "\t  \tthe calibration histograms of each channel (by default," << endl; 
+	cout << "\t  \tall pulses are included." << endl;
+    cout << "\t-?\tprints this help and exits" << endl << endl;
 	cout << endl;
 	exit(1);
 }
@@ -466,6 +483,9 @@ int main (int argc, char *argv[])
 			case 'g':
 				isclg=1;
 				break;
+			case 'i':
+				icaltrg=1;
+				break;
 			case 'l':
 				iscl=1;
 				irte=1;
diff --git a/sol.cc b/sol.cc
index 2f6cd7cbeea2b21af9a48d3b3d0d3147c9cd90fd..cd3137b8cbbb13a6e7ef3a3d6029dfd9fbe5ab17 100644
--- a/sol.cc
+++ b/sol.cc
@@ -101,28 +101,40 @@ double fitHisto(int xi, int xf, int* h, double* r)
 
 void Usage(char *prog)
 {
-	cout << endl << PROJECT << " " << CODEVERSION << endl;
-	cout << endl << "This is the Space Weather dedicated analysis (L1 -> L2SW)" << endl<< endl;
-	cout << "  Analyze .sol output files to identify solar modulation phenomena." << endl;
-	cout << "  Usage: " << prog << " [flags] <filename>.sol.bz2" << endl;
-	cout << "    If 'file.sol.bz2' does not exits, switch to STDIN and use <filename> as" << endl;
-	cout << "    basename for output file." << endl;
-	cout << "    Options:"<<endl;
-	cout << "      -c <ch>            : channel to be analyzed [1,2,3]" << endl;
-	cout << "      -r <Qs> <Qe>       : calculates the 1-min integrated flux in the signal range Qs<S<Qe, units in ADCq" << endl;
-	cout << "                         : if not Qe is given, use default (Qe=MaxCharge="<< max_charge << ")" << endl;
-	cout << "      -b <width> <start> : calculates the 1-min integrated flux for the histogram in bands of <width> ADCq" << endl;
-	cout << "      -h <det. height>   : detector height in mm (mandatory)" << endl;
-	cout << "      -d <det. diameter> : detector diameter in mm (mandatory)" << endl;
-	cout << "                           first band starts at <start> (default start=1 ADCq)" << endl;
-	cout << "    Flags and Modifiers:"<<endl;
-	cout << "      -p                 : do the analysis of peak histograms (by default, it use only charge histograms)" << endl;
-	cout << "      -s                 : calculates the flux in counts/s instead of counts/min" << endl;
-	cout << "      -n                 : disable automatic detection of features and flux calculations (default: enabled)" << endl;
-	cout << "      -g                 : if auto is enabled, produced the .pos file to analyze goodness of automatic fit. If not, enables automatic detection" << endl;
-	cout << "      -z                 : files output are compressed" << endl;
-	cout << "      -v                 : verbose mode" << endl;
-	cout << "      -?                 : prints help and exits" << endl << endl;
+	cout << "\t" << PROJECT << " " << CODEVERSION << endl;
+	cout << endl;
+    cout << "\t(c) 2012-Today, The LAGO Project, http://lagoproject.org" << endl;
+    cout << "\t(c) 2012, LabDPR, http://labdpr.cab.cnea.gov.ar" << endl;
+    cout << endl;
+    cout << "\tThe LAGO Project, lago@lagoproject.org" << endl;
+    cout << endl;
+    cout << "\tHalley (UIS) and ULA 2014" << endl;
+    cout << "\tY. Perez and H. Asorey, asoreyh@cab.cnea.gov.ar" << endl;
+    cout << endl;
+	cout << "\tSpace Weather dedicated analysis (L1 -> L2SW)" << endl;
+	cout << "\tAnalyze .sol output files to identify solar modulation phenomena." << endl;
+	cout << "\tUsage: " << prog << " [flags] <filename>.sol.bz2" << endl;
+    cout << endl;
+	cout << "\tIf 'file.sol.bz2' does not exits, switch to STDIN and use <filename> as" << endl;
+	cout << "\tbasename for output file." << endl;
+    cout << endl;
+	cout << "\tOptions:"<<endl;
+	cout << "\t-c <ch>      \tchannel to be analyzed [1,2,3]" << endl;
+	cout << "\t-r <Qs> <Qe> \tcalculates the 1-min integrated flux in the signal range Qs<S<Qe, "<<endl;
+	cout << "\t             \tin ADCq. If not Qe is given, use default (Qe=MaxCharge="<< max_charge << ")" << endl;
+	cout << "\t-b <w> <s>   \tcalculates 1-min flux in bands of width <w> ADCq, starting at <s>" << endl;
+	cout << "\t-h <height>  \tdetector height in mm (mandatory)" << endl;
+	cout << "\t-d <diameter>\tdetector diameter in mm (mandatory)" << endl;
+    cout << endl;
+	cout << "\tFlags and Modifiers:"<<endl;
+	cout << "\t-p\tdo the analysis of peak histograms (only charge histograms by default)" << endl;
+	cout << "\t-s\tcalculates the flux in counts/s instead of counts/min" << endl;
+	cout << "\t-n\tdisable automatic detection of features and flux calculations" << endl;
+	cout << "\t-g\tif auto is enabled, produce the .pos file to analyze goodness of automatic fit." << endl; 
+	cout << "\t  \tIf not, it enables automatic detection" << endl;
+	cout << "\t-z\toutput files are compressed using bz2" << endl;
+	cout << "\t-v\tverbose mode" << endl;
+	cout << "\t-?\tprints this help and exits" << endl << endl;
 	exit(1);
 }