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
RPCDCSSummary Class Reference

#include <RPCDCSSummary.h>

Inheritance diagram for RPCDCSSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 RPCDCSSummary (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~RPCDCSSummary ()
 Destructor. More...
 
- 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
 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
 
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 analyze (const edm::Event &event, const edm::EventSetup &setup)
 
virtual void beginJob ()
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
 

Private Attributes

MonitorElementdcsDiskFractions [10]
 
MonitorElementDCSMap_
 
MonitorElementdcsWheelFractions [5]
 
std::pair< int, int > FEDRange_
 
int numberOfDisks_
 
int NumberOfFeds_
 
DQMStoretheDbe
 
MonitorElementtotalDCSFraction
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 12 of file RPCDCSSummary.h.

Constructor & Destructor Documentation

RPCDCSSummary::RPCDCSSummary ( const edm::ParameterSet pset)

Constructor.

Definition at line 15 of file RPCDCSSummary.cc.

References FEDRange_, edm::ParameterSet::getUntrackedParameter(), numberOfDisks_, and NumberOfFeds_.

15  {
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 4);
18 
19  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
20  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
21 
22  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
23 }
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:37
RPCDCSSummary::~RPCDCSSummary ( )
virtual

Destructor.

Definition at line 25 of file RPCDCSSummary.cc.

25 {}

Member Function Documentation

void RPCDCSSummary::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 146 of file RPCDCSSummary.cc.

146 {}
void RPCDCSSummary::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 27 of file RPCDCSSummary.cc.

27 {}
void RPCDCSSummary::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file RPCDCSSummary.cc.

132  {
133 }
void RPCDCSSummary::beginRun ( const edm::Run r,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 29 of file RPCDCSSummary.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dcsDiskFractions, DCSMap_, dcsWheelFractions, f, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), archive::flag, edm::EventSetup::get(), i, j, MessageLogger_cff::limit, numberOfDisks_, evf::evtn::offset(), cppFunctionSkipper::operator, MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), hcal_dqm_sourceclient-file_cfg::streams, theDbe, and totalDCSFraction.

29  {
31 
32  int defaultValue = 1;
33 
34  if(0 != setup.find( recordKey ) ) {
35  defaultValue = -1;
36  //get fed summary information
38  setup.get<RunInfoRcd>().get(sumFED);
39  std::vector<int> FedsInIds= sumFED->m_fed_in;
40  unsigned int f = 0;
41  bool flag = false;
42  while(!flag && f < FedsInIds.size()) {
43  int fedID=FedsInIds[f];
44  //make sure fed id is in allowed range
45  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
46  defaultValue = 1;
47  flag = true;
48  }
49  f++;
50  }
51  }
52 
53  // get the DQMStore
55 
56  theDbe->setCurrentFolder("RPC/EventInfo");
57  // global fraction
58  totalDCSFraction = theDbe->bookFloat("DCSSummary");
59  totalDCSFraction->Fill(defaultValue);
60 
61  DCSMap_ = theDbe->book2D( "DCSSummaryMap","RPC DCS Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
62 
63  //customize the 2d histo
64  std::stringstream BinLabel;
65  for (int i= 1 ; i<13; i++){
66  BinLabel.str("");
67  BinLabel<<"Sec"<<i;
68  DCSMap_->setBinLabel(i,BinLabel.str(),2);
69  }
70 
71  for(int i = -2; i<=2; i++){
72  BinLabel.str("");
73  BinLabel<<"Wheel"<<i;
74  DCSMap_->setBinLabel((i+8),BinLabel.str(),1);
75  }
76 
77  for(int i = 1; i<=numberOfDisks_; i++){
78  BinLabel.str("");
79  BinLabel<<"Disk"<<i;
80  DCSMap_->setBinLabel((i+11),BinLabel.str(),1);
81  BinLabel.str("");
82  BinLabel<<"Disk"<<-i;
83  DCSMap_->setBinLabel((-i+5),BinLabel.str(),1);
84  }
85 
86  //fill the histo with "1" --- just for the moment
87  for(int i=1; i<=15; i++){
88  for (int j=1; j<=12; j++ ){
89  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
90  DCSMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
91  else
92  DCSMap_->setBinContent(i,j,defaultValue);
93  }
94  }
95 
96 
97  if(numberOfDisks_ < 4){
98  for (int j=1; j<=12; j++ ){
99  DCSMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
100  DCSMap_->setBinContent(15,j,-1);
101  }
102  }
103 
104  // book the ME
105  theDbe->setCurrentFolder("RPC/EventInfo/DCSContents");
106 
107  int limit = numberOfDisks_;
108  if(numberOfDisks_ < 2) limit = 2;
109 
110 
111  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
112  if (i>-3 && i<3){//wheels
113  std::stringstream streams;
114  streams << "RPC_Wheel" << i;
115  dcsWheelFractions[i+2] = theDbe->bookFloat(streams.str());
116  dcsWheelFractions[i+2]->Fill(defaultValue);
117  }
118 
119  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
120 
121  int offset = numberOfDisks_;
122  if (i>0) offset --; //used to skip case equale to zero
123  std::stringstream streams;
124  streams << "RPC_Disk" << i;
125  dcsDiskFractions[i+2] = theDbe->bookFloat(streams.str());
126  dcsDiskFractions[i+2]->Fill(defaultValue);
127  }
128 }
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * DCSMap_
Definition: RPCDCSSummary.h:33
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * totalDCSFraction
Definition: RPCDCSSummary.h:34
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:879
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
MonitorElement * dcsDiskFractions[10]
Definition: RPCDCSSummary.h:36
int j
Definition: DBlmapReader.cc:9
double f[11][100]
unsigned int offset(bool)
const T & get() const
Definition: EventSetup.h:55
DQMStore * theDbe
Definition: RPCDCSSummary.h:32
MonitorElement * dcsWheelFractions[5]
Definition: RPCDCSSummary.h:35
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:37
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
void RPCDCSSummary::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file RPCDCSSummary.cc.

142 {}
void RPCDCSSummary::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file RPCDCSSummary.cc.

138 {}

Member Data Documentation

MonitorElement* RPCDCSSummary::dcsDiskFractions[10]
private

Definition at line 36 of file RPCDCSSummary.h.

Referenced by beginRun().

MonitorElement* RPCDCSSummary::DCSMap_
private

Definition at line 33 of file RPCDCSSummary.h.

Referenced by beginRun().

MonitorElement* RPCDCSSummary::dcsWheelFractions[5]
private

Definition at line 35 of file RPCDCSSummary.h.

Referenced by beginRun().

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

Definition at line 37 of file RPCDCSSummary.h.

Referenced by beginRun(), and RPCDCSSummary().

int RPCDCSSummary::numberOfDisks_
private

Definition at line 38 of file RPCDCSSummary.h.

Referenced by beginRun(), and RPCDCSSummary().

int RPCDCSSummary::NumberOfFeds_
private

Definition at line 39 of file RPCDCSSummary.h.

Referenced by RPCDCSSummary().

DQMStore* RPCDCSSummary::theDbe
private

Definition at line 32 of file RPCDCSSummary.h.

Referenced by beginRun().

MonitorElement* RPCDCSSummary::totalDCSFraction
private

Definition at line 34 of file RPCDCSSummary.h.

Referenced by beginRun().