CMS 3D CMS Logo

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

#include <DTDCSByLumiSummary.h>

Inheritance diagram for DTDCSByLumiSummary:
DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTDCSByLumiSummary (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~DTDCSByLumiSummary ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void dqmEndJob (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup)
 
- 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)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

No description available.

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

threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my

Definition at line 29 of file DTDCSByLumiSummary.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 28 of file DTDCSByLumiSummary.cc.

28  {
29 
30  bookingdone = 0;
31 
32 }
DTDCSByLumiSummary::~DTDCSByLumiSummary ( )
virtual

Destructor.

Definition at line 35 of file DTDCSByLumiSummary.cc.

35 {}

Member Function Documentation

void DTDCSByLumiSummary::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 38 of file DTDCSByLumiSummary.cc.

38  {
39 
40 }
void DTDCSByLumiSummary::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Implements DQMEDHarvester.

Definition at line 129 of file DTDCSByLumiSummary.cc.

References alignCSCRings::r, DQMStore::IBooker::setCurrentFolder(), and DTTimeEvolutionHisto::setTimeSlotValue().

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

Reimplemented from DQMEDHarvester.

Definition at line 42 of file DTDCSByLumiSummary.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and MonitorElement::setLumiFlag().

43  {
44 
45  if (!bookingdone) {
46 
47 
48  ibooker.setCurrentFolder("DT/EventInfo/DCSContents");
49 
50  totalDCSFraction = ibooker.bookFloat("DTDCSSummary");
51  totalDCSFraction->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
52 
53  globalHVSummary = ibooker.book2D("HVGlbSummary","HV Status Summary",1,1,13,5,-2,3);
54  globalHVSummary->setAxisTitle("Sectors",1);
55  globalHVSummary->setAxisTitle("Wheel",2);
56 
57  for(int wh=-2;wh<=2;wh++){
58 
59  stringstream wheel_str; wheel_str << wh;
60 
61  MonitorElement* FractionWh = ibooker.bookFloat("DT_Wheel"+wheel_str.str());
62  FractionWh->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
63 
64  totalDCSFractionWh.push_back(FractionWh);
65  }
66 
68 
69  // CB LumiFlag marked products are reset on LS boundaries
71 
72  for(int wh=-2;wh<=2;wh++){
73  totalDCSFractionWh[wh+2]->Reset();
74  }
75 
76  }
77  bookingdone = 1;
78 
79  // Get the by lumi product plot from the task
80  int lumiNumber = lumi.id().luminosityBlock();
81 
82  bool null_pointer_histo(0);
83 
84  std::vector<float> wh_activeFrac;
85 
86  for(int wh=-2;wh<=2;wh++){
87 
88  stringstream wheel_str; wheel_str << wh;
89 
90  string hActiveUnitsPath = "DT/EventInfo/DCSContents/hActiveUnits"+wheel_str.str();
91 
92  MonitorElement *hActiveUnits = igetter.get(hActiveUnitsPath);
93 
94  if (hActiveUnits) {
95  float activeFrac = static_cast<float>(hActiveUnits->getBinContent(2)) / // CB 2nd bin is # of active channels
96  hActiveUnits->getBinContent(1); // first bin is overall number of channels
97 
98  if(activeFrac < 0.) activeFrac=-1;
99 
100  wh_activeFrac.push_back(activeFrac);
101 
102  // Fill by lumi Certification ME
103  totalDCSFraction->Fill(activeFrac);
104  totalDCSFractionWh[wh+2]->Fill(activeFrac);
105 
106  } else {
107  LogTrace("DTDQM|DTMonitorClient|DTDCSByLumiSummary")
108  << "[DTDCSByLumiSummary]: got null pointer retrieving histo at :"
109  << hActiveUnitsPath << " for lumi # " << lumiNumber
110  << "client operation not performed." << endl;
111 
112  null_pointer_histo=true;
113  }
114 
115  } // end loop on wheels
116 
117  if(!null_pointer_histo) dcsFracPerLumi[lumiNumber] = wh_activeFrac; // Fill map to be used to compute trend plots
118 
119 
120  // CB LumiFlag marked products are reset on LS boundaries
122 
123  for(int wh=-2;wh<=2;wh++){
124  totalDCSFractionWh[wh+2]->Reset();
125  }
126 
127 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:304
tuple lumi
Definition: fjr2json.py:35
MonitorElement * globalHVSummary
void Fill(long long x)
MonitorElement * totalDCSFraction
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
std::map< int, std::vector< float > > dcsFracPerLumi
std::vector< MonitorElement * > totalDCSFractionWh
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
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)

Member Data Documentation

bool DTDCSByLumiSummary::bookingdone
private

Definition at line 59 of file DTDCSByLumiSummary.h.

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

Definition at line 57 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::globalHVSummary
private

Definition at line 52 of file DTDCSByLumiSummary.h.

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

Definition at line 54 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::totalDCSFraction
private

Definition at line 51 of file DTDCSByLumiSummary.h.

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

Definition at line 55 of file DTDCSByLumiSummary.h.