CMS 3D CMS Logo

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

#include <DTChamberEfficiencyTask.h>

Inheritance diagram for DTChamberEfficiencyTask:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) override
 To reset the MEs. More...
 
void dqmBeginRun (const edm::Run &run, const edm::EventSetup &setup) override
 BeginRun. More...
 
 DTChamberEfficiencyTask (const edm::ParameterSet &pset)
 Constructor. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) final
 
 ~DTChamberEfficiencyTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Member Functions

void bookHistos (DQMStore::IBooker &ibooker, DTChamberId chId)
 
const DTRecSegment4DgetBestSegment (const DTRecSegment4D *s1, const DTRecSegment4D *s2) const
 
const DTRecSegment4DgetBestSegment (const DTRecSegment4DCollection::range &segs) const
 
LocalPoint interpolate (const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
 
bool isGoodSegment (const DTRecSegment4D &seg) const
 

Private Attributes

bool debug
 
bool detailedAnalysis
 
edm::ESHandle< DTGeometrydtGeom
 
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
 
bool onlineMonitor
 
edm::ParameterSet parameters
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
edm::Handle< DTRecSegment4DCollectionsegs
 
double theMinChi2NormSegment
 
double theMinCloseDist
 
unsigned int theMinHitsSegment
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

DQM Analysis of 4D DT segments, it produces plots about:

Class based on the code written by S. Lacaprara : RecoLocalMuon / DTSegment / test / DTEffAnalyzer.h

Author
G. Mila - INFN Torino

Definition at line 35 of file DTChamberEfficiencyTask.h.

Constructor & Destructor Documentation

◆ DTChamberEfficiencyTask()

DTChamberEfficiencyTask::DTChamberEfficiencyTask ( const edm::ParameterSet pset)

Constructor.

Definition at line 26 of file DTChamberEfficiencyTask.cc.

26  {
27  debug = pset.getUntrackedParameter<bool>("debug", false);
28 
29  edm::LogVerbatim("DTDQM|DTMonitorModule|DTChamberEfficiencyTask") << "[DTChamberEfficiencyTask] Constructor called!";
30 
31  parameters = pset;
32 
33  // the name of the 4D rec hits collection
35  consumes<DTRecSegment4DCollection>(edm::InputTag(parameters.getParameter<string>("recHits4DLabel")));
36 
37  // parameters to use for the segment quality check
38  theMinHitsSegment = static_cast<unsigned int>(parameters.getParameter<int>("minHitsSegment"));
39  theMinChi2NormSegment = parameters.getParameter<double>("minChi2NormSegment");
40  // parameter to use for the exstrapolated segment check
41  theMinCloseDist = parameters.getParameter<double>("minCloseDist");
42 
43  // the running modality
44  onlineMonitor = parameters.getUntrackedParameter<bool>("onlineMonitor");
45 
46  // the analysis mode
47  detailedAnalysis = parameters.getUntrackedParameter<bool>("detailedAnalysis");
48 }

References debug, dtNoiseAnalysis_cfi::detailedAnalysis, dtChamberEfficiencyTask_cfi::onlineMonitor, and muonDTDigis_cfi::pset.

◆ ~DTChamberEfficiencyTask()

DTChamberEfficiencyTask::~DTChamberEfficiencyTask ( )
override

Destructor.

Definition at line 50 of file DTChamberEfficiencyTask.cc.

50  {
51  edm::LogVerbatim("DTDQM|DTMonitorModule|DTChamberEfficiencyTask") << "[DTChamberEfficiencyTask] Destructor called!";
52 }

Member Function Documentation

◆ analyze()

void DTChamberEfficiencyTask::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 147 of file DTChamberEfficiencyTask.cc.

147  {
148  edm::LogVerbatim("DTDQM|DTMonitorModule|DTChamberEfficiencyTask")
149  << "[DTChamberEfficiencyTask] Analyze #Run: " << event.id().run() << " #Event: " << event.id().event();
150 
151  // Get the 4D rechit collection from the event
152  event.getByToken(recHits4DToken_, segs);
153 
154  int bottom = 0, top = 0;
155 
156  // Loop over all the chambers
157  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
158  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
159  for (; ch_it != ch_end; ++ch_it) {
160  DTChamberId ch = (*ch_it)->id();
161  int wheel = ch.wheel();
162  int sector = ch.sector();
163  int station = ch.station();
164 
165  DTChamberId MidId(wheel, station, sector);
166 
167  // get efficiency for MB1 using MB2 and MB3
168  if (station == 1) {
169  bottom = 2;
170  top = 3;
171  }
172 
173  // get efficiency for MB2 using MB1 and MB3
174  if (station == 2) {
175  bottom = 1;
176  top = 3;
177  }
178 
179  // get efficiency for MB2 using MB2 and MB4
180  if (station == 3) {
181  bottom = 2;
182  top = 4;
183  }
184 
185  // get efficiency for MB4 using MB2 and MB3
186  if (station == 4) {
187  bottom = 2;
188  top = 3;
189  }
190 
191  // Select events with (good) segments in Bot and Top
192  DTChamberId BotId(wheel, bottom, sector);
193  DTChamberId TopId(wheel, top, sector);
194 
195  // Get segments in the bottom chambers (if any)
196  DTRecSegment4DCollection::range segsBot = segs->get(BotId);
197  int nSegsBot = segsBot.second - segsBot.first;
198  // check if any segments is there
199  if (nSegsBot == 0)
200  continue;
201 
202  vector<MonitorElement*> histos = histosPerCh[MidId];
203 
204  // Get segments in the top chambers (if any)
205  DTRecSegment4DCollection::range segsTop = segs->get(TopId);
206  int nSegsTop = segsTop.second - segsTop.first;
207 
208  // Select one segment for the bottom chamber
209  const DTRecSegment4D& bestBotSeg = getBestSegment(segsBot);
210 
211  // Select one segment for the top chamber
212  DTRecSegment4D* pBestTopSeg = nullptr;
213  if (nSegsTop > 0)
214  pBestTopSeg = const_cast<DTRecSegment4D*>(&getBestSegment(segsTop));
215  //if top chamber is MB4 sector 10, consider also sector 14
216  if (TopId.station() == 4 && TopId.sector() == 10) {
217  DTChamberId TopId14(wheel, top, 14);
218  DTRecSegment4DCollection::range segsTop14 = segs->get(TopId14);
219  int nSegsTop14 = segsTop14.second - segsTop14.first;
220  nSegsTop += nSegsTop14;
221  if (nSegsTop14) {
222  DTRecSegment4D* pBestTopSeg14 = const_cast<DTRecSegment4D*>(&getBestSegment(segsTop14));
223  // get best between sector 10 and 14
224  pBestTopSeg = const_cast<DTRecSegment4D*>(getBestSegment(pBestTopSeg, pBestTopSeg14));
225  }
226  }
227  if (!pBestTopSeg)
228  continue;
229  const DTRecSegment4D& bestTopSeg = *pBestTopSeg;
230 
231  DTRecSegment4DCollection::range segsMid = segs->get(MidId);
232  int nSegsMid = segsMid.second - segsMid.first;
233 
234  if (detailedAnalysis) {
235  // very trivial efficiency, just count segments
236  histos[3]->Fill(0);
237  if (nSegsMid > 0)
238  histos[3]->Fill(1);
239  }
240 
241  // get position at Mid by interpolating the position (not direction) of best
242  // segment in Bot and Top to Mid surface
243  LocalPoint posAtMid = interpolate(bestBotSeg, bestTopSeg, MidId);
244 
245  // is best segment good enough?
246  if (isGoodSegment(bestBotSeg) && isGoodSegment(bestTopSeg)) {
247  if (detailedAnalysis)
248  histos[4]->Fill(posAtMid.x(), posAtMid.y());
249  //check if interpolation fall inside middle chamber
250  if ((dtGeom->chamber(MidId))->surface().bounds().inside(posAtMid)) {
251  histos[0]->Fill(posAtMid.x(), posAtMid.y());
252  if (nSegsMid > 0) {
253  if (detailedAnalysis) {
254  histos[3]->Fill(2);
255  histos[5]->Fill(posAtMid.x(), posAtMid.y());
256  }
257 
258  const DTRecSegment4D& bestMidSeg = getBestSegment(segsMid);
259  // check if middle segments is good enough
260  if (isGoodSegment(bestMidSeg)) {
261  if (detailedAnalysis)
262  histos[6]->Fill(posAtMid.x(), posAtMid.y());
263  LocalPoint midSegPos = bestMidSeg.localPosition();
264 
265  // check if middle segments is also close enough
266  double dist;
267  if (bestMidSeg.hasPhi()) {
268  if (bestTopSeg.hasZed() && bestBotSeg.hasZed() && bestMidSeg.hasZed()) {
269  dist = (midSegPos - posAtMid).mag();
270  } else {
271  dist = fabs((midSegPos - posAtMid).x());
272  }
273  } else {
274  dist = fabs((midSegPos - posAtMid).y());
275  }
276  if (dist < theMinCloseDist) {
277  histos[1]->Fill(posAtMid.x(), posAtMid.y());
278  }
279  if (detailedAnalysis)
280  histos[2]->Fill(dist);
281  }
282  }
283  }
284  }
285  } // loop over stations
286 }

References dtNoiseAnalysis_cfi::detailedAnalysis, DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), combine::histos, HiCaloJetParameters_cff::interpolate, DTRecSegment4D::localPosition(), mag(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTChamberId::wheel(), makeMuonMisalignmentScenario::wheel, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

◆ beginLuminosityBlock()

void DTChamberEfficiencyTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
override

To reset the MEs.

Definition at line 54 of file DTChamberEfficiencyTask.cc.

54  {
55  edm::LogVerbatim("DTDQM|DTMonitorModule|DTChamberEfficiencyTask")
56  << "[DTChamberEfficiencyTask]: Begin of LS transition";
57 
58  if (lumiSeg.id().luminosityBlock() % parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0 && onlineMonitor) {
59  for (map<DTChamberId, vector<MonitorElement*> >::const_iterator histo = histosPerCh.begin();
60  histo != histosPerCh.end();
61  histo++) {
62  int size = (*histo).second.size();
63  for (int i = 0; i < size; i++) {
64  (*histo).second[i]->Reset();
65  }
66  }
67  }
68 }

References timingPdfMaker::histo, mps_fire::i, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), genParticles_cff::map, dtChamberEfficiencyTask_cfi::onlineMonitor, and findQualityFiles::size.

