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 | Private Attributes
TrackerGeomBuilderFromGeometricDet Class Reference

#include <TrackerGeomBuilderFromGeometricDet.h>

Public Member Functions

TrackerGeometrybuild (const GeometricDet *gd, const edm::ParameterSet &pSet)
 

Private Member Functions

void buildGeomDet (TrackerGeometry *)
 
void buildPixel (std::vector< const GeometricDet * > const &, TrackerGeometry *, GeomDetType::SubDetector det, bool upgradeGeometry, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y)
 
PlaneBuilderFromGeometricDet::ResultType buildPlaneWithMaterial (const GeometricDet *gd, double scaleFactor=1.) const
 
void buildSilicon (std::vector< const GeometricDet * > const &, TrackerGeometry *, GeomDetType::SubDetector det, const std::string &part)
 

Private Attributes

std::map< std::string,
PixelGeomDetType * > 
thePixelDetTypeMap
 
std::map< std::string,
StripGeomDetType * > 
theStripDetTypeMap
 

Detailed Description

Definition at line 15 of file TrackerGeomBuilderFromGeometricDet.h.

Member Function Documentation

TrackerGeometry * TrackerGeomBuilderFromGeometricDet::build ( const GeometricDet gd,
const edm::ParameterSet pSet 
)

Definition at line 38 of file TrackerGeomBuilderFromGeometricDet.cc.

References fireworks::BIG_PIX_PER_ROC_X, fireworks::BIG_PIX_PER_ROC_Y, buildGeomDet(), buildPixel(), buildSilicon(), AlCaHLTBitMon_QueryRunRegistry::comp, GeometricDet::deepComponents(), edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), i, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, sistripsummary::TEC, thePixelDetTypeMap, theStripDetTypeMap, sistripsummary::TIB, sistripsummary::TID, sistripsummary::TOB, and patCandidatesForDimuonsSequences_cff::tracker.

Referenced by CreateSurveyRcds::analyze(), SurveyInputTrackerFromDB::analyze(), SurveyMisalignmentInput::analyze(), TrackerSystematicMisalignments::analyze(), AlignmentMonitorAsAnalyzer::analyze(), TrackerGeometryIntoNtuples::analyze(), AlignmentProducer::createGeometries_(), TrackerGeometryCompare::createROOTGeometry(), TrackerDigiGeometryESModule::produce(), MisalignedTrackerESProducer::produce(), and LaserAlignment::produce().

