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:
edm::EDAnalyzer

Public Member Functions

 DTDCSByLumiTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTDCSByLumiTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 By Lumi DCS DB Operation. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 Begin Run. More...
 
void bookHistos ()
 Book Monitor Elements. More...
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &setup)
 By Lumi DCS DB Operation. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

std::string topFolder () const
 

Private Attributes

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

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)
 

Detailed Description

Definition at line 32 of file DTDCSByLumiTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 39 of file DTDCSByLumiTask.cc.

References LogTrace, cmsCodeRules.cppFunctionSkipper::operator, and theDQMStore.

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

Destructor.

Definition at line 51 of file DTDCSByLumiTask.cc.

References LogTrace, theEvents, and theLumis.

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

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 188 of file DTDCSByLumiTask.cc.

References theEvents.

188  {
189 
190  theEvents++;
191 
192 }
void DTDCSByLumiTask::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 68 of file DTDCSByLumiTask.cc.

References LogTrace.

68  {
69 
70  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
71  <<"[DTDCSByLumiTask]: BeginJob"<<endl;
72 
73 }
#define LogTrace(id)
void DTDCSByLumiTask::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

By Lumi DCS DB Operation.

Reimplemented from edm::EDAnalyzer.

Definition at line 102 of file DTDCSByLumiTask.cc.

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

102  {
103 
104  theLumis++;
105 
106  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
107  << "[DTDCSByLumiTask]: Begin of processed lumi # " << lumiSeg.id().luminosityBlock()
108  << " " << theLumis << " lumi processed by this job" << endl;
109 
110  for(int wheel=0; wheel <5; wheel++) {
111  hActiveUnits[wheel]->Reset(); // Cb by lumi histo need to be resetted in between lumi boundaries
112  }
113 
114 }
#define LogTrace(id)
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::beginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Begin Run.

Reimplemented from edm::EDAnalyzer.

Definition at line 75 of file DTDCSByLumiTask.cc.

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

75  {
76 
77  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
78  << "[DTDCSByLumiTask]: begin run" << endl;
79 
80  bookHistos();
81 
82  context.get<MuonGeometryRecord>().get(theDTGeom);
83 
84  DTHVRecordFound=true;
85 
87 
88  std::vector<eventsetup::EventSetupRecordKey> recordKeys;
89  context.fillAvailableRecordKeys(recordKeys);
90  vector<eventsetup::EventSetupRecordKey>::iterator it = find(recordKeys.begin(),recordKeys.end(),recordKey);
91 
92  if( it == recordKeys.end() ) {
93  //record not found
94  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")<<"Record DTHVStatusRcd does not exist "<<std::endl;
95 
96  DTHVRecordFound=false;
97  }
98 
99 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:51
void bookHistos()
Book Monitor Elements.
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:101
#define LogTrace(id)
const T & get() const
Definition: EventSetup.h:55
void DTDCSByLumiTask::bookHistos ( )
protected

Book Monitor Elements.

Definition at line 171 of file DTDCSByLumiTask.cc.

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

Referenced by beginRun().

171  {
172 
173  // Book bylumi histo (# of bins as reduced as possible)
175 
176  for(int wheel=-2; wheel <=2; wheel++) {
177 
178  stringstream wheel_str; wheel_str << wheel;
179 
180  MonitorElement* ME = theDQMStore->book1D("hActiveUnits"+wheel_str.str(),"Active Untis x LS Wh"+wheel_str.str(),2,0.5,2.5);
181  ME->setLumiFlag();// Set LumiFlag in order to save histo every LS
182 
183  hActiveUnits.push_back(ME);
184  }
185 
186 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:514
DQMStore * theDQMStore
Definition: ME.h:11
std::string topFolder() const
void setLumiFlag(void)
this ME is meant to be stored for each luminosity section
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:232
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 60 of file DTDCSByLumiTask.cc.

References LogTrace.

60  {
61 
62  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
63  <<"[DTDCSByLumiTask] endjob called!"<<endl;
64 
65 }
#define LogTrace(id)
void DTDCSByLumiTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
protectedvirtual

By Lumi DCS DB Operation.

Reimplemented from edm::EDAnalyzer.

Definition at line 117 of file DTDCSByLumiTask.cc.

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

117  {
118 
119 
120  if(DTHVRecordFound) context.get<DTHVStatusRcd>().get(hvStatus);
121 
122  vector<DTLayer*>::const_iterator layersIt = theDTGeom->layers().begin();
123  vector<DTLayer*>::const_iterator layersEnd = theDTGeom->layers().end();
124 
125  for(; layersIt!=layersEnd; ++layersIt) {
126 
127  int wheel = (*layersIt)->id().wheel();
128 
129  int nWiresLayer = (*layersIt)->specificTopology().channels();
130 
131  hActiveUnits[wheel+2]->Fill(1,nWiresLayer); // CB first bin is # of layers
132  int nActiveWires = nWiresLayer;
133 
134  int flagA = -100;
135  int flagC = -100;
136  int flagS = -100;
137  int first = -100;
138  int last = -100;
139 
140  // CB info is not stored if HV is ON -> in this case get returns 1
141  // process all other cases and removed wires with "BAD HV" from active
142  // wires list
143 
144  if( DTHVRecordFound ) {
145  if ( !hvStatus->get((*layersIt)->id(),0,first,last,flagA,flagC,flagS)
146  && (flagA || flagC || flagS) ) {
147  nActiveWires -= (last - first + 1);
148  }
149 
150  if ( !hvStatus->get((*layersIt)->id(),1,first,last,flagA,flagC,flagS)
151  && (flagA || flagC || flagS) ) {
152  nActiveWires -= (last - first + 1);
153  }
154  } else {
155  nActiveWires=-1.;
156  }
157 
158  hActiveUnits[wheel+2]->Fill(2,nActiveWires); // CB 2nd bin is the list of wires wit HV ON
159 
160  }
161 
162  /* LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
163  << "[DTDCSByLumiTask]: processed lumi # : " << lumiSeg.id().luminosityBlock()
164  << "\t# of wires " << hActiveUnits->getBinContent(1)
165  << "\t# of Active wires (anodes && cathodes && strips ON) : "
166  << hActiveUnits->getBinContent(2) << endl;
167  */
168 }
edm::ESHandle< DTHVStatus > hvStatus
edm::ESHandle< DTGeometry > theDTGeom
bool first
Definition: L1TdeRCT.cc:79
std::vector< MonitorElement * > hActiveUnits
string DTDCSByLumiTask::topFolder ( ) const
private

Definition at line 195 of file DTDCSByLumiTask.cc.

Referenced by bookHistos().

195  {
196 
197  return string("DT/EventInfo/DCSContents");
198 
199 }

Member Data Documentation

bool DTDCSByLumiTask::DTHVRecordFound
private

Definition at line 72 of file DTDCSByLumiTask.h.

Referenced by beginRun(), and endLuminosityBlock().

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

Definition at line 79 of file DTDCSByLumiTask.h.

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

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

Definition at line 77 of file DTDCSByLumiTask.h.

Referenced by endLuminosityBlock().

DQMStore* DTDCSByLumiTask::theDQMStore
private

Definition at line 74 of file DTDCSByLumiTask.h.

Referenced by bookHistos(), and DTDCSByLumiTask().

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

Definition at line 75 of file DTDCSByLumiTask.h.

Referenced by beginRun(), and endLuminosityBlock().

int DTDCSByLumiTask::theEvents
private

Definition at line 69 of file DTDCSByLumiTask.h.

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

int DTDCSByLumiTask::theLumis
private

Definition at line 70 of file DTDCSByLumiTask.h.

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