need instructions on use of bratmain

From: Stephen J. Sanders (ssanders@ku.edu)
Date: Mon Jul 30 2001 - 14:16:15 EDT

  • Next message: Christian Holm Christensen: "Re: need instructions on use of bratmain"

    Hi, 
      I am having difficulties trying to use the bratmain program.  Some 
    background--
    what I really want is the functionality of the the TestGeantDig routine 
    that didn't make
    it into brat2.  Reading the brat2 document, there is a suggestion that 
    users wanting
    to do what TestGeantDig accomplished need to write their own macros to 
    work with
    bratmain.  OK.   Before starting on an entirely new macro I thought I 
    would try out
    bratmain using a slightly modified version of Christian's CentMacro.C 
    program. I'm
    attaching the file that I'm running at the end of this message. 
    
    This file runs fine interactively.  That is
    //   promtp% bratroot
    //   brat [0] .x Config.C
    //   brat [1] BrMainModule::Instance()->Main();
    
    works as expected.
    
    I was expecting to be able to just run bratmain (with Config.C in 
    current directory) to accomplish the same thing.  However, when I try 
    this the program runs through
    and exits, apparently never looping over any events.  There are no error 
    messages.
    Christian, what am I missing?
    
    Thanks,  Steve
    
    
    ---Listing of Config.C---
    
    {
    #include <stdio.h>
    #include <iostream>
      //==================================================================
      //
      // Some local variables
      //
      Int_t         maxEvents  = 1000000;
      Int_t         runNo      = 2336;
      const Char_t* geomFile   = "mrs_90.geo";
      const Char_t* inputFile  = "data/run002336seq000.dat";
      const Char_t* outputFile = "output.root";
      const Char_t* histFile = "histograms.root";
      Int_t         nInputs    = 1;
      Int_t         debug      = 0;
      Int_t         verbose    = 0;
    
      //==================================================================
      //
      // Our various managers.
      //
      BrParameterDbManager* fParamDBManager
       = BrParameterDbManager::Instance();
      fParamDBManager->SetDbParameterFileName("DetectorParameters.txt");
      BrGeometryDbManager* geom =
       BrGeometryDbManager::Instance();
      geom->SetDbFileName(geomFile);
    
      //__________________________________________________________________
      //
      // Temporary hack for Tile, Silicon, and Centrality calibrations
      //
      BrTileTmpCalibration* tileCalib = BrTileTmpCalibration::Instance();
      tileCalib->ReadASCIIFile(runNo);
      BrSiTmpCalibration* siCalib = BrSiTmpCalibration::Instance();
      siCalib->ReadASCIIFile(runNo);
      BrMultCentTmpCalibration * centCalib = 
    BrMultCentTmpCalibration::Instance();
     
      //==================================================================
      //
      // Our main module container.
      //
      BrMainModule* mainModule = new
       BrMainModule("CentMainModule", "Centrality config",
            "Steve Sanders", 0, 1, 0);
      mainModule->SetMaxEvents(maxEvents);
      mainModule->SetMaxRuns(nInputs);
    
      //==================================================================
      //
      // Now for our modules
      //
      // Our input module
      //
      BrIOModule* inputModule =
       new BrRawDataInput("rawInput", "Raw Data Input");
      if (nInputs == 1) {
       // For one input file
       inputModule->SetIOMode(BrIOModule::kBrJobFile|
                  BrRawDataInput::kBrRawDiskFile);
       inputModule->AddFile(inputFile);
       cout<<"Replay: "<<inputFile<<endl;
      }
      else {
       // If we wanted more than one input file we could do
       inputModule->SetIOMode(BrIOModule::kBrRunFile|
                  BrRawDataInput::kBrRawDiskFile);
       char* baseName[128];
       for (Int_t i = 0; i < nInputs; i++) {
         sprintf(baseName, "data/run%06dseq%03d.dat", runNo, i);
         cout<<baseName<<endl;
         inputModule->AddFile(baseName);
       }
      }
      // We can easly add BrIOModules to a container!
      mainModule->AddModule(inputModule);
    
      //__________________________________________________________________
      //
      // Histogram module to make sure we get hsitograms the right
      // place.
      //
      BrHistIOModule* histModule =
       new BrHistIOModule("histograms", "Some histograms");
      histModule->AddFile(histFile);
      mainModule->AddModule(histModule);
      mainModule->SetHistOn();
    
      //__________________________________________________________________
      //
      // Trigger filter to select some specific triggers
      //
      BrTriggerFilter* trigModule =
       new BrTriggerFilter("trigModule", "Trigger Filter");
      // trigModule->AddTrigger(1);
      // trigModule->AddTrigger(4);
      // trigModule->AddTrigger(5);
      trigModule->AddTrigger(6);
      mainModule->AddModule(trigModule);
    
      //__________________________________________________________________
      //
      // ZDC module
      //
      BrZdcRdoModule* zdcModule = new BrZdcRdoModule("ZDC", "ZDC Reducer");
      mainModule->AddModule(zdcModule);
    
      //__________________________________________________________________
      //
      // BB module
      //
      BrBbRdoModule* bbModule = new BrBbRdoModule("BB","Beam-Beam Reducer");
      mainModule->AddModule(bbModule);
    
      //__________________________________________________________________
      //
      // TPM1 seqeunce preprocessor
      //
      BrTPCPreProcess *preProcessor =
       new BrTPCPreProcess("TPM1", "TPM1 Preprocessor");
      mainModule->AddModule(preProcessor);
    
      //__________________________________________________________________
      //
      // TPM1 cluster module
      //
      // Who ever made this module _must_ make sure that the
      // BrTPCClusterFinder has the method
      //   Event(BrEventNode*,  BrEventNode*)
      // This is very VERY important!
      BrTpcClusterFinder* tpm1clsModule
       = new BrTpcClusterFinder("TPM1", "TPM1");
      tpm1clsModule->SetMaxPixelCutoff(10);
      mainModule->AddModule(tpm1clsModule);
    
      //__________________________________________________________________
      //
      // TPM1 cluster vertex module
      //
      // Who ever wrote this should redefine the cosntructor to take only
      // two arguments: The name and the title. The proper place to
      // specify the name of the detector is in the name!
      BrTPMClusterVertexModule* tmp1vtxModule =
       new BrTPMClusterVertexModule("VTX", "VertexFinder","TPM1");
      mainModule->AddModule(tmp1vtxModule);
     
     
      //__________________________________________________________________
      //
      // TMA Module
      //
      BrTileRdoModule* tileModule =
       new BrTileRdoModule("Tile","Tile Reducer");
      tileModule->SetOutlierMethod(BrTileRdoModule::kNoCorrection);
      mainModule->AddModule(tileModule);
    
      //__________________________________________________________________
      //
      // SMA Module
      //
      BrSiRdoModule* siModule =
       new BrSiRdoModule("Si","Si Reducer");
      siModule->SetOutlierMethod(BrSiRdoModule::kNoCorrection);
      mainModule->AddModule(siModule);
    
      //__________________________________________________________________
      //
      // Cent Module
      //
      BrMultCentModule * centModule =
       new BrMultCentModule("MultCent","Cent Module");
      BrSwitchContainer * multcentSwitcher =
       new BrSwitchContainer("multcentSwitcher","Switcher for 
    BrMultCentModule");
      multcentSwitcher->AddModule(centModule);
      mainModule->AddModule(multcentSwitcher);
      //__________________________________________________________________
      //
      // Output module
      //
      BrIOModule* outputModule =
         new BrEventIO("ouputModule", "Output module");
      outputModule->SetIOMode(BrIOModule::kBrJobFile|
                             BrIOModule::kBrRecreateFile);
      outputModule->AddFile(outputFile);
      mainModule->AddModule(outputModule);
    
      //==================================================================
      //
      // That is it. Now we just need to tell what kind of debug and
      // verbosity level we want.
      //
      // mainModule->SetDebug(debug);
      mainModule->SetVerbose(verbose);
    }
    



    This archive was generated by hypermail 2b30 : Mon Jul 30 2001 - 14:17:25 EDT