92 muonX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonXBin, muonXMin, muonXMax);
101 muonY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonYBin, muonYMin, muonYMax);
110 muonZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonZBin, muonZMin, muonZMax);
118 histname =
"muonEta_";
119 muonEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonEtaBin, muonEtaMin, muonEtaMax);
127 histname =
"muonPhi_";
128 muonPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonPhiBin, muonPhiMin, muonPhiMax);
136 histname =
"muonD0_";
137 muonD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonD0Bin, muonD0Min, muonD0Max);
141 int muonCompatibleLayersBin =
conf_.
getParameter<
int> (
"muonCompatibleLayersBin");
142 double muonCompatibleLayersMin =
conf_.
getParameter<
double>(
"muonCompatibleLayersMin");
143 double muonCompatibleLayersMax =
conf_.
getParameter<
double>(
"muonCompatibleLayersMax");
145 histname =
"muonCompatibleLayers_";
146 muonCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonCompatibleLayersBin, muonCompatibleLayersMin, muonCompatibleLayersMax);
156 histname =
"trackX_";
157 trackX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackXBin, trackXMin, trackXMax);
165 histname =
"trackY_";
166 trackY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackYBin, trackYMin, trackYMax);
174 histname =
"trackZ_";
175 trackZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackZBin, trackZMin, trackZMax);
183 histname =
"trackEta_";
184 trackEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackEtaBin, trackEtaMin, trackEtaMax);
192 histname =
"trackPhi_";
193 trackPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackPhiBin, trackPhiMin, trackPhiMax);
201 histname =
"trackD0_";
202 trackD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackD0Bin, trackD0Min, trackD0Max);
206 int trackCompatibleLayersBin =
conf_.
getParameter<
int> (
"trackCompatibleLayersBin");
207 double trackCompatibleLayersMin =
conf_.
getParameter<
double>(
"trackCompatibleLayersMin");
208 double trackCompatibleLayersMax =
conf_.
getParameter<
double>(
"trackCompatibleLayersMax");
210 histname =
"trackCompatibleLayers_";
211 trackCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackCompatibleLayersBin, trackCompatibleLayersMin, trackCompatibleLayersMax);
221 histname =
"deltaX_";
222 deltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaXBin, deltaXMin, deltaXMax);
230 histname =
"deltaY_";
231 deltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaYBin, deltaYMin, deltaYMax);
239 histname =
"signDeltaX_";
240 signDeltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaXBin, signDeltaXMin, signDeltaXMax);
248 histname =
"signDeltaY_";
249 signDeltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaYBin, signDeltaYMin, signDeltaYMax);
293 double mudd0 = 0., mudphi = 0., muddsz = 0., mudeta = 0.;
296 if ( staTracks->size() == 2 )
298 for (
unsigned int bindex = 0; bindex < staTracks->size(); ++bindex )
302 mudd0+=(*staTracks)[bindex].d0();
303 mudphi+=(*staTracks)[bindex].phi();
304 muddsz+=(*staTracks)[bindex].dsz();
305 mudeta+=(*staTracks)[bindex].eta();}
307 mudd0-=(*staTracks)[bindex].d0();
308 mudphi-=(*staTracks)[bindex].phi();
309 muddsz-=(*staTracks)[bindex].dsz();
310 mudeta-=(*staTracks)[bindex].eta();}
312 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060)) isGoodMuon =
true;
323 if( (tkTracks->front()).normalizedChi2() < 5 &&
324 (tkTracks->front()).hitPattern().numberOfValidHits() > 8)
341 if(outputMEsInRootFile){
366 for(
unsigned int i =0;
i< staTracks->size();
i++){
387 double d0 = (*staTracks)[idxUpMuon].d0();
396 bool isInTrackerAcceptance =
false;
404 if(isInTrackerAcceptance && (*staTracks)[idxUpMuon].hitPattern().numberOfValidHits() > 28)
415 if(!tkTracks->empty())
421 reco::TrackCollection::const_iterator closestTrk = tkTracks->end();
423 for(reco::TrackCollection::const_iterator tkTrack = tkTracks->begin(); tkTrack != tkTracks->end(); ++tkTrack)
434 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
435 if (DR2<DR2min) { DR2min = DR2; closestTrk = tkTrack;}
436 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
504 double d0 = (*tkTracks)[0].d0();
512 if(!staTracks->empty()){
519 reco::TrackCollection::const_iterator closestTrk = staTracks->end();
521 for(reco::TrackCollection::const_iterator staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
534 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
535 if (DR2<DR2min) { DR2min = DR2; closestTrk = staTrack;}
536 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
633 delete theTmpPropagator;
652 for (
unsigned int k=0 ;
k < barrelTOBLayers.size() ;
k++ )
654 const DetLayer* firstLay = barrelTOBLayers[barrelTOBLayers.size() -1 -
k];
668 bool isUpMuon =
false;
669 bool firstdtep =
true;
674 if(firstdtep) layers++;
685 std::vector< const DetLayer*> firstCompatibleLayers;
686 firstCompatibleLayers.push_back(firstLay);
687 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(theTSOS, firstCompatibleLayers, isUpMuon );
692 if (!trackCompatibleLayers.empty() ){
693 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(startTSOS, trackCompatibleLayers, isUpMuon );
694 if (firstLay != nextLayer.second ){
695 firstLay = nextLayer.second;
696 startTSOS = nextLayer.first;
699 else firstLay=
nullptr;
703 if(nwhile > 100)
break;
706 delete theTmpPropagator;
709 delete theTmpPropagator;
730 std::vector<const DetLayer*>::const_iterator itl;
732 for (itl=trackCompatibleLayers.begin();itl!=trackCompatibleLayers.end();++itl) {
742 std::pair<TrajectoryStateOnSurface, const DetLayer* > blabla;
743 blabla.first = sTSOS;
744 blabla.second = &**itl;
745 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
#define DEFINE_FWK_MODULE(type)
LocalPoint localPosition() const
edm::ESHandle< GeometricSearchTracker > theTracker
Geom::Phi< T > phi() const
virtual void endJob(void)
reco::TransientTrack build(const reco::Track *p) const
GlobalPoint globalPosition() const
~TrackEfficiencyMonitor() override
std::vector< BarrelDetLayer const * > const & tobLayers() const
void testTrackerTracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks, const NavigationSchool &navigationSchool)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
LocalError positionError() const
TrajectoryStateOnSurface innermostMeasurementState() const
const math::XYZPoint & innerPosition() const
position of the innermost hit
static CylinderPointer build(const PositionType &pos, const RotationType &rot, Scalar radius, Bounds *bounds=0)
MonitorElement * muonCompatibleLayers
const SurfaceType & surface() const
FreeTrajectoryState const * freeState(bool withErrors=true) const
edm::ESHandle< MeasurementTracker > measurementTrackerHandle
MonitorElement * book1D(Args &&...args)
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
void setCurrentFolder(const std::string &fullpath)
std::pair< TrajectoryStateOnSurface, const DetLayer * > findNextLayer(TrajectoryStateOnSurface startTSOS, const std::vector< const DetLayer * > &trackCompatibleLayers, bool isUpMuon)
MonitorElement * signDeltaX
edm::ESHandle< TransientTrackBuilder > theTTrackBuilder
edm::InputTag theTKTracksLabel_
std::vector< const DetLayer * > nextLayers(const DetLayer &detLayer, Args &&...args) const
NavigationDirection.
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const DirectTrackerNavigation * theNavigation
void analyze(const edm::Event &, const edm::EventSetup &) override
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
bool trackerAcceptance(TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ)
int compatibleLayers(const NavigationSchool &navigationSchool, TrajectoryStateOnSurface theTSOS)
MonitorElement * signDeltaY
TrackEfficiencyMonitor(const edm::ParameterSet &)
TrajectoryStateOnSurface impactPointState() const
void showDirStructure(void) const
virtual void beginJob(void)
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