Ignore:
Timestamp:
11/14/00 17:15:40 (24 years ago)
Author:
harald
Message:
added a few for functionalities. Also some spectras for TDCs are implemented.
Location:
trunk/MagicSoft/MarsOctober/mocttest
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h

    r447 r450  
    88
    99#pragma link C++ class MHistosAdc ;
     10#pragma link C++ class MHistosTdc ;
    1011#pragma link C++ class MAdcSpect ;
     12#pragma link C++ class MTdcSpect ;
    1113#pragma link C++ class MShowSpect ;
    1214
  • trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc

    r447 r450  
    3939  //
    4040
    41   fFrameTop = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ;
    42  
    43   fButEvtDisp = new TGTextButton(fFrameTop, "EventDisplay", M_BUTTON_EVTDISP );
     41  fFrameTop = new TGCompositeFrame (this, 300,100, kVerticalFrame ) ;
     42 
     43  fTop1 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
     44 
     45  fButEvtDisp = new TGTextButton(fTop1, "EventDisplay", M_BUTTON_EVTDISP );
    4446  fButEvtDisp->Associate(this) ;   
    45   fFrameTop->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    46 
    47   fButPedADC = new TGTextButton(fFrameTop, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
     47  fTop1->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     48 
     49  fFrameTop->AddFrame (fTop1, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     50
     51
     52  fTop2 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
     53 
     54  fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
    4855  fButPedADC->Associate(this) ;   
    49   fFrameTop->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
    50 
    51   fButCrADC = new TGTextButton(fFrameTop, "ADC Specta of Cosmics", M_BUTTON_CRADC );
     56  fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     57 
     58  fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
    5259  fButCrADC->Associate(this) ;   
    53   fFrameTop->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     60  fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     61
     62  fFrameTop->AddFrame (fTop2, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     63
     64
     65  fTop3 = new TGHorizontalFrame (fFrameTop, 300, 100 ) ;
     66 
     67  fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
     68  fButPedTDC->Associate(this) ;   
     69  fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     70 
     71  fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
     72  fButCrTDC->Associate(this) ;   
     73  fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     74
     75  fFrameTop->AddFrame (fTop3, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
     76
    5477
    5578 
     
    259282             
    260283              fOctober.CrAdcSpectra(fInputFile) ;
     284
     285              break ;
     286     
     287            case M_BUTTON_PEDTDC:
     288             
     289              if ( InputFileSelected() == kFALSE ) {              // it is not selected
     290               
     291                new TGMsgBox(fClient->GetRoot(), this, "ERROR!",
     292                             "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
     293                break ;
     294              }
     295             
     296              fOctober.PedTdcSpectra(fInputFile) ;
     297
     298              break ;
     299     
     300            case M_BUTTON_CRTDC:
     301             
     302              if ( InputFileSelected() == kFALSE ) {              // it is not selected
     303               
     304                new TGMsgBox(fClient->GetRoot(), this, "ERROR!",
     305                             "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
     306                break ;
     307              }
     308             
     309              fOctober.CrTdcSpectra(fInputFile) ;
    261310
    262311              break ;
  • trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h

    r447 r450  
    3333  M_BUTTON_PEDADC,
    3434  M_BUTTON_CRADC,
     35  M_BUTTON_PEDTDC,
     36  M_BUTTON_CRTDC,
    3537
    3638  M_PBUTTON_CDIR_UP,
     
    6365  TGTab             *fTab      ;   // different tabs in the low window
    6466 
     67  //     the horizontal frame in the top part
     68
     69  TGHorizontalFrame *fTop1, *fTop2, *fTop3 ;
     70 
    6571  //   the buttons in the Top Part
    6672 
    6773  TGTextButton      *fButEvtDisp ;
    6874  TGTextButton      *fButPedADC, *fButCrADC  ;
     75  TGTextButton      *fButPedTDC, *fButCrTDC  ;
    6976 
    7077  //   the things in the file selector
  • trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc

    r447 r450  
    8888  tasks->AddToList(fillAdc, "PedTree");
    8989
    90   MShowSpect *showAdc = new MShowSpect () ;
     90  MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
    9191  tasks->AddToList(showAdc, "PedTree");
    9292
     
    185185  tasks->AddToList(fillAdc, "EvtTree");
    186186
    187   MShowSpect *showAdc = new MShowSpect () ;
     187  MShowSpect *showAdc = new MShowSpect ("MHistosAdc") ;
    188188  tasks->AddToList(showAdc, "PedTree");
    189189
     
    213213  return ( kTRUE ) ;
    214214}
     215
     216
     217
     218Bool_t MOctTest::PedTdcSpectra ( Char_t *inputfile )
     219{
     220  //
     221  // 
     222 
     223  printf ("PedTdcSpectra:: Analyse the file %s \n", inputfile ) ;
     224 
     225  //   create a loop for this specific job.
     226 
     227  MEvtLoop loop ;
     228 
     229  // open input file
     230   
     231  MRootFile *fileIn = new MRootFile( inputfile );
     232
     233  //   set up the ParameterList,
     234  //   connect it to the loop
     235 
     236  MParList *plist = new MParList;
     237  loop.SetParList(plist);
     238
     239  //   set up the TaskList for this program
     240  //   and connect it to the loop
     241 
     242  MTaskList *tasks  = new MTaskList;
     243  tasks->SetEventType("PedTree") ;
     244
     245  loop.SetTaskList(tasks);
     246
     247  //    now set up all parameter(data) containers and put them
     248  //    in the parameter list
     249 
     250  //    the buffer for the RawEvts, here for the Pedestals
     251 
     252  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("PedTree"));  /* this buffer contains
     253                                                                 *  only one entry
     254                                                                 */
     255  pedbuf->SetAsInput(fileIn);
     256  plist->AddToList(pedbuf);
     257 
     258  //  now it is neccessary to define the input stream, that means
     259  //  we set the input only to PedTree
     260
     261  MInputStreamID  *inputStream = new MInputStreamID()  ;
     262  inputStream->SetEvtType("PedTree") ;
     263  plist->AddToList(inputStream);
     264 
     265  //
     266  //     the data container for the histograms
     267 
     268  MHistosTdc *his = new MHistosTdc;
     269 
     270  plist->AddToList(his);
     271
     272  //  his->SetAsOutput();
     273  // This tells the writer that this is an Output Container, which should
     274  // be written to a file ( not working yet)
     275 
     276 
     277  //   set up the tasks and add them to the list
     278 
     279  MParRead *readin = new MParRead;
     280  tasks->AddToList(readin, "PedTree");
     281
     282  MTdcSpect *fillTdc = new MTdcSpect ("PedTree" ) ;
     283  tasks->AddToList(fillTdc, "PedTree");
     284
     285  MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
     286  tasks->AddToList(showTdc, "PedTree");
     287
     288  //    MParWrite *write = new MParWrite;
     289  //    tasks->AddToList(write);
     290
     291  cout << endl;
     292 
     293  //
     294  //  Print the structure of the parameter list plist
     295  //
     296  tasks->Print();
     297
     298  cout << endl;
     299 
     300  //////////////////////////////////////////////////////////////
     301  //
     302  //   call the event loop for 5000 Events
     303  //
     304 
     305  loop.Eventloop (500);
     306 
     307  cout << endl << "THE END." << endl ;
     308 
     309 
     310
     311  return ( kTRUE ) ;
     312}
     313
     314
     315
     316Bool_t MOctTest::CrTdcSpectra ( Char_t *inputfile )
     317{
     318  //
     319  // 
     320 
     321  printf ("CrTdcSpectra:: Analyse the file %s \n", inputfile ) ;
     322 
     323  //   create a loop for this specific job.
     324 
     325  MEvtLoop loop ;
     326 
     327  // open input file
     328   
     329  MRootFile *fileIn = new MRootFile( inputfile );
     330
     331  //   set up the ParameterList,
     332  //   connect it to the loop
     333 
     334  MParList *plist = new MParList;
     335  loop.SetParList(plist);
     336
     337  //   set up the TaskList for this program
     338  //   and connect it to the loop
     339 
     340  MTaskList *tasks  = new MTaskList;
     341  tasks->SetEventType("EvtTree") ;
     342
     343  loop.SetTaskList(tasks);
     344
     345  //    now set up all parameter(data) containers and put them
     346  //    in the parameter list
     347 
     348  //    the buffer for the RawEvts, here for the Pedestals
     349 
     350  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("EvtTree"));  /* this buffer contains
     351                                                                 *  only one entry
     352                                                                 */
     353  pedbuf->SetAsInput(fileIn);
     354  plist->AddToList(pedbuf);
     355 
     356  //  now it is neccessary to define the input stream, that means
     357  //  we set the input only to PedTree
     358
     359  MInputStreamID  *inputStream = new MInputStreamID()  ;
     360  inputStream->SetEvtType("EvtTree") ;
     361  plist->AddToList(inputStream);
     362 
     363  //
     364  //     the data container for the histograms
     365 
     366  MHistosTdc *his = new MHistosTdc;
     367 
     368  plist->AddToList(his);
     369
     370  //  his->SetAsOutput();
     371  // This tells the writer that this is an Output Container, which should
     372  // be written to a file ( not working yet)
     373 
     374 
     375  //   set up the tasks and add them to the list
     376 
     377  MParRead *readin = new MParRead;
     378  tasks->AddToList(readin, "EvtTree");
     379
     380  MTdcSpect *fillTdc = new MTdcSpect ("EvtTree" ) ;
     381  tasks->AddToList(fillTdc, "EvtTree");
     382
     383  MShowSpect *showTdc = new MShowSpect ("MHistosTdc") ;
     384  tasks->AddToList(showTdc, "EvtTree");
     385
     386  //    MParWrite *write = new MParWrite;
     387  //    tasks->AddToList(write);
     388
     389  cout << endl;
     390 
     391  //
     392  //  Print the structure of the parameter list plist
     393  //
     394  tasks->Print();
     395
     396  cout << endl;
     397 
     398  //////////////////////////////////////////////////////////////
     399  //
     400  //   call the event loop for 5000 Events
     401  //
     402 
     403  loop.Eventloop (5000);
     404 
     405  cout << endl << "THE END." << endl ;
     406 
     407 
     408
     409  return ( kTRUE ) ;
     410}
  • trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h

    r447 r450  
    1717#include "MParWrite.h"
    1818#include "MAdcSpect.h"
     19#include "MTdcSpect.h"
    1920#include "MShowSpect.h"
    2021#include "MTaskList.h"
    2122#include "MHistosAdc.h"
     23#include "MHistosTdc.h"
    2224#include "MObjBuffer.h"
    2325#include "MFile.h"
     
    3739  Bool_t PedAdcSpectra( Char_t *inputFile ) ;
    3840  Bool_t CrAdcSpectra ( Char_t *inputFile ) ;
     41
     42  Bool_t PedTdcSpectra( Char_t *inputFile ) ;
     43  Bool_t CrTdcSpectra ( Char_t *inputFile ) ;
    3944 
    4045 
  • trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc

    r447 r450  
    2424ClassImp(MShowSpect)
    2525
    26 MShowSpect::MShowSpect( )
     26MShowSpect::MShowSpect(char *nameHist )
    2727{
    2828  // default constructor
     29
     30  sprintf (fHistName, "%s", nameHist ) ;
    2931}
    3032
     
    3840  //
    3941
    40   fHists = (MHistosAdc*) pList->FindObject("MHistosAdc");
     42  fHists = (MHistosAdc*) pList->FindObject( fHistName );
    4143 
    4244  if (!fHists)
    4345    {
    44       cout << "ERROR: MShowSpect::PreProc(): MHistosAdc not found!" << endl;
     46      cout << "ERROR: MShowSpect::PreProc(): " << fHistName << " not found!" << endl;
    4547      exit(1);
    4648    }
  • trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h

    r447 r450  
    1111
    1212class MHistosAdc;
     13class MHistosTdc;
    1314class MParList ;
    1415
     
    1617{
    1718private:
     19  char       fHistName[256] ;
     20
    1821  MHistosAdc *fHists;           // Pointer to Container with the histograms
    1922 
    2023 public:
    21   MShowSpect();
    2224 
    23   Bool_t PreProcess(MParList * pList);
     25  MShowSpect(char* histName );
     26 
     27  Bool_t PreProcess(MParList * pList);
    2428  Bool_t PostProcess();
    2529 
     
    2832
    2933#endif
     34
     35
     36
  • trunk/MagicSoft/MarsOctober/mocttest/Makefile

    r447 r450  
    5555           MOctTest.cc \
    5656           MHistosAdc.cc \
     57           MHistosTdc.cc \
    5758           MAdcSpect.cc \
     59           MTdcSpect.cc \
    5860           MShowSpect.cc \
    5961           MGDisplayAdc.cc
Note: See TracChangeset for help on using the changeset viewer.