CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTTTrigSyncT0Only.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2009/10/21 17:05:47 $
5  * $Revision: 1.6 $
6  * \author G. Cerminara - INFN Torino
7  */
8 
9 #include "DTTTrigSyncT0Only.h"
10 
11 
18 
19 #include <iostream>
20 
21 using namespace std;
22 using namespace edm;
23 
24 
26  debug = config.getUntrackedParameter<bool>("debug");
27 }
28 
29 
30 
32 
33 
34 
36  ESHandle<DTT0> t0;
37  setup.get<DTT0Rcd>().get(t0);
38  tZeroMap = &*t0;
39 
40  if(debug) {
41  cout << "[DTTTrigSyncT0Only] T0 version: " << t0->version() << endl;
42  }
43 }
44 
45 
46 
47 
48 double DTTTrigSyncT0Only::offset(const DTLayer* layer,
49  const DTWireId& wireId,
50  const GlobalPoint& globPos,
51  double& tTrig,
52  double& wirePropCorr,
53  double& tofCorr) {
54  tTrig = offset(wireId);
55  wirePropCorr = 0;
56  tofCorr = 0;
57 
58  if(debug) {
59  cout << "[DTTTrigSyncT0Only] Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl
60  << " various contributions are: " << endl
61  //<< " tZero (ns): " << t0 << endl
62  << " Propagation along wire delay (ns): " << wirePropCorr << endl
63  << " TOF correction (ns): " << tofCorr << endl
64  << endl;
65  }
66  //The global offset is the sum of various contributions
67  return tTrig + wirePropCorr - tofCorr;
68 }
69 
70 double DTTTrigSyncT0Only::offset(const DTWireId& wireId) {
71  float t0 = 0;
72  float t0rms = 0;
73  tZeroMap->get(wireId,
74  t0,
75  t0rms,
77 
78  return t0;
79 }
80 
81 
82 // Set the verbosity level
84 
85 
87  double &tTrig,
88  double &t0cell) {
89  tTrig = 0.;
90  t0cell = 0.;
91  return 0.;
92 }
93 
94 
95 
T getUntrackedParameter(std::string const &, T const &) const
virtual ~DTTTrigSyncT0Only()
Destructor.
virtual void setES(const edm::EventSetup &setup)
Pass the Event Setup to the algo at each event.
DTTTrigSyncT0Only(const edm::ParameterSet &config)
Constructor.
virtual double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr)
unsigned int offset(bool)
const T & get() const
Definition: EventSetup.h:55
Definition: DTT0Rcd.h:9
tuple cout
Definition: gather_cfg.py:121
virtual double emulatorOffset(const DTWireId &wireId, double &tTrig, double &t0cell)
#define debug
Definition: MEtoEDMFormat.h:34
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")