CMS 3D CMS Logo

DTRecoUncertainties.cc
Go to the documentation of this file.
1 
2 /*
3  * See header file for a description of this class.
4  *
5  * \author G. Cerminara - CERN
6  */
7 
10 #include <iostream>
11 
12 using std::cout;
13 using std::endl;
14 using std::map;
15 using std::vector;
16 
18 
20 
21 float DTRecoUncertainties::get(const DTWireId& wireid, unsigned int index) const {
22  // FIXME: what to do in case the superlayerId is not found in the map?
23  // FIXME: any check on the type?
24  map<uint32_t, vector<float> >::const_iterator slIt = payload.find(wireid.superlayerId().rawId());
25  if (slIt == payload.end()) {
26  cout << "[DTRecoUncertainties]***Error: the SLId: " << wireid.superlayerId() << " is not in the paylaod map!"
27  << endl;
28  // FIXME: what to do here???
29  return -1.;
30  } else if (vector<float>::size_type(index) >= (*slIt).second.size()) {
31  cout << "[DTRecoUncertainties]***Error: requesting parameter index: " << index << " for vector of size "
32  << (*slIt).second.size() << endl;
33  // FIXME: what to do here???
34  return -1.;
35  }
36 
37  return (*slIt).second[index];
38 }
39 
40 void DTRecoUncertainties::set(const DTWireId& wireid, const std::vector<float>& values) {
41  payload[wireid.superlayerId()] = values;
42 }
43 
45 
const_iterator begin() const
const_iterator end() const
uint16_t size_type
virtual ~DTRecoUncertainties()
Destructor.
float get(const DTWireId &wireid, unsigned int index) const
get the uncertainties for the SL correspoding to the given WireId and for the correct step as defined...
std::map< uint32_t, std::vector< float > >::const_iterator const_iterator
Access methods to data.
std::map< uint32_t, std::vector< float > > payload
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void set(const DTWireId &wireid, const std::vector< float > &values)
fills the map
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:48
DTRecoUncertainties()
Constructor.