CMS 3D CMS Logo

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

#include <DTEfficiencyTask.h>

Inheritance diagram for DTEfficiencyTask:
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...
 
 DTEfficiencyTask (const edm::ParameterSet &pset)
 Constructor. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) final
 
 ~DTEfficiencyTask () 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
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 BeginRun. More...
 
- 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 fillHistos (DTLayerId lId, int firstWire, int lastWire, int missingWire, bool UnassHit)
 
void fillHistos (DTLayerId lId, int firstWire, int lastWire, int numWire)
 

Private Attributes

bool debug
 
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
 
edm::ESHandle< DTGeometrymuonGeom
 
edm::ParameterSet parameters
 
edm::EDGetTokenT< DTRecSegment4DCollectionrecHits4DToken_
 
edm::EDGetTokenT< DTRecHitCollectionrecHitToken_
 

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:

Author
G. Mila - INFN Torino

Definition at line 33 of file DTEfficiencyTask.h.

Constructor & Destructor Documentation

◆ DTEfficiencyTask()

DTEfficiencyTask::DTEfficiencyTask ( const edm::ParameterSet pset)

Constructor.

Definition at line 33 of file DTEfficiencyTask.cc.

33  {
34  debug = pset.getUntrackedParameter<bool>("debug", false);
35  // the name of the 4D rec hits collection
36  recHits4DToken_ = consumes<DTRecSegment4DCollection>(edm::InputTag(pset.getParameter<string>("recHits4DLabel")));
37  // the name of the rechits collection
38  recHitToken_ = consumes<DTRecHitCollection>(edm::InputTag(pset.getParameter<string>("recHitLabel")));
39 
40  parameters = pset;
41 }

References debug, and muonDTDigis_cfi::pset.

◆ ~DTEfficiencyTask()

DTEfficiencyTask::~DTEfficiencyTask ( )
override

Destructor.

Definition at line 43 of file DTEfficiencyTask.cc.

43 {}

Member Function Documentation

◆ analyze()

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

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

Definition at line 143 of file DTEfficiencyTask.cc.

