60 LogVerbatim(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
61 <<
"DTChamberEfficiency: constructor called";
65 theDbe->setCurrentFolder(
"DT/05-ChamberEff/Task");
72 theTracksToken_ = consumes<reco::TrackCollection>(theTracksLabel_);
74 theMaxChi2 =
static_cast<unsigned int>(pSet.
getParameter<
double>(
"theMaxChi2"));
76 theMinNrec =
static_cast<int>(pSet.
getParameter<
double>(
"theMinNrec"));
86 labelRPCRecHits,iC,
true,
false,
false);
88 theNavigationType = pSet.
getParameter<
string>(
"NavigationType");
96 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
97 <<
"DTChamberEfficiency: destructor called";
101 delete theMeasurementExtractor;
107 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
108 <<
"DTChamberEfficiency: beginOfJob";
128 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
129 <<
"DTChamberEfficiency: endOfJob";
137 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency")
138 <<
"DTChamberEfficiency: booking histos";
141 theDbe->setCurrentFolder(
"DT/05-ChamberEff/Task");
143 for(
int wheel=-2;wheel<=2;wheel++){
145 vector<MonitorElement *>
histos;
147 stringstream wheel_str; wheel_str << wheel;
149 histos.push_back(theDbe->book2D(
"hCountSectVsChamb_All_W"+ wheel_str.str(),
150 "Countings for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
152 histos.push_back(theDbe->book2D(
"hCountSectVsChamb_Qual_W"+ wheel_str.str(),
153 "Countings for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
156 histos.push_back(theDbe->book2D(
"hExtrapSectVsChamb_W"+ wheel_str.str(),
157 "Extrapolations for wheel " + wheel_str.str(),14,1.,15.,4,1.,5.));
159 histosPerW.push_back(histos);
169 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
170 "--- [DTChamberEfficiency] Event analysed #Run: " <<
171 event.id().run() <<
" #Event: " <<
event.id().event() << endl;
173 theService->update(eventSetup);
174 theMeasurementExtractor->setEvent(event);
178 event.getByToken(theTracksToken_, tracks);
183 for(reco::TrackCollection::const_iterator track = tracks->begin(); track!=tracks->end(); ++track) {
187 const int recHitsize = (int)trans_track.
recHitsSize();
188 if(recHitsize < theMinNrec)
continue;
192 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"--- New track" << endl;
193 set<DTChamberId> chAlrUsed;
195 rHit != trans_track.recHitsEnd(); ++rHit) {
196 DetId rHitid = (*rHit)->geographicalId();
199 if(chAlrUsed.find(wId) != chAlrUsed.end())
continue;
200 chAlrUsed.insert(wId);
201 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" " << wId << endl;
206 DetId id = trans_track.track().innerDetId();
207 const DetLayer *initialLayer = theService->detLayerGeometry()->idToLayer(
id);
213 vector<const DetLayer*> layer_list = compatibleLayers(*theService->muonNavigationSchool(), initialLayer,*init_fs_free,
alongMomentum);
214 vector<const DetLayer*> layer_list_2 = compatibleLayers(*theService->muonNavigationSchool(), initialLayer,*init_fs_free,
oppositeToMomentum);
216 layer_list.insert(layer_list.end(),layer_list_2.begin(),layer_list_2.end());
218 set<DTChamberId> alreadyCheckedCh;
221 for(
int i=0;
i< (int)layer_list.size();
i++) {
228 vector<DetWithState> dss = layer_list.at(
i)->compatibleDets(tsos, *propagator(), *theEstimator);
230 if(dss.size() == 0)
continue;
234 const DetId idDetLay = detWithState.first->geographicalId();
237 if(!chamberSelection(idDetLay,trans_track))
continue;
242 if(alreadyCheckedCh.find(DTid) != alreadyCheckedCh.end())
continue;
243 alreadyCheckedCh.insert(DTid);
246 MeasurementContainer detMeasurements_initial = theMeasurementExtractor->measurements(layer_list.at(
i),
249 *theEstimator,
event);
250 LogTrace(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
" chamber: " << DTid
251 <<
" has: " << detMeasurements_initial.size() <<
" comp. meas." << endl;
259 vector<MonitorElement *>
histos = histosPerW[DTid.
wheel()+2];
261 if (detMeasurements_initial.size() != 0) histos[0]->
Fill(DTid.
sector(),DTid.
station(),1.);
262 if (detMeasurements.size() != 0) histos[1]->
Fill(DTid.
sector(),DTid.
station(),1.);
269 LogInfo(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"[DTChamberEfficiency] Collection: " << theTracksLabel_
270 <<
" is not valid!" << endl;
281 if(trans_track.
recHit(0)->geographicalId() == idDetLay ||
282 trans_track.
recHit(1)->geographicalId() == idDetLay)
return false;
294 for(MeasurementContainer::const_iterator mescont_Itr = seg_list.begin();
295 mescont_Itr != seg_list.end(); ++mescont_Itr){
302 for(TransientTrackingRecHit::ConstRecHitContainer::const_iterator recList_Itr = recHit_list.begin();
303 recList_Itr != recHit_list.end(); ++recList_Itr){
305 nhit_seg += (int)(*recList_Itr)->transientHits().size();
310 if(tmpId.
station() < 4 && nhit_seg >= 12) result.push_back(*mescont_Itr);
311 if(tmpId.
station() == 4 && nhit_seg >= 8) result.push_back(*mescont_Itr);
321 vector<const DetLayer*> detLayers;
323 if(theNavigationType ==
"Standard"){
329 detLayers.insert(detLayers.begin(),initialLayer);
332 else if (theNavigationType ==
"Direct"){
338 LogError(
"DTDQM|DTMonitorModule|DTChamberEfficiency") <<
"No Properly Navigation Selected!!"<<endl;
344 return theService->propagator(
"SteppingHelixPropagatorAny");
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MeasurementContainer segQualityCut(const MeasurementContainer &seg_list) 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
const SurfaceType & surface() const
bool chamberSelection(const DetId &idDetLay, reco::TransientTrack &trans_track) const
edm::ESHandle< Propagator > propagator() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
FreeTrajectoryState const * freeState(bool withErrors=true) const
std::vector< const DetLayer * > compatibleLayers(const DetLayer &detLayer, Args &&...args) const
Returns all layers compatible.
TrackingRecHitRef recHit(size_t i) const
get n-th recHit
std::vector< const DetLayer * > compatibleLayers(const NavigationSchool &navigationSchool, const DetLayer *initialLayer, const FreeTrajectoryState &fts, PropagationDirection propDir)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
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) ...
std::vector< ConstRecHitPointer > ConstRecHitContainer
void beginRun(const edm::Run &, const edm::EventSetup &)
std::vector< TrajectoryMeasurement > MeasurementContainer
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup)
int station() const
Return the station number.
Detector det() const
get the detector field from this detid
int wheel() const
Return the wheel number.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection