CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::FileInPath Class Reference

#include <FileInPath.h>

Public Types

enum  LocationCode { Unknown = 0, Local = 1, Release = 2, Data = 3 }
 

Public Member Functions

 FileInPath ()
 
 FileInPath (const char *r)
 
 FileInPath (const std::string &r)
 We throw an exception is the referenced file is not found. More...
 
 FileInPath (FileInPath const &other)
 
std::string fullPath () const
 
LocationCode location () const
 Where was the file found? More...
 
FileInPathoperator= (FileInPath const &other)
 
void read (std::istream &is)
 
void readFromParameterSetBlob (std::istream &is)
 
std::string relativePath () const
 
void swap (FileInPath &other)
 
void write (std::ostream &os) const
 
 ~FileInPath ()
 

Static Public Member Functions

static void disableFileLookup ()
 Should only be called while the edmWriteConfigs executable runs. More...
 

Private Member Functions

void getEnvironment ()
 
void initialize_ ()
 

Private Attributes

std::string canonicalFilename_
 
std::string dataTop_
 
std::string localTop_
 
LocationCode location_
 
std::string relativePath_
 
std::string releaseTop_
 
std::string searchPath_
 

Detailed Description

Definition at line 64 of file FileInPath.h.

Member Enumeration Documentation

◆ LocationCode

Enumerator
Unknown 
Local 
Release 
Data 

Definition at line 66 of file FileInPath.h.

66 { Unknown = 0, Local = 1, Release = 2, Data = 3 };

Constructor & Destructor Documentation

◆ FileInPath() [1/4]

edm::FileInPath::FileInPath ( )

Default c'tor does no file-existence check; what file would it check for existence?

Definition at line 106 of file FileInPath.cc.

107  if (s_fileLookupDisabled) {
108  return;
109  }
110  getEnvironment();
111  }

References getEnvironment().

◆ FileInPath() [2/4]

edm::FileInPath::FileInPath ( const std::string &  r)
explicit

We throw an exception is the referenced file is not found.

Definition at line 113 of file FileInPath.cc.

114  if (s_fileLookupDisabled) {
115  return;
116  }
117  getEnvironment();
118  initialize_();
119  }

References getEnvironment(), and initialize_().

◆ FileInPath() [3/4]

edm::FileInPath::FileInPath ( const char *  r)
explicit

Definition at line 121 of file FileInPath.cc.

122  if (s_fileLookupDisabled) {
123  return;
124  }
125  if (r == nullptr) {
126  throw edm::Exception(edm::errors::FileInPathError) << "Relative path must not be null\n";
127  }
128  getEnvironment();
129  initialize_();
130  }

References Exception, edm::errors::FileInPathError, getEnvironment(), initialize_(), and alignCSCRings::r.

◆ FileInPath() [4/4]

edm::FileInPath::FileInPath ( FileInPath const &  other)

Definition at line 132 of file FileInPath.cc.

133  : relativePath_(other.relativePath_),
134  canonicalFilename_(other.canonicalFilename_),
135  location_(other.location_),
136  localTop_(other.localTop_),
137  releaseTop_(other.releaseTop_),
138  dataTop_(other.dataTop_),
139  searchPath_(other.searchPath_) {}

◆ ~FileInPath()

edm::FileInPath::~FileInPath ( )

Definition at line 141 of file FileInPath.cc.

141 {}

Member Function Documentation

◆ disableFileLookup()

void edm::FileInPath::disableFileLookup ( )
static

Should only be called while the edmWriteConfigs executable runs.

Definition at line 436 of file FileInPath.cc.

436 { s_fileLookupDisabled = true; }

◆ fullPath()

std::string edm::FileInPath::fullPath ( ) const

Return a string that can be used to open the referenced file.

Note that operations on this file may fail, including testing for existence. This is because the state of a filesystem is global; other threads, processes, etc., may have removed the file since we checked on its existence at the time of construction of the FileInPath object.

Definition at line 163 of file FileInPath.cc.

163 { return canonicalFilename_; }

References canonicalFilename_.

