CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonGeometrySVGTemplate Class Reference

#include <Alignment/MuonAlignment/plugins/MuonGeometrySVGTemplate.cc>

Inheritance diagram for MuonGeometrySVGTemplate:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 MuonGeometrySVGTemplate (const edm::ParameterSet &iConfig)
 
 ~MuonGeometrySVGTemplate () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &iConfig) override
 

Private Attributes

std::string m_wheelTemplateName
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 46 of file MuonGeometrySVGTemplate.cc.

Constructor & Destructor Documentation

◆ MuonGeometrySVGTemplate()

MuonGeometrySVGTemplate::MuonGeometrySVGTemplate ( const edm::ParameterSet iConfig)
explicit

Definition at line 73 of file MuonGeometrySVGTemplate.cc.

74  : m_wheelTemplateName(iConfig.getParameter<std::string>("wheelTemplateName")) {}

◆ ~MuonGeometrySVGTemplate()

MuonGeometrySVGTemplate::~MuonGeometrySVGTemplate ( )
override

Definition at line 76 of file MuonGeometrySVGTemplate.cc.

76 {}

Member Function Documentation

◆ analyze()

void MuonGeometrySVGTemplate::analyze ( const edm::Event iEvent,
const edm::EventSetup iConfig 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 79 of file MuonGeometrySVGTemplate.cc.

79  {
80  // loads ideal geometry
81  MuonAlignmentInputMethod inputMethod;
82  MuonAlignment muonAlignment(iSetup, inputMethod);
83  AlignableNavigator *alignableNavigator = muonAlignment.getAlignableNavigator();
84 
85  edm::FileInPath fip_BEGINNING("Alignment/MuonAlignment/data/wheel_template.svg_BEGINNING");
86  std::ifstream in_BEGINNING(fip_BEGINNING.fullPath().c_str());
87  edm::FileInPath fip_END("Alignment/MuonAlignment/data/wheel_template.svg_END");
88  std::ifstream in_END(fip_END.fullPath().c_str());
89 
90  const double height = 45.; // assume all chambers are 45 cm tall (local z)
91  std::ofstream out(m_wheelTemplateName.c_str());
92 
93  while (in_BEGINNING.good()) {
94  char c = (char)in_BEGINNING.get();
95  if (in_BEGINNING.good())
96  out << c;
97  }
98 
99  for (int station = 1; station <= 4; station++) {
100  int numSectors = 12;
101  if (station == 4)
102  numSectors = 14;
103  for (int sector = 1; sector <= numSectors; sector++) {
104  DTChamberId id(-2, station, sector); // wheel -2 has a +1 signConvention for x
105  Alignable *chamber = &*(alignableNavigator->alignableFromDetId(id));
106 
107  // different stations, sectors have different widths (*very* fortunate that Alignment software provides this)
108  double width = chamber->surface().width();
109 
110  // lower-left corner of chamber in the chamber's coordinates
111  double x = -width / 2.;
112  double y = -height / 2.;
113 
114  // phi position of chamber
115  align::GlobalVector direction = chamber->surface().toGlobal(LocalVector(1., 0., 0.));
116  double phi = atan2(direction.y(), direction.x());
117 
118  // we'll apply a translation to put the chamber in its place
119  double tx = chamber->surface().position().x();
120  double ty = chamber->surface().position().y();
121 
122  out << " <rect id=\"MB_" << station << "_" << sector << "\" x=\"" << x << "\" y=\"" << y << "\" width=\""
123  << width << "\" height=\"" << height << "\" transform=\"translate(" << tx << ", " << ty << ") rotate("
124  << phi * 180. / M_PI
125  << ")\" style=\"fill:#e1e1e1;fill-opacity:1;stroke:#000000;stroke-width:5.0;stroke-dasharray:1, "
126  "1;stroke-dashoffset:0\" />"
127  << std::endl;
128  }
129  }
130 
131  while (in_END.good()) {
132  char c = (char)in_END.get();
133  if (in_END.good())
134  out << c;
135  }
136 }

References AlignableNavigator::alignableFromDetId(), HltBtagPostValidation_cff::c, relativeConstraints::chamber, edm::FileInPath::fullPath(), triggerObjects_cff::id, M_PI, m_wheelTemplateName, CSCOverlapsAlignmentAlgorithm_cff::muonAlignment, MillePedeFileConverter_cfg::out, phi, relativeConstraints::station, ApeEstimator_cff::width, x, PV3DBase< T, PVType, FrameType >::x(), y, and PV3DBase< T, PVType, FrameType >::y().

Member Data Documentation

◆ m_wheelTemplateName

std::string MuonGeometrySVGTemplate::m_wheelTemplateName
private

Definition at line 54 of file MuonGeometrySVGTemplate.cc.

Referenced by analyze().

Vector3DBase< Scalar, GlobalTag >
DDAxes::y
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
relativeConstraints.station
station
Definition: relativeConstraints.py:67
Alignable
Definition: Alignable.h:27
DDAxes::x
MuonAlignment
Definition: MuonAlignment.h:20
edm::FileInPath
Definition: FileInPath.h:64
AlignableNavigator
Definition: AlignableNavigator.h:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuonGeometrySVGTemplate::m_wheelTemplateName
std::string m_wheelTemplateName
Definition: MuonGeometrySVGTemplate.cc:54
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
LocalVector
Local3DVector LocalVector
Definition: LocalVector.h:12
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DDAxes::phi
AlignableNavigator::alignableFromDetId
AlignableDetOrUnitPtr alignableFromDetId(const DetId &detid)
Returns AlignableDetOrUnitPtr corresponding to given DetId.
Definition: AlignableNavigator.cc:91
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
DTChamberId
Definition: DTChamberId.h:14
CSCOverlapsAlignmentAlgorithm_cff.muonAlignment
muonAlignment
Definition: CSCOverlapsAlignmentAlgorithm_cff.py:33
MuonAlignmentInputMethod
Definition: MuonAlignmentInputMethod.h:34