CMS 3D CMS Logo

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

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

Private Attributes

const DTTtrigtTrigMap_
 
edm::ESGetToken< DTTtrig, DTTtrigRcdttrigToken_
 

Detailed Description

Definition at line 25 of file DTTTrigMatchRPhi.h.

Constructor & Destructor Documentation

◆ DTTTrigMatchRPhi()

DTTTrigMatchRPhi::DTTTrigMatchRPhi ( const edm::ParameterSet pset,
edm::ConsumesCollector  cc 
)

Definition at line 22 of file DTTTrigMatchRPhi.cc.

References edm::BeginRun, gpuPixelDoublets::cc, and muonDTDigis_cfi::pset.

22  {
23  ttrigToken_ =
24  cc.esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", pset.getUntrackedParameter<string>("dbLabel")));
25  }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
edm::ESGetToken< DTTtrig, DTTtrigRcd > ttrigToken_

◆ ~DTTTrigMatchRPhi()

DTTTrigMatchRPhi::~DTTTrigMatchRPhi ( )
override

Definition at line 27 of file DTTTrigMatchRPhi.cc.

27 {}

Member Function Documentation

◆ correction()

DTTTrigData DTTTrigMatchRPhi::correction ( const DTSuperLayerId slId)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 35 of file DTTTrigMatchRPhi.cc.

References DTSuperLayerId::chamberId(), Exception, dttriganalyzer_cfi::kFactor, DTTimeUnits::ns, mps_update::status, and DTSuperLayerId::superLayer().

35  {
36  float tTrigMean, tTrigSigma, kFactor;
37  int status = tTrigMap_->get(slId, tTrigMean, tTrigSigma, kFactor, DTTimeUnits::ns);
38  // RZ superlayers return the current value
39  if (slId.superLayer() == 2) {
40  if (status != 0)
41  throw cms::Exception("[DTTTrigMatchRPhi]") << "Could not find tTrig entry in DB for" << slId << endl;
42  return DTTTrigData(tTrigMean, tTrigSigma, kFactor);
43  } else {
44  DTSuperLayerId partnerSLId(slId.chamberId(), (slId.superLayer() == 1) ? 3 : 1);
45  float tTrigMeanNew, tTrigSigmaNew, kFactorNew;
46  if (!status) { // Gets average of both SuperLayer's
47  if (!tTrigMap_->get(partnerSLId, tTrigMeanNew, tTrigSigmaNew, kFactorNew, DTTimeUnits::ns)) {
48  tTrigMeanNew = (tTrigMean + tTrigMeanNew) / 2.;
49  // tTrigSigmaNew = sqrt(tTrigSigmaNew*tTrigSigmaNew + tTrigSigma*tTrigSigma)/2.;
50  tTrigSigmaNew = (tTrigSigmaNew + tTrigSigma) / 2.;
51 
52  kFactorNew = kFactor;
53  return DTTTrigData(tTrigMeanNew, tTrigSigmaNew, kFactorNew);
54  } else
55  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" << slId << "\n"
61  << partnerSLId << endl;
62  }
63  }
64  }
65  }
int superLayer() const
Return the superlayer number.
DTChamberId chamberId() const
Return the corresponding ChamberId.
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:59

◆ setES()

void DTTTrigMatchRPhi::setES ( const edm::EventSetup setup)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 29 of file DTTTrigMatchRPhi.cc.

References singleTopDQM_cfi::setup, and dttriganalyzer_cfi::tTrig.

29  {
30  // Get tTrig record from DB
32  tTrigMap_ = &*tTrig;
33  }
edm::ESGetToken< DTTtrig, DTTtrigRcd > ttrigToken_

Member Data Documentation

◆ tTrigMap_

const DTTtrig* dtCalibration::DTTTrigMatchRPhi::tTrigMap_
private

Definition at line 37 of file DTTTrigMatchRPhi.h.

◆ ttrigToken_

edm::ESGetToken<DTTtrig, DTTtrigRcd> dtCalibration::DTTTrigMatchRPhi::ttrigToken_
private

Definition at line 38 of file DTTTrigMatchRPhi.h.