Public Member Functions | |
DumpFWTGeoRecoGeometry (const edm::ParameterSet &config) | |
virtual | ~DumpFWTGeoRecoGeometry (void) |
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 |
Definition at line 14 of file DumpFWTGeoRecoGeometry.cc.
DumpFWTGeoRecoGeometry::DumpFWTGeoRecoGeometry | ( | const edm::ParameterSet & | config | ) | [explicit] |
Definition at line 28 of file DumpFWTGeoRecoGeometry.cc.
: m_level( config.getUntrackedParameter<int>( "level", 1 )) {}
virtual DumpFWTGeoRecoGeometry::~DumpFWTGeoRecoGeometry | ( | void | ) | [inline, virtual] |
Definition at line 18 of file DumpFWTGeoRecoGeometry.cc.
{}
void DumpFWTGeoRecoGeometry::analyze | ( | const edm::Event & | event, |
const edm::EventSetup & | eventSetup | ||
) | [private, virtual] |
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 diffTreeTool::tree.
{ using namespace edm; ESTransientHandle<FWTGeoRecoGeometry> geoh; eventSetup.get<FWTGeoRecoGeometryRecord>().get( geoh ); TGeoManager *geom = const_cast<TGeoManager*>( geoh.product()->manager()); std::stringstream s; s << "cmsTGeoRecoGeom" << m_level << ".root"; TFile file( s.str().c_str(), "RECREATE" ); TTree *tree = new TTree( "idToGeo", "Raw detector id association with geometry" ); UInt_t v_id; TString *v_path( new TString ); char v_name[1000]; Float_t v_vertex[24]; Float_t v_params[9]; tree->SetBranchStyle( 0 ); tree->Branch( "id", &v_id, "id/i" ); tree->Branch( "path", &v_name, "path/C" ); tree->Branch( "points", &v_vertex, "points[24]/F" ); tree->Branch( "topology", &v_params, "topology[9]/F" ); for( std::map<unsigned int, FWTGeoRecoGeometry::Info>::const_iterator it = geoh.product()->idToName.begin(), end = geoh.product()->idToName.end(); it != end; ++it ) { v_id = it->first; *v_path = it->second.name.c_str(); for( unsigned int i = 0; i < 24; ++i ) v_vertex[i] = it->second.points[i]; for( unsigned int i = 0; i < 9; ++i ) v_params[i] = it->second.topology[i]; assert( it->second.name.size() < 1000 ); strncpy( v_name, it->second.name.c_str(), 1000 ); tree->Fill(); } file.WriteTObject( &*geom ); file.WriteTObject( tree ); file.Close(); }
void DumpFWTGeoRecoGeometry::beginJob | ( | void | ) | [private, virtual] |
void DumpFWTGeoRecoGeometry::endJob | ( | void | ) | [private, virtual] |
int DumpFWTGeoRecoGeometry::m_level [private] |
Definition at line 25 of file DumpFWTGeoRecoGeometry.cc.
Referenced by analyze().