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
DumpFWTGeoRecoGeometry Class Reference
Inheritance diagram for DumpFWTGeoRecoGeometry:
edm::EDAnalyzer

Public Member Functions

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

Private Member Functions

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

Private Attributes

int m_level
 

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

Definition at line 14 of file DumpFWTGeoRecoGeometry.cc.

Constructor & Destructor Documentation

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

Definition at line 28 of file DumpFWTGeoRecoGeometry.cc.

29  : m_level( config.getUntrackedParameter<int>( "level", 1 ))
30 {}
T getUntrackedParameter(std::string const &, T const &) const
virtual DumpFWTGeoRecoGeometry::~DumpFWTGeoRecoGeometry ( void  )
inlinevirtual

Definition at line 18 of file DumpFWTGeoRecoGeometry.cc.

18 {}

Member Function Documentation

void DumpFWTGeoRecoGeometry::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 33 of file DumpFWTGeoRecoGeometry.cc.

References end, mergeVDriftHistosByStation::file, relativeConstraints::geom, edm::EventSetup::get(), i, m_level, alignCSCRings::s, and MainPageGenerator::tree.

34 {
35  using namespace edm;
36 
38  eventSetup.get<FWTGeoRecoGeometryRecord>().get( geoh );
39  TGeoManager *geom = const_cast<TGeoManager*>( geoh.product()->manager());
40 
41  std::stringstream s;
42  s << "cmsTGeoRecoGeom" << m_level << ".root";
43  TFile file( s.str().c_str(), "RECREATE" );
44 
45  TTree *tree = new TTree( "idToGeo", "Raw detector id association with geometry" );
46  UInt_t v_id;
47  TString *v_path( new TString );
48  char v_name[1000];
49  Float_t v_vertex[24];
50  Float_t v_params[9];
51 
52  tree->SetBranchStyle( 0 );
53  tree->Branch( "id", &v_id, "id/i" );
54  tree->Branch( "path", &v_name, "path/C" );
55  tree->Branch( "points", &v_vertex, "points[24]/F" );
56  tree->Branch( "topology", &v_params, "topology[9]/F" );
57 
58  for( std::map<unsigned int, FWTGeoRecoGeometry::Info>::const_iterator it = geoh.product()->idToName.begin(),
59  end = geoh.product()->idToName.end();
60  it != end; ++it )
61  {
62  v_id = it->first;
63  *v_path = it->second.name.c_str();
64  for( unsigned int i = 0; i < 24; ++i )
65  v_vertex[i] = it->second.points[i];
66  for( unsigned int i = 0; i < 9; ++i )
67  v_params[i] = it->second.topology[i];
68  assert( it->second.name.size() < 1000 );
69  strncpy( v_name, it->second.name.c_str(), 1000 );
70  tree->Fill();
71  }
72  file.WriteTObject( &*geom );
73  file.WriteTObject( tree );
74  file.Close();
75 }
int i
Definition: DBlmapReader.cc:9
#define end
Definition: vmac.h:38
unsigned int UInt_t
Definition: FUTypes.h:12
const T & get() const
Definition: EventSetup.h:55
void DumpFWTGeoRecoGeometry::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file DumpFWTGeoRecoGeometry.cc.

79 {}
void DumpFWTGeoRecoGeometry::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file DumpFWTGeoRecoGeometry.cc.

83 {}

Member Data Documentation

int DumpFWTGeoRecoGeometry::m_level
private

Definition at line 25 of file DumpFWTGeoRecoGeometry.cc.

Referenced by analyze().