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 Member Functions | Private Attributes
SiPixelDaqInfo Class Reference

#include <SiPixelDaqInfo.h>

Inheritance diagram for SiPixelDaqInfo:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 SiPixelDaqInfo (const edm::ParameterSet &)
 
 ~SiPixelDaqInfo ()
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 Member Functions

virtual void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, const edm::LuminosityBlock &, const edm::EventSetup &)
 

Private Attributes

std::string daqSource_
 
edm::EDGetTokenT
< FEDRawDataCollection
daqSourceToken_
 
std::pair< int, int > FEDRange_
 
int FEDs_ [40]
 
bool firstLumi
 
MonitorElementFraction_
 
MonitorElementFractionBarrel_
 
MonitorElementFractionEndcap_
 
int NEvents_
 
int nFEDsBarrel_
 
int nFEDsEndcap_
 
int NumberOfFeds_
 

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 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 27 of file SiPixelDaqInfo.h.

Constructor & Destructor Documentation

SiPixelDaqInfo::SiPixelDaqInfo ( const edm::ParameterSet ps)
explicit

Definition at line 11 of file SiPixelDaqInfo.cc.

References edm::ParameterSet::getUntrackedParameter(), and i.

11  {
12 
13  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumPixelFEDId", 0);
14  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumPixelFEDId", 39);
15  daqSource_ = ps.getUntrackedParameter<string>("daqSource", "source");
16 
17  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
18 
19  NEvents_ = 0;
20  for(int i=0; i!=40; i++) FEDs_[i] = 0;
21 
22  firstLumi = true;
23 
24  //set Token(-s)
25  daqSourceToken_ = consumes<FEDRawDataCollection>(ps.getUntrackedParameter<string>("daqSource", "source"));
26 }
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::pair< int, int > FEDRange_
std::string daqSource_
edm::EDGetTokenT< FEDRawDataCollection > daqSourceToken_
SiPixelDaqInfo::~SiPixelDaqInfo ( )

Definition at line 28 of file SiPixelDaqInfo.cc.

28 {}

Member Function Documentation

void SiPixelDaqInfo::dqmEndJob ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter 
)
privatevirtual

Implements DQMEDHarvester.

Definition at line 96 of file SiPixelDaqInfo.cc.

96 {}
void SiPixelDaqInfo::dqmEndLuminosityBlock ( DQMStore::IBooker iBooker,
DQMStore::IGetter iGetter,
const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from DQMEDHarvester.

Definition at line 30 of file SiPixelDaqInfo.cc.

References DQMStore::IBooker::bookFloat(), MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), edm::EventSetup::get(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), i, and DQMStore::IBooker::setCurrentFolder().

30  {
31 
32  //Book somethings first time around
33  if (firstLumi){
34  iBooker.setCurrentFolder("Pixel/EventInfo");
35  Fraction_= iBooker.bookFloat("DAQSummary");
36  iBooker.setCurrentFolder("Pixel/EventInfo/DAQContents");
37  FractionBarrel_= iBooker.bookFloat("PixelBarrelFraction");
38  FractionEndcap_= iBooker.bookFloat("PixelEndcapFraction");
39 
40  firstLumi = false;
41  }
42 
44  if(0 != iSetup.find( recordKey ) ) {
45  //get fed summary information
46  ESHandle<RunInfo> sumFED;
47  iSetup.get<RunInfoRcd>().get(sumFED);
48  vector<int> FedsInIds= sumFED->m_fed_in;
49 
50  int FedCount=0;
51  int FedCountBarrel=0;
52  int FedCountEndcap=0;
53 
54  //loop on all active feds
55  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
56  int fedID=FedsInIds[fedItr];
57  //make sure fed id is in allowed range
58  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second){
59  ++FedCount;
60  if(fedID>=0 && fedID<=31) ++FedCountBarrel;
61  else if(fedID>=32 && fedID<=39) ++FedCountEndcap;
62  }
63  }
64  //Fill active fed fraction ME
65  if(FedCountBarrel<=32){
66  MonitorElement * mefed = iGetter.get("Pixel/EventInfo/DAQContents/fedcounter");
67  FedCountBarrel = 0; FedCountEndcap = 0; FedCount = 0; NumberOfFeds_ = 40;
68  if(mefed){
69  for(int i=0; i!=40; i++){
70  if(i<=31 && mefed->getBinContent(i+1)>0) FedCountBarrel++;
71  if(i>=32 && mefed->getBinContent(i+1)>0) FedCountEndcap++;
72  if(mefed->getBinContent(i+1)>0) FedCount++;
73  }
74  }
75  }
76  if(NumberOfFeds_>0){
77  //all Pixel:
78  Fraction_->Fill( FedCount/NumberOfFeds_);
79  //Barrel:
80  FractionBarrel_->Fill( FedCountBarrel/32.);
81  //Endcap:
82  FractionEndcap_->Fill( FedCountEndcap/8.);
83  }else{
84  Fraction_->Fill(-1);
85  FractionBarrel_->Fill(-1);
86  FractionEndcap_->Fill(-1);
87  }
88  }else{
89  Fraction_->Fill(-1);
90  FractionBarrel_->Fill(-1);
91  FractionEndcap_->Fill(-1);
92  return;
93  }
94 }
int i
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
std::pair< int, int > FEDRange_
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:91
void Fill(long long x)
MonitorElement * Fraction_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * FractionBarrel_
const T & get() const
Definition: EventSetup.h:56
MonitorElement * FractionEndcap_
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125

Member Data Documentation

std::string SiPixelDaqInfo::daqSource_
private

Definition at line 48 of file SiPixelDaqInfo.h.

edm::EDGetTokenT<FEDRawDataCollection> SiPixelDaqInfo::daqSourceToken_
private

Definition at line 54 of file SiPixelDaqInfo.h.

std::pair<int,int> SiPixelDaqInfo::FEDRange_
private

Definition at line 41 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::FEDs_[40]
private

Definition at line 49 of file SiPixelDaqInfo.h.

bool SiPixelDaqInfo::firstLumi
private

Definition at line 51 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::Fraction_
private

Definition at line 37 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::FractionBarrel_
private

Definition at line 38 of file SiPixelDaqInfo.h.

MonitorElement* SiPixelDaqInfo::FractionEndcap_
private

Definition at line 39 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::NEvents_
private

Definition at line 45 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::nFEDsBarrel_
private

Definition at line 46 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::nFEDsEndcap_
private

Definition at line 47 of file SiPixelDaqInfo.h.

int SiPixelDaqInfo::NumberOfFeds_
private

Definition at line 43 of file SiPixelDaqInfo.h.