CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DumpFWRecoGeometry Class Reference
Inheritance diagram for DumpFWRecoGeometry:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DumpFWRecoGeometry (const edm::ParameterSet &config)
 
 ~DumpFWRecoGeometry (void) 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &event, const edm::EventSetup &eventSetup) override
 
void beginJob (void) override
 
void endJob (void) override
 

Private Attributes

int m_level
 
std::string m_outputFileName
 
std::string m_tag
 

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
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

Definition at line 14 of file DumpFWRecoGeometry.cc.

Constructor & Destructor Documentation

DumpFWRecoGeometry::DumpFWRecoGeometry ( const edm::ParameterSet config)
explicit

Definition at line 30 of file DumpFWRecoGeometry.cc.

31  : m_level( config.getUntrackedParameter<int>( "level", 1 )),
32  m_tag( config.getUntrackedParameter<std::string>( "tagInfo", "unknown" )),
33 
34  m_outputFileName( config.getUntrackedParameter<std::string>( "outputFileName", "cmsRecoGeo.root" ))
35 {}
T getUntrackedParameter(std::string const &, T const &) const
std::string m_outputFileName
DumpFWRecoGeometry::~DumpFWRecoGeometry ( void  )
inlineoverride

Definition at line 18 of file DumpFWRecoGeometry.cc.

References analyze(), beginJob(), and endJob().

18 {}

Member Function Documentation

void DumpFWRecoGeometry::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprivate

Definition at line 38 of file DumpFWRecoGeometry.cc.

References end, FWRecoGeometry::extraDet, FrontierConditions_GlobalTag_cff::file, edm::EventSetup::get(), mps_fire::i, FWRecoGeometry::idToName, m_outputFileName, m_tag, edm::ESTransientHandle< T >::product(), and FWRecoGeometry::trackerTopologyXML.

Referenced by ~DumpFWRecoGeometry().

39 {
40  using namespace edm;
41 
43  eventSetup.get<FWRecoGeometryRecord>().get( geoh );
44  TFile file( m_outputFileName.c_str(), "RECREATE" );
45 
46  TTree *tree = new TTree("idToGeo", "raw detector id association with geometry ANT");
47 
48  UInt_t v_id;
49  Float_t v_vertex[24];
50  Float_t v_params[9];
51  Float_t v_shape[5];
52  Float_t v_translation[3];
53  Float_t v_matrix[9];
54 
55  tree->SetBranchStyle( 0 );
56  tree->Branch( "id", &v_id, "id/i" );
57  tree->Branch( "points", &v_vertex, "points[24]/F" );
58  tree->Branch( "topology", &v_params, "topology[9]/F" );
59  tree->Branch( "shape", &v_shape, "shape[5]/F" );
60  tree->Branch( "translation", &v_translation, "translation[3]/F" );
61  tree->Branch( "matrix", &v_matrix, "matrix[9]/F" );
62 
63  for( FWRecoGeom::InfoMapItr it = geoh.product()->idToName.begin(),
64  end = geoh.product()->idToName.end();
65  it != end; ++it )
66  {
67  v_id = it->id;
68  for( unsigned int i = 0; i < 24; ++i )
69  v_vertex[i] = it->points[i];
70  for( unsigned int i = 0; i < 9; ++i )
71  v_params[i] = it->topology[i];
72  for( unsigned int i = 0; i < 5; ++i )
73  v_shape[i] = it->shape[i];
74  for( unsigned int i = 0; i < 3; ++i )
75  v_translation[i] = it->translation[i];
76  for( unsigned int i = 0; i < 9; ++i )
77  v_matrix[i] = it->matrix[i];
78  tree->Fill();
79  }
80  file.WriteTObject( tree );
81 
82 
83  file.WriteTObject(new TNamed("CMSSW_VERSION", gSystem->Getenv( "CMSSW_VERSION" )));
84  file.WriteTObject(new TNamed("tag", m_tag.c_str()));
85  file.WriteTObject(&geoh.product()->extraDet, "ExtraDetectors");
86  file.WriteTObject(new TNamed("PRODUCER_VERSION", "1")); // version 2 changes pixel parameters
87 
88 
89  file.WriteTObject(new TNamed("TrackerTopology", geoh.product()->trackerTopologyXML));
90 
91  file.Close();
92 }
std::vector< FWRecoGeom::Info >::const_iterator InfoMapItr
Definition: FWRecoGeom.h:28
std::string trackerTopologyXML
FWRecoGeom::InfoMap idToName
std::string m_outputFileName
#define end
Definition: vmac.h:39
T const * product() const
TObjArray extraDet
HLT enums.
T get() const
Definition: EventSetup.h:63
Definition: tree.py:1
void DumpFWRecoGeometry::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 95 of file DumpFWRecoGeometry.cc.

Referenced by ~DumpFWRecoGeometry().

96 {}
void DumpFWRecoGeometry::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 99 of file DumpFWRecoGeometry.cc.

References DEFINE_FWK_MODULE.

Referenced by ~DumpFWRecoGeometry().

100 {}

Member Data Documentation

int DumpFWRecoGeometry::m_level
private

Definition at line 25 of file DumpFWRecoGeometry.cc.

std::string DumpFWRecoGeometry::m_outputFileName
private

Definition at line 27 of file DumpFWRecoGeometry.cc.

Referenced by analyze().

std::string DumpFWRecoGeometry::m_tag
private

Definition at line 26 of file DumpFWRecoGeometry.cc.

Referenced by analyze().