CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiPixelDetInfoFileWriter Class Reference
Inheritance diagram for SiPixelDetInfoFileWriter:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiPixelDetInfoFileWriter (const edm::ParameterSet &)
 
 ~SiPixelDetInfoFileWriter () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (const edm::Run &, const edm::EventSetup &) override
 
void endRun (const edm::Run &, const edm::EventSetup &) override
 

Private Attributes

std::string filePath_
 
std::ofstream outputFile_
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerGeomTokenBeginRun_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 25 of file SiPixelDetInfoFileWriter.cc.

Constructor & Destructor Documentation

◆ SiPixelDetInfoFileWriter()

SiPixelDetInfoFileWriter::SiPixelDetInfoFileWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 45 of file SiPixelDetInfoFileWriter.cc.

References edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46  edm::LogInfo("SiPixelDetInfoFileWriter::SiPixelDetInfoFileWriter");
47 
48  trackerGeomTokenBeginRun_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>();
49  filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath", std::string("SiPixelDetInfo.dat"));
50 }
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo

◆ ~SiPixelDetInfoFileWriter()

SiPixelDetInfoFileWriter::~SiPixelDetInfoFileWriter ( )
override

Definition at line 52 of file SiPixelDetInfoFileWriter.cc.

52  {
53  edm::LogInfo("SiPixelDetInfoFileWriter::~SiPixelDetInfoFileWriter");
54 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

void SiPixelDetInfoFileWriter::analyze ( const edm::Event ,
const edm::EventSetup  
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 94 of file SiPixelDetInfoFileWriter.cc.

94 {}

◆ beginJob()

void SiPixelDetInfoFileWriter::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 92 of file SiPixelDetInfoFileWriter.cc.

92 {}

◆ beginRun()

void SiPixelDetInfoFileWriter::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 56 of file SiPixelDetInfoFileWriter.cc.

References ALCARECOPPSCalTrackBasedSel_cff::detid, TrackerGeometry::detUnits(), GeomDet::geographicalId(), edm::EventSetup::getHandle(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, hgcalPlots::ncols, PixelTopology::ncolumns(), PixelTopology::nrows(), nano_mu_digi_cff::rawId, and PixelGeomDetUnit::specificTopology().

56  {
57  outputFile_.open(filePath_.c_str());
58 
59  if (outputFile_.is_open()) {
61 
62  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - got geometry ") << std::endl;
63  edm::LogInfo("SiPixelDetInfoFileWriter") << " There are " << pDD->detUnits().size() << " detectors" << std::endl;
64 
65  int nPixelDets = 0;
66 
67  for (const auto &it : pDD->detUnits()) {
68  const PixelGeomDetUnit *mit = dynamic_cast<PixelGeomDetUnit const *>(it);
69 
70  if (mit != nullptr) {
71  nPixelDets++;
72  const PixelTopology &topol = mit->specificTopology();
73  // Get the module sizes.
74  int nrows = topol.nrows(); // rows in x
75  int ncols = topol.ncolumns(); // cols in y
76  uint32_t detid = (mit->geographicalId()).rawId();
77 
78  outputFile_ << detid << " " << ncols << " " << nrows << "\n";
79  }
80  }
81  outputFile_.close();
82  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - Loop finished. ")
83  << nPixelDets << " Pixel DetUnits found " << std::endl;
84  }
85 
86  else {
87  edm::LogError("SiPixelDetInfoFileWriter::beginJob - Unable to open file") << endl;
88  return;
89  }
90 }
virtual int ncolumns() const =0
virtual int nrows() const =0
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Log< level::Error, false > LogError
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeomTokenBeginRun_
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
Log< level::Info, false > LogInfo
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.

◆ endRun()

void SiPixelDetInfoFileWriter::endRun ( const edm::Run ,
const edm::EventSetup  
)
inlineoverrideprivate

Definition at line 34 of file SiPixelDetInfoFileWriter.cc.

34 {}

Member Data Documentation

◆ filePath_

std::string SiPixelDetInfoFileWriter::filePath_
private

Definition at line 39 of file SiPixelDetInfoFileWriter.cc.

◆ outputFile_

std::ofstream SiPixelDetInfoFileWriter::outputFile_
private

Definition at line 38 of file SiPixelDetInfoFileWriter.cc.

◆ trackerGeomTokenBeginRun_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelDetInfoFileWriter::trackerGeomTokenBeginRun_
private

Definition at line 37 of file SiPixelDetInfoFileWriter.cc.