CMS 3D CMS Logo

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

Classes

struct  BinData
 
struct  ProfileData
 

Public Member Functions

 CTPPSCompositeESSource (const edm::ParameterSet &)
 
std::unique_ptr< PPSDirectSimulationDataproduceDirectSimuData (const PPSDirectSimulationDataRcd &)
 
std::unique_ptr< LHCInfoproduceLhcInfo (const LHCInfoRcd &)
 
std::shared_ptr< CTPPSRPAlignmentCorrectionsDataproduceMisalignedAlignments (const RPMisalignedAlignmentRecord &)
 
std::shared_ptr< CTPPSGeometryproduceMisalignedTG (const VeryForwardMisalignedGeometryRecord &)
 
std::unique_ptr< LHCOpticalFunctionsSetCollectionproduceOptics (const CTPPSOpticsRcd &)
 
std::shared_ptr< CTPPSRPAlignmentCorrectionsDataproduceRealAlignments (const RPRealAlignmentRecord &)
 
std::shared_ptr< CTPPSGeometryproduceRealTG (const VeryForwardRealGeometryRecord &)
 
- 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 &)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

void buildAlignment (const edm::ParameterSet &profile, ProfileData &pData)
 
void buildDirectSimuData (const edm::ParameterSet &profile, ProfileData &pData)
 
void buildGeometry (const DDCompactView &cpv)
 
void buildLHCInfo (const edm::ParameterSet &profile, ProfileData &pData)
 
void buildOptics (const edm::ParameterSet &profile, ProfileData &pData)
 
void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
 

Private Attributes

std::string compactViewTag_
 
const ProfileDatacurrentProfile_
 
unsigned int generateEveryNEvents_
 
bool geometryBuilt_
 
const bool isRun2_
 
std::string lhcInfoLabel_
 
std::unique_ptr< CLHEP::HepRandomEngine > m_engine_
 
std::string opticsLabel_
 
edm::EventID previously_set_eventID_
 
std::vector< BinData< ProfileData > > profile_bins_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordtokenCompactViewMisaligned_
 
edm::ESGetToken< DDCompactView, IdealGeometryRecordtokenCompactViewReal_
 
unsigned int verbosity_
 

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 char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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 50 of file CTPPSCompositeESSource.cc.

Constructor & Destructor Documentation

◆ CTPPSCompositeESSource()

CTPPSCompositeESSource::CTPPSCompositeESSource ( const edm::ParameterSet conf)

Definition at line 138 of file CTPPSCompositeESSource.cc.

139  : compactViewTag_(conf.getParameter<std::string>("compactViewTag")),
140  lhcInfoLabel_(conf.getParameter<std::string>("lhcInfoLabel")),
141  opticsLabel_(conf.getParameter<std::string>("opticsLabel")),
142  generateEveryNEvents_(conf.getUntrackedParameter<unsigned int>("generateEveryNEvents")),
143  verbosity_(conf.getUntrackedParameter<unsigned int>("verbosity")),
144  isRun2_(conf.getParameter<bool>("isRun2")),
145  m_engine_(new CLHEP::HepJamesRandom(conf.getParameter<unsigned int>("seed"))),
146  geometryBuilt_(false) {
147  double l_int_sum = 0;
148 
149  for (const auto &cfg : conf.getParameter<std::vector<edm::ParameterSet>>("periods")) {
150  double l_int = cfg.getParameter<double>("L_int");
151 
152  profile_bins_.emplace_back(BinData<ProfileData>{l_int_sum, l_int_sum + l_int, ProfileData()});
153 
154  l_int_sum += l_int;
155 
156  auto &pData = profile_bins_.back().data;
157 
158  buildLHCInfo(cfg, pData);
159  buildOptics(cfg, pData);
160  buildAlignment(cfg, pData);
161  buildDirectSimuData(cfg, pData);
162  }
163 
164  // normalise L_int sums to probabilities
165  for (auto &bin : profile_bins_) {
166  bin.min /= l_int_sum;
167  bin.max /= l_int_sum;
168  }
169 
170  // framework registrations
174 
180 
181  findingRecord<LHCInfoRcd>();
182  findingRecord<CTPPSOpticsRcd>();
183  findingRecord<PPSDirectSimulationDataRcd>();
184  findingRecord<RPRealAlignmentRecord>();
185  findingRecord<RPMisalignedAlignmentRecord>();
186  findingRecord<VeryForwardRealGeometryRecord>();
187  findingRecord<VeryForwardMisalignedGeometryRecord>();
188 }

References newFWLiteAna::bin, buildAlignment(), buildDirectSimuData(), buildLHCInfo(), buildOptics(), looper::cfg, compactViewTag_, edm::ParameterSet::getParameter(), lhcInfoLabel_, opticsLabel_, produceDirectSimuData(), produceLhcInfo(), produceMisalignedTG(), produceOptics(), produceRealTG(), profile_bins_, edm::ESProducer::setWhatProduced(), tokenCompactViewMisaligned_, and tokenCompactViewReal_.

