CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCDaqInfo.cc
Go to the documentation of this file.
6 
8 
9  FEDRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumRPCFEDId", 790);
10  FEDRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumRPCFEDId", 792);
11 
12  NumberOfFeds_ =FEDRange_.second - FEDRange_.first +1;
13 
14  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
15 }
16 
18 
20 
22 
23 
24  if(0 != iSetup.find( recordKey ) ) {
25 
26  //get fed summary information
28  iSetup.get<RunInfoRcd>().get(sumFED);
29  std::vector<int> FedsInIds= sumFED->m_fed_in;
30 
31  int FedCount=0;
32 
33  //loop on all active feds
34  for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
35  int fedID=FedsInIds[fedItr];
36  //make sure fed id is in allowed range
37 
38  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) ++FedCount;
39  }
40 
41  //Fill active fed fraction ME
42  if(NumberOfFeds_>0) DaqFraction_->Fill( FedCount/NumberOfFeds_);
43  else DaqFraction_->Fill(-1);
44 
45  }else{
46  DaqFraction_->Fill(-1);
47  return;
48  }
49 }
50 
51 
53 
54 
56 
57  dbe_ = 0;
59 
60  //fraction of alive FEDs
61  dbe_->setCurrentFolder("RPC/EventInfo/DAQContents");
62 
63  int limit = numberOfDisks_;
64  if(numberOfDisks_ < 2) limit = 2;
65 
66  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
67  if (i>-3 && i<3){//wheels
68  std::stringstream streams;
69  streams << "RPC_Wheel" << i;
70  daqWheelFractions[i+2] = dbe_->bookFloat(streams.str());
71  daqWheelFractions[i+2]->Fill(-1);
72  }
73 
74  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
75 
76  int offset = numberOfDisks_;
77  if (i>0) offset --; //used to skip case equale to zero
78 
79  std::stringstream streams;
80  streams << "RPC_Disk" << i;
81  daqDiskFractions[i+2] = dbe_->bookFloat(streams.str());
82  daqDiskFractions[i+2]->Fill(-1);
83  }
84 
85 
86  //daq summary for RPCs
87  dbe_->setCurrentFolder("RPC/EventInfo");
88 
89  DaqFraction_ = dbe_->bookFloat("DAQSummary");
90 
91  DaqMap_ = dbe_->book2D( "DAQSummaryMap","RPC DAQ Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
92 
93  //customize the 2d histo
94  std::stringstream BinLabel;
95  for (int i= 1 ; i<=15; i++){
96  BinLabel.str("");
97  if(i<13){
98  BinLabel<<"Sec"<<i;
99  DaqMap_->setBinLabel(i,BinLabel.str(),2);
100  }
101 
102  BinLabel.str("");
103  if(i<5)
104  BinLabel<<"Disk"<<i-5;
105  else if(i>11)
106  BinLabel<<"Disk"<<i-11;
107  else if(i==11 || i==5)
108  BinLabel.str("");
109  else
110  BinLabel<<"Wheel"<<i-8;
111 
112  DaqMap_->setBinLabel(i,BinLabel.str(),1);
113  }
114 }
115 
116 
118 
119 
120 
122 
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * daqDiskFractions[10]
Definition: RPCDaqInfo.h:43
std::pair< int, int > FEDRange_
Definition: RPCDaqInfo.h:45
MonitorElement * DaqFraction_
Definition: RPCDaqInfo.h:40
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)
DQMStore * dbe_
Definition: RPCDaqInfo.h:38
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:243
RPCDaqInfo(const edm::ParameterSet &)
Definition: RPCDaqInfo.cc:7
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
Definition: RPCDaqInfo.cc:19
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: RPCDaqInfo.cc:121
unsigned int offset(bool)
virtual void beginJob()
Definition: RPCDaqInfo.cc:55
virtual void endJob()
Definition: RPCDaqInfo.cc:117
const T & get() const
Definition: EventSetup.h:55
MonitorElement * daqWheelFractions[5]
Definition: RPCDaqInfo.h:42
MonitorElement * DaqMap_
Definition: RPCDaqInfo.h:41
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:845
int numberOfDisks_
Definition: RPCDaqInfo.h:47
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:129
int NumberOfFeds_
Definition: RPCDaqInfo.h:47
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
Definition: RPCDaqInfo.cc:52