CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCDCSSummary.cc
Go to the documentation of this file.
2 
7 
10 //CondFormats
13 
14 
16 
17  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
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 }
24 
26 
28 
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 }
129 
130 
131 
133 }
134 
135 
136 
137 
139 
140 
141 
143 
144 
145 
147 
148 
149 
150 
151 
virtual void endJob()
T getUntrackedParameter(std::string const &, T const &) const
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
long int flag
Definition: mlp_lapack.h:47
MonitorElement * DCSMap_
Definition: RPCDCSSummary.h:33
tuple lumi
Definition: fjr2json.py:35
RPCDCSSummary(const edm::ParameterSet &pset)
Constructor.
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
void beginRun(const edm::Run &, const edm::EventSetup &)
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)
MonitorElement * dcsDiskFractions[10]
Definition: RPCDCSSummary.h:36
virtual ~RPCDCSSummary()
Destructor.
virtual void beginJob()
int j
Definition: DBlmapReader.cc:9
double f[11][100]
unsigned int offset(bool)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
const T & get() const
Definition: EventSetup.h:55
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
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:845
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::pair< int, int > FEDRange_
Definition: RPCDCSSummary.h:37
Definition: Run.h:33
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