CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelDcsInfo.cc
Go to the documentation of this file.
2 //#include "DataFormats/FEDRawData/interface/FEDNumbering.h"
6 
7 using namespace std;
8 using namespace edm;
10 
11 // DCSPixelRange_.first = ps.getUntrackedParameter<unsigned int>("MinimumPixelDcsChannel", 0);
12 // DCSPixelRange_.second = ps.getUntrackedParameter<unsigned int>("MaximumPixelDcsChannel", 39);
13 
14 // NumberOfDcsChannels_ =DCSPixelRange_.second - DCSPixelRange_.first +1;
15  NumberOfDcsChannels_ = 100;
16 }
17 
19 
20 void SiPixelDcsInfo::beginLuminosityBlock(const LuminosityBlock& lumiBlock, const EventSetup& iSetup){}
21 
22 
25  if(0 != iSetup.find( recordKey ) ) {
26  // cout<<"record key found"<<endl;
27  //get DCS channel information
28 // ESHandle<RunInfo> sumDCS;
29 // iSetup.get<RunInfoRcd>().get(sumDCS);
30 // vector<int> DcsChannelsInIds= sumDCS->m_dcs_in;
31 
32 /* int DcsCount=0;
33  int DcsCountBarrel=0;
34  int DcsCountEndcap=0;
35 */
36  //loop on all active DCS channels
37 /* for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
38  int fedID=FedsInIds[fedItr];
39  //make sure fed id is in allowed range
40  //cout<<fedID<<endl;
41  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second){
42  ++FedCount;
43  if(fedID>=0 && fedID<=31){
44  ++FedCountBarrel;
45  }else if(fedID>=32 && fedID<=39){
46  ++FedCountEndcap;
47  }
48  }
49  }
50 */
51  //Fill active dcs fraction ME's
52 // if(NumberOfFeds_>0){
53  //all Pixel:
54  Fraction_->Fill(1.);
55  //Barrel:
56  FractionBarrel_->Fill(1.);
57  //Endcap:
58  FractionEndcap_->Fill(1.);
59 /* }else{
60  Fraction_->Fill(-1);
61  FractionBarrel_->Fill(-1);
62  FractionEndcap_->Fill(-1);
63  }
64 
65  }else{
66  Fraction_->Fill(-1);
67  FractionBarrel_->Fill(-1);
68  FractionEndcap_->Fill(-1);
69 */
70  return;
71  }
72 }
73 
74 void SiPixelDcsInfo::endRun(const edm::Run& r, const edm::EventSetup& iSetup){
76  if(0 != iSetup.find( recordKey ) ) {
77  // cout<<"record key found"<<endl;
78  //get DCS channel information
79 // ESHandle<RunInfo> sumDCS;
80 // iSetup.get<RunInfoRcd>().get(sumDCS);
81 // vector<int> DcsChannelsInIds= sumDCS->m_dcs_in;
82 
83 /* int DcsCount=0;
84  int DcsCountBarrel=0;
85  int DcsCountEndcap=0;
86 */
87  //loop on all active DCS channels
88 /* for(unsigned int fedItr=0;fedItr<FedsInIds.size(); ++fedItr) {
89  int fedID=FedsInIds[fedItr];
90  //make sure fed id is in allowed range
91  //cout<<fedID<<endl;
92  if(fedID>=FEDRange_.first && fedID<=FEDRange_.second){
93  ++FedCount;
94  if(fedID>=0 && fedID<=31){
95  ++FedCountBarrel;
96  }else if(fedID>=32 && fedID<=39){
97  ++FedCountEndcap;
98  }
99  }
100  }
101 */
102  //Fill active dcs fraction ME's
103 // if(NumberOfFeds_>0){
104  //all Pixel:
105  Fraction_->Fill(1.);
106  //Barrel:
107  FractionBarrel_->Fill(1.);
108  //Endcap:
109  FractionEndcap_->Fill(1.);
110 /* }else{
111  Fraction_->Fill(-1);
112  FractionBarrel_->Fill(-1);
113  FractionEndcap_->Fill(-1);
114  }
115 
116  }else{
117  Fraction_->Fill(-1);
118  FractionBarrel_->Fill(-1);
119  FractionEndcap_->Fill(-1);
120 */
121  return;
122  }
123 }
124 
125 
127 
128  dbe_ = 0;
130 
131 
132  dbe_->setCurrentFolder("Pixel/EventInfo");
133  Fraction_= dbe_->bookFloat("DCSSummary");
134  dbe_->setCurrentFolder("Pixel/EventInfo/DCSContents");
135  FractionBarrel_= dbe_->bookFloat("PixelBarrelFraction");
136  FractionEndcap_= dbe_->bookFloat("PixelEndcapFraction");
137 }
138 
139 
141 
142 
143 
145 
virtual void beginJob()
virtual void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
SiPixelDcsInfo(const edm::ParameterSet &)
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:879
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
int iEvent
Definition: GenABIO.cc:230
virtual void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
virtual void endJob()
DQMStore * dbe_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
Definition: Run.h:41
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