CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
MuonDetIdAssociator Class Reference

#include <MuonDetIdAssociator.h>

Inheritance diagram for MuonDetIdAssociator:
DetIdAssociator

Public Member Functions

virtual const GeomDetgetGeomDet (const DetId &id) const
 
 MuonDetIdAssociator ()
 
 MuonDetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
 MuonDetIdAssociator (const edm::ParameterSet &pSet)
 
virtual const char * name () const
 
virtual void setConditions (const DetIdAssociatorRecord &iRecord)
 
virtual void setCSCBadChambers (const CSCBadChambers *ptr)
 
virtual void setGeometry (const GlobalTrackingGeometry *ptr)
 
virtual void setGeometry (const DetIdAssociatorRecord &iRecord)
 
- Public Member Functions inherited from DetIdAssociator
virtual void buildMap ()
 make the look-up map More...
 
 DetIdAssociator (const int nPhi, const int nEta, const double etaBinSize)
 
double etaBinSize () const
 look-up map bin size in eta dimension More...
 
virtual std::vector< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory) const
 
virtual std::vector< DetIdgetCrossedDetIds (const std::set< DetId > &, const std::vector< SteppingHelixStateInfo > &trajectory, const double toleranceInSigmas=-1) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &, const int iN=0) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &direction, const unsigned int iNEtaPlus, const unsigned int iNEtaMinus, const unsigned int iNPhiPlus, const unsigned int iNPhiMinus) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &direction, const MapRange &mapRange) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double d=0) const
 
virtual std::set< DetIdgetDetIdsCloseToAPoint (const GlobalPoint &point, const double dThetaPlus, const double dThetaMinus, const double dPhiPlus, const double dPhiMinus) const
 
virtual std::set< DetIdgetDetIdsInACone (const std::set< DetId > &, const std::vector< GlobalPoint > &trajectory, const double dR) const
 
virtual int iEta (const GlobalPoint &) const
 look-up map eta index More...
 
virtual int iPhi (const GlobalPoint &) const
 look-up map phi index More...
 
int nEtaBins () const
 number of bins of the look-up map in eta dimension More...
 
int nPhiBins () const
 number of bins of the look-up map in phi dimension More...
 
virtual void setPropagator (Propagator *ptr)
 set a specific track propagator to be used More...
 
const FiducialVolumevolume () const
 get active detector volume More...
 
virtual ~DetIdAssociator ()
 

Protected Member Functions

virtual void check_setup () const
 
virtual std::pair
< const_iterator,
const_iterator
getDetIdPoints (const DetId &id) const
 
virtual GlobalPoint getPosition (const DetId &id) const
 
virtual const std::vector
< DetId > & 
getValidDetIds (unsigned int) const
 
virtual bool insideElement (const GlobalPoint &point, const DetId &id) const
 
- Protected Member Functions inherited from DetIdAssociator
virtual bool crossedElement (const GlobalPoint &, const GlobalPoint &, const DetId &, const double toleranceInSigmas=-1, const SteppingHelixStateInfo *=0) const
 
virtual void dumpMapContent (int, int) const
 
virtual void dumpMapContent (int, int, int, int) const
 
void fillSet (std::set< DetId > &set, unsigned int iEta, unsigned int iPhi) const
 
virtual const unsigned int getNumberOfSubdetectors () const
 
unsigned int index (unsigned int iEta, unsigned int iPhi) const
 
virtual bool nearElement (const GlobalPoint &point, const DetId &id, const double distance) const
 

Protected Attributes

const CSCBadChamberscscbadchambers_
 
const GlobalTrackingGeometrygeometry_
 
bool includeBadChambers_
 
std::vector< GlobalPointpoints_
 
std::vector< DetIdvalidIds_
 
- Protected Attributes inherited from DetIdAssociator
std::vector< DetIdcontainer_
 
const double etaBinSize_
 
PropagatorivProp_
 
std::vector< std::pair
< unsigned int, unsigned int > > 
lookupMap_
 
double maxEta_
 
double minTheta_
 
const int nEta_
 
const int nPhi_
 
bool theMapIsValid_
 
FiducialVolume volume_
 

Additional Inherited Members

- Public Types inherited from DetIdAssociator
typedef std::vector
< GlobalPoint >
::const_iterator 
const_iterator
 
enum  PropagationTarget { Barrel, ForwardEndcap, BackwardEndcap }
 

Detailed Description

Definition at line 33 of file MuonDetIdAssociator.h.

