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 24 of file DTTTrigMatchRPhi.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file DTTTrigMatchRPhi.cc.

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

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

Definition at line 28 of file DTTTrigMatchRPhi.cc.

28 {}

Member Function Documentation

DTTTrigData DTTTrigMatchRPhi::correction ( const DTSuperLayerId slId)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 37 of file DTTTrigMatchRPhi.cc.

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

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

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 30 of file DTTTrigMatchRPhi.cc.

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

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

Member Data Documentation

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

Definition at line 38 of file DTTTrigMatchRPhi.h.

const DTTtrig* dtCalibration::DTTTrigMatchRPhi::tTrigMap_
private

Definition at line 36 of file DTTTrigMatchRPhi.h.