CMS 3D CMS Logo

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

#include <HcalTBSource.h>

Inheritance diagram for HcalTBSource:
edm::ProducerSourceFromFiles edm::ProducerSourceBase edm::FromFiles edm::IDGeneratorSourceBase< PuttableSourceBase > edm::PuttableSourceBase edm::InputSource edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 HcalTBSource (const edm::ParameterSet &pset, edm::InputSourceDescription const &desc)
 
 ~HcalTBSource () override
 
- Public Member Functions inherited from edm::ProducerSourceFromFiles
InputFileCatalogcatalog ()
 
std::vector< std::string > fileNames (unsigned iCatalog) const
 
std::vector< std::string > const & logicalFileNames () const
 
 ProducerSourceFromFiles (ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
 
 ~ProducerSourceFromFiles () override
 
- Public Member Functions inherited from edm::ProducerSourceBase
 ProducerSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
 
 ~ProducerSourceBase () noexcept(false) override
 
- Public Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase >
EventNumber_t event () const
 
unsigned int eventCreationDelay () const
 
EventID const & eventID () const
 
 IDGeneratorSourceBase (ParameterSet const &pset, InputSourceDescription const &desc, bool realData)
 
LuminosityBlockNumber_t luminosityBlock () const
 
unsigned int numberEventsInLumi () const
 
unsigned int numberEventsInRun () const
 
unsigned int numberEventsInThisLumi () const
 
unsigned int numberEventsInThisRun () const
 
TimeValue_t presentTime () const
 
RunNumber_t run () const
 
unsigned int timeBetweenEvents () const
 
 ~IDGeneratorSourceBase () noexcept(false) override
 
- Public Member Functions inherited from edm::PuttableSourceBase
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
PuttableSourceBaseoperator= (const PuttableSourceBase &)=delete
 
 PuttableSourceBase (ParameterSet const &, InputSourceDescription const &)
 
 PuttableSourceBase (const PuttableSourceBase &)=delete
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
void registerProducts () final
 Register any produced products. More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
- Public Member Functions inherited from edm::InputSource
std::shared_ptr< ActivityRegistryactReg () const
 Accessor for Activity Registry. More...
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 Accessors for branchIDListHelper. More...
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
void closeFile (FileBlock *, bool cleaningUpAfterException)
 close current file More...
 
void doBeginJob ()
 Called by framework at beginning of job. More...
 
void doEndJob ()
 Called by framework at end of job. More...
 
void fillProcessBlockHelper ()
 Fill the ProcessBlockHelper with info for the current file. More...
 
ProcessingController::ForwardState forwardState () const
 
bool goToEvent (EventID const &eventID)
 
 InputSource (ParameterSet const &, InputSourceDescription const &)
 Constructor. More...
 
 InputSource (InputSource const &)=delete
 
void issueReports (EventID const &eventID, StreamID streamID)
 issue an event report More...
 
LuminosityBlockNumber_t luminosityBlock () const
 Accessor for current luminosity block number. More...
 
std::shared_ptr< LuminosityBlockAuxiliaryluminosityBlockAuxiliary () const
 Called by the framework to merge or insert lumi in principal cache. More...
 
int maxEvents () const
 
int maxLuminosityBlocks () const
 
ModuleDescription const & moduleDescription () const
 Accessor for 'module' description. More...
 
ItemTypeInfo nextItemType ()
 Advances the source to the next item. More...
 
bool nextProcessBlock (ProcessBlockPrincipal &)
 Next process block, return false if there is none, sets the processName in the principal. More...
 
InputSourceoperator= (InputSource const &)=delete
 
std::shared_ptr< ProcessBlockHelper const > processBlockHelper () const
 Accessors for processBlockHelper. More...
 
std::shared_ptr< ProcessBlockHelper > & processBlockHelper ()
 
ProcessConfiguration const & processConfiguration () const
 Accessor for Process Configuration. More...
 
std::string const & processGUID () const
 Accessor for global process identifier. More...
 
ProcessHistoryRegistry const & processHistoryRegistry () const
 Accessors for process history registry. More...
 
ProcessHistoryRegistryprocessHistoryRegistry ()
 
ProcessingMode processingMode () const
 RunsLumisAndEvents (default), RunsAndLumis, or Runs. More...
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 Accessors for product registry. More...
 
bool randomAccess () const
 
void readAndMergeLumi (LuminosityBlockPrincipal &lbp)
 Read next luminosity block (same as a prior lumi) More...
 
void readAndMergeRun (RunPrincipal &rp)
 Read next run (same as a prior run) More...
 
void readEvent (EventPrincipal &ep, StreamContext &)
 Read next event. More...
 
bool readEvent (EventPrincipal &ep, EventID const &, StreamContext &)
 Read a specific event. More...
 
std::shared_ptr< FileBlockreadFile ()
 Read next file. More...
 
void readLuminosityBlock (LuminosityBlockPrincipal &lumiPrincipal, HistoryAppender &historyAppender)
 Read next luminosity block (new lumi) More...
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary ()
 Read next luminosity block Auxilary. More...
 
void readProcessBlock (ProcessBlockPrincipal &)
 Read next process block. More...
 
void readRun (RunPrincipal &runPrincipal, HistoryAppender &historyAppender)
 Read next run (new run) More...
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary ()
 Read next run Auxiliary. More...
 
ProcessHistoryID const & reducedProcessHistoryID () const
 
int remainingEvents () const
 
int remainingLuminosityBlocks () const
 
void repeat ()
 Reset the remaining number of events/lumis to the maximum number. More...
 
std::pair< SharedResourcesAcquirer *, std::recursive_mutex * > resourceSharedWithDelayedReader ()
 Returns nullptr if no resource shared between the Source and a DelayedReader. More...
 
ProcessingController::ReverseState reverseState () const
 
void rewind ()
 Begin again at the first event. More...
 
RunNumber_t run () const
 Accessor for current run number. More...
 
std::shared_ptr< RunAuxiliaryrunAuxiliary () const
 Called by the framework to merge or insert run in principal cache. More...
 
void setLuminosityBlockNumber_t (LuminosityBlockNumber_t lb)
 Set the luminosity block ID. More...
 
void setRunNumber (RunNumber_t r)
 Set the run number. More...
 
void skipEvents (int offset)
 
void switchTo (std::shared_ptr< ProductRegistry > iOther)
 switch to a different ProductRegistry. More...
 
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper () const
 Accessors for thinnedAssociationsHelper. More...
 
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper ()
 
Timestamp const & timestamp () const
 Accessor for the current time, as seen by the input source. More...
 
virtual ~InputSource () noexcept(false)
 Destructor. More...
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 

Private Member Functions

void openFile (const std::string &filename)
 
void produce (edm::Event &e) override
 
bool setRunAndEventInfo (edm::EventID &id, edm::TimeValue_t &time, edm::EventAuxiliary::ExperimentType &) override
 
void unpackSetup (const std::vector< std::string > &params)
 

Private Attributes

int m_chunkIds [CHUNK_COUNT]
 
CDFChunkm_chunks [CHUNK_COUNT]
 
CDFEventInfom_eventInfo
 
int m_eventNumberOffset
 
TFile * m_file
 
int m_fileCounter
 
int m_i
 
bool m_onlyRemapped
 
bool m_quiet
 
int m_skip
 
std::map< std::string, int > m_sourceIdRemap
 
TTree * m_tree
 
int n_chunks
 

Static Private Attributes

static const int CHUNK_COUNT = 64
 

Additional Inherited Members

- Public Types inherited from edm::InputSource
enum  ItemPosition : char { ItemPosition::Invalid, ItemPosition::LastItemToBeMerged, ItemPosition::NotLastItemToBeMerged }
 
enum  ItemType : char {
  ItemType::IsInvalid, ItemType::IsStop, ItemType::IsFile, ItemType::IsRun,
  ItemType::IsLumi, ItemType::IsEvent, ItemType::IsRepeat, ItemType::IsSynchronize
}
 
enum  ProcessingMode { Runs, RunsAndLumis, RunsLumisAndEvents }
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Static Public Member Functions inherited from edm::ProducerSourceFromFiles
static void fillDescription (ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase >
static void fillDescription (ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::InputSource
static const std::string & baseType ()
 
static void fillDescription (ParameterSetDescription &desc)
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Public Attributes inherited from edm::InputSource
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> postEventReadFromSourceSignal_
 
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> preEventReadFromSourceSignal_
 
- Protected Member Functions inherited from edm::ProducerSourceFromFiles
void incrementFileIndex ()
 
- Protected Member Functions inherited from edm::IDGeneratorSourceBase< PuttableSourceBase >
void doReadEvent (EventPrincipal &eventPrincipal, F &&f)
 
void doReadEventWithDelayedReader (EventPrincipal &eventPrincipal, ProcessHistoryID const &historyID, EventSelectionIDVector eventSelectionIDs, BranchListIndexes branchListIndexes, DelayedReader *reader)
 
- Protected Member Functions inherited from edm::InputSource
void decreaseRemainingEventsBy (int iSkipped)
 
bool eventCached () const
 
bool newLumi () const
 
bool newRun () const
 
ProcessHistoryRegistryprocessHistoryRegistryForUpdate ()
 
ProductRegistryproductRegistryUpdate ()
 
void reset () const
 
void resetEventCached ()
 
void resetLuminosityBlockAuxiliary (bool isNewLumi=true) const
 
void resetNewLumi ()
 
void resetNewRun ()
 
void resetRunAuxiliary (bool isNewRun=true) const
 
void setEventCached ()
 Called by the framework to merge or ached() const {return eventCached_;}. More...
 
void setLuminosityBlockAuxiliary (LuminosityBlockAuxiliary *lbp)
 
void setNewLumi ()
 
void setNewRun ()
 
void setRunAuxiliary (RunAuxiliary *rp)
 
void setTimestamp (Timestamp const &theTime)
 To set the current time, as seen by the input source. More...
 
ItemTypeInfo state () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 

Detailed Description

Note
Notice that there is a hack to renumber events from runs where the first event number was zero.

Definition at line 21 of file HcalTBSource.h.

Constructor & Destructor Documentation

◆ HcalTBSource()

HcalTBSource::HcalTBSource ( const edm::ParameterSet pset,
edm::InputSourceDescription const &  desc 
)
explicit

Definition at line 16 of file HcalTBSource.cc.

References m_file, m_fileCounter, m_i, m_skip, m_tree, muonDTDigis_cfi::pset, and unpackSetup().

18  m_quiet(pset.getUntrackedParameter<bool>("quiet", true)),
19  m_onlyRemapped(pset.getUntrackedParameter<bool>("onlyRemapped", false)),
20  m_skip(pset.getUntrackedParameter<uint32_t>("skipEvents", 0)) {
21  m_tree = nullptr;
22  m_fileCounter = -1;
23  m_file = nullptr;
24  m_i = m_skip;
25 
26  if (m_skip != 0)
27  edm::LogWarning("HcalTBSource") << "skipEvents != 0 works only for the first input file";
28 
29  unpackSetup(pset.getUntrackedParameter<std::vector<std::string> >("streams", std::vector<std::string>()));
30  produces<FEDRawDataCollection>();
31 }
TFile * m_file
Definition: HcalTBSource.h:32
TTree * m_tree
Definition: HcalTBSource.h:31
bool m_onlyRemapped
Definition: HcalTBSource.h:34
void unpackSetup(const std::vector< std::string > &params)
Definition: HcalTBSource.cc:33
Log< level::Warning, false > LogWarning

◆ ~HcalTBSource()

HcalTBSource::~HcalTBSource ( )
override

Definition at line 49 of file HcalTBSource.cc.

References m_file, and m_tree.

49  {
50  if (m_file != nullptr) {
51  m_file->Close();
52  m_file = nullptr;
53  m_tree = nullptr;
54  }
55 }
TFile * m_file
Definition: HcalTBSource.h:32
TTree * m_tree
Definition: HcalTBSource.h:31

Member Function Documentation

◆ openFile()

void HcalTBSource::openFile ( const std::string &  filename)
private

Definition at line 57 of file HcalTBSource.cc.

References b, corrVsCorr::filename, mps_fire::i, m_chunkIds, m_chunks, m_eventInfo, m_file, m_i, m_onlyRemapped, m_quiet, m_skip, m_sourceIdRemap, m_tree, and n_chunks.

Referenced by setRunAndEventInfo().

57  {
58  if (m_file != nullptr) {
59  m_file->Close();
60  m_file = nullptr;
61  m_tree = nullptr;
62  }
63 
64  // try {
65  m_file = TFile::Open(filename.c_str());
66  if (m_file == nullptr) {
67  edm::LogError("HCAL") << "Unable to open " << filename << endl;
68  m_tree = nullptr;
69  return;
70  }
71 
72  m_tree = (TTree*)m_file->Get("CMSRAW");
73 
74  if (m_tree == nullptr) {
75  m_file->Close();
76  m_file = nullptr;
77  edm::LogError("HCAL") << "Unable to find CMSRAW tree" << endl;
78  return;
79  }
80 
81  if (!m_quiet) {
82  edm::LogInfo("HCAL") << "Opening '" << filename << "' with " << m_tree->GetEntries() << " events.\n";
83  }
84 
85  TObjArray* lb = m_tree->GetListOfBranches();
86  n_chunks = 0;
87  for (int i = 0; i < lb->GetSize(); i++) {
88  TBranch* b = (TBranch*)lb->At(i);
89  if (b == nullptr)
90  continue;
91  if (!strcmp(b->GetClassName(), "CDFEventInfo")) {
92  m_eventInfo = nullptr;
93  b->SetAddress(&m_eventInfo);
94  } else {
95  if (strcmp(b->GetClassName(), "CDFChunk"))
96  continue;
97  if (m_sourceIdRemap.find(b->GetName()) == m_sourceIdRemap.end()) {
98  if (m_onlyRemapped)
99  continue;
100  m_sourceIdRemap.insert(std::pair<std::string, int>(b->GetName(), -1));
101  if (!m_quiet)
102  edm::LogInfo("HCAL") << "Also reading branch " << b->GetName();
103  }
104 
105  m_chunks[n_chunks] = nullptr; // allow ROOT to allocate
106  b->SetAddress(&(m_chunks[n_chunks]));
107  m_chunkIds[n_chunks] = m_sourceIdRemap[b->GetName()];
108  n_chunks++;
109  }
110  }
111  if (!((m_skip != 0) & (m_i == m_skip)))
112  m_i = 0;
113 }
TFile * m_file
Definition: HcalTBSource.h:32
Log< level::Error, false > LogError
TTree * m_tree
Definition: HcalTBSource.h:31
bool m_onlyRemapped
Definition: HcalTBSource.h:34
CDFChunk * m_chunks[CHUNK_COUNT]
Definition: HcalTBSource.h:37
Log< level::Info, false > LogInfo
int m_chunkIds[CHUNK_COUNT]
Definition: HcalTBSource.h:38
double b
Definition: hdecay.h:120
std::map< std::string, int > m_sourceIdRemap
Definition: HcalTBSource.h:39
CDFEventInfo * m_eventInfo
Definition: HcalTBSource.h:40

◆ produce()

void HcalTBSource::produce ( edm::Event e)
overrideprivatevirtual

Implements edm::ProducerSourceBase.

Definition at line 159 of file HcalTBSource.cc.

References FEDRawData::data(), data, MillePedeFileConverter_cfg::e, printContent_cfi::getData, CDFChunk::getDataLength(), CDFChunk::getSourceId(), RecoTauValidation_cfi::header, mps_fire::i, m_chunkIds, m_chunks, m_quiet, eostools::move(), n_chunks, and FEDRawData::resize().

159  {
160  auto bare_product = std::make_unique<FEDRawDataCollection>();
161  for (int i = 0; i < n_chunks; i++) {
162  const unsigned char* data = (const unsigned char*)m_chunks[i]->getData();
163  int len = m_chunks[i]->getDataLength() * 8;
164 
165  int natId = m_chunks[i]->getSourceId();
166  int id = (m_chunkIds[i] > 0) ? (m_chunkIds[i]) : (natId);
167 
168  FEDRawData& fed = bare_product->FEDData(id);
169  fed.resize(len);
170  memcpy(fed.data(), data, len);
171 
172  // patch the SourceId...
173  if (natId != id) {
174  unsigned int* header = (unsigned int*)fed.data();
175  header[0] = (header[0] & 0xFFF000FFu) | (id << 8);
176  // TODO: patch CRC after this change!
177  }
178  if (!m_quiet)
179  edm::LogInfo("HCAL") << "Reading " << len << " bytes for FED " << id << std::endl;
180  }
181 
182  e.put(std::move(bare_product));
183 }
int getSourceId() const
Definition: CDFChunk.h:24
Int_t getDataLength() const
Definition: CDFChunk.h:23
CDFChunk * m_chunks[CHUNK_COUNT]
Definition: HcalTBSource.h:37
Log< level::Info, false > LogInfo
int m_chunkIds[CHUNK_COUNT]
Definition: HcalTBSource.h:38
void resize(size_t newsize, size_t wordsize=8)
Definition: FEDRawData.cc:28
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
def move(src, dest)
Definition: eostools.py:511

◆ setRunAndEventInfo()

bool HcalTBSource::setRunAndEventInfo ( edm::EventID id,
edm::TimeValue_t time,
edm::EventAuxiliary::ExperimentType  
)
overrideprivatevirtual

Implements edm::IDGeneratorSourceBase< PuttableSourceBase >.

Definition at line 115 of file HcalTBSource.cc.

References edm::FromFiles::fileNames(), CDFEventInfo::getEventNumber(), CDFEventInfo::getRunNumber(), edm::IDGeneratorSourceBase< PuttableSourceBase >::luminosityBlock(), m_eventInfo, m_eventNumberOffset, m_file, m_fileCounter, m_i, m_tree, openFile(), edm::IDGeneratorSourceBase< PuttableSourceBase >::presentTime(), findQualityFiles::size, hcalRecHitTable_cff::time, and edm::IDGeneratorSourceBase< PuttableSourceBase >::timeBetweenEvents().

115  {
116  bool is_new = false;
117 
118  while (m_tree == nullptr || m_i == m_tree->GetEntries()) {
119  m_fileCounter++;
120  if (m_file != nullptr) {
121  m_file->Close();
122  m_file = nullptr;
123  m_tree = nullptr;
124  }
125  if (m_fileCounter >= int(fileNames(0).size()))
126  return false; // nothing good
128  is_new = true;
129  }
130 
131  if (m_tree == nullptr || m_i == m_tree->GetEntries())
132  return false; //nothing good
133 
134  m_tree->GetEntry(m_i);
135  m_i++;
136 
137  if (m_eventInfo != nullptr) {
138  if (is_new) {
139  if (m_eventInfo->getEventNumber() == 0)
141  else
143  }
144  // ZERO is unacceptable for a run number from a technical point of view
145  id = EventID((m_eventInfo->getRunNumber() == 0 ? 1 : m_eventInfo->getRunNumber()),
146  id.luminosityBlock(),
148  } else {
149  id = EventID(m_fileCounter + 10, id.luminosityBlock(), m_i + 1);
150  }
151  // time is a hack
152  edm::TimeValue_t present_time = presentTime();
153  unsigned long time_between_events = timeBetweenEvents();
154 
155  time = present_time + time_between_events;
156  return true;
157 }
size
Write out results.
TFile * m_file
Definition: HcalTBSource.h:32
UInt_t getRunNumber() const
get the run number
Definition: CDFEventInfo.h:12
int m_eventNumberOffset
Definition: HcalTBSource.h:41
ULong64_t getEventNumber() const
get the event number
Definition: CDFEventInfo.h:16
TTree * m_tree
Definition: HcalTBSource.h:31
void openFile(const std::string &filename)
Definition: HcalTBSource.cc:57
unsigned long long TimeValue_t
Definition: Timestamp.h:21
std::vector< std::string > fileNames(unsigned iCatalog) const
Definition: FromFiles.h:22
CDFEventInfo * m_eventInfo
Definition: HcalTBSource.h:40

◆ unpackSetup()

void HcalTBSource::unpackSetup ( const std::vector< std::string > &  params)
private

Definition at line 33 of file HcalTBSource.cc.

References mps_fire::i, m_sourceIdRemap, submitPVValidationJobs::params, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HcalTBSource().

33  {
34  for (std::vector<std::string>::const_iterator i = params.begin(); i != params.end(); i++) {
35  unsigned long pos = i->find(':');
36  std::string streamName = i->substr(0, pos);
37  int remapTo = -1;
38  if (pos != std::string::npos)
39  remapTo = atoi(i->c_str() + pos + 1);
40 
41  m_sourceIdRemap.insert(std::pair<std::string, int>(streamName, remapTo));
42  if (remapTo != -1)
43  edm::LogInfo("HCAL") << streamName << " --> " << remapTo << endl;
44  else
45  edm::LogInfo("HCAL") << streamName << " using fedid in file" << endl;
46  }
47 }
Log< level::Info, false > LogInfo
std::map< std::string, int > m_sourceIdRemap
Definition: HcalTBSource.h:39

Member Data Documentation

◆ CHUNK_COUNT

const int HcalTBSource::CHUNK_COUNT = 64
staticprivate

Definition at line 36 of file HcalTBSource.h.

◆ m_chunkIds

int HcalTBSource::m_chunkIds[CHUNK_COUNT]
private

Definition at line 38 of file HcalTBSource.h.

Referenced by openFile(), and produce().

◆ m_chunks

CDFChunk* HcalTBSource::m_chunks[CHUNK_COUNT]
private

Definition at line 37 of file HcalTBSource.h.

Referenced by openFile(), and produce().

◆ m_eventInfo

CDFEventInfo* HcalTBSource::m_eventInfo
private

Definition at line 40 of file HcalTBSource.h.

Referenced by openFile(), and setRunAndEventInfo().

◆ m_eventNumberOffset

int HcalTBSource::m_eventNumberOffset
private

Definition at line 41 of file HcalTBSource.h.

Referenced by setRunAndEventInfo().

◆ m_file

TFile* HcalTBSource::m_file
private

Definition at line 32 of file HcalTBSource.h.

Referenced by HcalTBSource(), openFile(), setRunAndEventInfo(), and ~HcalTBSource().

◆ m_fileCounter

int HcalTBSource::m_fileCounter
private

Definition at line 33 of file HcalTBSource.h.

Referenced by HcalTBSource(), and setRunAndEventInfo().

◆ m_i

int HcalTBSource::m_i
private

Definition at line 33 of file HcalTBSource.h.

Referenced by HcalTBSource(), openFile(), and setRunAndEventInfo().

◆ m_onlyRemapped

bool HcalTBSource::m_onlyRemapped
private

Definition at line 34 of file HcalTBSource.h.

Referenced by openFile().

◆ m_quiet

bool HcalTBSource::m_quiet
private

Definition at line 34 of file HcalTBSource.h.

Referenced by openFile(), and produce().

◆ m_skip

int HcalTBSource::m_skip
private

Definition at line 41 of file HcalTBSource.h.

Referenced by HcalTBSource(), and openFile().

◆ m_sourceIdRemap

std::map<std::string, int> HcalTBSource::m_sourceIdRemap
private

Definition at line 39 of file HcalTBSource.h.

Referenced by openFile(), and unpackSetup().

◆ m_tree

TTree* HcalTBSource::m_tree
private

Definition at line 31 of file HcalTBSource.h.

Referenced by HcalTBSource(), openFile(), setRunAndEventInfo(), and ~HcalTBSource().

◆ n_chunks

int HcalTBSource::n_chunks
private

Definition at line 35 of file HcalTBSource.h.

Referenced by openFile(), and produce().