Constructor & Destructor Documentation

MuonDetIdAssociator::MuonDetIdAssociator ( )
inline

Definition at line 35 of file MuonDetIdAssociator.h.

const CSCBadChambers * cscbadchambers_
DetIdAssociator(const int nPhi, const int nEta, const double etaBinSize)
const GlobalTrackingGeometry * geometry_
MuonDetIdAssociator::MuonDetIdAssociator ( const int  nPhi,
const int  nEta,
const double  etaBinSize 
)
inline

Definition at line 36 of file MuonDetIdAssociator.h.

const CSCBadChambers * cscbadchambers_
double etaBinSize() const
look-up map bin size in eta dimension
DetIdAssociator(const int nPhi, const int nEta, const double etaBinSize)
const GlobalTrackingGeometry * geometry_
MuonDetIdAssociator::MuonDetIdAssociator ( const edm::ParameterSet pSet)
inline

Definition at line 39 of file MuonDetIdAssociator.h.

40  :DetIdAssociator(pSet.getParameter<int>("nPhi"),pSet.getParameter<int>("nEta"),pSet.getParameter<double>("etaBinSize")),geometry_(0),cscbadchambers_(0),includeBadChambers_(pSet.getParameter<bool>("includeBadChambers")){};
T getParameter(std::string const &) const
const CSCBadChambers * cscbadchambers_
DetIdAssociator(const int nPhi, const int nEta, const double etaBinSize)
const GlobalTrackingGeometry * geometry_

Member Function Documentation

void MuonDetIdAssociator::check_setup ( ) const
protectedvirtual

Reimplemented from DetIdAssociator.

Definition at line 31 of file MuonDetIdAssociator.cc.

References DetIdAssociator::check_setup(), cscbadchambers_, edm::hlt::Exception, and geometry_.

31  {
32  if (geometry_==0) throw cms::Exception("ConfigurationProblem") << "GlobalTrackingGeomtry is not set\n";
33  if (cscbadchambers_==0) throw cms::Exception("ConfigurationProblem") << "CSCBadChambers is not set\n";
35 }
const CSCBadChambers * cscbadchambers_
virtual void check_setup() const
const GlobalTrackingGeometry * geometry_
std::pair< DetIdAssociator::const_iterator, DetIdAssociator::const_iterator > MuonDetIdAssociator::getDetIdPoints ( const DetId id) const
protectedvirtual

Implements DetIdAssociator.

Definition at line 92 of file MuonDetIdAssociator.cc.

References BoundSurface::bounds(), geometry_, getGeomDet(), GlobalTrackingGeometry::idToDet(), Bounds::length(), points_, GeomDet::surface(), Bounds::thickness(), GeomDet::toGlobal(), and Bounds::width().

93 {
94  points_.clear();
95  const GeomDet* geomDet = getGeomDet( id );
96 
97  // the coners of muon detector elements are not stored and can be only calculated
98  // based on methods defined in the interface class Bounds:
99  // width() - x
100  // length() - y
101  // thinkness() - z
102  // NOTE: this convention is implementation specific and can fail. Both
103  // RectangularPlaneBounds and TrapezoidalPlaneBounds use it.
104  // Even though the CSC geomtry is more complicated (trapezoid), it's enough
105  // to estimate which bins should contain this element. For the distance
106  // calculation from the edge, we will use exact geometry to get it right.
107 
108  const Bounds* bounds = &(geometry_->idToDet(id)->surface().bounds());
109  points_.push_back(geomDet->toGlobal(LocalPoint(+bounds->width()/2,+bounds->length()/2,+bounds->thickness()/2)));
110  points_.push_back(geomDet->toGlobal(LocalPoint(-bounds->width()/2,+bounds->length()/2,+bounds->thickness()/2)));
111  points_.push_back(geomDet->toGlobal(LocalPoint(+bounds->width()/2,-bounds->length()/2,+bounds->thickness()/2)));
112  points_.push_back(geomDet->toGlobal(LocalPoint(-bounds->width()/2,-bounds->length()/2,+bounds->thickness()/2)));
113  points_.push_back(geomDet->toGlobal(LocalPoint(+bounds->width()/2,+bounds->length()/2,-bounds->thickness()/2)));
114  points_.push_back(geomDet->toGlobal(LocalPoint(-bounds->width()/2,+bounds->length()/2,-bounds->thickness()/2)));
115  points_.push_back(geomDet->toGlobal(LocalPoint(+bounds->width()/2,-bounds->length()/2,-bounds->thickness()/2)));
116  points_.push_back(geomDet->toGlobal(LocalPoint(-bounds->width()/2,-bounds->length()/2,-bounds->thickness()/2)));
117 
118  return std::pair<const_iterator,const_iterator>(points_.begin(),points_.end());
119 }
virtual float length() const =0
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:47
virtual float thickness() const =0
virtual const GeomDet * idToDet(DetId) const
virtual const GeomDet * getGeomDet(const DetId &id) const
std::vector< GlobalPoint > points_
const Bounds & bounds() const
Definition: BoundSurface.h:89
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const GlobalTrackingGeometry * geometry_
Definition: Bounds.h:18
virtual float width() const =0
const GeomDet * MuonDetIdAssociator::getGeomDet ( const DetId id) const
virtual

