CMS 3D CMS Logo

DTTTrigSyncT0Only.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author G. Cerminara - INFN Torino
5  */
6 
7 #include "DTTTrigSyncT0Only.h"
8 
15 
16 #include <iostream>
17 
18 using namespace std;
19 using namespace edm;
20 
21 DTTTrigSyncT0Only::DTTTrigSyncT0Only(const ParameterSet& config) : debug(config.getUntrackedParameter<bool>("debug")) {}
22 
24 
27  setup.get<DTT0Rcd>().get(t0);
28  tZeroMap = &*t0;
29 
30  if (debug) {
31  cout << "[DTTTrigSyncT0Only] T0 version: " << t0->version() << endl;
32  }
33 }
34 
35 double DTTTrigSyncT0Only::offset(const DTLayer* layer,
36  const DTWireId& wireId,
37  const GlobalPoint& globPos,
38  double& tTrig,
39  double& wirePropCorr,
40  double& tofCorr) const {
41  tTrig = offset(wireId);
42  wirePropCorr = 0;
43  tofCorr = 0;
44 
45  if (debug) {
46  cout << "[DTTTrigSyncT0Only] Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl
47  << " various contributions are: "
48  << endl
49  //<< " tZero (ns): " << t0 << endl
50  << " Propagation along wire delay (ns): " << wirePropCorr << endl
51  << " TOF correction (ns): " << tofCorr << endl
52  << endl;
53  }
54  //The global offset is the sum of various contributions
55  return tTrig + wirePropCorr - tofCorr;
56 }
57 
58 double DTTTrigSyncT0Only::offset(const DTWireId& wireId) const {
59  float t0 = 0;
60  float t0rms = 0;
61  tZeroMap->get(wireId, t0, t0rms, DTTimeUnits::ns);
62 
63  return t0;
64 }
65 
66 double DTTTrigSyncT0Only::emulatorOffset(const DTWireId& wireId, double& tTrig, double& t0cell) const {
67  tTrig = 0.;
68  t0cell = 0.;
69  return 0.;
70 }
const DTT0 * tZeroMap
Definition: config.py:1
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
DTTTrigSyncT0Only(const edm::ParameterSet &config)
Constructor.
double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr) const override
void setES(const edm::EventSetup &setup) override
Pass the Event Setup to the algo at each event.
#define debug
Definition: HDRShower.cc:19
Definition: DTT0Rcd.h:9
~DTTTrigSyncT0Only() override
Destructor.
HLT enums.
T get() const
Definition: EventSetup.h:73
const std::string & version() const
access version
Definition: DTT0.cc:82
double emulatorOffset(const DTWireId &wireId, double &tTrig, double &t0cell) const override