CMS 3D CMS Logo

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

#include <DTRunConditionVar.h>

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

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 
 DTRunConditionVar (const edm::ParameterSet &pset)
 
 ~DTRunConditionVar () override
 
- 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
 
 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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void bookChamberHistos (DQMStore::IBooker &, const DTChamberId &dtCh, std::string histoType, int, float, float)
 

Private Attributes

std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
 
bool debug
 
edm::EDGetTokenT< DTRecSegment4DCollectiondt4DSegmentsToken_
 
edm::ESHandle< DTGeometrydtGeom
 
double maxAnglePhiSegm
 
edm::ESHandle< DTMtimemTime
 
const DTMtimemTimeMap_
 
int nMinHitsPhi
 

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

Description:

Author
: Paolo Bellan, Antonio Branca $date : 23/09/2011 15:42:04 CET $

Modification:

Definition at line 44 of file DTRunConditionVar.h.

Constructor & Destructor Documentation

◆ DTRunConditionVar()

DTRunConditionVar::DTRunConditionVar ( const edm::ParameterSet pset)

Definition at line 45 of file DTRunConditionVar.cc.

46  : // Get the debug parameter for verbose output
47  debug(pSet.getUntrackedParameter<bool>("debug", false)),
48  nMinHitsPhi(pSet.getUntrackedParameter<int>("nMinHitsPhi")),
49  maxAnglePhiSegm(pSet.getUntrackedParameter<double>("maxAnglePhiSegm")),
50  dt4DSegmentsToken_(consumes<DTRecSegment4DCollection>(pSet.getParameter<InputTag>("recoSegments"))) {}

◆ ~DTRunConditionVar()

DTRunConditionVar::~DTRunConditionVar ( )
override

Definition at line 52 of file DTRunConditionVar.cc.

52  {
53  LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar") << "DTRunConditionVar: destructor called";
54 
55  // free memory
56 }

References LogTrace.

Member Function Documentation

◆ analyze()

void DTRunConditionVar::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 82 of file DTRunConditionVar.cc.

82  {
83  LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar")
84  << "--- [DTRunConditionVar] Event analysed #Run: " << event.id().run() << " #Event: " << event.id().event()
85  << endl;
86 
87  // Get the DT Geometry
89  eventSetup.get<MuonGeometryRecord>().get(dtGeom);
90 
91  // Get the map of vdrift from the setup
92  eventSetup.get<DTMtimeRcd>().get(mTime);
93  mTimeMap_ = &*mTime;
94 
95  // Get the segment collection from the event
97  event.getByToken(dt4DSegmentsToken_, all4DSegments);
98 
99  // Loop over the segments
100  for (DTRecSegment4DCollection::const_iterator segment = all4DSegments->begin(); segment != all4DSegments->end();
101  ++segment) {
102  // Get the chamber from the setup
103  DTChamberId DTid = (DTChamberId)segment->chamberId();
104  uint32_t indexCh = DTid.rawId();
105 
106  // Fill v-drift values
107  if ((*segment).hasPhi()) {
108  int nHitsPhi = (*segment).phiSegment()->degreesOfFreedom() + 2;
109  double xdir = (*segment).phiSegment()->localDirection().x();
110  double zdir = (*segment).phiSegment()->localDirection().z();
111 
112  double anglePhiSegm = fabs(atan(xdir / zdir)) * 180. / TMath::Pi();
113 
114  if (nHitsPhi >= nMinHitsPhi && anglePhiSegm <= maxAnglePhiSegm) {
115  double segmentVDrift = segment->phiSegment()->vDrift();
116 
117  DTSuperLayerId indexSLPhi1(DTid, 1);
118  DTSuperLayerId indexSLPhi2(DTid, 3);
119 
120  float vDriftPhi1(0.), vDriftPhi2(0.);
121  float ResPhi1(0.), ResPhi2(0.);
122  int status1 = mTimeMap_->get(indexSLPhi1, vDriftPhi1, ResPhi1, DTVelocityUnits::cm_per_ns);
123  int status2 = mTimeMap_->get(indexSLPhi2, vDriftPhi2, ResPhi2, DTVelocityUnits::cm_per_ns);
124 
125  if (status1 != 0 || status2 != 0) {
126  DTSuperLayerId sl = (status1 != 0) ? indexSLPhi1 : indexSLPhi2;
127  throw cms::Exception("DTRunConditionVarClient") << "Could not find vDrift entry in DB for" << sl << endl;
128  }
129 
130  float vDriftMed = (vDriftPhi1 + vDriftPhi2) / 2.;
131 
132  segmentVDrift = vDriftMed * (1. - segmentVDrift);
133 
134  double segmentT0 = segment->phiSegment()->t0();
135 
136  if (segment->phiSegment()->ist0Valid())
137  (chamberHistos[indexCh])["T0_FromSegm"]->Fill(segmentT0);
138  if (segmentVDrift != vDriftMed)
139  (chamberHistos[indexCh])["VDrift_FromSegm"]->Fill(segmentVDrift);
140  }
141  }
142 
143  } //end loop on segment
144 
145 } //end analyze

