test
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
GeometryTestModule Class Reference

#include <GeometryTestModule.h>

Inheritance diagram for GeometryTestModule:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 GeometryTestModule (const edm::ParameterSet &)
 
 ~GeometryTestModule ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 10 of file GeometryTestModule.h.

Constructor & Destructor Documentation

GeometryTestModule::GeometryTestModule ( const edm::ParameterSet iConfig)
explicit

Definition at line 22 of file GeometryTestModule.cc.

23 {
24 }
GeometryTestModule::~GeometryTestModule ( )

Definition at line 28 of file GeometryTestModule.cc.

29 {
30 }

Member Function Documentation

void GeometryTestModule::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 46 of file GeometryTestModule.cc.

References gather_cfg::cout, and edm::EventSetup::get().

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
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 }
Roman Pot detector ID.
Definition: TotemRPDetId.h:51
Event setup record containing the Measured (measured) geometry information.
const T & get() const
Definition: EventSetup.h:56
tuple cout
Definition: gather_cfg.py:145
void GeometryTestModule::beginJob ( void  )
privatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 34 of file GeometryTestModule.cc.

35 {
36 }
void GeometryTestModule::endJob ( void  )
privatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 40 of file GeometryTestModule.cc.

41 {
42 }