34 doT0Correction = config.
getParameter<
bool>(
"doT0Correction");
36 doTOFCorrection = config.
getParameter<
bool>(
"doTOFCorrection");
37 theTOFCorrType = config.
getParameter<
int>(
"tofCorrType");
39 doWirePropCorrection = config.
getParameter<
bool>(
"doWirePropCorrection");
40 theWirePropCorrType = config.
getParameter<
int>(
"wirePropCorrType");
44 thetTrigLabel = config.
getParameter<
string>(
"tTrigLabel");
59 tZeroMap = &*t0Handle;
61 cout <<
"[DTTTrigSyncFromDB] t0 version: " << tZeroMap->version()<<endl;
68 tTrigMap = &*ttrigHandle;
70 cout <<
"[DTTTrigSyncFromDB] ttrig version: " << tTrigMap->version() << endl;
91 if(doWirePropCorrection) {
92 switch(theWirePropCorrType){
97 float wireCoord = layer->
toLocal(globPos).
y();
98 wirePropCorr = -wireCoord/theVPropWire;
105 float wireCoord = layer->
toLocal(globPos).
y();
106 float propgL = halfL - wireCoord;
107 wirePropCorr = propgL/theVPropWire;
112 cms::Exception(
"[DTTTrigSyncFromDB]") <<
" Invalid parameter: wirePropCorrType = "
113 << theWirePropCorrType
123 if(doTOFCorrection) {
124 float flightToHit = globPos.
mag();
125 static const float cSpeed = 29.9792458;
126 switch(theTOFCorrType) {
135 tofCorr = (flightToSL-flightToHit)/cSpeed;
144 tofCorr = (flightToWire-flightToHit)/cSpeed;
149 cms::Exception(
"[DTTTrigSyncFromDB]") <<
" Invalid parameter: tofCorrType = "
159 cout <<
"[DTTTrigSyncFromDB] Channel: " << wireId << endl
160 <<
" Offset (ns): " << tTrig + wirePropCorr - tofCorr << endl
161 <<
" various contributions are: " << endl
162 <<
" tTrig + t0 (ns): " << tTrig << endl
164 <<
" Propagation along wire delay (ns): " << wirePropCorr << endl
165 <<
" TOF correction (ns): " << tofCorr << endl
169 return tTrig + wirePropCorr - tofCorr;
178 tZeroMap->get(wireId,
187 float ttrigSigma = 0;
195 cout <<
"[DTTTrigSyncFromDB]*Error: ttrig not found for SL: " << wireId.
superlayerId() << endl;
199 return t0 + ttrigMean + kFactor * ttrigSigma;
216 tZeroMap->get(wireId,
225 float ttrigSigma = 0;
233 cout <<
"[DTTTrigSyncFromDB]*Error: ttrig not found for SL: " << wireId.
superlayerId() << endl;
237 tTrig = ttrigMean + kFactor * ttrigSigma;
240 return int(tTrig/theBXspace)*theBXspace + t0cell;
virtual ~DTTTrigSyncFromDB()
Destructor.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
const DTTopology & specificTopology() const
unsigned int offset(bool)
virtual double offset(const DTLayer *layer, const DTWireId &wireId, const GlobalPoint &globPos, double &tTrig, double &wirePropCorr, double &tofCorr)
virtual void setES(const edm::EventSetup &setup)
Pass the Event Setup to the algo at each event.
int wire() const
Return the wire number.
const DTSuperLayer * superLayer() const
virtual double emulatorOffset(const DTWireId &wireId, double &tTrig, double &t0cell)
const BoundPlane & surface() const
The nominal surface of the GeomDet.
DTTTrigSyncFromDB(const edm::ParameterSet &config)
Constructor.
const PositionType & position() const
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")