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 Member Functions | Private Attributes
DTDCSByLumiTask Class Reference

#include <DTDCSByLumiTask.h>

Inheritance diagram for DTDCSByLumiTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTDCSByLumiTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTDCSByLumiTask ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::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 analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 By Lumi DCS DB Operation. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 Begin Run. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup)
 By Lumi DCS DB Operation. 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 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

std::string topFolder () const
 

Private Attributes

bool DTHVRecordFound
 
std::vector< MonitorElement * > hActiveUnits
 
edm::ESHandle< DTHVStatushvStatus
 
edm::ESHandle< DTGeometrytheDTGeom
 
int theEvents
 
int theLumis
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 36 of file DTDCSByLumiTask.h.

Constructor & Destructor Documentation

DTDCSByLumiTask::DTDCSByLumiTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 37 of file DTDCSByLumiTask.cc.

References LogTrace.

37  : theEvents(0) , theLumis(0) {
38 
39  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
40  << "[DTDCSByLumiTask]: Constructor" << endl;
41 
42  // If needed put getParameter here
43  // dtDCSByLumiLabel = ps.getParameter<InputTag>("dtDCSByLumiLabel");
44 
45 }
#define LogTrace(id)
DTDCSByLumiTask::~DTDCSByLumiTask ( )
virtual

Destructor.

Definition at line 48 of file DTDCSByLumiTask.cc.

References LogTrace, theEvents, and theLumis.

48  {
49 
50  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
51  << "DTDCSByLumiTask: processed " << theEvents <<
52  " events in " << theLumis << " lumi sections" << endl;
53 
54 }
#define LogTrace(id)

Member Function Documentation

void DTDCSByLumiTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 159 of file DTDCSByLumiTask.cc.

References theEvents.

159  {
160 
161  theEvents++;
162 
163 }
void DTDCSByLumiTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

By Lumi DCS DB Operation.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 97 of file DTDCSByLumiTask.cc.

References hActiveUnits, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), and theLumis.

97  {
98 
99  theLumis++;
100 
101  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
102  << "[DTDCSByLumiTask]: Begin of processed lumi # " << lumiSeg.id().luminosityBlock()
103  << " " << theLumis << " lumi processed by this job" << endl;
104 
105  for(int wheel=0; wheel <5; wheel++) {
106  hActiveUnits[wheel]->Reset(); // Cb by lumi histo need to be resetted in between lumi boundaries
107  }
108 
109 }
#define LogTrace(id)
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 81 of file DTDCSByLumiTask.cc.

References DQMStore::IBooker::book1D(), hActiveUnits, DQMStore::IBooker::setCurrentFolder(), MonitorElement::setLumiFlag(), and topFolder().

81  {
82 
83  // Book bylumi histo (# of bins as reduced as possible)
84  ibooker.setCurrentFolder(topFolder());
85 
86  for(int wheel=-2; wheel <=2; wheel++) {
87 
88  stringstream wheel_str; wheel_str << wheel;
89 
90  MonitorElement* ME = ibooker.book1D("hActiveUnits"+wheel_str.str(),"Active Untis x LS Wh"+wheel_str.str(),2,0.5,2.5);
91  ME->setLumiFlag();// Set LumiFlag in order to save histo every LS
92 
93  hActiveUnits.push_back(ME);
94  }
95 }
Definition: ME.h:11
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
std::string topFolder() const
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Begin Run.

Reimplemented from DQMEDAnalyzer.

Definition at line 56 of file DTDCSByLumiTask.cc.

References DTHVRecordFound, edm::EventSetup::fillAvailableRecordKeys(), spr::find(), edm::typelookup::findType(), edm::EventSetup::get(), LogTrace, and theDTGeom.