◆ bookHistograms()

void DTChamberEfficiencyTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotected

Definition at line 75 of file DTChamberEfficiencyTask.cc.

77  {
78  ibooker.setCurrentFolder("DT/DTChamberEfficiencyTask");
79 
80  // Loop over all the chambers
81  vector<const DTChamber*>::const_iterator ch_it = dtGeom->chambers().begin();
82  vector<const DTChamber*>::const_iterator ch_end = dtGeom->chambers().end();
83  for (; ch_it != ch_end; ++ch_it) {
84  // histo booking
85  bookHistos(ibooker, (*ch_it)->id());
86  }
87 }

References bookHistos().

◆ bookHistos()

void DTChamberEfficiencyTask::bookHistos ( DQMStore::IBooker ibooker,
DTChamberId  chId 
)
private

Definition at line 90 of file DTChamberEfficiencyTask.cc.

90  {
91  edm::LogVerbatim("DTDQM|DTMonitorModule|DTChamberEfficiencyTask") << " Booking histos for CH : " << chId;
92 
93  // Compose the chamber name
94  stringstream wheel;
95  wheel << chId.wheel();
96  stringstream station;
97  station << chId.station();
98  stringstream sector;
99  sector << chId.sector();
100 
101  string HistoName = "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str();
102 
103  ibooker.setCurrentFolder("DT/01-DTChamberEfficiency/Task/Wheel" + wheel.str() + "/Sector" + sector.str() +
104  "/Station" + station.str());
105 
106  // Create the monitor elements
107  vector<MonitorElement*> histos;
108 
109  //efficiency selection cuts
110  // a- number of segments of the top chamber > 0 && number of segments of the bottom chamber > 0
111  // b- number of segments of the middle chamber > 0
112  // c- check of the top and bottom segment quality
113  // d- check if interpolation falls inside the middle chamber
114  // e- check of the middle segment quality
115  // f- check if the distance between the reconstructed and the exstrapolated segments is ok
116 
117  // histo for efficiency with cuts a-/c-/d-
118  histos.push_back(ibooker.book2D(
119  "hEffGoodSegVsPosDen" + HistoName, "Eff vs local position (good) ", 25, -250., 250., 25, -250., 250.));
120  // histo for efficiency with cuts a-/b-/c-/d-/e-/f-
121  histos.push_back(ibooker.book2D("hEffGoodCloseSegVsPosNum" + HistoName,
122  "Eff vs local position (good and close segs) ",
123  25,
124  -250.,
125  250.,
126  25,
127  -250.,
128  250.));
129  if (detailedAnalysis) {
130  histos.push_back(
131  ibooker.book1D("hDistSegFromExtrap" + HistoName, "Distance segments from extrap position ", 200, 0., 200.));
132  // histo for efficiency from segment counting
133  histos.push_back(ibooker.book1D("hNaiveEffSeg" + HistoName, "Naive eff ", 10, 0., 10.));
134  // histo for efficiency with cuts a-/c-
135  histos.push_back(ibooker.book2D(
136  "hEffSegVsPosDen" + HistoName, "Eff vs local position (all) ", 25, -250., 250., 25, -250., 250.));
137  // histo for efficiency with cuts a-/b-/c-/d-
138  histos.push_back(
139  ibooker.book2D("hEffSegVsPosNum" + HistoName, "Eff vs local position ", 25, -250., 250., 25, -250., 250.));
140  // histo for efficiency with cuts a-/b-/c-/d-/e-
141  histos.push_back(ibooker.book2D(
142  "hEffGoodSegVsPosNum" + HistoName, "Eff vs local position (good segs) ", 25, -250., 250., 25, -250., 250.));
143  }
144  histosPerCh[chId] = histos;
145 }

References dtNoiseAnalysis_cfi::detailedAnalysis, combine::histos, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginRun()

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

BeginRun.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 70 of file DTChamberEfficiencyTask.cc.

70  {
71  // Get the DT Geometry
73 }

References edm::get(), and singleTopDQM_cfi::setup.

◆ endLuminosityBlock()

void DTChamberEfficiencyTask::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
inlinefinal

Definition at line 48 of file DTChamberEfficiencyTask.h.

48 {}

◆ getBestSegment() [1/2]

const DTRecSegment4D * DTChamberEfficiencyTask::getBestSegment ( const DTRecSegment4D s1,
const DTRecSegment4D s2 
) const
private

Definition at line 310 of file DTChamberEfficiencyTask.cc.

311  {
312  if (!s1)
313  return s2;
314  if (!s2)
315  return s1;
316  unsigned int nHits1 = (s1->hasPhi() ? s1->phiSegment()->recHits().size() : 0);
317  nHits1 += (s1->hasZed() ? s1->zSegment()->recHits().size() : 0);
318 
319  unsigned int nHits2 = (s2->hasPhi() ? s2->phiSegment()->recHits().size() : 0);
320  nHits2 += (s2->hasZed() ? s2->zSegment()->recHits().size() : 0);
321 
322  if (nHits1 == nHits2) {
323  if (s1->chi2() / s1->degreesOfFreedom() < s2->chi2() / s2->degreesOfFreedom())
324  return s1;
325  else
326  return s2;
327  } else if (nHits1 > nHits2)
328  return s1;
329  return s2;
330 }

References DTRecSegment4D::chi2(), DTRecSegment4D::degreesOfFreedom(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), DTRecSegment4D::phiSegment(), DTRecSegment2D::recHits(), indexGen::s2, and DTRecSegment4D::zSegment().

◆ getBestSegment() [2/2]

const DTRecSegment4D & DTChamberEfficiencyTask::getBestSegment ( const DTRecSegment4DCollection::range segs) const
private

Definition at line 289 of file DTChamberEfficiencyTask.cc.

289  {
291  unsigned int nHitBest = 0;
292  double chi2Best = 99999.;
293  for (DTRecSegment4DCollection::const_iterator seg = segs.first; seg != segs.second; ++seg) {
294  unsigned int nHits = ((*seg).hasPhi() ? (*seg).phiSegment()->recHits().size() : 0);
295  nHits += ((*seg).hasZed() ? (*seg).zSegment()->recHits().size() : 0);
296 
297  if (nHits == nHitBest) {
298  if ((*seg).chi2() / (*seg).degreesOfFreedom() < chi2Best) {
299  chi2Best = (*seg).chi2() / (*seg).degreesOfFreedom();
300  bestIter = seg;
301  }
302  } else if (nHits > nHitBest) {
303  nHitBest = nHits;
304  bestIter = seg;
305  }
306  }
307  return *bestIter;
308 }

References DTRecSegment4D::chi2().

◆ interpolate()

LocalPoint DTChamberEfficiencyTask::interpolate ( const DTRecSegment4D seg1,
const DTRecSegment4D seg3,
const DTChamberId MB2 
) const
private

Definition at line 332 of file DTChamberEfficiencyTask.cc.