143  {
144  if (debug)
145  cout << "[DTEfficiencyTask] Analyze #Run: " << event.id().run() << " #Event: " << event.id().event() << endl;
146 
147  // Get the 4D segment collection from the event
149  event.getByToken(recHits4DToken_, all4DSegments);
150 
151  // Get the rechit collection from the event
152  Handle<DTRecHitCollection> dtRecHits;
153  event.getByToken(recHitToken_, dtRecHits);
154 
155  // Get the DT Geometry
156  ESHandle<DTGeometry> dtGeom;
157  setup.get<MuonGeometryRecord>().get(dtGeom);
158 
159  // Loop over all chambers containing a segment
161  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId) {
162  // Get the chamber
163  const DTChamber* chamber = dtGeom->chamber(*chamberId);
164 
165  // Get all 1D RecHits to be used for searches of hits not associated to segments and map them by wire
166  const vector<const DTSuperLayer*>& SLayers = chamber->superLayers();
167  map<DTWireId, int> wireAnd1DRecHits;
168  for (vector<const DTSuperLayer*>::const_iterator superlayer = SLayers.begin(); superlayer != SLayers.end();
169  superlayer++) {
170  DTRecHitCollection::range range = dtRecHits->get(DTRangeMapAccessor::layersBySuperLayer((*superlayer)->id()));
171  // Loop over the rechits of this ChamberId
172  for (DTRecHitCollection::const_iterator rechit = range.first; rechit != range.second; ++rechit) {
173  wireAnd1DRecHits[(*rechit).wireId()] = (*rechit).wireId().wire();
174  }
175  }
176 
177  // Get the 4D segment range for the corresponding ChamerId
178  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
179  int nsegm = distance(range.first, range.second);
180  if (debug)
181  cout << " Chamber: " << *chamberId << " has " << nsegm << " 4D segments" << endl;
182 
183  // Loop over the rechits of this ChamerId
184  for (DTRecSegment4DCollection::const_iterator segment4D = range.first; segment4D != range.second; ++segment4D) {
185  if (debug)
186  cout << " == RecSegment dimension: " << (*segment4D).dimension() << endl;
187 
188  // If Station != 4 skip RecHits with dimension != 4
189  // For the Station 4 consider 2D RecHits
190  if ((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
191  if (debug)
192  cout << "[DTEfficiencyTask]***Warning: RecSegment dimension is not 4 but " << (*segment4D).dimension()
193  << ", skipping!" << endl;
194  continue;
195  } else if ((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
196  if (debug)
197  cout << "[DTEfficiencyTask]***Warning: RecSegment dimension is not 2 but " << (*segment4D).dimension()
198  << ", skipping!" << endl;
199  continue;
200  }
201 
202  vector<DTRecHit1D> recHits1D;
203  bool rPhi = false;
204  bool rZ = false;
205 
206  // Get 1D RecHits and select only events with 7 or 8 hits in phi and 3 or 4 hits in theta (if any)
207  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
208  vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
209  rPhi = true;
210  if (phiRecHits.size() < 7 || phiRecHits.size() > 8) {
211  if (debug)
212  cout << "[DTEfficiencyTask] Phi segments has: " << phiRecHits.size() << " hits, skipping"
213  << endl; // FIXME: info output
214  continue;
215  }
216  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D));
217  const DTSLRecSegment2D* zSeg = nullptr;
218  if ((*segment4D).dimension() == 4) {
219  rZ = true;
220  zSeg = (*segment4D).zSegment();
221  vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
222  if (zRecHits.size() < 3 || zRecHits.size() > 4) {
223  if (debug)
224  cout << "[DTEfficiencyTask] Theta segments has: " << zRecHits.size() << " hits, skipping"
225  << endl; // FIXME: info output
226  continue;
227  }
228  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D));
229  }
230 
231  // Skip the segment if it has more than 1 hit on the same layer
232  vector<DTWireId> wireMap;
233  for (vector<DTRecHit1D>::const_iterator recHit1D = recHits1D.begin(); recHit1D != recHits1D.end(); recHit1D++) {
234  wireMap.push_back((*recHit1D).wireId());
235  }
236 
237  bool hitsOnSameLayer = false;
238  for (vector<DTWireId>::const_iterator channelId = wireMap.begin(); channelId != wireMap.end(); channelId++) {
239  vector<DTWireId>::const_iterator next = channelId;
240  next++;
241  for (vector<DTWireId>::const_iterator ite = next; ite != wireMap.end(); ite++) {
242  if ((*channelId).layerId() == (*ite).layerId()) {
243  hitsOnSameLayer = true;
244  }
245  }
246  }
247  if (hitsOnSameLayer) {
248  if (debug)
249  cout << "[DTEfficiencyTask] This RecHit has 2 hits on the same layer, skipping!" << endl;
250  continue;
251  }
252 
253  // Select 2D segments with angle smaller than 45 deg
254  LocalVector phiDirectionInChamber = (*phiSeg).localDirection();
255  if (rPhi && fabs(phiDirectionInChamber.x() / phiDirectionInChamber.z()) > 1) {
256  if (debug) {
257  cout << " RPhi segment has angle > 45 deg, skipping! " << endl;
258  cout << " Theta = " << phiDirectionInChamber.theta() << endl;
259  }
260  continue;
261  }
262  if (rZ) {
263  LocalVector zDirectionInChamber = (*zSeg).localDirection();
264  if (fabs(zDirectionInChamber.y() / zDirectionInChamber.z()) > 1) {
265  if (debug) {
266  cout << " RZ segment has angle > 45 deg, skipping! " << endl;
267  cout << " Theta = " << zDirectionInChamber.theta() << endl;
268  }
269  continue;
270  }
271  }
272 
273  // Skip if the 4D segment has only 10 hits
274  if (recHits1D.size() == 10) {
275  if (debug)
276  cout << "[DTEfficiencyTask] 4D Segment with only 10 hits, skipping!" << endl;
277  continue;
278  }
279 
280  // Analyse the case of 11 recHits for MB1,MB2,MB3 and of 7 recHits for MB4
281  if ((rPhi && recHits1D.size() == 7) || (rZ && recHits1D.size() == 11)) {
282  if (debug) {
283  if (rPhi && recHits1D.size() == 7)
284  cout << "[DTEfficiencyTask] MB4 Segment with only 7 hits!" << endl;
285  if (rZ && recHits1D.size() == 11)
286  cout << "[DTEfficiencyTask] 4D Segment with only 11 hits!" << endl;
287  }
288 
289  // Find the layer without RecHits ----------------------------------------
290  const vector<const DTSuperLayer*>& SupLayers = chamber->superLayers();
291  map<DTLayerId, bool> layerMap;
292  map<DTWireId, float> wireAndPosInChamberAtLayerZ;
293  // Loop over layers and wires to fill a map
294  for (vector<const DTSuperLayer*>::const_iterator superlayer = SupLayers.begin(); superlayer != SupLayers.end();
295  superlayer++) {
296  const vector<const DTLayer*> Layers = (*superlayer)->layers();
297  for (vector<const DTLayer*>::const_iterator layer = Layers.begin(); layer != Layers.end(); layer++) {
298  layerMap.insert(make_pair((*layer)->id(), false));
299  const int firstWire = dtGeom->layer((*layer)->id())->specificTopology().firstChannel();
300  const int lastWire = dtGeom->layer((*layer)->id())->specificTopology().lastChannel();
301  for (int i = firstWire; i - lastWire <= 0; i++) {
302  DTWireId wireId((*layer)->id(), i);
303  float wireX = (*layer)->specificTopology().wirePosition(wireId.wire());
304  LocalPoint wirePosInLay(wireX, 0, 0);
305  GlobalPoint wirePosGlob = (*layer)->toGlobal(wirePosInLay);
306  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
307  if ((*superlayer)->id().superlayer() == 1 || (*superlayer)->id().superlayer() == 3) {
308  wireAndPosInChamberAtLayerZ.insert(make_pair(wireId, wirePosInChamber.x()));
309  } else {
310  wireAndPosInChamberAtLayerZ.insert(make_pair(wireId, wirePosInChamber.y()));
311  }
312  }
313  }
314  }
315 
316  // Loop over segment 1D RecHit
317  map<DTLayerId, int> NumWireMap;
318  for (vector<DTRecHit1D>::const_iterator recHit = recHits1D.begin(); recHit != recHits1D.end(); recHit++) {
319  layerMap[(*recHit).wireId().layerId()] = true;
320  NumWireMap[(*recHit).wireId().layerId()] = (*recHit).wireId().wire();
321  }
322 
323  DTLayerId missLayerId;
324  //Loop over the map and find the layer without hits
325  for (map<DTLayerId, bool>::const_iterator iter = layerMap.begin(); iter != layerMap.end(); iter++) {
326  if (!(*iter).second)
327  missLayerId = (*iter).first;
328  }
329  if (debug)
330  cout << "[DTEfficiencyTask] Layer without recHits is: " << missLayerId << endl;
331  // -------------------------------------------------------
332 
333  const DTLayer* missLayer = chamber->layer(missLayerId);
334 
335  LocalPoint missLayerPosInChamber = chamber->toLocal(missLayer->toGlobal(LocalPoint(0, 0, 0)));
336 
337  // Segment position at Wire z in chamber local frame
338  LocalPoint segPosAtZLayer = (*segment4D).localPosition() + (*segment4D).localDirection() *
339  missLayerPosInChamber.z() /
340  cos((*segment4D).localDirection().theta());
341 
342  DTWireId missWireId;
343 
344  // Find the id of the cell without hit ---------------------------------------------------
345  for (map<DTWireId, float>::const_iterator wireAndPos = wireAndPosInChamberAtLayerZ.begin();
346  wireAndPos != wireAndPosInChamberAtLayerZ.end();
347  wireAndPos++) {
348  DTWireId wireId = (*wireAndPos).first;
349  if (wireId.layerId() == missLayerId) {
350  if (missLayerId.superlayerId().superlayer() == 1 || missLayerId.superlayerId().superlayer() == 3) {
351  if (fabs(segPosAtZLayer.x() - (*wireAndPos).second) < 2.1)
352  missWireId = wireId;
353  } else {
354  if (fabs(segPosAtZLayer.y() - (*wireAndPos).second) < 2.1)
355  missWireId = wireId;
356  }
357  }
358  }
359  if (debug)
360  cout << "[DTEfficiencyTask] Cell without hit is: " << missWireId << endl;
361  // ----------------------------------------------------------
362 
363  bool foundUnAssRechit = false;
364 
365  // Look for unassociated hits in this cell
366  if (wireAnd1DRecHits.find(missWireId) != wireAnd1DRecHits.end()) {
367  if (debug)
368  cout << "[DTEfficiencyTask] Unassociated Hit found!" << endl;
369  foundUnAssRechit = true;
370  }
371 
372  for (map<DTLayerId, bool>::const_iterator iter = layerMap.begin(); iter != layerMap.end(); iter++) {
373  if ((*iter).second)
374  fillHistos((*iter).first,
375  dtGeom->layer((*iter).first)->specificTopology().firstChannel(),
376  dtGeom->layer((*iter).first)->specificTopology().lastChannel(),
377  NumWireMap[(*iter).first]);
378  else
379  fillHistos((*iter).first,
380  dtGeom->layer((*iter).first)->specificTopology().firstChannel(),
381  dtGeom->layer((*iter).first)->specificTopology().lastChannel(),
382  missWireId.wire(),
383  foundUnAssRechit);
384  }
385 
386  } // End of the loop for segment with 7 or 11 recHits
387 
388  if ((rPhi && recHits1D.size() == 8) || (rZ && recHits1D.size() == 12)) {
389  map<DTLayerId, int> NumWireMap;
390  DTLayerId LayerID;
391  for (vector<DTRecHit1D>::const_iterator recHit = recHits1D.begin(); recHit != recHits1D.end(); recHit++) {
392  LayerID = (*recHit).wireId().layerId();
393  NumWireMap[LayerID] = (*recHit).wireId().wire();
394  }
395  for (map<DTLayerId, int>::const_iterator iter = NumWireMap.begin(); iter != NumWireMap.end(); iter++) {
396  fillHistos((*iter).first,
397  dtGeom->layer((*iter).first)->specificTopology().firstChannel(),
398  dtGeom->layer((*iter).first)->specificTopology().lastChannel(),
399  NumWireMap[(*iter).first]);
400  }
401  }
402 
403  } // End of loop over the 4D segments inside a sigle chamber
404  } // End of loop over all tha chamber with at least a 4D segment in the event
405 }

