CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTOccupancyTest Class Reference

#include <DTOccupancyTest.h>

Inheritance diagram for DTOccupancyTest:
DQMEDHarvester edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTOccupancyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTOccupancyTest () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginRun (edm::Run const &run, edm::EventSetup const &context) override
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 Endjob. More...
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, ESInputTag const &tag)
 
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 Member Functions

void bookHistos (DQMStore::IBooker &, const int wheelId, std::string folder, std::string histoTag)
 book the summary histograms More...
 
int getIntegral (TH2F *histo, int, int, int, int, bool)
 
std::string getMEName (std::string histoTag, const DTChamberId &chId)
 Get the ME name. More...
 
int runOccupancyTest (TH2F *histo, const DTChamberId &chId, float &chamberPercentage)
 
std::string topFolder () const
 

Private Attributes

bool bookingdone
 
MonitorElementglbSummaryHisto
 
int lsCounter
 
std::set< DTLayerIdmonitoredLayers
 
edm::ESHandle< DTGeometrymuonGeom
 
std::string nameMonitoredHisto
 
int nChannelDead
 
int nChannelTotal
 
int nevents
 
int nMinEvts
 
int nMinEvtsPC
 
TNtuple * ntuple
 
int nZeroEvtsPC
 
TFile * rootFile
 
bool runOnAllHitsOccupancies
 
bool runOnInTimeOccupancies
 
bool runOnNoiseOccupancies
 
MonitorElementsummaryHisto
 
bool tpMode
 
std::map< int, MonitorElement * > wheelHistos
 
bool writeRootFile
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 39 of file DTOccupancyTest.h.

Constructor & Destructor Documentation

DTOccupancyTest::DTOccupancyTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file DTOccupancyTest.cc.

References edm::ParameterSet::getUntrackedParameter(), and indexGen::rootFile.

31  {
32  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << "[DTOccupancyTest]: Constructor";
33 
34  // Get the DQM service
35 
36  lsCounter = 0;
37 
38  writeRootFile = ps.getUntrackedParameter<bool>("writeRootFile", false);
39  if(writeRootFile) {
40  rootFile = new TFile("DTOccupancyTest.root","RECREATE");
41  ntuple = new TNtuple("OccupancyNtuple", "OccupancyNtuple", "ls:wh:st:se:lay1MeanCell:lay1RMS:lay2MeanCell:lay2RMS:lay3MeanCell:lay3RMS:lay4MeanCell:lay4RMS:lay5MeanCell:lay5RMS:lay6MeanCell:lay6RMS:lay7MeanCell:lay7RMS:lay8MeanCell:lay8RMS:lay9MeanCell:lay9RMS:lay10MeanCell:lay10RMS:lay11MeanCell:lay11RMS:lay12MeanCell:lay12RMS");
42  }
43 
44  // switch on the mode for running on test pulses (different top folder)
45  tpMode = ps.getUntrackedParameter<bool>("testPulseMode", false);
46 
47  runOnAllHitsOccupancies = ps.getUntrackedParameter<bool>("runOnAllHitsOccupancies", true);
48  runOnNoiseOccupancies = ps.getUntrackedParameter<bool>("runOnNoiseOccupancies", false);
49  runOnInTimeOccupancies = ps.getUntrackedParameter<bool>("runOnInTimeOccupancies", false);
50  nMinEvts = ps.getUntrackedParameter<int>("nEventsCert", 5000);
51  nMinEvtsPC = ps.getUntrackedParameter<int>("nEventsMinPC", 2200);
52  nZeroEvtsPC = ps.getUntrackedParameter<int>("nEventsZeroPC", 30);
53 
54  bookingdone = false;
55 
56  // Event counter
57  nevents = 0;
58 
59 }
T getUntrackedParameter(std::string const &, T const &) const
Definition: ntuple.py:1
bool runOnAllHitsOccupancies
DTOccupancyTest::~DTOccupancyTest ( )
override

Destructor.

Definition at line 61 of file DTOccupancyTest.cc.

61  {
62  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << " destructor called" << endl;
63 }

Member Function Documentation

void DTOccupancyTest::beginRun ( edm::Run const &  run,
edm::EventSetup const &  context 
)
overrideprotected

BeginRun.

Definition at line 66 of file DTOccupancyTest.cc.

References edm::EventSetup::get().