Referenced by MillePedeAlignmentAlgorithm::addPxbSurvey(), SiStripNoisesBuilder::analyze(), SiStripApvGainBuilder::analyze(), SiStripPedestalsBuilder::analyze(), SiStripThresholdBuilder::analyze(), JetCorrectorDemo::analyze(), MuonGeometrySVGTemplate::analyze(), HcalLutAnalyzer::analyze(), PixelRegions::attachedDets(), BeamSpotFakeConditions::BeamSpotFakeConditions(), AntiElectronIDMVA6::beginEvent(), JetCorrectorDBWriter::beginJob(), ProtonTaggerFilter::beginJob(), omtf::OmtfPacker::beginRun(), omtf::OmtfUnpacker::beginRun(), GoodSeedProducer::beginRun(), HGCalValidator::bookHistograms(), BTagSFProducer::BTagSFProducer(), HcalTPGCoderULUT::buildCoder(), magneticfield::MagGeoBuilder::buildInterpolator(), MagGeoBuilderFromDDD::buildInterpolator(), HGCalTriggerGeometryImp1::buildMaps(), CaloMiscalibTools::CaloMiscalibTools(), CaloMiscalibToolsMC::CaloMiscalibToolsMC(), GBRForestWriter::categoryEntryType::categoryEntryType(), CTPPSPixelDAQMappingESSourceXML::CompleteFileName(), TotemDAQMappingESSourceXML::CompleteFileName(), createGBRForest(), CSCTFPtLUT::CSCTFPtLUT(), SiStripPopConNoisesHandlerFromDQM::dqmEndJob(), SiStripPopConPedestalsHandlerFromDQM::dqmEndJob(), SiStripPopConBadComponentsHandlerFromDQM::dqmEndJob(), SiStripPopConFEDErrorsHandlerFromDQM::dqmEndJob(), DTOccupancyTestML::dqmEndLuminosityBlock(), dtCalibration::DTTTrigResidualCorrection::DTTTrigResidualCorrection(), EcalDQMonitorClient::EcalDQMonitorClient(), ElectronIdMVAProducer::ElectronIdMVAProducer(), ElectronPATIdMVAProducer::ElectronPATIdMVAProducer(), OccupancyPlots::endRun(), ESDataFormatterV4::ESDataFormatterV4(), ESDigiToRaw::ESDigiToRaw(), ESElectronicsMapper::ESElectronicsMapper(), ESIntegrityClient::ESIntegrityClient(), ESPedestalClient::ESPedestalClient(), ESUnpacker::ESUnpacker(), SiStripPI::fillBCArrays(), HGCalTriggerGeometryHexImp1::fillMaps(), HGCalTriggerGeometryHexImp2::fillMaps(), HGCalTriggerGeometryV9Imp2::fillMaps(), HGCalTriggerGeometryHexLayerBasedImp1::fillMaps(), HGCalTriggerGeometryV9Imp1::fillMaps(), HGCalTriggerGeometryHexImp2::fillNeighborMaps(), popcon::SiStripPopConHandlerUnitTest< T >::fillObject(), popcon::SiStripPopConHandlerUnitTestGain< T >::fillObject(), popcon::SiStripPopConHandlerUnitTestNoise< T >::fillObject(), SiStripPI::fillTotalComponents(), gen::BaseHadronizer::generateLHE(), ESTrivialConditionRetriever::getChannelStatusFromConfiguration(), EcalTrivialConditionRetriever::getChannelStatusFromConfiguration(), EcalTrivialConditionRetriever::getMappingFromConfiguration(), SiStripBadStripFromASCIIFile::getNewObject(), SiStripGainFromAsciiFile::getNewObject(), SiStripBadFiberBuilder::getNewObject(), SiStripBadChannelBuilder::getNewObject(), SiStripNoisesFromDBMiscalibrator::getNewObject_withDefaults(), EcalMappingElectronicsHandler::getNewObjects(), EcalTrivialConditionRetriever::getPFRecHitThresholdsFromConfiguration(), EcalTrivialConditionRetriever::getTrgChannelStatusFromConfiguration(), ESTrivialConditionRetriever::getWeightsFromConfiguration(), EcalTrivialConditionRetriever::getWeightsFromConfiguration(), HcalHardcodeCalibrations::HcalHardcodeCalibrations(), HcalLaserEventFilter2012::HcalLaserEventFilter2012(), l1t::HGC3DClusterTMVASelector::HGC3DClusterTMVASelector(), HGCalTriggerTowerGeometryHelper::HGCalTriggerTowerGeometryHelper(), HGCalValidator::HGCalValidator(), PDFWeightsHelper::Init(), gen::EvtGenInterface::init(), l1tpf::corrector::init_(), CandidateBoostedDoubleSecondaryVertexComputer::initialize(), MuonTagger::initialize(), CandidateChargeBTagComputer::initialize(), CombinedMVAV2JetTagComputer::initialize(), ElectronTagger::initialize(), CharmTagger::initialize(), ApeSettingAlgorithm::initialize(), DeepMETProducer::initializeGlobalCache(), DeepFlavourONNXJetTagsProducer::initializeGlobalCache(), DeepDoubleXONNXJetTagsProducer::initializeGlobalCache(), TrackstersMergeProducer::initializeGlobalCache(), TrackstersProducer::initializeGlobalCache(), DeepBoostedJetONNXJetTagsProducer::initializeGlobalCache(), deep_tau::DeepTauBase::initializeGlobalCache(), PileupJetIdProducer::initJetEnergyCorrector(), L1EGammaEECalibrator::L1EGammaEECalibrator(), L1FPGATrackProducer::L1FPGATrackProducer(), L1TGlobalPrescalesVetosESProducer::L1TGlobalPrescalesVetosESProducer(), L1TMuonOverlapParamsESProducer::L1TMuonOverlapParamsESProducer(), CovarianceParameterization::load(), L1MuDTPtaLut::load(), L1MuDTPhiLut::load(), L1MuDTEtaPatternLut::load(), L1MuBMTEtaPatternLut::load(), L1MuDTQualPatternLut::load(), L1MuBMTQualPatternLut::load(), L1MuDTExtLut::load(), L1TMuonBarrelParamsHelper::load_ext(), L1TMuonBarrelParamsHelper::load_phi(), L1TMuonBarrelParamsHelper::load_pt(), DTCCablingMapProducer::LoadModulesToDTCCablingMapFromCSV(), ClusterShapeHitFilter::loadStripLimits(), SiStripFedCablingFakeESSource::make(), jpt::Map::Map(), MaterialBudgetCategorizer::MaterialBudgetCategorizer(), MuonPathAnalyzerInChamber::MuonPathAnalyzerInChamber(), MuonPathAnalyzerPerSL::MuonPathAnalyzerPerSL(), MVAJetPuId::MVAJetPuId(), MVAVariableManager< reco::GsfElectron >::MVAVariableManager(), fastsim::NuclearInteraction::NuclearInteraction(), NuclearInteractionSimulator::NuclearInteractionSimulator(), gen::Herwig6Instance::openParticleSpecFile(), OverlapValidation::OverlapValidation(), HcalTBObjectUnpacker::parseCalib(), cond::persistency::parseFipConnectionString(), EcalTrigPrimESProducer::parseTextFile(), EcalTrigTowerConstituentsMapBuilder::parseTextMap(), CaloTowerConstituentsMapBuilder::parseTextMap(), cms::PileupJPTJetIdAlgo::PileupJPTJetIdAlgo(), PixelTemplateSmearerBase::PixelTemplateSmearerBase(), l1tpf::HGC3DClusterEgID::prepareTMVA(), SiPixelFakeCPEGenericErrorParmESSource::produce(), LwtnnESProducer::produce(), SiPixelFakeGainESSource::produce(), SiPixelFakeGainForHLTESSource::produce(), SiPixelFakeGainOfflineESSource::produce(), HepPDTESSource::produce(), SiPixelFakeLorentzAngleESSource::produce(), HcalTPGCoderULUT::produce(), CaloTPGTranscoderULUTs::produce(), MaskedRctInputDigiProducer::produce(), JetCorrectionESSource< Corrector >::produce(), gen::PtYDistributor::PtYDistributor(), gen::Py8InterfaceBase::Py8InterfaceBase(), PYBIND11_MODULE(), QualityTester::QualityTester(), CSCTFPtLUT::readLUT(), CSCSectorReceiverLUT::readLUTsFromFile(), GsfBetheHeitlerUpdator::readParameters(), gen::ReggeGribovPartonMCHadronizer::ReggeGribovPartonMCHadronizer(), RPCCalibSetUp::RPCCalibSetUp(), RPCDBSimSetUp::RPCDBSimSetUp(), PhiSymmetryCalibration::setUp(), ShiftedJetProducerT< T, Textractor >::ShiftedJetProducerT(), ShiftedPFCandidateProducerForNoPileUpPFMEt::ShiftedPFCandidateProducerForNoPileUpPFMEt(), ShiftedPFCandidateProducerForPFNoPUMEt::ShiftedPFCandidateProducerForPFNoPUMEt(), SiLinearChargeDivider::SiLinearChargeDivider(), SiStripBadModuleByHandBuilder::SiStripBadModuleByHandBuilder(), SiStripDigitizerAlgorithm::SiStripDigitizerAlgorithm(), SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree(), SiStripQuality::SiStripQuality(), SiStripQualityHotStripIdentifier::SiStripQualityHotStripIdentifier(), TtSemiLepHitFitProducer< LeptonCollection >::TtSemiLepHitFitProducer(), and FWRecoGeometryESProducer::writeTrackerParametersXML().

