Index: trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h	(revision 450)
@@ -8,5 +8,7 @@
 
 #pragma link C++ class MHistosAdc ;
+#pragma link C++ class MHistosTdc ;
 #pragma link C++ class MAdcSpect ;
+#pragma link C++ class MTdcSpect ;
 #pragma link C++ class MShowSpect ;
 
Index: trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc	(revision 450)
@@ -39,17 +39,40 @@
   //
 
-  fFrameTop = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
-  
-  fButEvtDisp = new TGTextButton(fFrameTop, "EventDisplay", M_BUTTON_EVTDISP );
+  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ; 
+  
+  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
+  
+  fButEvtDisp = new TGTextButton(fTop1, "EventDisplay", M_BUTTON_EVTDISP );
   fButEvtDisp->Associate(this) ;   
-  fFrameTop->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-
-  fButPedADC = new TGTextButton(fFrameTop, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
+  fTop1->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+ 
+  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+
+  fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
+ 
+  fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
   fButPedADC->Associate(this) ;   
-  fFrameTop->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
-
-  fButCrADC = new TGTextButton(fFrameTop, "ADC Specta of Cosmics", M_BUTTON_CRADC );
+  fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+  
+  fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
   fButCrADC->Associate(this) ;   
-  fFrameTop->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+  fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+  fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+
+  fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ; 
+ 
+  fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
+  fButPedTDC->Associate(this) ;   
+  fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+  
+  fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
+  fButCrTDC->Associate(this) ;   
+  fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+  fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
 
  
@@ -259,4 +282,30 @@
 	      
 	      fOctober.CrAdcSpectra(fInputFile) ; 
+
+	      break ; 
+      
+	    case M_BUTTON_PEDTDC:
+	      
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }
+	      
+	      fOctober.PedTdcSpectra(fInputFile) ; 
+
+	      break ; 
+      
+	    case M_BUTTON_CRTDC:
+	      
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }
+	      
+	      fOctober.CrTdcSpectra(fInputFile) ; 
 
 	      break ; 
Index: trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h	(revision 450)
@@ -33,4 +33,6 @@
   M_BUTTON_PEDADC, 
   M_BUTTON_CRADC, 
+  M_BUTTON_PEDTDC, 
+  M_BUTTON_CRTDC, 
 
   M_PBUTTON_CDIR_UP, 
@@ -63,8 +65,13 @@
   TGTab             *fTab      ;   // different tabs in the low window
   
+  //     the horizontal frame in the top part
+
+  TGHorizontalFrame *fTop1, *fTop2, *fTop3 ; 
+  
   //   the buttons in the Top Part
   
   TGTextButton      *fButEvtDisp ; 
   TGTextButton      *fButPedADC, *fButCrADC  ; 
+  TGTextButton      *fButPedTDC, *fButCrTDC  ; 
   
   //   the things in the file selector
Index: trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc	(revision 450)
@@ -88,5 +88,5 @@
   tasks->AddToList(fillAdc, "PedTree");
 
-  MShowSpect *showAdc = new MShowSpect () ;
+  MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
   tasks->AddToList(showAdc, "PedTree");
 
@@ -185,5 +185,5 @@
   tasks->AddToList(fillAdc, "EvtTree");
 
-  MShowSpect *showAdc = new MShowSpect () ;
+  MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
   tasks->AddToList(showAdc, "PedTree");
 
@@ -213,2 +213,198 @@
   return ( kTRUE ) ; 
 } 