Member Function Documentation

◆ buildAlignment()

void CTPPSCompositeESSource::buildAlignment ( const edm::ParameterSet profile,
ProfileData pData 
)
private

Definition at line 359 of file CTPPSCompositeESSource.cc.

359  {
360  // load alignment data
361  auto ctppsRPAlignmentCorrectionsDataXMLPSet =
362  cfg.getParameter<edm::ParameterSet>("ctppsRPAlignmentCorrectionsDataXML");
363  ctppsRPAlignmentCorrectionsDataXMLPSet.addUntrackedParameter("verbosity", verbosity_);
364 
365  CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon ctppsRPAlignmentCorrectionsDataESSourceXMLCommon(
366  ctppsRPAlignmentCorrectionsDataXMLPSet);
367 
368  // store the first entry from the alignment sequence (more cannot be done)
369  pData.acReal = std::make_shared<CTPPSRPAlignmentCorrectionsData>(
370  ctppsRPAlignmentCorrectionsDataESSourceXMLCommon.acsReal.empty()
372  : ctppsRPAlignmentCorrectionsDataESSourceXMLCommon.acsReal[0].second);
373 
374  pData.acMisaligned = std::make_shared<CTPPSRPAlignmentCorrectionsData>(
375  ctppsRPAlignmentCorrectionsDataESSourceXMLCommon.acsMisaligned.empty()
377  : ctppsRPAlignmentCorrectionsDataESSourceXMLCommon.acsMisaligned[0].second);
378 }

References CTPPSCompositeESSource::ProfileData::acMisaligned, CTPPSCompositeESSource::ProfileData::acReal, CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon::acsMisaligned, CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon::acsReal, edm::ParameterSet::addUntrackedParameter(), looper::cfg, and verbosity_.

Referenced by CTPPSCompositeESSource().

◆ buildDirectSimuData()

void CTPPSCompositeESSource::buildDirectSimuData ( const edm::ParameterSet profile,
ProfileData pData 
)
private

Definition at line 268 of file CTPPSCompositeESSource.cc.

268  {
269  const auto &ctppsDirectSimuData = profile.getParameter<edm::ParameterSet>("ctppsDirectSimuData");
270 
271  pData.directSimuData.setEmpiricalAperture45(ctppsDirectSimuData.getParameter<std::string>("empiricalAperture45"));
272  pData.directSimuData.setEmpiricalAperture56(ctppsDirectSimuData.getParameter<std::string>("empiricalAperture56"));
273 
274  pData.directSimuData.setTimeResolutionDiamonds45(
275  ctppsDirectSimuData.getParameter<std::string>("timeResolutionDiamonds45"));
276  pData.directSimuData.setTimeResolutionDiamonds56(
277  ctppsDirectSimuData.getParameter<std::string>("timeResolutionDiamonds56"));
278 
279  for (const auto &ps : ctppsDirectSimuData.getParameterSetVector("efficienciesPerRP")) {
280  const auto rpId = ps.getParameter<unsigned int>("rpId");
281  const auto &file = ps.getParameter<std::string>("file");
282  const auto &object = ps.getParameter<std::string>("object");
283  pData.directSimuData.getEfficienciesPerRP()[rpId] = {file, object};
284  }
285 
286  for (const auto &ps : ctppsDirectSimuData.getParameterSetVector("efficienciesPerPlane")) {
287  const auto rpId = ps.getParameter<unsigned int>("rpId");
288  const auto &file = ps.getParameter<std::string>("file");
289  const auto &object = ps.getParameter<std::string>("object");
290  pData.directSimuData.getEfficienciesPerPlane()[rpId] = {file, object};
291  }
292 }

