CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
dtCalibration::DTTTrigFillWithAverage Class Reference

#include <DTTTrigFillWithAverage.h>

Inheritance diagram for dtCalibration::DTTTrigFillWithAverage:
dtCalibration::DTTTrigBaseCorrection

Public Member Functions

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

Private Member Functions

void getAverage ()
 

Private Attributes

std::string dbLabel
 
bool foundAverage_
 
struct {
   float   aveKFactor
 
   float   aveMean
 
   float   aveSigma
 
   float   rmsMean
 
   float   rmsSigma
 
initialTTrig_
 
edm::ESHandle< DTGeometrymuonGeom_
 
const DTTtrigtTrigMap_
 

Detailed Description

Definition at line 23 of file DTTTrigFillWithAverage.h.

Constructor & Destructor Documentation

◆ DTTTrigFillWithAverage()

DTTTrigFillWithAverage::DTTTrigFillWithAverage ( const edm::ParameterSet pset)

Definition at line 21 of file DTTTrigFillWithAverage.cc.

21  : foundAverage_(false) {
22  dbLabel = pset.getUntrackedParameter<string>("dbLabel", "");
23  }

References dbLabel, and muonDTDigis_cfi::pset.

◆ ~DTTTrigFillWithAverage()

DTTTrigFillWithAverage::~DTTTrigFillWithAverage ( )
override

Definition at line 25 of file DTTTrigFillWithAverage.cc.

25 {}

Member Function Documentation

◆ correction()

DTTTrigData DTTTrigFillWithAverage::correction ( const DTSuperLayerId slId)
overridevirtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 37 of file DTTTrigFillWithAverage.cc.

37  {
38  float tTrigMean, tTrigSigma, kFactor;
39  int status = tTrigMap_->get(slId, tTrigMean, tTrigSigma, kFactor, DTTimeUnits::ns);
40  if (!status) {
41  return DTTTrigData(tTrigMean, tTrigSigma, kFactor);
42  } else {
43  if (!foundAverage_)
44  getAverage();
45  float corrMean = initialTTrig_.aveMean;
46  float corrSigma = initialTTrig_.aveSigma;
47  float corrKFactor = initialTTrig_.aveKFactor;
48  return DTTTrigData(corrMean, corrSigma, corrKFactor); //FIXME: kFactor is not anymore a unique one
49  }
50  }

References foundAverage_, DTTtrig::get(), getAverage(), initialTTrig_, dttriganalyzer_cfi::kFactor, DTTimeUnits::ns, mps_update::status, and tTrigMap_.

◆ getAverage()

void DTTTrigFillWithAverage::getAverage ( )
private

Definition at line 52 of file DTTTrigFillWithAverage.cc.

52  {
53  //Get the superlayers list
54  vector<const DTSuperLayer*> dtSupLylist = muonGeom_->superLayers();
55 
56  float aveMean = 0.;
57  float ave2Mean = 0.;
58  float aveSigma = 0.;
59  float ave2Sigma = 0.;
60  float aveKFactor = 0.;
61  int nIter = 0;
62 
63  for (auto sl = muonGeom_->superLayers().begin(); sl != muonGeom_->superLayers().end(); ++sl) {
64  float tTrigMean, tTrigSigma, kFactor;
65  int status = tTrigMap_->get((*sl)->id(), tTrigMean, tTrigSigma, kFactor, DTTimeUnits::ns);
66  if (!status) {
67  ++nIter;
68  aveMean += tTrigMean;
69  ave2Mean += tTrigMean * tTrigMean;
70  aveSigma += tTrigSigma;
71  ave2Sigma += tTrigSigma * tTrigSigma;
73  }
74  }
75 
76  // Compute average
77  aveMean /= nIter;
78  float rmsMean = ave2Mean / (nIter - 1) - aveMean * aveMean;
79  rmsMean = sqrt(rmsMean);
80  aveSigma /= nIter;
81  float rmsSigma = ave2Sigma / (nIter - 1) - aveSigma * aveSigma;
83  aveKFactor /= nIter;
84 
85  initialTTrig_.aveMean = aveMean;
86  initialTTrig_.rmsMean = rmsMean;
87  initialTTrig_.aveSigma = aveSigma;
88  initialTTrig_.rmsSigma = rmsSigma;
89  initialTTrig_.aveKFactor = aveKFactor;
90 
91  LogVerbatim("Calibration") << "[DTTTrigFillWithAverage] Found from " << nIter << " SL's\n"
92  << " average tTrig mean: " << aveMean << "\n"
93  << " tTrig mean RMS: " << rmsMean << "\n"
94  << " average tTrig sigma: " << aveSigma << "\n"
95  << " tTrig sigma RMS: " << rmsSigma << "\n"
96  << " kFactor mean: " << aveKFactor;
97  foundAverage_ = true;
98  }

References aveKFactor, aveMean, aveSigma, foundAverage_, DTTtrig::get(), initialTTrig_, dttriganalyzer_cfi::kFactor, muonGeom_, DTTimeUnits::ns, rmsMean, rmsSigma, mathSSE::sqrt(), mps_update::status, DTGeometry::superLayers(), and tTrigMap_.

Referenced by correction().

◆ setES()

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

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 27 of file DTTTrigFillWithAverage.cc.

27  {
28  // Get tTrig record from DB
30  setup.get<DTTtrigRcd>().get(dbLabel, tTrig);
31  tTrigMap_ = &*tTrig;
32 
33  // Get geometry from Event Setup
35  }

References dbLabel, get, muonGeom_, singleTopDQM_cfi::setup, dttriganalyzer_cfi::tTrig, and tTrigMap_.

Member Data Documentation

◆ aveKFactor

float dtCalibration::DTTTrigFillWithAverage::aveKFactor

Definition at line 47 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

◆ aveMean

float dtCalibration::DTTTrigFillWithAverage::aveMean

Definition at line 43 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

◆ aveSigma

float dtCalibration::DTTTrigFillWithAverage::aveSigma

Definition at line 45 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

◆ dbLabel

std::string dtCalibration::DTTTrigFillWithAverage::dbLabel
private

Definition at line 40 of file DTTTrigFillWithAverage.h.

Referenced by DTTTrigFillWithAverage(), and setES().

◆ foundAverage_

bool dtCalibration::DTTTrigFillWithAverage::foundAverage_
private

Definition at line 50 of file DTTTrigFillWithAverage.h.

Referenced by correction(), and getAverage().

◆ initialTTrig_

struct { ... } dtCalibration::DTTTrigFillWithAverage::initialTTrig_

Referenced by correction(), and getAverage().

◆ muonGeom_

edm::ESHandle<DTGeometry> dtCalibration::DTTTrigFillWithAverage::muonGeom_
private

Definition at line 38 of file DTTTrigFillWithAverage.h.

Referenced by getAverage(), and setES().

◆ rmsMean

float dtCalibration::DTTTrigFillWithAverage::rmsMean

Definition at line 44 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

◆ rmsSigma

float dtCalibration::DTTTrigFillWithAverage::rmsSigma

Definition at line 46 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

◆ tTrigMap_

const DTTtrig* dtCalibration::DTTTrigFillWithAverage::tTrigMap_
private

Definition at line 37 of file DTTTrigFillWithAverage.h.

Referenced by correction(), getAverage(), and setES().

dtCalibration::DTTTrigFillWithAverage::tTrigMap_
const DTTtrig * tTrigMap_
Definition: DTTTrigFillWithAverage.h:37
dtCalibration::DTTTrigFillWithAverage::rmsMean
float rmsMean
Definition: DTTTrigFillWithAverage.h:44
mps_update.status
status
Definition: mps_update.py:68
DTTtrigRcd
Definition: DTTtrigRcd.h:5
dttriganalyzer_cfi.tTrig
tTrig
Definition: dttriganalyzer_cfi.py:11
dtCalibration::DTTTrigFillWithAverage::aveSigma
float aveSigma
Definition: DTTTrigFillWithAverage.h:45
dtCalibration::DTTTrigFillWithAverage::rmsSigma
float rmsSigma
Definition: DTTTrigFillWithAverage.h:46
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dtCalibration::DTTTrigFillWithAverage::aveMean
float aveMean
Definition: DTTTrigFillWithAverage.h:43
DTTimeUnits::ns
Definition: DTTimeUnits.h:32
edm::ESHandle< DTTtrig >
DTTtrig::get
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
dtCalibration::DTTTrigFillWithAverage::aveKFactor
float aveKFactor
Definition: DTTTrigFillWithAverage.h:47
dtCalibration::DTTTrigFillWithAverage::dbLabel
std::string dbLabel
Definition: DTTTrigFillWithAverage.h:40
dtCalibration::DTTTrigFillWithAverage::initialTTrig_
struct dtCalibration::DTTTrigFillWithAverage::@62 initialTTrig_
DTGeometry::superLayers
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:86
get
#define get
dttriganalyzer_cfi.kFactor
kFactor
Definition: dttriganalyzer_cfi.py:7
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dtCalibration::DTTTrigFillWithAverage::foundAverage_
bool foundAverage_
Definition: DTTTrigFillWithAverage.h:50
dtCalibration::DTTTrigFillWithAverage::muonGeom_
edm::ESHandle< DTGeometry > muonGeom_
Definition: DTTTrigFillWithAverage.h:38
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dtCalibration::DTTTrigFillWithAverage::getAverage
void getAverage()
Definition: DTTTrigFillWithAverage.cc:52