◆ getEnvironment()

void edm::FileInPath::getEnvironment ( void  )
private

Definition at line 333 of file FileInPath.cc.

333  {
334  static std::string const searchPath = removeSymLinksTokens(PathVariableName);
335  if (searchPath.empty()) {
336  throw edm::Exception(edm::errors::FileInPathError) << PathVariableName << " must be defined\n";
337  }
338  searchPath_ = searchPath;
339 
340  static std::string const releaseTop = removeSymLinksSrc(RELEASETOP);
341  releaseTop_ = releaseTop;
342 
343  static std::string const localTop = removeSymLinksSrc(LOCALTOP);
344  localTop_ = localTop;
345 
346  static std::string const dataTop = removeSymLinks(DATATOP);
347  dataTop_ = dataTop;
348 
349  if (releaseTop_.empty()) {
350  // RELEASETOP was not set. This means that the environment is set
351  // for the base release itself. So LOCALTOP actually contains the
352  // location of the base release.
354  localTop_.clear();
355  }
356  if (releaseTop_ == localTop_) {
357  // RELEASETOP is the same as LOCALTOP. This means that the environment is set
358  // for the base release itself. So LOCALTOP actually contains the
359  // location of the base release.
360  localTop_.clear();
361  }
362  }

References dataTop_, Exception, edm::errors::FileInPathError, localTop_, releaseTop_, searchPath_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FileInPath().

