CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PPSAlignmentConfigurationESSource Class Reference
Inheritance diagram for PPSAlignmentConfigurationESSource:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 PPSAlignmentConfigurationESSource (const edm::ParameterSet &iConfig)
 
std::unique_ptr< PPSAlignmentConfigurationproduce (const PPSAlignmentConfigurationRcd &)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 
- Public Member Functions inherited from edm::EventSetupRecordIntervalFinder
bool concurrentFinder () const
 
const eventsetup::ComponentDescriptiondescriptionForFinder () const
 
 EventSetupRecordIntervalFinder ()
 
 EventSetupRecordIntervalFinder (const EventSetupRecordIntervalFinder &)=delete
 
std::set< eventsetup::EventSetupRecordKeyfindingForRecords () const
 
const ValidityIntervalfindIntervalFor (const eventsetup::EventSetupRecordKey &, const IOVSyncValue &)
 
bool nonconcurrentAndIOVNeedsUpdate (const eventsetup::EventSetupRecordKey &key, const IOVSyncValue &syncValue) const
 
const EventSetupRecordIntervalFinderoperator= (const EventSetupRecordIntervalFinder &)=delete
 
void resetInterval (const eventsetup::EventSetupRecordKey &)
 
void setDescriptionForFinder (const eventsetup::ComponentDescription &iDescription)
 
virtual ~EventSetupRecordIntervalFinder () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

std::vector< PPSAlignmentConfiguration::PointErrorsbuildVectorFromDirectory (TDirectory *dir, const PPSAlignmentConfiguration::RPConfig &rpd)
 
TDirectory * findDirectoryWithName (TDirectory *dir, std::string searchName)
 
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &key, const edm::IOVSyncValue &iosv, edm::ValidityInterval &oValidity) override
 

Private Attributes

std::map< unsigned int, PPSAlignmentConfiguration::SelectionRangealignment_x_meth_o_ranges
 
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRangealignment_x_relative_ranges
 
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRangealignment_y_ranges
 
PPSAlignmentConfiguration::Binning binning
 
double chiSqThreshold
 
bool debug
 
std::vector< double > extraParams
 
unsigned int fitProfileMinBinEntries
 
unsigned int fitProfileMinNReasonable
 
std::string label
 
std::map< unsigned int, std::vector< PPSAlignmentConfiguration::PointErrors > > matchingReferencePoints
 
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRangematchingShiftRanges
 
unsigned int maxRPTracksSize
 
unsigned int methOGraphMinN
 
double methOUncFitRange
 
unsigned int minRPTracksSize
 
unsigned int modeGraphMinN
 
unsigned int multSelProjYMinEntries
 
double n_si
 
unsigned int nearFarMinEntries
 
PPSAlignmentConfiguration::SectorConfig sectorConfig45
 
PPSAlignmentConfiguration::SectorConfig sectorConfig56
 
double x_ali_sh_step
 
double y_mode_max_valid
 
double y_mode_sys_unc
 
double y_mode_unc_max_valid
 

Additional Inherited Members

- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Member Functions inherited from edm::EventSetupRecordIntervalFinder
template<class T >
void findingRecord ()
 
void findingRecordWithKey (const eventsetup::EventSetupRecordKey &)
 

Detailed Description

Definition at line 37 of file PPSAlignmentConfigurationESSource.cc.

Constructor & Destructor Documentation

◆ PPSAlignmentConfigurationESSource()

PPSAlignmentConfigurationESSource::PPSAlignmentConfigurationESSource ( const edm::ParameterSet iConfig)

Definition at line 93 of file PPSAlignmentConfigurationESSource.cc.

References alignment_x_meth_o_ranges, alignment_x_relative_ranges, alignment_y_ranges, PPSAlignmentConfiguration::Binning::bin_size_x_, binning, buildVectorFromDirectory(), reco::ceil(), chiSqThreshold, debug, PPSAlignmentConfiguration::Binning::diffFN_n_bins_x_, PPSAlignmentConfiguration::Binning::diffFN_x_max_, PPSAlignmentConfiguration::Binning::diffFN_x_min_, edm::ParameterSet::empty(), extraParams, findDirectoryWithName(), fitProfileMinBinEntries, fitProfileMinNReasonable, edm::ParameterSet::getParameter(), PPSAlignmentConfiguration::RPConfig::id_, label, matchingReferencePoints, matchingShiftRanges, maxRPTracksSize, methOGraphMinN, methOUncFitRange, minRPTracksSize, eostools::mkdir(), modeGraphMinN, multSelProjYMinEntries, PPSAlignmentConfiguration::Binning::n_bins_x_, PPSAlignmentConfiguration::Binning::n_bins_y_, n_si, PPSAlignmentConfiguration::RPConfig::name_, PPSAlignmentConfiguration::SectorConfig::name_, nearFarMinEntries, AlCaHLTBitMon_ParallelJobs::p, PPSAlignmentConfiguration::Binning::pixel_x_offset_, PPSAlignmentConfiguration::RPConfig::position_, PPSAlignmentConfiguration::SectorConfig::rp_F_, PPSAlignmentConfiguration::SectorConfig::rp_N_, sectorConfig45, sectorConfig56, edm::ESProducer::setWhatProduced(), PPSAlignmentConfiguration::Binning::slice_n_bins_x_, PPSAlignmentConfiguration::Binning::slice_n_bins_y_, PPSAlignmentConfiguration::Binning::slice_x_max_, PPSAlignmentConfiguration::Binning::slice_x_min_, PPSAlignmentConfiguration::Binning::slice_y_max_, PPSAlignmentConfiguration::Binning::slice_y_min_, AlCaHLTBitMon_QueryRunRegistry::string, x_ali_sh_step, PPSAlignmentConfiguration::Binning::y_max_, PPSAlignmentConfiguration::Binning::y_min_, y_mode_max_valid, y_mode_sys_unc, and y_mode_unc_max_valid.

