From: Stephen Sanders (ssanders@ku.edu)
Date: Wed Mar 19 2003 - 10:16:50 EST
Hi,
I am trying to commit a pedestal calibration for C4 to the DB.  To 
obtain the calibration
I used the BrChkvPedCalModule, which has been modified to account for 
C4.  This
module works fine in generating a ascii file of the pedestal 
calibration.  I also use
BrChkvPedCalModule to commit the pedestal, following the example given 
in the
CommitPedCal.C script.  Following this message I'll attach a stripped 
down script that I
used trying to get the pedestal committed.   There are no obvious error 
messages
generated.   However, when I then try to access the pedestals for this 
run, I get
an error:
Fatal in <BrChkvRdoModule::Begin>: Could not find pedestal calibration 
revision!
aborting
Abort
Is there any way to check if the pedestals were ever committed?
Any suggestions would be greatly appreciated!
Thanks,
Steve
=======C4Commit.C==========
#ifndef __CINT__
C4Commit()
#endif
{
#include <iostream.h>
   // ---- Options ----
   BrAppOptionManager *optionManager = BrAppOptionManager::Instance();
   optionManager->SetVersion(1,0, "C4 Macro");
   optionManager->SetHelp("\nFirst argument is the configuration 
script\n");
   BrAppIntOption* debugOption =
     new BrAppIntOption('d', "debug", "Debug level", 0);
   if (!optionManager->ProcessCommandLine()) {
     Warning("C4Commit", "Bad command line, try --help option");
     return;
   }
	
   Char_t histFile [60];
   Char_t calibFile[60];
   Char_t inputFile[120];
   Int_t runNo = 8458;
   sprintf(histFile,"hists/hists_%d.root",runNo);
   sprintf(calibFile,"c4_run%d.calib",runNo);
   //==================================================================
   //
   // Our various managers.
   //
   BrMainDb * mainDb = BrMainDb::Instance();
   mainDb->SetUserName("insert");
   mainDb->SetHostName("rcas0005.rcf.bnl.gov");
   mainDb->SetDbName("BrahmsMain");
   if (!mainDb->Connect( )) return;
   if (!mainDb->ConnectToRun("query" )) return;
   if (!mainDb->ConnectToCalib( )) return;
   BrParameterDbManager *parMan = BrParameterDbManager::Instance();
   parMan->SetDbParameterFileName("DetectorParameters.txt");
   BrRunInfoManager *runInfoManager = BrRunInfoManager::Instance();
   runInfoManager->SetDebugLevel(debugOption->GetValue());
   runInfoManager->Register(runNo);
   BrCalibrationManager* calMan = BrCalibrationManager::Instance();
   calMan->SetDebugLevel(debugOption->GetValue());
   BrGeometryDbManager *geoMan = BrGeometryDbManager::Instance();
   geoMan->SetDbModeMySQL();
   //==================================================================
   //
   // Our main module container.
   //
   BrMainModule* mainModule = new
     BrMainModule("C4MainModule", "C4 commit",
		 "Steve Sanders", 0, 1, 0);
   mainModule->SetMaxEvents(10);
   mainModule->SetMaxRuns(1);
   //
   // Innput module
   //
   UInt_t ioMode = BrIOModule::kBrJobFile;
   BrIOModule * inputModule;
   ioMode |= BrRawDataInput::kBrRawDiskFile;
   sprintf(inputFile,"data/raw/run00%dseq000.dat",runNo);
   inputModule =
     new BrRawDataInput("rawInput", "Raw Data Input");
   inputModule->SetIOMode( ioMode );
   inputModule->AddFile(inputFile);
   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();
   //
   //-------------------------------------------------------
   mainModule->AddModule(new BrDbUpdateModule("DBUP","DB Update"));
   BrChkvPedCalModule * c4 = new BrChkvPedCalModule("C4","C4Ped");
   c4->SetCommitAscii(kTRUE);
   c4->SetCalibFile(calibFile);
   c4->SetComment("Pedestal calibration for C4");
   mainModule->AddModule(c4);
   mainModule->SetDebugLevel(debugOption->GetValue());
}
This archive was generated by hypermail 2.1.5 : Wed Mar 19 2003 - 10:17:38 EST