Skip to content

Commit

Permalink
Added SiStripDetInfoFileReader::kDefaultFile
Browse files Browse the repository at this point in the history
Use the constant in recently changed files.
  • Loading branch information
Dr15Jones committed May 29, 2021
1 parent f7d5080 commit dd09f36
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions CalibFormats/SiStripObjects/test/UnitTests/TestSiStripGain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class TestSiStripGain : public CppUnit::TestFixture {
normVector.push_back(norm1);
normVector.push_back(norm2);

edm::FileInPath fp("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(fp.fullPath());

SiStripGain gain(*apvGain1, norm1, recordLabelPair1, reader.info());
Expand All @@ -88,7 +88,7 @@ class TestSiStripGain : public CppUnit::TestFixture {
}

void apvGainsTest(const float &norm) {
edm::FileInPath fp("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(fp.fullPath());

SiStripGain gain(*apvGain1, norm, reader.info());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SiStripDetInfoFileReader {
public:
using DetInfo = SiStripDetInfo::DetInfo;

constexpr static char const * const kDefaultFile = "CalibTracker/SiStripCommon/data/SiStripDetInfo.dat";
explicit SiStripDetInfoFileReader(){};

explicit SiStripDetInfoFileReader(std::string filePath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SiStripQualityFakeESSource::SiStripQualityFakeESSource(const edm::ParameterSet&
}

std::unique_ptr<SiStripQuality> SiStripQualityFakeESSource::produce(const SiStripQualityRcd& iRecord) {
edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());

return std::make_unique<SiStripQuality>(reader.info());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ SiStripGainESProducer::SiStripGainESProducer(const edm::ParameterSet& iConfig) :
}

std::unique_ptr<SiStripGain> SiStripGainESProducer::produce(const SiStripGainRcd& iRecord) {
edm::FileInPath fp("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(fp.fullPath());

const auto& apvGain = gainGetters_[0]->gain(iRecord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SiStripGainSimESProducer::SiStripGainSimESProducer(const edm::ParameterSet& iCon
}

std::unique_ptr<SiStripGain> SiStripGainSimESProducer::produce(const SiStripGainSimRcd& iRecord) {
const edm::FileInPath fp("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
const edm::FileInPath fp(SiStripDetInfoFileReader::kDefaultFile);
const SiStripDetInfoFileReader reader(fp.fullPath());

const auto& apvGain = iRecord.get(tokenLabels_[0].token_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ SiStripQualityESProducer::SiStripQualityESProducer(const edm::ParameterSet& iCon
}

std::unique_ptr<SiStripQuality> SiStripQualityESProducer::produce(const SiStripQualityRcd& iRecord) {
edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());
auto quality = std::make_unique<SiStripQuality>(reader.info());
edm::LogInfo("SiStripQualityESProducer") << "produce called";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace {
std::unique_ptr<SiStripQuality> sistrip::badStripFromFedErr(DQMStore::IGetter& dqmStore,
const SiStripFedCabling& fedCabling,
float cutoff) {
edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());

auto quality = std::make_unique<SiStripQuality>(reader.info());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ void testSiStripQualityESProducer::analyze(const edm::Event& e, const edm::Event

char canvas[1024] = "\n&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n";

//NOTE: can't guarantee this is what was used to make the SiStripQuality
// can difference be determined without it?
edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");

//&&&&&&&&&&&&&&&&&&
//First Record
//&&&&&&&&&&&&&&&&&&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SiStripQualityHotStripIdentifier::SiStripQualityHotStripIdentifier(const edm::Pa
dataLabel_(iConfig.getUntrackedParameter<std::string>("dataLabel", "")),
conf_(iConfig),
fp_(iConfig.getUntrackedParameter<edm::FileInPath>(
"file", edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat"))),
"file", edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile))),
Cluster_src_(iConfig.getParameter<edm::InputTag>("Cluster_src")),
Track_src_(iConfig.getUntrackedParameter<edm::InputTag>("Track_src")),
tracksCollection_in_EventTree(iConfig.getUntrackedParameter<bool>("RemoveTrackClusters", false)),
Expand Down Expand Up @@ -54,7 +54,7 @@ std::unique_ptr<SiStripBadStrip> SiStripQualityHotStripIdentifier::getNewObject(
theIdentifier.setMinNumEntries(parameters.getUntrackedParameter<uint32_t>("MinNumEntries", 100));
theIdentifier.setMinNumEntriesPerStrip(parameters.getUntrackedParameter<uint32_t>("MinNumEntriesPerStrip", 5));

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());

SiStripQuality* qobj = new SiStripQuality(reader.info());
Expand Down
20 changes: 10 additions & 10 deletions CondCore/SiStripPlugins/plugins/SiStripBadStrip_PayloadInspector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ namespace {
auto tagname = PlotBase::getTag<0>().name;
std::shared_ptr<SiStripBadStrip> payload = fetchPayload(std::get<1>(iov));

edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

auto theIOVsince = std::to_string(std::get<0>(iov));
Expand Down Expand Up @@ -204,7 +204,7 @@ namespace {
auto tagname = PlotBase::getTag<0>().name;
std::shared_ptr<SiStripBadStrip> payload = fetchPayload(std::get<1>(iov));

edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

auto theIOVsince = std::to_string(std::get<0>(iov));
Expand Down Expand Up @@ -258,7 +258,7 @@ namespace {
~SiStripBadStripFractionByRun() override = default;

float getFromPayload(SiStripBadStrip& payload) override {
edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::vector<uint32_t> detid;
Expand Down Expand Up @@ -301,7 +301,7 @@ namespace {
~SiStripBadStripTIBFractionByRun() override = default;

float getFromPayload(SiStripBadStrip& payload) override {
edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::vector<uint32_t> detid;
Expand Down Expand Up @@ -347,7 +347,7 @@ namespace {
~SiStripBadStripTOBFractionByRun() override = default;

float getFromPayload(SiStripBadStrip& payload) override {
edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::vector<uint32_t> detid;
Expand Down Expand Up @@ -393,7 +393,7 @@ namespace {
~SiStripBadStripTIDFractionByRun() override = default;

float getFromPayload(SiStripBadStrip& payload) override {
edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::vector<uint32_t> detid;
Expand Down Expand Up @@ -439,7 +439,7 @@ namespace {
~SiStripBadStripTECFractionByRun() override = default;

float getFromPayload(SiStripBadStrip& payload) override {
edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::vector<uint32_t> detid;
Expand Down Expand Up @@ -865,7 +865,7 @@ namespace {
std::string lastIOVsince = std::to_string(std::get<0>(lastiov));
std::string firstIOVsince = std::to_string(std::get<0>(firstiov));

edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath fp_ = edm::FileInPath(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader* reader = new SiStripDetInfoFileReader(fp_.fullPath());

std::string titleMap =
Expand Down Expand Up @@ -966,7 +966,7 @@ namespace {
auto iov = tag.iovs.front();
std::shared_ptr<SiStripBadStrip> payload = fetchPayload(std::get<1>(iov));

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());

SiStripQuality* siStripQuality_ = new SiStripQuality(reader.info());
Expand Down Expand Up @@ -1190,7 +1190,7 @@ namespace {
// for the total
int totNComponents[4][19][4] = {{{0}}};

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());
SiStripQuality* f_siStripQuality_ = new SiStripQuality(reader.info());
f_siStripQuality_->add(first_payload.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ std::unique_ptr<SiStripBadStrip> SiStripQualityHotStripIdentifierRoot::getNewObj
conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
theIdentifier->setTrackerGeometry(tracker_);

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());
SiStripQuality* qobj = new SiStripQuality(reader.info());
theIdentifier->extractBadStrips(
Expand Down Expand Up @@ -133,7 +133,7 @@ std::unique_ptr<SiStripBadStrip> SiStripQualityHotStripIdentifierRoot::getNewObj
conf_.getUntrackedParameter<bool>("WriteOccupancyRootFile", false));
theIdentifier2->setTrackerGeometry(tracker_);

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());
SiStripQuality* qobj = new SiStripQuality(reader.info());
theIdentifier2->extractBadAPVs(qobj, ClusterPositionHistoMap, SiStripQuality_);
Expand Down Expand Up @@ -186,7 +186,7 @@ std::unique_ptr<SiStripBadStrip> SiStripQualityHotStripIdentifierRoot::getNewObj
parameters.getUntrackedParameter<double>("OccupancyThreshold", 1.E-5));
theIdentifier3->setMinNumOfEvents();

edm::FileInPath path("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
edm::FileInPath path(SiStripDetInfoFileReader::kDefaultFile);
SiStripDetInfoFileReader reader(path.fullPath());
SiStripQuality* qobj = new SiStripQuality(reader.info());
theIdentifier3->extractBadAPVSandStrips(
Expand Down

0 comments on commit dd09f36

Please sign in to comment.