CMS 3D CMS Logo

Public Member Functions | Private Attributes

dtCalibration::DTT0FillDefaultFromDB Class Reference

#include <DTT0FillDefaultFromDB.h>

Inheritance diagram for dtCalibration::DTT0FillDefaultFromDB:
dtCalibration::DTT0BaseCorrection

List of all members.

Public Member Functions

virtual DTT0Data correction (const DTWireId &)
 DTT0FillDefaultFromDB (const edm::ParameterSet &)
virtual void setES (const edm::EventSetup &setup)
virtual ~DTT0FillDefaultFromDB ()

Private Attributes

std::string dbLabelRef_
const DTT0t0Map_
const DTT0t0MapRef_

Detailed Description

Definition at line 24 of file DTT0FillDefaultFromDB.h.


Constructor & Destructor Documentation

DTT0FillDefaultFromDB::DTT0FillDefaultFromDB ( const edm::ParameterSet pset)

Definition at line 26 of file DTT0FillDefaultFromDB.cc.

                                                                    :
  dbLabelRef_( pset.getParameter<string>("dbLabelRef") ) {
}
DTT0FillDefaultFromDB::~DTT0FillDefaultFromDB ( ) [virtual]

Definition at line 30 of file DTT0FillDefaultFromDB.cc.

                                              {
}

Member Function Documentation

DTT0Data DTT0FillDefaultFromDB::correction ( const DTWireId wireId) [virtual]

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 48 of file DTT0FillDefaultFromDB.cc.

References DTTimeUnits::counts, Exception, DTT0::get(), ntuplemaker::status, t0Map_, and t0MapRef_.

                                                                 {
  // Try to access value in default DB
  // If it does not exist return value from reference DB
  // If it does not exist in reference DB, throw exception
  // Could also set to default zero value
  float t0Mean,t0RMS;
  int status = t0Map_->get(wireId,t0Mean,t0RMS,DTTimeUnits::counts);
  if(!status){
     return DTT0Data(t0Mean,t0RMS);
  } else{
     // Now access reference DB
     float t0MeanRef,t0RMSRef;
     int statusRef = t0MapRef_->get(wireId,t0MeanRef,t0RMSRef,DTTimeUnits::counts);
     if(!statusRef){
        return DTT0Data(t0MeanRef,t0RMSRef);
     } else{
        //... 
        throw cms::Exception("[DTT0FillDefaultFromDB]") << "Could not find t0 entry in reference DB for"
                                                        << wireId << endl;
     }
  }
}
void DTT0FillDefaultFromDB::setES ( const edm::EventSetup setup) [virtual]

Implements dtCalibration::DTT0BaseCorrection.

Definition at line 33 of file DTT0FillDefaultFromDB.cc.

References dbLabelRef_, edm::EventSetup::get(), t0Map_, and t0MapRef_.

                                                         {
  // Get t0 record from DB
  ESHandle<DTT0> t0H;
  setup.get<DTT0Rcd>().get(t0H);
  t0Map_ = &*t0H;
  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] T0 version: " << t0H->version();

  // Get reference t0 DB 
  ESHandle<DTT0> t0RefH;
  setup.get<DTT0Rcd>().get(dbLabelRef_,t0RefH);
  t0MapRef_ = &*t0RefH;
  LogVerbatim("Calibration") << "[DTT0FillDefaultFromDB] Reference T0 version: " << t0RefH->version();

}

Member Data Documentation

Definition at line 36 of file DTT0FillDefaultFromDB.h.

Referenced by setES().

Definition at line 39 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().

Definition at line 38 of file DTT0FillDefaultFromDB.h.

Referenced by correction(), and setES().