94 muonX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonXBin, muonXMin, muonXMax);
103 muonY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonYBin, muonYMin, muonYMax);
112 muonZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonZBin, muonZMin, muonZMax);
120 histname =
"muonEta_";
121 muonEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonEtaBin, muonEtaMin, muonEtaMax);
129 histname =
"muonPhi_";
130 muonPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonPhiBin, muonPhiMin, muonPhiMax);
138 histname =
"muonD0_";
139 muonD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonD0Bin, muonD0Min, muonD0Max);
143 int muonCompatibleLayersBin =
conf_.
getParameter<
int> (
"muonCompatibleLayersBin");
144 double muonCompatibleLayersMin =
conf_.
getParameter<
double>(
"muonCompatibleLayersMin");
145 double muonCompatibleLayersMax =
conf_.
getParameter<
double>(
"muonCompatibleLayersMax");
147 histname =
"muonCompatibleLayers_";
148 muonCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonCompatibleLayersBin, muonCompatibleLayersMin, muonCompatibleLayersMax);
158 histname =
"trackX_";
159 trackX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackXBin, trackXMin, trackXMax);
167 histname =
"trackY_";
168 trackY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackYBin, trackYMin, trackYMax);
176 histname =
"trackZ_";
177 trackZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackZBin, trackZMin, trackZMax);
185 histname =
"trackEta_";
186 trackEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackEtaBin, trackEtaMin, trackEtaMax);
194 histname =
"trackPhi_";
195 trackPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackPhiBin, trackPhiMin, trackPhiMax);
203 histname =
"trackD0_";
204 trackD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackD0Bin, trackD0Min, trackD0Max);
208 int trackCompatibleLayersBin =
conf_.
getParameter<
int> (
"trackCompatibleLayersBin");
209 double trackCompatibleLayersMin =
conf_.
getParameter<
double>(
"trackCompatibleLayersMin");
210 double trackCompatibleLayersMax =
conf_.
getParameter<
double>(
"trackCompatibleLayersMax");
212 histname =
"trackCompatibleLayers_";
213 trackCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackCompatibleLayersBin, trackCompatibleLayersMin, trackCompatibleLayersMax);
223 histname =
"deltaX_";
224 deltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaXBin, deltaXMin, deltaXMax);
232 histname =
"deltaY_";
233 deltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaYBin, deltaYMin, deltaYMax);
241 histname =
"signDeltaX_";
242 signDeltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaXBin, signDeltaXMin, signDeltaXMax);
250 histname =
"signDeltaY_";
251 signDeltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaYBin, signDeltaYMin, signDeltaYMax);
255 histname =
"GlobalMuonPtEtaPhi_LowPt_";
260 histname =
"StandaloneMuonPtEtaPhi_LowPt_";
264 histname =
"GlobalMuonPtEtaPhi_HighPt_";
269 histname =
"StandaloneMuonPtEtaPhi_HighPt_";
314 if( (*muon).pt() < 5)
continue;
315 if( fabs((*muon).eta()) > 2.4)
continue;
316 if( (*muon).vertexNormalizedChi2() > 10)
continue;
317 if ( (*muon).isStandAloneMuon() and (*muon).isGlobalMuon()){
321 if ( (*muon).isStandAloneMuon()){
332 double mudd0 = 0., mudphi = 0., muddsz = 0., mudeta = 0.;
335 if ( staTracks->size() == 2 )
337 for (
unsigned int bindex = 0; bindex < staTracks->size(); ++bindex )
341 mudd0+=(*staTracks)[bindex].d0();
342 mudphi+=(*staTracks)[bindex].phi();
343 muddsz+=(*staTracks)[bindex].dsz();
344 mudeta+=(*staTracks)[bindex].eta();}
346 mudd0-=(*staTracks)[bindex].d0();
347 mudphi-=(*staTracks)[bindex].phi();
348 muddsz-=(*staTracks)[bindex].dsz();
349 mudeta-=(*staTracks)[bindex].eta();}
351 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060)) isGoodMuon =
true;
362 if( (tkTracks->front()).normalizedChi2() < 5 &&
363 (tkTracks->front()).hitPattern().numberOfValidHits() > 8)
380 if(outputMEsInRootFile){
404 for(
unsigned int i =0;
i< staTracks->size();
i++){
425 double d0 = (*staTracks)[idxUpMuon].d0();
434 bool isInTrackerAcceptance =
false;
442 if(isInTrackerAcceptance && (*staTracks)[idxUpMuon].hitPattern().numberOfValidHits() > 28)
453 if(!tkTracks->empty())
459 reco::TrackCollection::const_iterator closestTrk = tkTracks->end();
461 for(reco::TrackCollection::const_iterator tkTrack = tkTracks->begin(); tkTrack != tkTracks->end(); ++tkTrack)
472 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
473 if (DR2<DR2min) { DR2min = DR2; closestTrk = tkTrack;}
474 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
540 double d0 = (*tkTracks)[0].d0();
548 if(!staTracks->empty()){
555 reco::TrackCollection::const_iterator closestTrk = staTracks->end();
557 for(reco::TrackCollection::const_iterator staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
570 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
571 if (DR2<DR2min) { DR2min = DR2; closestTrk = staTrack;}
572 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
668 delete theTmpPropagator;
687 for (
unsigned int k=0 ;
k < barrelTOBLayers.size() ;
k++ )
689 const DetLayer* firstLay = barrelTOBLayers[barrelTOBLayers.size() -1 -
k];
703 bool isUpMuon =
false;
704 bool firstdtep =
true;
709 if(firstdtep) layers++;
720 std::vector< const DetLayer*> firstCompatibleLayers;
721 firstCompatibleLayers.push_back(firstLay);
722 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(theTSOS, firstCompatibleLayers, isUpMuon );
727 if (!trackCompatibleLayers.empty() ){
728 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(startTSOS, trackCompatibleLayers, isUpMuon );
729 if (firstLay != nextLayer.second ){
730 firstLay = nextLayer.second;
731 startTSOS = nextLayer.first;
734 else firstLay=
nullptr;
738 if(nwhile > 100)
break;
741 delete theTmpPropagator;
744 delete theTmpPropagator;
764 std::vector<const DetLayer*>::const_iterator itl;
766 for (itl=trackCompatibleLayers.begin();itl!=trackCompatibleLayers.end();++itl) {
776 std::pair<TrajectoryStateOnSurface, const DetLayer* > blabla;
777 blabla.first = sTSOS;
778 blabla.second = &**itl;
779 delete theTmpPropagator;
T getParameter(std::string const &) const
edm::ESHandle< MagneticField > bField
virtual void setPropagationDirection(PropagationDirection dir)
virtual Propagator * clone() const =0
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
LocalPoint localPosition() const
edm::ESHandle< GeometricSearchTracker > theTracker
Geom::Phi< T > phi() const
reco::TransientTrack build(const reco::Track *p) const
GlobalPoint globalPosition() const
~TrackEfficiencyMonitor() override
MonitorElement * GlobalMuonPtEtaPhiHighPt
std::vector< BarrelDetLayer const * > const & tobLayers() const
void endJob(void) override
void testTrackerTracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks, const NavigationSchool &navigationSchool)
MonitorElement * GlobalMuonPtEtaPhiLowPt
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
void beginJob(void) override
LocalError positionError() const
TrajectoryStateOnSurface innermostMeasurementState() const
const math::XYZPoint & innerPosition() const
position of the innermost hit
edm::EDGetTokenT< edm::View< reco::Muon > > muonToken_
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
MonitorElement * muonCompatibleLayers
const SurfaceType & surface() const
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
FreeTrajectoryState const * freeState(bool withErrors=true) const
edm::ESHandle< MeasurementTracker > measurementTrackerHandle
MonitorElement * book1D(Args &&...args)
MonitorElement * StandaloneMuonPtEtaPhiLowPt
MonitorElement * trackEta
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const LocalTrajectoryError & localError() const
TrajectoryStateOnSurface outermostMeasurementState() const
edm::InputTag theSTATracksLabel_
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
edm::EDGetTokenT< reco::TrackCollection > theTKTracksToken_
edm::ESHandle< Propagator > thePropagator
std::pair< TrajectoryStateOnSurface, const DetLayer * > findNextLayer(TrajectoryStateOnSurface startTSOS, const std::vector< const DetLayer * > &trackCompatibleLayers, bool isUpMuon)
MonitorElement * signDeltaX
edm::ESHandle< TransientTrackBuilder > theTTrackBuilder
MonitorElement * book2D(Args &&...args)
edm::InputTag theTKTracksLabel_
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
MonitorElement * StandaloneMuonPtEtaPhiHighPt
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const DirectTrackerNavigation * theNavigation
void save(std::string const &filename, std::string const &path="", std::string const &pattern="", std::string const &rewrite="", uint32_t run=0, uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, std::string const &fileupdate="RECREATE")
void analyze(const edm::Event &, const edm::EventSetup &) override
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
bool trackerAcceptance(TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ)
int compatibleLayers(const NavigationSchool &navigationSchool, TrajectoryStateOnSurface theTSOS)
MonitorElement * signDeltaY
TrackEfficiencyMonitor(const edm::ParameterSet &)
TrajectoryStateOnSurface impactPointState() const
MonitorElement * trackPhi
SemiCylinder checkSemiCylinder(const Track &)
MonitorElement * trackCompatibleLayers
const GeometricSearchTracker * geometricSearchTracker() const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Power< A, B >::type pow(const A &a, const B &b)
void testSTATracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks)
edm::EDGetTokenT< reco::TrackCollection > theSTATracksToken_
GlobalVector globalDirection() const