42 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Constructor called!";
72 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Destructor called!";
88 vector<DTChamber*>::const_iterator ch_it = chambers.begin();
89 vector<DTChamber*>::const_iterator ch_end = chambers.end();
90 for (; ch_it != ch_end; ++ch_it) {
95 int modeTimeHisto = 0;
97 for(
int wheel = -2; wheel != 3; ++wheel) {
98 for(
int sector = 1; sector <= 12; ++sector) {
99 stringstream wheelstr; wheelstr << wheel;
100 stringstream sectorstr; sectorstr << sector;
101 string sectorHistoName =
"NSegmPerEvent_W" + wheelstr.str()
102 +
"_Sec" + sectorstr.str();
103 string sectorHistoTitle =
"# segm. W" + wheelstr.str() +
" Sect." + sectorstr.str();
106 "/Sector" + sectorstr.str());
122 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] endjob called!";
137 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run()
138 <<
" #Event: " <<
event.id().event();
140 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"[DTSegmentAnalysisTask] Analyze #Run: " <<
event.id().run()
141 <<
" #Event: " <<
event.id().event();
155 if(!all4DSegments.
isValid())
return;
158 DTRecSegment4DCollection::id_iterator chamberId;
159 for (chamberId = all4DSegments->id_begin();
160 chamberId != all4DSegments->id_end();
165 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Chamber: " << *chamberId <<
" has " << distance(range.first, range.second)
170 segment4D!=range.second;
174 bool segmNoisy =
false;
177 if((*segment4D).hasPhi()){
180 map<DTSuperLayerId,vector<DTRecHit1D> > hitsBySLMap;
181 for(vector<DTRecHit1D>::const_iterator
hit = phiHits.begin();
182 hit != phiHits.end(); ++
hit) {
186 bool isNoisy =
false;
187 bool isFEMasked =
false;
188 bool isTDCMasked =
false;
189 bool isTrigMask =
false;
192 statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
194 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"Wire: " << wireId <<
" is noisy, skipping!";
200 if((*segment4D).hasZed()) {
204 for(vector<DTRecHit1D>::const_iterator
hit = zHits.begin();
205 hit != zHits.end(); ++
hit) {
207 bool isNoisy =
false;
208 bool isFEMasked =
false;
209 bool isTDCMasked =
false;
210 bool isTrigMask =
false;
213 statusMap->cellStatus(wireId, isNoisy, isFEMasked, isTDCMasked, isTrigMask, isDead, isNohv);
215 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
"Wire: " << wireId <<
" is noisy, skipping!";
223 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask")<<
"skipping the segment: it contains noisy cells";
229 if((*segment4D).hasPhi())
230 nHits = (((*segment4D).phiSegment())->specificRecHits()).
size();
231 if((*segment4D).hasZed())
232 nHits = nHits + ((((*segment4D).zSegment())->specificRecHits()).
size());
234 double anglePhiSegm(0.);
235 if( (*segment4D).hasPhi() ) {
236 double xdir = (*segment4D).phiSegment()->localDirection().x();
237 double zdir = (*segment4D).phiSegment()->localDirection().z();
239 anglePhiSegm = atan(xdir/zdir)*180./
TMath::Pi();
241 if( fabs(anglePhiSegm) >
phiSegmCut )
continue;
244 if( fabs((*chamberId).wheel()) == 2 && (*chamberId).station() == 1 ) {
249 DTChamberId checkMB((*chamberId).wheel(),mb,(*chamberId).sector());
253 cksegment4D!=ckrange.second;
257 if((*cksegment4D).hasPhi())
258 nHits = (((*cksegment4D).phiSegment())->specificRecHits()).
size();
259 if((*cksegment4D).hasZed())
260 nHits = nHits + ((((*cksegment4D).zSegment())->specificRecHits()).
size());
262 if( nHits >=
nhitsCut ) segmOk=
true;
268 if( !segmOk )
continue;
273 (*segment4D).chi2()/(*segment4D).degreesOfFreedom());
284 edm::LogVerbatim (
"DTDQM|DTMonitorModule|DTSegmentAnalysisTask") <<
" Booking histos for chamber: " << chamberId;
288 stringstream wheel; wheel << chamberId.
wheel();
290 stringstream sector; sector << chamberId.
sector();
292 string chamberHistoName =
294 "_St" + station.str() +
295 "_Sec" + sector.str();
298 for(
int wh=-2; wh<=2; wh++){
299 stringstream wheel; wheel << wh;
301 string histoName =
"numberOfSegments_W" + wheel.str();
326 "/Sector" + sector.str() +
327 "/Station" + station.str());
330 vector<MonitorElement *>
histos;
331 histos.push_back(
theDbe->
book1D(
"h4DSegmNHits"+chamberHistoName,
332 "# of hits per segment",
335 histos.push_back(
theDbe->
book1D(
"h4DChi2"+chamberHistoName,
336 "4D Segment reduced Chi2",
347 int sector = chamberId.
sector();
348 if(chamberId.
sector()==13) {
350 }
else if(chamberId.
sector()==14) {
358 histos[0]->Fill(nHits);
360 histos[1]->Fill(chi2);
370 for(
int wheel = -2; wheel != 3; ++wheel) {
371 for(
int sector = 1; sector <= 12; ++sector) {
T getParameter(std::string const &) const
EventNumber_t event() const
void fillHistos(DTChamberId chamberId, int nHits, float chi2)
T getUntrackedParameter(std::string const &, T const &) const
void analyze(const edm::Event &event, const edm::EventSetup &setup)
std::pair< const_iterator, const_iterator > range
iterator range
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
DTTimeEvolutionHisto * hNevtPerLS
static char chambers[TOTALCHAMBERS][20]
std::map< int, MonitorElement * > summaryHistos
std::map< DTChamberId, std::vector< MonitorElement * > > histosPerCh
MonitorElement * bookFloat(const char *name)
Book float.
LuminosityBlockNumber_t luminosityBlock() const
edm::ESHandle< DTGeometry > dtGeom
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
Summary.
void beginRun(const edm::Run &, const edm::EventSetup &)
BeginRun.
void updateTimeSlot(int ls, int nEventsInLS)
virtual ~DTSegmentAnalysisTask()
Destructor.
MonitorElement * nEventMonitor
std::map< int, std::map< int, DTTimeEvolutionHisto * > > histoTimeEvol
int station() const
Return the station number.
edm::EDGetTokenT< DTRecSegment4DCollection > recHits4DToken_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
DTSegmentAnalysisTask(const edm::ParameterSet &pset)
Constructor.
void setCurrentFolder(const std::string &fullpath)
void bookHistos(DTChamberId chamberId)
std::string topHistoFolder