334  {
335  // Get GlobalPoition of Seg in MB1
336  GlobalPoint gpos1 = (dtGeom->chamber(seg1.chamberId()))->toGlobal(seg1.localPosition());
337 
338  // Get GlobalPoition of Seg in MB3
339  GlobalPoint gpos3 = (dtGeom->chamber(seg3.chamberId()))->toGlobal(seg3.localPosition());
340 
341  // interpolate
342  // get all in MB2 frame
343  LocalPoint pos1 = (dtGeom->chamber(id2))->toLocal(gpos1);
344  LocalPoint pos3 = (dtGeom->chamber(id2))->toLocal(gpos3);
345 
346  // case 1: 1 and 3 has both projection. No problem
347 
348  // case 2: one projection is missing for one of the segments. Keep the other's segment position
349  if (!seg1.hasZed())
350  pos1 = LocalPoint(pos1.x(), pos3.y(), pos1.z());
351  if (!seg3.hasZed())
352  pos3 = LocalPoint(pos3.x(), pos1.y(), pos3.z());
353 
354  if (!seg1.hasPhi())
355  pos1 = LocalPoint(pos3.x(), pos1.y(), pos1.z());
356  if (!seg3.hasPhi())
357  pos3 = LocalPoint(pos1.x(), pos3.y(), pos3.z());
358 
359  // direction
360  LocalVector dir = (pos3 - pos1).unit(); // z points inward!
361  LocalPoint pos2 = pos1 + dir * pos1.z() / (-dir.z());
362 
363  return pos2;
364 }

References DTRecSegment4D::chamberId(), DeadROC_duringRun::dir, DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), globals_cff::id2, DTRecSegment4D::localPosition(), toLocal(), unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ isGoodSegment()

bool DTChamberEfficiencyTask::isGoodSegment ( const DTRecSegment4D seg) const
private

Definition at line 366 of file DTChamberEfficiencyTask.cc.

366  {
367  if (seg.chamberId().station() != 4 && !seg.hasZed())
368  return false;
369  unsigned int nHits = (seg.hasPhi() ? seg.phiSegment()->recHits().size() : 0);
370  nHits += (seg.hasZed() ? seg.zSegment()->recHits().size() : 0);
371  return (nHits >= theMinHitsSegment && seg.chi2() / seg.degreesOfFreedom() < theMinChi2NormSegment);
372 }

References DTRecSegment4D::chamberId(), DTRecSegment4D::chi2(), DTRecSegment4D::degreesOfFreedom(), DTRecSegment4D::hasPhi(), DTRecSegment4D::hasZed(), DTRecSegment4D::phiSegment(), DTRecSegment2D::recHits(), DTChamberId::station(), and DTRecSegment4D::zSegment().

Member Data Documentation

◆ debug

bool DTChamberEfficiencyTask::debug
private

◆ detailedAnalysis

bool DTChamberEfficiencyTask::detailedAnalysis
private

Definition at line 70 of file DTChamberEfficiencyTask.h.

◆ dtGeom

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

Definition at line 83 of file DTChamberEfficiencyTask.h.

◆ histosPerCh

std::map<DTChamberId, std::vector<MonitorElement*> > DTChamberEfficiencyTask::histosPerCh
private

Definition at line 77 of file DTChamberEfficiencyTask.h.

◆ onlineMonitor

bool DTChamberEfficiencyTask::onlineMonitor
private

Definition at line 68 of file DTChamberEfficiencyTask.h.

◆ parameters

edm::ParameterSet DTChamberEfficiencyTask::parameters
private

Definition at line 75 of file DTChamberEfficiencyTask.h.

◆ recHits4DToken_

edm::EDGetTokenT<DTRecSegment4DCollection> DTChamberEfficiencyTask::recHits4DToken_
private

Definition at line 73 of file DTChamberEfficiencyTask.h.

◆ segs

edm::Handle<DTRecSegment4DCollection> DTChamberEfficiencyTask::segs
private

Definition at line 84 of file DTChamberEfficiencyTask.h.

◆ theMinChi2NormSegment

double DTChamberEfficiencyTask::theMinChi2NormSegment
private

Definition at line 80 of file DTChamberEfficiencyTask.h.

◆ theMinCloseDist

double DTChamberEfficiencyTask::theMinCloseDist
private

Definition at line 81 of file DTChamberEfficiencyTask.h.

◆ theMinHitsSegment

unsigned int DTChamberEfficiencyTask::theMinHitsSegment
private

Definition at line 79 of file DTChamberEfficiencyTask.h.

