Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:34

0001 #ifndef CalibTracker_SiPixelLorentzAngle_SiPixelLorentzAngleCalibrationStruct_h
0002 #define CalibTracker_SiPixelLorentzAngle_SiPixelLorentzAngleCalibrationStruct_h
0003 
0004 #include "DQMServices/Core/interface/DQMStore.h"
0005 #include <unordered_map>
0006 
0007 namespace siPixelLACalibration {
0008   static constexpr float cmToum = 10000.f;
0009 
0010   class Chebyshev {
0011   public:
0012     Chebyshev(int n, double xmin, double xmax) : fA(xmin), fB(xmax), fT(std::vector<double>(n + 1)) {}
0013 
0014     double operator()(const double* xx, const double* p) {
0015       double x = (2.0 * xx[0] - fA - fB) / (fB - fA);
0016       int npar = fT.size();
0017 
0018       if (npar == 1)
0019         return p[0];
0020       if (npar == 2)
0021         return p[0] + x * p[1];
0022       // build the polynomials
0023       fT[0] = 1;
0024       fT[1] = x;
0025       for (int i = 2; i < npar; ++i) {
0026         fT[i] = 2 * x * fT[i - 1] - fT[i - 2];
0027       }
0028       double sum = p[0] * fT[0];
0029       for (int i = 1; i < npar; ++i) {
0030         sum += p[i] * fT[i];
0031       }
0032       return sum;
0033     }
0034 
0035   private:
0036     double fA;
0037     double fB;
0038     std::vector<double> fT;  // polynomial
0039     std::vector<double> fC;  // coefficients
0040   };
0041 }  // namespace siPixelLACalibration
0042 
0043 struct SiPixelLorentzAngleCalibrationHistograms {
0044 public:
0045   SiPixelLorentzAngleCalibrationHistograms() = default;
0046 
0047   using MonitorMap = std::unordered_map<uint32_t, dqm::reco::MonitorElement*>;
0048 
0049   int nlay;
0050   std::vector<int> nModules_;
0051   std::vector<int> nLadders_;
0052   std::vector<std::string> BPixnewmodulename_;
0053   std::vector<unsigned int> BPixnewDetIds_;
0054   std::vector<int> BPixnewModule_;
0055   std::vector<int> BPixnewLayer_;
0056 
0057   std::vector<std::string> FPixnewmodulename_;
0058   std::vector<int> FPixnewDetIds_;
0059   std::vector<int> FPixnewDisk_;
0060   std::vector<int> FPixnewBlade_;
0061   std::unordered_map<uint32_t, std::vector<uint32_t> > detIdsList;
0062 
0063   MonitorMap h_drift_depth_adc_;
0064   MonitorMap h_drift_depth_adc2_;
0065   MonitorMap h_drift_depth_noadc_;
0066   MonitorMap h_drift_depth_;
0067   MonitorMap h_mean_;
0068 
0069   // track monitoring
0070   dqm::reco::MonitorElement* h_tracks_;
0071   dqm::reco::MonitorElement* h_trackEta_;
0072   dqm::reco::MonitorElement* h_trackPhi_;
0073   dqm::reco::MonitorElement* h_trackPt_;
0074   dqm::reco::MonitorElement* h_trackChi2_;
0075 
0076   // per-sector measurements
0077   dqm::reco::MonitorElement* h_bySectOccupancy_;
0078   dqm::reco::MonitorElement* h_bySectMeasLA_;
0079   dqm::reco::MonitorElement* h_bySectSetLA_;
0080   dqm::reco::MonitorElement* h_bySectRejectLA_;
0081   dqm::reco::MonitorElement* h_bySectLA_;
0082   dqm::reco::MonitorElement* h_bySectDeltaLA_;
0083   dqm::reco::MonitorElement* h_bySectChi2_;
0084   dqm::reco::MonitorElement* h_bySectFitStatus_;
0085   dqm::reco::MonitorElement* h_bySectCovMatrixStatus_;
0086   dqm::reco::MonitorElement* h_bySectDriftError_;
0087 
0088   // for fit quality
0089   dqm::reco::MonitorElement* h_bySectFitQuality_;
0090 
0091   // ouput LA maps
0092   std::vector<dqm::reco::MonitorElement*> h2_byLayerLA_;
0093   std::vector<dqm::reco::MonitorElement*> h2_byLayerDiff_;
0094 
0095   // FPix Minimal Cluster Size
0096   static constexpr int nRings_ = 2;
0097   static constexpr int nPanels_ = 2;
0098   static constexpr int nSides_ = 2;
0099   static constexpr int betaStartIdx_ = nRings_ * nPanels_ * nSides_;
0100   static constexpr int nAngles_ = 2;
0101 
0102   MonitorMap h_fpixAngleSize_;
0103   MonitorMap h_fpixMean_;
0104   MonitorMap h_fpixMagField_[3];
0105 
0106   dqm::reco::MonitorElement* h_fpixMeanHistoFitStatus_;
0107   dqm::reco::MonitorElement* h_fpixMinClusterSizeCotAngle_;
0108   dqm::reco::MonitorElement* h_fpixNhitsClusterSizeCotAngle_;
0109   dqm::reco::MonitorElement* h_fpixFitStatusMuH_;
0110   dqm::reco::MonitorElement* h_fpixMuH_;
0111   dqm::reco::MonitorElement* h_fpixDeltaMuH_;
0112   dqm::reco::MonitorElement* h_fpixRelDeltaMuH_;
0113 };
0114 
0115 #endif