◆ initialize_()

void edm::FileInPath::initialize_ ( )
private

Definition at line 364 of file FileInPath.cc.

364  {
365  if (relativePath_.empty()) {
366  throw edm::Exception(edm::errors::FileInPathError) << "Relative path must not be empty\n";
367  }
368 
369  // Find the file, based on the value of path variable.
370  typedef std::vector<std::string> stringvec_t;
371  stringvec_t pathElements = tokenize(searchPath_, ":");
372  for (auto const& element : pathElements) {
373  // Set the boost::fs path to the current element of
374  // CMSSW_SEARCH_PATH:
375  bf::path pathPrefix(element);
376 
377  // Does the a file exist? locateFile throws is it finds
378  // something goofy.
379  if (locateFile(pathPrefix, relativePath_)) {
380  // Convert relative path to canonical form, and save it.
381  relativePath_ = bf::path(relativePath_).normalize().string();
382 
383  // Save the absolute path.
384  canonicalFilename_ = bf::absolute(relativePath_, pathPrefix).string();
385  if (canonicalFilename_.empty()) {
387  << "fullPath is empty"
388  << "\nrelativePath() is: " << relativePath_ << "\npath prefix is: " << pathPrefix.string() << '\n';
389  }
390 
391  // From the current path element, find the branch path (basically the path minus the
392  // last directory, e.g. /src or /share):
393  for (bf::path br = pathPrefix.branch_path(); !br.normalize().string().empty(); br = br.branch_path()) {
394  if (!localTop_.empty()) {
395  // Create a path object for our local path LOCALTOP:
396  bf::path local_(localTop_);
397  // If the branch path matches the local path, the file was found locally:
398  if (br == local_) {
399  location_ = Local;
400  return;
401  }
402  }
403 
404  if (!releaseTop_.empty()) {
405  // Create a path object for our release path RELEASETOP:
406  bf::path release_(releaseTop_);
407  // If the branch path matches the release path, the file was found in the release:
408  if (br == release_) {
409  location_ = Release;
410  return;
411  }
412  }
413 
414  if (!dataTop_.empty()) {
415  // Create a path object for our data path DATATOP:
416  bf::path data_(dataTop_);
417  // If the branch path matches the data path, the file was found in the data area:
418  if (br == data_) {
419  location_ = Data;
420  return;
421  }
422  }
423  }
424  }
425  }
426 
427  // If we got here, we ran out of path elements without finding
428  // what we're looking found.
430  << "edm::FileInPath unable to find file " << relativePath_ << " anywhere in the search path."
431  << "\nThe search path is defined by: " << PathVariableName << "\n${" << PathVariableName
432  << "} is: " << std::getenv(PathVariableName.c_str())
433  << "\nCurrent directory is: " << bf::initial_path().string() << "\n";
434  }