+
+
+
+Bool_t MOctTest::PedTdcSpectra ( Char_t *inputfile ) 
+{
+  //
+  //  
+  
+  printf ("PedTdcSpectra:: Analyse the file %s \n", inputfile ) ; 
+  
+  //   create a loop for this specific job. 
+  
+  MEvtLoop loop ; 
+  
+  // open input file
+    
+  MRootFile *fileIn = new MRootFile( inputfile );
+
+  //   set up the ParameterList, 
+  //   connect it to the loop
+  
+  MParList *plist = new MParList;
+  loop.SetParList(plist);
+
+  //   set up the TaskList for this program
+  //   and connect it to the loop 
+  
+  MTaskList *tasks  = new MTaskList;
+  tasks->SetEventType("PedTree") ;
+
+  loop.SetTaskList(tasks);
+
+  //    now set up all parameter(data) containers and put them 
+  //    in the parameter list
+  
+  //    the buffer for the RawEvts, here for the Pedestals
+  
+  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("PedTree"));  /* this buffer contains 
+								 *  only one entry
+								 */
+  pedbuf->SetAsInput(fileIn);
+  plist->AddToList(pedbuf);
+  
+  //  now it is neccessary to define the input stream, that means
+  //  we set the input only to PedTree
+
+  MInputStreamID  *inputStream = new MInputStreamID()  ;
+  inputStream->SetEvtType("PedTree") ; 
+  plist->AddToList(inputStream);
+  
+  //
+  //     the data container for the histograms
+  
+  MHistosTdc *his = new MHistosTdc;
+  
+  plist->AddToList(his);
+
+  //  his->SetAsOutput();
+  // This tells the writer that this is an Output Container, which should
+  // be written to a file ( not working yet)
+  
+  
+  //   set up the tasks and add them to the list
+  
+  MParRead *readin = new MParRead;
+  tasks->AddToList(readin, "PedTree");
+
+  MTdcSpect *fillTdc = new MTdcSpect ("PedTree" ) ;
+  tasks->AddToList(fillTdc, "PedTree");
+
+  MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
+  tasks->AddToList(showTdc, "PedTree");
+
+  //    MParWrite *write = new MParWrite;
+  //    tasks->AddToList(write);
+
+  cout << endl;
+  
+  //
+  //  Print the structure of the parameter list plist
+  //
+  tasks->Print();
+
+  cout << endl;
+  
+  //////////////////////////////////////////////////////////////
+  //
+  //   call the event loop for 5000 Events
+  //
+  
+  loop.Eventloop (500);
+  
+  cout << endl << "THE END." << endl ;
+  
+  
+
+  return ( kTRUE ) ; 
+} 
+
+
+
+Bool_t MOctTest::CrTdcSpectra ( Char_t *inputfile ) 
+{
+  //
+  //  
+  
+  printf ("CrTdcSpectra:: Analyse the file %s \n", inputfile ) ; 
+  
+  //   create a loop for this specific job. 
+  
+  MEvtLoop loop ; 
+  
+  // open input file
+    
+  MRootFile *fileIn = new MRootFile( inputfile );
+
+  //   set up the ParameterList, 
+  //   connect it to the loop
+  
+  MParList *plist = new MParList;
+  loop.SetParList(plist);
+
+  //   set up the TaskList for this program
+  //   and connect it to the loop 
+  
+  MTaskList *tasks  = new MTaskList;
+  tasks->SetEventType("EvtTree") ;
+
+  loop.SetTaskList(tasks);
+
+  //    now set up all parameter(data) containers and put them 
+  //    in the parameter list
+  
+  //    the buffer for the RawEvts, here for the Pedestals
+  
+  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("EvtTree"));  /* this buffer contains 
+								 *  only one entry
+								 */
+  pedbuf->SetAsInput(fileIn);
+  plist->AddToList(pedbuf);
+  
+  //  now it is neccessary to define the input stream, that means
+  //  we set the input only to PedTree
+
+  MInputStreamID  *inputStream = new MInputStreamID()  ;
+  inputStream->SetEvtType("EvtTree") ; 
+  plist->AddToList(inputStream);
+  
+  //
+  //     the data container for the histograms
+  
+  MHistosTdc *his = new MHistosTdc;
+  
+  plist->AddToList(his);
+
+  //  his->SetAsOutput();
+  // This tells the writer that this is an Output Container, which should
+  // be written to a file ( not working yet)
+  
+  
+  //   set up the tasks and add them to the list
+  
+  MParRead *readin = new MParRead;
+  tasks->AddToList(readin, "EvtTree");
+
+  MTdcSpect *fillTdc = new MTdcSpect ("EvtTree" ) ;
+  tasks->AddToList(fillTdc, "EvtTree");
+
+  MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
+  tasks->AddToList(showTdc, "EvtTree");
+
+  //    MParWrite *write = new MParWrite;
+  //    tasks->AddToList(write);
+
+  cout << endl;
+  
+  //
+  //  Print the structure of the parameter list plist
+  //
+  tasks->Print();
+
+  cout << endl;
+  
+  //////////////////////////////////////////////////////////////
+  //
+  //   call the event loop for 5000 Events
+  //
+  
+  loop.Eventloop (5000);
+  
+  cout << endl << "THE END." << endl ;
+  
+  
+
+  return ( kTRUE ) ; 
+} 
Index: trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h	(revision 450)
@@ -17,7 +17,9 @@
 #include "MParWrite.h"
 #include "MAdcSpect.h"
+#include "MTdcSpect.h"
 #include "MShowSpect.h"
 #include "MTaskList.h"
 #include "MHistosAdc.h"
+#include "MHistosTdc.h"
 #include "MObjBuffer.h"
 #include "MFile.h"
@@ -37,4 +39,7 @@
   Bool_t PedAdcSpectra( Char_t *inputFile ) ; 
   Bool_t CrAdcSpectra ( Char_t *inputFile ) ; 
+
+  Bool_t PedTdcSpectra( Char_t *inputFile ) ; 
+  Bool_t CrTdcSpectra ( Char_t *inputFile ) ; 
   
   
Index: trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc	(revision 450)
@@ -24,7 +24,9 @@
 ClassImp(MShowSpect)
 
-MShowSpect::MShowSpect( ) 
+MShowSpect::MShowSpect(char *nameHist ) 
 { 
   // default constructor 
+
+  sprintf (fHistName, "%s", nameHist ) ; 
 } 
 
@@ -38,9 +40,9 @@
   //
 
-  fHists = (MHistosAdc*) pList->FindObject("MHistosAdc");
+  fHists = (MHistosAdc*) pList->FindObject( fHistName );
   
   if (!fHists)
     {
-      cout << "ERROR: MShowSpect::PreProc(): MHistosAdc not found!" << endl;
+      cout << "ERROR: MShowSpect::PreProc(): " << fHistName << " not found!" << endl;
       exit(1);
     }
Index: trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h	(revision 450)
@@ -11,4 +11,5 @@
 
 class MHistosAdc;
+class MHistosTdc; 
 class MParList ;
 
@@ -16,10 +17,13 @@
 {
 private:
+  char       fHistName[256] ; 
+
   MHistosAdc *fHists;		// Pointer to Container with the histograms
   
  public:
-  MShowSpect();
   
-  Bool_t PreProcess(MParList * pList);
+  MShowSpect(char* histName );
+  
+  Bool_t PreProcess(MParList * pList); 
   Bool_t PostProcess();
   
@@ -28,2 +32,5 @@
 
 #endif
+
+
+
Index: trunk/MagicSoft/MarsOctober/mocttest/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/Makefile	(revision 449)
+++ trunk/MagicSoft/MarsOctober/mocttest/Makefile	(revision 450)
@@ -55,5 +55,7 @@
 	   MOctTest.cc \
 	   MHistosAdc.cc \
+	   MHistosTdc.cc \
 	   MAdcSpect.cc \
+	   MTdcSpect.cc \
 	   MShowSpect.cc \
 	   MGDisplayAdc.cc 
