76 void fill(
const double y,
const double yDiff,
const bool debug);
95 std::vector<edm::EDGetTokenT<CTPPSLocalTrackLiteCollection>>
tracksTokens_;
107 : esTokenBookHistograms_(
113 dqmDir_(iConfig.getParameter<
std::
string>(
"dqm_dir")),
114 debug_(iConfig.getParameter<
bool>(
"debug")) {
116 li <<
"parameters:\n";
118 li <<
"* tracksTags:\n";
120 li <<
" " <<
tag <<
",\n";
122 li <<
"* dqm_dir: " <<
dqmDir_ <<
"\n";
123 li <<
"* debug: " << std::boolalpha <<
debug_;
140 bool foundProduct =
false;
164 desc.add<std::vector<edm::InputTag>>(
"tracksTags", {
edm::InputTag(
"ctppsLocalTrackLiteProducer")});
166 desc.add<
bool>(
"debug",
false);
179 "h_y",
";y",
cfg.binning().slice_n_bins_x_,
cfg.binning().slice_x_min_,
cfg.binning().slice_x_max_);
181 auto profilePtr = std::make_unique<TProfile>(
182 "",
";y;y_{F} - y_{N}",
cfg.binning().slice_n_bins_x_,
cfg.binning().slice_x_min_,
cfg.binning().slice_x_max_);
183 p_y_diffFN_vs_y = iBooker.
bookProfile(
"p_y_diffFN_vs_y", profilePtr.get());
186 h2_y_diffFN_vs_y = iBooker.
book2DD(
"h2_y_diffFN_vs_y",
188 cfg.binning().slice_n_bins_x_,
189 cfg.binning().slice_x_min_,
190 cfg.binning().slice_x_max_,
191 cfg.binning().slice_n_bins_y_,
192 cfg.binning().slice_y_min_,
193 cfg.binning().slice_y_max_);
198 p_y_diffFN_vs_y->Fill(
y, yDiff);
200 h2_y_diffFN_vs_y->Fill(
y, yDiff);
211 const double bin_size_x =
cfg.binning().bin_size_x_;
212 const unsigned int n_bins_x =
cfg.binning().n_bins_x_;
214 const double pixel_x_offset =
cfg.binning().pixel_x_offset_;
216 const double x_min_pix = pixel_x_offset, x_max_pix = pixel_x_offset + n_bins_x * bin_size_x;
217 const double x_min_str = 0., x_max_str = n_bins_x * bin_size_x;
219 const unsigned int n_bins_y =
cfg.binning().n_bins_y_;
220 const double y_min =
cfg.binning().y_min_, y_max =
cfg.binning().y_max_;
225 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_str, x_max_str, n_bins_y, y_min, y_max);
228 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_pix, x_max_pix, n_bins_y, y_min, y_max);
232 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_str, x_max_str, n_bins_y, y_min, y_max);
235 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_pix, x_max_pix, n_bins_y, y_min, y_max);
239 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_str, x_max_str, n_bins_y, y_min, y_max);
242 iBooker.
book2DD(
"h2_y_vs_x",
";x;y", n_bins_x, x_min_pix, x_max_pix, n_bins_y, y_min, y_max);
249 iBooker.
book2DD(
"h2_cut_h_bef",
";x_up;x_dw", n_bins_x, x_min_str, x_max_str, n_bins_x, x_min_pix, x_max_pix);
251 iBooker.
book2DD(
"h2_cut_h_aft",
";x_up;x_dw", n_bins_x, x_min_str, x_max_str, n_bins_x, x_min_pix, x_max_pix);
256 h2_cut_v_bef = iBooker.
book2DD(
"h2_cut_v_bef",
";y_up;y_dw", n_bins_y, y_min, y_max, n_bins_y, y_min, y_max);
257 h2_cut_v_aft = iBooker.
book2DD(
"h2_cut_v_aft",
";y_up;y_dw", n_bins_y, y_min, y_max, n_bins_y, y_min, y_max);
262 auto profilePtr = std::make_unique<TProfile>(
"",
263 ";x_{N};x_{F} - x_{N}",
264 cfg.binning().diffFN_n_bins_x_,
265 cfg.binning().diffFN_x_min_,
266 cfg.binning().diffFN_x_max_);
275 sprintf(
buf,
"%.1f-%.1f", x_min, x_max);
286 sprintf(
buf,
"%.1f-%.1f", x_min, x_max);
298 for (
const auto& tr :
tracks) {
300 unsigned int rpDecId = rpId.
arm() * 100 + rpId.station() * 10 + rpId.rp();
307 tracksUp.push_back(tr);
309 tracksDw.push_back(tr);
313 for (
const auto& tr : tracksUp)
316 for (
const auto& tr : tracksDw)
320 if (tracksUp.size() <
cfg.minRPTracksSize() || tracksUp.size() >
cfg.maxRPTracksSize())
323 if (tracksDw.size() <
cfg.minRPTracksSize() || tracksDw.size() >
cfg.maxRPTracksSize())
327 for (
const auto& tr : tracksUp)
330 for (
const auto& tr : tracksDw)
334 unsigned int pairsSelected = 0;
335 for (
const auto& trUp : tracksUp) {
336 for (
const auto& trDw : tracksDw) {
350 bool cutsPassed =
true;
383 return pairsSelected;
std::map< unsigned int, SlicePlots > x_slice_plots_F
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
std::map< unsigned int, MonitorElement * > m_h2_y_vs_x_bef_sel
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void bookHistograms(DQMStore::IBooker &iBooker, edm::Run const &, edm::EventSetup const &iSetup) override
unsigned int process(const CTPPSLocalTrackLiteCollection &tracks, const PPSAlignmentConfiguration &cfg, bool debug)
MonitorElement * h_q_cut_h_bef
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * h2_cut_h_aft
#define DEFINE_FWK_MODULE(type)
MonitorElement * p_y_diffFN_vs_y_F
def replace(string, replacements)
const std::vector< edm::InputTag > tracksTags_
std::map< unsigned int, MonitorElement * > m_h2_y_vs_x_aft_sel
MonitorElement * p_x_diffFN_vs_x_N
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
MonitorElement * h_q_cut_h_aft
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenAnalyze_
MonitorElement * h2_cut_v_bef
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
const std::string dqmDir_
PPSAlignmentWorker(const edm::ParameterSet &iConfig)
bool getData(T &iHolder) const
MonitorElement * h2_cut_h_bef
PPSAlignmentConfiguration::SectorConfig scfg_
MonitorElement * h_q_cut_v_aft
MonitorElement * h2_cut_v_aft
MonitorElement * h2_y_diffFN_vs_y
void init(DQMStore::IBooker &iBooker, const PPSAlignmentConfiguration &cfg, const PPSAlignmentConfiguration::SectorConfig &scfg, const std::string &rootDir, bool debug)
Log< level::Info, false > LogInfo
void fill(const double y, const double yDiff, const bool debug)
auto const & tracks
cannot be loose
std::vector< CTPPSLocalTrackLite > CTPPSLocalTrackLiteCollection
Collection of CTPPSLocalTrackLite objects.
const edm::ESGetToken< PPSAlignmentConfiguration, PPSAlignmentConfigurationRcd > esTokenBookHistograms_
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Base class for CTPPS detector IDs.
std::map< unsigned int, SlicePlots > x_slice_plots_N
std::map< unsigned int, MonitorElement * > m_h2_y_vs_x_mlt_sel
std::vector< edm::EDGetTokenT< CTPPSLocalTrackLiteCollection > > tracksTokens_
MonitorElement * p_y_diffFN_vs_y
MonitorElement * h_q_cut_v_bef