References beamvalidation::br, canonicalFilename_, Data, dataTop_, Exception, edm::errors::FileInPathError, Local, localTop_, location_, castor_dqm_sourceclient_file_cfg::path, relativePath_, Release, releaseTop_, searchPath_, and edm::tokenize().

Referenced by FileInPath().

◆ location()

FileInPath::LocationCode edm::FileInPath::location ( ) const

◆ operator=()

FileInPath & edm::FileInPath::operator= ( FileInPath const &  other)

Definition at line 143 of file FileInPath.cc.

143  {
145  this->swap(temp);
146  return *this;
147  }

References trackingPlots::other, swap(), and groupFilesInBlocks::temp.

◆ read()

void edm::FileInPath::read ( std::istream &  is)

Read from the given istream, and set contents accordingly. Reading errors are reflected in the state of the stream.

Definition at line 204 of file FileInPath.cc.

204  {
205  std::string vsn;
206  std::string relname;
207  std::string canFilename;
208 #if 1
209  // This #if needed for backward compatibility
210  // for files written before CMSSW_1_5_0_pre3.
211  is >> vsn;
212  if (!is)
213  return;
214  bool oldFormat = (version != vsn);
215  if (oldFormat) {
216  relname = vsn;
217  bool local;
218  is >> local;
219  location_ = (local ? Local : Release);
220  is >> canFilename;
221  } else {
222  // Current format
223  int loc;
224  is >> relname >> loc;
225  location_ = static_cast<FileInPath::LocationCode>(loc);
226  if (location_ != Unknown)
227  is >> canFilename;
228  }
229 #else
230  is >> vsn >> relname >> loc >> canFilename;
231 #endif
232  if (!is)
233  return;
234  relativePath_ = relname;
235  if (location_ == Local) {
236  if (localTop_.empty()) {
237  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << LOCALTOP << " is not set.\n"
238  << "Trying to read Local file: " << canFilename << ".\n";
239  }
240 #if 1
241  // This #if needed for backward compatibility
242  // for files written before CMSSW_1_5_0_pre3.
243  if (oldFormat) {
244  canonicalFilename_ = canFilename;
245  } else
246 #endif
247  canonicalFilename_ = localTop_ + canFilename;
248  } else if (location_ == Release) {
249  if (releaseTop_.empty()) {
250  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << RELEASETOP << " is not set.\n";
251  }
252 #if 1
253  // This #if needed for backward compatibility
254  // for files written before CMSSW_1_5_0_pre3.
255  if (oldFormat) {
256  std::string::size_type pos = canFilename.find(BASE);
257  if (pos == 0) {
258  // Replace the placehoder with the path to the base release (site dependent).
259  canonicalFilename_ = releaseTop_ + canFilename.substr(BASE.size());
260  } else {
261  // Needed for files written before CMSSW_1_2_0_pre2.
262  canonicalFilename_ = canFilename;
263  }
264  } else
265 #endif
266  canonicalFilename_ = releaseTop_ + canFilename;
267  } else if (location_ == Data) {
268  if (dataTop_.empty()) {
269  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << DATATOP << " is not set.\n";
270  }
271  canonicalFilename_ = dataTop_ + canFilename;
272  }
273  }

References canonicalFilename_, Data, dataTop_, Exception, edm::errors::FileInPathError, DTRecHitClients_cfi::local, Local, localTop_, location_, relativePath_, Release, releaseTop_, AlCaHLTBitMon_QueryRunRegistry::string, Unknown, and BeamSplash_cfg::version.

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and edm::operator>>().

◆ readFromParameterSetBlob()

void edm::FileInPath::readFromParameterSetBlob ( std::istream &  is)

Definition at line 275 of file FileInPath.cc.

