File indexing completed on 2024-04-06 11:59:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #include "CalibFormats/SiStripObjects/interface/SiStripDetCabling.h"
0023 #include "CalibFormats/SiStripObjects/interface/SiStripGain.h"
0024 #include "CalibFormats/SiStripObjects/interface/SiStripQuality.h"
0025 #include "CalibTracker/Records/interface/SiStripDetCablingRcd.h"
0026 #include "CalibTracker/Records/interface/SiStripGainRcd.h"
0027 #include "CalibTracker/Records/interface/SiStripQualityRcd.h"
0028 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
0029 #include "DQMServices/Core/interface/DQMGlobalEDAnalyzer.h"
0030 #include "DQMServices/Core/interface/DQMStore.h"
0031 #include "DataFormats/DetId/interface/DetId.h"
0032 #include "DataFormats/FEDRawData/interface/FEDNumbering.h"
0033 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0034 #include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
0035 #include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
0036 #include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h"
0037 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0038 #include "DataFormats/TrackReco/interface/Track.h"
0039 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0040 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
0041 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
0042 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h"
0043 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
0044 #include "FWCore/Framework/interface/Event.h"
0045 #include "FWCore/Framework/interface/Frameworkfwd.h"
0046 #include "FWCore/Framework/interface/MakerMacros.h"
0047 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0048 #include "FWCore/ServiceRegistry/interface/Service.h"
0049 #include "FWCore/Utilities/interface/EDGetToken.h"
0050 #include "FWCore/Utilities/interface/Exception.h"
0051 #include "FWCore/Framework/interface/ESWatcher.h"
0052 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0053 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0054 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0055 #include "Geometry/CommonTopologies/interface/StripTopology.h"
0056 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0057 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0058 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
0059 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0060 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0061 #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
0062 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0063
0064
0065 #include "CalibTracker/SiStripChannelGain/interface/APVGainStruct.h"
0066 #include "CalibTracker/SiStripChannelGain/interface/APVGainHelpers.h"
0067
0068
0069 #include <unordered_map>
0070
0071
0072
0073
0074
0075 class SiStripGainsPCLWorker : public DQMGlobalEDAnalyzer<APVGain::APVGainHistograms> {
0076 public:
0077 explicit SiStripGainsPCLWorker(const edm::ParameterSet &);
0078
0079 void bookHistograms(DQMStore::IBooker &,
0080 edm::Run const &,
0081 edm::EventSetup const &,
0082 APVGain::APVGainHistograms &) const override;
0083 void dqmAnalyze(edm::Event const &, edm::EventSetup const &, APVGain::APVGainHistograms const &) const override;
0084
0085 static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
0086
0087 private:
0088 void dqmBeginRun(edm::Run const &, edm::EventSetup const &, APVGain::APVGainHistograms &) const override;
0089 void checkBookAPVColls(const TrackerGeometry *bareTkGeomPtr,
0090 const TrackerTopology *bareTkTopoPtr,
0091 APVGain::APVGainHistograms &histograms) const;
0092
0093 std::vector<std::string> dqm_tag_;
0094
0095 int statCollectionFromMode(const char *tag) const;
0096
0097 double MinTrackMomentum;
0098 double MaxTrackMomentum;
0099 double MinTrackEta;
0100 double MaxTrackEta;
0101 unsigned int MaxNrStrips;
0102 unsigned int MinTrackHits;
0103 double MaxTrackChiOverNdf;
0104 int MaxTrackingIteration;
0105 bool AllowSaturation;
0106 bool FirstSetOfConstants;
0107 bool Validation;
0108 bool OldGainRemoving;
0109 bool useCalibration;
0110 bool doChargeMonitorPerPlane;
0111
0112 std::string m_DQMdir;
0113 std::string m_calibrationMode;
0114 std::vector<std::string> VChargeHisto;
0115
0116 edm::EDGetTokenT<edm::View<reco::Track>> m_tracks_token;
0117 edm::EDGetTokenT<TrajTrackAssociationCollection> m_association_token;
0118
0119 edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoTokenBR_, tTopoToken_;
0120 edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomTokenBR_, tkGeomToken_;
0121 edm::ESGetToken<SiStripGain, SiStripGainRcd> gainToken_;
0122 edm::ESGetToken<SiStripQuality, SiStripQualityRcd> qualityToken_;
0123
0124
0125 std::map<unsigned int, APVloc> theTopologyMap;
0126 };
0127
0128 inline int SiStripGainsPCLWorker::statCollectionFromMode(const char *tag) const {
0129 std::vector<std::string>::const_iterator it = dqm_tag_.begin();
0130 while (it != dqm_tag_.end()) {
0131 if (*it == std::string(tag))
0132 return it - dqm_tag_.begin();
0133 it++;
0134 }
0135
0136 if (std::string(tag).empty())
0137 return 0;
0138
0139 return None;
0140 }