93  {
94  label = iConfig.getParameter<std::string>("label");
95 
96  debug = iConfig.getParameter<bool>("debug");
97  std::unique_ptr<TFile> debugFile;
98  if (debug) {
99  debugFile =
100  std::make_unique<TFile>(("debug_producer_" + (label.empty() ? "test" : label) + ".root").c_str(), "recreate");
101  }
102 
103  sectorConfig45.name_ = "sector 45";
104 
107 
108  sectorConfig56.name_ = "sector 56";
109 
112 
113  for (std::string sectorName : {"sector_45", "sector_56"}) {
114  const auto& sps = iConfig.getParameter<edm::ParameterSet>(sectorName);
116  if (sectorName == "sector_45")
117  sc = &sectorConfig45;
118  else
119  sc = &sectorConfig56;
120 
121  for (std::string rpName : {"rp_N", "rp_F"}) {
122  const auto& rpps = sps.getParameter<edm::ParameterSet>(rpName);
124  if (rpName == "rp_N")
125  rc = &sc->rp_N_;
126  else
127  rc = &sc->rp_F_;
128 
129  rc->name_ = rpps.getParameter<std::string>("name");
130  rc->id_ = rpps.getParameter<int>("id");
131 
132  rc->slope_ = rpps.getParameter<double>("slope");
133  rc->sh_x_ = rpps.getParameter<double>("sh_x");
134 
135  rc->x_min_fit_mode_ = rpps.getParameter<double>("x_min_fit_mode");
136  rc->x_max_fit_mode_ = rpps.getParameter<double>("x_max_fit_mode");
137  rc->y_max_fit_mode_ = rpps.getParameter<double>("y_max_fit_mode");
138  rc->y_cen_add_ = rpps.getParameter<double>("y_cen_add");
139  rc->y_width_mult_ = rpps.getParameter<double>("y_width_mult");
140 
141  rc->x_slice_min_ = rpps.getParameter<double>("x_slice_min");
142  rc->x_slice_w_ = rpps.getParameter<double>("x_slice_w");
143  rc->x_slice_n_ = std::ceil((rpps.getParameter<double>("x_slice_max") - rc->x_slice_min_) / rc->x_slice_w_);
144  }
145 
146  sc->slope_ = sps.getParameter<double>("slope");
147 
148  sc->cut_h_apply_ = sps.getParameter<bool>("cut_h_apply");
149  sc->cut_h_a_ = sps.getParameter<double>("cut_h_a");
150  sc->cut_h_c_ = sps.getParameter<double>("cut_h_c");
151  sc->cut_h_si_ = sps.getParameter<double>("cut_h_si");
152 
153  sc->cut_v_apply_ = sps.getParameter<bool>("cut_v_apply");
154  sc->cut_v_a_ = sps.getParameter<double>("cut_v_a");
155  sc->cut_v_c_ = sps.getParameter<double>("cut_v_c");
156  sc->cut_v_si_ = sps.getParameter<double>("cut_v_si");
157  }
158 
159  std::map<unsigned int, std::string> rpTags = {{sectorConfig45.rp_F_.id_, "rp_L_F"},
160  {sectorConfig45.rp_N_.id_, "rp_L_N"},
161  {sectorConfig56.rp_N_.id_, "rp_R_N"},
162  {sectorConfig56.rp_F_.id_, "rp_R_F"}};
163 
164  std::map<unsigned int, std::string> sectorNames = {{sectorConfig45.rp_F_.id_, sectorConfig45.name_},
168 
169  std::map<unsigned int, const PPSAlignmentConfiguration::RPConfig*> rpConfigs = {
174 
175  x_ali_sh_step = iConfig.getParameter<double>("x_ali_sh_step");
176 
177  y_mode_sys_unc = iConfig.getParameter<double>("y_mode_sys_unc");
178  chiSqThreshold = iConfig.getParameter<double>("chiSqThreshold");
179  y_mode_unc_max_valid = iConfig.getParameter<double>("y_mode_unc_max_valid");
180  y_mode_max_valid = iConfig.getParameter<double>("y_mode_max_valid");
181 
182  minRPTracksSize = iConfig.getParameter<unsigned int>("min_RP_tracks_size");
183  maxRPTracksSize = iConfig.getParameter<unsigned int>("max_RP_tracks_size");
184  n_si = iConfig.getParameter<double>("n_si");
185 
186  const auto& c_axo = iConfig.getParameter<edm::ParameterSet>("x_alignment_meth_o");
187  for (const auto& p : rpTags) {
188  const auto& ps = c_axo.getParameter<edm::ParameterSet>(p.second);
189  alignment_x_meth_o_ranges[p.first] = {ps.getParameter<double>("x_min"), ps.getParameter<double>("x_max")};
190  }
191  fitProfileMinBinEntries = c_axo.getParameter<unsigned int>("fit_profile_min_bin_entries");
192  fitProfileMinNReasonable = c_axo.getParameter<unsigned int>("fit_profile_min_N_reasonable");
193  methOGraphMinN = c_axo.getParameter<unsigned int>("meth_o_graph_min_N");
194  methOUncFitRange = c_axo.getParameter<double>("meth_o_unc_fit_range");
195 
196  const auto& c_m = iConfig.getParameter<edm::ParameterSet>("matching");
197  const auto& referenceDataset = c_m.getParameter<std::string>("reference_dataset");
198 
199  // constructing vectors with reference data
200  if (!referenceDataset.empty()) {
201  auto f_ref = std::make_unique<TFile>(referenceDataset.c_str(), "READ");
202  if (!f_ref->IsOpen()) {
203  edm::LogWarning("PPS") << "[ESSource] could not find reference dataset file: " << referenceDataset;
204  } else {
205  TDirectory* ad_ref = findDirectoryWithName((TDirectory*)f_ref.get(), sectorConfig45.name_);
206  if (ad_ref == nullptr) {
207  edm::LogWarning("PPS") << "[ESSource] could not find reference dataset in " << referenceDataset;
208  } else {
209  edm::LogInfo("PPS") << "[ESSource] loading reference dataset from " << ad_ref->GetPath();
210 
211  for (const auto& p : rpTags) {
212  if (debug)
213  gDirectory = debugFile->mkdir(rpConfigs[p.first]->name_.c_str())->mkdir("fits_ref");
214 
215  auto* d_ref = (TDirectory*)ad_ref->Get(
216  (sectorNames[p.first] + "/near_far/x slices, " + rpConfigs[p.first]->position_).c_str());
217  if (d_ref == nullptr) {
218  edm::LogWarning("PPS") << "[ESSource] could not load d_ref";
219  } else {
220  matchingReferencePoints[p.first] = buildVectorFromDirectory(d_ref, *rpConfigs[p.first]);
221  }
222  }
223  }
224  }
225  }
226 
227  for (const auto& p : rpTags) {
228  const auto& ps = c_m.getParameter<edm::ParameterSet>(p.second);
229  matchingShiftRanges[p.first] = {ps.getParameter<double>("sh_min"), ps.getParameter<double>("sh_max")};
230  }
231 
232  const auto& c_axr = iConfig.getParameter<edm::ParameterSet>("x_alignment_relative");
233  for (const auto& p : rpTags) {
234  if (p.second.back() == 'N') { // only near RPs
235  const auto& ps = c_axr.getParameter<edm::ParameterSet>(p.second);
236  alignment_x_relative_ranges[p.first] = {ps.getParameter<double>("x_min"), ps.getParameter<double>("x_max")};
237  }
238  }
239  nearFarMinEntries = c_axr.getParameter<unsigned int>("near_far_min_entries");
240 
241  const auto& c_ay = iConfig.getParameter<edm::ParameterSet>("y_alignment");
242  for (const auto& p : rpTags) {
243  const auto& ps = c_ay.getParameter<edm::ParameterSet>(p.second);
244  alignment_y_ranges[p.first] = {ps.getParameter<double>("x_min"), ps.getParameter<double>("x_max")};
245  }
246  modeGraphMinN = c_ay.getParameter<unsigned int>("mode_graph_min_N");
247  multSelProjYMinEntries = c_ay.getParameter<unsigned int>("mult_sel_proj_y_min_entries");
248 
249  const auto& bps = iConfig.getParameter<edm::ParameterSet>("binning");
250  binning.bin_size_x_ = bps.getParameter<double>("bin_size_x");
251  binning.n_bins_x_ = bps.getParameter<unsigned int>("n_bins_x");
252  binning.pixel_x_offset_ = bps.getParameter<double>("pixel_x_offset");
253  binning.n_bins_y_ = bps.getParameter<unsigned int>("n_bins_y");
254  binning.y_min_ = bps.getParameter<double>("y_min");
255  binning.y_max_ = bps.getParameter<double>("y_max");
256 
257  binning.diffFN_n_bins_x_ = bps.getParameter<unsigned int>("diffFN_n_bins_x");
258  binning.diffFN_x_min_ = bps.getParameter<double>("diffFN_x_min");
259  binning.diffFN_x_max_ = bps.getParameter<double>("diffFN_x_max");
260 
261  binning.slice_n_bins_x_ = bps.getParameter<unsigned int>("slice_n_bins_x");
262  binning.slice_x_min_ = bps.getParameter<double>("slice_x_min");
263  binning.slice_x_max_ = bps.getParameter<double>("slice_x_max");
264  binning.slice_n_bins_y_ = bps.getParameter<unsigned int>("slice_n_bins_y");
265  binning.slice_y_min_ = bps.getParameter<double>("slice_y_min");
266  binning.slice_y_max_ = bps.getParameter<double>("slice_y_max");
267 
268  extraParams = iConfig.getParameter<std::vector<double>>("extra_params");
269 
270  setWhatProduced(this, label);
271  findingRecord<PPSAlignmentConfigurationRcd>();
272 }
constexpr int32_t ceil(float num)
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PPSAlignmentConfiguration::SectorConfig sectorConfig56
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_y_ranges
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_x_relative_ranges
PPSAlignmentConfiguration::SectorConfig sectorConfig45
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > matchingShiftRanges
std::map< unsigned int, std::vector< PPSAlignmentConfiguration::PointErrors > > matchingReferencePoints
bool empty() const
Definition: ParameterSet.h:201
TDirectory * findDirectoryWithName(TDirectory *dir, std::string searchName)
Log< level::Info, false > LogInfo
def mkdir(path)
Definition: eostools.py:251
PPSAlignmentConfiguration::Binning binning
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_x_meth_o_ranges
std::vector< PPSAlignmentConfiguration::PointErrors > buildVectorFromDirectory(TDirectory *dir, const PPSAlignmentConfiguration::RPConfig &rpd)
Log< level::Warning, false > LogWarning

Member Function Documentation

◆ buildVectorFromDirectory()

std::vector< PPSAlignmentConfiguration::PointErrors > PPSAlignmentConfigurationESSource::buildVectorFromDirectory ( TDirectory *  dir,
const PPSAlignmentConfiguration::RPConfig rpd 
)
private

Definition at line 619 of file PPSAlignmentConfigurationESSource.cc.

References ztail::d, debug, DeadROC_duringRun::dir, alig_utils::fitProfile(), fitProfileMinBinEntries, fitProfileMinNReasonable, dqmdumpme::k, Skims_PA_cff::name, GetRecoTauVFromDQM_MC_cff::next, EcalTangentSkim_cfg::o, MetAnalyzer::pv(), AlCaHLTBitMon_QueryRunRegistry::string, PPSAlignmentConfiguration::RPConfig::y_cen_add_, and PPSAlignmentConfiguration::RPConfig::y_width_mult_.

Referenced by PPSAlignmentConfigurationESSource().

620  {
621  std::vector<PPSAlignmentConfiguration::PointErrors> pv;
622 
623  TIter next(dir->GetListOfKeys());
624  TObject* o;
625  while ((o = next())) {
626  TKey* k = (TKey*)o;
627 
628  std::string name = k->GetName();
629  size_t d = name.find('-');
630  const double x_min = std::stod(name.substr(0, d));
631  const double x_max = std::stod(name.substr(d + 1));
632 
633  TDirectory* d_slice = (TDirectory*)k->ReadObj();
634 
635  TH1D* h_y = (TH1D*)d_slice->Get("h_y");
636  TProfile* p_y_diffFN_vs_y = (TProfile*)d_slice->Get("p_y_diffFN_vs_y");
637 
638  double y_cen = h_y->GetMean();
639  double y_width = h_y->GetRMS();
640 
641  y_cen += rpd.y_cen_add_;
642  y_width *= rpd.y_width_mult_;
643 
644  double sl = 0., sl_unc = 0.;
645  int fr = alig_utils::fitProfile(
646  p_y_diffFN_vs_y, y_cen, y_width, fitProfileMinBinEntries, fitProfileMinNReasonable, sl, sl_unc);
647  if (fr != 0)
648  continue;
649 
650  if (debug)
651  p_y_diffFN_vs_y->Write(name.c_str());
652 
653  pv.push_back({(x_max + x_min) / 2., sl, (x_max - x_min) / 2., sl_unc});
654  }
655 
656  return pv;
657 }
int fitProfile(TProfile *p, double x_mean, double x_rms, unsigned int minBinEntries, unsigned int minNBinsReasonable, double &sl, double &sl_unc)
Definition: utils.cc:14
def pv(vc)
Definition: MetAnalyzer.py:7
d
Definition: ztail.py:151

◆ fillDescriptions()

void PPSAlignmentConfigurationESSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 324 of file PPSAlignmentConfigurationESSource.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), binning, submitPVResolutionJobs::desc, TtSemiLepJetCombMVATrainer_cfi::matching, and AlCaHLTBitMon_QueryRunRegistry::string.

324  {
326 
327  desc.add<bool>("debug", false);
328 
329  desc.add<std::string>("label", "");
330 
331  // sector_45
332  {
334 
336  rp_N.add<std::string>("name", "L_1_F");
337  rp_N.add<int>("id", 3);
338 
339  rp_N.add<double>("slope", 0.19);
340  rp_N.add<double>("sh_x", -3.6);
341 
342  rp_N.add<double>("x_min_fit_mode", 2.);
343  rp_N.add<double>("x_max_fit_mode", 7.0);
344  rp_N.add<double>("y_max_fit_mode", 7.0);
345  rp_N.add<double>("y_cen_add", -0.3);
346  rp_N.add<double>("y_width_mult", 1.1);
347 
348  rp_N.add<double>("x_slice_min", 7.);
349  rp_N.add<double>("x_slice_max", 19.);
350  rp_N.add<double>("x_slice_w", 0.2);
351  sector45.add<edm::ParameterSetDescription>("rp_N", rp_N);
352 
354  rp_F.add<std::string>("name", "L_2_F");
355  rp_F.add<int>("id", 23);
356 
357  rp_F.add<double>("slope", 0.19);
358  rp_F.add<double>("sh_x", -42.);
359 
360  rp_F.add<double>("x_min_fit_mode", 2.);
361  rp_F.add<double>("x_max_fit_mode", 7.5);
362  rp_F.add<double>("y_max_fit_mode", 7.5);
363  rp_F.add<double>("y_cen_add", -0.3);
364  rp_F.add<double>("y_width_mult", 1.1);
365 
366  rp_F.add<double>("x_slice_min", 46.);
367  rp_F.add<double>("x_slice_max", 58.);
368  rp_F.add<double>("x_slice_w", 0.2);
369  sector45.add<edm::ParameterSetDescription>("rp_F", rp_F);
370 
371  sector45.add<double>("slope", 0.006);
372  sector45.add<bool>("cut_h_apply", true);
373  sector45.add<double>("cut_h_a", -1.);
374  sector45.add<double>("cut_h_c", -38.55);
375  sector45.add<double>("cut_h_si", 0.2);
376  sector45.add<bool>("cut_v_apply", true);
377  sector45.add<double>("cut_v_a", -1.07);
378  sector45.add<double>("cut_v_c", 1.63);
379  sector45.add<double>("cut_v_si", 0.15);
380 
381  desc.add<edm::ParameterSetDescription>("sector_45", sector45);
382  }
383 
384  // sector_56
385  {
387 
389  rp_N.add<std::string>("name", "R_1_F");
390  rp_N.add<int>("id", 103);
391 
392  rp_N.add<double>("slope", 0.40);
393  rp_N.add<double>("sh_x", -2.8);
394 
395  rp_N.add<double>("x_min_fit_mode", 2.);
396  rp_N.add<double>("x_max_fit_mode", 7.4);
397  rp_N.add<double>("y_max_fit_mode", 7.4);
398  rp_N.add<double>("y_cen_add", -0.8);
399  rp_N.add<double>("y_width_mult", 1.0);
400 
401  rp_N.add<double>("x_slice_min", 6.);
402  rp_N.add<double>("x_slice_max", 17.);
403  rp_N.add<double>("x_slice_w", 0.2);
404  sector56.add<edm::ParameterSetDescription>("rp_N", rp_N);
405 
407  rp_F.add<std::string>("name", "R_2_F");
408  rp_F.add<int>("id", 123);
409 
410  rp_F.add<double>("slope", 0.39);
411  rp_F.add<double>("sh_x", -41.9);
412 
413  rp_F.add<double>("x_min_fit_mode", 2.);
414  rp_F.add<double>("x_max_fit_mode", 8.0);
415  rp_F.add<double>("y_max_fit_mode", 8.0);
416  rp_F.add<double>("y_cen_add", -0.8);
417  rp_F.add<double>("y_width_mult", 1.0);
418 
419  rp_F.add<double>("x_slice_min", 45.);
420  rp_F.add<double>("x_slice_max", 57.);
421  rp_F.add<double>("x_slice_w", 0.2);
422  sector56.add<edm::ParameterSetDescription>("rp_F", rp_F);
423 
424  sector56.add<double>("slope", -0.015);
425  sector56.add<bool>("cut_h_apply", true);
426  sector56.add<double>("cut_h_a", -1.);
427  sector56.add<double>("cut_h_c", -39.26);
428  sector56.add<double>("cut_h_si", 0.2);
429  sector56.add<bool>("cut_v_apply", true);
430  sector56.add<double>("cut_v_a", -1.07);
431  sector56.add<double>("cut_v_c", 1.49);
432  sector56.add<double>("cut_v_si", 0.15);
433 
434  desc.add<edm::ParameterSetDescription>("sector_56", sector56);
435  }
436 
437  desc.add<double>("x_ali_sh_step", 0.01);
438 
439  desc.add<double>("y_mode_sys_unc", 0.03);
440  desc.add<double>("chiSqThreshold", 50.);
441  desc.add<double>("y_mode_unc_max_valid", 5.);
442  desc.add<double>("y_mode_max_valid", 20.);
443 
444  desc.add<unsigned int>("min_RP_tracks_size", 1);
445  desc.add<unsigned int>("max_RP_tracks_size", 1);
446  desc.add<double>("n_si", 4.);
447 
448  // matching
449  {
451  matching.add<std::string>("reference_dataset", "");
452 
454  rpLF.add<double>("sh_min", -43.);
455  rpLF.add<double>("sh_max", -41.);
456  matching.add<edm::ParameterSetDescription>("rp_L_F", rpLF);
457 
459  rpLN.add<double>("sh_min", -4.2);
460  rpLN.add<double>("sh_max", -2.4);
461  matching.add<edm::ParameterSetDescription>("rp_L_N", rpLN);
462 
464  rpRN.add<double>("sh_min", -3.6);
465  rpRN.add<double>("sh_max", -1.8);
466  matching.add<edm::ParameterSetDescription>("rp_R_N", rpRN);
467 
469  rpRF.add<double>("sh_min", -43.2);
470  rpRF.add<double>("sh_max", -41.2);
471  matching.add<edm::ParameterSetDescription>("rp_R_F", rpRF);
472 
473  desc.add<edm::ParameterSetDescription>("matching", matching);
474  }
475 
476  // x alignment meth o
477  {
478  edm::ParameterSetDescription x_alignment_meth_o;
479 
481  rpLF.add<double>("x_min", 47.);
482  rpLF.add<double>("x_max", 56.5);
483  x_alignment_meth_o.add<edm::ParameterSetDescription>("rp_L_F", rpLF);
484 
486  rpLN.add<double>("x_min", 9.);
487  rpLN.add<double>("x_max", 18.5);
488  x_alignment_meth_o.add<edm::ParameterSetDescription>("rp_L_N", rpLN);
489 
491  rpRN.add<double>("x_min", 7.);
492  rpRN.add<double>("x_max", 15.);
493  x_alignment_meth_o.add<edm::ParameterSetDescription>("rp_R_N", rpRN);
494 
496  rpRF.add<double>("x_min", 46.);
497  rpRF.add<double>("x_max", 54.);
498  x_alignment_meth_o.add<edm::ParameterSetDescription>("rp_R_F", rpRF);
499 
500  x_alignment_meth_o.add<unsigned int>("fit_profile_min_bin_entries", 5);
501  x_alignment_meth_o.add<unsigned int>("fit_profile_min_N_reasonable", 10);
502  x_alignment_meth_o.add<unsigned int>("meth_o_graph_min_N", 5);
503  x_alignment_meth_o.add<double>("meth_o_unc_fit_range", 0.5);
504 
505  desc.add<edm::ParameterSetDescription>("x_alignment_meth_o", x_alignment_meth_o);
506  }
507 
508  // x alignment relative
509  {
510  edm::ParameterSetDescription x_alignment_relative;
511 
513  rpLN.add<double>("x_min", 7.5);
514  rpLN.add<double>("x_max", 12.);
515  x_alignment_relative.add<edm::ParameterSetDescription>("rp_L_N", rpLN);
516 
518  rpRN.add<double>("x_min", 6.);
519  rpRN.add<double>("x_max", 10.);
520  x_alignment_relative.add<edm::ParameterSetDescription>("rp_R_N", rpRN);
521 
522  x_alignment_relative.add<unsigned int>("near_far_min_entries", 100);
523 
524  desc.add<edm::ParameterSetDescription>("x_alignment_relative", x_alignment_relative);
525  }
526 
527  // y alignment
528  {
529  edm::ParameterSetDescription y_alignment;
530 
532  rpLF.add<double>("x_min", 44.5);
533  rpLF.add<double>("x_max", 49.);
534  y_alignment.add<edm::ParameterSetDescription>("rp_L_F", rpLF);
535 
537  rpLN.add<double>("x_min", 6.7);
538  rpLN.add<double>("x_max", 11.);
539  y_alignment.add<edm::ParameterSetDescription>("rp_L_N", rpLN);
540 
542  rpRN.add<double>("x_min", 5.9);
543  rpRN.add<double>("x_max", 10.);
544  y_alignment.add<edm::ParameterSetDescription>("rp_R_N", rpRN);
545 
547  rpRF.add<double>("x_min", 44.5);
548  rpRF.add<double>("x_max", 49.);
549  y_alignment.add<edm::ParameterSetDescription>("rp_R_F", rpRF);
550 
551  y_alignment.add<unsigned int>("mode_graph_min_N", 5);
552  y_alignment.add<unsigned int>("mult_sel_proj_y_min_entries", 300);
553 
554  desc.add<edm::ParameterSetDescription>("y_alignment", y_alignment);
555  }
556 
557  // binning
558  {
560 
561  binning.add<double>("bin_size_x", 142.3314E-3);
562  binning.add<unsigned int>("n_bins_x", 210);
563  binning.add<double>("pixel_x_offset", 40.);
564  binning.add<unsigned int>("n_bins_y", 400);
565  binning.add<double>("y_min", -20.);
566  binning.add<double>("y_max", 20.);
567 
568  binning.add<unsigned int>("diffFN_n_bins_x", 100);
569  binning.add<double>("diffFN_x_min", 0.);
570  binning.add<double>("diffFN_x_max", 20.);
571 
572  binning.add<unsigned int>("slice_n_bins_x", 100);
573  binning.add<double>("slice_x_min", -10.);
574  binning.add<double>("slice_x_max", 10.);
575  binning.add<unsigned int>("slice_n_bins_y", 100);
576  binning.add<double>("slice_y_min", -2.);
577  binning.add<double>("slice_y_max", 2.);
578 
579  desc.add<edm::ParameterSetDescription>("binning", binning);
580  }
581 
582  desc.add<std::vector<double>>("extra_params", {});
583 
584  descriptions.add("ppsAlignmentConfigurationESSource", desc);
585 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
PPSAlignmentConfiguration::Binning binning

◆ findDirectoryWithName()

TDirectory * PPSAlignmentConfigurationESSource::findDirectoryWithName ( TDirectory *  dir,
std::string  searchName 
)
private

Definition at line 591 of file PPSAlignmentConfigurationESSource.cc.

References DeadROC_duringRun::dir, dqmdumpme::k, Skims_PA_cff::name, GetRecoTauVFromDQM_MC_cff::next, EcalTangentSkim_cfg::o, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PPSAlignmentConfigurationESSource().

591  {
592  TIter next(dir->GetListOfKeys());
593  std::queue<TDirectory*> dirQueue;
594  TObject* o;
595  while ((o = next())) {
596  TKey* k = (TKey*)o;
597 
598  std::string name = k->GetName();
599  if (name == searchName)
600  return dir;
601 
602  if (((TSystemFile*)k)->IsDirectory())
603  dirQueue.push((TDirectory*)k->ReadObj());
604  }
605 
606  while (!dirQueue.empty()) {
607  TDirectory* resultDir = findDirectoryWithName(dirQueue.front(), searchName);
608  dirQueue.pop();
609  if (resultDir != nullptr)
610  return resultDir;
611  }
612 
613  return nullptr;
614 }
TDirectory * findDirectoryWithName(TDirectory *dir, std::string searchName)

◆ produce()

std::unique_ptr< PPSAlignmentConfiguration > PPSAlignmentConfigurationESSource::produce ( const PPSAlignmentConfigurationRcd )

Definition at line 276 of file PPSAlignmentConfigurationESSource.cc.

References alignment_x_meth_o_ranges, alignment_x_relative_ranges, alignment_y_ranges, binning, chiSqThreshold, extraParams, fitProfileMinBinEntries, fitProfileMinNReasonable, label, matchingReferencePoints, matchingShiftRanges, maxRPTracksSize, methOGraphMinN, methOUncFitRange, minRPTracksSize, modeGraphMinN, multSelProjYMinEntries, n_si, nearFarMinEntries, AlCaHLTBitMon_ParallelJobs::p, sectorConfig45, sectorConfig56, x_ali_sh_step, y_mode_max_valid, y_mode_sys_unc, and y_mode_unc_max_valid.

277  {
278  auto p = std::make_unique<PPSAlignmentConfiguration>();
279 
280  p->setSectorConfig45(sectorConfig45);
281  p->setSectorConfig56(sectorConfig56);
282 
283  p->setX_ali_sh_step(x_ali_sh_step);
284 
285  p->setY_mode_sys_unc(y_mode_sys_unc);
286  p->setChiSqThreshold(chiSqThreshold);
287  p->setY_mode_unc_max_valid(y_mode_unc_max_valid);
288  p->setY_mode_max_valid(y_mode_max_valid);
289 
290  p->setMinRPTracksSize(minRPTracksSize);
291  p->setMaxRPTracksSize(maxRPTracksSize);
292  p->setN_si(n_si);
293 
294  p->setMatchingReferencePoints(matchingReferencePoints);
295  p->setMatchingShiftRanges(matchingShiftRanges);
296 
297  p->setAlignment_x_meth_o_ranges(alignment_x_meth_o_ranges);
298  p->setFitProfileMinBinEntries(fitProfileMinBinEntries);
299  p->setFitProfileMinNReasonable(fitProfileMinNReasonable);
300  p->setMethOGraphMinN(methOGraphMinN);
301  p->setMethOUncFitRange(methOUncFitRange);
302 
303  p->setAlignment_x_relative_ranges(alignment_x_relative_ranges);
304  p->setNearFarMinEntries(nearFarMinEntries);
305 
306  p->setAlignment_y_ranges(alignment_y_ranges);
307  p->setModeGraphMinN(modeGraphMinN);
308  p->setMultSelProjYMinEntries(multSelProjYMinEntries);
309 
310  p->setBinning(binning);
311 
312  p->setExtraParams(extraParams);
313 
314  edm::LogInfo("PPS") << "\n"
315  << "[ESSource] " << (label.empty() ? "empty label" : "label = " + label) << ":\n\n"
316  << (*p);
317 
318  return p;
319 }
PPSAlignmentConfiguration::SectorConfig sectorConfig56
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_y_ranges
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_x_relative_ranges
PPSAlignmentConfiguration::SectorConfig sectorConfig45
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > matchingShiftRanges
std::map< unsigned int, std::vector< PPSAlignmentConfiguration::PointErrors > > matchingReferencePoints
Log< level::Info, false > LogInfo
PPSAlignmentConfiguration::Binning binning
std::map< unsigned int, PPSAlignmentConfiguration::SelectionRange > alignment_x_meth_o_ranges

◆ setIntervalFor()

void PPSAlignmentConfigurationESSource::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey key,
const edm::IOVSyncValue iosv,
edm::ValidityInterval oValidity 
)
overrideprivatevirtual

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 661 of file PPSAlignmentConfigurationESSource.cc.

References edm::IOVSyncValue::beginOfTime(), edm::IOVSyncValue::endOfTime(), edm::EventID::event(), edm::IOVSyncValue::eventID(), infinity, crabWrapper::key, and edm::EventID::run().

663  {
664  edm::LogInfo("PPS") << ">> PPSAlignmentConfigurationESSource::setIntervalFor(" << key.name() << ")\n"
665  << " run=" << iosv.eventID().run() << ", event=" << iosv.eventID().event();
666 
668  oValidity = infinity;
669 }
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
const double infinity
Log< level::Info, false > LogInfo
RunNumber_t run() const
Definition: EventID.h:38
const EventID & eventID() const
Definition: IOVSyncValue.h:40
EventNumber_t event() const
Definition: EventID.h:40

Member Data Documentation

◆ alignment_x_meth_o_ranges

std::map<unsigned int, PPSAlignmentConfiguration::SelectionRange> PPSAlignmentConfigurationESSource::alignment_x_meth_o_ranges
private

◆ alignment_x_relative_ranges

std::map<unsigned int, PPSAlignmentConfiguration::SelectionRange> PPSAlignmentConfigurationESSource::alignment_x_relative_ranges
private

◆ alignment_y_ranges

std::map<unsigned int, PPSAlignmentConfiguration::SelectionRange> PPSAlignmentConfigurationESSource::alignment_y_ranges
private

◆ binning

PPSAlignmentConfiguration::Binning PPSAlignmentConfigurationESSource::binning
private

◆ chiSqThreshold

double PPSAlignmentConfigurationESSource::chiSqThreshold
private

◆ debug

bool PPSAlignmentConfigurationESSource::debug
private

◆ extraParams

std::vector<double> PPSAlignmentConfigurationESSource::extraParams
private

◆ fitProfileMinBinEntries

unsigned int PPSAlignmentConfigurationESSource::fitProfileMinBinEntries
private

◆ fitProfileMinNReasonable

unsigned int PPSAlignmentConfigurationESSource::fitProfileMinNReasonable
private

◆ label

std::string PPSAlignmentConfigurationESSource::label
private

◆ matchingReferencePoints

std::map<unsigned int, std::vector<PPSAlignmentConfiguration::PointErrors> > PPSAlignmentConfigurationESSource::matchingReferencePoints
private

◆ matchingShiftRanges

std::map<unsigned int, PPSAlignmentConfiguration::SelectionRange> PPSAlignmentConfigurationESSource::matchingShiftRanges
private

◆ maxRPTracksSize

unsigned int PPSAlignmentConfigurationESSource::maxRPTracksSize
private

◆ methOGraphMinN

unsigned int PPSAlignmentConfigurationESSource::methOGraphMinN
private

◆ methOUncFitRange

double PPSAlignmentConfigurationESSource::methOUncFitRange
private

◆ minRPTracksSize

unsigned int PPSAlignmentConfigurationESSource::minRPTracksSize
private

◆ modeGraphMinN

unsigned int PPSAlignmentConfigurationESSource::modeGraphMinN
private

◆ multSelProjYMinEntries

unsigned int PPSAlignmentConfigurationESSource::multSelProjYMinEntries
private

◆ n_si

double PPSAlignmentConfigurationESSource::n_si
private

◆ nearFarMinEntries

unsigned int PPSAlignmentConfigurationESSource::nearFarMinEntries
private

◆ sectorConfig45

PPSAlignmentConfiguration::SectorConfig PPSAlignmentConfigurationESSource::sectorConfig45
private

◆ sectorConfig56

PPSAlignmentConfiguration::SectorConfig PPSAlignmentConfigurationESSource::sectorConfig56
private

◆ x_ali_sh_step

double PPSAlignmentConfigurationESSource::x_ali_sh_step
private

◆ y_mode_max_valid

double PPSAlignmentConfigurationESSource::y_mode_max_valid
private

◆ y_mode_sys_unc

double PPSAlignmentConfigurationESSource::y_mode_sys_unc
private

◆ y_mode_unc_max_valid

double PPSAlignmentConfigurationESSource::y_mode_unc_max_valid
private