66  {
67 
68  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << "[DTOccupancyTest]: BeginRun";
69 
70  // Get the geometry
71  context.get<MuonGeometryRecord>().get(muonGeom);
72 
73 }
edm::ESHandle< DTGeometry > muonGeom
void DTOccupancyTest::bookHistos ( DQMStore::IBooker ,
const int  wheelId,
std::string  folder,
std::string  histoTag 
)
private

book the summary histograms

Definition at line 213 of file DTOccupancyTest.cc.

References DQMStore::IBooker::book2D(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), and makeMuonMisalignmentScenario::wheel.

214  {
215  // Set the current folder
216  stringstream wheel; wheel << wheelId;
217 
218  ibooker.setCurrentFolder(topFolder());
219 
220  // build the histo name
221  string histoName = histoTag + "_W" + wheel.str();
222 
223 
224  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") <<"[DTOccupancyTest]: booking wheel histo:"
225  << histoName
226  << " (tag "
227  << histoTag
228  << ") in: "
229  << topFolder() + "Wheel"+ wheel.str() + "/" + folder << endl;
230 
231  string histoTitle = "Occupancy summary WHEEL: "+wheel.str();
232  if(tpMode) {
233  histoTitle = "TP Occupancy summary WHEEL: "+wheel.str();
234  }
235 
236  wheelHistos[wheelId] = ibooker.book2D(histoName,histoTitle,12,1,13,4,1,5);
237  wheelHistos[wheelId]->setBinLabel(1,"MB1",2);
238  wheelHistos[wheelId]->setBinLabel(2,"MB2",2);
239  wheelHistos[wheelId]->setBinLabel(3,"MB3",2);
240  wheelHistos[wheelId]->setBinLabel(4,"MB4",2);
241  wheelHistos[wheelId]->setAxisTitle("sector",1);
242 }
std::map< int, MonitorElement * > wheelHistos
std::string topFolder() const
void DTOccupancyTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Endjob.

Implements DQMEDHarvester.

Definition at line 199 of file DTOccupancyTest.cc.

References indexGen::rootFile.

199  {
200 
201  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << "[DTOccupancyTest] endjob called!";
202  if(writeRootFile) {
203  rootFile->cd();
204  ntuple->Write();
205  rootFile->Close();
206  }
207 }
Definition: ntuple.py:1
void DTOccupancyTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 75 of file DTOccupancyTest.cc.

References DQMStore::IBooker::book2D(), bookHistos(), relativeConstraints::chamber, chambers, DQMStore::IGetter::get(), MonitorElement::getFloatValue(), MonitorElement::getTH2F(), trackerHits::histo, createfilelist::int, mps_fire::result, DTChamberId::sector(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), fftjetcommon_cfi::title, and DTChamberId::wheel().

