64 LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
65 <<
"DTChamberEfficiency: constructor called";
69 theDbe->setCurrentFolder(
"DT/05-ChamberEff/Task");
87 labelRPCRecHits,
true,
false,
false);
89 theNavigationType = pSet.
getParameter<
string>(
"NavigationType");
97 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
98 <<
"DTChamberEfficiency: destructor called";
102 delete theMeasurementExtractor;
108 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
109 <<
"DTChamberEfficiency: beginOfJob";
129 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
130 <<
"DTChamberEfficiency: endOfJob";
138 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
139 <<
"DTChamberEfficiency: booking histos";
142 theDbe->setCurrentFolder(
"DT/05-ChamberEff/Task");
144 for(
int wheel=-2;wheel<=2;wheel++){
146 vector<MonitorElement *>
histos;
148 stringstream wheel_str; wheel_str << wheel;
150 histos.push_back(theDbe->book2D(
"hCountSectVsChamb_All_W"+ wheel_str.str(),
151 "Countings for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
153 histos.push_back(theDbe->book2D(
"hCountSectVsChamb_Qual_W"+ wheel_str.str(),
154 "Countings for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
157 histos.push_back(theDbe->book2D(
"hExtrapSectVsChamb_W"+ wheel_str.str(),
158 "Extrapolations for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
160 histosPerW.push_back(histos);
170 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
171 "--- [DTChamberEfficiency] Event analysed #Run: " <<
172 event.id().run() <<
" #Event: " <<
event.id().event() << endl;
174 theService->update(eventSetup);
175 theMeasurementExtractor->setEvent(event);
179 event.getByLabel(theTracksLabel, tracks);
184 for(reco::TrackCollection::const_iterator
track = tracks->begin();
track!=tracks->end(); ++
track) {
188 const int recHitsize = (int)trans_track.
recHitsSize();
193 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"--- New track" << endl;
194 set<DTChamberId> chAlrUsed;
196 rHit != trans_track.recHitsEnd(); ++rHit) {
197 DetId rHitid = (*rHit)->geographicalId();
200 if(chAlrUsed.find(wId) != chAlrUsed.end())
continue;
201 chAlrUsed.insert(wId);
202 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" " << wId << endl;
207 DetId id = trans_track.track().innerDetId();
208 const DetLayer *initialLayer = theService->detLayerGeometry()->idToLayer(
id);
214 vector<const DetLayer*> layer_list = compatibleLayers(initialLayer,*init_fs_free,
alongMomentum);
215 vector<const DetLayer*> layer_list_2 = compatibleLayers(initialLayer,*init_fs_free,
oppositeToMomentum);
217 layer_list.insert(layer_list.end(),layer_list_2.begin(),layer_list_2.end());
219 set<DTChamberId> alreadyCheckedCh;
222 for(
int i=0;
i< (int)layer_list.size();
i++) {
229 vector<DetWithState> dss = layer_list.at(
i)->compatibleDets(tsos, *
propagator(), *theEstimator);
231 if(dss.size() == 0)
continue;
235 const DetId idDetLay = detWithState.first->geographicalId();
238 if(!chamberSelection(idDetLay,trans_track))
continue;
243 if(alreadyCheckedCh.find(DTid) != alreadyCheckedCh.end())
continue;
244 alreadyCheckedCh.insert(DTid);
247 MeasurementContainer detMeasurements_initial = theMeasurementExtractor->measurements(layer_list.at(
i),
250 *theEstimator,
event);
251 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" chamber: " << DTid
252 <<
" has: " << detMeasurements_initial.size() <<
" comp. meas." << endl;
260 vector<MonitorElement *>
histos = histosPerW[DTid.
wheel()+2];
262 if (detMeasurements_initial.size() != 0) histos[0]->Fill(DTid.
sector(),DTid.
station(),1.);
263 if (detMeasurements.size() != 0) histos[1]->Fill(DTid.
sector(),DTid.
station(),1.);
270 LogInfo(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"[DTChamberEfficiency] Collection: " << theTracksLabel
271 <<
" is not valid!" << endl;
282 if(trans_track.
recHit(0)->geographicalId() == idDetLay ||
283 trans_track.
recHit(1)->geographicalId() == idDetLay)
return false;
295 for(MeasurementContainer::const_iterator mescont_Itr = seg_list.begin();
296 mescont_Itr != seg_list.end(); ++mescont_Itr){
303 for(TransientTrackingRecHit::ConstRecHitContainer::const_iterator recList_Itr = recHit_list.begin();
304 recList_Itr != recHit_list.end(); ++recList_Itr){
306 nhit_seg += (int)(*recList_Itr)->transientHits().size();
311 if(tmpId.
station() < 4 && nhit_seg >= 12) result.push_back(*mescont_Itr);
312 if(tmpId.
station() == 4 && nhit_seg >= 8) result.push_back(*mescont_Itr);
322 vector<const DetLayer*> detLayers;
324 if(theNavigationType ==
"Standard"){
329 detLayers.insert(detLayers.begin(),initialLayer);
331 else if (theNavigationType ==
"Direct"){
337 LogError(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"No Properly Navigation Selected!!"<<endl;
343 return theService->propagator(
"SteppingHelixPropagatorAny");
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTChamberEfficiency(const edm::ParameterSet &pset)
size_t recHitsSize() const
number of RecHits
std::vector< const DetLayer * > compatibleLayers(const FreeTrajectoryState &fts, PropagationDirection timeDirection) const
uint32_t rawId() const
get the raw id
std::vector< const DetLayer * > compatibleLayers(const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
bool chamberSelection(const DetId &idDetLay, reco::TransientTrack &trans_track) const
edm::ESHandle< Propagator > propagator() const
FreeTrajectoryState * freeState(bool withErrors=true) const
TrackingRecHitRef recHit(size_t i) const
get n-th recHit
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
tuple Chi2MeasurementEstimator
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< ConstRecHitPointer > ConstRecHitContainer
MeasurementContainer segQualityCut(const MeasurementContainer seg_list) const
std::vector< TrajectoryMeasurement > MeasurementContainer
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
const Surface & surface() const
std::vector< const DetLayer * > compatibleLayers(NavigationDirection direction) const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
int station() const
Return the station number.
Detector det() const
get the detector field from this detid
int wheel() const
Return the wheel number.