References base_cff::ctppsDirectSimuData, CTPPSCompositeESSource::ProfileData::directSimuData, FrontierConditions_GlobalTag_cff::file, PPSDirectSimulationData::getEfficienciesPerPlane(), PPSDirectSimulationData::getEfficienciesPerRP(), PostProcessor_cff::profile, profile_2016_postTS2_cff::rpId, PPSDirectSimulationData::setEmpiricalAperture45(), PPSDirectSimulationData::setEmpiricalAperture56(), PPSDirectSimulationData::setTimeResolutionDiamonds45(), PPSDirectSimulationData::setTimeResolutionDiamonds56(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by CTPPSCompositeESSource().

◆ buildGeometry()

void CTPPSCompositeESSource::buildGeometry ( const DDCompactView cpv)
private

Definition at line 296 of file CTPPSCompositeESSource.cc.

296  {
297  std::unique_ptr<DetGeomDesc> idealGD = detgeomdescbuilder::buildDetGeomDescFromCompactView(cpv, isRun2_);
298 
299  for (auto &pb : profile_bins_) {
300  auto &p = pb.data;
301 
302  p.misalignedGD = CTPPSGeometryESCommon::applyAlignments(*(idealGD), p.acMisaligned.get());
303  p.misalignedTG = std::make_shared<CTPPSGeometry>(p.misalignedGD.get(), verbosity_);
304 
305  p.realGD = CTPPSGeometryESCommon::applyAlignments(*(idealGD), p.acReal.get());
306  p.realTG = std::make_shared<CTPPSGeometry>(p.realGD.get(), verbosity_);
307  }
308 
309  geometryBuilt_ = true;
310 }

References CTPPSGeometryESCommon::applyAlignments(), detgeomdescbuilder::buildDetGeomDescFromCompactView(), geometryBuilt_, isRun2_, AlCaHLTBitMon_ParallelJobs::p, profile_bins_, and verbosity_.

Referenced by produceMisalignedTG(), and produceRealTG().

◆ buildLHCInfo()

void CTPPSCompositeESSource::buildLHCInfo ( const edm::ParameterSet profile,
ProfileData pData 
)
private

Definition at line 382 of file CTPPSCompositeESSource.cc.

382  {
383  const auto &ctppsLHCInfo = profile.getParameter<edm::ParameterSet>("ctppsLHCInfo");
384 
385  pData.beamEnergy = ctppsLHCInfo.getParameter<double>("beamEnergy");
386  pData.betaStar = ctppsLHCInfo.getParameter<double>("betaStar");
387  pData.xangle = ctppsLHCInfo.getParameter<double>("xangle");
388 
389  // continue only if distributed xangle/beta* shall be used
390  if (pData.xangle > 0)
391  return;
392 
393  edm::FileInPath fip(ctppsLHCInfo.getParameter<std::string>("xangleBetaStarHistogramFile").c_str());
394  std::unique_ptr<TFile> f_in(TFile::Open(fip.fullPath().c_str()));
395  if (!f_in)
396  throw cms::Exception("PPS") << "Cannot open input file '"
397  << ctppsLHCInfo.getParameter<std::string>("xangleBetaStarHistogramFile") << "'.";
398 
399  TH2D *h_xangle_beta_star =
400  (TH2D *)f_in->Get(ctppsLHCInfo.getParameter<std::string>("xangleBetaStarHistogramObject").c_str());
401  if (!h_xangle_beta_star)
402  throw cms::Exception("PPS") << "Cannot load input object '"
403  << ctppsLHCInfo.getParameter<std::string>("xangleBetaStarHistogramObject") << "'.";
404 
405  // extract non-empty bins, calculate weights
406  double sum = 0.;
407  for (int bi = 1; bi <= h_xangle_beta_star->GetNcells(); ++bi)
408  sum += h_xangle_beta_star->GetBinContent(bi);
409 
410  double cw = 0.;
411  for (int x = 1; x <= h_xangle_beta_star->GetNbinsX(); ++x)
412  for (int y = 1; y <= h_xangle_beta_star->GetNbinsY(); ++y) {
413  const double w = h_xangle_beta_star->GetBinContent(h_xangle_beta_star->GetBin(x, y)) / sum;
414  if (w > 0.) {
415  pData.xangleBetaStarBins.push_back(
416  {cw,
417  cw + w,
418  std::pair<double, double>(h_xangle_beta_star->GetXaxis()->GetBinCenter(x),
419  h_xangle_beta_star->GetYaxis()->GetBinCenter(y))});
420  cw += w;
421  }
422  }
423 }

References CTPPSCompositeESSource::ProfileData::beamEnergy, CTPPSCompositeESSource::ProfileData::betaStar, base_cff::ctppsLHCInfo, Exception, PostProcessor_cff::profile, AlCaHLTBitMon_QueryRunRegistry::string, w, x, CTPPSCompositeESSource::ProfileData::xangle, CTPPSCompositeESSource::ProfileData::xangleBetaStarBins, and y.

Referenced by CTPPSCompositeESSource().

◆ buildOptics()

void CTPPSCompositeESSource::buildOptics ( const edm::ParameterSet profile,
ProfileData pData 
)
private

Definition at line 314 of file CTPPSCompositeESSource.cc.

314  {
315  const auto &ctppsOpticalFunctions = profile.getParameter<edm::ParameterSet>("ctppsOpticalFunctions");
316 
317  struct FileInfo {
318  double m_xangle;
319  std::string m_fileName;
320  };
321 
322  std::vector<FileInfo> fileInfo;
323 
324  for (const auto &pset : ctppsOpticalFunctions.getParameter<std::vector<edm::ParameterSet>>("opticalFunctions")) {
325  const double &xangle = pset.getParameter<double>("xangle");
326  const std::string &fileName = pset.getParameter<edm::FileInPath>("fileName").fullPath();
327  fileInfo.push_back({xangle, fileName});
328  }
329 
330  struct RPInfo {
331  std::string m_dirName;
332  double m_scoringPlaneZ;
333  };
334 
335  std::unordered_map<unsigned int, RPInfo> rpInfo;
336 
337  for (const auto &pset : ctppsOpticalFunctions.getParameter<std::vector<edm::ParameterSet>>("scoringPlanes")) {
338  const unsigned int rpId = pset.getParameter<unsigned int>("rpId");
339  const std::string dirName = pset.getParameter<std::string>("dirName");
340  const double z = pset.getParameter<double>("z");
341  const RPInfo entry = {dirName, z};
342  rpInfo.emplace(rpId, entry);
343  }
344 
345  for (const auto &fi : fileInfo) {
346  std::unordered_map<unsigned int, LHCOpticalFunctionsSet> xa_data;
347 
348  for (const auto &rpi : rpInfo) {
349  LHCOpticalFunctionsSet fcn(fi.m_fileName, rpi.second.m_dirName, rpi.second.m_scoringPlaneZ);
350  xa_data.emplace(rpi.first, std::move(fcn));
351  }
352 
353  pData.lhcOptical.emplace(fi.m_xangle, xa_data);
354  }
355 }

References base_cff::ctppsOpticalFunctions, TrackerOfflineValidation_Dqm_cff::dirName, mps_splice::entry, fcn(), tkal_create_file_lists::FileInfo, MillePedeFileConverter_cfg::fileName, contentValuesFiles::fullPath, CTPPSCompositeESSource::ProfileData::lhcOptical, eostools::move(), PostProcessor_cff::profile, muonDTDigis_cfi::pset, profile_2016_postTS2_cff::rpId, AlCaHLTBitMon_QueryRunRegistry::string, OpticalFunctionsConfig_cfi::xangle, and z.

Referenced by CTPPSCompositeESSource().

◆ fillDescriptions()

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

Definition at line 192 of file CTPPSCompositeESSource.cc.

192  {
194  desc.add<std::string>("compactViewTag", "")->setComment("label of the geometry compact view");
195  desc.add<std::string>("lhcInfoLabel", "")->setComment("label of the LHCInfo record");
196  desc.add<std::string>("opticsLabel", "")->setComment("label of the optics record");
197  desc.add<unsigned int>("seed", 1)->setComment("random seed");
198  desc.add<bool>("isRun2", false)->setComment("use diamond's run 2 geometry definition?");
199  desc.addUntracked<unsigned int>("generateEveryNEvents", 1)->setComment("how often to switch conditions");
200  desc.addUntracked<unsigned int>("verbosity", 0);
201 
202  edm::ParameterSetDescription desc_profile;
203  std::vector<edm::ParameterSet> vp;
204  desc_profile.add<double>("L_int", 0.)->setComment("integrated luminosity");
205 
206  // lhcInfo
207  edm::ParameterSetDescription desc_profile_ctppsLHCInfo;
208  desc_profile_ctppsLHCInfo.add<double>("xangle", -1)
209  ->setComment("constant xangle, if negative, the xangle/beta* distribution will be used");
210  desc_profile_ctppsLHCInfo.add<double>("betaStar", 0.)->setComment("constant beta*");
211  desc_profile_ctppsLHCInfo.add<double>("beamEnergy", 0.)->setComment("beam energy");
212  desc_profile_ctppsLHCInfo.add<std::string>("xangleBetaStarHistogramFile", "")
213  ->setComment("ROOT file with xangle/beta* distribution");
214  desc_profile_ctppsLHCInfo.add<std::string>("xangleBetaStarHistogramObject", "")
215  ->setComment("xangle distribution object in the ROOT file");
216  desc_profile.add<edm::ParameterSetDescription>("ctppsLHCInfo", desc_profile_ctppsLHCInfo);
217 
218  // optics
219  edm::ParameterSetDescription desc_profile_ctppsOpticalFunctions;
221  of_desc.add<double>("xangle")->setComment("half crossing angle value in urad");
222  of_desc.add<edm::FileInPath>("fileName")->setComment("ROOT file with optical functions");
223  std::vector<edm::ParameterSet> of;
224  desc_profile_ctppsOpticalFunctions.addVPSet("opticalFunctions", of_desc, of)
225  ->setComment("list of optical functions at different crossing angles");
226 
228  sp_desc.add<unsigned int>("rpId")->setComment("associated detector DetId");
229  sp_desc.add<std::string>("dirName")->setComment("associated path to the optical functions file");
230  sp_desc.add<double>("z")->setComment("longitudinal position at scoring plane/detector");
231  std::vector<edm::ParameterSet> sp;
232  desc_profile_ctppsOpticalFunctions.addVPSet("scoringPlanes", sp_desc, sp)
233  ->setComment("list of sensitive planes/detectors stations");
234  desc_profile.add<edm::ParameterSetDescription>("ctppsOpticalFunctions", desc_profile_ctppsOpticalFunctions);
235 
236  // alignment
237  edm::ParameterSetDescription desc_profile_ctppsRPAlignmentCorrectionsDataXML;
238  desc_profile_ctppsRPAlignmentCorrectionsDataXML.add<std::vector<std::string>>("MeasuredFiles");
239  desc_profile_ctppsRPAlignmentCorrectionsDataXML.add<std::vector<std::string>>("RealFiles");
240  desc_profile_ctppsRPAlignmentCorrectionsDataXML.add<std::vector<std::string>>("MisalignedFiles");
241  desc_profile.add<edm::ParameterSetDescription>("ctppsRPAlignmentCorrectionsDataXML",
242  desc_profile_ctppsRPAlignmentCorrectionsDataXML);
243 
244  // direct simu config
245  edm::ParameterSetDescription desc_profile_ctppsDirectSimuData;
246  desc_profile_ctppsDirectSimuData.add<std::string>("empiricalAperture45");
247  desc_profile_ctppsDirectSimuData.add<std::string>("empiricalAperture56");
248 
249  desc_profile_ctppsDirectSimuData.add<std::string>("timeResolutionDiamonds45");
250  desc_profile_ctppsDirectSimuData.add<std::string>("timeResolutionDiamonds56");
251 
253  eps_desc.add<unsigned int>("rpId")->setComment("RP id");
254  eps_desc.add<std::string>("file")->setComment("file name");
255  eps_desc.add<std::string>("object")->setComment("path to the efficiency histogram");
256  desc_profile_ctppsDirectSimuData.addVPSet("efficienciesPerRP", eps_desc, std::vector<edm::ParameterSet>());
257  desc_profile_ctppsDirectSimuData.addVPSet("efficienciesPerPlane", eps_desc, std::vector<edm::ParameterSet>());
258 
259  desc_profile.add<edm::ParameterSetDescription>("ctppsDirectSimuData", desc_profile_ctppsDirectSimuData);
260 
261  desc.addVPSet("periods", desc_profile, vp)->setComment("profiles");
262 
263  descriptions.add("ctppsCompositeESSource", desc);
264 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, edm::ParameterDescriptionNode::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ produceDirectSimuData()

std::unique_ptr< PPSDirectSimulationData > CTPPSCompositeESSource::produceDirectSimuData ( const PPSDirectSimulationDataRcd )

Definition at line 488 of file CTPPSCompositeESSource.cc.

489  {
490  return std::make_unique<PPSDirectSimulationData>(currentProfile_->directSimuData);
491 }

References currentProfile_, and CTPPSCompositeESSource::ProfileData::directSimuData.

Referenced by CTPPSCompositeESSource().

◆ produceLhcInfo()

std::unique_ptr< LHCInfo > CTPPSCompositeESSource::produceLhcInfo ( const LHCInfoRcd )

Definition at line 501 of file CTPPSCompositeESSource.cc.

501  {
502  double xangle = currentProfile_->xangle;
504 
505  if (currentProfile_->xangle < 0) {
506  const double u = CLHEP::RandFlat::shoot(m_engine_.get(), 0., 1.);
507  for (const auto &d : currentProfile_->xangleBetaStarBins) {
508  if (d.min <= u && u <= d.max) {
509  xangle = d.data.first;
510  betaStar = d.data.second;
511  break;
512  }
513  }
514  }
515 
516  auto lhcInfo = std::make_unique<LHCInfo>();
517  lhcInfo->setEnergy(currentProfile_->beamEnergy);
518  lhcInfo->setCrossingAngle(xangle);
519  lhcInfo->setBetaStar(betaStar);
520 
521  edm::LogInfo("PPS") << "new LHCInfo: xangle=" << xangle << ", betaStar=" << betaStar;
522 
523  return lhcInfo;
524 }

References CTPPSCompositeESSource::ProfileData::beamEnergy, BeamSpotFakeParameters_cfi::betaStar, CTPPSCompositeESSource::ProfileData::betaStar, currentProfile_, ztail::d, m_engine_, OpticalFunctionsConfig_cfi::xangle, CTPPSCompositeESSource::ProfileData::xangle, and CTPPSCompositeESSource::ProfileData::xangleBetaStarBins.

Referenced by CTPPSCompositeESSource().

◆ produceMisalignedAlignments()

std::shared_ptr< CTPPSRPAlignmentCorrectionsData > CTPPSCompositeESSource::produceMisalignedAlignments ( const RPMisalignedAlignmentRecord )

Definition at line 462 of file CTPPSCompositeESSource.cc.

463  {
465 }

References CTPPSCompositeESSource::ProfileData::acMisaligned, and currentProfile_.

◆ produceMisalignedTG()

std::shared_ptr< CTPPSGeometry > CTPPSCompositeESSource::produceMisalignedTG ( const VeryForwardMisalignedGeometryRecord iRecord)

◆ produceOptics()

std::unique_ptr< LHCOpticalFunctionsSetCollection > CTPPSCompositeESSource::produceOptics ( const CTPPSOpticsRcd )

Definition at line 495 of file CTPPSCompositeESSource.cc.

495  {
496  return std::make_unique<LHCOpticalFunctionsSetCollection>(currentProfile_->lhcOptical);
497 }

References currentProfile_, and CTPPSCompositeESSource::ProfileData::lhcOptical.

Referenced by CTPPSCompositeESSource().

◆ produceRealAlignments()

std::shared_ptr< CTPPSRPAlignmentCorrectionsData > CTPPSCompositeESSource::produceRealAlignments ( const RPRealAlignmentRecord )

Definition at line 455 of file CTPPSCompositeESSource.cc.

456  {
457  return currentProfile_->acReal;
458 }

References CTPPSCompositeESSource::ProfileData::acReal, and currentProfile_.

◆ produceRealTG()

std::shared_ptr< CTPPSGeometry > CTPPSCompositeESSource::produceRealTG ( const VeryForwardRealGeometryRecord iRecord)

◆ setIntervalFor()

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

Implements edm::EventSetupRecordIntervalFinder.

Definition at line 427 of file CTPPSCompositeESSource.cc.

429  {
430  // determine new IOV
431  edm::EventID beginEvent = iosv.eventID();
432  edm::EventID endEvent(beginEvent.run(), beginEvent.luminosityBlock(), beginEvent.event() + generateEveryNEvents_);
433  oValidity = edm::ValidityInterval(edm::IOVSyncValue(beginEvent), edm::IOVSyncValue(endEvent));
434 
435  // stop if new profile has already been generated
436  if (beginEvent.run() == previously_set_eventID_.run() &&
438  return;
439 
440  previously_set_eventID_ = beginEvent;
441 
442  // randomly pick the next profile
443  const double u = CLHEP::RandFlat::shoot(m_engine_.get(), 0., 1.);
444 
445  for (const auto &bin : profile_bins_) {
446  if (bin.min <= u && u <= bin.max) {
447  currentProfile_ = &bin.data;
448  break;
449  }
450  }
451 }

References newFWLiteAna::bin, currentProfile_, edm::EventID::event(), edm::IOVSyncValue::eventID(), generateEveryNEvents_, edm::EventID::luminosityBlock(), m_engine_, previously_set_eventID_, profile_bins_, and edm::EventID::run().

Member Data Documentation

◆ compactViewTag_

std::string CTPPSCompositeESSource::compactViewTag_
private

Definition at line 73 of file CTPPSCompositeESSource.cc.

Referenced by CTPPSCompositeESSource().

◆ currentProfile_

const ProfileData* CTPPSCompositeESSource::currentProfile_
private

◆ generateEveryNEvents_

unsigned int CTPPSCompositeESSource::generateEveryNEvents_
private

Definition at line 76 of file CTPPSCompositeESSource.cc.

Referenced by setIntervalFor().

◆ geometryBuilt_

bool CTPPSCompositeESSource::geometryBuilt_
private

Definition at line 125 of file CTPPSCompositeESSource.cc.

Referenced by buildGeometry(), produceMisalignedTG(), and produceRealTG().

◆ isRun2_

const bool CTPPSCompositeESSource::isRun2_
private

Definition at line 78 of file CTPPSCompositeESSource.cc.

Referenced by buildGeometry().

◆ lhcInfoLabel_

std::string CTPPSCompositeESSource::lhcInfoLabel_
private

Definition at line 74 of file CTPPSCompositeESSource.cc.

Referenced by CTPPSCompositeESSource().

◆ m_engine_

std::unique_ptr<CLHEP::HepRandomEngine> CTPPSCompositeESSource::m_engine_
private

Definition at line 116 of file CTPPSCompositeESSource.cc.

Referenced by produceLhcInfo(), and setIntervalFor().

◆ opticsLabel_

std::string CTPPSCompositeESSource::opticsLabel_
private

Definition at line 75 of file CTPPSCompositeESSource.cc.

Referenced by CTPPSCompositeESSource().

◆ previously_set_eventID_

edm::EventID CTPPSCompositeESSource::previously_set_eventID_
private

Definition at line 133 of file CTPPSCompositeESSource.cc.

Referenced by setIntervalFor().

◆ profile_bins_

std::vector<BinData<ProfileData> > CTPPSCompositeESSource::profile_bins_
private

◆ tokenCompactViewMisaligned_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> CTPPSCompositeESSource::tokenCompactViewMisaligned_
private

Definition at line 81 of file CTPPSCompositeESSource.cc.

Referenced by CTPPSCompositeESSource(), and produceMisalignedTG().

◆ tokenCompactViewReal_

edm::ESGetToken<DDCompactView, IdealGeometryRecord> CTPPSCompositeESSource::tokenCompactViewReal_
private

Definition at line 81 of file CTPPSCompositeESSource.cc.

Referenced by CTPPSCompositeESSource(), and produceRealTG().

◆ verbosity_

unsigned int CTPPSCompositeESSource::verbosity_
private

Definition at line 77 of file CTPPSCompositeESSource.cc.

Referenced by buildAlignment(), and buildGeometry().

edm::eventsetup::DependentRecordImplementation::getRecord
const DepRecordT getRecord() const
Definition: DependentRecordImplementation.h:50
CTPPSCompositeESSource::tokenCompactViewMisaligned_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > tokenCompactViewMisaligned_
Definition: CTPPSCompositeESSource.cc:81
DDAxes::y
CTPPSCompositeESSource::lhcInfoLabel_
std::string lhcInfoLabel_
Definition: CTPPSCompositeESSource.cc:74
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CTPPSCompositeESSource::produceOptics
std::unique_ptr< LHCOpticalFunctionsSetCollection > produceOptics(const CTPPSOpticsRcd &)
Definition: CTPPSCompositeESSource.cc:495
CTPPSCompositeESSource::produceMisalignedTG
std::shared_ptr< CTPPSGeometry > produceMisalignedTG(const VeryForwardMisalignedGeometryRecord &)
Definition: CTPPSCompositeESSource.cc:478
base_cff.ctppsLHCInfo
ctppsLHCInfo
Definition: base_cff.py:14
BeamSpotFakeParameters_cfi.betaStar
betaStar
Definition: BeamSpotFakeParameters_cfi.py:19
CTPPSCompositeESSource::buildAlignment
void buildAlignment(const edm::ParameterSet &profile, ProfileData &pData)
Definition: CTPPSCompositeESSource.cc:359
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
mps_splice.entry
entry
Definition: mps_splice.py:68
CTPPSCompositeESSource::generateEveryNEvents_
unsigned int generateEveryNEvents_
Definition: CTPPSCompositeESSource.cc:76
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CTPPSCompositeESSource::buildGeometry
void buildGeometry(const DDCompactView &cpv)
Definition: CTPPSCompositeESSource.cc:296
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSCompositeESSource::compactViewTag_
std::string compactViewTag_
Definition: CTPPSCompositeESSource.cc:73
CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon
Definition: CTPPSRPAlignmentCorrectionsDataESSourceXMLCommon.h:17
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DDAxes::x
CTPPSCompositeESSource::opticsLabel_
std::string opticsLabel_
Definition: CTPPSCompositeESSource.cc:75
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
fcn
void fcn(int &, double *, double &, double *, int)
Definition: LASBarrelAlgorithm.cc:388
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
edm::ParameterSet::addUntrackedParameter
void addUntrackedParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:192
CTPPSCompositeESSource::buildLHCInfo
void buildLHCInfo(const edm::ParameterSet &profile, ProfileData &pData)
Definition: CTPPSCompositeESSource.cc:382
CTPPSCompositeESSource::previously_set_eventID_
edm::EventID previously_set_eventID_
Definition: CTPPSCompositeESSource.cc:133
CTPPSCompositeESSource::buildDirectSimuData
void buildDirectSimuData(const edm::ParameterSet &profile, ProfileData &pData)
Definition: CTPPSCompositeESSource.cc:268
edm::FileInPath
Definition: FileInPath.h:64
CTPPSCompositeESSource::verbosity_
unsigned int verbosity_
Definition: CTPPSCompositeESSource.cc:77
CTPPSCompositeESSource::ProfileData::directSimuData
PPSDirectSimulationData directSimuData
Definition: CTPPSCompositeESSource.cc:108
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSCompositeESSource::buildOptics
void buildOptics(const edm::ParameterSet &profile, ProfileData &pData)
Definition: CTPPSCompositeESSource.cc:314
LHCOpticalFunctionsSet
Set of optical functions corresponding to one scoring plane along LHC.
Definition: LHCOpticalFunctionsSet.h:13
CTPPSCompositeESSource::currentProfile_
const ProfileData * currentProfile_
Definition: CTPPSCompositeESSource.cc:113
w
const double w
Definition: UKUtility.cc:23
CTPPSCompositeESSource::geometryBuilt_
bool geometryBuilt_
Definition: CTPPSCompositeESSource.cc:125
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
DDAxes::z
CTPPSCompositeESSource::ProfileData::xangle
double xangle
Definition: CTPPSCompositeESSource.cc:91
edm::es::Label
Definition: es_Label.h:56
base_cff.ctppsDirectSimuData
ctppsDirectSimuData
Definition: base_cff.py:36
CTPPSCompositeESSource::m_engine_
std::unique_ptr< CLHEP::HepRandomEngine > m_engine_
Definition: CTPPSCompositeESSource.cc:116
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
CTPPSCompositeESSource::ProfileData::acMisaligned
std::shared_ptr< CTPPSRPAlignmentCorrectionsData > acMisaligned
Definition: CTPPSCompositeESSource.cc:105
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
OpticalFunctionsConfig_cfi.xangle
xangle
Definition: OpticalFunctionsConfig_cfi.py:17
base_cff.ctppsOpticalFunctions
ctppsOpticalFunctions
Definition: base_cff.py:23
PostProcessor_cff.profile
profile
Definition: PostProcessor_cff.py:38
CTPPSCompositeESSource::ProfileData::betaStar
double betaStar
Definition: CTPPSCompositeESSource.cc:91
edm::IOVSyncValue::eventID
const EventID & eventID() const
Definition: IOVSyncValue.h:40
edm::ParameterSet
Definition: ParameterSet.h:47
CTPPSCompositeESSource::produceDirectSimuData
std::unique_ptr< PPSDirectSimulationData > produceDirectSimuData(const PPSDirectSimulationDataRcd &)
Definition: CTPPSCompositeESSource.cc:488
tkal_create_file_lists.FileInfo
FileInfo
Definition: tkal_create_file_lists.py:1119
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
CTPPSGeometryESCommon::applyAlignments
std::unique_ptr< DetGeomDesc > applyAlignments(const DetGeomDesc &, const CTPPSRPAlignmentCorrectionsData *)
Definition: CTPPSGeometryESCommon.cc:6
CTPPSCompositeESSource::tokenCompactViewReal_
edm::ESGetToken< DDCompactView, IdealGeometryRecord > tokenCompactViewReal_
Definition: CTPPSCompositeESSource.cc:81
CTPPSCompositeESSource::isRun2_
const bool isRun2_
Definition: CTPPSCompositeESSource.cc:78
CTPPSCompositeESSource::ProfileData::beamEnergy
double beamEnergy
Definition: CTPPSCompositeESSource.cc:91
CTPPSCompositeESSource::ProfileData::xangleBetaStarBins
std::vector< BinData< std::pair< double, double > > > xangleBetaStarBins
Definition: CTPPSCompositeESSource.cc:92
looper.cfg
cfg
Definition: looper.py:297
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
profile_2016_postTS2_cff.rpId
rpId
Definition: profile_2016_postTS2_cff.py:21
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
CTPPSCompositeESSource::ProfileData::misalignedTG
std::shared_ptr< CTPPSGeometry > misalignedTG
Definition: CTPPSCompositeESSource.cc:101
eostools.move
def move(src, dest)
Definition: eostools.py:511
CTPPSCompositeESSource::ProfileData::lhcOptical
LHCOpticalFunctionsSetCollection lhcOptical
Definition: CTPPSCompositeESSource.cc:95
Exception
Definition: hltDiff.cc:245
CTPPSCompositeESSource::produceLhcInfo
std::unique_ptr< LHCInfo > produceLhcInfo(const LHCInfoRcd &)
Definition: CTPPSCompositeESSource.cc:501
CTPPSRPAlignmentCorrectionsData
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
Definition: CTPPSRPAlignmentCorrectionsData.h:24
TrackerOfflineValidation_Dqm_cff.dirName
dirName
Definition: TrackerOfflineValidation_Dqm_cff.py:55
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CTPPSCompositeESSource::ProfileData::realTG
std::shared_ptr< CTPPSGeometry > realTG
Definition: CTPPSCompositeESSource.cc:102
CTPPSCompositeESSource::produceRealTG
std::shared_ptr< CTPPSGeometry > produceRealTG(const VeryForwardRealGeometryRecord &)
Definition: CTPPSCompositeESSource.cc:469
ztail.d
d
Definition: ztail.py:151
CTPPSCompositeESSource::profile_bins_
std::vector< BinData< ProfileData > > profile_bins_
Definition: CTPPSCompositeESSource.cc:112
CTPPSCompositeESSource::ProfileData::acReal
std::shared_ptr< CTPPSRPAlignmentCorrectionsData > acReal
Definition: CTPPSCompositeESSource.cc:105
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
edm::EventID
Definition: EventID.h:31
detgeomdescbuilder::buildDetGeomDescFromCompactView
std::unique_ptr< DetGeomDesc > buildDetGeomDescFromCompactView(const DDCompactView &myCompactView, const bool isRun2)
Definition: DetGeomDescBuilder.cc:10
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27