CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTTTrigT0SegCorrection Class Reference

#include <DTTTrigT0SegCorrection.h>

Inheritance diagram for DTTTrigT0SegCorrection:
DTTTrigBaseCorrection

Public Member Functions

virtual DTTTrigData correction (const DTSuperLayerId &)
 
 DTTTrigT0SegCorrection (const edm::ParameterSet &)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTTTrigT0SegCorrection ()
 
- Public Member Functions inherited from DTTTrigBaseCorrection
 DTTTrigBaseCorrection ()
 
virtual ~DTTTrigBaseCorrection ()
 

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().

26  {
27  string t0SegRootFile = pset.getParameter<string>("t0SegRootFile");
28  rootFile_ = new TFile(t0SegRootFile.c_str(),"READ");
29  dbLabel = pset.getUntrackedParameter<string>("dbLabel", "");
30 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTTTrigT0SegCorrection::~DTTTrigT0SegCorrection ( )
virtual

Definition at line 32 of file DTTTrigT0SegCorrection.cc.

32  {
33  delete rootFile_;
34 }

Member Function Documentation

DTTTrigData DTTTrigT0SegCorrection::correction ( const DTSuperLayerId slId)
virtual

Implements DTTTrigBaseCorrection.

Definition at line 43 of file DTTTrigT0SegCorrection.cc.

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

43  {
44  float tTrigMean,tTrigSigma,kFactor;
45  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
46  if(status != 0) throw cms::Exception("[DTTTrigT0SegCorrection]") << "Could not find tTrig entry in DB for"
47  << slId << endl;
48 
49  const TH1F* t0SegHisto = getHisto(slId);
50  double corrMean = tTrigMean;
51  double corrSigma = tTrigSigma;
52  //FIXME: can we fit the t0seg histo? How do we remove the peak at 0?;
53  double corrKFact = (kFactor*tTrigSigma + t0SegHisto->GetMean())/tTrigSigma;
54  return DTTTrigData(corrMean,corrSigma,corrKFact);
55 }
const TH1F * getHisto(const DTSuperLayerId &)
int get(int wheelId, int stationId, int sectorId, int slId, float &tTrig, float &tTrms, float &kFact, DTTimeUnits::type unit) const
get content
Definition: DTTtrig.cc:87
tuple status
Definition: ntuplemaker.py:245
const TH1F * DTTTrigT0SegCorrection::getHisto ( const DTSuperLayerId slId)
private

Definition at line 57 of file DTTTrigT0SegCorrection.cc.

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

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

Definition at line 65 of file DTTTrigT0SegCorrection.cc.

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

65  {
66  DTChamberId chId = slId.chamberId();
67 
68  // Compose the chamber name
69  stringstream wheel; wheel << chId.wheel();
70  stringstream station; station << chId.station();
71  stringstream sector; sector << chId.sector();
72 
73  string chHistoName =
74  "_W" + wheel.str() +
75  "_St" + station.str() +
76  "_Sec" + sector.str();
77 
78  return (slId.superLayer() != 2)?("hRPhiSegT0"+chHistoName):("hRZSegT0"+chHistoName);
79 }
int sector() const
Definition: DTChamberId.h:63
int station() const
Return the station number.
Definition: DTChamberId.h:53
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
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().

36  {
37  // Get tTrig record from DB
38  ESHandle<DTTtrig> tTrig;
39  setup.get<DTTtrigRcd>().get(dbLabel,tTrig);
40  tTrigMap_ = &*tTrig;
41 }
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

std::string DTTTrigT0SegCorrection::dbLabel
private

Definition at line 42 of file DTTTrigT0SegCorrection.h.

TFile* DTTTrigT0SegCorrection::rootFile_
private

Definition at line 40 of file DTTTrigT0SegCorrection.h.

const DTTtrig* DTTTrigT0SegCorrection::tTrigMap_
private

Definition at line 44 of file DTTTrigT0SegCorrection.h.