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 Attributes
dtCalibration::DTTTrigMatchRPhi Class Reference

#include <DTTTrigMatchRPhi.h>

Inheritance diagram for dtCalibration::DTTTrigMatchRPhi:
dtCalibration::DTTTrigBaseCorrection

Public Member Functions

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

Private Attributes

std::string dbLabel
 
const DTTtrigtTrigMap_
 

Detailed Description

Definition at line 23 of file DTTTrigMatchRPhi.h.

Constructor & Destructor Documentation

DTTTrigMatchRPhi::DTTTrigMatchRPhi ( const edm::ParameterSet pset)

Definition at line 22 of file DTTTrigMatchRPhi.cc.

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

22  {
23  dbLabel = pset.getUntrackedParameter<string>("dbLabel", "");
24 }
T getUntrackedParameter(std::string const &, T const &) const
DTTTrigMatchRPhi::~DTTTrigMatchRPhi ( )
virtual

Definition at line 26 of file DTTTrigMatchRPhi.cc.

26 {}

Member Function Documentation

DTTTrigData DTTTrigMatchRPhi::correction ( const DTSuperLayerId slId)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 35 of file DTTTrigMatchRPhi.cc.

References DTSuperLayerId::chamberId(), edm::hlt::Exception, DTTimeUnits::ns, ntuplemaker::status, and DTSuperLayerId::superLayer().

35  {
36 
37  float tTrigMean,tTrigSigma,kFactor;
38  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
39  // RZ superlayers return the current value
40  if(slId.superLayer() == 2){
41  if(status != 0) throw cms::Exception("[DTTTrigMatchRPhi]") << "Could not find tTrig entry in DB for"
42  << slId << endl;
43  return DTTTrigData(tTrigMean,tTrigSigma,kFactor);
44  } else{
45  DTSuperLayerId partnerSLId(slId.chamberId(),(slId.superLayer() == 1)?3:1);
46  float tTrigMeanNew,tTrigSigmaNew,kFactorNew;
47  if(!status){ // Gets average of both SuperLayer's
48  if(!tTrigMap_->get(partnerSLId,tTrigMeanNew,tTrigSigmaNew,kFactorNew,DTTimeUnits::ns)){
49  tTrigMeanNew = (tTrigMean + tTrigMeanNew)/2.;
50 // tTrigSigmaNew = sqrt(tTrigSigmaNew*tTrigSigmaNew + tTrigSigma*tTrigSigma)/2.;
51  tTrigSigmaNew = (tTrigSigmaNew + tTrigSigma)/2.;
52 
53  kFactorNew = kFactor;
54  return DTTTrigData(tTrigMeanNew,tTrigSigmaNew,kFactorNew);
55  } else return DTTTrigData(tTrigMean,tTrigSigma,kFactor);
56  } else{ // If there is no entry tries to find partner SL and retrieves its value
57  if(!tTrigMap_->get(partnerSLId,tTrigMeanNew,tTrigSigmaNew,kFactorNew,DTTimeUnits::ns))
58  return DTTTrigData(tTrigMeanNew,tTrigSigmaNew,kFactorNew);
59  else { // Both RPhi SL's not present in DB
60  throw cms::Exception("[DTTTrigMatchRPhi]") << "Could not find tTrig entry in DB for"
61  << slId << "\n" << partnerSLId << endl;
62  }
63  }
64  }
65 }
DTChamberId chamberId() const
Return the corresponding ChamberId.
int superLayer() const
Return the superlayer number.
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:86
tuple status
Definition: ntuplemaker.py:245
void DTTTrigMatchRPhi::setES ( const edm::EventSetup setup)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 28 of file DTTTrigMatchRPhi.cc.

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

28  {
29  // Get tTrig record from DB
30  ESHandle<DTTtrig> tTrig;
31  setup.get<DTTtrigRcd>().get(dbLabel,tTrig);
32  tTrigMap_ = &*tTrig;
33 }
const T & get() const
Definition: EventSetup.h:55

Member Data Documentation

std::string dtCalibration::DTTTrigMatchRPhi::dbLabel
private

Definition at line 37 of file DTTTrigMatchRPhi.h.

const DTTtrig* dtCalibration::DTTTrigMatchRPhi::tTrigMap_
private

Definition at line 35 of file DTTTrigMatchRPhi.h.