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
 
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::vector< ModuleDescription const * > &modules, 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
 
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_
 

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 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>
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 26 of file SiStripDetInfoFileWriter.h.

Constructor & Destructor Documentation

◆ SiStripDetInfoFileWriter()

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

Definition at line 21 of file SiStripDetInfoFileWriter.cc.

21  {
22  edm::LogInfo("SiStripDetInfoFileWriter::SiStripDetInfoFileWriter");
23 
24  filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath", std::string("SiStripDetInfo.dat"));
25 }

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

◆ ~SiStripDetInfoFileWriter()

SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter ( )
override

Definition at line 27 of file SiStripDetInfoFileWriter.cc.

27  {
28  edm::LogInfo("SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter");
29 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 34 of file SiStripDetInfoFileWriter.h.

34 {};

◆ beginRun()

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

Reimplemented from edm::EDAnalyzer.

Definition at line 31 of file SiStripDetInfoFileWriter.cc.

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

References Surface::bounds(), TrackerGeometry::detUnits(), GeomDet::geographicalId(), edm::EventSetup::get(), get, 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 38 of file SiStripDetInfoFileWriter.h.

◆ outputFile_

std::ofstream SiStripDetInfoFileWriter::outputFile_
private

Definition at line 34 of file SiStripDetInfoFileWriter.h.

SiStripDetInfoFileWriter::filePath_
std::string filePath_
Definition: SiStripDetInfoFileWriter.h:38
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
Surface::bounds
const Bounds & bounds() const
Definition: Surface.h:87
edm::ESHandle< TrackerGeometry >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
edm::LogError
Definition: MessageLogger.h:183
GeomDet::specificSurface
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
get
#define get
SiStripDetInfoFileWriter::outputFile_
std::ofstream outputFile_
Definition: SiStripDetInfoFileWriter.h:34
StripTopology::nstrips
virtual int nstrips() const =0
StripGeomDetUnit::specificTopology
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Definition: StripGeomDetUnit.cc:17
StripGeomDetUnit
Definition: StripGeomDetUnit.h:15