76  {
77  if (!bookingdone) {
78 
79  // Book the summary histos
80  // - one summary per wheel
81  for(int wh = -2; wh <= 2; ++wh) { // loop over wheels
82  bookHistos(ibooker,wh, string("Occupancies"), "OccupancySummary");
83  }
84 
85  ibooker.setCurrentFolder(topFolder());
86  string title = "Occupancy Summary";
87  if(tpMode) {
88  title = "Test Pulse Occupancy Summary";
89  }
90  // - global summary with alarms
91  summaryHisto = ibooker.book2D("OccupancySummary",title.c_str(),12,1,13,5,-2,3);
92  summaryHisto->setAxisTitle("sector",1);
93  summaryHisto->setAxisTitle("wheel",2);
94 
95  // - global summary with percentages
96  glbSummaryHisto = ibooker.book2D("OccupancyGlbSummary",title.c_str(),12,1,13,5,-2,3);
97  glbSummaryHisto->setAxisTitle("sector",1);
98  glbSummaryHisto->setAxisTitle("wheel",2);
99 
100 
101  // assign the name of the input histogram
103  nameMonitoredHisto = "OccupancyAllHits_perCh";
104  } else if(runOnNoiseOccupancies) {
105  nameMonitoredHisto = "OccupancyNoise_perCh";
106  } else if(runOnInTimeOccupancies) {
107  nameMonitoredHisto = "OccupancyInTimeHits_perCh";
108  } else { // default is AllHits histo
109  nameMonitoredHisto = "OccupancyAllHits_perCh";
110  }
111 
112  }
113  bookingdone = true;
114 
115 
116  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest")
117  <<"[DTOccupancyTest]: End of LS transition, performing the DQM client operation";
118  lsCounter++;
119 
120 
121 
122  // Reset the global summary
123  summaryHisto->Reset();
125 
126  nChannelTotal = 0;
127  nChannelDead = 0;
128 
129  // Get all the DT chambers
130  vector<const DTChamber*> chambers = muonGeom->chambers();
131 
132  for(vector<const DTChamber*>::const_iterator chamber = chambers.begin();
133  chamber != chambers.end(); ++chamber) { // Loop over all chambers
134  DTChamberId chId = (*chamber)->id();
135 
136  MonitorElement * chamberOccupancyHisto = igetter.get(getMEName(nameMonitoredHisto, chId));
137 
138  // Run the tests on the plot for the various granularities
139  if(chamberOccupancyHisto != nullptr) {
140  // Get the 2D histo
141  TH2F* histo = chamberOccupancyHisto->getTH2F();
142  float chamberPercentage = 1.;
143  int result = runOccupancyTest(histo, chId, chamberPercentage);
144  int sector = chId.sector();
145 
146  if(sector == 13) {
147  sector = 4;
148  float resultSect4 = wheelHistos[chId.wheel()]->getBinContent(sector, chId.station());
149  if(resultSect4 > result) {
150  result = (int)resultSect4;
151  }
152  } else if(sector == 14) {
153  sector = 10;
154  float resultSect10 = wheelHistos[chId.wheel()]->getBinContent(sector, chId.station());
155  if(resultSect10 > result) {
156  result = (int)resultSect10;
157  }
158  }
159 
160  // the 2 MB4 of Sect 4 and 10 count as half a chamber
161  if((sector == 4 || sector == 10) && chId.station() == 4)
162  chamberPercentage = chamberPercentage/2.;
163 
164  wheelHistos[chId.wheel()]->setBinContent(sector, chId.station(),result);
165  if(result > summaryHisto->getBinContent(sector, chId.wheel()+3)) {
166  summaryHisto->setBinContent(sector, chId.wheel()+3, result);
167  }
168  glbSummaryHisto->Fill(sector, chId.wheel(), chamberPercentage*1./4.);
169  } else {
170  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << "[DTOccupancyTest] ME: "
171  << getMEName(nameMonitoredHisto, chId) << " not found!" << endl;
172  }
173 
174  }
175 
176  string nEvtsName = "DT/EventInfo/Counters/nProcessedEventsDigi";
177 
178  MonitorElement * meProcEvts = igetter.get(nEvtsName);
179 
180  if (meProcEvts) {
181  int nProcEvts = meProcEvts->getFloatValue();
182  glbSummaryHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
183  summaryHisto->setEntries(nProcEvts < nMinEvts ? 10. : nProcEvts);
184  } else {
187  LogVerbatim ("DTDQM|DTMonitorClient|DTOccupancyTest") << "[DTOccupancyTest] ME: "
188  << nEvtsName << " not found!" << endl;
189  }
190 
191  // Fill the global summary
192  // Check for entire sectors off and report them on the global summary
193  //FIXME: TODO
194 
195  if(writeRootFile) ntuple->AutoSave("SaveSelf");
196 
197 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:102
void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< int, MonitorElement * > wheelHistos
int runOccupancyTest(TH2F *histo, const DTChamberId &chId, float &chamberPercentage)
double getFloatValue() const
MonitorElement * summaryHisto
std::string nameMonitoredHisto
Definition: ntuple.py:1
void Fill(long long x)
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
void bookHistos(DQMStore::IBooker &, const int wheelId, std::string folder, std::string histoTag)
book the summary histograms
std::string getMEName(std::string histoTag, const DTChamberId &chId)
Get the ME name.
bool runOnAllHitsOccupancies
void setEntries(double nentries)
set # of entries
void Reset()
reset ME (ie. contents, errors, etc)
edm::ESHandle< DTGeometry > muonGeom
TH2F * getTH2F() const
MonitorElement * get(std::string const &path)
Definition: DQMStore.cc:303
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
double getBinContent(int binx) const
get content of bin (1-D)
int sector() const
Definition: DTChamberId.h:61
std::string topFolder() const
int station() const
Return the station number.
Definition: DTChamberId.h:51
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * glbSummaryHisto
int DTOccupancyTest::getIntegral ( TH2F *  histo,
int  firstBinX,
int  lastBinX,
int  firstBinY,
int  lastBinY,
bool  doall 
)
private

