CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCDataCertification.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 
27 
29 
30 
33 
34  int defaultValue = 1;
35 
36  if(0 != setup.find( recordKey ) ) {
37  defaultValue = -1;
38  //get fed summary information
40  setup.get<RunInfoRcd>().get(sumFED);
41  std::vector<int> FedsInIds= sumFED->m_fed_in;
42  unsigned int f = 0;
43  bool flag = false;
44  while(!flag && f < FedsInIds.size()) {
45  int fedID=FedsInIds[f];
46  //make sure fed id is in allowed range
47  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second) {
48  defaultValue = 1;
49  flag = true;
50  }
51  f++;
52  }
53  }
54 
55 
56  // get the DQMStore
58 
59  theDbe->setCurrentFolder("RPC/EventInfo");
60  // global fraction
61  totalCertFraction = theDbe->bookFloat("CertificationSummary");
62  totalCertFraction->Fill(defaultValue);
63 
64  CertMap_ = theDbe->book2D( "CertificationSummaryMap","RPC Certification Summary Map",15, -7.5, 7.5, 12, 0.5 ,12.5);
65 
66  //customize the 2d histo
67  std::stringstream BinLabel;
68  for (int i= 1 ; i<13; i++){
69  BinLabel.str("");
70  BinLabel<<"Sec"<<i;
71  CertMap_->setBinLabel(i,BinLabel.str(),2);
72  }
73 
74  for(int i = -2 ; i <=2; i++){
75  BinLabel.str("");
76  BinLabel<<"Wheel"<<i;
77  CertMap_->setBinLabel(i+8,BinLabel.str(),1);
78  }
79 
80 
81  for(int i = 1; i<=numberOfDisks_; i++){
82  BinLabel.str("");
83  BinLabel<<"Disk"<<i;
84  CertMap_->setBinLabel((i+11),BinLabel.str(),1);
85  BinLabel.str("");
86  BinLabel<<"Disk"<<-i;
87  CertMap_->setBinLabel((-i+5),BinLabel.str(),1);
88  }
89  //fill the histo with "1" --- just for the moment
90  for(int i=1; i<=15; i++){
91  for (int j=1; j<=12; j++ ){
92  if(i==5 || i==11 || (j>6 && (i<6 || i>10)))
93  CertMap_->setBinContent(i,j,-1);//bins that not correspond to subdetector parts
94  else
95  CertMap_->setBinContent(i,j,defaultValue);
96  }
97  }
98 
99 
100  if(numberOfDisks_ < 4){
101  for (int j=1; j<=12; j++ ){
102  CertMap_->setBinContent(1,j,-1);//bins that not correspond to subdetector parts
103  CertMap_->setBinContent(15,j,-1);
104  }
105  }
106  // book the ME
107  theDbe->setCurrentFolder("RPC/EventInfo/CertificationContents");
108 
109  int limit = numberOfDisks_;
110  if(numberOfDisks_ < 2) limit = 2;
111 
112 
113  for (int i = -1 * limit; i<= limit;i++ ){//loop on wheels and disks
114  if (i>-3 && i<3){//wheels
115  std::stringstream streams;
116  streams << "RPC_Wheel" << i;
117  certWheelFractions[i+2] = theDbe->bookFloat(streams.str());
118  certWheelFractions[i+2]->Fill(defaultValue);
119  }
120 
121  if (i == 0 || i > numberOfDisks_ || i< (-1 * numberOfDisks_))continue;
122 
123  int offset = numberOfDisks_;
124  if (i>0) offset --; //used to skip case equale to zero
125  std::stringstream streams;
126  streams << "RPC_Disk" << i;
127  certDiskFractions[i+2] = theDbe->bookFloat(streams.str());
128  certDiskFractions[i+2]->Fill(defaultValue);
129  }
130 }
131 
133 
134 
136 
137 
139 
140 
141 
143 
144 
145 
146 
147 
T getUntrackedParameter(std::string const &, T const &) const
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 * certWheelFractions[5]
tuple lumi
Definition: fjr2json.py:35
virtual void beginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
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 * 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 * CertMap_
MonitorElement * totalCertFraction
std::pair< int, int > FEDRange_
RPCDataCertification(const edm::ParameterSet &pset)
Constructor.
int j
Definition: DBlmapReader.cc:9
double f[11][100]
unsigned int offset(bool)
MonitorElement * certDiskFractions[10]
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)
virtual ~RPCDataCertification()
Destructor.
virtual void endLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
const T & get() const
Definition: EventSetup.h:55
virtual void beginRun(const edm::Run &r, const edm::EventSetup &setup)
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
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