Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:36:21

0001 #include "CondCore/BeamSpotPlugins/interface/BeamSpotPayloadInspectorHelper.h"
0002 #include "CondCore/CondDB/interface/Time.h"
0003 #include "CondCore/Utilities/interface/PayloadInspector.h"
0004 #include "CondCore/Utilities/interface/PayloadInspectorModule.h"
0005 #include "CondFormats/BeamSpotObjects/interface/BeamSpotObjects.h"
0006 
0007 namespace {
0008 
0009   using namespace beamSpotPI;
0010 
0011   class BeamSpot_hx : public cond::payloadInspector::HistoryPlot<BeamSpotObjects, std::pair<double, double> > {
0012   public:
0013     BeamSpot_hx()
0014         : cond::payloadInspector::HistoryPlot<BeamSpotObjects, std::pair<double, double> >("x vs run number", "x") {}
0015 
0016     std::pair<double, double> getFromPayload(BeamSpotObjects& payload) override {
0017       return std::make_pair(payload.x(), payload.xError());
0018     }
0019   };
0020 
0021   class BeamSpot_rhx : public cond::payloadInspector::RunHistoryPlot<BeamSpotObjects, std::pair<double, double> > {
0022   public:
0023     BeamSpot_rhx()
0024         : cond::payloadInspector::RunHistoryPlot<BeamSpotObjects, std::pair<double, double> >("x vs run number", "x") {}
0025 
0026     std::pair<double, double> getFromPayload(BeamSpotObjects& payload) override {
0027       return std::make_pair(payload.x(), payload.xError());
0028     }
0029   };
0030   class BeamSpot_x : public cond::payloadInspector::TimeHistoryPlot<BeamSpotObjects, std::pair<double, double> > {
0031   public:
0032     BeamSpot_x()
0033         : cond::payloadInspector::TimeHistoryPlot<BeamSpotObjects, std::pair<double, double> >("x vs time", "x") {}
0034 
0035     std::pair<double, double> getFromPayload(BeamSpotObjects& payload) override {
0036       return std::make_pair(payload.x(), payload.xError());
0037     }
0038   };
0039 
0040   class BeamSpot_y : public cond::payloadInspector::TimeHistoryPlot<BeamSpotObjects, std::pair<double, double> > {
0041   public:
0042     BeamSpot_y()
0043         : cond::payloadInspector::TimeHistoryPlot<BeamSpotObjects, std::pair<double, double> >("y vs time", "y") {}
0044 
0045     std::pair<double, double> getFromPayload(BeamSpotObjects& payload) override {
0046       return std::make_pair(payload.y(), payload.yError());
0047     }
0048   };
0049 
0050   /************************************************
0051     X-Y correlation plot
0052   *************************************************/
0053 
0054   typedef xyCorrelation<BeamSpotObjects> BeamSpot_xy;
0055 
0056   /************************************************
0057     history plots
0058   *************************************************/
0059   typedef BeamSpot_history<X, BeamSpotObjects> BeamSpot_HistoryX;
0060   typedef BeamSpot_history<Y, BeamSpotObjects> BeamSpot_HistoryY;
0061   typedef BeamSpot_history<Z, BeamSpotObjects> BeamSpot_HistoryZ;
0062   typedef BeamSpot_history<sigmaX, BeamSpotObjects> BeamSpot_HistorySigmaX;
0063   typedef BeamSpot_history<sigmaY, BeamSpotObjects> BeamSpot_HistorySigmaY;
0064   typedef BeamSpot_history<sigmaZ, BeamSpotObjects> BeamSpot_HistorySigmaZ;
0065   typedef BeamSpot_history<dxdz, BeamSpotObjects> BeamSpot_HistorydXdZ;
0066   typedef BeamSpot_history<dydz, BeamSpotObjects> BeamSpot_HistorydYdZ;
0067 
0068   /************************************************
0069     run history plots
0070   *************************************************/
0071 
0072   typedef BeamSpot_runhistory<X, BeamSpotObjects> BeamSpot_RunHistoryX;
0073   typedef BeamSpot_runhistory<Y, BeamSpotObjects> BeamSpot_RunHistoryY;
0074   typedef BeamSpot_runhistory<Z, BeamSpotObjects> BeamSpot_RunHistoryZ;
0075   typedef BeamSpot_runhistory<sigmaX, BeamSpotObjects> BeamSpot_RunHistorySigmaX;
0076   typedef BeamSpot_runhistory<sigmaY, BeamSpotObjects> BeamSpot_RunHistorySigmaY;
0077   typedef BeamSpot_runhistory<sigmaZ, BeamSpotObjects> BeamSpot_RunHistorySigmaZ;
0078   typedef BeamSpot_runhistory<dxdz, BeamSpotObjects> BeamSpot_RunHistorydXdZ;
0079   typedef BeamSpot_runhistory<dydz, BeamSpotObjects> BeamSpot_RunHistorydYdZ;
0080 
0081   /************************************************
0082     time history plots
0083   *************************************************/
0084 
0085   typedef BeamSpot_timehistory<X, BeamSpotObjects> BeamSpot_TimeHistoryX;
0086   typedef BeamSpot_timehistory<Y, BeamSpotObjects> BeamSpot_TimeHistoryY;
0087   typedef BeamSpot_timehistory<Z, BeamSpotObjects> BeamSpot_TimeHistoryZ;
0088   typedef BeamSpot_timehistory<sigmaX, BeamSpotObjects> BeamSpot_TimeHistorySigmaX;
0089   typedef BeamSpot_timehistory<sigmaY, BeamSpotObjects> BeamSpot_TimeHistorySigmaY;
0090   typedef BeamSpot_timehistory<sigmaZ, BeamSpotObjects> BeamSpot_TimeHistorySigmaZ;
0091   typedef BeamSpot_timehistory<dxdz, BeamSpotObjects> BeamSpot_TimeHistorydXdZ;
0092   typedef BeamSpot_timehistory<dydz, BeamSpotObjects> BeamSpot_TimeHistorydYdZ;
0093 
0094   /************************************************
0095     Display of Beam Spot parameters
0096   *************************************************/
0097 
0098   typedef DisplayParameters<BeamSpotObjects> BeamSpotParameters;
0099 
0100   /************************************************
0101     Display of Beam Spot parameters Differences
0102   *************************************************/
0103 
0104   typedef DisplayParametersDiff<BeamSpotObjects, cond::payloadInspector::MULTI_IOV, 1> BeamSpotParametersDiffSingleTag;
0105   typedef DisplayParametersDiff<BeamSpotObjects, cond::payloadInspector::SINGLE_IOV, 2> BeamSpotParametersDiffTwoTags;
0106 
0107 }  // namespace
0108 
0109 PAYLOAD_INSPECTOR_MODULE(BeamSpot) {
0110   PAYLOAD_INSPECTOR_CLASS(BeamSpot_hx);
0111   PAYLOAD_INSPECTOR_CLASS(BeamSpot_rhx);
0112   PAYLOAD_INSPECTOR_CLASS(BeamSpot_x);
0113   PAYLOAD_INSPECTOR_CLASS(BeamSpot_y);
0114   PAYLOAD_INSPECTOR_CLASS(BeamSpot_xy);
0115   PAYLOAD_INSPECTOR_CLASS(BeamSpotParameters);
0116   PAYLOAD_INSPECTOR_CLASS(BeamSpotParametersDiffSingleTag);
0117   PAYLOAD_INSPECTOR_CLASS(BeamSpotParametersDiffTwoTags);
0118   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistoryX);
0119   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistoryY);
0120   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistoryZ);
0121   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistorySigmaX);
0122   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistorySigmaY);
0123   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistorySigmaZ);
0124   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistorydXdZ);
0125   PAYLOAD_INSPECTOR_CLASS(BeamSpot_HistorydYdZ);
0126   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistoryX);
0127   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistoryY);
0128   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistoryZ);
0129   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistorySigmaX);
0130   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistorySigmaY);
0131   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistorySigmaZ);
0132   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistorydXdZ);
0133   PAYLOAD_INSPECTOR_CLASS(BeamSpot_RunHistorydYdZ);
0134   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistoryX);
0135   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistoryY);
0136   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistoryZ);
0137   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistorySigmaX);
0138   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistorySigmaY);
0139   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistorySigmaZ);
0140   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistorydXdZ);
0141   PAYLOAD_INSPECTOR_CLASS(BeamSpot_TimeHistorydYdZ);
0142 }