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
CSCGeometryESModule Class Reference

#include <CSCGeometryESModule.h>

Inheritance diagram for CSCGeometryESModule:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 CSCGeometryESModule (const edm::ParameterSet &p)
 Constructor. More...
 
boost::shared_ptr< CSCGeometryproduce (const MuonGeometryRecord &record)
 Produce CSCGeometry. More...
 
virtual ~CSCGeometryESModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Member Functions

void geometryCallback_ (const MuonNumberingRecord &)
 Called when geometry description changes. More...
 

Private Attributes

const std::string alignmentsLabel_
 
bool applyAlignment_
 
boost::shared_ptr< CSCGeometrycscGeometry
 
bool debugV
 
const std::string myLabel_
 
bool useCentreTIOffsets
 
bool useDDD_
 
bool useGangedStripsInME1a
 
bool useOnlyWiresInME1a
 
bool useRealWireGeometry
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

ESProducer for CSCGeometry in MuonGeometryRecord

Author
Tim Cox

Definition at line 19 of file CSCGeometryESModule.h.

Constructor & Destructor Documentation

CSCGeometryESModule::CSCGeometryESModule ( const edm::ParameterSet p)

Constructor.

Definition at line 35 of file CSCGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, debugV, edm::eventsetup::dependsOn(), geometryCallback_(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), myLabel_, edm::ESProducer::setWhatProduced(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

36  : alignmentsLabel_(p.getParameter<std::string>("alignmentsLabel")),
37  myLabel_(p.getParameter<std::string>("appendToDataLabel"))
38 {
39 
41 
42  // Choose wire geometry modelling
43  // We now _require_ some wire geometry specification in the CSCOrcaSpec.xml file
44  // in the DDD Geometry.
45  // Default as of transition to CMSSW is to use real values.
46  // Alternative is to use pseudo-values which match reasonably closely
47  // the calculated geometry values used up to and including ORCA_8_8_1.
48  // (This was the default in ORCA.)
49 
50  useRealWireGeometry = p.getParameter<bool>("useRealWireGeometry");
51 
52  // Suppress strips altogether in ME1a region of ME11?
53 
54  useOnlyWiresInME1a = p.getParameter<bool>("useOnlyWiresInME1a");
55 
56  // Allow strips in ME1a region of ME11 but gang them?
57  // Default is now to treat ME1a with ganged strips (e.g. in clusterizer)
58 
59  useGangedStripsInME1a = p.getParameter<bool>("useGangedStripsInME1a");
60 
61  if ( useGangedStripsInME1a ) useOnlyWiresInME1a = false; // override possible inconsistentcy
62 
63  // Use the backed-out offsets that correct the CTI
64  useCentreTIOffsets = p.getParameter<bool>("useCentreTIOffsets");
65 
66  // Debug printout etc. in CSCGeometry etc.
67 
68  debugV = p.getUntrackedParameter<bool>("debugV", false);
69 
70  // Find out if using the DDD or CondDB Geometry source.
71  useDDD_ = p.getParameter<bool>("useDDD");
72 
73  // Feed these value to where I need them
74  applyAlignment_ = p.getParameter<bool>("applyAlignment");
75 
76 
77  edm::LogInfo("Geometry") << "@SUB=CSCGeometryESModule"
78  << "Label '" << myLabel_ << "' "
79  << (applyAlignment_ ? "looking for" : "IGNORING")
80  << " alignment labels '" << alignmentsLabel_ << "'.";
81 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
const std::string alignmentsLabel_
const std::string myLabel_
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void geometryCallback_(const MuonNumberingRecord &)
Called when geometry description changes.
CSCGeometryESModule::~CSCGeometryESModule ( )
virtual

Destructor.

Definition at line 84 of file CSCGeometryESModule.cc.

84 {}

Member Function Documentation

void CSCGeometryESModule::geometryCallback_ ( const MuonNumberingRecord record)
private

Called when geometry description changes.

Definition at line 125 of file CSCGeometryESModule.cc.

References CSCGeometryBuilderFromDDD::build(), CSCGeometryBuilder::build(), cscGeometry, debugV, edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), useCentreTIOffsets, useDDD_, useGangedStripsInME1a, useOnlyWiresInME1a, and useRealWireGeometry.

Referenced by CSCGeometryESModule().

126 {
127  // Called whenever the muon numbering (or ideal geometry) changes
128 
129  cscGeometry = boost::shared_ptr<CSCGeometry>( new CSCGeometry );
130 
131  cscGeometry->setUseRealWireGeometry( useRealWireGeometry );
132  cscGeometry->setOnlyWiresInME1a( useOnlyWiresInME1a );
133  cscGeometry->setGangedStripsInME1a( useGangedStripsInME1a );
134  cscGeometry->setUseCentreTIOffsets( useCentreTIOffsets );
135  cscGeometry->setDebugV( debugV );
136  if ( debugV ) cscGeometry->queryModelling();
137 
138  // Called whenever the muon numbering (or ideal geometry) changes
139  //
140  if ( useDDD_ ) {
143  record.getRecord<IdealGeometryRecord>().get(cpv);
144  record.get( mdc );
146  // _cscGeometry = boost::shared_ptr<CSCGeometry>(builder.build(_cscGeometry, &(*cpv), *mdc));
147  builder.build(cscGeometry, &(*cpv), *mdc);
148  } else {
151  record.getRecord<CSCRecoGeometryRcd>().get(rig);
152  record.getRecord<CSCRecoDigiParametersRcd>().get(rdp);
153  CSCGeometryBuilder cscgb;
154  // _cscGeometry = boost::shared_ptr<CSCGeometry>(cscgb.build(_cscGeometry, *rig, *rdp));
155  cscgb.build(cscGeometry, *rig, *rdp);
156  }
157 
158 }
void build(boost::shared_ptr< CSCGeometry > geom, const DDCompactView *fv, const MuonDDDConstants &muonConstants)
Build the geometry.
void get(HolderT &iHolder) const
void build(boost::shared_ptr< CSCGeometry > theGeometry, const RecoIdealGeometry &rig, const CSCRecoDigiParameters &cscpars)
Build the geometry.
boost::shared_ptr< CSCGeometry > cscGeometry
boost::shared_ptr< CSCGeometry > CSCGeometryESModule::produce ( const MuonGeometryRecord record)

Produce CSCGeometry.

Definition at line 87 of file CSCGeometryESModule.cc.

References alignmentsLabel_, applyAlignment_, GeometryAligner::applyAlignments(), cscGeometry, align::DetectorGlobalPosition(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), DetId::Muon, and myLabel_.

87  {
88 
89  // Called whenever the alignments or alignment errors change
90 
91  if ( applyAlignment_ ) {
92  // applyAlignment_ is scheduled for removal.
93  // Ideal geometry obtained by using 'fake alignment' (with applyAlignment_ = true)
94  edm::ESHandle<Alignments> globalPosition;
95  record.getRecord<GlobalPositionRcd>().get(alignmentsLabel_, globalPosition);
96  edm::ESHandle<Alignments> alignments;
97  record.getRecord<CSCAlignmentRcd>().get(alignmentsLabel_, alignments);
98  edm::ESHandle<AlignmentErrors> alignmentErrors;
99 // <<<<<<< CSCGeometryESModule.cc
100 // record.getRecord<CSCAlignmentErrorRcd>().get( alignmentErrors );
101 // GeometryAligner aligner;
102 // aligner.applyAlignments<CSCGeometry>( &(*_cscGeometry),
103 // &(*alignments), &(*alignmentErrors),
104 // align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Muon)));
105 // =======
106  record.getRecord<CSCAlignmentErrorRcd>().get(alignmentsLabel_, alignmentErrors);
107  // Only apply alignment if values exist
108  if (alignments->empty() && alignmentErrors->empty() && globalPosition->empty()) {
109  edm::LogInfo("Config") << "@SUB=CSCGeometryRecord::produce"
110  << "Alignment(Error)s and global position (label '"
111  << alignmentsLabel_ << "') empty: Geometry producer (label "
112  << "'" << myLabel_ << "') assumes fake and does not apply.";
113  } else {
114  GeometryAligner aligner;
115  aligner.applyAlignments<CSCGeometry>( &(*cscGeometry), &(*alignments), &(*alignmentErrors),
116  align::DetectorGlobalPosition(*globalPosition, DetId(DetId::Muon)) );
117  }
118 // >>>>>>> 1.8
119  }
120 
121  return cscGeometry;
122 }
const std::string alignmentsLabel_
Class to update a given geometry with a set of alignments.
const std::string myLabel_
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
Definition: DetId.h:20
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
boost::shared_ptr< CSCGeometry > cscGeometry

Member Data Documentation

const std::string CSCGeometryESModule::alignmentsLabel_
private

Definition at line 44 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::applyAlignment_
private

Definition at line 42 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

boost::shared_ptr<CSCGeometry> CSCGeometryESModule::cscGeometry
private

Definition at line 34 of file CSCGeometryESModule.h.

Referenced by geometryCallback_(), and produce().

bool CSCGeometryESModule::debugV
private

Definition at line 41 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().

const std::string CSCGeometryESModule::myLabel_
private

Definition at line 45 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and produce().

bool CSCGeometryESModule::useCentreTIOffsets
private

Definition at line 40 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().

bool CSCGeometryESModule::useDDD_
private

Definition at line 43 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().

bool CSCGeometryESModule::useGangedStripsInME1a
private

Definition at line 39 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().

bool CSCGeometryESModule::useOnlyWiresInME1a
private

Definition at line 38 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().

bool CSCGeometryESModule::useRealWireGeometry
private

Definition at line 37 of file CSCGeometryESModule.h.

Referenced by CSCGeometryESModule(), and geometryCallback_().