CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTT0Calibration.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2012/02/17 16:39:06 $
5  * $Revision: 1.11.2.1 $
6  * \author S. Bolognesi - INFN Torino
7  */
10 
13 
16 
19 
20 #include "TH1I.h"
21 #include "TFile.h"
22 #include "TKey.h"
23 
24 using namespace std;
25 using namespace edm;
26 // using namespace cond;
27 
28 // Constructor
30  // Get the debug parameter for verbose output
31  debug = pset.getUntrackedParameter<bool>("debug");
32  if(debug)
33  cout << "[DTT0Calibration]Constructor called!" << endl;
34 
35  // Get the label to retrieve digis from the event
36  digiLabel = pset.getUntrackedParameter<string>("digiLabel");
37 
38  // The root file which contain the histos per layer
39  string rootFileName = pset.getUntrackedParameter<string>("rootFileName","DTT0PerLayer.root");
40  theFile = new TFile(rootFileName.c_str(), "RECREATE");
41 
42  theCalibWheel = pset.getUntrackedParameter<string>("calibWheel", "All"); //FIXME amke a vector of integer instead of a string
43  if(theCalibWheel != "All") {
44  stringstream linestr;
45  int selWheel;
46  linestr << theCalibWheel;
47  linestr >> selWheel;
48  cout << "[DTT0CalibrationPerLayer] chosen wheel " << selWheel << endl;
49  }
50 
51  // Sector/s to calibrate
52  theCalibSector = 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  cout << "[DTT0CalibrationPerLayer] chosen sector " << selSector << endl;
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=0;
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 }
82 
83 // Destructor
85  if(debug)
86  cout << "[DTT0Calibration]Destructor called!" << endl;
87 
88  theFile->Close();
89 }
90 
92 void DTT0Calibration::analyze(const edm::Event & event, const edm::EventSetup& eventSetup) {
93  if(debug || event.id().event() % 500==0)
94  cout << "--- [DTT0Calibration] Analysing Event: #Run: " << event.id().run()
95  << " #Event: " << event.id().event() << endl;
96  nevents++;
97 
98  // Get the digis from the event
100  event.getByLabel(digiLabel, digis);
101 
102  // Get the DT Geometry
103  eventSetup.get<MuonGeometryRecord>().get(dtGeom);
104 
105  // Iterate through all digi collections ordered by LayerId
107  for (dtLayerIt = digis->begin();
108  dtLayerIt != digis->end();
109  ++dtLayerIt){
110  // Get the iterators over the digis associated with this LayerId
111  const DTDigiCollection::Range& digiRange = (*dtLayerIt).second;
112 
113  // Get the layerId
114  const DTLayerId layerId = (*dtLayerIt).first; //FIXME: check to be in the right sector
115 
116  if((theCalibWheel != "All") && (layerId.superlayerId().chamberId().wheel() != selWheel))
117  continue;
118  if((theCalibSector != "All") && (layerId.superlayerId().chamberId().sector() != selSector))
119  continue;
120 
121  //if(debug) {
122  // cout << "Layer " << layerId<<" with "<<distance(digiRange.first, digiRange.second)<<" digi"<<endl;
123  //}
124 
125  // Loop over all digis in the given layer
126  for (DTDigiCollection::const_iterator digi = digiRange.first;
127  digi != digiRange.second;
128  digi++) {
129  double t0 = (*digi).countsTDC();
130 
131  //Use first bunch of events to fill t0 per layer
132  if(nevents < eventsForLayerT0){
133  //Get the per-layer histo from the map
134  TH1I *hT0LayerHisto = theHistoLayerMap[layerId];
135  //If it doesn't exist, book it
136  if(hT0LayerHisto == 0){
137  theFile->cd();
138  hT0LayerHisto = new TH1I(getHistoName(layerId).c_str(),
139  "T0 from pulses by layer (TDC counts, 1 TDC count = 0.781 ns)",
140  200, t0-100, t0+100);
141  if(debug)
142  cout << " New T0 per Layer Histo: " << hT0LayerHisto->GetName() << endl;
143  theHistoLayerMap[layerId] = hT0LayerHisto;
144  }
145 
146  //Fill the histos
147  theFile->cd();
148  if(hT0LayerHisto != 0) {
149  // if(debug)
150  // cout<<"Filling histo "<<hT0LayerHisto->GetName()<<" with digi "<<t0<<" TDC counts"<<endl;
151  hT0LayerHisto->Fill(t0);
152  }
153  }
154 
155  //Use all the remaining events to compute t0 per wire
156  if(nevents>eventsForLayerT0){
157  // Get the wireId
158  const DTWireId wireId(layerId, (*digi).wire());
159  if(debug) {
160  cout << " Wire: " << wireId << endl
161  << " time (TDC counts): " << (*digi).countsTDC()<< endl;
162  }
163 
164  //Fill the histos per wire for the chosen cells
165  vector<DTWireId>::iterator it_wire = find(wireIdWithHistos.begin(),wireIdWithHistos.end(),wireId);
166  if(it_wire != wireIdWithHistos.end()){
167  if(theHistoWireMap.find(wireId) == theHistoWireMap.end()){
168  theHistoWireMap[wireId] = new TH1I(getHistoName(wireId).c_str(),"T0 from pulses by wire (TDC counts, 1 TDC count = 0.781 ns)",7000,0,7000);
169  if(debug) cout << " New T0 per wire Histo: " << (theHistoWireMap[wireId])->GetName() << endl;
170  }
171  if(theHistoWireMap_ref.find(wireId) == theHistoWireMap_ref.end()){
172  theHistoWireMap_ref[wireId] = new TH1I((getHistoName(wireId) + "_ref").c_str(),"T0 from pulses by wire (TDC counts, 1 TDC count = 0.781 ns)",7000,0,7000);
173  if(debug) cout << " New T0 per wire Histo: " << (theHistoWireMap_ref[wireId])->GetName() << endl;
174  }
175 
176  TH1I* hT0WireHisto = theHistoWireMap[wireId];
177  //Fill the histos
178  theFile->cd();
179  if(hT0WireHisto) hT0WireHisto->Fill(t0);
180  }
181 
182  //Check the tzero has reasonable value
183  if(abs(hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin()) - t0) > rejectDigiFromPeak){
184  if(debug)
185  cout<<"digi skipped because t0 per sector "<<hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin())<<endl;
186  continue;
187  }
188 
189  //Use second bunch of events to compute a t0 reference per wire
190  if(nevents< (eventsForLayerT0 + eventsForWireT0)){
191  //Fill reference wire histos
192  if(it_wire != wireIdWithHistos.end()){
193  TH1I* hT0WireHisto_ref = theHistoWireMap_ref[wireId];
194  theFile->cd();
195  if(hT0WireHisto_ref) hT0WireHisto_ref->Fill(t0);
196  }
197  if(!nDigiPerWire_ref[wireId]){
198  mK_ref[wireId] = 0;
199  }
200  nDigiPerWire_ref[wireId] = nDigiPerWire_ref[wireId] + 1;
201  mK_ref[wireId] = mK_ref[wireId] + (t0-mK_ref[wireId])/nDigiPerWire_ref[wireId];
202  }
203  //Use last all the remaining events to compute the mean and sigma t0 per wire
204  else if(nevents>(eventsForLayerT0 + eventsForWireT0)){
205  if(abs(t0-mK_ref[wireId]) > tpPeakWidth)
206  continue;
207  if(!nDigiPerWire[wireId]){
208  theAbsoluteT0PerWire[wireId] = 0;
209  qK[wireId] = 0;
210  mK[wireId] = 0;
211  }
212  nDigiPerWire[wireId] = nDigiPerWire[wireId] + 1;
213  theAbsoluteT0PerWire[wireId] = theAbsoluteT0PerWire[wireId] + t0;
214  //theSigmaT0PerWire[wireId] = theSigmaT0PerWire[wireId] + (t0*t0);
215  qK[wireId] = qK[wireId] + ((nDigiPerWire[wireId]-1)*(t0-mK[wireId])*(t0-mK[wireId])/nDigiPerWire[wireId]);
216  mK[wireId] = mK[wireId] + (t0-mK[wireId])/nDigiPerWire[wireId];
217  }
218  }//end if(nevents>1000)
219  }//end loop on digi
220  }//end loop on layer
221 
222  //Use the t0 per layer histos to have an indication about the t0 position
223  if(nevents == eventsForLayerT0){
224  for(map<DTLayerId, TH1I*>::const_iterator lHisto = theHistoLayerMap.begin();
225  lHisto != theHistoLayerMap.end();
226  lHisto++){
227  if(debug)
228  cout<<"Reading histogram "<<(*lHisto).second->GetName()<<" with mean "<<(*lHisto).second->GetMean()<<" and RMS "<<(*lHisto).second->GetRMS();
229 
230  //Take the mean as a first t0 estimation
231  if((*lHisto).second->GetRMS()<5.0){
232  if(hT0SectorHisto == 0){
233  hT0SectorHisto = new TH1D("hT0AllLayerOfSector","T0 from pulses per layer in sector",
234  //20, (*lHisto).second->GetMean()-100, (*lHisto).second->GetMean()+100);
235  700, 0, 7000);
236  }
237  if(debug)
238  cout<<" accepted"<<endl;
239  hT0SectorHisto->Fill((*lHisto).second->GetMean());
240  }
241  //Take the mean of noise + 400ns as a first t0 estimation
242  // if((*lHisto).second->GetRMS()>10.0 && ((*lHisto).second->GetRMS()<15.0)){
243 // double t0_estim = (*lHisto).second->GetMean() + 400;
244 // if(hT0SectorHisto == 0){
245 // hT0SectorHisto = new TH1D("hT0AllLayerOfSector","T0 from pulses per layer in sector",
246 // //20, t0_estim-100, t0_estim+100);
247 // 700, 0, 7000);
248 // }
249 // if(debug)
250 // cout<<" accepted + 400ns"<<endl;
251 // hT0SectorHisto->Fill((*lHisto).second->GetMean() + 400);
252 // }
253  if(debug)
254  cout<<endl;
255 
256  theT0LayerMap[(*lHisto).second->GetName()] = (*lHisto).second->GetMean();
257  theSigmaT0LayerMap[(*lHisto).second->GetName()] = (*lHisto).second->GetRMS();
258  }
259  if(!hT0SectorHisto){
260  cout<<"[DTT0Calibration]: All the t0 per layer are still uncorrect: trying with greater number of events"<<endl;
261  eventsForLayerT0 = eventsForLayerT0*2;
262  return;
263  }
264  if(debug)
265  cout<<"[DTT0Calibration] t0 reference for this sector "<<
266  hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin())<<endl;
267  }
268 }
269 
270 
272 
273  DTT0* t0s = new DTT0();
274  DTT0* t0sWRTChamber = new DTT0();
275 
276  if(debug)
277  cout << "[DTT0CalibrationPerLayer]Writing histos to file!" << endl;
278 
279  theFile->cd();
280  hT0SectorHisto->Write();
281  for(map<DTWireId, TH1I*>::const_iterator wHisto = theHistoWireMap.begin();
282  wHisto != theHistoWireMap.end();
283  wHisto++) {
284  (*wHisto).second->Write();
285  }
286  for(map<DTWireId, TH1I*>::const_iterator wHisto = theHistoWireMap_ref.begin();
287  wHisto != theHistoWireMap_ref.end();
288  wHisto++) {
289  (*wHisto).second->Write();
290  }
291  for(map<DTLayerId, TH1I*>::const_iterator lHisto = theHistoLayerMap.begin();
292  lHisto != theHistoLayerMap.end();
293  lHisto++) {
294  (*lHisto).second->Write();
295  }
296 
297  if(debug)
298  cout << "[DTT0Calibration] Compute and store t0 and sigma per wire" << endl;
299 
300  for(map<DTWireId, double>::const_iterator wiret0 = theAbsoluteT0PerWire.begin();
301  wiret0 != theAbsoluteT0PerWire.end();
302  wiret0++){
303  if(nDigiPerWire[(*wiret0).first]){
304  double t0 = (*wiret0).second/nDigiPerWire[(*wiret0).first];
305  theRelativeT0PerWire[(*wiret0).first] = t0 - hT0SectorHisto->GetBinCenter(hT0SectorHisto->GetMaximumBin());
306  cout<<"Wire "<<(*wiret0).first<<" has t0 "<<t0<<"(absolute) "<<theRelativeT0PerWire[(*wiret0).first]<<"(relative)";
307 
308  //theSigmaT0PerWire[(*wiret0).first] = sqrt((theSigmaT0PerWire[(*wiret0).first] / nDigiPerWire[(*wiret0).first]) - t0*t0);
309  theSigmaT0PerWire[(*wiret0).first] = sqrt(qK[(*wiret0).first]/nDigiPerWire[(*wiret0).first]);
310  cout<<" sigma "<<theSigmaT0PerWire[(*wiret0).first]<<endl;
311  }
312  else{
313  cout<<"[DTT0Calibration] ERROR: no digis in wire "<<(*wiret0).first<<endl;
314  abort();
315  }
316  }
317 
319  // Get all the sls from the setup
320  const vector<DTSuperLayer*> superLayers = dtGeom->superLayers();
321  // Loop over all SLs
322  for(vector<DTSuperLayer*>::const_iterator sl = superLayers.begin();
323  sl != superLayers.end(); sl++) {
324 
325 
326  //Compute mean for odd and even superlayers
327  double oddLayersMean=0;
328  double evenLayersMean=0;
329  double oddLayersDen=0;
330  double evenLayersDen=0;
331  for(map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
332  wiret0 != theRelativeT0PerWire.end();
333  wiret0++){
334  if((*wiret0).first.layerId().superlayerId() == (*sl)->id()){
335  if(debug)
336  cout<<"[DTT0Calibration] Superlayer "<<(*sl)->id()
337  <<"layer " <<(*wiret0).first.layerId().layer()<<" with "<<(*wiret0).second<<endl;
338  if(((*wiret0).first.layerId().layer()) % 2){
339  oddLayersMean = oddLayersMean + (*wiret0).second;
340  oddLayersDen++;
341  }
342  else{
343  evenLayersMean = evenLayersMean + (*wiret0).second;
344  evenLayersDen++;
345  }
346  }
347  }
348  oddLayersMean = oddLayersMean/oddLayersDen;
349  evenLayersMean = evenLayersMean/evenLayersDen;
350  if(debug && oddLayersMean)
351  cout<<"[DTT0Calibration] Relative T0 mean for odd layers "<<oddLayersMean<<" even layers"<<evenLayersMean<<endl;
352 
353  //Compute sigma for odd and even superlayers
354  double oddLayersSigma=0;
355  double evenLayersSigma=0;
356  for(map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
357  wiret0 != theRelativeT0PerWire.end();
358  wiret0++){
359  if((*wiret0).first.layerId().superlayerId() == (*sl)->id()){
360  if(((*wiret0).first.layerId().layer()) % 2){
361  oddLayersSigma = oddLayersSigma + ((*wiret0).second - oddLayersMean) * ((*wiret0).second - oddLayersMean);
362  }
363  else{
364  evenLayersSigma = evenLayersSigma + ((*wiret0).second - evenLayersMean) * ((*wiret0).second - evenLayersMean);
365  }
366  }
367  }
368  oddLayersSigma = oddLayersSigma/oddLayersDen;
369  evenLayersSigma = evenLayersSigma/evenLayersDen;
370  oddLayersSigma = sqrt(oddLayersSigma);
371  evenLayersSigma = sqrt(evenLayersSigma);
372 
373  if(debug && oddLayersMean)
374  cout<<"[DTT0Calibration] Relative T0 sigma for odd layers "<<oddLayersSigma<<" even layers"<<evenLayersSigma<<endl;
375 
376  //Recompute the mean for odd and even superlayers discarding fluctations
377  double oddLayersFinalMean=0;
378  double evenLayersFinalMean=0;
379  for(map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
380  wiret0 != theRelativeT0PerWire.end();
381  wiret0++){
382  if((*wiret0).first.layerId().superlayerId() == (*sl)->id()){
383  if(((*wiret0).first.layerId().layer()) % 2){
384  if(abs((*wiret0).second - oddLayersMean) < (2*oddLayersSigma))
385  oddLayersFinalMean = oddLayersFinalMean + (*wiret0).second;
386  }
387  else{
388  if(abs((*wiret0).second - evenLayersMean) < (2*evenLayersSigma))
389  evenLayersFinalMean = evenLayersFinalMean + (*wiret0).second;
390  }
391  }
392  }
393  oddLayersFinalMean = oddLayersFinalMean/oddLayersDen;
394  evenLayersFinalMean = evenLayersFinalMean/evenLayersDen;
395  if(debug && oddLayersMean)
396  cout<<"[DTT0Calibration] Final relative T0 mean for odd layers "<<oddLayersFinalMean<<" even layers"<<evenLayersFinalMean<<endl;
397 
398  for(map<DTWireId, double>::const_iterator wiret0 = theRelativeT0PerWire.begin();
399  wiret0 != theRelativeT0PerWire.end();
400  wiret0++){
401  if((*wiret0).first.layerId().superlayerId() == (*sl)->id()){
402  double t0=-999;
403  if(((*wiret0).first.layerId().layer()) % 2)
404  t0 = (*wiret0).second + (evenLayersFinalMean - oddLayersFinalMean);
405  else
406  t0 = (*wiret0).second;
407 
408  cout<<"[DTT0Calibration] Wire "<<(*wiret0).first<<" has t0 "<<(*wiret0).second<<" (relative, after even-odd layer corrections) "
409  <<" sigma "<<theSigmaT0PerWire[(*wiret0).first]<<endl;
410  //Store the results into DB
411  t0s->set((*wiret0).first, t0, theSigmaT0PerWire[(*wiret0).first],DTTimeUnits::counts);
412  }
413  }
414  }
415 
417  if(debug)
418  cout << "[DTT0Calibration]Computing relative t0 wrt to chamber average" << endl;
419  //Compute the reference for each chamber
420  map<DTChamberId,double> sumT0ByChamber;
421  map<DTChamberId,int> countT0ByChamber;
422  for(DTT0::const_iterator tzero = t0s->begin();
423  tzero != t0s->end(); tzero++) {
424 // @@@ NEW DTT0 FORMAT
425 // DTChamberId chamberId((*tzero).first.wheelId,
426 // (*tzero).first.stationId,
427 // (*tzero).first.sectorId);
428 // sumT0ByChamber[chamberId] = sumT0ByChamber[chamberId] + (*tzero).second.t0mean;
429  int channelId = tzero->channelId;
430  if ( channelId == 0 ) continue;
431  DTWireId wireId(channelId);
432  DTChamberId chamberId(wireId.chamberId());
433  sumT0ByChamber[chamberId] = sumT0ByChamber[chamberId] + tzero->t0mean;
434 // @@@ better DTT0 usage
435  float t0mean_f;
436  float t0rms_f;
437  t0s->get(wireId,t0mean_f,t0rms_f,DTTimeUnits::counts);
438  sumT0ByChamber[chamberId] = sumT0ByChamber[chamberId] + t0mean_f;
439 // @@@ NEW DTT0 END
440  countT0ByChamber[chamberId]++;
441  }
442 
443  //Change reference for each wire and store the new t0s in the new map
444  for(DTT0::const_iterator tzero = t0s->begin();
445  tzero != t0s->end(); tzero++) {
446 // @@@ NEW DTT0 FORMAT
447 // DTChamberId chamberId((*tzero).first.wheelId,
448 // (*tzero).first.stationId,
449 // (*tzero).first.sectorId);
450 // double t0mean = ((*tzero).second.t0mean) - (sumT0ByChamber[chamberId]/countT0ByChamber[chamberId]);
451 // double t0rms = (*tzero).second.t0rms;
452 // DTWireId wireId((*tzero).first.wheelId,
453 // (*tzero).first.stationId,
454 // (*tzero).first.sectorId,
455 // (*tzero).first.slId,
456 // (*tzero).first.layerId,
457 // (*tzero).first.cellId);
458  int channelId = tzero->channelId;
459  if ( channelId == 0 ) continue;
460  DTWireId wireId(channelId);
461  DTChamberId chamberId(wireId.chamberId());
462  double t0mean = (tzero->t0mean) - (sumT0ByChamber[chamberId]/countT0ByChamber[chamberId]);
463  double t0rms = tzero->t0rms;
464 // @@@ better DTT0 usage
465  float t0mean_f;
466  float t0rms_f;
467  t0s->get(wireId,t0mean_f,t0rms_f,DTTimeUnits::counts);
468  t0mean = t0mean_f - (sumT0ByChamber[chamberId]/countT0ByChamber[chamberId]);
469  t0rms = t0rms_f;
470 // @@@ NEW DTT0 END
471  t0sWRTChamber->set(wireId,
472  t0mean,
473  t0rms,
475  if(debug){
476  //cout<<"Chamber "<<chamberId<<" has reference "<<(sumT0ByChamber[chamberId]/countT0ByChamber[chamberId]);
477 // cout<<"Changing t0 of wire "<<wireId<<" from "<<(*tzero).second.t0mean<<" to "<<t0mean<<endl;
478  cout<<"Changing t0 of wire "<<wireId<<" from "<<tzero->t0mean<<" to "<<t0mean<<endl;
479  }
480  }
481 
483  if(debug)
484  cout << "[DTT0Calibration]Writing values in DB!" << endl;
485  // FIXME: to be read from cfg?
486  string t0Record = "DTT0Rcd";
487  // Write the t0 map to DB
488  DTCalibDBUtils::writeToDB(t0Record, t0sWRTChamber);
489 }
490 
491 string DTT0Calibration::getHistoName(const DTWireId& wId) const {
492  string histoName;
493  stringstream theStream;
494  theStream << "Ch_" << wId.wheel() << "_" << wId.station() << "_" << wId.sector()
495  << "_SL" << wId.superlayer() << "_L" << wId.layer() << "_W"<< wId.wire() <<"_hT0Histo";
496  theStream >> histoName;
497  return histoName;
498 }
499 
500 string DTT0Calibration::getHistoName(const DTLayerId& lId) const {
501  string histoName;
502  stringstream theStream;
503  theStream << "Ch_" << lId.wheel() << "_" << lId.station() << "_" << lId.sector()
504  << "_SL" << lId.superlayer() << "_L" << lId.layer() <<"_hT0Histo";
505  theStream >> histoName;
506  return histoName;
507 }
508 
const_iterator begin() const
Definition: DTT0.cc:206
RunNumber_t run() const
Definition: EventID.h:42
int set(int wheelId, int stationId, int sectorId, int slId, int layerId, int cellId, float t0mean, float t0rms, DTTimeUnits::type unit)
Definition: DTT0.cc:142
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
DTChamberId chamberId() const
Return the corresponding ChamberId.
#define abs(x)
Definition: mlp_lapack.h:159
std::string getHistoName(const DTWireId &wId) const
int layer() const
Return the layer number.
Definition: DTLayerId.h:55
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:61
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
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:69
std::vector< DTT0Data >::const_iterator const_iterator
Access methods to data.
Definition: DTT0.h:139
Definition: DTT0.h:52
T sqrt(T t)
Definition: SSEVec.h:46
virtual ~DTT0Calibration()
Destructor.
void endJob()
Compute the mean and the RMS of the t0 from the maps and write them to the DB with channel granularit...
int nevents
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int wire() const
Return the wire number.
Definition: DTWireId.h:58
const_iterator end() const
Definition: DTT0.cc:211
int superlayer() const
Return the superlayer number (deprecated method name)
const T & get() const
Definition: EventSetup.h:55
std::vector< DigiType >::const_iterator const_iterator
edm::EventID id() const
Definition: EventBase.h:56
int sector() const
Definition: DTChamberId.h:63
static const double tzero[3]
std::pair< const_iterator, const_iterator > Range
tuple cout
Definition: gather_cfg.py:121
int station() const
Return the station number.
Definition: DTChamberId.h:53
DTT0Calibration(const edm::ParameterSet &pset)
Constructor.
#define debug
Definition: MEtoEDMFormat.h:34
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:47
static void writeToDB(std::string record, T *payload)
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
Fill the maps with t0 (by channel)