CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DumpFWRecoGeometry.cc
Go to the documentation of this file.
8 
9 #include "TFile.h"
10 #include "TTree.h"
11 #include "TError.h"
12 #include "TSystem.h"
13 
15 {
16 public:
17  explicit DumpFWRecoGeometry( const edm::ParameterSet& config );
18  virtual ~DumpFWRecoGeometry( void ) {}
19 
20 private:
21  virtual void analyze( const edm::Event& event, const edm::EventSetup& eventSetup ) override;
22  virtual void beginJob( void ) override;
23  virtual void endJob( void ) override;
24 
25  int m_level;
27 };
28 
30  : m_level( config.getUntrackedParameter<int>( "level", 1 )),
31  m_info( config.getUntrackedParameter<std::string>( "tagInfo", "2015" ))
32 {}
33 
34 void
36 {
37  using namespace edm;
38 
40  eventSetup.get<FWRecoGeometryRecord>().get( geoh );
41 
42  std::stringstream s;
43  s << "cmsRecoGeom" << m_level << ".root";
44  TFile file( s.str().c_str(), "RECREATE" );
45 
46  TTree *tree = new TTree("idToGeo", "raw detector id association with geometry");
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  TNamed* version = new TNamed("CMSSW_VERSION", gSystem->Getenv( "CMSSW_VERSION" ));
83  file.WriteTObject(version);
84 
85  file.WriteTObject(new TNamed("TAG", m_info.c_str()));
86 
87  file.Close();
88 }
89 
90 void
92 {}
93 
94 void
96 {}
97 
std::vector< FWRecoGeom::Info >::const_iterator InfoMapItr
Definition: FWRecoGeom.h:28
int i
Definition: DBlmapReader.cc:9
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
#define end
Definition: vmac.h:37
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual ~DumpFWRecoGeometry(void)
virtual void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
virtual void beginJob(void) override
const T & get() const
Definition: EventSetup.h:55
DumpFWRecoGeometry(const edm::ParameterSet &config)
virtual void endJob(void) override