56  {
57 
58  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
59  << "[DTDCSByLumiTask]: begin run" << endl;
60 
61  context.get<MuonGeometryRecord>().get(theDTGeom);
62 
63  DTHVRecordFound=true;
64 
66 
67  std::vector<eventsetup::EventSetupRecordKey> recordKeys;
68  context.fillAvailableRecordKeys(recordKeys);
69  vector<eventsetup::EventSetupRecordKey>::iterator it = find(recordKeys.begin(),recordKeys.end(),recordKey);
70 
71  if( it == recordKeys.end() ) {
72  //record not found
73  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")<<"Record DTHVStatusRcd does not exist "<<std::endl;
74 
75  DTHVRecordFound=false;
76  }
77 
78 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:76
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::ESHandle< DTGeometry > theDTGeom
void fillAvailableRecordKeys(std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all available records ...
Definition: EventSetup.cc:102
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:56
void DTDCSByLumiTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
protectedvirtual

By Lumi DCS DB Operation.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 112 of file DTDCSByLumiTask.cc.

References DTHVRecordFound, plotBeamSpotDB::first, edm::EventSetup::get(), hActiveUnits, hvStatus, plotBeamSpotDB::last, and theDTGeom.

112  {
113 
114 
115  if(DTHVRecordFound) context.get<DTHVStatusRcd>().get(hvStatus);
116 
117  vector<const DTLayer*>::const_iterator layersIt = theDTGeom->layers().begin();
118  vector<const DTLayer*>::const_iterator layersEnd = theDTGeom->layers().end();
119 
120  for(; layersIt!=layersEnd; ++layersIt) {
121 
122  int wheel = (*layersIt)->id().wheel();
123 
124  int nWiresLayer = (*layersIt)->specificTopology().channels();
125 
126  hActiveUnits[wheel+2]->Fill(1,nWiresLayer); // CB first bin is # of layers
127  int nActiveWires = nWiresLayer;
128 
129  int flagA = -100;
130  int flagC = -100;
131  int flagS = -100;
132  int first = -100;
133  int last = -100;
134 
135  // CB info is not stored if HV is ON -> in this case get returns 1
136  // process all other cases and removed wires with "BAD HV" from active
137  // wires list
138 
139  if( DTHVRecordFound ) {
140  if ( !hvStatus->get((*layersIt)->id(),0,first,last,flagA,flagC,flagS)
141  && (flagA || flagC || flagS) ) {
142  nActiveWires -= (last - first + 1);
143  }
144 
145  if ( !hvStatus->get((*layersIt)->id(),1,first,last,flagA,flagC,flagS)
146  && (flagA || flagC || flagS) ) {
147  nActiveWires -= (last - first + 1);
148  }
149  } else {
150  nActiveWires=-1.;
151  }
152 
153  hActiveUnits[wheel+2]->Fill(2,nActiveWires); // CB 2nd bin is the list of wires wit HV ON
154 
155  }
156 }
edm::ESHandle< DTHVStatus > hvStatus
edm::ESHandle< DTGeometry > theDTGeom
std::vector< MonitorElement * > hActiveUnits
string DTDCSByLumiTask::topFolder ( ) const
private

Definition at line 166 of file DTDCSByLumiTask.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

166  {
167 
168  return string("DT/EventInfo/DCSContents");
169 
170 }

Member Data Documentation

bool DTDCSByLumiTask::DTHVRecordFound
private

Definition at line 70 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and endLuminosityBlock().

std::vector<MonitorElement*> DTDCSByLumiTask::hActiveUnits
private

Definition at line 76 of file DTDCSByLumiTask.h.

Referenced by beginLuminosityBlock(), bookHistograms(), and endLuminosityBlock().

edm::ESHandle<DTHVStatus> DTDCSByLumiTask::hvStatus
private

Definition at line 74 of file DTDCSByLumiTask.h.

Referenced by endLuminosityBlock().

edm::ESHandle<DTGeometry> DTDCSByLumiTask::theDTGeom
private

Definition at line 72 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and endLuminosityBlock().

int DTDCSByLumiTask::theEvents
private

Definition at line 67 of file DTDCSByLumiTask.h.

Referenced by analyze(), and ~DTDCSByLumiTask().

int DTDCSByLumiTask::theLumis
private

Definition at line 68 of file DTDCSByLumiTask.h.

Referenced by beginLuminosityBlock(), and ~DTDCSByLumiTask().