|
//____________________________________________________________________ // // Base class for a calibration module // Register the parameter element in the manager at init time // //____________________________________________________________________ // // $Id: BrBbCalModule.cxx,v 1.7 2002/03/21 15:02:16 ouerdane Exp $ // $Author: ouerdane $ // $Date: 2002/03/21 15:02:16 $ // $Copyright: (C) 2001 BRAHMS Collaboration <brahmlib@rhic.bnl.gov> // #ifndef BRAT_BrBbCalModule #include "BrBbCalModule.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(BrBbCalModule); //____________________________________________________________________ BrBbCalModule::BrBbCalModule() : BrModule() { // Default constructor. DO NOT USE SetState(kSetup); fParamsBb = 0; fCalibration = 0; SetLoadAscii(kFALSE); SetCommitAscii(kFALSE); SetSaveAscii(kFALSE); fCalibFile = '0'; fComment = '0'; SetRef(-1); SetBigRef(-1); SetSmallRef(-1); } //____________________________________________________________________ BrBbCalModule::BrBbCalModule(const Char_t* name, const Char_t* title) : BrModule(name, title) { // Named Constructor SetState(kSetup); fParamsBb = 0; fCalibration = 0; SetLoadAscii(kFALSE); SetCommitAscii(kFALSE); SetSaveAscii(kFALSE); fIsBb = kTRUE; fCalibFile = '0'; fComment = '0'; fBigT = 31; SetRef(31); SetBigRef(31); SetSmallRef(4); if (strcmp(GetName(), "BBL") == 0) { fBigT = 37; SetBigRef(37); SetSmallRef(4); SetRef(37); } if (strcmp(GetName(), "INL") == 0) { fBigT = 9; SetBigRef(9); SetSmallRef(0); SetRef(9); fIsBb = kFALSE; } if (strcmp(GetName(), "INR") == 0) { fBigT = 5; SetBigRef(5); SetSmallRef(0); SetRef(5); fIsBb = kFALSE; } } //____________________________________________________________________ void BrBbCalModule::Init() { // Job-level initialisation SetState(kInit); // check reference tubes if (fRef == -1) { Abort("Init", "The reference tube is -1!!n" " You can set it by SetRef(<t>)"); return; } // ------------------------------------------- // calibration parameters and others BrParameterDbManager* parMan = BrParameterDbManager::Instance(); if( strcmp(GetName(), "BBL") == 0 || strcmp(GetName(), "BBR") == 0) { fParamsBb = (BrDetectorParamsBB*)parMan->GetDetectorParameters("BrDetectorParamsBB", "BB"); } if (strcmp(GetName(), "BBL") == 0) { fNoTubes = fParamsBb->GetNoLeftTubes(); fNoBigTubes = 8; fNoSmallTubes = 36; sprintf(fDigName, "DigBB Left"); } else if (strcmp(GetName(), "BBR") == 0) { fNoTubes = fParamsBb->GetNoRightTubes(); fNoBigTubes = 5; fNoSmallTubes = 30; sprintf(fDigName, "DigBB Right"); } else if (strcmp(GetName(), "INL") == 0) { fNoTubes = 16; fNoBigTubes = 16; fNoSmallTubes = 0; sprintf(fDigName, "BbDig INL"); } else if (strcmp(GetName(), "INR") == 0) { fNoTubes = 16; fNoBigTubes = 16; fNoSmallTubes = 0; sprintf(fDigName, "BbDig INR"); } else { Failure("Init", "*** Don't know this beam-beam array!! " "Names should be BBL, BBR, INL or INR ***"); return; } BrCalibrationManager* calMan = BrCalibrationManager::Instance(); if (!calMan) { Abort("Init", "could not get calibration manager"); return; } fCalibration = (BrBbCalibration*)calMan->Register("BrBbCalibration", GetName()); 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 ***"); // tag tube good fValidTube = new Bool_t [fNoTubes]; for (Int_t t = 0; t < fNoTubes; t++) fValidTube[t] = kTRUE; } //____________________________________________________________________ void BrBbCalModule::SaveAscii() { if (fCalibFile == "") { cout << " You forgot to set a calibration file for " << GetName() << ".n Please provide it now: " << flush; cin >> fCalibFile; cout << endl; } } //____________________________________________________________________ void BrBbCalModule::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 useful comments for this calibration " << ".n Please provide some now (more than 15 characters please): " << flush; cin >> fComment; cout << endl; } } //____________________________________________________________________ // // $Log: BrBbCalModule.cxx,v $ // Revision 1.7 2002/03/21 15:02:16 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.6 2002/03/20 19:30:52 videbaek // Add the INL and INR counters to be dealt with for calibration and timing // In the 2002 pp run there were not really of BB kind since they only have // td information, but it is most convinientn to deal with them as BB calibration // data. // // Revision 1.5 2001/11/01 06:32:09 ouerdane // call of SetLoadAscii() forgotten in constructor, now fixed. // // Revision 1.4 2001/10/15 00:35:07 ouerdane // Updated all Beam-Beam counter calibration modules (like I did for the TOF // some weeks ago): // // Common changes: // added methods Set[Save,Commit,Load]Ascii(Bool_t) // removed methods Set[ReadFrom,LoadFrom,SaveTo]File // // BrBbGainCalModule: // cleaned up a lot the code, added diagnostic histograms showing calibrated // ADC after the 1st MIP peak was found. // Still at a stage where the 1st MIP peak is the only one to be checked. // Later on, will add algorithm to find other peaks. // // Added BrBbSlewingCalModule in Makefile.am, etc // The fit function introduced is dT = a + b/sqrt(dE) + c/dE (where dE = ADC/Gain0) // // Revision 1.3 2001/10/08 11:27:17 cholm // Changed to use new DB access classes // // Revision 1.2 2001/09/23 01:51:51 videbaek // Added prototype Gain calibration module. Updated others to deal with // Load from File. This may be temporary, but does not break any code as far as // I can tell. // // Revision 1.1 2001/07/23 11:39:53 ouerdane // Added calibration modules for Beam-Beam counters // BrBbCalModule: base class // BrBbPedCalModule: pedestals // BrBbTdcGaincalModule tdc gains // // Updated Makefile.am, LinkDef.h, Include.h // |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|