39 {
40  bool upgradeGeometry = false;
41  int BIG_PIX_PER_ROC_X = 1;
42  int BIG_PIX_PER_ROC_Y = 2;
43 
44  if( pSet.exists( "trackerGeometryConstants" ))
45  {
46  const edm::ParameterSet tkGeomConsts( pSet.getParameter<edm::ParameterSet>( "trackerGeometryConstants" ));
47  upgradeGeometry = tkGeomConsts.getParameter<bool>( "upgradeGeometry" );
48  BIG_PIX_PER_ROC_X = tkGeomConsts.getParameter<int>( "BIG_PIX_PER_ROC_X" );
49  BIG_PIX_PER_ROC_Y = tkGeomConsts.getParameter<int>( "BIG_PIX_PER_ROC_Y" );
50  }
51 
52  thePixelDetTypeMap.clear();
53  theStripDetTypeMap.clear();
54 
56  std::vector<const GeometricDet*> comp;
57  gd->deepComponents(comp);
58 
59  std::vector<const GeometricDet*> dets[6];
60  std::vector<const GeometricDet*> & pixB = dets[0]; pixB.reserve(comp.size());
61  std::vector<const GeometricDet*> & pixF = dets[1]; pixF.reserve(comp.size());
62  std::vector<const GeometricDet*> & tib = dets[2]; tib.reserve(comp.size());
63  std::vector<const GeometricDet*> & tid = dets[3]; tid.reserve(comp.size());
64  std::vector<const GeometricDet*> & tob = dets[4]; tob.reserve(comp.size());
65  std::vector<const GeometricDet*> & tec = dets[5]; tec.reserve(comp.size());
66 
67  for(u_int32_t i = 0;i<comp.size();i++)
68  dets[comp[i]->geographicalID().subdetId()-1].push_back(comp[i]);
69 
70  // this order is VERY IMPORTANT!!!!!
72  upgradeGeometry,
73  BIG_PIX_PER_ROC_X,
74  BIG_PIX_PER_ROC_Y); //"PixelBarrel"
76  upgradeGeometry,
77  BIG_PIX_PER_ROC_X,
78  BIG_PIX_PER_ROC_Y); //"PixelEndcap"
79  buildSilicon(tib,tracker,GeomDetEnumerators::SubDetector::TIB, "barrel");//"TIB"
80  buildSilicon(tid,tracker,GeomDetEnumerators::SubDetector::TID, "endcap");//"TID"
81  buildSilicon(tob,tracker,GeomDetEnumerators::SubDetector::TOB, "barrel");//"TOB"
82  buildSilicon(tec,tracker,GeomDetEnumerators::SubDetector::TEC, "endcap");//"TEC"
83  buildGeomDet(tracker);//"GeomDet"
84 
85  verifyDUinTG(*tracker);
86 
87  return tracker;
88 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
static const int BIG_PIX_PER_ROC_Y
Definition: TrackUtils.cc:60
bool exists(std::string const &parameterName) const
checks if a parameter exists
void buildPixel(std::vector< const GeometricDet * > const &, TrackerGeometry *, GeomDetType::SubDetector det, bool upgradeGeometry, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y)
std::map< std::string, StripGeomDetType * > theStripDetTypeMap
static const int BIG_PIX_PER_ROC_X
Definition: TrackUtils.cc:63
void buildSilicon(std::vector< const GeometricDet * > const &, TrackerGeometry *, GeomDetType::SubDetector det, const std::string &part)
std::map< std::string, PixelGeomDetType * > thePixelDetTypeMap
ConstGeometricDetContainer deepComponents() const
void TrackerGeomBuilderFromGeometricDet::buildGeomDet ( TrackerGeometry tracker)
private

Definition at line 163 of file TrackerGeomBuilderFromGeometricDet.cc.

References TrackerGeometry::addDet(), TrackerGeometry::addDetId(), TrackerGeometry::detUnitIds(), TrackerGeometry::detUnits(), edm::hlt::Exception, StripSubdetector::glued(), i, findQualityFiles::jj, StripSubdetector::partnerDetId(), PlaneBuilderForGluedDet::plane(), and StripSubdetector::stereo().

Referenced by build().

163  {
164  PlaneBuilderForGluedDet gluedplaneBuilder;
165  std::vector<GeomDetUnit*> const & gdu= tracker->detUnits();
166  std::vector<DetId> const & gduId = tracker->detUnitIds();
167 
168  for(u_int32_t i=0;i<gdu.size();i++){
169  StripSubdetector sidet( gduId[i].rawId());
170  tracker->addDet((GeomDet*) gdu[i]);
171  tracker->addDetId(gduId[i]);
172  if(sidet.glued()!=0&&sidet.stereo()==1){
173  int partner_pos=-1;
174  for(u_int32_t jj=0;jj<gduId.size();jj++){
175  if(sidet.partnerDetId()== gduId[jj]) {
176  partner_pos=jj;
177  break;
178  }
179  }
180  const GeomDetUnit* dus = gdu[i];
181  if(partner_pos==-1){
182  throw cms::Exception("Configuration") <<"No partner detector found \n"
183  <<"There is a problem on Tracker geometry configuration\n";
184  }
185  const GeomDetUnit* dum = gdu[partner_pos];
186  std::vector<const GeomDetUnit *> glued(2);
187  glued[0]=dum;
188  glued[1]=dus;
189  PlaneBuilderForGluedDet::ResultType plane = gluedplaneBuilder.plane(glued);
190  GluedGeomDet* gluedDet = new GluedGeomDet(&(*plane),dum,dus);
191  tracker->addDet((GeomDet*) gluedDet);
192  tracker->addDetId(DetId(sidet.glued()));
193  }
194  }
195 }
int i
Definition: DBlmapReader.cc:9
ResultType plane(const std::vector< const GeomDetUnit * > &dets) const
void addDetId(DetId p)
virtual const DetUnitContainer & detUnits() const
Returm a vector of all GeomDetUnit.
Definition: DetId.h:18
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
void addDet(GeomDet *p)
void TrackerGeomBuilderFromGeometricDet::buildPixel ( std::vector< const GeometricDet * > const &  gdv,
TrackerGeometry tracker,
GeomDetType::SubDetector  det,
bool  upgradeGeometry,
int  BIG_PIX_PER_ROC_X,
int  BIG_PIX_PER_ROC_Y 
)
private

Definition at line 90 of file TrackerGeomBuilderFromGeometricDet.cc.

References TrackerGeometry::addDetUnit(), TrackerGeometry::addDetUnitId(), TrackerGeometry::addType(), PixelTopologyBuilder::build(), buildPlaneWithMaterial(), i, TrackerGeometry::setEndsetDU(), TrackerGeometry::setOffsetDU(), AlCaHLTBitMon_QueryRunRegistry::string, lumiQTWidget::t, groupFilesInBlocks::temp, and thePixelDetTypeMap.

Referenced by build().

96 {
97  tracker->setOffsetDU(det);
98 
99  for(u_int32_t i=0; i<gdv.size(); i++){
100 
101  std::string const & detName = gdv[i]->name().fullname();
102  if (thePixelDetTypeMap.find(detName) == thePixelDetTypeMap.end()) {
103  std::auto_ptr<const Bounds> bounds(gdv[i]->bounds());
104 
105  PixelTopology* t =
106  PixelTopologyBuilder().build(&*bounds,
107  upgradeGeometry,
108  gdv[i]->pixROCRows(),
109  gdv[i]->pixROCCols(),
112  gdv[i]->pixROCx(), gdv[i]->pixROCy());
113 
114  thePixelDetTypeMap[detName] = new PixelGeomDetType(t,detName,det);
115  tracker->addType(thePixelDetTypeMap[detName]);
116  }
117 
119  GeomDetUnit* temp = new PixelGeomDetUnit(&(*plane),thePixelDetTypeMap[detName],gdv[i]);
120 
121  tracker->addDetUnit(temp);
122  tracker->addDetUnitId(gdv[i]->geographicalID());
123  }
124  tracker->setEndsetDU(det);
125 
126 }
int i
Definition: DBlmapReader.cc:9
void setEndsetDU(SubDetector sid)
PixelTopology * build(const Bounds *bounds, bool upgradeGeometry, int ROWS_PER_ROC, int COLS_PER_ROC, int BIG_PIX_PER_ROC_X, int BIG_PIX_PER_ROC_Y, int ROCS_X, int ROCS_Y)
static const int BIG_PIX_PER_ROC_Y
Definition: TrackUtils.cc:60
static const int BIG_PIX_PER_ROC_X
Definition: TrackUtils.cc:63
void setOffsetDU(SubDetector sid)
PlaneBuilderFromGeometricDet::ResultType buildPlaneWithMaterial(const GeometricDet *gd, double scaleFactor=1.) const
std::map< std::string, PixelGeomDetType * > thePixelDetTypeMap
void addDetUnitId(DetId p)
void addType(GeomDetType *p)
void addDetUnit(GeomDetUnit *p)
PlaneBuilderFromGeometricDet::ResultType TrackerGeomBuilderFromGeometricDet::buildPlaneWithMaterial ( const GeometricDet gd,
double  scaleFactor = 1. 
) const
private

Definition at line 198 of file TrackerGeomBuilderFromGeometricDet.cc.

