Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize SiStripDetInfoFileWriter #35265

Merged
merged 1 commit into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions CalibTracker/SiStripCommon/plugins/SealModules.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h"

DEFINE_FWK_MODULE(SiStripDetInfoFileWriter);

#include "ShallowTree.h"
#include "ShallowEventDataProducer.h"
#include "ShallowDigisProducer.h"
Expand Down
54 changes: 44 additions & 10 deletions CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
// -*- C++ -*-
// Package: SiStripCommon
//
// Package: SiStripDetInfoFileWriter
// Class: SiStripDetInfoFileWriter
// Original Author: G. Bruno
// Created: Mon May 20 10:04:31 CET 2007
//
/**\class SiStripDetInfoFileWriter SiStripDetInfoFileWriter.cc CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc

Description: <one line class summary>

#include "CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h"
Implementation:
<Notes on implementation>
*/
//
// Original Author: G. Bruno
// Created: Mon Nov 20 10:04:31 CET 2006
//
//

// C++ includes
#include <string>
#include <iostream>
#include <fstream>

// User includes
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "Geometry/CommonDetUnit/interface/GeomDet.h"
#include "Geometry/CommonTopologies/interface/StripTopology.h"
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"

class SiStripDetInfoFileWriter : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
public:
explicit SiStripDetInfoFileWriter(const edm::ParameterSet&);
~SiStripDetInfoFileWriter() override;

private:
void beginRun(const edm::Run&, const edm::EventSetup& iSetup) override;
void analyze(const edm::Event&, const edm::EventSetup&) override{};
void endRun(const edm::Run&, const edm::EventSetup& iSetup) override{};

private:
std::ofstream outputFile_;
std::string filePath_;
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> tkGeomToken_;
};

using namespace cms;
using namespace std;
Expand Down Expand Up @@ -55,13 +91,11 @@ void SiStripDetInfoFileWriter::beginRun(const edm::Run&, const edm::EventSetup&
outputFile_ << detid << " " << numberOfAPVs << " " << stripLength << " " << thickness << "\n";
}
}

outputFile_.close();

}

else {
} else {
edm::LogError("SiStripDetInfoFileWriter::beginRun - Unable to open file") << endl;
return;
}
}

DEFINE_FWK_MODULE(SiStripDetInfoFileWriter);
44 changes: 0 additions & 44 deletions CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h

This file was deleted.