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

#include <DTDCSByLumiSummary.h>

Inheritance diagram for DTDCSByLumiSummary:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DTDCSByLumiSummary (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~DTDCSByLumiSummary ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

Private Attributes

std::map< int, std::vector
< float > > 
dcsFracPerLumi
 
MonitorElementglobalHVSummary
 
std::vector
< DTTimeEvolutionHisto * > 
hDCSFracTrend
 
DQMStoretheDQMStore
 
MonitorElementtotalDCSFraction
 
std::vector< MonitorElement * > totalDCSFractionWh
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

No description available.

Author
C. Battilana - CIEMAT
P. Bellan - INFN PD
A. Branca = INFN PD

Definition at line 24 of file DTDCSByLumiSummary.h.

Constructor & Destructor Documentation

DTDCSByLumiSummary::DTDCSByLumiSummary ( const edm::ParameterSet pset)

Constructor.

Definition at line 28 of file DTDCSByLumiSummary.cc.

28 {}
DTDCSByLumiSummary::~DTDCSByLumiSummary ( )
virtual

Destructor.

Definition at line 31 of file DTDCSByLumiSummary.cc.

31 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 199 of file DTDCSByLumiSummary.cc.

199  {
200 
201 }
void DTDCSByLumiSummary::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 34 of file DTDCSByLumiSummary.cc.

References cppFunctionSkipper::operator, and MonitorElement::setLumiFlag().

34  {
35 
37 
38  // book the ME
39  theDQMStore->setCurrentFolder("DT/EventInfo/DCSContents");
40 
41  totalDCSFraction = theDQMStore->bookFloat("DTDCSSummary");
42  totalDCSFraction->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
43 
44  globalHVSummary = theDQMStore->book2D("HVGlbSummary","HV Status Summary",1,1,13,5,-2,3);
45  globalHVSummary->setAxisTitle("Sectors",1);
46  globalHVSummary->setAxisTitle("Wheel",2);
47 
48  for(int wh=-2;wh<=2;wh++){
49 
50  stringstream wheel_str; wheel_str << wh;
51 
52  MonitorElement* FractionWh = theDQMStore->bookFloat("DT_Wheel"+wheel_str.str());
53  FractionWh->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
54 
55  totalDCSFractionWh.push_back(FractionWh);
56  }
57 
59 
60 }
MonitorElement * globalHVSummary
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:810
MonitorElement * totalDCSFraction
std::vector< MonitorElement * > totalDCSFractionWh
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
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:1001
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585
void DTDCSByLumiSummary::beginLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 63 of file DTDCSByLumiSummary.cc.

63  {
64 
65  // CB LumiFlag marked products are reset on LS boundaries
67 
68  for(int wh=-2;wh<=2;wh++){
69  totalDCSFractionWh[wh+2]->Reset();
70  }
71 
72 }
MonitorElement * totalDCSFraction
std::vector< MonitorElement * > totalDCSFractionWh
void Reset(void)
reset ME (ie. contents, errors, etc)
void DTDCSByLumiSummary::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 194 of file DTDCSByLumiSummary.cc.

194  {
195 
196 }
void DTDCSByLumiSummary::endLuminosityBlock ( const edm::LuminosityBlock lumi,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file DTDCSByLumiSummary.cc.

References MonitorElement::getBinContent(), edm::LuminosityBlockBase::id(), LogTrace, and edm::LuminosityBlockID::luminosityBlock().

75  {
76 
77  // Get the by lumi product plot from the task
78  int lumiNumber = lumi.id().luminosityBlock();
79 
80  bool null_pointer_histo(0);
81 
82  std::vector<float> wh_activeFrac;
83 
84  for(int wh=-2;wh<=2;wh++){
85 
86  stringstream wheel_str; wheel_str << wh;
87 
88  string hActiveUnitsPath = "DT/EventInfo/DCSContents/hActiveUnits"+wheel_str.str();
89  MonitorElement *hActiveUnits = theDQMStore->get(hActiveUnitsPath);
90 
91  if (hActiveUnits) {
92  float activeFrac = static_cast<float>(hActiveUnits->getBinContent(2)) / // CB 2nd bin is # of active channels
93  hActiveUnits->getBinContent(1); // first bin is overall number of channels
94 
95  if(activeFrac < 0.) activeFrac=-1;
96 
97  wh_activeFrac.push_back(activeFrac);
98 
99  // Fill by lumi Certification ME
100  totalDCSFraction->Fill(activeFrac);
101  totalDCSFractionWh[wh+2]->Fill(activeFrac);
102 
103  } else {
104  LogTrace("DTDQM|DTMonitorClient|DTDCSByLumiSummary")
105  << "[DTDCSByLumiSummary]: got null pointer retrieving histo at :"
106  << hActiveUnitsPath << " for lumi # " << lumiNumber
107  << "client operation not performed." << endl;
108 
109  null_pointer_histo=true;
110  }
111 
112  } // end loop on wheels
113 
114  if(!null_pointer_histo) dcsFracPerLumi[lumiNumber] = wh_activeFrac; // Fill map to be used to compute trend plots
115 
116 }
LuminosityBlockID id() const
void Fill(long long x)
MonitorElement * totalDCSFraction
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1624
#define LogTrace(id)
LuminosityBlockNumber_t luminosityBlock() const
double getBinContent(int binx) const
get content of bin (1-D)
std::map< int, std::vector< float > > dcsFracPerLumi
std::vector< MonitorElement * > totalDCSFractionWh
void DTDCSByLumiSummary::endRun ( const edm::Run run,
const edm::EventSetup setup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file DTDCSByLumiSummary.cc.

References alignCSCRings::r, and DTTimeEvolutionHisto::setTimeSlotValue().

119  {
120 
121 
122  // Book trend plots ME & loop on map to fill it with by lumi info
123  map<int,std::vector<float> >::const_iterator fracPerLumiIt = dcsFracPerLumi.begin();
124  map<int,std::vector<float> >::const_iterator fracPerLumiEnd = dcsFracPerLumi.end();
125 
126  int fLumi = dcsFracPerLumi.begin()->first;
127  int lLumi = dcsFracPerLumi.rbegin()->first;
128  theDQMStore->setCurrentFolder("DT/EventInfo/DCSContents");
129 
130  int nLumis = lLumi-fLumi + 1.;
131 
132  // trend plots
133  for(int wh=-2; wh<=2; wh++) {
134 
135  stringstream wheel_str; wheel_str << wh;
136 
137  DTTimeEvolutionHisto* trend;
138 
139  trend = new DTTimeEvolutionHisto(theDQMStore, "hDCSFracTrendWh" + wheel_str.str(), "Fraction of DT-HV ON Wh" + wheel_str.str(),
140  nLumis, fLumi, 1, false, 2);
141 
142  hDCSFracTrend.push_back(trend);
143 
144  }
145 
146  float goodLSperWh[5] = {0,0,0,0,0};
147  float badLSperWh[5] = {0,0,0,0,0};
148 
149  // fill trend plots and save infos for summaryPlot
150  for(;fracPerLumiIt!=fracPerLumiEnd;++fracPerLumiIt) {
151 
152  for(int wh=-2; wh<=2; wh++) {
153 
154  std::vector<float> activeFracPerWh;
155  activeFracPerWh = fracPerLumiIt->second;
156 
157  hDCSFracTrend[wh+2]->setTimeSlotValue(activeFracPerWh[wh+2],fracPerLumiIt->first);
158 
159  if( activeFracPerWh[wh+2] > 0 ) { // we do not count the lumi were the DTs are off (no real problem),
160  // even if this can happen in the middle of a run (real problem: to be fixed)
161  if( activeFracPerWh[wh+2] > 0.9 ) goodLSperWh[wh+2]++;
162  else {
163  badLSperWh[wh+2]++;
164  }
165  } else { // there is no HV value OR all channels OFF
166  if( activeFracPerWh[wh+2] < 0 ) badLSperWh[wh+2]=-1; // if there were no HV values, activeFrac returning -1
167  }
168 
169  }
170 
171  }
172 
173  // fill summaryPlot
174  for(int wh=-2; wh<=2; wh++) {
175 
176  if( goodLSperWh[wh+2] != 0 || badLSperWh[wh+2] == -1 ) {
177 
178  float r = badLSperWh[wh+2]/fabs(goodLSperWh[wh+2] + badLSperWh[wh+2]);
179  if( r > 0.5 ) globalHVSummary->Fill(1,wh,0);
180  else globalHVSummary->Fill(1,wh,1);
181  if( r == -1 ) globalHVSummary->Fill(1,wh,-1);
182 
183  } else {
184 
185  globalHVSummary->Fill(1,wh,0);
186 
187  }
188 
189  }
190 
191 }
std::vector< DTTimeEvolutionHisto * > hDCSFracTrend
MonitorElement * globalHVSummary
void Fill(long long x)
std::map< int, std::vector< float > > dcsFracPerLumi
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:585

Member Data Documentation

std::map<int, std::vector<float> > DTDCSByLumiSummary::dcsFracPerLumi
private

Definition at line 53 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::globalHVSummary
private

Definition at line 48 of file DTDCSByLumiSummary.h.

std::vector<DTTimeEvolutionHisto*> DTDCSByLumiSummary::hDCSFracTrend
private

Definition at line 50 of file DTDCSByLumiSummary.h.

DQMStore* DTDCSByLumiSummary::theDQMStore
private

Definition at line 45 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::totalDCSFraction
private

Definition at line 47 of file DTDCSByLumiSummary.h.

std::vector<MonitorElement*> DTDCSByLumiSummary::totalDCSFractionWh
private

Definition at line 51 of file DTDCSByLumiSummary.h.