CMS 3D CMS Logo

SiPixelDetInfoFileWriter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Package: SiPixelESProducers
3 // Class: SiPixelDetInfoFileWriter
4 // Original Author: V.Chiochia (adapted from the Strip version by G.Bruno)
5 // Created: Mon May 20 10:04:31 CET 2007
6 
11 
17 
18 using namespace cms;
19 using namespace std;
20 
22  edm::LogInfo("SiPixelDetInfoFileWriter::SiPixelDetInfoFileWriter");
23 
24  filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath", std::string("SiPixelDetInfo.dat"));
25 }
26 
28  edm::LogInfo("SiPixelDetInfoFileWriter::~SiPixelDetInfoFileWriter");
29 }
30 
32  outputFile_.open(filePath_.c_str());
33 
34  if (outputFile_.is_open()) {
36 
37  iSetup.get<TrackerDigiGeometryRecord>().get(pDD);
38 
39  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - got geometry ") << std::endl;
40  edm::LogInfo("SiPixelDetInfoFileWriter") << " There are " << pDD->detUnits().size() << " detectors" << std::endl;
41 
42  int nPixelDets = 0;
43 
44  for (const auto &it : pDD->detUnits()) {
45  const PixelGeomDetUnit *mit = dynamic_cast<PixelGeomDetUnit const *>(it);
46 
47  if (mit != nullptr) {
48  nPixelDets++;
49  const PixelTopology &topol = mit->specificTopology();
50  // Get the module sizes.
51  int nrows = topol.nrows(); // rows in x
52  int ncols = topol.ncolumns(); // cols in y
53  uint32_t detid = (mit->geographicalId()).rawId();
54 
55  outputFile_ << detid << " " << ncols << " " << nrows << "\n";
56  }
57  }
58  outputFile_.close();
59  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - Loop finished. ")
60  << nPixelDets << " Pixel DetUnits found " << std::endl;
61  }
62 
63  else {
64  edm::LogError("SiPixelDetInfoFileWriter::beginJob - Unable to open file") << endl;
65  return;
66  }
67 }
68 
70 
hgcalPlots.ncols
ncols
Definition: hgcalPlots.py:105
MessageLogger.h
TrackerGeometry.h
SiPixelDetInfoFileWriter::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: SiPixelDetInfoFileWriter.cc:31
PixelTopology.h
ESHandle.h
edm::Run
Definition: Run.h:45
edm::LogInfo
Definition: MessageLogger.h:254
SiPixelDetInfoFileWriter::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiPixelDetInfoFileWriter.cc:71
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiPixelDetInfoFileWriter::~SiPixelDetInfoFileWriter
~SiPixelDetInfoFileWriter() override
Definition: SiPixelDetInfoFileWriter.cc:27
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
SiPixelDetInfoFileWriter::SiPixelDetInfoFileWriter
SiPixelDetInfoFileWriter(const edm::ParameterSet &)
Definition: SiPixelDetInfoFileWriter.cc:21
edm::ESHandle< TrackerGeometry >
PixelTopology::ncolumns
virtual int ncolumns() const =0
PixelTopology
Definition: PixelTopology.h:10
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
PixelGeomDetUnit::specificTopology
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
Definition: PixelGeomDetUnit.cc:17
SiPixelDetInfoFileWriter::beginJob
void beginJob() override
Definition: SiPixelDetInfoFileWriter.cc:69
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
GeomDet.h
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
PixelGeomDetUnit.h
ParameterSet.h
SiPixelDetInfoFileWriter.h
edm::Event
Definition: Event.h:73
PixelTopology::nrows
virtual int nrows() const =0
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21