Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-08 02:25:55

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