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
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 &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::ESWatcher< CTPPSRPAlignmentCorrectionsDataRcdwatcherAlignments_
 

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)
 
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<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)
 

Detailed Description

Class to print out information on current geometry.

Definition at line 35 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 59 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References edm::ParameterSet::getParameter(), iov_, and record_.

60  {
61  record_=iConfig.getParameter<string>("record");
62  iov_=iConfig.getParameter<unsigned long long>("iov");
63 }
CTPPSRPAlignmentInfoAnalyzer::~CTPPSRPAlignmentInfoAnalyzer ( )
inlineoverride

Definition at line 39 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References analyze(), MillePedeFileConverter_cfg::e, and printInfo().

39 {}

Member Function Documentation

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

Definition at line 67 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References edm::ESWatcher< T >::check(), edm::EventSetup::get(), iov_, edm::Service< T >::isAvailable(), edm::ESHandle< T >::product(), record_, watcherAlignments_, and cond::service::PoolDBOutputService::writeOne().

Referenced by ~CTPPSRPAlignmentInfoAnalyzer().

68 {
69 
71  if ( watcherAlignments_.check( iSetup ) )
72  {
73  if(strcmp(record_.c_str(),"CTPPSRPAlignmentCorrectionsDataRcd")==0){
74  iSetup.get<CTPPSRPAlignmentCorrectionsDataRcd>().get(alignments);
75  }
76  else if(strcmp(record_.c_str(),"RPRealAlignmentRecord")==0){
77  iSetup.get<RPRealAlignmentRecord>().get(alignments);
78  }
79  else {
80  iSetup.get<RPMisalignedAlignmentRecord>().get(alignments);
81  }
82  const CTPPSRPAlignmentCorrectionsData* pCTPPSRPAlignmentCorrectionsData = alignments.product();
84  if( poolDbService.isAvailable() ){
85  poolDbService->writeOne( pCTPPSRPAlignmentCorrectionsData, iov_, record_ );
86  }
87 
88  }
89  return;
90 
91 }
bool isAvailable() const
Definition: Service.h:40
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
Container for CTPPS RP alignment corrections. The corrections are stored on two levels - RP and senso...
edm::ESWatcher< CTPPSRPAlignmentCorrectionsDataRcd > watcherAlignments_
T const * product() const
Definition: ESHandle.h:86
void CTPPSRPAlignmentInfoAnalyzer::printInfo ( const CTPPSRPAlignmentCorrectionsData alignments,
const edm::Event event 
) const
private

Definition at line 95 of file CTPPSRPAlignmentInfoAnalyzer.cc.

References DEFINE_FWK_MODULE.

Referenced by ~CTPPSRPAlignmentInfoAnalyzer().

96 {
97  time_t unixTime = event.time().unixTime();
98  char timeStr[50];
99  strftime( timeStr, 50, "%F %T", localtime( &unixTime ) );
100 
101  edm::LogInfo("CTPPSRPAlignmentInfoAnalyzer")
102  << "New alignments found in run="
103  << event.id().run() << ", event=" << event.id().event() << ", UNIX timestamp=" << unixTime
104  << " (" << timeStr << "):\n"
105  << alignments;
106 }

Member Data Documentation

cond::Time_t CTPPSRPAlignmentInfoAnalyzer::iov_
private

Definition at line 47 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().

std::string CTPPSRPAlignmentInfoAnalyzer::record_
private

Definition at line 48 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze(), and CTPPSRPAlignmentInfoAnalyzer().

edm::ESWatcher<CTPPSRPAlignmentCorrectionsDataRcd> CTPPSRPAlignmentInfoAnalyzer::watcherAlignments_
private

Definition at line 45 of file CTPPSRPAlignmentInfoAnalyzer.cc.

Referenced by analyze().