References PlaneBuilderFromGeometricDet::plane(), GeometricDet::radLength(), pileupReCalc_HLTpaths::scale, and GeometricDet::xi().

Referenced by buildPixel(), and buildSilicon().

200 {
201  PlaneBuilderFromGeometricDet planeBuilder;
202  PlaneBuilderFromGeometricDet::ResultType plane = planeBuilder.plane(gd);
203  //
204  // set medium properties (if defined)
205  //
206  plane->setMediumProperties(MediumProperties(gd->radLength()*scale,gd->xi()*scale));
207 
208  return plane;
209 }
double radLength() const
Definition: GeometricDet.h:240
ResultType plane(const GeometricDet *gd) const
double xi() const
Definition: GeometricDet.h:244
void TrackerGeomBuilderFromGeometricDet::buildSilicon ( std::vector< const GeometricDet * > const &  gdv,
TrackerGeometry tracker,
GeomDetType::SubDetector  det,
const std::string &  part 
)
private

Definition at line 128 of file TrackerGeomBuilderFromGeometricDet.cc.

References TrackerGeometry::addDetUnit(), TrackerGeometry::addDetUnitId(), TrackerGeometry::addType(), StripTopologyBuilder::build(), buildPlaneWithMaterial(), i, StripSubdetector::partnerDetId(), pileupReCalc_HLTpaths::scale, TrackerGeometry::setEndsetDU(), TrackerGeometry::setOffsetDU(), AlCaHLTBitMon_QueryRunRegistry::string, lumiQTWidget::t, groupFilesInBlocks::temp, and theStripDetTypeMap.

Referenced by build().

132 {
133  tracker->setOffsetDU(det);
134 
135  for(u_int32_t i=0;i<gdv.size();i++){
136 
137  std::string const & detName = gdv[i]->name().fullname();
138  if (theStripDetTypeMap.find(detName) == theStripDetTypeMap.end()) {
139  std::auto_ptr<const Bounds> bounds(gdv[i]->bounds());
140  StripTopology* t =
141  StripTopologyBuilder().build(&*bounds,
142  gdv[i]->siliconAPVNum(),
143  part);
144  theStripDetTypeMap[detName] = new StripGeomDetType( t,detName,det,
145  gdv[i]->stereo());
146  tracker->addType(theStripDetTypeMap[detName]);
147  }
148 
149  StripSubdetector sidet( gdv[i]->geographicalID());
150  double scale = (sidet.partnerDetId()) ? 0.5 : 1.0 ;
151 
153  GeomDetUnit* temp = new StripGeomDetUnit(&(*plane), theStripDetTypeMap[detName],gdv[i]);
154 
155  tracker->addDetUnit(temp);
156  tracker->addDetUnitId(gdv[i]->geographicalID());
157  }
158  tracker->setEndsetDU(det);
159 
160 }
int i
Definition: DBlmapReader.cc:9
StripTopology * build(const Bounds *, double, std::string)
void setEndsetDU(SubDetector sid)
std::map< std::string, StripGeomDetType * > theStripDetTypeMap
void setOffsetDU(SubDetector sid)
PlaneBuilderFromGeometricDet::ResultType buildPlaneWithMaterial(const GeometricDet *gd, double scaleFactor=1.) const
part
Definition: HCALResponse.h:20
void addDetUnitId(DetId p)
void addType(GeomDetType *p)
void addDetUnit(GeomDetUnit *p)

Member Data Documentation

std::map<std::string,PixelGeomDetType*> TrackerGeomBuilderFromGeometricDet::thePixelDetTypeMap
private

Definition at line 34 of file TrackerGeomBuilderFromGeometricDet.h.

Referenced by build(), and buildPixel().

std::map<std::string,StripGeomDetType*> TrackerGeomBuilderFromGeometricDet::theStripDetTypeMap
private

Definition at line 35 of file TrackerGeomBuilderFromGeometricDet.h.

Referenced by build(), and buildSilicon().