CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTEfficiencyTask Class Reference

#include <DTEfficiencyTask.h>

Inheritance diagram for DTEfficiencyTask:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &setup)
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 To reset the MEs. More...
 
 DTEfficiencyTask (const edm::ParameterSet &pset)
 Constructor. More...
 
void endJob ()
 Endjob. More...
 
virtual ~DTEfficiencyTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void bookHistos (DTLayerId lId, int fisrtWire, int lastWire)
 
void fillHistos (DTLayerId lId, int firstWire, int lastWire, int numWire)
 
void fillHistos (DTLayerId lId, int firstWire, int lastWire, int missingWire, bool UnassHit)
 

Private Attributes

bool debug
 
std::map< DTLayerId,
std::vector< MonitorElement * > > 
histosPerL
 
edm::ParameterSet parameters
 
edm::EDGetTokenT
< DTRecSegment4DCollection
recHits4DToken_
 
edm::EDGetTokenT
< DTRecHitCollection
recHitToken_
 
DQMStoretheDbe
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

Author
G. Mila - INFN Torino

Definition at line 31 of file DTEfficiencyTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file DTEfficiencyTask.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, and Parameters::parameters.

39  {
40 
41  debug = pset.getUntrackedParameter<bool>("debug",false);
42  // the name of the 4D rec hits collection
43  recHits4DToken_ = consumes<DTRecSegment4DCollection>(
44  edm::InputTag(pset.getParameter<string>("recHits4DLabel")));
45  // the name of the rechits collection
46  recHitToken_ = consumes<DTRecHitCollection>(
47  edm::InputTag(pset.getParameter<string>("recHitLabel")));
48 
49  // Get the DQM needed services
51  theDbe->setCurrentFolder("DT/DTEfficiencyTask");
52 
53  parameters = pset;
54 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
edm::ParameterSet parameters
DTEfficiencyTask::~DTEfficiencyTask ( )
virtual

Destructor.

Definition at line 57 of file DTEfficiencyTask.cc.

57  {
58 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 87 of file DTEfficiencyTask.cc.

References filterCSVwithJSON::copy, funct::cos(), gather_cfg::cout, debug, edm::EventSetup::get(), i, getDQMSummary::iter, DTChamber::layer(), DTWireId::layerId(), DTRangeMapAccessor::layersBySuperLayer(), GetRecoTauVFromDQM_MC_cff::next, DTRecSegment2D::specificRecHits(), DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), DTChamber::superLayers(), PV3DBase< T, PVType, FrameType >::theta(), GeomDet::toGlobal(), GeomDet::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

87  {
88 
89 
90  if(debug)
91  cout << "[DTEfficiencyTask] Analyze #Run: " << event.id().run()
92  << " #Event: " << event.id().event() << endl;
93 
94 
95  // Get the 4D segment collection from the event
97  event.getByToken(recHits4DToken_, all4DSegments);
98 
99  // Get the rechit collection from the event
100  Handle<DTRecHitCollection> dtRecHits;
101  event.getByToken(recHitToken_, dtRecHits);
102 
103  // Get the DT Geometry
104  ESHandle<DTGeometry> dtGeom;
105  setup.get<MuonGeometryRecord>().get(dtGeom);
106 
107  // Loop over all chambers containing a segment
108  DTRecSegment4DCollection::id_iterator chamberId;
109  for (chamberId = all4DSegments->id_begin();
110  chamberId != all4DSegments->id_end();
111  ++chamberId) {
112 
113  // Get the chamber
114  const DTChamber* chamber = dtGeom->chamber(*chamberId);
115 
116  // Get all 1D RecHits to be used for searches of hits not associated to segments and map them by wire
117  const vector<const DTSuperLayer*> SLayers = chamber->superLayers();
118  map<DTWireId, int> wireAnd1DRecHits;
119  for(vector<const DTSuperLayer*>::const_iterator superlayer = SLayers.begin();
120  superlayer != SLayers.end();
121  superlayer++) {
122  DTRecHitCollection::range range = dtRecHits->get(DTRangeMapAccessor::layersBySuperLayer((*superlayer)->id()));
123  // Loop over the rechits of this ChamberId
124  for (DTRecHitCollection::const_iterator rechit = range.first;
125  rechit!=range.second;
126  ++rechit){
127  wireAnd1DRecHits[(*rechit).wireId()] = (*rechit).wireId().wire();
128  }
129  }
130 
131 
132  // Get the 4D segment range for the corresponding ChamerId
133  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
134  int nsegm = distance(range.first, range.second);
135  if(debug)
136  cout << " Chamber: " << *chamberId << " has " << nsegm
137  << " 4D segments" << endl;
138 
139 
140  // Loop over the rechits of this ChamerId
141  for (DTRecSegment4DCollection::const_iterator segment4D = range.first;
142  segment4D!=range.second;
143  ++segment4D) {
144  if(debug)
145  cout << " == RecSegment dimension: " << (*segment4D).dimension() << endl;
146 
147  // If Statio != 4 skip RecHits with dimension != 4
148  // For the Station 4 consider 2D RecHits
149  if((*chamberId).station() != 4 && (*segment4D).dimension() != 4) {
150  if(debug)
151  cout << "[DTEfficiencyTask]***Warning: RecSegment dimension is not 4 but "
152  << (*segment4D).dimension() << ", skipping!" << endl;
153  continue;
154  } else if((*chamberId).station() == 4 && (*segment4D).dimension() != 2) {
155  if(debug)
156  cout << "[DTEfficiencyTask]***Warning: RecSegment dimension is not 2 but "
157  << (*segment4D).dimension() << ", skipping!" << endl;
158  continue;
159  }
160 
161  vector<DTRecHit1D> recHits1D;
162  bool rPhi = false;
163  bool rZ = false;
164 
165  // Get 1D RecHits and select only events with 7 or 8 hits in phi and 3 or 4 hits in theta (if any)
166  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
167  vector<DTRecHit1D> phiRecHits = phiSeg->specificRecHits();
168  rPhi = true;
169  if(phiRecHits.size() < 7 || phiRecHits.size() > 8 ) {
170  if(debug)
171  cout << "[DTEfficiencyTask] Phi segments has: " << phiRecHits.size()
172  << " hits, skipping" << endl; // FIXME: info output
173  continue;
174  }
175  copy(phiRecHits.begin(), phiRecHits.end(), back_inserter(recHits1D));
176  const DTSLRecSegment2D* zSeg = 0;
177  if((*segment4D).dimension() == 4) {
178  rZ = true;
179  zSeg = (*segment4D).zSegment();
180  vector<DTRecHit1D> zRecHits = zSeg->specificRecHits();
181  if(zRecHits.size() < 3 || zRecHits.size() > 4 ) {
182  if(debug)
183  cout << "[DTEfficiencyTask] Theta segments has: " << zRecHits.size()
184  << " hits, skipping" << endl; // FIXME: info output
185  continue;
186  }
187  copy(zRecHits.begin(), zRecHits.end(), back_inserter(recHits1D));
188  }
189 
190  // Skip the segment if it has more than 1 hit on the same layer
191  vector<DTWireId> wireMap;
192  for(vector<DTRecHit1D>::const_iterator recHit1D = recHits1D.begin();
193  recHit1D != recHits1D.end();
194  recHit1D++) {
195  wireMap.push_back((*recHit1D).wireId());
196  }
197 
198  bool hitsOnSameLayer = false;
199  for(vector<DTWireId>::const_iterator channelId = wireMap.begin();
200  channelId != wireMap.end(); channelId++) {
201  vector<DTWireId>::const_iterator next = channelId;
202  next++;
203  for(vector<DTWireId>::const_iterator ite = next; ite != wireMap.end(); ite++) {
204  if((*channelId).layerId() == (*ite).layerId()) {
205  hitsOnSameLayer = true;
206  }
207  }
208  }
209  if(hitsOnSameLayer) {
210  if(debug)
211  cout << "[DTEfficiencyTask] This RecHit has 2 hits on the same layer, skipping!" << endl;
212  continue;
213  }
214 
215 
216  // Select 2D segments with angle smaller than 45 deg
217  LocalVector phiDirectionInChamber = (*phiSeg).localDirection();
218  if(rPhi && fabs(phiDirectionInChamber.x()/phiDirectionInChamber.z()) > 1) {
219  if(debug) {
220  cout << " RPhi segment has angle > 45 deg, skipping! " << endl;
221  cout << " Theta = " << phiDirectionInChamber.theta() << endl;
222  }
223  continue;
224  }
225  if(rZ) {
226  LocalVector zDirectionInChamber = (*zSeg).localDirection();
227  if(fabs(zDirectionInChamber.y()/zDirectionInChamber.z()) > 1) {
228  if(debug){
229  cout << " RZ segment has angle > 45 deg, skipping! " << endl;
230  cout << " Theta = " << zDirectionInChamber.theta() << endl;
231  }
232  continue;
233  }
234  }
235 
236 
237  // Skip if the 4D segment has only 10 hits
238  if(recHits1D.size() == 10) {
239  if(debug)
240  cout << "[DTEfficiencyTask] 4D Segment with only 10 hits, skipping!" << endl;
241  continue;
242  }
243 
244 
245  // Analyse the case of 11 recHits for MB1,MB2,MB3 and of 7 recHits for MB4
246  if((rPhi && recHits1D.size() == 7) || (rZ && recHits1D.size() == 11)) {
247 
248  if(debug) {
249  if(rPhi && recHits1D.size() == 7)
250  cout << "[DTEfficiencyTask] MB4 Segment with only 7 hits!" << endl;
251  if(rZ && recHits1D.size() == 11)
252  cout << "[DTEfficiencyTask] 4D Segment with only 11 hits!" << endl;
253  }
254 
255  // Find the layer without RecHits ----------------------------------------
256  const vector<const DTSuperLayer*> SupLayers = chamber->superLayers();
257  map<DTLayerId, bool> layerMap;
258  map<DTWireId, float> wireAndPosInChamberAtLayerZ;
259  // Loop over layers and wires to fill a map
260  for(vector<const DTSuperLayer*>::const_iterator superlayer = SupLayers.begin();
261  superlayer != SupLayers.end();
262  superlayer++) {
263  const vector<const DTLayer*> Layers = (*superlayer)->layers();
264  for(vector<const DTLayer*>::const_iterator layer = Layers.begin();
265  layer != Layers.end();
266  layer++) {
267  layerMap.insert(make_pair((*layer)->id(), false));
268  const int firstWire = dtGeom->layer((*layer)->id())->specificTopology().firstChannel();
269  const int lastWire = dtGeom->layer((*layer)->id())->specificTopology().lastChannel();
270  for(int i=firstWire; i - lastWire <= 0; i++) {
271  DTWireId wireId((*layer)->id(), i);
272  float wireX = (*layer)->specificTopology().wirePosition(wireId.wire());
273  LocalPoint wirePosInLay(wireX,0,0);
274  GlobalPoint wirePosGlob = (*layer)->toGlobal(wirePosInLay);
275  LocalPoint wirePosInChamber = chamber->toLocal(wirePosGlob);
276  if((*superlayer)->id().superlayer() == 1 || (*superlayer)->id().superlayer() == 3) {
277  wireAndPosInChamberAtLayerZ.insert(make_pair(wireId, wirePosInChamber.x()));
278  } else {
279  wireAndPosInChamberAtLayerZ.insert(make_pair(wireId, wirePosInChamber.y()));
280  }
281  }
282  }
283  }
284 
285  // Loop over segment 1D RecHit
286  map<DTLayerId, int> NumWireMap;
287  for(vector<DTRecHit1D>::const_iterator recHit = recHits1D.begin();
288  recHit != recHits1D.end();
289  recHit++) {
290  layerMap[(*recHit).wireId().layerId()]= true;
291  NumWireMap[(*recHit).wireId().layerId()]= (*recHit).wireId().wire();
292  }
293 
294  DTLayerId missLayerId;
295  //Loop over the map and find the layer without hits
296  for(map<DTLayerId, bool>::const_iterator iter = layerMap.begin();
297  iter != layerMap.end(); iter++) {
298  if(!(*iter).second) missLayerId = (*iter).first;
299  }
300  if(debug)
301  cout << "[DTEfficiencyTask] Layer without recHits is: " << missLayerId << endl;
302  // -------------------------------------------------------
303 
304 
305 
306  const DTLayer* missLayer = chamber->layer(missLayerId);
307 
308  LocalPoint missLayerPosInChamber = chamber->toLocal(missLayer->toGlobal(LocalPoint(0,0,0)));
309 
310  // Segment position at Wire z in chamber local frame
311  LocalPoint segPosAtZLayer = (*segment4D).localPosition()
312  + (*segment4D).localDirection()*missLayerPosInChamber.z()/cos((*segment4D).localDirection().theta());
313 
314  DTWireId missWireId;
315 
316  // Find the id of the cell without hit ---------------------------------------------------
317  for(map<DTWireId, float>::const_iterator wireAndPos = wireAndPosInChamberAtLayerZ.begin();
318  wireAndPos != wireAndPosInChamberAtLayerZ.end();
319  wireAndPos++) {
320  DTWireId wireId = (*wireAndPos).first;
321  if(wireId.layerId() == missLayerId) {
322  if(missLayerId.superlayerId().superlayer() == 1 || missLayerId.superlayerId().superlayer() == 3 ) {
323  if(fabs(segPosAtZLayer.x() - (*wireAndPos).second) < 2.1)
324  missWireId = wireId;
325  } else {
326  if(fabs(segPosAtZLayer.y() - (*wireAndPos).second) < 2.1)
327  missWireId = wireId;
328  }
329  }
330  }
331  if(debug)
332  cout << "[DTEfficiencyTask] Cell without hit is: " << missWireId << endl;
333  // ----------------------------------------------------------
334 
335 
336  bool foundUnAssRechit = false;
337 
338  // Look for unassociated hits in this cell
339  if(wireAnd1DRecHits.find(missWireId) != wireAnd1DRecHits.end()) {
340  if(debug)
341  cout << "[DTEfficiencyTask] Unassociated Hit found!" << endl;
342  foundUnAssRechit = true;
343  }
344 
345 
346  for(map<DTLayerId, bool>::const_iterator iter = layerMap.begin();
347  iter != layerMap.end(); iter++) {
348  if((*iter).second)
349  fillHistos((*iter).first, dtGeom->layer((*iter).first)->specificTopology().firstChannel(), dtGeom->layer((*iter).first)->specificTopology().lastChannel(), NumWireMap[(*iter).first]);
350  else
351  fillHistos((*iter).first, dtGeom->layer((*iter).first)->specificTopology().firstChannel(), dtGeom->layer((*iter).first)->specificTopology().lastChannel(), missWireId.wire(), foundUnAssRechit);
352  }
353 
354  } // End of the loop for segment with 7 or 11 recHits
355 
356  if((rPhi && recHits1D.size() == 8) || (rZ && recHits1D.size() == 12)) {
357  map<DTLayerId, int> NumWireMap;
358  DTLayerId LayerID;
359  for(vector<DTRecHit1D>::const_iterator recHit = recHits1D.begin();
360  recHit != recHits1D.end();
361  recHit++) {
362  LayerID = (*recHit).wireId().layerId();
363  NumWireMap[LayerID]= (*recHit).wireId().wire();
364  }
365  for(map<DTLayerId, int>::const_iterator iter = NumWireMap.begin();
366  iter != NumWireMap.end(); iter++) {
367  fillHistos((*iter).first, dtGeom->layer((*iter).first)->specificTopology().firstChannel(), dtGeom->layer((*iter).first)->specificTopology().lastChannel(), NumWireMap[(*iter).first]);
368  }
369  }
370 
371  } // End of loop over the 4D segments inside a sigle chamber
372  } // End of loop over all tha chamber with at least a 4D segment in the event
373 }
int i
Definition: DBlmapReader.cc:9
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
T y() const
Definition: PV3DBase.h:63
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:62
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
Definition: DTChamber.cc:80
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
void fillHistos(DTLayerId lId, int firstWire, int lastWire, int numWire)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
edm::EDGetTokenT< DTRecHitCollection > recHitToken_
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
const std::vector< const DTSuperLayer * > & superLayers() const
Return the superlayers in the chamber.
Definition: DTChamber.cc:60
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
int superlayer() const
Return the superlayer number (deprecated method name)
const T & get() const
Definition: EventSetup.h:55
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:62
tuple cout
Definition: gather_cfg.py:121
T x() const
Definition: PV3DBase.h:62
void DTEfficiencyTask::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 61 of file DTEfficiencyTask.cc.

61  {
62 }
void DTEfficiencyTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
virtual

To reset the MEs.

Reimplemented from edm::EDAnalyzer.

Definition at line 65 of file DTEfficiencyTask.cc.

References timingPdfMaker::histo, i, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), python.multivaluedict::map(), Parameters::parameters, and findQualityFiles::size.