References relativeConstraints::chamber, DTGeometry::chamber(), filterCSVwithJSON::copy, funct::cos(), gather_cfg::cout, debug, HLT_2018_cff::distance, DTTopology::firstChannel(), edm::get(), mps_fire::i, DTTopology::lastChannel(), DTGeometry::layer(), DTWireId::layerId(), DTRangeMapAccessor::layersBySuperLayer(), GetRecoTauVFromDQM_MC_cff::next, FastTimerService_cff::range, rpcPointValidation_cfi::recHit, singleTopDQM_cfi::setup, DTRecSegment2D::specificRecHits(), DTLayer::specificTopology(), DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ beginLuminosityBlock()

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

To reset the MEs.

Definition at line 131 of file DTEfficiencyTask.cc.

131  {
132  if (lumiSeg.id().luminosityBlock() % parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
133  for (map<DTLayerId, vector<MonitorElement*> >::const_iterator histo = histosPerL.begin(); histo != histosPerL.end();
134  histo++) {
135  int size = (*histo).second.size();
136  for (int i = 0; i < size; i++) {
137  (*histo).second[i]->Reset();
138  }
139  }
140  }
141 }

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

◆ bookHistograms()

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

Definition at line 50 of file DTEfficiencyTask.cc.

52  {
53  ibooker.setCurrentFolder("DT/DTEfficiencyTask");
54 
55  cout << "[DTTestPulseTask]: booking" << endl;
56 
57  //here put the static booking loop
58 
59  // Loop over all the chambers
60  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
61  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
62 
63  for (; ch_it != ch_end; ++ch_it) {
64  // Loop over the SLs
65  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
66  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
67 
68  for (; sl_it != sl_end; ++sl_it) {
69  DTSuperLayerId sl = (*sl_it)->id();
70  stringstream superLayer;
71  superLayer << sl.superlayer();
72 
73  // Loop over the Ls
74  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
75  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
76 
77  for (; l_it != l_end; ++l_it) {
78  DTLayerId layerId = (*l_it)->id();
79  if (debug)
80  cout << " Booking histos for L: " << layerId << endl;
81 
82  // Compose the chamber name
83  stringstream layer;
84  layer << layerId.layer();
85  stringstream superLayer;
86  superLayer << layerId.superlayer();
87  stringstream station;
88  station << layerId.superlayerId().chamberId().station();
89  stringstream sector;
90  sector << layerId.superlayerId().chamberId().sector();
91  stringstream wheel;
92  wheel << layerId.superlayerId().chamberId().wheel();
93 
94  const int firstWire = (*l_it)->specificTopology().firstChannel();
95  const int lastWire = (*l_it)->specificTopology().lastChannel();
96 
97  string lHistoName = "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" +
98  superLayer.str() + "_L" + layer.str();
99 
100  ibooker.setCurrentFolder("DT/DTEfficiencyTask/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
101  sector.str() + "/SuperLayer" + superLayer.str());
102 
103  // Create the monitor elements
104  vector<MonitorElement*> histos;
105  // histo for hits associated to the 4D reconstructed segment
106  histos.push_back(ibooker.book1D("hEffOccupancy" + lHistoName,
107  "4D segments recHits occupancy",
108  lastWire - firstWire + 1,
109  firstWire - 0.5,
110  lastWire + 0.5));
111  // histo for hits not associated to the segment
112  histos.push_back(ibooker.book1D("hEffUnassOccupancy" + lHistoName,
113  "4D segments recHits and Hits not associated occupancy",
114  lastWire - firstWire + 1,
115  firstWire - 0.5,
116  lastWire + 0.5));
117  // histo for cells associated to the 4D reconstructed segment
118  histos.push_back(ibooker.book1D("hRecSegmOccupancy" + lHistoName,
119  "4D segments cells occupancy",
120  lastWire - firstWire + 1,
121  firstWire - 0.5,
122  lastWire + 0.5));
123 
124  histosPerL[layerId] = histos;
125 
126  } // layer
127  } // superlayer
128  } // chambers
129 }

