CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
RPCEfficiencyShiftHisto Class Reference

#include <RPCEfficiencyShiftHisto.h>

Inheritance diagram for RPCEfficiencyShiftHisto:
edm::EDAnalyzer

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
 RPCEfficiencyShiftHisto (const edm::ParameterSet &iConfig)
 Constructor. More...
 
virtual ~RPCEfficiencyShiftHisto ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Public Attributes

MonitorElementEffBarrelRoll
 
MonitorElementEffEndcapMinusRoll
 
MonitorElementEffEndcapPlusRoll
 
MonitorElementRollPercentage
 

Private Attributes

DQMStoredbe_
 
int effCut_
 
std::string globalFolder_
 
std::string NameFile
 
int numberOfDisks_
 
bool SaveFile
 

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 31 of file RPCEfficiencyShiftHisto.h.

Constructor & Destructor Documentation

RPCEfficiencyShiftHisto::RPCEfficiencyShiftHisto ( const edm::ParameterSet iConfig)

Constructor.

Definition at line 25 of file RPCEfficiencyShiftHisto.cc.

References effCut_, edm::ParameterSet::getUntrackedParameter(), globalFolder_, NameFile, numberOfDisks_, and SaveFile.

25  {
26 
27  globalFolder_ = ps.getUntrackedParameter<std::string>("GlobalFolder", "RPC/RPCEfficiency/");
28  effCut_= ps.getUntrackedParameter<int>("EffCut", 90);
29  SaveFile = ps.getUntrackedParameter<bool>("SaveFile", false);
30  NameFile = ps.getUntrackedParameter<std::string>("NameFile","RPCEfficiency.root");
31  numberOfDisks_ = ps.getUntrackedParameter<int>("NumberOfEndcapDisks", 3);
32 }
RPCEfficiencyShiftHisto::~RPCEfficiencyShiftHisto ( )
virtual

Destructor.

Definition at line 35 of file RPCEfficiencyShiftHisto.cc.

35 { }

Member Function Documentation

void RPCEfficiencyShiftHisto::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 37 of file RPCEfficiencyShiftHisto.cc.

37 {}
void RPCEfficiencyShiftHisto::beginJob ( void  )
virtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 39 of file RPCEfficiencyShiftHisto.cc.

References dbe_, and cppFunctionSkipper::operator.

void RPCEfficiencyShiftHisto::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 44 of file RPCEfficiencyShiftHisto.cc.

References DQMStore::book1D(), DQMStore::book2D(), dbe_, EffBarrelRoll, EffEndcapMinusRoll, EffEndcapPlusRoll, globalFolder_, RollPercentage, MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

44  {
45 
46  if(dbe_ == 0) return;
47 
49  EffBarrelRoll = dbe_->book1D("EffBarrelRoll", "Barrel Efficiency",101,-0.5, 100.5);
50  EffEndcapPlusRoll = dbe_->book1D("EffEndcapPlusRoll", "Endcap + Efficiency",101,-0.5, 100.5);
51  EffEndcapMinusRoll = dbe_->book1D("EffEndcapMinusRoll", "Endcap - Efficiency",101,-0.5, 100.5);
52  RollPercentage = dbe_->book2D("RollPercentage", "RollPercentage",1,0.,1.,3,0.,3.);
53 
54  RollPercentage->setBinLabel(1,"%",1);
55  RollPercentage->setBinLabel(1,"E+",2);
56  RollPercentage->setBinLabel(2,"B",2);
57  RollPercentage->setBinLabel(3,"E-",2);
58 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
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 * 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
void RPCEfficiencyShiftHisto::endRun ( const edm::Run r,
const edm::EventSetup c 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file RPCEfficiencyShiftHisto.cc.

References dbe_, EffBarrelRoll, effCut_, EffEndcapMinusRoll, EffEndcapPlusRoll, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), globalFolder_, NameFile, numberOfDisks_, RollPercentage, alignCSCRings::s, DQMStore::save(), SaveFile, MonitorElement::setBinContent(), w(), x, and detailsBasic3DVector::y.

60  {
61 
62  std::stringstream meName;
63  MonitorElement * myMe;
64 
65  meName.str("");
66  meName<<globalFolder_;
67 
68  //Barrel
69 
70  int entriesBarrel = 0;
71  int entriesBarrelBeyondEff = 0;
72  float percBarrel = 0;
73 
74  for(int w = -2 ; w<3; w++){
75 
76  meName.str("");
77  if(w <= 0) meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_"<<w;
78  else meName<<globalFolder_<<"Efficiency_Roll_vs_Sector_Wheel_+"<<w;
79 
80  myMe = dbe_->get(meName.str());
81 
82  if(myMe){
83  for(int s = 1; s <= myMe->getNbinsX(); s++){
84  for(int r = 1;r <= myMe->getNbinsY(); r++){
85 
86  double effBarrel = myMe->getBinContent(s,r);
87 
88  if(effBarrel >= 0){//5
89 
90  if (EffBarrelRoll) EffBarrelRoll->Fill(effBarrel);
91  entriesBarrel++;
92 
93  if(effBarrel >= effCut_) entriesBarrelBeyondEff++;
94  }
95  }
96  }
97  }
98  }
99 
100  if(entriesBarrel != 0){
101  percBarrel = 100*entriesBarrelBeyondEff/entriesBarrel;
102  if(RollPercentage)RollPercentage->setBinContent(1,2,percBarrel);}
103 
104 
105  //EndcapMinus
106 
107  int entriesEndcapMinus = 0;
108  int entriesEndcapMinusBeyondEff = 0;
109  float percEndcapMinus = 0;
110  int entriesEndcapPlus = 0;
111  int entriesEndcapPlusBeyondEff = 0;
112  float percEndcapPlus = 0;
113  for(int d = -numberOfDisks_ ; d <= numberOfDisks_; d++){
114 
115  if(d == 0) continue;
116 
117  meName.str("");
118  meName<<globalFolder_<<"Efficiency_Roll_vs_Segment_Disk_"<<d;
119  myMe = dbe_->get(meName.str());
120 
121 
122  if(myMe){
123 
124  for (int x = 1 ;x <= myMe->getNbinsX();x++){
125  for(int y = 1;y<=myMe->getNbinsY(); y++){
126 
127  double effEndcap = myMe->getBinContent(x,y);
128 
129  if(d<0 ){
130  entriesEndcapMinus++;
132  if(effEndcap >= effCut_) entriesEndcapMinusBeyondEff++;
133  }else {
134  entriesEndcapPlus++;
136  if(effEndcap >= effCut_) entriesEndcapPlusBeyondEff++;
137  }
138  }
139  }
140  }
141  }
142 
143 
144  if(entriesEndcapMinus != 0){
145  percEndcapMinus = 100*entriesEndcapMinusBeyondEff/entriesEndcapMinus;
146  if( RollPercentage) RollPercentage->setBinContent(1,3,percEndcapMinus);}
147 
148 
149  if(entriesEndcapPlus != 0){
150  percEndcapPlus = 100*entriesEndcapPlusBeyondEff/entriesEndcapPlus;
151  if(RollPercentage) RollPercentage->setBinContent(1,1,percEndcapPlus);
152  }
153 
154  if(SaveFile) dbe_->save(NameFile);
155 
156 }
void setBinContent(int binx, double content)
set content of bin (1-D)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
Definition: DDAxes.h:10
T w() const

Member Data Documentation

DQMStore* RPCEfficiencyShiftHisto::dbe_
private

Definition at line 65 of file RPCEfficiencyShiftHisto.h.

Referenced by beginJob(), beginRun(), and endRun().

MonitorElement* RPCEfficiencyShiftHisto::EffBarrelRoll

Definition at line 52 of file RPCEfficiencyShiftHisto.h.

Referenced by beginRun(), and endRun().

int RPCEfficiencyShiftHisto::effCut_
private

Definition at line 63 of file RPCEfficiencyShiftHisto.h.

Referenced by endRun(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapMinusRoll

Definition at line 54 of file RPCEfficiencyShiftHisto.h.

Referenced by beginRun(), and endRun().

MonitorElement* RPCEfficiencyShiftHisto::EffEndcapPlusRoll

Definition at line 53 of file RPCEfficiencyShiftHisto.h.

Referenced by beginRun(), and endRun().

std::string RPCEfficiencyShiftHisto::globalFolder_
private

Definition at line 67 of file RPCEfficiencyShiftHisto.h.

Referenced by beginRun(), endRun(), and RPCEfficiencyShiftHisto().

std::string RPCEfficiencyShiftHisto::NameFile
private

Definition at line 61 of file RPCEfficiencyShiftHisto.h.

Referenced by endRun(), and RPCEfficiencyShiftHisto().

int RPCEfficiencyShiftHisto::numberOfDisks_
private

Definition at line 62 of file RPCEfficiencyShiftHisto.h.

Referenced by endRun(), and RPCEfficiencyShiftHisto().

MonitorElement* RPCEfficiencyShiftHisto::RollPercentage

Definition at line 55 of file RPCEfficiencyShiftHisto.h.

Referenced by beginRun(), and endRun().

bool RPCEfficiencyShiftHisto::SaveFile
private

Definition at line 59 of file RPCEfficiencyShiftHisto.h.

Referenced by endRun(), and RPCEfficiencyShiftHisto().