65  {
66 
67 
68  if(lumiSeg.id().luminosityBlock()%parameters.getUntrackedParameter<int>("ResetCycle", 3) == 0) {
69  for(map<DTLayerId, vector<MonitorElement*> > ::const_iterator histo = histosPerL.begin();
70  histo != histosPerL.end();
71  histo++) {
72  int size = (*histo).second.size();
73  for(int i=0; i<size; i++){
74  (*histo).second[i]->Reset();
75  }
76  }
77  }
78 
79 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
tuple size
Write out results.
edm::ParameterSet parameters
void DTEfficiencyTask::bookHistos ( DTLayerId  lId,
int  fisrtWire,
int  lastWire 
)
private

Definition at line 377 of file DTEfficiencyTask.cc.

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

377  {
378  if(debug)
379  cout << " Booking histos for L: " << lId << endl;
380 
381  // Compose the chamber name
382  stringstream wheel; wheel << lId.superlayerId().chamberId().wheel();
383  stringstream station; station << lId.superlayerId().chamberId().station();
384  stringstream sector; sector << lId.superlayerId().chamberId().sector();
385  stringstream superLayer; superLayer << lId.superlayerId().superlayer();
386  stringstream layer; layer << lId.layer();
387 
388  string lHistoName =
389  "_W" + wheel.str() +
390  "_St" + station.str() +
391  "_Sec" + sector.str() +
392  "_SL" + superLayer.str()+
393  "_L" + layer.str();
394 
395  theDbe->setCurrentFolder("DT/DTEfficiencyTask/Wheel" + wheel.str() +
396  "/Station" + station.str() +
397  "/Sector" + sector.str() +
398  "/SuperLayer" +superLayer.str());
399  // Create the monitor elements
400  vector<MonitorElement *> histos;
401  // histo for hits associated to the 4D reconstructed segment
402  histos.push_back(theDbe->book1D("hEffOccupancy"+lHistoName, "4D segments recHits occupancy",lastWire-firstWire+1, firstWire-0.5, lastWire+0.5));
403  // histo for hits not associated to the segment
404  histos.push_back(theDbe->book1D("hEffUnassOccupancy"+lHistoName, "4D segments recHits and Hits not associated occupancy",lastWire-firstWire+1, firstWire-0.5, lastWire+0.5));
405  // histo for cells associated to the 4D reconstructed segment
406  histos.push_back(theDbe->book1D("hRecSegmOccupancy"+lHistoName, "4D segments cells occupancy",lastWire-firstWire+1, firstWire-0.5, lastWire+0.5));
407 
408  histosPerL[lId] = histos;
409 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
DTChamberId chamberId() const
Return the corresponding ChamberId.
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
int layer() const
Return the layer number.
Definition: DTLayerId.h:53
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
int superlayer() const
Return the superlayer number (deprecated method name)
int sector() const
Definition: DTChamberId.h:61
tuple cout
Definition: gather_cfg.py:121
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void DTEfficiencyTask::endJob ( void  )
virtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file DTEfficiencyTask.cc.

82  {
83  theDbe->rmdir("DT/DTEfficiencyTask");
84 }
void rmdir(const std::string &fullpath)
Definition: DQMStore.cc:3051
void DTEfficiencyTask::fillHistos ( DTLayerId  lId,
int  firstWire,
int  lastWire,
int  numWire 
)
private

Definition at line 413 of file DTEfficiencyTask.cc.

References bookHistos(), and mergeVDriftHistosByStation::histos.

415  {
416  if(histosPerL.find(lId) == histosPerL.end()){
417  bookHistos(lId, firstWire, lastWire);
418  }
419  vector<MonitorElement *> histos = histosPerL[lId];
420  histos[0]->Fill(numWire);
421  histos[1]->Fill(numWire);
422  histos[2]->Fill(numWire);
423 }
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
void bookHistos(DTLayerId lId, int fisrtWire, int lastWire)
void DTEfficiencyTask::fillHistos ( DTLayerId  lId,
int  firstWire,
int  lastWire,
int  missingWire,
bool  UnassHit 
)
private

Definition at line 426 of file DTEfficiencyTask.cc.

References bookHistos(), and mergeVDriftHistosByStation::histos.

429  {
430  if(histosPerL.find(lId) == histosPerL.end()){
431  bookHistos(lId, firstWire, lastWire);
432  }
433  vector<MonitorElement *> histos = histosPerL[lId];
434  if(unassHit)
435  histos[1]->Fill(missingWire);
436  histos[2]->Fill(missingWire);
437 }
std::map< DTLayerId, std::vector< MonitorElement * > > histosPerL
void bookHistos(DTLayerId lId, int fisrtWire, int lastWire)

Member Data Documentation

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

Definition at line 75 of file DTEfficiencyTask.h.

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

Definition at line 61 of file DTEfficiencyTask.h.

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

Definition at line 64 of file DTEfficiencyTask.h.

DQMStore* DTEfficiencyTask::theDbe
private

Definition at line 55 of file DTEfficiencyTask.h.