CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
sistrip::SpyIdentifyRunsModule Class Reference
Inheritance diagram for sistrip::SpyIdentifyRunsModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SpyIdentifyRunsModule (const edm::ParameterSet &)
 
 ~SpyIdentifyRunsModule () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
void writeRunInFile (const unsigned int aRunNumber)
 

Private Attributes

std::string fileName_
 
std::ofstream outFile_
 
uint32_t prevRun_
 
edm::InputTag srcTag_
 
edm::EDGetTokenT< FEDRawDataCollectionsrcToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 37 of file SiStripSpyIdentifyRuns.cc.

Constructor & Destructor Documentation

◆ SpyIdentifyRunsModule()

sistrip::SpyIdentifyRunsModule::SpyIdentifyRunsModule ( const edm::ParameterSet iConfig)
explicit

Definition at line 69 of file SiStripSpyIdentifyRuns.cc.

70  : fileName_(iConfig.getParameter<std::string>("OutputTextFile")),
71  srcTag_(iConfig.getParameter<edm::InputTag>("InputProductLabel")),
72  prevRun_(0) {
73  srcToken_ = consumes<FEDRawDataCollection>(srcTag_);
74  }

References srcTag_, and srcToken_.

◆ ~SpyIdentifyRunsModule()

sistrip::SpyIdentifyRunsModule::~SpyIdentifyRunsModule ( )
override

Definition at line 76 of file SiStripSpyIdentifyRuns.cc.

76 {}

Member Function Documentation

◆ analyze()

