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

#include <RPCDataCertification.h>

Inheritance diagram for RPCDataCertification:
edm::EDAnalyzer

Public Member Functions

 RPCDataCertification (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~RPCDataCertification ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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)
 
virtual void beginRun (const edm::Run &r, const edm::EventSetup &setup)
 
virtual void endJob ()
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
 

Private Attributes

MonitorElementcertDiskFractions [10]
 
MonitorElementCertMap_
 
MonitorElementcertWheelFractions [5]
 
std::pair< int, int > FEDRange_
 
int numberOfDisks_
 
int NumberOfFeds_
 
DQMStoretheDbe
 
MonitorElementtotalCertFraction
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 12 of file RPCDataCertification.h.

Constructor & Destructor Documentation

RPCDataCertification::RPCDataCertification ( const edm::ParameterSet pset)

Constructor.

Definition at line 15 of file RPCDataCertification.cc.

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

15  {
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 }
std::pair< int, int > FEDRange_
RPCDataCertification::~RPCDataCertification ( )
virtual

Destructor.

Definition at line 25 of file RPCDataCertification.cc.

25 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 142 of file RPCDataCertification.cc.

142 {}
void RPCDataCertification::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 28 of file RPCDataCertification.cc.

28 {}
void RPCDataCertification::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 132 of file RPCDataCertification.cc.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 31 of file RPCDataCertification.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), certDiskFractions, CertMap_, certWheelFractions, f, FEDRange_, MonitorElement::Fill(), edm::EventSetup::find(), edm::eventsetup::heterocontainer::HCTypeTag::findType(), 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 totalCertFraction.

31  {
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 }
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]
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_
int j
Definition: DBlmapReader.cc:9
double f[11][100]
unsigned int offset(bool)
MonitorElement * certDiskFractions[10]
const T & get() const
Definition: EventSetup.h:55
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 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
void RPCDataCertification::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 138 of file RPCDataCertification.cc.

138 {}
void RPCDataCertification::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file RPCDataCertification.cc.

135 {}

Member Data Documentation

MonitorElement* RPCDataCertification::certDiskFractions[10]
private

Definition at line 36 of file RPCDataCertification.h.

Referenced by beginRun().

MonitorElement* RPCDataCertification::CertMap_
private

Definition at line 33 of file RPCDataCertification.h.

Referenced by beginRun().

MonitorElement* RPCDataCertification::certWheelFractions[5]
private

Definition at line 35 of file RPCDataCertification.h.

Referenced by beginRun().

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

Definition at line 37 of file RPCDataCertification.h.

Referenced by beginRun(), and RPCDataCertification().

int RPCDataCertification::numberOfDisks_
private

Definition at line 38 of file RPCDataCertification.h.

Referenced by beginRun(), and RPCDataCertification().

int RPCDataCertification::NumberOfFeds_
private

Definition at line 39 of file RPCDataCertification.h.

Referenced by RPCDataCertification().

DQMStore* RPCDataCertification::theDbe
private

Definition at line 32 of file RPCDataCertification.h.

Referenced by beginRun().

MonitorElement* RPCDataCertification::totalCertFraction
private

Definition at line 34 of file RPCDataCertification.h.

Referenced by beginRun().