1 |
// system include files
|
2 |
#include <memory>
|
3 |
|
4 |
// user include files
|
5 |
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
6 |
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
7 |
|
8 |
#include "FWCore/Framework/interface/Event.h"
|
9 |
#include "FWCore/Framework/interface/EventSetup.h"
|
10 |
#include "FWCore/Framework/interface/ESHandle.h"
|
11 |
#include "FWCore/Framework/interface/MakerMacros.h"
|
12 |
|
13 |
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
14 |
|
15 |
#include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
|
16 |
#include "RecoTracker/TkDetLayers/interface/GeometricSearchTracker.h"
|
17 |
|
18 |
using namespace std;
|
19 |
|
20 |
//
|
21 |
//
|
22 |
// class decleration
|
23 |
//
|
24 |
|
25 |
class TrackerRecoGeometryAnalyzer : public edm::EDAnalyzer {
|
26 |
public:
|
27 |
explicit TrackerRecoGeometryAnalyzer( const edm::ParameterSet& );
|
28 |
~TrackerRecoGeometryAnalyzer();
|
29 |
|
30 |
|
31 |
virtual void analyze( const edm::Event&, const edm::EventSetup& );
|
32 |
private:
|
33 |
// ----------member data ---------------------------
|
34 |
};
|
35 |
|
36 |
//
|
37 |
// constants, enums and typedefs
|
38 |
//
|
39 |
|
40 |
//
|
41 |
// static data member definitions
|
42 |
//
|
43 |
|
44 |
//
|
45 |
// constructors and destructor
|
46 |
//
|
47 |
TrackerRecoGeometryAnalyzer::TrackerRecoGeometryAnalyzer( const edm::ParameterSet& iConfig )
|
48 |
{
|
49 |
//now do what ever initialization is needed
|
50 |
|
51 |
}
|
52 |
|
53 |
|
54 |
TrackerRecoGeometryAnalyzer::~TrackerRecoGeometryAnalyzer()
|
55 |
{
|
56 |
|
57 |
// do anything here that needs to be done at desctruction time
|
58 |
// (e.g. close files, deallocate resources etc.)
|
59 |
|
60 |
}
|
61 |
|
62 |
|
63 |
//
|
64 |
// member functions
|
65 |
//
|
66 |
|
67 |
// ------------ method called to produce the data ------------
|
68 |
void
|
69 |
TrackerRecoGeometryAnalyzer::analyze( const edm::Event& iEvent, const edm::EventSetup& iSetup )
|
70 |
{
|
71 |
using namespace edm;
|
72 |
|
73 |
std::cout << "Here I am " << std::endl;
|
74 |
//
|
75 |
// get the GeometricSearchDet
|
76 |
//
|
77 |
edm::ESHandle<GeometricSearchTracker> track;
|
78 |
iSetup.get<TrackerRecoGeometryRecord>().get( track );
|
79 |
|
80 |
//---- testing access to barrelLayers ----
|
81 |
vector<BarrelDetLayer*> theBarrelLayers = track->barrelLayers();
|
82 |
cout << "number of BarrelLayers: " << theBarrelLayers.size() << endl;
|
83 |
|
84 |
for(unsigned int i=0; i<3; i++){
|
85 |
BarrelDetLayer* theLayer = theBarrelLayers[i];
|
86 |
cout << "theLayer[" << i << "]->position().perp(): "
|
87 |
<< theLayer->components().front()->surface().position().perp() << endl;
|
88 |
//cout << "theLayer[" << i << "]->module(): "
|
89 |
//<< theLayer->module() << endl;
|
90 |
}
|
91 |
//--------------------------------------
|
92 |
|
93 |
}
|
94 |
|
95 |
//define this as a plug-in
|
96 |
DEFINE_FWK_MODULE(TrackerRecoGeometryAnalyzer)
|
97 |
|
98 |
|