Implements DetIdAssociator.

Definition at line 37 of file MuonDetIdAssociator.cc.

References edm::hlt::Exception, geometry_, and GlobalTrackingGeometry::idToDet().

Referenced by getDetIdPoints(), and getPosition().

38 {
39  if (geometry_==0) throw cms::Exception("ConfigurationProblem") << "GlobalTrackingGeomtry is not set\n";
40  const GeomDet* gd = geometry_->idToDet(id);
41  if (gd == 0) throw cms::Exception("NoGeometry") << "Cannot find GeomDet for DetID: " << id.rawId() <<"\n";
42  return gd;
43 }
virtual const GeomDet * idToDet(DetId) const
const GlobalTrackingGeometry * geometry_
GlobalPoint MuonDetIdAssociator::getPosition ( const DetId id) const
protectedvirtual

Implements DetIdAssociator.

Definition at line 46 of file MuonDetIdAssociator.cc.

References getGeomDet(), point, position, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

46  {
48  return GlobalPoint(point.x(),point.y(),point.z());
49 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
virtual const GeomDet * getGeomDet(const DetId &id) const
static int position[264][3]
Definition: ReadPGInfo.cc:509
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
const std::vector< DetId > & MuonDetIdAssociator::getValidDetIds ( unsigned int  subDectorIndex) const
protectedvirtual

Implements DetIdAssociator.

Definition at line 51 of file MuonDetIdAssociator.cc.

References cscbadchambers_, CSCDetId, TrackingGeometry::dets(), dt, DTChamberId, edm::hlt::Exception, geometry_, includeBadChambers_, CSCBadChambers::isInBadChamber(), alignCSCRings::r, RPCDetId, GlobalTrackingGeometry::slaveGeometry(), and validIds_.

51  {
52  validIds_.clear();
53  if (geometry_==0) throw cms::Exception("ConfigurationProblem") << "GlobalTrackingGeomtry is not set\n";
54  if (subDectorIndex!=0) throw cms::Exception("FatalError") <<
55  "Muon sub-dectors are all handle as one sub-system, but subDetectorIndex is not zero.\n";
56 
57  // CSC
58  if (! geometry_->slaveGeometry(CSCDetId()) ) throw cms::Exception("FatalError") << "Cannnot CSCGeometry\n";
59  const std::vector<GeomDet*>& geomDetsCSC = geometry_->slaveGeometry(CSCDetId())->dets();
60  for(std::vector<GeomDet*>::const_iterator it = geomDetsCSC.begin(); it != geomDetsCSC.end(); ++it)
61  if (CSCChamber* csc = dynamic_cast< CSCChamber*>(*it)) {
62  if ((! includeBadChambers_) && (cscbadchambers_->isInBadChamber(CSCDetId(csc->id())))) continue;
63  validIds_.push_back(csc->id());
64  }
65 
66  // DT
67  if (! geometry_->slaveGeometry(DTChamberId()) ) throw cms::Exception("FatalError") << "Cannnot DTGeometry\n";
68  const std::vector<GeomDet*>& geomDetsDT = geometry_->slaveGeometry(DTChamberId())->dets();
69  for(std::vector<GeomDet*>::const_iterator it = geomDetsDT.begin(); it != geomDetsDT.end(); ++it)
70  if (DTChamber* dt = dynamic_cast< DTChamber*>(*it)) validIds_.push_back(dt->id());
71 
72  // RPC
73  if (! geometry_->slaveGeometry(RPCDetId()) ) throw cms::Exception("FatalError") << "Cannnot RPCGeometry\n";
74  const std::vector<GeomDet*>& geomDetsRPC = geometry_->slaveGeometry(RPCDetId())->dets();
75  for(std::vector<GeomDet*>::const_iterator it = geomDetsRPC.begin(); it != geomDetsRPC.end(); ++it)
76  if (RPCChamber* rpc = dynamic_cast< RPCChamber*>(*it)) {
77  std::vector< const RPCRoll*> rolls = (rpc->rolls());
78  for(std::vector<const RPCRoll*>::iterator r = rolls.begin(); r != rolls.end(); ++r)
79  validIds_.push_back((*r)->id().rawId());
80  }
81 
82  return validIds_;
83 }
bool isInBadChamber(const CSCDetId &id) const
Is the gven chamber flagged as bad?
float dt
Definition: AMPTWrapper.h:126
const CSCBadChambers * cscbadchambers_
std::vector< DetId > validIds_
const TrackingGeometry * slaveGeometry(DetId id) const
Return the pointer to the actual geometry for a given DetId.
virtual const DetContainer & dets() const =0
Returm a vector of all GeomDet (including all GeomDetUnits)
const GlobalTrackingGeometry * geometry_
bool MuonDetIdAssociator::insideElement ( const GlobalPoint point,
const DetId id 
) const
protectedvirtual

Implements DetIdAssociator.

Definition at line 85 of file MuonDetIdAssociator.cc.

References BoundSurface::bounds(), edm::hlt::Exception, geometry_, GlobalTrackingGeometry::idToDet(), Bounds::inside(), GeomDet::surface(), and GeomDet::toLocal().

85  {
86  if (geometry_==0) throw cms::Exception("ConfigurationProblem") << "GlobalTrackingGeomtry is not set\n";
87  LocalPoint lp = geometry_->idToDet(id)->toLocal(point);
88  return geometry_->idToDet(id)->surface().bounds().inside(lp);
89 }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:62
virtual const GeomDet * idToDet(DetId) const
const Bounds & bounds() const
Definition: BoundSurface.h:89
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const GlobalTrackingGeometry * geometry_
virtual const char* MuonDetIdAssociator::name ( void  ) const
inlinevirtual

Implements DetIdAssociator.

Definition at line 56 of file MuonDetIdAssociator.h.

56 { return "AllMuonDetectors"; }
virtual void MuonDetIdAssociator::setConditions ( const DetIdAssociatorRecord iRecord)
inlinevirtual

Reimplemented from DetIdAssociator.

Definition at line 48 of file MuonDetIdAssociator.h.

References edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), edm::ESHandle< class >::product(), and setCSCBadChambers().

