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
SiPixelDetInfoFileWriter Class Reference

#include <CalibTracker/SiPixelCommon/src/SiPixelDetInfoFileWriter.cc>

Inheritance diagram for SiPixelDetInfoFileWriter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiPixelDetInfoFileWriter (const edm::ParameterSet &)
 
 ~SiPixelDetInfoFileWriter ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 27 of file SiPixelDetInfoFileWriter.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file SiPixelDetInfoFileWriter.cc.

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

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

Definition at line 34 of file SiPixelDetInfoFileWriter.cc.

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

Member Function Documentation

void SiPixelDetInfoFileWriter::analyze ( const edm::Event ,
const edm::EventSetup  
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 91 of file SiPixelDetInfoFileWriter.cc.

91  {
92 
93 }
void SiPixelDetInfoFileWriter::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file SiPixelDetInfoFileWriter.cc.

87  {
88 
89 }
void SiPixelDetInfoFileWriter::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file SiPixelDetInfoFileWriter.cc.

References cond::rpcobgas::detid, GeomDet::geographicalId(), edm::EventSetup::get(), PixelTopology::ncolumns(), PixelTopology::nrows(), and PixelGeomDetUnit::specificTopology().

41  {
42 
43  outputFile_.open(filePath_.c_str());
44 
45  if (outputFile_.is_open()){
46 
48 
49  iSetup.get<TrackerDigiGeometryRecord>().get( pDD );
50 
51  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - got geometry ")<<std::endl;
52  edm::LogInfo("SiPixelDetInfoFileWriter") <<" There are "<<pDD->detUnits().size() <<" detectors"<<std::endl;
53 
54  int nPixelDets = 0;
55 
56  for(TrackerGeometry::DetUnitContainer::const_iterator it = pDD->detUnits().begin(); it != pDD->detUnits().end(); it++){
57 
58  const PixelGeomDetUnit* mit = dynamic_cast<PixelGeomDetUnit*>(*it);
59 
60  if(mit!=0){
61  nPixelDets++;
62  const PixelTopology & topol = mit->specificTopology();
63  // Get the module sizes.
64  int nrows = topol.nrows(); // rows in x
65  int ncols = topol.ncolumns(); // cols in y
66  uint32_t detid=(mit->geographicalId()).rawId();
67 
68 
69  outputFile_ << detid << " "<< ncols << " " << nrows << "\n";
70 
71  }
72  }
73  outputFile_.close();
74  edm::LogInfo("SiPixelDetInfoFileWriter::beginJob - Loop finished. ")<< nPixelDets << " Pixel DetUnits found " << std::endl;
75  }
76 
77  else {
78 
79  edm::LogError("SiPixelDetInfoFileWriter::beginJob - Unable to open file")<<endl;
80  return;
81 
82  }
83 
84 }
virtual int ncolumns() const =0
virtual int nrows() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.

Member Data Documentation

std::string SiPixelDetInfoFileWriter::filePath_
private

Definition at line 44 of file SiPixelDetInfoFileWriter.h.

std::ofstream SiPixelDetInfoFileWriter::outputFile_
private

Definition at line 43 of file SiPixelDetInfoFileWriter.h.