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  std::vector<SkipDeviceDescription> whitelistedDevices; // devices whitelist for gain update: will NOT be skipped, even if in the 'skip list'
139  std::vector<uint32_t> whitelistedDetIds;
140 
141  //methods used by BuildStripRelatedObjects
142  bool setValuesApvLatency(SiStripLatency & latency_, SiStripConfigDb* const db, FedChannelConnection &ipair, uint32_t detid, uint16_t apvnr, SiStripConfigDb::DeviceDescriptionsRange apvs);
144  // bool setValuesCabling(SiStripConfigDb* const db, FedChannelConnection &ipair, uint32_t detid);
145  bool setValuesCabling(SiStripConfigDb::FedDescriptionsRange &descriptions, FedChannelConnection &ipair, uint32_t detid);
148  vector<uint32_t> retrieveActiveDetIds(const SiStripDetCabling& det_cabling);
149  vector<const FedChannelConnection *> buildConnections(const SiStripDetCabling& det_cabling, uint32_t det_id );
150  uint16_t retrieveNumberAPVPairs(uint32_t det_id);
151 
152  //set and store data
153  void setDefaultValuesCabling(uint16_t apvPair);
154  void setDefaultValuesApvTiming(uint32_t detid, uint32_t apvPair);
155  void setDefaultValuesApvLatency(SiStripLatency & latency_, const FedChannelConnection& ipair, uint32_t detid, uint16_t apvnr);
156  void storePedestals(uint32_t det_id);
157  void storeNoise(uint32_t det_id);
158  void storeThreshold(uint32_t det_id);
159  void storeQuality(uint32_t det_id);
160  void storeTiming(uint32_t det_id);
161 
162 
163  // cfi input parameters
164  edm::VParameterSet m_skippedDevices; // VPset of devices to be skipped in tickmark update
165  edm::VParameterSet m_whitelistedDevices; // VPset of whitelisted devices: will NOT be skipped in tickmark update (even if in the 'skip list')
166  float m_tickmarkThreshold; // threshold to accept the tickmark measurement
176  bool m_usefed;
177  bool m_usefec;
178  bool m_debug;
179 
180  //Data containers
187 
188 
189  // Tracker Cabling objects
190  pair_apvpairconn p_apvpcon;
191  v_apvpairconn v_apvpcon;
192  pair_detcon p_detcon;
193  trackercon v_trackercon;
194 
195  };
196 #endif // OnlineDB_SiStripESSources_SiStripCondObjBuilderFromDb_H
197 
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:53
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
std::vector< SkipDeviceDescription > whitelistedDevices
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
std::vector< uint32_t > whitelistedDetIds
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