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::map;
13 using std::vector;
14 using std::cout;
15 using std::endl;
16 
17 
19 
21 
22 
23 float DTRecoUncertainties::get(const DTWireId& wireid, unsigned int index) const {
24  // FIXME: what to do in case the superlayerId is not found in the map?
25  // FIXME: any check on the type?
26  map<uint32_t, vector<float> >::const_iterator slIt = payload.find(wireid.superlayerId().rawId());
27  if(slIt == payload.end()) {
28  cout << "[DTRecoUncertainties]***Error: the SLId: " << wireid.superlayerId() << " is not in the paylaod map!" << endl;
29  // FIXME: what to do here???
30  return -1.;
31  } else if(vector<float>::size_type(index) >= (*slIt).second.size()) {
32  cout << "[DTRecoUncertainties]***Error: requesting parameter index: " << index << " for vector of size " << (*slIt).second.size() << endl;
33  // FIXME: what to do here???
34  return -1.;
35  }
36 
37 
38  return (*slIt).second[index];
39 }
40 
41 
42 void DTRecoUncertainties::set(const DTWireId& wireid, const std::vector<float>& values) {
43  payload[wireid.superlayerId()] = values;
44 }
45 
46 
48  return payload.begin();
49 }
50 
52  return payload.end();
53 }
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...
const_iterator begin() const
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:59
uint16_t size_type
uint32_t rawId() const
get the raw id
Definition: DetId.h:44
virtual ~DTRecoUncertainties()
Destructor.
std::map< uint32_t, std::vector< float > >::const_iterator const_iterator
Access methods to data.
std::map< uint32_t, std::vector< float > > payload
const_iterator end() const
void set(const DTWireId &wireid, const std::vector< float > &values)
fills the map
DTRecoUncertainties()
Constructor.