CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SiStripLorentzAngleRunInfoTableProducer Class Reference
Inheritance diagram for SiStripLorentzAngleRunInfoTableProducer:
edm::global::EDProducer< edm::BeginRunProducer > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void globalBeginRunProduce (edm::Run &iRun, edm::EventSetup const &iSetup) const override
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const override
 
 SiStripLorentzAngleRunInfoTableProducer (const edm::ParameterSet &params)
 
- Public Member Functions inherited from edm::global::EDProducer< edm::BeginRunProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const std::string m_doc
 
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcdm_lorentzAngleToken
 
const std::string m_magFieldName
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordm_magFieldToken
 
const std::string m_name
 
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordm_tkGeomToken
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 19 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Constructor & Destructor Documentation

◆ SiStripLorentzAngleRunInfoTableProducer()

SiStripLorentzAngleRunInfoTableProducer::SiStripLorentzAngleRunInfoTableProducer ( const edm::ParameterSet params)
inlineexplicit

Definition at line 21 of file SiStripLorentzAngleRunInfoTableProducer.cc.

References submitPVValidationJobs::params, and AlCaHLTBitMon_QueryRunRegistry::string.

22  : m_name{params.getParameter<std::string>("name")},
23  m_magFieldName{params.getParameter<std::string>("magFieldName")},
24  m_doc{params.existsAs<std::string>("doc") ? params.getParameter<std::string>("doc") : ""},
25  m_tkGeomToken{esConsumes<edm::Transition::BeginRun>()},
26  m_magFieldToken{esConsumes<edm::Transition::BeginRun>()},
27  m_lorentzAngleToken{esConsumes<edm::Transition::BeginRun>()} {
28  produces<nanoaod::FlatTable, edm::Transition::BeginRun>();
29  produces<nanoaod::FlatTable, edm::Transition::BeginRun>("magField");
30  }
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > m_lorentzAngleToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magFieldToken

Member Function Documentation

◆ fillDescriptions()

static void SiStripLorentzAngleRunInfoTableProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 34 of file SiStripLorentzAngleRunInfoTableProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

