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 Attributes
DTSegmentsTask Class Reference

#include <DTSegmentsTask.h>

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

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 book the histos More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 DTSegmentsTask (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual ~DTSegmentsTask ()
 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
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 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
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

bool checkNoisyChannels
 
bool debug
 
edm::ParameterSet parameters
 
std::vector< MonitorElement * > phiHistos
 
edm::EDGetTokenT
< DTRecSegment4DCollection
theRecHits4DLabel_
 
std::vector< MonitorElement * > thetaHistos
 

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
 
- 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)
 
- Protected Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

DQM Analysis of 4D DT segments

Author
G. Mila - INFN Torino

Definition at line 26 of file DTSegmentsTask.h.

Constructor & Destructor Documentation

DTSegmentsTask::DTSegmentsTask ( const edm::ParameterSet pset)

Constructor.

Definition at line 28 of file DTSegmentsTask.cc.

References debug, edm::ParameterSet::getUntrackedParameter(), Parameters::parameters, and AlCaHLTBitMon_QueryRunRegistry::string.

28  {
29 
30  debug = pset.getUntrackedParameter<bool>("debug",false);
31  parameters = pset;
32 
33  // the name of the 4D rec hits collection
34  theRecHits4DLabel_ = consumes<DTRecSegment4DCollection>(parameters.getParameter<std::string>("recHits4DLabel"));
35 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DLabel_
edm::ParameterSet parameters
DTSegmentsTask::~DTSegmentsTask ( )
virtual

Destructor.

Definition at line 38 of file DTSegmentsTask.cc.

38  {
39 }

Member Function Documentation

void DTSegmentsTask::analyze ( const edm::Event event,
const edm::EventSetup setup 
)
virtual

book the histos

Implements edm::stream::EDAnalyzerBase.

Definition at line 106 of file DTSegmentsTask.cc.

References gather_cfg::cout, debug, edm::EventSetup::get(), findQualityFiles::size, DTRecSegment2D::specificRecHits(), and crabStatusFromReport::statusMap.

106  {
107 
108  // Get the map of noisy channels
109  // bool checkNoisyChannels = parameters.getUntrackedParameter<bool>("checkNoisyChannels",false);
111  if(checkNoisyChannels) {
112  setup.get<DTStatusFlagRcd>().get(statusMap);
113  }
114 
115  // Get the 4D segment collection from the event
117  event.getByToken(theRecHits4DLabel_, all4DSegments);
118 
119  // Loop over all chambers containing a segment
120  DTRecSegment4DCollection::id_iterator chamberId;
121  for (chamberId = all4DSegments->id_begin(); chamberId != all4DSegments->id_end(); ++chamberId){
122  // Get the range for the corresponding ChamerId
123  DTRecSegment4DCollection::range range = all4DSegments->get(*chamberId);
124  int nsegm = distance(range.first, range.second);
125  if(debug)
126  cout << " Chamber: " << *chamberId << " has " << nsegm
127  << " 4D segments" << endl;
128 
129  // Loop over the rechits of this ChamerId
130  for (DTRecSegment4DCollection::const_iterator segment4D = range.first; segment4D!=range.second; ++segment4D){
131 
132  //FOR NOISY CHANNELS////////////////////////////////
133  bool segmNoisy = false;
134  if((*segment4D).hasPhi()){
135  const DTChamberRecSegment2D* phiSeg = (*segment4D).phiSegment();
136  vector<DTRecHit1D> phiHits = phiSeg->specificRecHits();
137  map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
138  for(vector<DTRecHit1D>::const_iterator hit = phiHits.begin(); hit != phiHits.end(); ++hit) {
139  DTWireId wireId = (*hit).wireId();
140 
141  // Check for noisy channels to skip them
142  if(checkNoisyChannels) {
143  bool isNoisy = false;
144  bool isFEMasked = false;
145  bool isTDCMasked = false;
146  bool isTrigMask = false;
147  bool isDead = false;
148  bool isNohv = false;
149  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
150  if(isNoisy) {
151  if(debug)
152  cout << "Wire: " << wireId << " is noisy, skipping!" << endl;
153  segmNoisy = true;
154  }
155  }
156  }
157  }
158 
159  if((*segment4D).hasZed()) {
160  const DTSLRecSegment2D* zSeg = (*segment4D).zSegment(); // zSeg lives in the SL RF
161  // Check for noisy channels to skip them
162  vector<DTRecHit1D> zHits = zSeg->specificRecHits();
163  for(vector<DTRecHit1D>::const_iterator hit = zHits.begin();
164  hit != zHits.end(); ++hit) {
165  DTWireId wireId = (*hit).wireId();
166  if(checkNoisyChannels) {
167  bool isNoisy = false;
168  bool isFEMasked = false;
169  bool isTDCMasked = false;
170  bool isTrigMask = false;
171  bool isDead = false;
172  bool isNohv = false;
173  //cout<<"wire id "<<wireId<<endl;
174  statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
175  if(isNoisy) {
176  if(debug)
177  cout << "Wire: " << wireId << " is noisy, skipping!" << endl;
178  segmNoisy = true;
179  }
180  }
181  }
182  }
183 
184  if (segmNoisy) {
185  if(debug)
186  cout<<"skipping the segment: it contains noisy cells"<<endl;
187  continue;
188  }
189  //END FOR NOISY CHANNELS////////////////////////////////
190 
191  // Fill the histos
192  int nHits=0;
193  if((*segment4D).hasPhi()){
194  nHits = (((*segment4D).phiSegment())->specificRecHits()).size();
195  if(debug)
196  cout<<"Phi segment with number of hits: "<<nHits<<endl;
197  phiHistos[0]->Fill((*chamberId).wheel(), nHits);
198  phiHistos[1]->Fill((*chamberId).sector(), nHits);
199  phiHistos[2]->Fill((*chamberId).station(), nHits);
200  }
201  if((*segment4D).hasZed()) {
202  nHits = (((*segment4D).zSegment())->specificRecHits()).size();
203  if(debug)
204  cout<<"Zed segment with number of hits: "<<nHits<<endl;
205  thetaHistos[0]->Fill((*chamberId).wheel(), nHits);
206  thetaHistos[1]->Fill((*chamberId).sector(), nHits);
207  thetaHistos[2]->Fill((*chamberId).station(), nHits);
208  }
209 
210  } //loop over segments
211  } // loop over chambers
212 }
std::pair< const_iterator, const_iterator > range
iterator range
Definition: RangeMap.h:50
edm::EDGetTokenT< DTRecSegment4DCollection > theRecHits4DLabel_
std::vector< MonitorElement * > thetaHistos
std::vector< MonitorElement * > phiHistos
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
tuple size
Write out results.
void DTSegmentsTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 41 of file DTSegmentsTask.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::cd(), and DQMStore::IBooker::setCurrentFolder().

43  {
44 
45  ibooker.cd();
46  ibooker.setCurrentFolder("Muons/DTSegmentsMonitor");
47 
48  // histos for phi segments
49  phiHistos.push_back(ibooker.book2D("phiSegments_numHitsVsWheel", "phiSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
50  phiHistos[0]->setBinLabel(1,"W-2",1);
51  phiHistos[0]->setBinLabel(2,"W-1",1);
52  phiHistos[0]->setBinLabel(3,"W0",1);
53  phiHistos[0]->setBinLabel(4,"W1",1);
54  phiHistos[0]->setBinLabel(5,"W2",1);
55  phiHistos.push_back(ibooker.book2D("phiSegments_numHitsVsSector", "phiSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
56  phiHistos[1]->setBinLabel(1,"Sec1",1);
57  phiHistos[1]->setBinLabel(2,"Sec2",1);
58  phiHistos[1]->setBinLabel(3,"Sec3",1);
59  phiHistos[1]->setBinLabel(4,"Sec4",1);
60  phiHistos[1]->setBinLabel(5,"Sec5",1);
61  phiHistos[1]->setBinLabel(6,"Sec6",1);
62  phiHistos[1]->setBinLabel(7,"Sec7",1);
63  phiHistos[1]->setBinLabel(8,"Sec8",1);
64  phiHistos[1]->setBinLabel(9,"Sec9",1);
65  phiHistos[1]->setBinLabel(10,"Sec10",1);
66  phiHistos[1]->setBinLabel(11,"Sec11",1);
67  phiHistos[1]->setBinLabel(12,"Sec12",1);
68  phiHistos[1]->setBinLabel(13,"Sec13",1);
69  phiHistos[1]->setBinLabel(14,"Sec14",1);
70  phiHistos.push_back(ibooker.book2D("phiSegments_numHitsVsStation", "phiSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
71  phiHistos[2]->setBinLabel(1,"St1",1);
72  phiHistos[2]->setBinLabel(2,"St2",1);
73  phiHistos[2]->setBinLabel(3,"St3",1);
74  phiHistos[2]->setBinLabel(4,"St4",1);
75 
76  // histos for theta segments
77  thetaHistos.push_back(ibooker.book2D("thetaSegments_numHitsVsWheel", "thetaSegments_numHitsVsWheel", 5, -2.5, 2.5, 20, 0, 20));
78  thetaHistos[0]->setBinLabel(1,"W-2",1);
79  thetaHistos[0]->setBinLabel(2,"W-1",1);
80  thetaHistos[0]->setBinLabel(3,"W0",1);
81  thetaHistos[0]->setBinLabel(4,"W1",1);
82  thetaHistos[0]->setBinLabel(5,"W2",1);
83  thetaHistos.push_back(ibooker.book2D("thetaSegments_numHitsVsSector", "thetaSegments_numHitsVsSector", 14, 0.5, 14.5, 20, 0, 20));
84  thetaHistos[1]->setBinLabel(1,"Sec1",1);
85  thetaHistos[1]->setBinLabel(2,"Sec2",1);
86  thetaHistos[1]->setBinLabel(3,"Sec3",1);
87  thetaHistos[1]->setBinLabel(4,"Sec4",1);
88  thetaHistos[1]->setBinLabel(5,"Sec5",1);
89  thetaHistos[1]->setBinLabel(6,"Sec6",1);
90  thetaHistos[1]->setBinLabel(7,"Sec7",1);
91  thetaHistos[1]->setBinLabel(8,"Sec8",1);
92  thetaHistos[1]->setBinLabel(9,"Sec9",1);
93  thetaHistos[1]->setBinLabel(10,"Sec10",1);
94  thetaHistos[1]->setBinLabel(11,"Sec11",1);
95  thetaHistos[1]->setBinLabel(12,"Sec12",1);
96  thetaHistos[1]->setBinLabel(13,"Sec13",1);
97  thetaHistos[1]->setBinLabel(14,"Sec14",1);
98  thetaHistos.push_back(ibooker.book2D("thetaSegments_numHitsVsStation", "thetaSegments_numHitsVsStation", 4, 0.5, 4.5, 20, 0, 20));
99  thetaHistos[2]->setBinLabel(1,"St1",1);
100  thetaHistos[2]->setBinLabel(2,"St2",1);
101  thetaHistos[2]->setBinLabel(3,"St3",1);
102  thetaHistos[2]->setBinLabel(4,"St4",1);
103 
104 }
void cd(void)
Definition: DQMStore.cc:266
std::vector< MonitorElement * > thetaHistos
std::vector< MonitorElement * > phiHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133

Member Data Documentation

bool DTSegmentsTask::checkNoisyChannels
private

Definition at line 46 of file DTSegmentsTask.h.

bool DTSegmentsTask::debug
private
edm::ParameterSet DTSegmentsTask::parameters
private
std::vector<MonitorElement*> DTSegmentsTask::phiHistos
private

Definition at line 50 of file DTSegmentsTask.h.

edm::EDGetTokenT<DTRecSegment4DCollection> DTSegmentsTask::theRecHits4DLabel_
private

Definition at line 54 of file DTSegmentsTask.h.

std::vector<MonitorElement*> DTSegmentsTask::thetaHistos
private

Definition at line 51 of file DTSegmentsTask.h.