48  {
49  edm::ESHandle<CSCBadChambers> cscbadchambersH;
50  iRecord.getRecord<CSCBadChambersRcd>().get(cscbadchambersH);
51  setCSCBadChambers(cscbadchambersH.product());
52  };
virtual void setCSCBadChambers(const CSCBadChambers *ptr)
T const * product() const
Definition: ESHandle.h:62
virtual void MuonDetIdAssociator::setCSCBadChambers ( const CSCBadChambers ptr)
inlinevirtual

Definition at line 46 of file MuonDetIdAssociator.h.

References cscbadchambers_.

Referenced by setConditions().

46 { cscbadchambers_ = ptr; }
const CSCBadChambers * cscbadchambers_
virtual void MuonDetIdAssociator::setGeometry ( const GlobalTrackingGeometry ptr)
inlinevirtual

Definition at line 42 of file MuonDetIdAssociator.h.

References geometry_.

Referenced by setGeometry().

42 { geometry_ = ptr; }
const GlobalTrackingGeometry * geometry_
void MuonDetIdAssociator::setGeometry ( const DetIdAssociatorRecord iRecord)
virtual

Member Data Documentation

const CSCBadChambers* MuonDetIdAssociator::cscbadchambers_
protected

Definition at line 72 of file MuonDetIdAssociator.h.

Referenced by check_setup(), getValidDetIds(), and setCSCBadChambers().

const GlobalTrackingGeometry* MuonDetIdAssociator::geometry_
protected
bool MuonDetIdAssociator::includeBadChambers_
protected

Definition at line 73 of file MuonDetIdAssociator.h.

Referenced by getValidDetIds().

std::vector<GlobalPoint> MuonDetIdAssociator::points_
mutableprotected

Definition at line 74 of file MuonDetIdAssociator.h.

Referenced by getDetIdPoints().

std::vector<DetId> MuonDetIdAssociator::validIds_
mutableprotected

Definition at line 75 of file MuonDetIdAssociator.h.

Referenced by getValidDetIds().