CMS 3D CMS Logo

DTT0CalibrationRMS.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author S. Bolognesi - INFN Torino
5  */
8 
12 
15 
17 
18 #include "TH1I.h"
19 #include "TFile.h"
20 #include "TKey.h"
21 
22 using namespace std;
23 using namespace edm;
24 // using namespace cond;
25 
26 // Constructor
28  // Get the debug parameter for verbose output
29  debug = pset.getUntrackedParameter<bool>("debug");
30  if (debug)
31  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS]Constructor called!";
32 
33  // Get the token to retrieve digis from the event
34  digiToken = consumes<DTDigiCollection>(pset.getUntrackedParameter<string>("digiLabel"));
35 
36  // The root file which contain the histos per layer
37  string rootFileName = pset.getUntrackedParameter<string>("rootFileName", "DTT0PerLayer.root");
38  theFile = new TFile(rootFileName.c_str(), "RECREATE");
39 
41  pset.getUntrackedParameter<string>("calibWheel", "All"); //FIXME amke a vector of integer instead of a string
42  if (theCalibWheel != "All") {
43  stringstream linestr;
44  int selWheel;
45  linestr << theCalibWheel;
46  linestr >> selWheel;
47  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMSPerLayer] chosen wheel " << selWheel;
48  }
49 
50  // Sector/s to calibrate
52  pset.getUntrackedParameter<string>("calibSector", "All"); //FIXME amke a vector of integer instead of a string
53  if (theCalibSector != "All") {
54  stringstream linestr;
55  int selSector;
56  linestr << theCalibSector;
57  linestr >> selSector;
58  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMSPerLayer] chosen sector " << selSector;
59  }
60 
61  vector<string> defaultCell;
62  defaultCell.push_back("None");
63  cellsWithHistos = pset.getUntrackedParameter<vector<string> >("cellsWithHisto", defaultCell);
64  for (vector<string>::const_iterator cell = cellsWithHistos.begin(); cell != cellsWithHistos.end(); ++cell) {
65  if ((*cell) != "None") {
66  stringstream linestr;
67  int wheel, sector, station, sl, layer, wire;
68  linestr << (*cell);
69  linestr >> wheel >> sector >> station >> sl >> layer >> wire;
70  wireIdWithHistos.push_back(DTWireId(wheel, station, sector, sl, layer, wire));
71  }
72  }
73 
74  hT0SectorHisto = nullptr;
75 
76  nevents = 0;
77  eventsForLayerT0 = pset.getParameter<unsigned int>("eventsForLayerT0");
78  eventsForWireT0 = pset.getParameter<unsigned int>("eventsForWireT0");
79  rejectDigiFromPeak = pset.getParameter<unsigned int>("rejectDigiFromPeak");
80  tpPeakWidth = pset.getParameter<double>("tpPeakWidth");
81  //useReferenceWireInLayer_ = true;
82  correctByChamberMean_ = pset.getParameter<bool>("correctByChamberMean");
83 }
84 
85 // Destructor
87  if (debug)
88  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS]Destructor called!";
89 
90  theFile->Close();
91 }
92 
95  if (debug || event.id().event() % 500 == 0)
96  edm::LogVerbatim("DTCalibration") << "--- [DTT0CalibrationRMS] Analysing Event: #Run: " << event.id().run()
97  << " #Event: " << event.id().event();
98  nevents++;
99 
100  // Get the digis from the event
101  const Handle<DTDigiCollection>& digis = event.getHandle(digiToken);
102 
103  // Get the DT Geometry
104  dtGeom = eventSetup.getHandle(dtGeomToken_);
105 
106  // Iterate through all digi collections ordered by LayerId
108  for (dtLayerIt = digis->begin(); dtLayerIt != digis->end(); ++dtLayerIt) {
109  // Get the iterators over the digis associated with this LayerId
110  const DTDigiCollection::Range& digiRange = (*dtLayerIt).second;
111 
112  // Get the layerId
113  const DTLayerId layerId = (*dtLayerIt).first; //FIXME: check to be in the right sector
114 
115  if ((theCalibWheel != "All") && (layerId.superlayerId().chamberId().wheel() != selWheel))
116  continue;
117  if ((theCalibSector != "All") && (layerId.superlayerId().chamberId().sector() != selSector))
118  continue;
119 
120  // Loop over all digis in the given layer
121  for (DTDigiCollection::const_iterator digi = digiRange.first; digi != digiRange.second; ++digi) {
122  double t0 = (*digi).countsTDC();
123 
124  //Use first bunch of events to fill t0 per layer
125  if (nevents < eventsForLayerT0) {
126  //Get the per-layer histo from the map
127  TH1I* hT0LayerHisto = theHistoLayerMap[layerId];
128  //If it doesn't exist, book it
129  if (hT0LayerHisto == nullptr) {
130  theFile->cd();
131  hT0LayerHisto = new TH1I(getHistoName(layerId).c_str(),
132  "T0 from pulses by layer (TDC counts, 1 TDC count = 0.781 ns)",
133  200,
134  t0 - 100,
135  t0 + 100);
136  if (debug)
137  edm::LogVerbatim("DTCalibration") << " New T0 per Layer Histo: " << hT0LayerHisto->GetName();
138  theHistoLayerMap[layerId] = hT0LayerHisto;
139  }
140 
141  //Fill the histos
142  theFile->cd();
143  if (hT0LayerHisto != nullptr) {
144  hT0LayerHisto->Fill(t0);
145  }
146  }
147 
148  //Use all the remaining events to compute t0 per wire
149  if (nevents > eventsForLayerT0) {
150  // Get the wireId
151  const DTWireId wireId(layerId, (*digi).wire());
152  if (debug) {
153  edm::LogVerbatim("DTCalibration")
154  << " Wire: " << wireId << "\n time (TDC counts): " << (*digi).countsTDC();
155  }
156 
157  //Fill the histos per wire for the chosen cells
158  vector<DTWireId>::iterator it_wire = find(wireIdWithHistos.begin(), wireIdWithHistos.end(), wireId);
159  if (it_wire != wireIdWithHistos.end()) {
160  if (theHistoWireMap.find(wireId) == theHistoWireMap.end()) {
161  theHistoWireMap[wireId] = new TH1I(getHistoName(wireId).c_str(),
162  "T0 from pulses by wire (TDC counts, 1 TDC count = 0.781 ns)",
163  7000,
164  0,
165  7000);
166  if (debug)
167  edm::LogVerbatim("DTCalibration") << " New T0 per wire Histo: " << (theHistoWireMap[wireId])->GetName();
168  }
169  if (theHistoWireMap_ref.find(wireId) == theHistoWireMap_ref.end()) {
170  theHistoWireMap_ref[wireId] = new TH1I((getHistoName(wireId) + "_ref").c_str(),
171  "T0 from pulses by wire (TDC counts, 1 TDC count = 0.781 ns)",
172  7000,
173  0,
174  7000);
175  if (debug)
176  edm::LogVerbatim("DTCalibration")
177  << " New T0 per wire Histo: " << (theHistoWireMap_ref[wireId])->GetName();
178  }
179 
180  TH1I* hT0WireHisto = theHistoWireMap[wireId];
181  //Fill the histos
182  theFile->cd();
183  if (hT0WireHisto)
184  hT0WireHisto->Fill(t0);
185  }
186 
187  //Check the tzero has reasonable value
188  if (abs(hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin()) - t0) > rejectDigiFromPeak) {
189  if (debug)
190  edm::LogVerbatim("DTCalibration") << "digi skipped because t0 per sector "
191  << hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin());
192  continue;
193  }
194 
195  //Use second bunch of events to compute a t0 reference per wire
197  //Fill reference wire histos
198  if (it_wire != wireIdWithHistos.end()) {
199  TH1I* hT0WireHisto_ref = theHistoWireMap_ref[wireId];
200  theFile->cd();
201  if (hT0WireHisto_ref)
202  hT0WireHisto_ref->Fill(t0);
203  }
204  if (!nDigiPerWire_ref[wireId]) {
205  mK_ref[wireId] = 0;
206  }
207  nDigiPerWire_ref[wireId] = nDigiPerWire_ref[wireId] + 1;
208  mK_ref[wireId] = mK_ref[wireId] + (t0 - mK_ref[wireId]) / nDigiPerWire_ref[wireId];
209  }
210  //Use last all the remaining events to compute the mean and sigma t0 per wire
211  else if (nevents > (eventsForLayerT0 + eventsForWireT0)) {
212  if (abs(t0 - mK_ref[wireId]) > tpPeakWidth)
213  continue;
214  if (!nDigiPerWire[wireId]) {
215  theAbsoluteT0PerWire[wireId] = 0;
216  qK[wireId] = 0;
217  mK[wireId] = 0;
218  }
219  nDigiPerWire[wireId] = nDigiPerWire[wireId] + 1;
220  theAbsoluteT0PerWire[wireId] = theAbsoluteT0PerWire[wireId] + t0;
221  //theSigmaT0PerWire[wireId] = theSigmaT0PerWire[wireId] + (t0*t0);
222  qK[wireId] =
223  qK[wireId] + ((nDigiPerWire[wireId] - 1) * (t0 - mK[wireId]) * (t0 - mK[wireId]) / nDigiPerWire[wireId]);
224  mK[wireId] = mK[wireId] + (t0 - mK[wireId]) / nDigiPerWire[wireId];
225  }
226  } //end if(nevents>1000)
227  } //end loop on digi
228  } //end loop on layer
229 
230  //Use the t0 per layer histos to have an indication about the t0 position
231  if (nevents == eventsForLayerT0) {
232  for (map<DTLayerId, TH1I*>::const_iterator lHisto = theHistoLayerMap.begin(); lHisto != theHistoLayerMap.end();
233  ++lHisto) {
234  if (debug)
235  edm::LogVerbatim("DTCalibration") << "Reading histogram " << (*lHisto).second->GetName() << " with mean "
236  << (*lHisto).second->GetMean() << " and RMS " << (*lHisto).second->GetRMS();
237 
238  //Take the mean as a first t0 estimation
239  if ((*lHisto).second->GetRMS() < 5.0) {
240  if (hT0SectorHisto == nullptr) {
241  hT0SectorHisto = new TH1D("hT0AllLayerOfSector",
242  "T0 from pulses per layer in sector",
243  //20, (*lHisto).second->GetMean()-100, (*lHisto).second->GetMean()+100);
244  700,
245  0,
246  7000);
247  }
248  if (debug)
249  edm::LogVerbatim("DTCalibration") << " accepted";
250  hT0SectorHisto->Fill((*lHisto).second->GetMean());
251  }
252  //Take the mean of noise + 400ns as a first t0 estimation
253  // if((*lHisto).second->GetRMS()>10.0 && ((*lHisto).second->GetRMS()<15.0)){
254  // double t0_estim = (*lHisto).second->GetMean() + 400;
255  // if(hT0SectorHisto == 0){
256  // hT0SectorHisto = new TH1D("hT0AllLayerOfSector","T0 from pulses per layer in sector",
257  // //20, t0_estim-100, t0_estim+100);
258  // 700, 0, 7000);
259  // }
260  // if(debug)
261  // edm::LogVerbatim("DTCalibration")<<" accepted + 400ns";
262  // hT0SectorHisto->Fill((*lHisto).second->GetMean() + 400);
263  // }
264  //if (debug)
265  // edm::LogVerbatim("DTCalibration");
266 
267  theT0LayerMap[(*lHisto).second->GetName()] = (*lHisto).second->GetMean();
268  theSigmaT0LayerMap[(*lHisto).second->GetName()] = (*lHisto).second->GetRMS();
269  }
270  if (!hT0SectorHisto) {
271  edm::LogVerbatim("DTCalibration")
272  << "[DTT0CalibrationRMS]: All the t0 per layer are still uncorrect: trying with greater number of events";
274  return;
275  }
276  if (debug)
277  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] t0 reference for this sector "
278  << hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin());
279  }
280 }
281 
283  DTT0* t0sAbsolute = new DTT0();
284  DTT0* t0sRelative = new DTT0();
285  DTT0* t0sWRTChamber = new DTT0();
286 
287  //if(debug)
288  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMSPerLayer]Writing histos to file!";
289 
290  theFile->cd();
291  theFile->WriteTObject(hT0SectorHisto);
292  //hT0SectorHisto->Write();
293  for (map<DTWireId, TH1I*>::const_iterator wHisto = theHistoWireMap.begin(); wHisto != theHistoWireMap.end();
294  ++wHisto) {
295  (*wHisto).second->Write();
296  }
297  for (map<DTWireId, TH1I*>::const_iterator wHisto = theHistoWireMap_ref.begin(); wHisto != theHistoWireMap_ref.end();
298  ++wHisto) {
299  (*wHisto).second->Write();
300  }
301  for (map<DTLayerId, TH1I*>::const_iterator lHisto = theHistoLayerMap.begin(); lHisto != theHistoLayerMap.end();
302  ++lHisto) {
303  (*lHisto).second->Write();
304  }
305 
306  //if(debug)
307  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Compute and store t0 and sigma per wire";
308 
309  for (map<DTWireId, double>::const_iterator wiret0 = theAbsoluteT0PerWire.begin();
310  wiret0 != theAbsoluteT0PerWire.end();
311  ++wiret0) {
312  if (nDigiPerWire[(*wiret0).first]) {
313  double t0 = (*wiret0).second / nDigiPerWire[(*wiret0).first];
314 
315  theRelativeT0PerWire[(*wiret0).first] = t0 - hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin());
316 
317  //theSigmaT0PerWire[(*wiret0).first] = sqrt((theSigmaT0PerWire[(*wiret0).first] / nDigiPerWire[(*wiret0).first]) - t0*t0);
318  theSigmaT0PerWire[(*wiret0).first] = sqrt(qK[(*wiret0).first] / nDigiPerWire[(*wiret0).first]);
319 
320  edm::LogVerbatim("DTCalibration") << "Wire " << (*wiret0).first << " has t0 " << t0 << "(absolute) "
321  << theRelativeT0PerWire[(*wiret0).first] << "(relative)"
322  << " sigma " << theSigmaT0PerWire[(*wiret0).first];
323 
324  t0sAbsolute->set((*wiret0).first, t0, theSigmaT0PerWire[(*wiret0).first], DTTimeUnits::counts);
325  } else {
326  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] ERROR: no digis in wire " << (*wiret0).first;
327  abort();
328  }
329  }
330 
331  if (correctByChamberMean_) {
333  // Get all the sls from the setup
334  const vector<const DTSuperLayer*> superLayers = dtGeom->superLayers();
335  // Loop over all SLs
336  for (vector<const DTSuperLayer*>::const_iterator sl = superLayers.begin(); sl != superLayers.end(); sl++) {
337  //Compute mean for odd and even superlayers
338  double oddLayersMean = 0;
339  double evenLayersMean = 0;
340  double oddLayersDen = 0;
341  double evenLayersDen = 0;
342  for (map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
343  wiret0 != theRelativeT0PerWire.end();
344  ++wiret0) {
345  if ((*wiret0).first.layerId().superlayerId() == (*sl)->id()) {
346  if (debug)
347  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Superlayer " << (*sl)->id() << "layer "
348  << (*wiret0).first.layerId().layer() << " with " << (*wiret0).second;
349  if (((*wiret0).first.layerId().layer()) % 2) {
350  oddLayersMean = oddLayersMean + (*wiret0).second;
351  oddLayersDen++;
352  } else {
353  evenLayersMean = evenLayersMean + (*wiret0).second;
354  evenLayersDen++;
355  }
356  }
357  }
358  oddLayersMean = oddLayersMean / oddLayersDen;
359  evenLayersMean = evenLayersMean / evenLayersDen;
360  //if(debug && oddLayersMean)
361  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Relative T0 mean for odd layers " << oddLayersMean
362  << " even layers" << evenLayersMean;
363 
364  //Compute sigma for odd and even superlayers
365  double oddLayersSigma = 0;
366  double evenLayersSigma = 0;
367  for (map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
368  wiret0 != theRelativeT0PerWire.end();
369  ++wiret0) {
370  if ((*wiret0).first.layerId().superlayerId() == (*sl)->id()) {
371  if (((*wiret0).first.layerId().layer()) % 2) {
372  oddLayersSigma = oddLayersSigma + ((*wiret0).second - oddLayersMean) * ((*wiret0).second - oddLayersMean);
373  } else {
374  evenLayersSigma =
375  evenLayersSigma + ((*wiret0).second - evenLayersMean) * ((*wiret0).second - evenLayersMean);
376  }
377  }
378  }
379  oddLayersSigma = oddLayersSigma / oddLayersDen;
380  evenLayersSigma = evenLayersSigma / evenLayersDen;
381  oddLayersSigma = sqrt(oddLayersSigma);
382  evenLayersSigma = sqrt(evenLayersSigma);
383 
384  //if(debug && oddLayersMean)
385  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Relative T0 sigma for odd layers " << oddLayersSigma
386  << " even layers" << evenLayersSigma;
387 
388  //Recompute the mean for odd and even superlayers discarding fluctations
389  double oddLayersFinalMean = 0;
390  double evenLayersFinalMean = 0;
391  for (map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
392  wiret0 != theRelativeT0PerWire.end();
393  ++wiret0) {
394  if ((*wiret0).first.layerId().superlayerId() == (*sl)->id()) {
395  if (((*wiret0).first.layerId().layer()) % 2) {
396  if (abs((*wiret0).second - oddLayersMean) < (2 * oddLayersSigma))
397  oddLayersFinalMean = oddLayersFinalMean + (*wiret0).second;
398  } else {
399  if (abs((*wiret0).second - evenLayersMean) < (2 * evenLayersSigma))
400  evenLayersFinalMean = evenLayersFinalMean + (*wiret0).second;
401  }
402  }
403  }
404  oddLayersFinalMean = oddLayersFinalMean / oddLayersDen;
405  evenLayersFinalMean = evenLayersFinalMean / evenLayersDen;
406  //if(debug && oddLayersMean)
407  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Final relative T0 mean for odd layers "
408  << oddLayersFinalMean << " even layers" << evenLayersFinalMean;
409 
410  for (map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
411  wiret0 != theRelativeT0PerWire.end();
412  ++wiret0) {
413  if ((*wiret0).first.layerId().superlayerId() == (*sl)->id()) {
414  double t0 = -999;
415  if (((*wiret0).first.layerId().layer()) % 2)
416  t0 = (*wiret0).second + (evenLayersFinalMean - oddLayersFinalMean);
417  else
418  t0 = (*wiret0).second;
419 
420  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS] Wire " << (*wiret0).first << " has t0 "
421  << (*wiret0).second << " (relative, after even-odd layer corrections) "
422  << " sigma " << theSigmaT0PerWire[(*wiret0).first];
423 
424  //Store the results into DB
425  t0sRelative->set((*wiret0).first, t0, theSigmaT0PerWire[(*wiret0).first], DTTimeUnits::counts);
426  }
427  }
428  }
429 
431  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS]Computing relative t0 wrt to chamber average";
432  //Compute the reference for each chamber
433  map<DTChamberId, double> sumT0ByChamber;
434  map<DTChamberId, int> countT0ByChamber;
435  for (DTT0::const_iterator tzero = t0sRelative->begin(); tzero != t0sRelative->end(); ++tzero) {
436  int channelId = tzero->channelId;
437  if (channelId == 0)
438  continue;
439  DTWireId wireId(channelId);
440  DTChamberId chamberId(wireId.chamberId());
441  //sumT0ByChamber[chamberId] = sumT0ByChamber[chamberId] + tzero->t0mean;
442  // @@@ better DTT0 usage
443  float t0mean_f;
444  float t0rms_f;
445  t0sRelative->get(wireId, t0mean_f, t0rms_f, DTTimeUnits::counts);
446  sumT0ByChamber[chamberId] = sumT0ByChamber[chamberId] + t0mean_f;
447  // @@@ NEW DTT0 END
448  countT0ByChamber[chamberId]++;
449  }
450 
451  //Change reference for each wire and store the new t0s in the new map
452  for (DTT0::const_iterator tzero = t0sRelative->begin(); tzero != t0sRelative->end(); ++tzero) {
453  int channelId = tzero->channelId;
454  if (channelId == 0)
455  continue;
456  DTWireId wireId(channelId);
457  DTChamberId chamberId(wireId.chamberId());
458  //double t0mean = (tzero->t0mean) - (sumT0ByChamber[chamberId]/countT0ByChamber[chamberId]);
459  //double t0rms = tzero->t0rms;
460  // @@@ better DTT0 usage
461  float t0mean_f;
462  float t0rms_f;
463  t0sRelative->get(wireId, t0mean_f, t0rms_f, DTTimeUnits::counts);
464  double t0mean = t0mean_f - (sumT0ByChamber[chamberId] / countT0ByChamber[chamberId]);
465  double t0rms = t0rms_f;
466  // @@@ NEW DTT0 END
467  t0sWRTChamber->set(wireId, t0mean, t0rms, DTTimeUnits::counts);
468  edm::LogVerbatim("DTCalibration") << "Changing t0 of wire " << wireId << " from " << t0mean_f << " to " << t0mean;
469  }
470  }
471 
473  if (debug)
474  edm::LogVerbatim("DTCalibration") << "[DTT0CalibrationRMS]Writing values in DB!";
475  // FIXME: to be read from cfg?
476  string t0Record = "DTT0Rcd";
477  // Write the t0 map to DB
479  DTCalibDBUtils::writeToDB(t0Record, t0sWRTChamber);
480  else
481  DTCalibDBUtils::writeToDB(t0Record, t0sAbsolute);
482 }
483 
484 string DTT0CalibrationRMS::getHistoName(const DTWireId& wId) const {
485  string histoName = "Ch_" + std::to_string(wId.wheel()) + "_" + std::to_string(wId.station()) + "_" +
486  std::to_string(wId.sector()) + "_SL" + std::to_string(wId.superlayer()) + "_L" +
487  std::to_string(wId.layer()) + "_W" + std::to_string(wId.wire()) + "_hT0Histo";
488  return histoName;
489 }
490 
491 string DTT0CalibrationRMS::getHistoName(const DTLayerId& lId) const {
492  string histoName = "Ch_" + std::to_string(lId.wheel()) + "_" + std::to_string(lId.station()) + "_" +
493  std::to_string(lId.sector()) + "_SL" + std::to_string(lId.superlayer()) + "_L" +
494  std::to_string(lId.layer()) + "_hT0Histo";
495  return histoName;
496 }
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
Definition: DTT0.cc:97
Log< level::Info, true > LogVerbatim
int station() const
Return the station number.
Definition: DTChamberId.h:42
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
std::map< DTWireId, double > theAbsoluteT0PerWire
static void writeToDB(std::string record, const T &payload)
void endJob() override
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
int wire() const
Return the wire number.
Definition: DTWireId.h:42
std::map< DTWireId, double > qK
std::map< DTWireId, double > mK
std::map< DTWireId, int > nDigiPerWire
const_iterator end() const
Definition: DTT0.cc:147
std::map< std::string, double > theSigmaT0LayerMap
std::string getHistoName(const DTWireId &wId) const
std::string to_string(const V &value)
Definition: OMSAccess.h:71
edm::ESHandle< DTGeometry > dtGeom
std::map< DTWireId, TH1I * > theHistoWireMap
unsigned int rejectDigiFromPeak
std::vector< DTWireId > wireIdWithHistos
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::string theCalibSector
std::vector< DTT0Data >::const_iterator const_iterator
Access methods to data.
Definition: DTT0.h:122
unsigned int eventsForWireT0
const_iterator begin() const
Definition: DTT0.cc:145
std::map< std::string, double > theT0LayerMap
std::map< DTWireId, TH1I * > theHistoWireMap_ref
std::map< DTWireId, double > mK_ref
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
Definition: DTT0.h:48
DTChamberId chamberId() const
Return the corresponding ChamberId.
~DTT0CalibrationRMS() override
Destructor.
unsigned int eventsForLayerT0
T sqrt(T t)
Definition: SSEVec.h:19
std::map< DTLayerId, TH1I * > theHistoLayerMap
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< DTDigiCollection > digiToken
std::map< DTWireId, double > theSigmaT0PerWire
int superlayer() const
Return the superlayer number (deprecated method name)
uint8_t channelId(const VFATFrame &frame)
retrieve this channel identifier
std::pair< const_iterator, const_iterator > Range
std::vector< std::string > cellsWithHistos
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float &t0mean, float &t0rms, DTTimeUnits::type unit) const
Definition: DTT0.cc:48
std::vector< DigiType >::const_iterator const_iterator
DTT0CalibrationRMS(const edm::ParameterSet &pset)
Constructor.
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
std::map< DTWireId, double > theRelativeT0PerWire
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
HLT enums.
int sector() const
Definition: DTChamberId.h:49
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_
static const double tzero[3]
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
Fill the maps with t0 (by channel)
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
std::map< DTWireId, int > nDigiPerWire_ref
Definition: event.py:1
const std::vector< const DTSuperLayer * > & superLayers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:86