CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

DTTTrigT0SegCorrection Class Reference

#include <DTTTrigT0SegCorrection.h>

Inheritance diagram for DTTTrigT0SegCorrection:
DTTTrigBaseCorrection

List of all members.

Public Member Functions

virtual DTTTrigData correction (const DTSuperLayerId &)
 DTTTrigT0SegCorrection (const edm::ParameterSet &)
virtual void setES (const edm::EventSetup &setup)
virtual ~DTTTrigT0SegCorrection ()

Private Member Functions

const TH1F * getHisto (const DTSuperLayerId &)
std::string getHistoName (const DTSuperLayerId &slID)

Private Attributes

std::string dbLabel
TFile * rootFile_
const DTTtrigtTrigMap_

Detailed Description

Concrete implementation of a DTTTrigBaseCorrection. Computes t0-seg correction for tTrig

Revision:
1.2
Author:
A. Vilela Pereira

Definition at line 25 of file DTTTrigT0SegCorrection.h.


Constructor & Destructor Documentation

DTTTrigT0SegCorrection::DTTTrigT0SegCorrection ( const edm::ParameterSet pset)

Definition at line 26 of file DTTTrigT0SegCorrection.cc.

References dtTTrigAnalyzer_cfg::dbLabel, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

                                                                       {
  string t0SegRootFile = pset.getParameter<string>("t0SegRootFile");
  rootFile_ = new TFile(t0SegRootFile.c_str(),"READ");
  dbLabel  = pset.getUntrackedParameter<string>("dbLabel", "");
}
DTTTrigT0SegCorrection::~DTTTrigT0SegCorrection ( ) [virtual]

Definition at line 32 of file DTTTrigT0SegCorrection.cc.

                                                {
  delete rootFile_;
}

Member Function Documentation

DTTTrigData DTTTrigT0SegCorrection::correction ( const DTSuperLayerId slId) [virtual]

Implements DTTTrigBaseCorrection.

Definition at line 43 of file DTTTrigT0SegCorrection.cc.

References Exception, getHisto(), DTTimeUnits::ns, and ntuplemaker::status.

                                                                         {
  float tTrigMean,tTrigSigma,kFactor;
  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
  if(status != 0) throw cms::Exception("[DTTTrigT0SegCorrection]") << "Could not find tTrig entry in DB for"
                                                                   << slId << endl;

  const TH1F* t0SegHisto = getHisto(slId);
  double corrMean = tTrigMean;
  double corrSigma = tTrigSigma;
  //FIXME: can we fit the t0seg histo? How do we remove the peak at 0?;
  double corrKFact = (kFactor*tTrigSigma + t0SegHisto->GetMean())/tTrigSigma;
  return DTTTrigData(corrMean,corrSigma,corrKFact);  
}
const TH1F * DTTTrigT0SegCorrection::getHisto ( const DTSuperLayerId slId) [private]

Definition at line 57 of file DTTTrigT0SegCorrection.cc.

References Exception, mergeVDriftHistosByStation::getHistoName(), and interpolateCardsSimple::histo.

                                                                       {
  string histoName = getHistoName(slId);
  TH1F* histo = static_cast<TH1F*>(rootFile_->Get(histoName.c_str()));
  if(!histo) throw cms::Exception("[DTTTrigT0SegCorrection]") << "t0-seg histogram not found:"
                                                              << histoName << endl; 
  return histo;
}
string DTTTrigT0SegCorrection::getHistoName ( const DTSuperLayerId slID) [private]

Definition at line 65 of file DTTTrigT0SegCorrection.cc.

References DTSuperLayerId::chamberId(), DTChamberId::sector(), relativeConstraints::station, DTChamberId::station(), DTSuperLayerId::superLayer(), and DTChamberId::wheel().

                                                                      {
  DTChamberId chId = slId.chamberId();

  // Compose the chamber name
  stringstream wheel; wheel << chId.wheel();
  stringstream station; station << chId.station();
  stringstream sector; sector << chId.sector();

  string chHistoName =
    "_W" + wheel.str() +
    "_St" + station.str() +
    "_Sec" + sector.str();

  return (slId.superLayer() != 2)?("hRPhiSegT0"+chHistoName):("hRZSegT0"+chHistoName);
}
void DTTTrigT0SegCorrection::setES ( const edm::EventSetup setup) [virtual]

Implements DTTTrigBaseCorrection.

Definition at line 36 of file DTTTrigT0SegCorrection.cc.

References dtTTrigAnalyzer_cfg::dbLabel, and edm::EventSetup::get().

                                                          {
  // Get tTrig record from DB
  ESHandle<DTTtrig> tTrig;
  setup.get<DTTtrigRcd>().get(dbLabel,tTrig);
  tTrigMap_ = &*tTrig;
}

Member Data Documentation

std::string DTTTrigT0SegCorrection::dbLabel [private]

Definition at line 42 of file DTTTrigT0SegCorrection.h.

Definition at line 40 of file DTTTrigT0SegCorrection.h.

Definition at line 44 of file DTTTrigT0SegCorrection.h.