Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:18

0001 
0002 #ifndef OnlineDB_SiStripESSources_SiStripFedCablingBuilderFromDb_H
0003 #define OnlineDB_SiStripESSources_SiStripFedCablingBuilderFromDb_H
0004 
0005 #include "CalibTracker/SiStripESProducers/interface/SiStripFedCablingESProducer.h"
0006 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0007 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0008 #include <vector>
0009 #include <string>
0010 #include <cstdint>
0011 
0012 class SiStripFedCablingRcd;
0013 class SiStripFedCabling;
0014 class SiStripFecCabling;
0015 class SiStripConfigDb;
0016 class TkDcuInfo;
0017 
0018 class SiStripFedCablingBuilderFromDb : public SiStripFedCablingESProducer, public edm::EventSetupRecordIntervalFinder {
0019 public:
0020   // -------------------- Constructors, destructors --------------------
0021 
0022   SiStripFedCablingBuilderFromDb(const edm::ParameterSet&);
0023   ~SiStripFedCablingBuilderFromDb() override;
0024 
0025   // -------------------- Methods to build FED cabling --------------------
0026 
0027   /** Builds FED cabling using info from configuration database. */
0028   SiStripFedCabling* make(const SiStripFedCablingRcd&) override;
0029 
0030   // -------------------- Convert b/w FED and FEC cabling --------------------
0031 
0032   /** Utility method that takes a FEC cabling object as input and
0033       returns (as an arg) the corresponding FED cabling object. */
0034   static void getFedCabling(const SiStripFecCabling& in, SiStripFedCabling& out);
0035 
0036   /** Utility method that takes a FED cabling object as input and
0037       returns (as an arg) the corresponding FEC cabling object. */
0038   static void getFecCabling(const SiStripFedCabling& in, SiStripFecCabling& out);
0039 
0040   // -------------------- Methods to build FEC cabling --------------------
0041 
0042   /** Generic method which builds FEC cabling. Call ones of the three
0043       methods below depending on the cabling "source" parameter
0044       (connections, devices, detids). */
0045   static void buildFecCabling(SiStripConfigDb* const, SiStripFecCabling&, const sistrip::CablingSource&);
0046 
0047   /** Generic method which builds FEC cabling. Call ones of the three
0048       methods below depending on what descriptions are available
0049       within the database or which xml files are available. */
0050   static void buildFecCabling(SiStripConfigDb* const, SiStripFecCabling&);
0051 
0052   /** Builds the SiStripFecCabling conditions object using information
0053       found within the "module.xml" and "dcuinfo.xml" files. "Dummy"
0054       values are provided when necessary. */
0055   static void buildFecCablingFromFedConnections(SiStripConfigDb* const, SiStripFecCabling&);
0056 
0057   /** Builds the SiStripFecCabling conditions object using information
0058       found within the "fec.xml" and "dcuinfo.xml" files. "Dummy"
0059       values are provided when necessary. */
0060   static void buildFecCablingFromDevices(SiStripConfigDb* const, SiStripFecCabling&);
0061 
0062   /** Builds the SiStripFecCabling conditions object using information
0063       found within the "dcuinfo.xml" file (ie, based on DetIds). "Dummy"
0064       values are provided when necessary. */
0065   static void buildFecCablingFromDetIds(SiStripConfigDb* const, SiStripFecCabling&);
0066 
0067 protected:
0068   /** */
0069   void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0070                       const edm::IOVSyncValue&,
0071                       edm::ValidityInterval&) override;
0072 
0073   /** */
0074   static void assignDcuAndDetIds(SiStripFecCabling&, const std::vector<std::pair<uint32_t, TkDcuInfo*> >&);
0075 
0076   /** Virtual method that is called by makeFedCabling() to allow FED
0077       cabling to be written to the conds DB (local or otherwise). */
0078   virtual void writeFedCablingToCondDb(const SiStripFedCabling&) { ; }
0079 
0080   /** Access to the configuration DB interface class. */
0081   SiStripConfigDb* db_;
0082 
0083   /** Defines "source" (conns, devices, detids) of cabling info. */
0084   sistrip::CablingSource source_;
0085 };
0086 
0087 #endif  // OnlineDB_SiStripESSources_SiStripFedCablingBuilderFromDb_H