References DTSuperLayerId::chamberId(), gather_cfg::cout, debug, combine::histos, DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginRun()

void DTEfficiencyTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotectedvirtual

BeginRun.

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

Definition at line 45 of file DTEfficiencyTask.cc.

45  {
46  // Get the geometry
47  context.get<MuonGeometryRecord>().get(muonGeom);
48 }

References edm::EventSetup::get(), and edm::get().

◆ endLuminosityBlock()

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

Definition at line 43 of file DTEfficiencyTask.h.

43 {}

◆ fillHistos() [1/2]

void DTEfficiencyTask::fillHistos ( DTLayerId  lId,
int  firstWire,
int  lastWire,
int  missingWire,
bool  UnassHit 
)
private

Definition at line 416 of file DTEfficiencyTask.cc.

416  {
417  vector<MonitorElement*> histos = histosPerL[lId];
418  if (unassHit)
419  histos[1]->Fill(missingWire);
420  histos[2]->Fill(missingWire);
421 }

References combine::histos.

◆ fillHistos() [2/2]

void DTEfficiencyTask::fillHistos ( DTLayerId  lId,
int  firstWire,
int  lastWire,
int  numWire 
)
private

Definition at line 408 of file DTEfficiencyTask.cc.

408  {
409  vector<MonitorElement*> histos = histosPerL[lId];
410  histos[0]->Fill(numWire);
411  histos[1]->Fill(numWire);
412  histos[2]->Fill(numWire);
413 }

