CMS 3D CMS Logo

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

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

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

Public Member Functions

 CTPPSRPAlignmentInfoAnalyzer (const edm::ParameterSet &ps)
 
 ~CTPPSRPAlignmentInfoAnalyzer () override
 
- 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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

cond::Time_t iov_
 
std::string record_
 
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcdtokenAlignmentIdeal_
 
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecordtokenAlignmentMisaligned_
 
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecordtokenAlignmentReal_
 

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 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 35 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Constructor & Destructor Documentation

◆ CTPPSRPAlignmentInfoAnalyzer()

CTPPSRPAlignmentInfoAnalyzer::CTPPSRPAlignmentInfoAnalyzer ( const edm::ParameterSet ps)

Definition at line 61 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References record_, tokenAlignmentIdeal_, tokenAlignmentMisaligned_, and tokenAlignmentReal_.

62  : record_(iConfig.getParameter<string>("record")), iov_(iConfig.getParameter<unsigned long long>("iov")) {
63  if (strcmp(record_.c_str(), "CTPPSRPAlignmentCorrectionsDataRcd") == 0) {
64  tokenAlignmentIdeal_ = esConsumes<CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd>();
65  } else if (strcmp(record_.c_str(), "RPRealAlignmentRecord") == 0) {
66  tokenAlignmentReal_ = esConsumes<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord>();
67  } else {
68  tokenAlignmentMisaligned_ = esConsumes<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord>();
69  }
70 }
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > tokenAlignmentReal_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd > tokenAlignmentIdeal_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord > tokenAlignmentMisaligned_

◆ ~CTPPSRPAlignmentInfoAnalyzer()

CTPPSRPAlignmentInfoAnalyzer::~CTPPSRPAlignmentInfoAnalyzer ( )
inlineoverride

Definition at line 38 of file CTPPSRPAlignmentInfoAnalyzer.cc.

38 {}

Member Function Documentation

◆ analyze()

void CTPPSRPAlignmentInfoAnalyzer::analyze ( const edm::Event e,
const edm::EventSetup es 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 74 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References PixelBaryCentreAnalyzer_cfg::alignments, iov_, edm::Service< T >::isAvailable(), alignCSCRings::r, record_, tokenAlignmentIdeal_, tokenAlignmentMisaligned_, tokenAlignmentReal_, and cond::service::PoolDBOutputService::writeOneIOV().

74  {
75  const auto alignments = [&r = record_,
76  &eS = iSetup,
77  &tAI = tokenAlignmentIdeal_,
78  &tAR = tokenAlignmentReal_,
80  if (r == "CTPPSRPAlignmentCorrectionsDataRcd") {
81  return eS.getData(tAI);
82  } else if (r == "RPRealAlignmentRecord") {
83  return eS.getData(tAR);
84  } else {
85  return eS.getData(tAM);
86  }
87  }();
88 
90  if (!poolDbService.isAvailable()) {
91  edm::LogError("CTPPSAlignmentInfoAnalyzer") << " DbService not available ";
92  } else {
93  poolDbService->writeOneIOV(alignments, iov_, record_);
94  }
95 }
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord > tokenAlignmentReal_
Log< level::Error, false > LogError
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd > tokenAlignmentIdeal_
edm::ESGetToken< CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord > tokenAlignmentMisaligned_
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
bool isAvailable() const
Definition: Service.h:40

◆ printInfo()

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

Definition at line 99 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References PixelBaryCentreAnalyzer_cfg::alignments.

100  {
101  time_t unixTime = event.time().unixTime();
102  char timeStr[50];
103  strftime(timeStr, 50, "%F %T", localtime(&unixTime));
104 
105  edm::LogInfo("CTPPSRPAlignmentInfoAnalyzer")
106  << "New alignments found in run=" << event.id().run() << ", event=" << event.id().event()
107  << ", UNIX timestamp=" << unixTime << " (" << timeStr << "):\n"
108  << alignments;
109 }
Log< level::Info, false > LogInfo

Member Data Documentation

◆ iov_

cond::Time_t CTPPSRPAlignmentInfoAnalyzer::iov_
private

Definition at line 50 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze().

◆ record_

std::string CTPPSRPAlignmentInfoAnalyzer::record_
private

Definition at line 49 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().

◆ tokenAlignmentIdeal_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, CTPPSRPAlignmentCorrectionsDataRcd> CTPPSRPAlignmentInfoAnalyzer::tokenAlignmentIdeal_
private

Definition at line 45 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().

◆ tokenAlignmentMisaligned_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPMisalignedAlignmentRecord> CTPPSRPAlignmentInfoAnalyzer::tokenAlignmentMisaligned_
private

Definition at line 47 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().

◆ tokenAlignmentReal_

edm::ESGetToken<CTPPSRPAlignmentCorrectionsData, RPRealAlignmentRecord> CTPPSRPAlignmentInfoAnalyzer::tokenAlignmentReal_
private

Definition at line 46 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().