CMS 3D CMS Logo

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

Class to print out information on current geometry. More...

Inheritance diagram for CTPPSAlignmentInfo:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CTPPSAlignmentInfo (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void printInfo (const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
 

Private Attributes

edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecordalignmentToken_
 
std::string alignmentType_
 
edm::ESWatcher< RPMisalignedAlignmentRecordwatcherMisalignedAlignments_
 
edm::ESWatcher< RPRealAlignmentRecordwatcherRealAlignments_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Class to print out information on current geometry.

Definition at line 27 of file CTPPSAlignmentInfo.cc.

Constructor & Destructor Documentation

◆ CTPPSAlignmentInfo()

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

Definition at line 43 of file CTPPSAlignmentInfo.cc.

44  : alignmentType_(iConfig.getUntrackedParameter<std::string>("alignmentType", "real")),
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > alignmentToken_
T getUntrackedParameter(std::string const &, T const &) const

Member Function Documentation

◆ analyze()

void CTPPSAlignmentInfo::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 49 of file CTPPSAlignmentInfo.cc.

References alignmentToken_, alignmentType_, edm::ESWatcher< T >::check(), Exception, edm::EventSetup::getData(), iEvent, printInfo(), watcherMisalignedAlignments_, and watcherRealAlignments_.

49  {
50  if (alignmentType_ == "real") {
51  if (watcherRealAlignments_.check(iSetup)) {
52  auto const& alignments = iSetup.getData(alignmentToken_);
53  printInfo(alignments, iEvent);
54  }
55  return;
56  }
57 
58  else if (alignmentType_ == "misaligned") {
59  if (watcherMisalignedAlignments_.check(iSetup)) {
60  auto const& alignments = iSetup.getData(alignmentToken_);
61  printInfo(alignments, iEvent);
62  }
63  return;
64  }
65 
66  throw cms::Exception("CTPPSAlignmentInfo") << "Unknown geometry type: `" << alignmentType_ << "'.";
67 }
void printInfo(const CTPPSRPAlignmentCorrectionsData &alignments, const edm::Event &event) const
edm::ESWatcher< RPMisalignedAlignmentRecord > watcherMisalignedAlignments_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > alignmentToken_
int iEvent
Definition: GenABIO.cc:224
bool getData(T &iHolder) const
Definition: EventSetup.h:122
edm::ESWatcher< RPRealAlignmentRecord > watcherRealAlignments_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57

◆ printInfo()

void CTPPSAlignmentInfo::printInfo ( const CTPPSRPAlignmentCorrectionsData alignments,
const edm::Event event 
) const
private

Definition at line 71 of file CTPPSAlignmentInfo.cc.

References alignmentType_.

Referenced by analyze().

71  {
72  time_t unixTime = event.time().unixTime();
73  char timeStr[50];
74  strftime(timeStr, 50, "%F %T", localtime(&unixTime));
75 
76  edm::LogInfo("CTPPSAlignmentInfo") << "New " << alignmentType_ << " alignments found in run=" << event.id().run()
77  << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime << " ("
78  << timeStr << "):\n"
79  << alignments;
80 }
Log< level::Info, false > LogInfo

Member Data Documentation

◆ alignmentToken_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord> CTPPSAlignmentInfo::alignmentToken_
private

Definition at line 36 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

◆ alignmentType_

std::string CTPPSAlignmentInfo::alignmentType_
private

Definition at line 32 of file CTPPSAlignmentInfo.cc.

Referenced by analyze(), and printInfo().

◆ watcherMisalignedAlignments_

edm::ESWatcher<RPMisalignedAlignmentRecord> CTPPSAlignmentInfo::watcherMisalignedAlignments_
private

Definition at line 35 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().

◆ watcherRealAlignments_

edm::ESWatcher<RPRealAlignmentRecord> CTPPSAlignmentInfo::watcherRealAlignments_
private

Definition at line 34 of file CTPPSAlignmentInfo.cc.

Referenced by analyze().