Definition at line 271 of file DTOccupancyTest.cc.

References mps_fire::i.

271  {
272 
273  int sum = 0;
274  for (Int_t i = firstBinX; i < lastBinX+1; i++) {
275  for (Int_t j = firstBinY; j < lastBinY+1; j++) {
276 
277  if (histo->GetBinContent(i,j) >0){
278  if (!doall) return 1;
279  sum += histo->GetBinContent(i,j);
280  }
281  }
282  }
283 
284  return sum;
285 }
string DTOccupancyTest::getMEName ( std::string  histoTag,
const DTChamberId chId 
)
private

Get the ME name.

Definition at line 246 of file DTOccupancyTest.cc.

References printsummarytable::folder, DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

246  {
247 
248  stringstream wheel; wheel << chId.wheel();
249  stringstream station; station << chId.station();
250  stringstream sector; sector << chId.sector();
251 
252 
253  string folderRoot = topFolder() + "Wheel" + wheel.str() +
254  "/Sector" + sector.str() +
255  "/Station" + station.str() + "/";
256 
257  string folder = "Occupancies/";
258 
259  // build the histo name
260  string histoName = histoTag
261  + "_W" + wheel.str()
262  + "_St" + station.str()
263  + "_Sec" + sector.str();
264 
265  string histoname = folderRoot + histoName;
266 
267  return histoname;
268 }
int sector() const
Definition: DTChamberId.h:61
std::string topFolder() const
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
int DTOccupancyTest::runOccupancyTest ( TH2F *  histo,
const DTChamberId chId,
float &  chamberPercentage 
)
private

Definition at line 297 of file DTOccupancyTest.cc.

References objects.autophobj::float, LogTrace, DTChamberId::sector(), and DTChamberId::station().

298  {
299  int nBinsX = histo->GetNbinsX();
300 
301  LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest") << "--- Occupancy test for chamber: " << chId << endl;
302 
303  int compDeadCell = 0;
304  int totCell = 0;
305  int totOccup = 0;
306 
307  for(int slay = 1; slay <= 3; ++slay) { // loop over SLs
308  int binYlow = ((slay-1)*4)+1;
309 
310  if(chId.station() == 4 && slay == 2) continue;
311  for(int lay = 1; lay <= 4; ++lay) { // loop over layers
312  DTLayerId layID(chId,slay,lay);
313  int firstWire = muonGeom->layer(layID)->specificTopology().firstChannel();
314  int nWires = muonGeom->layer(layID)->specificTopology().channels();
315  int binY = binYlow+(lay-1);
316  int totalDeadCells = 0;
317  int nDeadCellsInARow = 1;
318  int nDeadCellsInARowMax = 0;
319  int nCellsZeroCount = 0;
320  bool previousIsDead = false;
321 
322  int interDeadCells = 0;
323 
324  totCell += nWires;
325 
326  for(int cell = firstWire; cell != (nWires+firstWire); ++cell) { // loop over cells
327  double cellOccup = histo->GetBinContent(cell,binY);
328  LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest") << " cell occup: " << cellOccup;
329  totOccup += cellOccup;
330 
331  if(cellOccup == 0) {
332  nCellsZeroCount++;
333  totalDeadCells++;
334  if(previousIsDead) {
335  nDeadCellsInARow++;
336  }
337  else {
338  // if(interDeadCells > 3) {
339  if(nDeadCellsInARow > nDeadCellsInARowMax) nDeadCellsInARowMax = nDeadCellsInARow;
340  nDeadCellsInARow = 1;
341  // }
342  }
343  previousIsDead = true;
344  interDeadCells = 0;
345  LogTrace("DTDQM|DTMonitorClient|DTOccupancyTest") << " below reference" << endl;
346  } else {
347  previousIsDead = false;
348  interDeadCells++;
349  }
350  // // 3 cells not dead between a group of dead cells don't break the count
351  if(nDeadCellsInARow > nDeadCellsInARowMax) nDeadCellsInARowMax = nDeadCellsInARow;
352  }
353  compDeadCell += totalDeadCells;
354  if(nDeadCellsInARowMax >= 7.) {
355  histo->SetBinContent(nBinsX+1,binY,-1.);
356  }
357  }
358  }
359 
360 
361  nChannelTotal += totCell;
362  nChannelDead += compDeadCell;
363  chamberPercentage = 1.-(float(compDeadCell)/totCell);
364 
365  int min_occup = nZeroEvtsPC*20;
366  if (chId.station() == 3) min_occup = nZeroEvtsPC*3;
367  if (chId.station() == 2) min_occup = nZeroEvtsPC*8;
368  if ((chId.station() == 4) && (chId.sector() == 9)) min_occup = nZeroEvtsPC*3;
369  if ((chId.station() == 4) && (chId.sector() == 10)) min_occup = nZeroEvtsPC*3;
370  if ((chId.station() == 4) && (chId.sector() == 11)) min_occup = nZeroEvtsPC*3;
371  if ((chId.station() == 4) && (chId.sector() == 14)) min_occup = nZeroEvtsPC*3;
372 
373 
374  if (totOccup < min_occup) return 4;
375  if (totOccup < nMinEvtsPC) chamberPercentage = 1.;
376 
377  if (chamberPercentage < 0.2) return 4;
378  if (chamberPercentage < 0.5) return 3;
379  if (chamberPercentage < 0.75) return 2;
380  if (chamberPercentage < 0.9) return 1;
381 
382  return 0;
383 }
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
#define LogTrace(id)
edm::ESHandle< DTGeometry > muonGeom
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
int sector() const
Definition: DTChamberId.h:61
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:127
int station() const
Return the station number.
Definition: DTChamberId.h:51
string DTOccupancyTest::topFolder ( ) const
private

