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

Public Member Functions

 SiStripDetInfoFileWriter (const edm::ParameterSet &)
 
 ~SiStripDetInfoFileWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

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

Private Attributes

std::string filePath_
 
std::ofstream outputFile_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

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

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

Definition at line 27 of file SiStripDetInfoFileWriter.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file SiStripDetInfoFileWriter.cc.

References edm::ParameterSet::getUntrackedParameter().

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

Definition at line 34 of file SiStripDetInfoFileWriter.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 38 of file SiStripDetInfoFileWriter.h.

38 {};
void SiStripDetInfoFileWriter::beginRun ( const edm::EventSetup iSetup)
private

Definition at line 41 of file SiStripDetInfoFileWriter.cc.

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

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

Member Data Documentation

std::string SiStripDetInfoFileWriter::filePath_
private

Definition at line 44 of file SiStripDetInfoFileWriter.h.

std::ofstream SiStripDetInfoFileWriter::outputFile_
private

Definition at line 38 of file SiStripDetInfoFileWriter.h.