CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
evf::EvFRecordUnpacker Class Reference

#include <EvFRecordUnpacker.h>

Inheritance diagram for evf::EvFRecordUnpacker:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
 EvFRecordUnpacker (const edm::ParameterSet &)
 
 ~EvFRecordUnpacker ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

TH2F * corre_
 
TFile * f_
 
TH1F * l1_rb_delay_
 
edm::InputTag label_
 
TH1F * node_usage_
 

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

Definition at line 15 of file EvFRecordUnpacker.h.

Constructor & Destructor Documentation

evf::EvFRecordUnpacker::EvFRecordUnpacker ( const edm::ParameterSet pset)

Definition at line 12 of file EvFRecordUnpacker.cc.

References newFWLiteAna::bin, corre_, TauDecayModes::dec, f_, l1_rb_delay_, and node_usage_.

13  : label_(pset.getParameter<edm::InputTag>("inputTag"))
14  , node_usage_(0)
15  , l1_rb_delay_(0)
16  {
17  node_usage_ = new TH1F("nodes","node usage",1600,0.,1600.);
18  l1_rb_delay_ = new TH1F("l1-rb","l1-rb delay in ms",1000,0.,10000.);
19  corre_ = new TH2F("corre","Correlation",1600,0.,1600.,1000,0.,10000.);
20  for(unsigned int row = 0xa; row <=0xf; row++)
21  for(unsigned int rack = 11; rack <= 18; rack++)
22  for(unsigned int position_in_rack = 1; position_in_rack<=30;
23  position_in_rack++)
24  {
25  unsigned int bin = (row-0xa)*9*30+(rack-11)*30+position_in_rack+1;
26  std::ostringstream ost;
27  ost << std::hex << row << "-" << std::dec << rack << "-"
28  << std::setfill('0') << std::setw(2) << position_in_rack;
29  node_usage_->GetXaxis()->SetBinLabel(bin,ost.str().c_str());
30  corre_->GetXaxis()->SetBinLabel(bin,ost.str().c_str());
31  }
32 
33  f_ = new TFile("histos.root","RECREATE");
34  }
T getParameter(std::string const &) const
evf::EvFRecordUnpacker::~EvFRecordUnpacker ( )

Definition at line 35 of file EvFRecordUnpacker.cc.

References corre_, f_, l1_rb_delay_, and node_usage_.

36  {
37  f_->cd();
38  node_usage_->Write();
39  l1_rb_delay_->Write();
40  corre_->Write();
41  f_->Write();
42  f_->Close();
43  delete f_;
44  delete corre_;
45  if(node_usage_ !=0) delete node_usage_;
46  if(l1_rb_delay_!=0) delete l1_rb_delay_;
47  }

Member Function Documentation

void evf::EvFRecordUnpacker::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 49 of file EvFRecordUnpacker.cc.

References corre_, data, edm::Event::eventAuxiliary(), evf::fedinterface::EVFFED_ID, evf::fedinterface::EVFFED_RBIDENT_OFFSET, evf::fedinterface::EVFFED_RBPCIDE_MASK, evf::fedinterface::EVFFED_RBPCIDE_SHIFT, evf::fedinterface::EVFFED_RBWCTIM_OFFSET, edm::Event::getByLabel(), l1_rb_delay_, label_, node_usage_, lumiPlot::rawdata, alignCSCRings::s, edm::EventAuxiliary::time(), edm::Timestamp::value(), and x().

50  {
52 
53  using namespace fedinterface;
56  unsigned int id = fedinterface::EVFFED_ID;
57  const FEDRawData& data = rawdata->FEDData(id);
58  // size_t size=data.size();
59  unsigned int rbident = *((unsigned int*)(data.data()+EVFFED_RBIDENT_OFFSET));
60  uint64_t rbtime = *((uint64_t*)(data.data()+EVFFED_RBWCTIM_OFFSET));
61  unsigned int s = (unsigned int)((rbtime >> 32)-(ts.value() >> 32));
62  unsigned int us = (unsigned int)((rbtime & 0xffffffff) - (ts.value() & 0xffffffff));
63  float deltams= s*1000.+((float)us)/1000.;
64 
65  unsigned int nodeid = (rbident >> EVFFED_RBPCIDE_SHIFT) & EVFFED_RBPCIDE_MASK;
66  unsigned int rackid = (nodeid&0xfff00)>>8;
67  unsigned int position_in_rack = nodeid&0x000ff;
68  // std::cout << std::hex << rbident << " node id " << nodeid << " rack " << rackid << " position " << position_in_rack << std::dec << std::endl;
69  unsigned int row = ((rackid & 0xf00) >> 8)-10;
70  unsigned int rackno = (rackid & 0x0ff)-0x11;
71  // std::cout << "row " << row << " rackno " << rackno << std::endl;
72  // std::cout << "BIN " << row*9*30+rackno*30+position_in_rack << std::endl;
73  position_in_rack = position_in_rack%16 + position_in_rack/16*10;
74 
75  float x = (row*9*30+rackno*30+position_in_rack)-0.00001;
76  // std::cout << " X " << x << std::endl;
77  node_usage_->Fill(x,1.);
78  l1_rb_delay_->Fill(deltams,1.);
79  corre_->Fill(x,deltams,1.);
80  }
Timestamp const & time() const
const unsigned int EVFFED_ID
Definition: FED1023.h:28
const unsigned int EVFFED_RBPCIDE_SHIFT
Definition: FED1023.h:36
const unsigned int EVFFED_RBPCIDE_MASK
Definition: FED1023.h:35
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:76
const unsigned int EVFFED_RBWCTIM_OFFSET
Definition: FED1023.h:39
unsigned long long uint64_t
Definition: Time.h:15
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const unsigned int EVFFED_RBIDENT_OFFSET
Definition: FED1023.h:34
dictionary rawdata
Definition: lumiPlot.py:393
TimeValue_t value() const
Definition: Timestamp.h:56

Member Data Documentation

TH2F* evf::EvFRecordUnpacker::corre_
private

Definition at line 26 of file EvFRecordUnpacker.h.

Referenced by analyze(), EvFRecordUnpacker(), and ~EvFRecordUnpacker().

TFile* evf::EvFRecordUnpacker::f_
private

Definition at line 27 of file EvFRecordUnpacker.h.

Referenced by EvFRecordUnpacker(), and ~EvFRecordUnpacker().

TH1F* evf::EvFRecordUnpacker::l1_rb_delay_
private

Definition at line 25 of file EvFRecordUnpacker.h.

Referenced by analyze(), EvFRecordUnpacker(), and ~EvFRecordUnpacker().

edm::InputTag evf::EvFRecordUnpacker::label_
private
TH1F* evf::EvFRecordUnpacker::node_usage_
private

Definition at line 24 of file EvFRecordUnpacker.h.

Referenced by analyze(), EvFRecordUnpacker(), and ~EvFRecordUnpacker().