CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

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

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

Definition at line 26 of file SiStripDetInfoFileWriter.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file SiStripDetInfoFileWriter.cc.

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

23  {
24 
25 
26  edm::LogInfo("SiStripDetInfoFileWriter::SiStripDetInfoFileWriter");
27 
28  filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath",std::string("SiStripDetInfo.dat"));
29 
30 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter ( )

Definition at line 33 of file SiStripDetInfoFileWriter.cc.

33  {
34 
35  edm::LogInfo("SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter");
36 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 37 of file SiStripDetInfoFileWriter.h.

37 {};
void SiStripDetInfoFileWriter::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 40 of file SiStripDetInfoFileWriter.cc.

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

40  {
41 
42 
43  outputFile_.open(filePath_.c_str());
44 
45  if (outputFile_.is_open()){
46 
47 
49 
50  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
51 
52  edm::LogInfo("SiStripDetInfoFileWriter::beginRun - got geometry ")<<std::endl;
53 
54 
55  edm::LogInfo("SiStripDetInfoFileWriter") <<" There are "<<pDD->detUnits().size() <<" detectors"<<std::endl;
56 
57  for(TrackerGeometry::DetUnitContainer::const_iterator it = pDD->detUnits().begin(); it != pDD->detUnits().end(); it++){
58 
59  const StripGeomDetUnit* mit = dynamic_cast<StripGeomDetUnit const *>(*it);
60 
61  if(mit!=0){
62 
63  uint32_t detid=(mit->geographicalId()).rawId();
64  double stripLength = mit->specificTopology().stripLength();
65  unsigned short numberOfAPVs= mit->specificTopology().nstrips()/128;
66  float thickness=mit->specificSurface().bounds().thickness();
67 
68 
69  if(numberOfAPVs<1 || numberOfAPVs>6 ) {
70  edm::LogError("SiStripDetInfoFileWriter")<<" Problem with Number of strips in detector.. "<< mit->specificTopology().nstrips() << "Will not write this entry to file"<< endl;
71  continue;
72  }
73 
74  outputFile_ << detid << " "<< numberOfAPVs << " " << stripLength << " "<< thickness << "\n";
75 
76  }
77 
78  }
79 
80  outputFile_.close();
81 
82  }
83 
84  else {
85 
86  edm::LogError("SiStripDetInfoFileWriter::beginRun - Unable to open file")<<endl;
87  return;
88 
89  }
90 
91 }
virtual int nstrips() const =0
const Bounds & bounds() const
Definition: Surface.h:120
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
virtual float thickness() const =0
virtual float stripLength() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
const T & get() const
Definition: EventSetup.h:56
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:43

Member Data Documentation

std::string SiStripDetInfoFileWriter::filePath_
private

Definition at line 43 of file SiStripDetInfoFileWriter.h.

std::ofstream SiStripDetInfoFileWriter::outputFile_
private

Definition at line 37 of file SiStripDetInfoFileWriter.h.