CMS 3D CMS Logo

SiStripCondObjBuilderFromDb.h
Go to the documentation of this file.
1 
2 #ifndef OnlineDB_SiStripESSources_SiStripCondObjBuilderFromDb_H
3 #define OnlineDB_SiStripESSources_SiStripCondObjBuilderFromDb_H
4 
10 
27 
28 #include <memory>
29 #include <vector>
30 #include <string>
31 #include <typeinfo>
32 #include <cstdint>
33 
34 class SiStripFecCabling;
35 class SiStripDetCabling;
36 class SiStripPedestals;
37 class SiStripNoises;
38 class SiStripQuality;
39 class SiStripThreshold;
40 class DcuDetIdMap;
41 class SiStripApvGain;
42 class SiStripLatency;
43 class TrackerTopology;
44 
46 public:
47  // Typedefs
48  typedef std::pair<uint32_t, FedChannelConnection> pair_apvpairconn;
49  typedef std::vector<pair_apvpairconn> v_apvpairconn;
50  typedef std::pair<uint32_t, v_apvpairconn> pair_detcon;
51  typedef std::vector<pair_detcon> trackercon;
52 
53  typedef std::vector<pair_detcon>::iterator i_trackercon;
54  typedef std::vector<pair_apvpairconn>::iterator i_apvpairconn;
55 
57  /* Class to hold the addresses of the devices to be skipped from gain update.
58  * 0 stands for all devices at this level.
59  * sistrip::invalid means this coordinate is not used. */
60  public:
63  bool isConsistent(const FedChannelConnection& fc) const;
64  std::string dump() const;
65 
66  private:
69  uint32_t detid_;
70  };
71 
75 
77 
79  inline const SiStripDbParams& dbParams() const { return db_->dbParams(); }
80 
83  void buildCondObj();
84  void buildStripRelatedObjects(SiStripConfigDb* const db, const SiStripDetCabling& det_cabling);
86  void buildFECRelatedObjects(SiStripConfigDb* const db, const trackercon& tc);
87  void buildFEDRelatedObjects(SiStripConfigDb* const db, const trackercon& tc);
88 
89  bool checkForCompatibility(std::stringstream& input, std::stringstream& output, std::string& label);
90  std::string getConfigString(const std::type_info& typeInfo);
91 
93  checkUpdate();
94  return fed_cabling_;
95  }
97  checkUpdate();
98  return pedestals_;
99  }
101  checkUpdate();
102  return noises_;
103  }
105  checkUpdate();
106  return threshold_;
107  }
109  checkUpdate();
110  return quality_;
111  }
113  checkUpdate();
114  return gain_;
115  }
117  checkUpdate();
118  return latency_;
119  }
120 
129 
130  void setLastIovGain(std::shared_ptr<SiStripApvGain> gain) { gain_last_ = gain; }
131 
132 protected:
133  void checkUpdate();
134 
136  // Build and retrieve SiStripConfigDb object using service
138 
148 
149  std::shared_ptr<SiStripApvGain> gain_last_; // last gain object in DB
150  std::vector<SkipDeviceDescription> skippedDevices; // devices to be skipped for gain update
151  std::vector<uint32_t> skippedDetIds;
152  std::vector<SkipDeviceDescription>
153  whitelistedDevices; // devices whitelist for gain update: will NOT be skipped, even if in the 'skip list'
154  std::vector<uint32_t> whitelistedDetIds;
155 
156  //methods used by BuildStripRelatedObjects
158  SiStripConfigDb* const db,
159  FedChannelConnection& ipair,
160  uint32_t detid,
161  uint16_t apvnr,
164  // bool setValuesCabling(SiStripConfigDb* const db, FedChannelConnection &ipair, uint32_t detid);
166  FedChannelConnection& ipair,
167  uint32_t detid);
170  vector<uint32_t> retrieveActiveDetIds(const SiStripDetCabling& det_cabling);
171  vector<const FedChannelConnection*> buildConnections(const SiStripDetCabling& det_cabling, uint32_t det_id);
172  uint16_t retrieveNumberAPVPairs(uint32_t det_id);
173 
174  //set and store data
175  void setDefaultValuesCabling(uint16_t apvPair);
176  void setDefaultValuesApvTiming(uint32_t detid, uint32_t apvPair);
178  const FedChannelConnection& ipair,
179  uint32_t detid,
180  uint16_t apvnr);
181  void storePedestals(uint32_t det_id);
182  void storeNoise(uint32_t det_id);
183  void storeThreshold(uint32_t det_id);
184  void storeQuality(uint32_t det_id);
185  void storeTiming(uint32_t det_id);
186 
187  // cfi input parameters
188  edm::VParameterSet m_skippedDevices; // VPset of devices to be skipped in tickmark update
190  m_whitelistedDevices; // VPset of whitelisted devices: will NOT be skipped in tickmark update (even if in the 'skip list')
191  float m_tickmarkThreshold; // threshold to accept the tickmark measurement
201  bool m_usefed;
202  bool m_usefec;
203  bool m_debug;
205 
206  //Data containers
213 
214  // Tracker Cabling objects
219 };
220 #endif // OnlineDB_SiStripESSources_SiStripCondObjBuilderFromDb_H
vector< uint32_t > retrieveActiveDetIds(const SiStripDetCabling &det_cabling)
SiStripPedestals::InputVector inputPedestals
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
void buildAnalysisRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
SiStripQuality::InputVector inputQuality
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:34
std::vector< uint16_t > InputVector
Definition: SiStripNoises.h:50
std::pair< uint32_t, v_apvpairconn > pair_detcon
FedDescriptions::range FedDescriptionsRange
SiStripThreshold::InputVector inputThreshold
std::vector< SkipDeviceDescription > whitelistedDevices
bool isConsistent(const FedChannelConnection &fc) const
void setDefaultValuesCabling(uint16_t apvPair)
static std::string const input
Definition: EdmProvDump.cc:47
edm::Service< SiStripConfigDb > db_
void buildFECRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
bool setValuesApvLatency(SiStripLatency &latency_, SiStripConfigDb *const db, FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr, SiStripConfigDb::DeviceDescriptionsRange apvs)
char const * label
bool retrieveFedDescriptions(SiStripConfigDb *const db)
void buildStripRelatedObjects(SiStripConfigDb *const db, const SiStripDetCabling &det_cabling)
bool checkForCompatibility(std::stringstream &input, std::stringstream &output, std::string &label)
std::shared_ptr< SiStripApvGain > gain_last_
std::pair< uint32_t, FedChannelConnection > pair_apvpairconn
std::vector< uint16_t > InputVector
void getValue(SiStripQuality *&val)
Class containning control, module, detector and connection information, at the level of a FED channel...
DeviceDescriptions::range DeviceDescriptionsRange
void getValue(SiStripFedCabling *&val)
An interface class to the DeviceFactory.
void buildFEDRelatedObjects(SiStripConfigDb *const db, const trackercon &tc)
const SiStripDbParams & dbParams() const
uint16_t retrieveNumberAPVPairs(uint32_t det_id)
std::vector< pair_detcon > trackercon
void setLastIovGain(std::shared_ptr< SiStripApvGain > gain)
void getValue(SiStripThreshold *&val)
std::vector< pair_apvpairconn > v_apvpairconn
void getValue(SiStripLatency *&val)
void getValue(SiStripBadStrip *&val)
vector< const FedChannelConnection * > buildConnections(const SiStripDetCabling &det_cabling, uint32_t det_id)
SiStripNoises::InputVector inputNoises
bool setValuesCabling(SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid)
bool retrieveTimingAnalysisDescriptions(SiStripConfigDb *const db)
void getValue(SiStripApvGain *&val)
Container class for database connection parameters.
std::string getConfigString(const std::type_info &typeInfo)
void setDefaultValuesApvLatency(SiStripLatency &latency_, const FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr)
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
SiStripApvGain::InputVector inputApvGain
std::vector< float > InputVector
std::vector< uint32_t > whitelistedDetIds
void getValue(SiStripPedestals *&val)
void setDefaultValuesApvTiming(uint32_t detid, uint32_t apvPair)
const SiStripDbParams & dbParams() const
std::vector< SkipDeviceDescription > skippedDevices
std::vector< pair_detcon >::iterator i_trackercon
std::vector< pair_apvpairconn >::iterator i_apvpairconn
bool setValuesApvTiming(SiStripConfigDb *const db, FedChannelConnection &ipair)
Container InputVector