References chamberHistos, DTVelocityUnits::cm_per_ns, dt4DSegmentsToken_, dtGeom, Exception, HcalObjRepresent::Fill(), edm::EventSetup::get(), DTMtime::get(), get, LogTrace, maxAnglePhiSegm, mTime, mTimeMap_, nMinHitsPhi, Pi, DetId::rawId(), and xdir.

◆ bookChamberHistos()

void DTRunConditionVar::bookChamberHistos ( DQMStore::IBooker ,
const DTChamberId dtCh,
std::string  histoType,
int  ,
float  ,
float   
)
private

Definition at line 147 of file DTRunConditionVar.cc.

148  {
149  int wh = dtCh.wheel();
150  int sc = dtCh.sector();
151  int st = dtCh.station();
152  stringstream wheel;
153  wheel << wh;
154  stringstream station;
155  station << st;
156  stringstream sector;
157  sector << sc;
158 
159  string bookingFolder = "DT/02-Segments/Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str();
160  string histoTag = "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
161 
162  ibooker.setCurrentFolder(bookingFolder);
163 
164  LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar")
165  << "[DTRunConditionVar]: booking histos in " << bookingFolder << endl;
166 
167  string histoName = histoType + histoTag;
168  const string& histoLabel = histoType;
169 
170  (chamberHistos[dtCh.rawId()])[histoType] = ibooker.book1D(histoName, histoLabel, nbins, min, max);
171 }

References dqm::implementation::IBooker::book1D(), chamberHistos, fftjetimagerecorder_cfi::histoLabel, HltBtagPostValidation_cff::histoName, dtResolutionTest_cfi::histoTag, LogTrace, SiStripPI::max, min(), LaserClient_cfi::nbins, DetId::rawId(), DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

◆ bookHistograms()

void DTRunConditionVar::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 58 of file DTRunConditionVar.cc.

60  {
61  LogTrace("DTDQM|DTMonitorModule|DTRunConditionVar") << "DTRunConditionVar: bookHistograms";
62 
63  for (int wheel = -2; wheel <= 2; wheel++) {
64  for (int sec = 1; sec <= 14; sec++) {
65  for (int stat = 1; stat <= 4; stat++) {
66  bookChamberHistos(ibooker, DTChamberId(wheel, stat, sec), "VDrift_FromSegm", 100, 0.0043, 0.0065);
67  bookChamberHistos(ibooker, DTChamberId(wheel, stat, sec), "T0_FromSegm", 100, -25., 25.);
68  }
69  }
70  }
71 
72  return;
73 }

References bookChamberHistos(), LogTrace, fileinputsource_cfi::sec, hgcalPlots::stat, and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginRun()