34  {
36  desc.add<std::string>("name", "Det");
37  desc.add<std::string>("magFieldName", "magField");
38  desc.add<std::string>("doc", "Run info for the Lorentz angle measurement");
39  descriptions.add("siStripLorentzAngleRunInfoTable", desc);
40  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ globalBeginRunProduce()

void SiStripLorentzAngleRunInfoTableProducer::globalBeginRunProduce ( edm::Run iRun,
edm::EventSetup const &  iSetup 
) const
override

Definition at line 60 of file SiStripLorentzAngleRunInfoTableProducer.cc.

References shallow::drift(), edm::EventSetup::getData(), m_lorentzAngleToken, m_magFieldName, m_magFieldToken, m_name, m_tkGeomToken, eostools::move(), MillePedeFileConverter_cfg::out, PointingDoubleMultiSkim_cfg::out2, GloballyPositioned< T >::position(), edm::Run::put(), GeomDet::surface(), GeomDet::toGlobal(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

61  {
62  const auto& tkGeom = iSetup.getData(m_tkGeomToken);
63  const auto& magField = iSetup.getData(m_magFieldToken);
64  const auto& lorentzAngle = iSetup.getData(m_lorentzAngleToken);
65  std::vector<uint32_t> c_rawid;
66  std::vector<float> c_globalZofunitlocalY, c_localB, c_BdotY, c_driftx, c_drifty, c_driftz, c_lorentzAngle;
67 
68  auto dets = tkGeom.detsTIB();
69  dets.insert(dets.end(), tkGeom.detsTID().begin(), tkGeom.detsTID().end());
70  dets.insert(dets.end(), tkGeom.detsTOB().begin(), tkGeom.detsTOB().end());
71  dets.insert(dets.end(), tkGeom.detsTEC().begin(), tkGeom.detsTEC().end());
72  for (auto det : dets) {
73  auto detid = det->geographicalId().rawId();
74  const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(tkGeom.idToDet(det->geographicalId()));
75  if (stripDet) {
76  c_rawid.push_back(detid);
77  c_globalZofunitlocalY.push_back(stripDet->toGlobal(LocalVector(0, 1, 0)).z());
78  const auto locB = magField.inTesla(stripDet->surface().position());
79  c_localB.push_back(locB.mag());
80  c_BdotY.push_back(stripDet->surface().toLocal(locB).y());
81  const auto drift = shallow::drift(stripDet, magField, lorentzAngle);
82  c_driftx.push_back(drift.x());
83  c_drifty.push_back(drift.y());
84  c_driftz.push_back(drift.z());
85  c_lorentzAngle.push_back(lorentzAngle.getLorentzAngle(detid));
86  }
87  }
88  auto out = std::make_unique<nanoaod::FlatTable>(c_rawid.size(), m_name, false, false);
89  addColumn(out.get(), "rawid", c_rawid, "DetId");
90  addColumn(out.get(), "globalZofunitlocalY", c_globalZofunitlocalY, "z component of a local unit vector along y");
91  addColumn(out.get(), "localB", c_localB, "Local magnitude of the magnetic field");
92  addColumn(out.get(), "BdotY", c_BdotY, "Magnetic field projection on the local y axis");
93  addColumn(out.get(), "driftx", c_driftx, "x component of the drift vector");
94  addColumn(out.get(), "drifty", c_drifty, "y component of the drift vector");
95  addColumn(out.get(), "driftz", c_driftz, "z component of the drift vector");
96  addColumn(out.get(), "lorentzAngle", c_lorentzAngle, "Lorentz angle from database");
97  iRun.put(std::move(out));
98 
99  auto out2 = std::make_unique<nanoaod::FlatTable>(1, m_magFieldName, true, false);
100  out2->addColumnValue<float>(
101  "origin", magField.inTesla(GlobalPoint(0, 0, 0)).z(), "z-component of the magnetic field at (0,0,0) in Tesla");
102  iRun.put(std::move(out2), "magField");
103 }
T z() const
Definition: PV3DBase.h:61
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken
LocalPoint toLocal(const GlobalPoint &gp) const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() const
void put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Run.h:109
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > m_lorentzAngleToken
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magFieldToken
def move(src, dest)
Definition: eostools.py:511

◆ produce()

void SiStripLorentzAngleRunInfoTableProducer::produce ( edm::StreamID  ,
edm::Event ,
edm::EventSetup const &   
) const
inlineoverridevirtual

Implements edm::global::EDProducerBase.

Definition at line 32 of file SiStripLorentzAngleRunInfoTableProducer.cc.

32 {}

Member Data Documentation

◆ m_doc

const std::string SiStripLorentzAngleRunInfoTableProducer::m_doc
private

Definition at line 46 of file SiStripLorentzAngleRunInfoTableProducer.cc.

◆ m_lorentzAngleToken

edm::ESGetToken<SiStripLorentzAngle, SiStripLorentzAngleDepRcd> SiStripLorentzAngleRunInfoTableProducer::m_lorentzAngleToken
private

Definition at line 49 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Referenced by globalBeginRunProduce().

◆ m_magFieldName

const std::string SiStripLorentzAngleRunInfoTableProducer::m_magFieldName
private

Definition at line 45 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Referenced by globalBeginRunProduce().

◆ m_magFieldToken

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SiStripLorentzAngleRunInfoTableProducer::m_magFieldToken
private

Definition at line 48 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Referenced by globalBeginRunProduce().

◆ m_name

const std::string SiStripLorentzAngleRunInfoTableProducer::m_name
private

Definition at line 45 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Referenced by globalBeginRunProduce().

◆ m_tkGeomToken

edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiStripLorentzAngleRunInfoTableProducer::m_tkGeomToken
private

Definition at line 47 of file SiStripLorentzAngleRunInfoTableProducer.cc.

Referenced by globalBeginRunProduce().