CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripDetInfoFileWriter Class Reference

#include <CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc>

Inheritance diagram for SiStripDetInfoFileWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripDetInfoFileWriter (const edm::ParameterSet &)
 
 ~SiStripDetInfoFileWriter () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 29 of file SiStripDetInfoFileWriter.h.

Constructor & Destructor Documentation

◆ SiStripDetInfoFileWriter()

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

Definition at line 18 of file SiStripDetInfoFileWriter.cc.

18  {
19  edm::LogInfo("SiStripDetInfoFileWriter::SiStripDetInfoFileWriter");
20 
21  filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath", std::string("SiStripDetInfo.dat"));
22  tkGeomToken_ = esConsumes<edm::Transition::BeginRun>();
23 }

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

◆ ~SiStripDetInfoFileWriter()

SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter ( )
override

Definition at line 25 of file SiStripDetInfoFileWriter.cc.

25  {
26  edm::LogInfo("SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter");
27 }

Member Function Documentation

◆ analyze()

void SiStripDetInfoFileWriter::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlineoverrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 37 of file SiStripDetInfoFileWriter.h.

37 {};

◆ beginRun()

void SiStripDetInfoFileWriter::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 29 of file SiStripDetInfoFileWriter.cc.

29  {
30  outputFile_.open(filePath_.c_str());
31 
32  if (outputFile_.is_open()) {
33  const auto& dd = iSetup.getData(tkGeomToken_);
34 
35  edm::LogInfo("SiStripDetInfoFileWriter::beginRun - got geometry ") << std::endl;
36 
37  edm::LogInfo("SiStripDetInfoFileWriter") << " There are " << dd.detUnits().size() << " detectors" << std::endl;
38 
39  for (const auto& it : dd.detUnits()) {
40  const StripGeomDetUnit* mit = dynamic_cast<StripGeomDetUnit const*>(it);
41 
42  if (mit != nullptr) {
43  uint32_t detid = (mit->geographicalId()).rawId();
44  double stripLength = mit->specificTopology().stripLength();
45  unsigned short numberOfAPVs = mit->specificTopology().nstrips() / 128;
46  float thickness = mit->specificSurface().bounds().thickness();
47 
48  if (numberOfAPVs < 1 || numberOfAPVs > 6) {
49  edm::LogError("SiStripDetInfoFileWriter")
50  << " Problem with Number of strips in detector.. " << mit->specificTopology().nstrips()
51  << "Will not write this entry to file" << endl;
52  continue;
53  }
54 
55  outputFile_ << detid << " " << numberOfAPVs << " " << stripLength << " " << thickness << "\n";
56  }
57  }
58 
59  outputFile_.close();
60 
61  }
62 
63  else {
64  edm::LogError("SiStripDetInfoFileWriter::beginRun - Unable to open file") << endl;
65  return;
66  }
67 }

References Surface::bounds(), createTree::dd, GeomDet::geographicalId(), edm::EventSetup::getData(), StripTopology::nstrips(), GeomDet::specificSurface(), StripGeomDetUnit::specificTopology(), StripTopology::stripLength(), Bounds::thickness(), and Calorimetry_cff::thickness.

Member Data Documentation

◆ filePath_

std::string SiStripDetInfoFileWriter::filePath_
private

Definition at line 41 of file SiStripDetInfoFileWriter.h.

◆ outputFile_

std::ofstream SiStripDetInfoFileWriter::outputFile_
private

Definition at line 37 of file SiStripDetInfoFileWriter.h.

◆ tkGeomToken_

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripDetInfoFileWriter::tkGeomToken_
private

Definition at line 42 of file SiStripDetInfoFileWriter.h.

SiStripDetInfoFileWriter::filePath_
std::string filePath_
Definition: SiStripDetInfoFileWriter.h:41
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:115
SiStripDetInfoFileWriter::tkGeomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Definition: SiStripDetInfoFileWriter.h:42
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
createTree.dd
string dd
Definition: createTree.py:154
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
Bounds::thickness
virtual float thickness() const =0
StripTopology::stripLength
virtual float stripLength() const =0
GeomDet::specificSurface
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripDetInfoFileWriter::outputFile_
std::ofstream outputFile_
Definition: SiStripDetInfoFileWriter.h:37
StripTopology::nstrips
virtual int nstrips() const =0
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
StripGeomDetUnit::specificTopology
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Definition: StripGeomDetUnit.cc:17
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15