275  {
276  std::string vsn;
277  std::string relname;
278  std::string canFilename;
279  is >> vsn;
280  if (!is)
281  return;
282  bool oldFormat = (version != vsn);
283  if (oldFormat) {
284  relname = vsn;
285  bool local;
286  is >> local;
287  location_ = (local ? Local : Release);
288  is >> canFilename;
289  } else {
290  // Current format
291  int loc;
292  is >> relname >> loc;
293  location_ = static_cast<FileInPath::LocationCode>(loc);
294  if (location_ != Unknown)
295  is >> canFilename;
296  }
297  if (!is)
298  return;
299  relativePath_ = relname;
300  if (location_ == Local) {
301  if (localTop_.empty()) {
302  localTop_ = "@LOCAL";
303  }
304  if (oldFormat) {
305  canonicalFilename_ = canFilename;
306  } else
307  canonicalFilename_ = localTop_ + canFilename;
308  } else if (location_ == Release) {
309  if (releaseTop_.empty()) {
310  releaseTop_ = "@RELEASE";
311  }
312  if (oldFormat) {
313  std::string::size_type pos = canFilename.find(BASE);
314  if (pos == 0) {
315  // Replace the placehoder with the path to the base release (site dependent).
316  canonicalFilename_ = releaseTop_ + canFilename.substr(BASE.size());
317  } else {
318  // Needed for files written before CMSSW_1_2_0_pre2.
319  canonicalFilename_ = canFilename;
320  }
321  } else
322  canonicalFilename_ = releaseTop_ + canFilename;
323  } else if (location_ == Data) {
324  if (dataTop_.empty()) {
325  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << DATATOP << " is not set.\n";
326  }
327  canonicalFilename_ = dataTop_ + canFilename;
328  }
329  }

References canonicalFilename_, Data, dataTop_, Exception, edm::errors::FileInPathError, DTRecHitClients_cfi::local, Local, localTop_, location_, relativePath_, Release, releaseTop_, AlCaHLTBitMon_QueryRunRegistry::string, Unknown, and BeamSplash_cfg::version.

◆ relativePath()

std::string edm::FileInPath::relativePath ( ) const

Return a string containing the canonical form of the relative path. DO NOT USE THIS AS THE FILENAME for any file operations; use fullPath() for that purpose.

Definition at line 159 of file FileInPath.cc.

159 { return relativePath_; }

References relativePath_.

Referenced by PDFWeightsHelper::Init(), and PYBIND11_MODULE().

◆ swap()

void edm::FileInPath::swap ( FileInPath other)

Definition at line 149 of file FileInPath.cc.

149  {
150  relativePath_.swap(other.relativePath_);
151  canonicalFilename_.swap(other.canonicalFilename_);
152  std::swap(location_, other.location_);
153  localTop_.swap(other.localTop_);
154  releaseTop_.swap(other.releaseTop_);
155  dataTop_.swap(other.dataTop_);
156  searchPath_.swap(other.searchPath_);
157  }

References canonicalFilename_, dataTop_, localTop_, location_, trackingPlots::other, relativePath_, releaseTop_, searchPath_, and std::swap().

Referenced by operator=().

◆ write()

void edm::FileInPath::write ( std::ostream &  os) const

Write contents to the given ostream. Writing errors are reflected in the state of the stream.

Definition at line 165 of file FileInPath.cc.

165  {
166  if (location_ == Unknown) {
167  os << version << ' ' << relativePath_ << ' ' << location_;
168  } else if (location_ == Local) {
169  // Guarantee a site independent value by stripping $LOCALTOP.
170  if (localTop_.empty()) {
171  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << LOCALTOP << " is not set.\n";
172  }
174  if (pos != 0) {
176  << "Path " << canonicalFilename_ << " is not in the local release area " << localTop_ << "\n";
177  }
178  os << version << ' ' << relativePath_ << ' ' << location_ << ' ' << canonicalFilename_.substr(localTop_.size());
179  } else if (location_ == Release) {
180  // Guarantee a site independent value by stripping $RELEASETOP.
181  if (releaseTop_.empty()) {
182  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << RELEASETOP << " is not set.\n";
183  }
185  if (pos != 0) {
187  << "Path " << canonicalFilename_ << " is not in the base release area " << releaseTop_ << "\n";
188  }
189  os << version << ' ' << relativePath_ << ' ' << location_ << ' ' << canonicalFilename_.substr(releaseTop_.size());
190  } else if (location_ == Data) {
191  // Guarantee a site independent value by stripping $DATATOP.
192  if (dataTop_.empty()) {
193  throw edm::Exception(edm::errors::FileInPathError) << "Environment Variable " << DATATOP << " is not set.\n";
194  }
196  if (pos != 0) {
198  << "Path " << canonicalFilename_ << " is not in the data area " << dataTop_ << "\n";
199  }
200  os << version << ' ' << relativePath_ << ' ' << location_ << ' ' << canonicalFilename_.substr(dataTop_.size());
201  }
202  }

