![]() |
![]() |
#include <CalibTracker/SiStripCommon/src/SiStripDetInfoFileWriter.cc>
Public Member Functions | |
SiStripDetInfoFileWriter (const edm::ParameterSet &) | |
~SiStripDetInfoFileWriter () | |
Private Member Functions | |
void | analyze (const edm::Event &, const edm::EventSetup &) |
void | beginJob (const edm::EventSetup &iSetup) |
Private Attributes | |
std::string | filePath_ |
std::ofstream | outputFile_ |
Implementation: <Notes on="" implementation>="">
Definition at line 27 of file SiStripDetInfoFileWriter.h.
SiStripDetInfoFileWriter::SiStripDetInfoFileWriter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 24 of file SiStripDetInfoFileWriter.cc.
References filePath_, and edm::ParameterSet::getUntrackedParameter().
00024 { 00025 00026 00027 edm::LogInfo("SiStripDetInfoFileWriter::SiStripDetInfoFileWriter"); 00028 00029 filePath_ = iConfig.getUntrackedParameter<std::string>("FilePath",std::string("SiStripDetInfo.dat")); 00030 00031 }
SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter | ( | ) |
Definition at line 34 of file SiStripDetInfoFileWriter.cc.
00034 { 00035 00036 edm::LogInfo("SiStripDetInfoFileWriter::~SiStripDetInfoFileWriter"); 00037 }
void SiStripDetInfoFileWriter::analyze | ( | const edm::Event & | , | |
const edm::EventSetup & | ||||
) | [inline, private, virtual] |
void SiStripDetInfoFileWriter::beginJob | ( | const edm::EventSetup & | iSetup | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 41 of file SiStripDetInfoFileWriter.cc.
References BoundSurface::bounds(), lat::endl(), filePath_, StripGeomDetUnit::geographicalId(), edm::EventSetup::get(), it, StripTopology::nstrips(), outputFile_, GeomDet::specificSurface(), StripGeomDetUnit::specificTopology(), StripTopology::stripLength(), and Bounds::thickness().
00041 { 00042 00043 00044 outputFile_.open(filePath_.c_str()); 00045 00046 if (outputFile_.is_open()){ 00047 00048 00049 edm::ESHandle<TrackerGeometry> pDD; 00050 00051 iSetup.get<TrackerDigiGeometryRecord>().get( pDD ); 00052 00053 edm::LogInfo("SiStripDetInfoFileWriter::beginJob - got geometry ")<<std::endl; 00054 00055 00056 edm::LogInfo("SiStripDetInfoFileWriter") <<" There are "<<pDD->detUnits().size() <<" detectors"<<std::endl; 00057 00058 for(TrackerGeometry::DetUnitContainer::const_iterator it = pDD->detUnits().begin(); it != pDD->detUnits().end(); it++){ 00059 00060 const StripGeomDetUnit* mit = dynamic_cast<StripGeomDetUnit*>(*it); 00061 00062 if(mit!=0){ 00063 00064 uint32_t detid=(mit->geographicalId()).rawId(); 00065 double stripLength = mit->specificTopology().stripLength(); 00066 unsigned short numberOfAPVs= mit->specificTopology().nstrips()/128; 00067 float thickness=mit->specificSurface().bounds().thickness(); 00068 00069 00070 if(numberOfAPVs<1 || numberOfAPVs>6 ) { 00071 edm::LogError("SiStripDetInfoFileWriter")<<" Problem with Number of strips in detector.. "<< mit->specificTopology().nstrips() << "Will not write this entry to file"<< endl; 00072 continue; 00073 } 00074 00075 outputFile_ << detid << " "<< numberOfAPVs << " " << stripLength << " "<< thickness << "\n"; 00076 00077 } 00078 00079 } 00080 00081 outputFile_.close(); 00082 00083 } 00084 00085 else { 00086 00087 edm::LogError("SiStripDetInfoFileWriter::beginJob - Unable to open file")<<endl; 00088 return; 00089 00090 } 00091 00092 }
std::string SiStripDetInfoFileWriter::filePath_ [private] |
Definition at line 44 of file SiStripDetInfoFileWriter.h.
Referenced by beginJob(), and SiStripDetInfoFileWriter().
std::ofstream SiStripDetInfoFileWriter::outputFile_ [private] |