test
Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
Geometry
VeryForwardGeometryBuilder
plugins
GeometryTestModule.cc
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* Authors:
4
* Jan Kaspar (jan.kaspar@gmail.com)
5
*
6
****************************************************************************/
7
8
#include "
FWCore/Framework/interface/ESHandle.h
"
9
#include "
FWCore/Framework/interface/MakerMacros.h
"
10
#include "
Geometry/VeryForwardGeometryBuilder/interface/DetGeomDesc.h
"
11
#include "
Geometry/Records/interface/VeryForwardRealGeometryRecord.h
"
12
13
#include "
Geometry/VeryForwardGeometryBuilder/interface/GeometryTestModule.h
"
14
#include "
Geometry/VeryForwardGeometryBuilder/interface/TotemRPGeometry.h
"
15
16
#include <iostream>
17
18
19
//----------------------------------------------------------------------------------------------------
20
//----------------------------------------------------------------------------------------------------
21
22
GeometryTestModule::GeometryTestModule
(
const
edm::ParameterSet
& iConfig)
23
{
24
}
25
26
//----------------------------------------------------------------------------------------------------
27
28
GeometryTestModule::~GeometryTestModule
()
29
{
30
}
31
32
//----------------------------------------------------------------------------------------------------
33
34
void
GeometryTestModule::beginJob
()
35
{
36
}
37
38
//----------------------------------------------------------------------------------------------------
39
40
void
GeometryTestModule::endJob
()
41
{
42
}
43
44
//----------------------------------------------------------------------------------------------------
45
46
void
GeometryTestModule::analyze
(
const
edm::Event
&
iEvent
,
const
edm::EventSetup
& iSetup)
47
{
48
using namespace
edm;
49
using namespace
std;
50
51
// retrieve the ideal geometrical description
52
// actually, it searchech for DetGeomDesc in VeryForwardMeasuredGeometryRecord
53
// and when it is not found, it calls TotemRPDetGeomDescESModule to produce it
54
ESHandle<DetGeomDesc>
gD;
55
iSetup.
get
<
VeryForwardMeasuredGeometryRecord
>().
get
(gD);
56
57
// retrieve RP map, similarly as above, when TotemRPMap is not found,
58
// TotemRPMapESModule is called (indeed, it must be specified in configuration file)
59
ESHandle<TotemRPGeometry>
idealRPMap;
60
iSetup.
get
<
VeryForwardMeasuredGeometryRecord
>().
get
(idealRPMap);
61
62
cout
<<
"-------------------------------------------"
<< endl
63
<<
" GeometryTestModule output: "
<< endl;
64
65
66
/*
67
// print the structure on screen
68
cout << "-------------------------------------------" << endl;
69
70
deque<DetGeomDesc *> buffer;
71
buffer.push_back((DetGeomDesc *)gD.product());
72
73
//int count = 0;
74
while (buffer.size() > 0) {
75
DetGeomDesc *d = buffer.front();
76
buffer.pop_front();
77
// // print only detectors
78
// if (!d->name().name().compare("RP_Silicon_Detector")) {
79
//cout << "** RP #" << count++ << endl
80
cout << "** name = " << d->name().name() << ", "
81
<< "ID = " << d->geographicalID().rawId()
82
// << endl
83
// << "translation: " << d->translation() << endl
84
// << "rotation: " << d->rotation()
85
<< endl;
86
// }
87
for (unsigned int i = 0; i < d->components().size(); i++) {
88
DetGeomDesc *dd = d->components()[i];
89
buffer.push_back(dd);
90
cout << " child[" << i << "] = " << dd->name().name() << endl;
91
}
92
93
cout << "==================================================" << endl;
94
}
95
*/
96
97
/*
98
cout << "-------------------------------------------" << endl;
99
// get geometrical info for an existing detector
100
cout << "shift = " << (*idealRPMap)[1208]->translation() << endl << "rotation:" << idealRPMap->GetDetector(1208)->rotation() << endl;
101
102
// exception is raised when geometry of an non-existing detector is required
103
//(*idealRPMap)[1288];
104
105
cout << "-------------------------------------------" << endl;
106
unsigned int id = 12;
107
cout << "children of element with ID " << id << endl;
108
set<unsigned int> rps = idealRPMap->RPsInStation(id);
109
//set<unsigned int> rps = idealRPMap->RPsInStation(stationId);
110
for (set<unsigned int>::iterator it = rps.begin(); it != rps.end(); ++it) {
111
cout << (*it)
112
<< idealRPMap->GetDetector((*it) * 10)->translation()
113
<< endl;
114
}
115
116
cout << "-------------------------------------------" << endl;
117
118
id = 1201;
119
CLHEP::Hep3Vector v(1, 0, 0);
120
cout << "vector = " << v << endl
121
<< "detector id = " << id << endl
122
<< "LocalToGlobal(v) = " << idealRPMap->LocalToGlobal(id, v) << endl
123
<< "GlobalToLocal(v) = " << idealRPMap->GlobalToLocal(id, v) << endl
124
<< "LocalToGlobalDirection(v) = " << idealRPMap->LocalToGlobalDirection(id, v) << endl
125
<< "GlobalToLocalDirection(v) = " << idealRPMap->GlobalToLocalDirection(id, v) << endl
126
<< endl;
127
128
cout << "-------------------------------------------" << endl;
129
*/
130
131
/*
132
// real geometry
133
ESHandle<DetGeomDesc> realGD;
134
iSetup.get<VeryForwardRealGeometryRecord>().get(realGD);
135
ESHandle<TotemRPGeometry> realRPMap;
136
iSetup.get<VeryForwardRealGeometryRecord>().get(realRPMap);
137
*/
138
139
for
(TotemRPGeometry::mapType::const_iterator it = idealRPMap->beginDet(); it != idealRPMap->endDet(); ++it) {
140
TotemRPDetId
id(it->first);
141
cout
<<
"possition of detector "
<<
id
.detectorDecId() << endl
142
<<
" ideal "
<< it->second->translation() << endl
143
// << " real " << (*realRPMap)[id]->translation() << endl
144
<< endl;
145
}
146
147
cout
<<
"-------------------------------------------"
<< endl;
148
149
/*
150
Alignments al = TotemRPExtractAlignments::Extract(idealRPMap.product(), realRPMap.product());
151
cout << "Extracted " << al.m_align.size() << " alignments." << endl;
152
for (unsigned int i = 0; i < al.m_align.size(); i++) {
153
AlignTransform &at = al.m_align[i];
154
cout << " ID = " << at.rawId() << endl
155
<< " shift = " << at.translation() << endl
156
<< " euler angles = " << at.eulerAngles()
157
<< endl;
158
}
159
160
cout << "-------------------------------------------" << endl;
161
*/
162
}
163
164
DEFINE_FWK_MODULE
(
GeometryTestModule
);
TotemRPDetId
Roman Pot detector ID.
Definition:
TotemRPDetId.h:51
VeryForwardRealGeometryRecord.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition:
MakerMacros.h:17
MakerMacros.h
GeometryTestModule::analyze
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition:
GeometryTestModule.cc:46
GeometryTestModule.h
iEvent
int iEvent
Definition:
GenABIO.cc:230
VeryForwardMeasuredGeometryRecord
Event setup record containing the Measured (measured) geometry information.
Definition:
VeryForwardMeasuredGeometryRecord.h:23
TotemRPGeometry.h
edm::ESHandle
Definition:
DTSurvey.h:22
ESHandle.h
edm::EventSetup
Definition:
EventSetup.h:45
DetGeomDesc.h
GeometryTestModule
Definition:
GeometryTestModule.h:10
GeometryTestModule::~GeometryTestModule
~GeometryTestModule()
Definition:
GeometryTestModule.cc:28
edm::EventSetup::get
const T & get() const
Definition:
EventSetup.h:56
GeometryTestModule::beginJob
virtual void beginJob()
Definition:
GeometryTestModule.cc:34
GeometryTestModule::endJob
virtual void endJob()
Definition:
GeometryTestModule.cc:40
GeometryTestModule::GeometryTestModule
GeometryTestModule(const edm::ParameterSet &)
Definition:
GeometryTestModule.cc:22
edm::ParameterSet
Definition:
ParameterSet.h:36
gather_cfg.cout
tuple cout
Definition:
gather_cfg.py:145
edm::Event
Definition:
Event.h:65
Generated for CMSSW Reference Manual by
1.8.5