Go to the documentation of this file.00001
00005 #include "Geometry/GEMGeometryBuilder/src/GEMGeometryBuilderFromCondDB.h"
00006 #include "Geometry/GEMGeometry/interface/GEMGeometry.h"
00007 #include "Geometry/GEMGeometry/interface/GEMEtaPartitionSpecs.h"
00008
00009 #include <DetectorDescription/Core/interface/DDFilter.h>
00010 #include <DetectorDescription/Core/interface/DDFilteredView.h>
00011 #include <DetectorDescription/Core/interface/DDSolid.h>
00012
00013 #include "Geometry/MuonNumbering/interface/MuonDDDNumbering.h"
00014 #include "Geometry/MuonNumbering/interface/MuonBaseNumber.h"
00015 #include "Geometry/MuonNumbering/interface/GEMNumberingScheme.h"
00016
00017 #include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
00018 #include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
00019
00020 #include "DataFormats/GeometryVector/interface/Basic3DVector.h"
00021
00022 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00023
00024 #include <iostream>
00025 #include <algorithm>
00026
00027 GEMGeometryBuilderFromCondDB::GEMGeometryBuilderFromCondDB(bool comp11) :
00028 theComp11Flag(comp11)
00029 { }
00030
00031 GEMGeometryBuilderFromCondDB::~GEMGeometryBuilderFromCondDB()
00032 { }
00033
00034 GEMGeometry* GEMGeometryBuilderFromCondDB::build(const RecoIdealGeometry& rgeo)
00035 {
00036 const std::vector<DetId>& detids(rgeo.detIds());
00037 GEMGeometry* geometry = new GEMGeometry();
00038
00039 std::string name;
00040 std::vector<double>::const_iterator tranStart;
00041 std::vector<double>::const_iterator shapeStart;
00042 std::vector<double>::const_iterator rotStart;
00043 std::vector<std::string>::const_iterator strStart;
00044
00045 for (unsigned int id=0; id<detids.size(); id++){
00046
00047 GEMDetId gemid(detids[id]);
00048
00049
00050
00051 tranStart=rgeo.tranStart(id);
00052 shapeStart=rgeo.shapeStart(id);
00053 rotStart=rgeo.rotStart(id);
00054 strStart=rgeo.strStart(id);
00055 name=*(strStart);
00056
00057 Surface::PositionType pos(*(tranStart)/cm,*(tranStart+1)/cm, *(tranStart+2)/cm);
00058
00059 Surface::RotationType rot(*(rotStart+0),*(rotStart+1),*(rotStart+2),
00060 *(rotStart+3),*(rotStart+4),*(rotStart+5),
00061 *(rotStart+6),*(rotStart+7),*(rotStart+8));
00062
00063 std::vector<float> pars;
00064 GEMEtaPartitionSpecs* etapartitionspecs= 0;
00065 Bounds* bounds = 0;
00066
00067 float be = *(shapeStart+0)/cm;
00068 float te = *(shapeStart+1)/cm;
00069 float ap = *(shapeStart+2)/cm;
00070 float ti = *(shapeStart+3)/cm;
00071 float nstrip = *(shapeStart+4);
00072
00073 bounds =
00074 new TrapezoidalPlaneBounds(be,te,ap,ti);
00075 pars.push_back(be);
00076 pars.push_back(te);
00077 pars.push_back(ap);
00078 pars.push_back(nstrip);
00079
00080 etapartitionspecs = new GEMEtaPartitionSpecs(GeomDetEnumerators::GEM,name,pars);
00081
00082
00083 Basic3DVector<float> newX(1.,0.,0.);
00084 Basic3DVector<float> newY(0.,0.,1.);
00085
00086 newY *= -1;
00087 Basic3DVector<float> newZ(0.,1.,0.);
00088 rot.rotateAxes (newX, newY,newZ);
00089
00090
00091 BoundPlane* bp = new BoundPlane(pos,rot,bounds);
00092 ReferenceCountingPointer<BoundPlane> surf(bp);
00093 GEMEtaPartition* gep=new GEMEtaPartition(gemid,surf,etapartitionspecs);
00094 geometry->add(gep);
00095
00096
00097 std::list<GEMEtaPartition *> gepls;
00098
00099
00100
00101
00102
00103 gepls.push_back(gep);
00104
00105
00106 }
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137 return geometry;
00138 }
00139
00140
00141