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

#include <DTTTrigFillWithAverage.h>

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

Public Member Functions

virtual DTTTrigData correction (const DTSuperLayerId &)
 
 DTTTrigFillWithAverage (const edm::ParameterSet &)
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTTTrigFillWithAverage ()
 
- 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 24 of file DTTTrigFillWithAverage.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file DTTTrigFillWithAverage.cc.

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

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

Definition at line 27 of file DTTTrigFillWithAverage.cc.

27 {}

Member Function Documentation

DTTTrigData DTTTrigFillWithAverage::correction ( const DTSuperLayerId slId)
virtual

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 39 of file DTTTrigFillWithAverage.cc.

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

39  {
40  float tTrigMean,tTrigSigma, kFactor;
41  int status = tTrigMap_->get(slId,tTrigMean,tTrigSigma,kFactor,DTTimeUnits::ns);
42  if(!status){
43  return DTTTrigData(tTrigMean,tTrigSigma,kFactor);
44  } else {
46  float corrMean = initialTTrig_.aveMean;
47  float corrSigma = initialTTrig_.aveSigma;
48  float corrKFactor = initialTTrig_.aveKFactor;
49  return DTTTrigData(corrMean,corrSigma,corrKFactor); //FIXME: kFactor is not anymore a unique one
50  }
51 }
struct dtCalibration::DTTTrigFillWithAverage::@54 initialTTrig_
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 DTTTrigFillWithAverage::getAverage ( )
private

Definition at line 53 of file DTTTrigFillWithAverage.cc.

References aveKFactor, aveMean, aveSigma, foundAverage_, DTTtrig::get(), initialTTrig_, muonGeom_, DTTimeUnits::ns, rmsMean, rmsSigma, mathSSE::sqrt(), ntuplemaker::status, and tTrigMap_.

Referenced by correction().

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

Implements dtCalibration::DTTTrigBaseCorrection.

Definition at line 29 of file DTTTrigFillWithAverage.cc.

References dbLabel, edm::EventSetup::get(), muonGeom_, and tTrigMap_.

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

Member Data Documentation

float dtCalibration::DTTTrigFillWithAverage::aveKFactor

Definition at line 48 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

float dtCalibration::DTTTrigFillWithAverage::aveMean

Definition at line 44 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

float dtCalibration::DTTTrigFillWithAverage::aveSigma

Definition at line 46 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

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

Definition at line 41 of file DTTTrigFillWithAverage.h.

Referenced by DTTTrigFillWithAverage(), and setES().

bool dtCalibration::DTTTrigFillWithAverage::foundAverage_
private

Definition at line 51 of file DTTTrigFillWithAverage.h.

Referenced by correction(), and getAverage().

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

Referenced by correction(), and getAverage().

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

Definition at line 39 of file DTTTrigFillWithAverage.h.

Referenced by getAverage(), and setES().

float dtCalibration::DTTTrigFillWithAverage::rmsMean

Definition at line 45 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

float dtCalibration::DTTTrigFillWithAverage::rmsSigma

Definition at line 47 of file DTTTrigFillWithAverage.h.

Referenced by getAverage().

const DTTtrig* dtCalibration::DTTTrigFillWithAverage::tTrigMap_
private

Definition at line 38 of file DTTTrigFillWithAverage.h.

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