References canonicalFilename_, Data, dataTop_, Exception, edm::errors::FileInPathError, Local, localTop_, location_, relativePath_, Release, releaseTop_, Unknown, and BeamSplash_cfg::version.

Referenced by pkg.AbstractPkg::generate(), and edm::operator<<().

Member Data Documentation

◆ canonicalFilename_

std::string edm::FileInPath::canonicalFilename_
private

Definition at line 114 of file FileInPath.h.

Referenced by fullPath(), initialize_(), read(), readFromParameterSetBlob(), swap(), and write().

◆ dataTop_

std::string edm::FileInPath::dataTop_
private

Definition at line 118 of file FileInPath.h.

Referenced by getEnvironment(), initialize_(), read(), readFromParameterSetBlob(), swap(), and write().

◆ localTop_

std::string edm::FileInPath::localTop_
private

Definition at line 116 of file FileInPath.h.

Referenced by getEnvironment(), initialize_(), read(), readFromParameterSetBlob(), swap(), and write().

◆ location_

LocationCode edm::FileInPath::location_
private

Definition at line 115 of file FileInPath.h.

Referenced by initialize_(), location(), read(), readFromParameterSetBlob(), swap(), and write().

◆ relativePath_

std::string edm::FileInPath::relativePath_
private

Definition at line 113 of file FileInPath.h.

Referenced by initialize_(), read(), readFromParameterSetBlob(), relativePath(), swap(), and write().

◆ releaseTop_

std::string edm::FileInPath::releaseTop_
private

Definition at line 117 of file FileInPath.h.

Referenced by getEnvironment(), initialize_(), read(), readFromParameterSetBlob(), swap(), and write().

◆ searchPath_

std::string edm::FileInPath::searchPath_
private

Definition at line 119 of file FileInPath.h.

Referenced by getEnvironment(), initialize_(), and swap().

edm::FileInPath::swap
void swap(FileInPath &other)
Definition: FileInPath.cc:149
edm::FileInPath::dataTop_
std::string dataTop_
Definition: FileInPath.h:118
edm::FileInPath::canonicalFilename_
std::string canonicalFilename_
Definition: FileInPath.h:114
edm::FileInPath::getEnvironment
void getEnvironment()
Definition: FileInPath.cc:333
edm::FileInPath::Release
Definition: FileInPath.h:66
edm::FileInPath::localTop_
std::string localTop_
Definition: FileInPath.h:116
pos
Definition: PixelAliasList.h:18
edm::FileInPath::location_
LocationCode location_
Definition: FileInPath.h:115
edm::errors::FileInPathError
Definition: EDMException.h:48
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::FileInPath::Local
Definition: FileInPath.h:66
edm::tokenize
std::vector< std::string > tokenize(std::string const &input, std::string const &separator)
breaks the input string into tokens, delimited by the separator
Definition: Parse.cc:52
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
edm::FileInPath::releaseTop_
std::string releaseTop_
Definition: FileInPath.h:117
edm::FileInPath::searchPath_
std::string searchPath_
Definition: FileInPath.h:119
trackingPlots.other
other
Definition: trackingPlots.py:1465
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
beamvalidation.br
br
Definition: beamvalidation.py:398
edm::FileInPath::Data
Definition: FileInPath.h:66
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::FileInPath::initialize_
void initialize_()
Definition: FileInPath.cc:364
edm::FileInPath::Unknown
Definition: FileInPath.h:66
Exception
Definition: hltDiff.cc:246
edm::FileInPath::relativePath_
std::string relativePath_
Definition: FileInPath.h:113
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
edm::FileInPath::FileInPath
FileInPath()
Definition: FileInPath.cc:106