Definition at line 386 of file DTOccupancyTest.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

386  {
387  if(tpMode) return string("DT/10-TestPulses/");
388  return string("DT/01-Digi/");
389 }

Member Data Documentation

bool DTOccupancyTest::bookingdone
private

Definition at line 102 of file DTOccupancyTest.h.

MonitorElement* DTOccupancyTest::glbSummaryHisto
private

Definition at line 83 of file DTOccupancyTest.h.

int DTOccupancyTest::lsCounter
private

Definition at line 87 of file DTOccupancyTest.h.

std::set<DTLayerId> DTOccupancyTest::monitoredLayers
private

Definition at line 85 of file DTOccupancyTest.h.

edm::ESHandle<DTGeometry> DTOccupancyTest::muonGeom
private

Definition at line 78 of file DTOccupancyTest.h.

std::string DTOccupancyTest::nameMonitoredHisto
private

Definition at line 100 of file DTOccupancyTest.h.

int DTOccupancyTest::nChannelDead
private

Definition at line 105 of file DTOccupancyTest.h.

int DTOccupancyTest::nChannelTotal
private

Definition at line 104 of file DTOccupancyTest.h.

int DTOccupancyTest::nevents
private

Definition at line 76 of file DTOccupancyTest.h.

int DTOccupancyTest::nMinEvts
private

Definition at line 88 of file DTOccupancyTest.h.

int DTOccupancyTest::nMinEvtsPC
private

Definition at line 89 of file DTOccupancyTest.h.

TNtuple* DTOccupancyTest::ntuple
private

Definition at line 94 of file DTOccupancyTest.h.

int DTOccupancyTest::nZeroEvtsPC
private

Definition at line 90 of file DTOccupancyTest.h.

TFile* DTOccupancyTest::rootFile
private

Definition at line 93 of file DTOccupancyTest.h.

bool DTOccupancyTest::runOnAllHitsOccupancies
private

Definition at line 97 of file DTOccupancyTest.h.

bool DTOccupancyTest::runOnInTimeOccupancies
private

Definition at line 99 of file DTOccupancyTest.h.

bool DTOccupancyTest::runOnNoiseOccupancies
private

Definition at line 98 of file DTOccupancyTest.h.

MonitorElement* DTOccupancyTest::summaryHisto
private

Definition at line 82 of file DTOccupancyTest.h.

bool DTOccupancyTest::tpMode
private

Definition at line 95 of file DTOccupancyTest.h.

std::map< int, MonitorElement* > DTOccupancyTest::wheelHistos
private

Definition at line 81 of file DTOccupancyTest.h.

bool DTOccupancyTest::writeRootFile
private

Definition at line 92 of file DTOccupancyTest.h.