void sistrip::SpyIdentifyRunsModule::analyze ( const edm::Event aEvt,
const edm::EventSetup aSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 90 of file SiStripSpyIdentifyRuns.cc.

90  {
91  //static bool lFirstEvent = true;
92  //if (!lFirstEvent) return;
93  uint32_t lRunNum = aEvt.id().run();
94  if (lRunNum == prevRun_)
95  return;
96 
98  aEvt.getByToken(srcToken_, lHandle);
99  const FEDRawDataCollection& buffers = *lHandle;
100 
101  for (unsigned int iFed(FEDNumbering::MINSiStripFEDID); iFed <= FEDNumbering::MAXSiStripFEDID; iFed++) {
102  //retrieve FED raw data for given FED
103  const FEDRawData& input = buffers.FEDData(static_cast<int>(iFed));
104  //check on FEDRawData pointer and size
105  if (!input.data() || !input.size())
106  continue;
107  //construct FEDBuffer
108  const auto st_buffer = preconstructCheckFEDSpyBuffer(input);
109  if (sistrip::FEDBufferStatusCode::SUCCESS != st_buffer) {
110  edm::LogWarning("SiStripSpyIdentifyRuns")
111  << "Exception caught when creating FEDSpyBuffer object for FED " << iFed << ": "
112  << "An exception of category 'FEDBuffer' occurred.\n"
113  << st_buffer;
115  break;
116  }
118  edm::LogWarning("SiStripSpyIdentifyRuns") << " -- this is a spy file, run " << lRunNum << std::endl;
119  writeRunInFile(lRunNum);
120  break;
121  }
122  //lFirstEvent = false;
123  prevRun_ = lRunNum;
124  }

References edmScanValgrind::buffer, sistrip::EXPECT_SPY, FEDRawDataCollection::FEDData(), edm::Event::getByToken(), edm::EventBase::id(), input, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, sistrip::preconstructCheckFEDSpyBuffer(), prevRun_, edm::EventID::run(), srcToken_, sistrip::SUCCESS, and writeRunInFile().

◆ beginJob()

void sistrip::SpyIdentifyRunsModule::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 78 of file SiStripSpyIdentifyRuns.cc.

78  {
79  outFile_.open(fileName_.c_str(), std::ios::out);
80  if (!outFile_.is_open()) {
81  edm::LogError("SiStripSpyIdentifyRuns")
82  << " -- Cannot open file : " << fileName_ << " for writting." << std::endl;
83  edm::LogInfo("SiStripSpyIdentifyRuns") << " *** SPY RUNS *** " << std::endl;
84 
85  } else {
86  outFile_ << " *** SPY RUNS *** " << std::endl;
87  }
88  }

References fileName_, MillePedeFileConverter_cfg::out, and outFile_.

◆ endJob()

void sistrip::SpyIdentifyRunsModule::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 134 of file SiStripSpyIdentifyRuns.cc.

134  {
135  //save global run number in text file in local directory
136  //output loginfo with number of errors
137  //or throw exception ?
138  if (outFile_.is_open())
139  outFile_.close();
140  }

References outFile_.

◆ writeRunInFile()

void sistrip::SpyIdentifyRunsModule::writeRunInFile ( const unsigned int  aRunNumber)
private

Definition at line 126 of file SiStripSpyIdentifyRuns.cc.

126  {
127  if (!outFile_.is_open()) {
128  edm::LogInfo("SiStripSpyIdentifyRuns") << aRunNumber << std::endl;
129  } else {
130  outFile_ << aRunNumber << std::endl;
131  }
132  }

References outFile_.

Referenced by analyze().

Member Data Documentation

◆ fileName_

std::string sistrip::SpyIdentifyRunsModule::fileName_
private

Definition at line 51 of file SiStripSpyIdentifyRuns.cc.

Referenced by beginJob().

◆ outFile_

std::ofstream sistrip::SpyIdentifyRunsModule::outFile_
private

Definition at line 52 of file SiStripSpyIdentifyRuns.cc.

Referenced by beginJob(), endJob(), and writeRunInFile().

◆ prevRun_

uint32_t sistrip::SpyIdentifyRunsModule::prevRun_
private

Definition at line 57 of file SiStripSpyIdentifyRuns.cc.

Referenced by analyze().

◆ srcTag_

edm::InputTag sistrip::SpyIdentifyRunsModule::srcTag_
private

Definition at line 55 of file SiStripSpyIdentifyRuns.cc.

Referenced by SpyIdentifyRunsModule().

◆ srcToken_

edm::EDGetTokenT<FEDRawDataCollection> sistrip::SpyIdentifyRunsModule::srcToken_
private

Definition at line 56 of file SiStripSpyIdentifyRuns.cc.

Referenced by analyze(), and SpyIdentifyRunsModule().

sistrip::preconstructCheckFEDSpyBuffer
FEDBufferStatusCode preconstructCheckFEDSpyBuffer(const FEDRawData &fedBuffer)
Definition: SiStripFEDSpyBuffer.h:108
input
static const std::string input
Definition: EdmProvDump.cc:48
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
FEDRawData
Definition: FEDRawData.h:19
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
sistrip::SpyIdentifyRunsModule::srcTag_
edm::InputTag srcTag_
Definition: SiStripSpyIdentifyRuns.cc:55
sistrip::SpyIdentifyRunsModule::writeRunInFile
void writeRunInFile(const unsigned int aRunNumber)
Definition: SiStripSpyIdentifyRuns.cc:126
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
sistrip::SpyIdentifyRunsModule::fileName_
std::string fileName_
Definition: SiStripSpyIdentifyRuns.cc:51
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FEDNumbering::MAXSiStripFEDID
Definition: FEDNumbering.h:30
sistrip::FEDBufferStatusCode::SUCCESS
sistrip::SpyIdentifyRunsModule::outFile_
std::ofstream outFile_
Definition: SiStripSpyIdentifyRuns.cc:52
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
sistrip::FEDBufferStatusCode::EXPECT_SPY
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
sistrip::FEDSpyBuffer
Definition: SiStripFEDSpyBuffer.h:33
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
sistrip::SpyIdentifyRunsModule::srcToken_
edm::EDGetTokenT< FEDRawDataCollection > srcToken_
Definition: SiStripSpyIdentifyRuns.cc:56
sistrip::SpyIdentifyRunsModule::prevRun_
uint32_t prevRun_
Definition: SiStripSpyIdentifyRuns.cc:57
edm::InputTag
Definition: InputTag.h:15
FEDNumbering::MINSiStripFEDID
Definition: FEDNumbering.h:29