Vector3DBase< float, LocalTag >
DDAxes::y
DTRecSegment4D
Definition: DTRecSegment4D.h:23
mps_fire.i
i
Definition: mps_fire.py:355
DTChamberEfficiencyTask::detailedAnalysis
bool detailedAnalysis
Definition: DTChamberEfficiencyTask.h:70
DTChamberEfficiencyTask::recHits4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTChamberEfficiencyTask.h:73
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
DTChamberEfficiencyTask::theMinChi2NormSegment
double theMinChi2NormSegment
Definition: DTChamberEfficiencyTask.h:80
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTRecSegment4D::chamberId
virtual DTChamberId chamberId() const
The (specific) DetId of the chamber on which the segment resides.
Definition: DTRecSegment4D.cc:256
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DDAxes::x
indexGen.s2
s2
Definition: indexGen.py:107
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
DTChamberEfficiencyTask::theMinCloseDist
double theMinCloseDist
Definition: DTChamberEfficiencyTask.h:81
DTRecSegment4D::localPosition
LocalPoint localPosition() const override
Local position in Chamber frame.
Definition: DTRecSegment4D.h:61
DTRecSegment4D::zSegment
const DTSLRecSegment2D * zSegment() const
The Z segment: 0 if not zed projection available.
Definition: DTRecSegment4D.h:99
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
DTGeometry::chamber
const DTChamber * chamber(const DTChamberId &id) const
Return a DTChamber given its id.
Definition: DTGeometry.cc:90
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DTRecSegment2D::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: DTRecSegment2D.cc:86
DTChamberEfficiencyTask::interpolate
LocalPoint interpolate(const DTRecSegment4D &seg1, const DTRecSegment4D &seg3, const DTChamberId &MB2) const
Definition: DTChamberEfficiencyTask.cc:332
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
DTChamberEfficiencyTask::segs
edm::Handle< DTRecSegment4DCollection > segs
Definition: DTChamberEfficiencyTask.h:84
DTChamberEfficiencyTask::onlineMonitor
bool onlineMonitor
Definition: DTChamberEfficiencyTask.h:68
Point3DBase< float, LocalTag >
DTChamberEfficiencyTask::debug
bool debug
Definition: DTChamberEfficiencyTask.h:66
DTRecSegment4D::degreesOfFreedom
int degreesOfFreedom() const override
Degrees of freedom of the segment fit.
Definition: DTRecSegment4D.cc:179
DTChamberEfficiencyTask::histosPerCh
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
Definition: DTChamberEfficiencyTask.h:77
DTChamberEfficiencyTask::getBestSegment
const DTRecSegment4D & getBestSegment(const DTRecSegment4DCollection::range &segs) const
Definition: DTChamberEfficiencyTask.cc:289
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTChamberEfficiencyTask::dtGeom
edm::ESHandle< DTGeometry > dtGeom
Definition: DTChamberEfficiencyTask.h:83
edm::LogVerbatim
Definition: MessageLogger.h:297
cscdqm::HistoName
std::string HistoName
Definition: CSCDQM_HistoDef.h:32
get
#define get
unit
Basic3DVector unit() const
Definition: Basic3DVectorLD.h:162
DTChamberEfficiencyTask::isGoodSegment
bool isGoodSegment(const DTRecSegment4D &seg) const
Definition: DTChamberEfficiencyTask.cc:366
combine.histos
histos
Definition: combine.py:4
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
edm::RangeMap::range
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
DTRecSegment4D::hasZed
bool hasZed() const
Does it have the Z projection?
Definition: DTRecSegment4D.h:93
DTChamberEfficiencyTask::bookHistos
void bookHistos(DQMStore::IBooker &ibooker, DTChamberId chId)
Definition: DTChamberEfficiencyTask.cc:90
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:192
DTRecSegment4D::chi2
double chi2() const override
Chi2 of the segment fit.
Definition: DTRecSegment4D.cc:170
DTRecSegment4D::hasPhi
bool hasPhi() const
Does it have the Phi projection?
Definition: DTRecSegment4D.h:90
genParticles_cff.map
map
Definition: genParticles_cff.py:11
DTChamberId
Definition: DTChamberId.h:14
globals_cff.id2
id2
Definition: globals_cff.py:33
DTChamberEfficiencyTask::theMinHitsSegment
unsigned int theMinHitsSegment
Definition: DTChamberEfficiencyTask.h:79
DTRecSegment4D::phiSegment
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
Definition: DTRecSegment4D.h:96
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
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
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443