BRAT 2.4.5
Class index
Full class index
brahmlib
BRAHMS
ROOT page
//____________________________________________________________________
// 
// Base class for a calibration module  
// Register the parameter element in the manager at init time
//

//____________________________________________________________________
//
// $Id: BrVertexCalModule.cxx,v 1.2 2002/03/21 15:04:44 ouerdane Exp $
// $Author: ouerdane $
// $Date: 2002/03/21 15:04:44 $
// $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov>
//
#ifndef BRAT_BrVertexCalModule
#include "BrVertexCalModule.h"
#endif
#ifndef ROOT_TDirectory
#include "TDirectory.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef WIN32
#include <iostream>
#else
#include <iostream.h>
#endif
#ifndef BRAT_BrParameterDbManager
#include "BrParameterDbManager.h"
#endif
#ifndef BRAT_BrCalibrationManager
#include "BrCalibrationManager.h"
#endif

//____________________________________________________________________
ClassImp(BrVertexCalModule);

//____________________________________________________________________
 BrVertexCalModule::BrVertexCalModule()
  : BrModule()
{
  // Default constructor. DO NOT USE
  SetState(kSetup);

  fCalibration = 0;
  
  SetLoadAscii(kFALSE);
  SetCommitAscii(kFALSE);
  SetSaveAscii(kFALSE);
  fCalibFile = '0';
  fComment = '0';
}
//____________________________________________________________________
 BrVertexCalModule::BrVertexCalModule(const Char_t* name, const Char_t* title)
  : BrModule(name, title)
{
  // Named Constructor
  SetState(kSetup);
  
  fCalibration = 0;
  
  SetLoadAscii(kFALSE);
  SetCommitAscii(kFALSE);
  SetSaveAscii(kFALSE);
  fCalibFile = '0';
  fComment = '0';
}

//____________________________________________________________________
 void BrVertexCalModule::Init()
{
  // Job-level initialisation
  SetState(kInit);
  
  // -------------------------------------------
  BrCalibrationManager* calMan = 
    BrCalibrationManager::Instance();
  
  if (!calMan) {
    Abort("Init", "could not get calibration manager");
    return;
  }  
  
  fCalibration =
    (BrVertexCalibration*)calMan->Register("BrVertexCalibration",
					   "VERTEX");
  
  if (!fCalibration) {
    Abort("Init", "could not get calibration parameters");
    return;
  }
  
  if (fCommitAscii) {
    fSaveAscii = kFALSE;
    fLoadAscii = kFALSE;
    if (Verbose() > 1) 
      Warning("Init", "Calib. file %s will be read", fCalibFile.Data()); 
  }
  
  if (fSaveAscii) {
    fLoadAscii   = kFALSE;
    fCommitAscii = kFALSE;
    if (Verbose() > 1) 
      Warning("Init", "Calib. file %s will be created", fCalibFile.Data()); 
  }
  
  if (fLoadAscii) {
    fSaveAscii   = kFALSE;
    fCommitAscii = kFALSE;
    if (Verbose() > 1) 
      Warning("Init", "Calib. file %s will be loaded", fCalibFile.Data()); 
  }
  
  if (!fSaveAscii && !fCommitAscii && !fLoadAscii)
    if (Verbose() > 1)
      Warning("Init", "*** No reference to any calibration file ***");

}
 
//____________________________________________________________________
 void BrVertexCalModule::SaveAscii() 
{
  if (fCalibFile == "") {
    cout << " You forgot to set a calibration file for "
	 << GetName() << ".n Please provide it now: " << flush;
    cin >> fCalibFile;
    cout << endl;
  }
}

//____________________________________________________________________
 void BrVertexCalModule::ReadAscii() 
{
  if (fCalibFile == "") {
    cout << " You forgot to set a calibration file for "
	 << GetName() << ".n Please provide it now: " << flush;
    cin >> fCalibFile;
    cout << endl;
  }
 
  if (fCommitAscii)
    if (fComment == "") {
      cout << " You forgot to give some valid comments on your actual calibration"
	   << ".n Please do it now (at least 15 characters) : " << flush;
      cin >> fComment;
      cout << endl;
    }
}

//____________________________________________________________________
//
// $Log: BrVertexCalModule.cxx,v $
// Revision 1.2  2002/03/21 15:04:44  ouerdane
// added fComment member to base class module and method SetComment so that the user can set comments about the calibration at commit time
//
// Revision 1.1  2001/11/02 10:58:46  ouerdane
// Added new classes for automatic vertex offset finding.
// The result is stored in BrVertexCalibration which corresponds
// to a new entry in the SQL database called VERTEX (type BEAM)
// (cf. data/calib/BrVertexCalibration for more details)
//
// The modules are: BrVertexCalModule (base class)
//                  BrBbVertexCalModule for beam-beam counters
//  will come next: BrTpcVertexCalModule
//                  BrZdcVertexCalModule
//
// The bb module uses internally the new cal hit and vertex modules with all offsets
// set to 0. (of course). It only needs TPM1 tracks and a valid BB calibration
// made with the wonderful BB calibration modules and stored into the SQL db :)
//
// Usage: once you've made a calibration and stored to the rcas0005 DB, use
// the script scripts/calib/bb/BbVtxOffset.C to evaluate the BB vertices offsets
// with TPM1.
// The result will be stored into an ascii file that you can commit afterwards
// (check first your histos !)
//
// The vertex module then will read these offsets so that you won't need to think about it!
//
//

This page automatically generated by script docBrat by Christian Holm

Copyright ; 2002 BRAHMS Collaboration <brahmlib@rcf.rhic.bnl.gov>
Last Update on by

Validate HTML
Validate CSS