References combine::histos.

Member Data Documentation

◆ debug

bool DTEfficiencyTask::debug
private

◆ histosPerL

std::map<DTLayerId, std::vector<MonitorElement*> > DTEfficiencyTask::histosPerL
private

Definition at line 73 of file DTEfficiencyTask.h.

◆ muonGeom

edm::ESHandle<DTGeometry> DTEfficiencyTask::muonGeom
private

Definition at line 56 of file DTEfficiencyTask.h.

◆ parameters

edm::ParameterSet DTEfficiencyTask::parameters
private

Definition at line 67 of file DTEfficiencyTask.h.

◆ recHits4DToken_

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

Definition at line 62 of file DTEfficiencyTask.h.

◆ recHitToken_

edm::EDGetTokenT<DTRecHitCollection> DTEfficiencyTask::recHitToken_
private

Definition at line 65 of file DTEfficiencyTask.h.

Vector3DBase< float, LocalTag >
DTSLRecSegment2D
Definition: DTSLRecSegment2D.h:15
DTSuperLayerId
Definition: DTSuperLayerId.h:12
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
mps_fire.i
i
Definition: mps_fire.py:355
DTEfficiencyTask::fillHistos
void fillHistos(DTLayerId lId, int firstWire, int lastWire, int numWire)
Definition: DTEfficiencyTask.cc:408
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
relativeConstraints.station
station
Definition: relativeConstraints.py:67
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
DTEfficiencyTask::recHitToken_
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
Definition: DTEfficiencyTask.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DTChamber
Definition: DTChamber.h:24
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
HLT_2018_cff.distance
distance
Definition: HLT_2018_cff.py:6417
DTEfficiencyTask::recHits4DToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
Definition: DTEfficiencyTask.h:62
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
edm::Handle< DTRecSegment4DCollection >
edm::RangeMap::id_iterator
identifier iterator
Definition: RangeMap.h:130
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
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
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DTTopology::firstChannel
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
DTWireId
Definition: DTWireId.h:12
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
edm::ESHandle< DTGeometry >
Point3DBase< float, LocalTag >
DTLayerId
Definition: DTLayerId.h:12
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
DTRangeMapAccessor::layersBySuperLayer
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
Definition: DTRangeMapAccessor.cc:15
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTSuperLayerId::chamberId
DTChamberId chamberId() const
Return the corresponding ChamberId.
Definition: DTSuperLayerId.h:45
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
DTChamberRecSegment2D
Definition: DTChamberRecSegment2D.h:31
get
#define get
DTLayer
Definition: DTLayer.h:25
combine.histos
histos
Definition: combine.py:4
DTTopology::lastChannel
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
DTEfficiencyTask::debug
bool debug
Definition: DTEfficiencyTask.h:59
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
DTLayerId::superlayerId
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
DTRecSegment2D::specificRecHits
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
Definition: DTRecSegment2D.cc:104
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
DTWireId::layerId
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:45
genParticles_cff.map
map
Definition: genParticles_cff.py:11
DTEfficiencyTask::muonGeom
edm::ESHandle< DTGeometry > muonGeom
Definition: DTEfficiencyTask.h:56
DTEfficiencyTask::histosPerL
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
Definition: DTEfficiencyTask.h:73
DTLayerId::layer
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
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
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443