void DTRunConditionVar::dqmBeginRun ( const edm::Run run,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 75 of file DTRunConditionVar.cc.

75  {
76  // Get the DT Geometry
78 
79  return;
80 }

References dtGeom, get, and singleTopDQM_cfi::setup.

Member Data Documentation

◆ chamberHistos

std::map<uint32_t, std::map<std::string, MonitorElement*> > DTRunConditionVar::chamberHistos
private

Definition at line 73 of file DTRunConditionVar.h.

Referenced by analyze(), and bookChamberHistos().

◆ debug

bool DTRunConditionVar::debug
private

◆ dt4DSegmentsToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTRunConditionVar::dt4DSegmentsToken_
private

Definition at line 66 of file DTRunConditionVar.h.

Referenced by analyze().

◆ dtGeom

edm::ESHandle<DTGeometry> DTRunConditionVar::dtGeom
private

Definition at line 68 of file DTRunConditionVar.h.

Referenced by analyze(), and dqmBeginRun().

◆ maxAnglePhiSegm

double DTRunConditionVar::maxAnglePhiSegm
private

Definition at line 64 of file DTRunConditionVar.h.

Referenced by analyze().

◆ mTime

edm::ESHandle<DTMtime> DTRunConditionVar::mTime
private

Definition at line 70 of file DTRunConditionVar.h.

Referenced by analyze().

◆ mTimeMap_

const DTMtime* DTRunConditionVar::mTimeMap_
private

Definition at line 71 of file DTRunConditionVar.h.

Referenced by analyze().

◆ nMinHitsPhi

int DTRunConditionVar::nMinHitsPhi
private

Definition at line 63 of file DTRunConditionVar.h.

Referenced by analyze().

DTSuperLayerId
Definition: DTSuperLayerId.h:12
min
T min(T a, T b)
Definition: MathUtil.h:58
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTRunConditionVar::nMinHitsPhi
int nMinHitsPhi
Definition: DTRunConditionVar.h:63
DTRunConditionVar::debug
bool debug
Definition: DTRunConditionVar.h:62
DTRunConditionVar::dt4DSegmentsToken_
edm::EDGetTokenT< DTRecSegment4DCollection > dt4DSegmentsToken_
Definition: DTRunConditionVar.h:66
DTRunConditionVar::mTime
edm::ESHandle< DTMtime > mTime
Definition: DTRunConditionVar.h:70
edm::Handle< DTRecSegment4DCollection >
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTRunConditionVar::mTimeMap_
const DTMtime * mTimeMap_
Definition: DTRunConditionVar.h:71
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1111
edm::ESHandle< DTGeometry >
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
DTVelocityUnits::cm_per_ns
Definition: DTVelocityUnits.h:32
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
DTRunConditionVar::maxAnglePhiSegm
double maxAnglePhiSegm
Definition: DTRunConditionVar.h:64
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
dtResolutionTest_cfi.histoTag
histoTag
Definition: dtResolutionTest_cfi.py:21
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
xdir
Definition: DeviationsFromFileSensor2D.cc:15
get
#define get
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
fileinputsource_cfi.sec
sec
Definition: fileinputsource_cfi.py:87
DTRunConditionVar::bookChamberHistos
void bookChamberHistos(DQMStore::IBooker &, const DTChamberId &dtCh, std::string histoType, int, float, float)
Definition: DTRunConditionVar.cc:147
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTRunConditionVar::chamberHistos
std::map< uint32_t, std::map< std::string, MonitorElement * > > chamberHistos
Definition: DTRunConditionVar.h:73
DTRunConditionVar::dtGeom
edm::ESHandle< DTGeometry > dtGeom
Definition: DTRunConditionVar.h:68
Exception
Definition: hltDiff.cc:246
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
DTChamberId
Definition: DTChamberId.h:14
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
fftjetimagerecorder_cfi.histoLabel
histoLabel
Definition: fftjetimagerecorder_cfi.py:12
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTMtime::get
int get(int wheelId, int stationId, int sectorId, int slId, float &mTime, float &mTrms, DTTimeUnits::type unit) const
Definition: DTMtime.cc:56
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
edm::InputTag
Definition: InputTag.h:15
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
DTMtimeRcd
Definition: DTMtimeRcd.h:5