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 
11 
28 
29 #include "boost/cstdint.hpp"
30 #include <memory>
31 #include <vector>
32 #include <string>
33 #include <typeinfo>
34 
35 class SiStripFecCabling;
36 class SiStripDetCabling;
37 class SiStripPedestals;
38 class SiStripNoises;
39 class SiStripQuality;
40 class SiStripThreshold;
41 class DcuDetIdMap;
42 class SiStripApvGain;
43 class SiStripLatency;
44 class TrackerTopology;
45 
47 
48  public:
49 
50  // Typedefs
51  typedef std::pair<uint32_t,FedChannelConnection> pair_apvpairconn;
52  typedef std::vector<pair_apvpairconn> v_apvpairconn;
53  typedef std::pair<uint32_t, v_apvpairconn> pair_detcon;
54  typedef std::vector<pair_detcon> trackercon;
55 
56  typedef std::vector<pair_detcon>::iterator i_trackercon;
57  typedef std::vector<pair_apvpairconn>::iterator i_apvpairconn;
58 
60  /* Class to hold the addresses of the devices to be skipped from gain update.
61  * 0 stands for all devices at this level.
62  * sistrip::invalid means this coordinate is not used. */
63  public:
66  bool isConsistent(const FedChannelConnection &fc) const;
67  std::string dump() const;
68 
69  private:
72  uint32_t detid_;
73  };
74 
77  const edm::ActivityRegistry&);
79 
81 
83  inline const SiStripDbParams& dbParams() const {return db_->dbParams();}
84 
87  void buildCondObj();
89  const SiStripDetCabling& det_cabling);
90  void buildAnalysisRelatedObjects( SiStripConfigDb* const db, const trackercon& tc);
91  void buildFECRelatedObjects( SiStripConfigDb* const db, const trackercon& tc);
92  void buildFEDRelatedObjects( SiStripConfigDb* const db, const trackercon& tc);
93 
94 
95  bool checkForCompatibility(std::stringstream& input,std::stringstream& output,std::string& label);
96  std::string getConfigString(const std::type_info& typeInfo);
97 
105 
108  void getValue(SiStripNoises * & val){ val = getNoises(); }
110  void getValue(SiStripQuality * & val){ val = getQuality(); }
112  void getValue( SiStripApvGain*& val ){ val = getApvGain(); }
113  void getValue( SiStripLatency*& val ){ val = getApvLatency(); }
114 
115  void setLastIovGain(std::shared_ptr<SiStripApvGain> gain) { gain_last_ = gain; }
116 
117  protected:
118 
119  void checkUpdate();
120 
122  // Build and retrieve SiStripConfigDb object using service
124 
134 
135  std::shared_ptr<SiStripApvGain> gain_last_; // last gain object in DB
136  std::vector<SkipDeviceDescription> skippedDevices; // devices to be skipped for gain update
137  std::vector<uint32_t> skippedDetIds;
138 
139  //methods used by BuildStripRelatedObjects
140  bool setValuesApvLatency(SiStripLatency & latency_, SiStripConfigDb* const db, FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr, SiStripConfigDb::DeviceDescriptionsRange apvs);
142  // bool setValuesCabling(SiStripConfigDb* const db, FedChannelConnection &ipair, uint32_t detid);
143  bool setValuesCabling(SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid);
146  vector<uint32_t> retrieveActiveDetIds(const SiStripDetCabling& det_cabling);
147  vector<const FedChannelConnection *> buildConnections(const SiStripDetCabling& det_cabling, uint32_t det_id );
148  uint16_t retrieveNumberAPVPairs(uint32_t det_id);
149 
150  //set and store data
151  void setDefaultValuesCabling(uint16_t apvPair);
152  void setDefaultValuesApvTiming(uint32_t detid, uint32_t apvPair);
153  void setDefaultValuesApvLatency(SiStripLatency & latency_, const FedChannelConnection& ipair, uint32_t detid, uint16_t apvnr);
154  void storePedestals(uint32_t det_id);
155  void storeNoise(uint32_t det_id);
156  void storeThreshold(uint32_t det_id);
157  void storeQuality(uint32_t det_id);
158  void storeTiming(uint32_t det_id);
159 
160 
161  // cfi input parameters
162  edm::VParameterSet m_skippedDevices; // VPset of devices to be skipped in tickmark update
163  float m_tickmarkThreshold; // threshold to accept the tickmark measurement
173  bool m_usefed;
174  bool m_usefec;
175  bool m_debug;
176 
177  //Data containers
184 
185 
186  // Tracker Cabling objects
187  pair_apvpairconn p_apvpcon;
188  v_apvpairconn v_apvpcon;
189  pair_detcon p_detcon;
190  trackercon v_trackercon;
191 
192  };
193 #endif // OnlineDB_SiStripESSources_SiStripCondObjBuilderFromDb_H
194 
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:33
std::vector< uint16_t > InputVector
Definition: SiStripNoises.h:51
std::pair< uint32_t, FedChannelConnection > pair_apvpairconn
bool isConsistent(const FedChannelConnection &fc) const
std::pair< uint32_t, v_apvpairconn > pair_detcon
FedDescriptions::range FedDescriptionsRange
SiStripThreshold::InputVector inputThreshold
void setDefaultValuesCabling(uint16_t apvPair)
static std::string const input
Definition: EdmProvDump.cc:44
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)
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::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)
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
const SiStripDbParams & dbParams() const
bool setValuesCabling(SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid)
const SiStripDbParams & dbParams() const
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
void getValue(SiStripPedestals *&val)
void setDefaultValuesApvTiming(uint32_t detid, uint32_t apvPair)
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