Skip to content

Commit

Permalink
modernize SiStripDetInfoFileWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Sep 14, 2021
1 parent befbd9c commit b06f301
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 53 deletions.
48 changes: 39 additions & 9 deletions CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.cc
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
// -*- C++ -*-
// Package: SiStripCommon
//
// Package: SiStripDetInfoFileWriter
// Class: SiStripDetInfoFileWriter
//
/**\class SiStripDetInfoFileWriter SiStripDetInfoFileWriter.cc CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: G. Bruno
// Created: Mon May 20 10:04:31 CET 2007
// Created: Mon Nov 20 10:04:31 CET 2006
//
//

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

#include "CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h"
// User includes
#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{};

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

using namespace cms;
using namespace std;
Expand Down Expand Up @@ -55,12 +89,8 @@ 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;
}
Expand Down
44 changes: 0 additions & 44 deletions CalibTracker/SiStripCommon/plugins/SiStripDetInfoFileWriter.h

This file was deleted.

0 comments on commit b06f301

Please sign in to comment.