CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTtTrigDBValidation Class Reference

#include <DTtTrigDBValidation.h>

Inheritance diagram for DTtTrigDBValidation:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 Operations. More...
 
 DTtTrigDBValidation (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTtTrigDBValidation () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void bookHistos (DQMStore::IBooker &, int wheel)
 
void bookHistos (DQMStore::IBooker &, int, int)
 
int slFromBin (int bin) const
 
int stationFromBin (int bin) const
 

Private Attributes

edm::ESHandle< DTGeometrydtGeom_
 
int higherLimit_
 
std::string labelDB_
 
std::string labelDBRef_
 
int lowerLimit_
 
std::string metname_
 
std::map< std::pair< int, int >, MonitorElement * > tTrigDiffHistos_
 
std::map< int, MonitorElement * > tTrigDiffWheel_
 
std::map< DTSuperLayerId, std::pair< float, float > > tTrigMap_
 
std::map< DTSuperLayerId, std::pair< float, float > > tTrigRefMap_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 23 of file DTtTrigDBValidation.h.

Constructor & Destructor Documentation

◆ DTtTrigDBValidation()

DTtTrigDBValidation::DTtTrigDBValidation ( const edm::ParameterSet pset)

Constructor.

Definition at line 32 of file DTtTrigDBValidation.cc.

33  : metname_("TTrigDBValidation"),
34  labelDBRef_(pset.getParameter<string>("labelDBRef")),
35  labelDB_(pset.getParameter<string>("labelDB")),
36  lowerLimit_(pset.getUntrackedParameter<int>("lowerLimit", 1)),
37  higherLimit_(pset.getUntrackedParameter<int>("higherLimit", 3)) {
38  LogVerbatim(metname_) << "[DTtTrigDBValidation] Constructor called!";
39 }

References metname_.

◆ ~DTtTrigDBValidation()

DTtTrigDBValidation::~DTtTrigDBValidation ( )
override

Destructor.

Definition at line 41 of file DTtTrigDBValidation.cc.

41 {}

Member Function Documentation

◆ analyze()

void DTtTrigDBValidation::analyze ( const edm::Event ,
const edm::EventSetup  
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 206 of file DTtTrigDBValidation.cc.

206 {}

◆ bookHistograms()

void DTtTrigDBValidation::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &  setup 
)
overridevirtual

Operations.

Implements DQMEDAnalyzer.

Definition at line 43 of file DTtTrigDBValidation.cc.

43  {
44  LogVerbatim(metname_) << "[DTtTrigDBValidation] Parameters initialization";
45  iBooker.setCurrentFolder("DT/DtCalib/TTrigDBValidation");
46 
47  ESHandle<DTTtrig> tTrig_Ref;
48  setup.get<DTTtrigRcd>().get(labelDBRef_, tTrig_Ref);
49  const DTTtrig *DTTtrigRefMap = &*tTrig_Ref;
50  LogVerbatim(metname_) << "[DTtTrigDBValidation] reference Ttrig version: " << tTrig_Ref->version();
51 
54  const DTTtrig *DTTtrigMap = &*tTrig;
55  LogVerbatim(metname_) << "[DTtTrigDBValidation] Ttrig to validate version: " << tTrig->version();
56 
57  // book&reset the summary histos
58  for (int wheel = -2; wheel <= 2; wheel++) {
59  bookHistos(iBooker, wheel);
60  tTrigDiffWheel_[wheel]->Reset();
61  }
62 
63  // Get the geometry
65 
66  // Loop over Ref DB entries
67  for (DTTtrig::const_iterator it = DTTtrigRefMap->begin(); it != DTTtrigRefMap->end(); ++it) {
68  DTSuperLayerId slId((*it).first.wheelId, (*it).first.stationId, (*it).first.sectorId, (*it).first.slId);
69  float tTrigMean;
70  float tTrigRms;
71  float kFactor;
72  DTTtrigRefMap->get(slId, tTrigMean, tTrigRms, kFactor, DTTimeUnits::ns);
73  float tTrigCorr = tTrigMean + kFactor * tTrigRms;
74  LogTrace(metname_) << "Ref Superlayer: " << slId << "\n"
75  << " Ttrig mean (ns): " << tTrigMean << " Ttrig rms (ns): " << tTrigRms
76  << " Ttrig k-Factor: " << kFactor << " Ttrig value (ns): " << tTrigCorr;
77 
78  // tTrigRefMap[slId] = std::pair<float,float>(tTrigmean,tTrigrms);
79  tTrigRefMap_[slId] = pair<float, float>(tTrigCorr, tTrigRms);
80  }
81 
82  // Loop over Ref DB entries
83  for (DTTtrig::const_iterator it = DTTtrigMap->begin(); it != DTTtrigMap->end(); ++it) {
84  DTSuperLayerId slId((*it).first.wheelId, (*it).first.stationId, (*it).first.sectorId, (*it).first.slId);
85  float tTrigMean;
86  float tTrigRms;
87  float kFactor;
88  DTTtrigMap->get(slId, tTrigMean, tTrigRms, kFactor, DTTimeUnits::ns);
89  float tTrigCorr = tTrigMean + kFactor * tTrigRms;
90  LogTrace(metname_) << "Superlayer: " << slId << "\n"
91  << " Ttrig mean (ns): " << tTrigMean << " Ttrig rms (ns): " << tTrigRms
92  << " Ttrig k-Factor: " << kFactor << " Ttrig value (ns): " << tTrigCorr;
93 
94  // tTrigMap[slId] = std::pair<float,float>(tTrigmean,tTrigrms);
95  tTrigMap_[slId] = pair<float, float>(tTrigCorr, tTrigRms);
96  }
97 
98  for (map<DTSuperLayerId, pair<float, float>>::const_iterator it = tTrigRefMap_.begin(); it != tTrigRefMap_.end();
99  ++it) {
100  if (tTrigMap_.find((*it).first) == tTrigMap_.end())
101  continue;
102 
103  // compute the difference
104  float difference = tTrigMap_[(*it).first].first - (*it).second.first;
105 
106  // book histo
107  int wheel = (*it).first.chamberId().wheel();
108  int sector = (*it).first.chamberId().sector();
109  if (tTrigDiffHistos_.find(make_pair(wheel, sector)) == tTrigDiffHistos_.end())
110  bookHistos(iBooker, wheel, sector);
111 
112  LogTrace(metname_) << "Filling histos for super-layer: " << (*it).first << " difference: " << difference;
113 
114  // Fill the test histos
115  int entry = -1;
116  int station = (*it).first.chamberId().station();
117  if (station == 1)
118  entry = 0;
119  if (station == 2)
120  entry = 3;
121  if (station == 3)
122  entry = 6;
123  if (station == 4)
124  entry = 9;
125 
126  int slBin = entry + (*it).first.superLayer();
127  if (slBin == 12)
128  slBin = 11;
129 
130  tTrigDiffHistos_[make_pair(wheel, sector)]->setBinContent(slBin, difference);
131  if (abs(difference) < lowerLimit_) {
132  tTrigDiffWheel_[wheel]->setBinContent(slBin, sector, 1);
133  } else if (abs(difference) < higherLimit_) {
134  tTrigDiffWheel_[wheel]->setBinContent(slBin, sector, 2);
135  } else {
136  tTrigDiffWheel_[wheel]->setBinContent(slBin, sector, 3);
137  }
138 
139  } // Loop over the tTrig map reference
140 }

References funct::abs(), DTTtrig::begin(), bookHistos(), dtGeom_, DTTtrig::end(), mps_splice::entry, DTTtrig::get(), get, higherLimit_, dttriganalyzer_cfi::kFactor, labelDB_, labelDBRef_, LogTrace, lowerLimit_, genParticles_cff::map, metname_, DTTimeUnits::ns, dqm::implementation::NavigatorBase::setCurrentFolder(), singleTopDQM_cfi::setup, relativeConstraints::station, dttriganalyzer_cfi::tTrig, tTrigDiffHistos_, tTrigDiffWheel_, tTrigMap_, tTrigRefMap_, DTTtrig::version(), and makeMuonMisalignmentScenario::wheel.

◆ bookHistos() [1/2]

void DTtTrigDBValidation::bookHistos ( DQMStore::IBooker iBooker,
int  wheel 
)
private

Definition at line 176 of file DTtTrigDBValidation.cc.

176  {
177  stringstream wh;
178  wh << wheel;
179 
180  iBooker.setCurrentFolder("DT/DtCalib/TTrigDBValidation");
181  tTrigDiffWheel_[wheel] = iBooker.book2D(
182  "TTrigDifference_W" + wh.str(), "W" + wh.str() + ": summary of tTrig differences", 11, 1, 12, 14, 1, 15);
183  tTrigDiffWheel_[wheel]->setBinLabel(1, "MB1_SL1", 1);
184  tTrigDiffWheel_[wheel]->setBinLabel(2, "MB1_SL2", 1);
185  tTrigDiffWheel_[wheel]->setBinLabel(3, "MB1_SL3", 1);
186  tTrigDiffWheel_[wheel]->setBinLabel(4, "MB2_SL1", 1);
187  tTrigDiffWheel_[wheel]->setBinLabel(5, "MB2_SL2", 1);
188  tTrigDiffWheel_[wheel]->setBinLabel(6, "MB2_SL3", 1);
189  tTrigDiffWheel_[wheel]->setBinLabel(7, "MB3_SL1", 1);
190  tTrigDiffWheel_[wheel]->setBinLabel(8, "MB3_SL2", 1);
191  tTrigDiffWheel_[wheel]->setBinLabel(9, "MB3_SL3", 1);
192  tTrigDiffWheel_[wheel]->setBinLabel(10, "MB4_SL1", 1);
193  tTrigDiffWheel_[wheel]->setBinLabel(11, "MB4_SL3", 1);
194 }

References dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::setCurrentFolder(), tTrigDiffWheel_, and makeMuonMisalignmentScenario::wheel.

◆ bookHistos() [2/2]

void DTtTrigDBValidation::bookHistos ( DQMStore::IBooker iBooker,
int  wheel,
int  sector 
)
private

Definition at line 142 of file DTtTrigDBValidation.cc.

142  {
143  LogTrace(metname_) << " Booking histos for Wheel, Sector: " << wheel << ", " << sector;
144 
145  // Compose the chamber name
146  stringstream str_wheel;
147  str_wheel << wheel;
148  stringstream str_sector;
149  str_sector << sector;
150 
151  string lHistoName = "_W" + str_wheel.str() + "_Sec" + str_sector.str();
152 
153  iBooker.setCurrentFolder("DT/DtCalib/TTrigDBValidation/Wheel" + str_wheel.str());
154 
155  // Create the monitor elements
156  MonitorElement *hDifference;
157  hDifference = iBooker.book1D("TTrigDifference" + lHistoName, "difference between the two tTrig values", 11, 0, 11);
158 
159  pair<int, int> mypair(wheel, sector);
160  tTrigDiffHistos_[mypair] = hDifference;
161 
162  (tTrigDiffHistos_[mypair])->setBinLabel(1, "MB1_SL1", 1);
163  (tTrigDiffHistos_[mypair])->setBinLabel(2, "MB1_SL2", 1);
164  (tTrigDiffHistos_[mypair])->setBinLabel(3, "MB1_SL3", 1);
165  (tTrigDiffHistos_[mypair])->setBinLabel(4, "MB2_SL1", 1);
166  (tTrigDiffHistos_[mypair])->setBinLabel(5, "MB2_SL2", 1);
167  (tTrigDiffHistos_[mypair])->setBinLabel(6, "MB2_SL3", 1);
168  (tTrigDiffHistos_[mypair])->setBinLabel(7, "MB3_SL1", 1);
169  (tTrigDiffHistos_[mypair])->setBinLabel(8, "MB3_SL2", 1);
170  (tTrigDiffHistos_[mypair])->setBinLabel(9, "MB3_SL3", 1);
171  (tTrigDiffHistos_[mypair])->setBinLabel(10, "MB4_SL1", 1);
172  (tTrigDiffHistos_[mypair])->setBinLabel(11, "MB4_SL3", 1);
173 }

References dqm::implementation::IBooker::book1D(), LogTrace, metname_, dqm::implementation::NavigatorBase::setCurrentFolder(), tTrigDiffHistos_, and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

◆ slFromBin()

int DTtTrigDBValidation::slFromBin ( int  bin) const
private

Definition at line 198 of file DTtTrigDBValidation.cc.

198  {
199  int ret = bin % 3;
200  if (ret == 0 || bin == 11)
201  ret = 3;
202 
203  return ret;
204 }

References newFWLiteAna::bin, and runTheMatrix::ret.

◆ stationFromBin()

int DTtTrigDBValidation::stationFromBin ( int  bin) const
private

Definition at line 196 of file DTtTrigDBValidation.cc.

196 { return (int)(bin / 3.1) + 1; }

References newFWLiteAna::bin.

Member Data Documentation

◆ dtGeom_

edm::ESHandle<DTGeometry> DTtTrigDBValidation::dtGeom_
private

Definition at line 46 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ higherLimit_

int DTtTrigDBValidation::higherLimit_
private

Definition at line 43 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ labelDB_

std::string DTtTrigDBValidation::labelDB_
private

Definition at line 40 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ labelDBRef_

std::string DTtTrigDBValidation::labelDBRef_
private

Definition at line 39 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ lowerLimit_

int DTtTrigDBValidation::lowerLimit_
private

Definition at line 42 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ metname_

std::string DTtTrigDBValidation::metname_
private

Definition at line 37 of file DTtTrigDBValidation.h.

Referenced by bookHistograms(), bookHistos(), and DTtTrigDBValidation().

◆ tTrigDiffHistos_

std::map<std::pair<int, int>, MonitorElement *> DTtTrigDBValidation::tTrigDiffHistos_
private

Definition at line 53 of file DTtTrigDBValidation.h.

Referenced by bookHistograms(), and bookHistos().

◆ tTrigDiffWheel_

std::map<int, MonitorElement *> DTtTrigDBValidation::tTrigDiffWheel_
private

Definition at line 54 of file DTtTrigDBValidation.h.

Referenced by bookHistograms(), and bookHistos().

◆ tTrigMap_

std::map<DTSuperLayerId, std::pair<float, float> > DTtTrigDBValidation::tTrigMap_
private

Definition at line 50 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

◆ tTrigRefMap_

std::map<DTSuperLayerId, std::pair<float, float> > DTtTrigDBValidation::tTrigRefMap_
private

Definition at line 49 of file DTtTrigDBValidation.h.

Referenced by bookHistograms().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
DTSuperLayerId
Definition: DTSuperLayerId.h:12
DTTtrig
Definition: DTTtrig.h:68
DTtTrigDBValidation::labelDB_
std::string labelDB_
Definition: DTtTrigDBValidation.h:40
DTTtrig::version
const std::string & version() const
access version
Definition: DTTtrig.cc:162
DTTtrigRcd
Definition: DTTtrigRcd.h:5
relativeConstraints.station
station
Definition: relativeConstraints.py:67
mps_splice.entry
entry
Definition: mps_splice.py:68
dttriganalyzer_cfi.tTrig
tTrig
Definition: dttriganalyzer_cfi.py:11
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DTTtrig::end
const_iterator end() const
Definition: DTTtrig.cc:252
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DTTtrig::const_iterator
std::vector< std::pair< DTTtrigId, DTTtrigData > >::const_iterator const_iterator
Access methods to data.
Definition: DTTtrig.h:139
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTTtrig::begin
const_iterator begin() const
Definition: DTTtrig.cc:250
DTtTrigDBValidation::dtGeom_
edm::ESHandle< DTGeometry > dtGeom_
Definition: DTtTrigDBValidation.h:46
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
DTtTrigDBValidation::tTrigRefMap_
std::map< DTSuperLayerId, std::pair< float, float > > tTrigRefMap_
Definition: DTtTrigDBValidation.h:49
DTtTrigDBValidation::tTrigDiffHistos_
std::map< std::pair< int, int >, MonitorElement * > tTrigDiffHistos_
Definition: DTtTrigDBValidation.h:53
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTtTrigDBValidation::tTrigMap_
std::map< DTSuperLayerId, std::pair< float, float > > tTrigMap_
Definition: DTtTrigDBValidation.h:50
DTtTrigDBValidation::labelDBRef_
std::string labelDBRef_
Definition: DTtTrigDBValidation.h:39
DTtTrigDBValidation::higherLimit_
int higherLimit_
Definition: DTtTrigDBValidation.h:43
get
#define get
DTtTrigDBValidation::lowerLimit_
int lowerLimit_
Definition: DTtTrigDBValidation.h:42
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
DTtTrigDBValidation::metname_
std::string metname_
Definition: DTtTrigDBValidation.h:37
dttriganalyzer_cfi.kFactor
kFactor
Definition: dttriganalyzer_cfi.py:7
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
DTtTrigDBValidation::bookHistos
void bookHistos(DQMStore::IBooker &, int, int)
Definition: DTtTrigDBValidation.cc:142
DTtTrigDBValidation::tTrigDiffWheel_
std::map< int, MonitorElement * > tTrigDiffWheel_
Definition: DTtTrigDBValidation.h:54
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
genParticles_cff.map
map
Definition: genParticles_cff.py:11
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98