CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelPopConCalibChecker Class Reference
Inheritance diagram for PixelPopConCalibChecker:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 PixelPopConCalibChecker (const edm::ParameterSet &)
 
 ~PixelPopConCalibChecker () 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 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
 
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 Attributes

const std::string _filename
 
const int _messageLevel
 
const edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcdgainCalibToken_
 

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

Description: Test analyzer for checking calib configuration objects written to db

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

Definition at line 38 of file PixelPopConCalibChecker.cc.

Constructor & Destructor Documentation

◆ PixelPopConCalibChecker()

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

Definition at line 56 of file PixelPopConCalibChecker.cc.

References _messageLevel.

58  _filename(iConfig.getParameter<string>("filename")),
59  _messageLevel(iConfig.getUntrackedParameter("messageLevel", 0)) {
60  if (_messageLevel > 0)
61  edm::LogPrint("PixelPopConCalibChecker") << "********* PixelPopConCalibChecker ************" << endl;
62 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Warning, true > LogPrint
const edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > gainCalibToken_

◆ ~PixelPopConCalibChecker()

PixelPopConCalibChecker::~PixelPopConCalibChecker ( )
overridedefault

Member Function Documentation

◆ analyze()

void PixelPopConCalibChecker::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 71 of file PixelPopConCalibChecker.cc.

References _filename, _messageLevel, gainCalibToken_, SiPixelCalibConfiguration::getCalibrationMode(), SiPixelCalibConfiguration::getColumnPattern(), edm::EventSetup::getData(), SiPixelCalibConfiguration::getNTriggers(), SiPixelCalibConfiguration::getRowPattern(), SiPixelCalibConfiguration::getVCalValues(), iEvent, and edm::EventID::run().

71  {
72  using namespace edm;
73 
74  bool isSame = true;
75 
76  // get the run and event number from the EmptyIOVSource
77  if (_messageLevel > 0) {
78  EventID eventID = iEvent.id();
79  edm::LogPrint("PixelPopConCalibChecker") << "Comparing SiPixelCalibConfiguration object from database for run "
80  << eventID.run() << " to calib.dat file at " << _filename << endl;
81  } // if (_messageLevel > 0)
82 
83  // get the calib config object in the database from the event setup
84  const SiPixelCalibConfiguration* calibES = &iSetup.getData(gainCalibToken_);
85 
86  // get the calib config object from the calib.dat file
88  SiPixelCalibConfiguration* calibFile = new SiPixelCalibConfiguration(fancyCalib);
89 
90  // check if mode matches
91  string modeES = calibES->getCalibrationMode();
92  string modeFile = calibFile->getCalibrationMode();
93  if (_messageLevel > 1) {
94  edm::LogPrint("PixelPopConCalibChecker") << "*** Checking calibration mode ***" << endl;
95  edm::LogPrint("PixelPopConCalibChecker") << " mode from DB: " << modeES << endl;
96  edm::LogPrint("PixelPopConCalibChecker") << " mode from file: " << modeFile << endl;
97  }
98  if (modeES != modeFile) {
99  isSame = false;
100  if (_messageLevel > 0) {
101  edm::LogPrint("PixelPopConCalibChecker") << "Mismatch in calibration mode!" << endl;
102  edm::LogPrint("PixelPopConCalibChecker") << " " << modeES << " in database, " << modeFile << " in file" << endl;
103  }
104  }
105 
106  // check if the number of triggers matches
107  short ntriggerES = calibES->getNTriggers();
108  short ntriggerFile = calibFile->getNTriggers();
109  if (_messageLevel > 1) {
110  edm::LogPrint("PixelPopConCalibChecker") << "*** Checking number of triggers ***" << endl;
111  edm::LogPrint("PixelPopConCalibChecker") << " NTriggers from DB: " << ntriggerES << endl;
112  edm::LogPrint("PixelPopConCalibChecker") << " NTriggers from file: " << ntriggerFile << endl;
113  }
114  if (ntriggerES != ntriggerFile) {
115  isSame = false;
116  if (_messageLevel > 0) {
117  edm::LogPrint("PixelPopConCalibChecker") << "Mismatch in number of triggers!" << endl;
118  edm::LogPrint("PixelPopConCalibChecker")
119  << " " << ntriggerES << " in database, " << ntriggerFile << " in file" << endl;
120  }
121  }
122 
123  // check if vcal values match
124  vector<short> vcalES = calibES->getVCalValues();
125  vector<short> vcalFile = calibFile->getVCalValues();
126  if (_messageLevel > 1) {
127  edm::LogPrint("PixelPopConCalibChecker") << "*** Checking vcal values ***" << endl;
128  edm::LogPrint("PixelPopConCalibChecker") << " vcal values from DB: ";
129  for (vector<short>::const_iterator it = vcalES.begin(); it != vcalES.end(); ++it)
130  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
131  edm::LogPrint("PixelPopConCalibChecker") << endl;
132  edm::LogPrint("PixelPopConCalibChecker") << " vcal values from file: ";
133  for (vector<short>::const_iterator it = vcalFile.begin(); it != vcalFile.end(); ++it)
134  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
135  edm::LogPrint("PixelPopConCalibChecker") << endl;
136  }
137  if (vcalES != vcalFile) {
138  isSame = false;
139  if (_messageLevel > 0) {
140  edm::LogPrint("PixelPopConCalibChecker") << "Mismatch in vcal values!" << endl;
141  }
142  }
143 
144  // check if column values match
145  vector<short> colES = calibES->getColumnPattern();
146  vector<short> colFile = calibFile->getColumnPattern();
147  if (_messageLevel > 1) {
148  edm::LogPrint("PixelPopConCalibChecker") << "*** Checking column pattern values ***" << endl;
149  edm::LogPrint("PixelPopConCalibChecker") << " column pattern from DB: ";
150  for (vector<short>::const_iterator it = colES.begin(); it != colES.end(); ++it)
151  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
152  edm::LogPrint("PixelPopConCalibChecker") << endl;
153  edm::LogPrint("PixelPopConCalibChecker") << " column pattern from file: ";
154  for (vector<short>::const_iterator it = colFile.begin(); it != colFile.end(); ++it)
155  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
156  edm::LogPrint("PixelPopConCalibChecker") << endl;
157  }
158  if (colES != colFile) {
159  isSame = false;
160  if (_messageLevel > 0) {
161  edm::LogPrint("PixelPopConCalibChecker") << "Mismatch in column pattern!" << endl;
162  }
163  }
164 
165  // check if row values match
166  vector<short> rowES = calibES->getRowPattern();
167  vector<short> rowFile = calibFile->getRowPattern();
168  if (_messageLevel > 1) {
169  edm::LogPrint("PixelPopConCalibChecker") << "*** Checking row pattern values ***" << endl;
170  edm::LogPrint("PixelPopConCalibChecker") << " row pattern from DB: ";
171  for (vector<short>::const_iterator it = rowES.begin(); it != rowES.end(); ++it)
172  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
173  edm::LogPrint("PixelPopConCalibChecker") << endl;
174  edm::LogPrint("PixelPopConCalibChecker") << " row pattern from file: ";
175  for (vector<short>::const_iterator it = rowFile.begin(); it != rowFile.end(); ++it)
176  edm::LogPrint("PixelPopConCalibChecker") << *it << ", ";
177  edm::LogPrint("PixelPopConCalibChecker") << endl;
178  }
179  if (rowES != rowFile) {
180  isSame = false;
181  if (_messageLevel > 0) {
182  edm::LogPrint("PixelPopConCalibChecker") << "Mismatch in row pattern!" << endl;
183  }
184  }
185 
186  edm::LogPrint("PixelPopConCalibChecker") << endl;
187  if (isSame) {
188  edm::LogPrint("PixelPopConCalibChecker")
189  << "*** Calibration configuration in database and file match. Go forth and calibrate." << endl;
190  } else {
191  edm::LogPrint("PixelPopConCalibChecker")
192  << "*** WARNING! Calibration configuration is database and file DO NOT match!" << endl;
193  }
194 
195 } // PixelPopConCalibChecker::analyze()
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::vector< short > getColumnPattern() const
std::vector< short > getRowPattern() const
int iEvent
Definition: GenABIO.cc:224
const std::vector< short > getVCalValues() const
This class implements the steps that are used in a scan over Threshold and CalDelay.
Log< level::Warning, true > LogPrint
RunNumber_t run() const
Definition: EventID.h:38
HLT enums.
std::string getCalibrationMode() const
const edm::ESGetToken< SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd > gainCalibToken_

Member Data Documentation

◆ _filename

const std::string PixelPopConCalibChecker::_filename
private

Definition at line 47 of file PixelPopConCalibChecker.cc.

Referenced by analyze().

◆ _messageLevel

const int PixelPopConCalibChecker::_messageLevel
private

Definition at line 48 of file PixelPopConCalibChecker.cc.

Referenced by analyze(), and PixelPopConCalibChecker().

◆ gainCalibToken_

const edm::ESGetToken<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd> PixelPopConCalibChecker::gainCalibToken_
private

Definition at line 46 of file PixelPopConCalibChecker.cc.

Referenced by analyze().