Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:54

0001 #ifndef LMFCORRCOEFDAT_H
0002 #define LMFCORRCOEFDAT_H
0003 
0004 /*
0005  Last updated by  Giovanni.Organtini@roma1.infn.it 2010
0006 
0007  This class represents a block of data from LMF_CORR_COEF_DAT
0008 
0009 */
0010 
0011 #include <map>
0012 
0013 #include "OnlineDB/EcalCondDB/interface/LMFCorrCoefDatComponent.h"
0014 #include "OnlineDB/EcalCondDB/interface/LMFSextuple.h"
0015 
0016 class LMFCorrCoefDat {
0017 public:
0018   LMFCorrCoefDat();
0019   LMFCorrCoefDat(EcalDBConnection *c);
0020   LMFCorrCoefDat(oracle::occi::Environment *env, oracle::occi::Connection *conn);
0021   ~LMFCorrCoefDat();
0022 
0023   void init();
0024   LMFCorrCoefDat &setConnection(oracle::occi::Environment *env, oracle::occi::Connection *conn);
0025   LMFCorrCoefDat &setP123(const LMFLmrSubIOV &iov, const EcalLogicID &id, float p1, float p2, float p3);
0026   LMFCorrCoefDat &setP123(
0027       const LMFLmrSubIOV &iov, const EcalLogicID &id, float p1, float p2, float p3, float p1e, float p2e, float p3e);
0028   LMFCorrCoefDat &setP123Errors(const LMFLmrSubIOV &iov, const EcalLogicID &id, float p1e, float p2e, float p3e);
0029   LMFCorrCoefDat &setFlag(const LMFLmrSubIOV &iov, const EcalLogicID &id, int flag);
0030   LMFCorrCoefDat &setSequence(const LMFLmrSubIOV &iov, const EcalLogicID &id, int seq_id);
0031   LMFCorrCoefDat &setSequence(const LMFLmrSubIOV &iov, const EcalLogicID &id, const LMFSeqDat &seq);
0032   RunIOV fetchLastInsertedRun();
0033   void fetchAfter(const Tm &t);
0034   void fetchAfter(const Tm &t, int howMany);
0035   void fetchBetween(const Tm &tmin, const Tm &tmax);
0036   void fetchBetween(const Tm &tmin, const Tm &tmax, int maxNumberOfIOVs);
0037   void fetch(std::list<int> subiov_ids);
0038   void fetch(int subiov_id);
0039   void fetch(const LMFLmrSubIOV &iov);
0040 
0041   std::map<int, std::map<int, LMFSextuple> > getCorrections(const Tm &t);
0042   std::map<int, std::map<int, LMFSextuple> > getCorrections(const Tm &t, int max);
0043   std::map<int, std::map<int, LMFSextuple> > getCorrections(const Tm &t, const Tm &t2, int max);
0044   std::list<std::vector<float> > getParameters(int id);
0045   std::list<std::vector<float> > getParameters(const EcalLogicID &id);
0046   std::vector<float> getParameters(const LMFLmrSubIOV &iov, const EcalLogicID &id);
0047   std::vector<float> getParameterErrors(const LMFLmrSubIOV &iov, const EcalLogicID &id);
0048   std::vector<Tm> getTimes(const LMFLmrSubIOV &iov);
0049   int getFlag(const LMFLmrSubIOV &iov, const EcalLogicID &id);
0050   int getSeqID(const LMFLmrSubIOV &iov, const EcalLogicID &id);
0051   LMFSeqDat getSequence(const LMFLmrSubIOV &iov, const EcalLogicID &id);
0052   std::list<int> getSubIOVIDs();
0053 
0054   int size() const;
0055   void dump();
0056   void debug();
0057   void nodebug();
0058   void writeDB();
0059 
0060 private:
0061   static const int MAX_NUMBER_OF_SEQUENCES_TO_FETCH = 32;
0062 
0063   std::map<int, LMFCorrCoefDatComponent *> m_data;  // this map associates SUBIOV_IDs to data
0064   std::map<int, LMFLmrSubIOV *> m_subiov;           // this map associates SUBIOV_IDs to SubIOVs
0065   oracle::occi::Environment *m_env;
0066   oracle::occi::Connection *m_conn;
0067   bool m_debug;
0068 
0069   LMFCorrCoefDatComponent *find(const LMFLmrSubIOV &iov);
0070   void checkTriplets(int logic_id, const LMFSextuple &s, const std::map<int, LMFSextuple> &lastMap);
0071 };
0072 
0073 #endif