CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

MuonDTDetLayerGeometryBuilder Class Reference

#include <MuonDTDetLayerGeometryBuilder.h>

List of all members.

Public Member Functions

 MuonDTDetLayerGeometryBuilder ()
 Constructor.
virtual ~MuonDTDetLayerGeometryBuilder ()
 Destructor.

Static Public Member Functions

static std::vector< DetLayer * > buildLayers (const DTGeometry &geo)
 Operations.

Detailed Description

Build the DT DetLayers.

Date:
2006/06/02 12:21:39
Revision:
1.3
Author:
N. Amapane - CERN

Definition at line 18 of file MuonDTDetLayerGeometryBuilder.h.


Constructor & Destructor Documentation

MuonDTDetLayerGeometryBuilder::MuonDTDetLayerGeometryBuilder ( )

Constructor.

Definition at line 17 of file MuonDTDetLayerGeometryBuilder.cc.

                                                             {
}
MuonDTDetLayerGeometryBuilder::~MuonDTDetLayerGeometryBuilder ( ) [virtual]

Destructor.

Definition at line 20 of file MuonDTDetLayerGeometryBuilder.cc.

                                                              {
}

Member Function Documentation

vector< DetLayer * > MuonDTDetLayerGeometryBuilder::buildLayers ( const DTGeometry geo) [static]

Operations.

Definition at line 24 of file MuonDTDetLayerGeometryBuilder.cc.

References DTChamberId, DTGeometry::idToDet(), LogDebug, LogTrace, DTChamberId::maxSectorId, DTChamberId::maxStationId, DTChamberId::maxWheelId, metname, DTChamberId::minSectorId, DTChamberId::minStationId, DTChamberId::minWheelId, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeomDet::position(), precomputed_value_sort(), query::result, and relativeConstraints::station.

Referenced by MuonDetLayerGeometryESProducer::produce().

                                                                {
        
  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuonDTDetLayerGeometryBuilder";

  vector<DetLayer*> detlayers;
  vector<MuRodBarrelLayer*> result;
            
  for(int station = DTChamberId::minStationId; station <= DTChamberId::maxStationId; station++) {
    
    vector<const DetRod*> muDetRods;
    for(int sector = DTChamberId::minSectorId; sector <= DTChamberId::maxSectorId; sector++) {
      
      vector<const GeomDet*> geomDets;
      for(int wheel = DTChamberId::minWheelId; wheel <= DTChamberId::maxWheelId; wheel++) {               
        const GeomDet* geomDet = geo.idToDet(DTChamberId(wheel, station, sector));
        if (geomDet) {
          geomDets.push_back(geomDet);
          LogTrace(metname) << "get DT chamber " <<  DTChamberId(wheel, station, sector)
                            << " at R=" << geomDet->position().perp()
                            << ", phi=" << geomDet->position().phi() ;
        }
      }
      
      if (geomDets.size()!=0) {
        precomputed_value_sort(geomDets.begin(), geomDets.end(), geomsort::DetZ());
        muDetRods.push_back(new MuDetRod(geomDets));
        LogTrace(metname) << "  New MuDetRod with " << geomDets.size()
                          << " chambers at R=" << muDetRods.back()->position().perp()
                          << ", phi=" << muDetRods.back()->position().phi();
      }
    }
    precomputed_value_sort(muDetRods.begin(), muDetRods.end(), geomsort::ExtractPhi<GeometricSearchDet,float>());
    result.push_back(new MuRodBarrelLayer(muDetRods));  
    LogDebug(metname) << "    New MuRodBarrelLayer with " << muDetRods.size()
                      << " rods, at R " << result.back()->specificSurface().radius();
  }
  
  for(vector<MuRodBarrelLayer*>::const_iterator it = result.begin(); it != result.end(); it++)
    detlayers.push_back((DetLayer*)(*it));
  
  return detlayers;
}