93 muonX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonXBin, muonXMin, muonXMax);
102 muonY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonYBin, muonYMin, muonYMax);
111 muonZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonZBin, muonZMin, muonZMax);
119 histname =
"muonEta_";
120 muonEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonEtaBin, muonEtaMin, muonEtaMax);
128 histname =
"muonPhi_";
129 muonPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonPhiBin, muonPhiMin, muonPhiMax);
137 histname =
"muonD0_";
138 muonD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonD0Bin, muonD0Min, muonD0Max);
142 int muonCompatibleLayersBin =
conf_.
getParameter<
int> (
"muonCompatibleLayersBin");
143 double muonCompatibleLayersMin =
conf_.
getParameter<
double>(
"muonCompatibleLayersMin");
144 double muonCompatibleLayersMax =
conf_.
getParameter<
double>(
"muonCompatibleLayersMax");
146 histname =
"muonCompatibleLayers_";
147 muonCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, muonCompatibleLayersBin, muonCompatibleLayersMin, muonCompatibleLayersMax);
157 histname =
"trackX_";
158 trackX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackXBin, trackXMin, trackXMax);
166 histname =
"trackY_";
167 trackY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackYBin, trackYMin, trackYMax);
175 histname =
"trackZ_";
176 trackZ = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackZBin, trackZMin, trackZMax);
184 histname =
"trackEta_";
185 trackEta = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackEtaBin, trackEtaMin, trackEtaMax);
193 histname =
"trackPhi_";
194 trackPhi = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackPhiBin, trackPhiMin, trackPhiMax);
202 histname =
"trackD0_";
203 trackD0 = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackD0Bin, trackD0Min, trackD0Max);
207 int trackCompatibleLayersBin =
conf_.
getParameter<
int> (
"trackCompatibleLayersBin");
208 double trackCompatibleLayersMin =
conf_.
getParameter<
double>(
"trackCompatibleLayersMin");
209 double trackCompatibleLayersMax =
conf_.
getParameter<
double>(
"trackCompatibleLayersMax");
211 histname =
"trackCompatibleLayers_";
212 trackCompatibleLayers = ibooker.
book1D(histname+AlgoName, histname+AlgoName, trackCompatibleLayersBin, trackCompatibleLayersMin, trackCompatibleLayersMax);
222 histname =
"deltaX_";
223 deltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaXBin, deltaXMin, deltaXMax);
231 histname =
"deltaY_";
232 deltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, deltaYBin, deltaYMin, deltaYMax);
240 histname =
"signDeltaX_";
241 signDeltaX = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaXBin, signDeltaXMin, signDeltaXMax);
249 histname =
"signDeltaY_";
250 signDeltaY = ibooker.
book1D(histname+AlgoName, histname+AlgoName, signDeltaYBin, signDeltaYMin, signDeltaYMax);
294 double mudd0 = 0., mudphi = 0., muddsz = 0., mudeta = 0.;
297 if ( staTracks->size() == 2 )
299 for (
unsigned int bindex = 0; bindex < staTracks->size(); ++bindex )
303 mudd0+=(*staTracks)[bindex].d0();
304 mudphi+=(*staTracks)[bindex].phi();
305 muddsz+=(*staTracks)[bindex].dsz();
306 mudeta+=(*staTracks)[bindex].eta();}
308 mudd0-=(*staTracks)[bindex].d0();
309 mudphi-=(*staTracks)[bindex].phi();
310 muddsz-=(*staTracks)[bindex].dsz();
311 mudeta-=(*staTracks)[bindex].eta();}
313 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060)) isGoodMuon =
true;
324 if( (tkTracks->front()).normalizedChi2() < 5 &&
325 (tkTracks->front()).hitPattern().numberOfValidHits() > 8)
342 if(outputMEsInRootFile){
367 for(
unsigned int i =0;
i< staTracks->size();
i++){
388 double d0 = (*staTracks)[idxUpMuon].d0();
397 bool isInTrackerAcceptance =
false;
405 if(isInTrackerAcceptance && (*staTracks)[idxUpMuon].hitPattern().numberOfValidHits() > 28)
416 if(!tkTracks->empty())
422 reco::TrackCollection::const_iterator closestTrk = tkTracks->end();
424 for(reco::TrackCollection::const_iterator tkTrack = tkTracks->begin(); tkTrack != tkTracks->end(); ++tkTrack)
435 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
436 if (DR2<DR2min) { DR2min = DR2; closestTrk = tkTrack;}
437 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
505 double d0 = (*tkTracks)[0].d0();
513 if(!staTracks->empty()){
520 reco::TrackCollection::const_iterator closestTrk = staTracks->end();
522 for(reco::TrackCollection::const_iterator staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
535 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
536 if (DR2<DR2min) { DR2min = DR2; closestTrk = staTrack;}
537 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
613 const Cylinder::CylinderPointer cyl =
Cylinder::build(pos0, rot0, theRadius);
620 const Cylinder::CylinderPointer cyl2 =
Cylinder::build(pos02, rot02, theRadius -10);
625 const Cylinder::CylinderPointer cyl3 =
Cylinder::build(pos03, rot03, theRadius );
634 delete theTmpPropagator;
650 std::vector< const BarrelDetLayer*> barrelTOBLayers =
measurementTrackerHandle->geometricSearchTracker()->tobLayers() ;
653 for (
unsigned int k=0 ;
k < barrelTOBLayers.size() ;
k++ )
655 const DetLayer* firstLay = barrelTOBLayers[barrelTOBLayers.size() -1 -
k];
669 bool isUpMuon =
false;
670 bool firstdtep =
true;
675 if(firstdtep) layers++;
686 std::vector< const DetLayer*> firstCompatibleLayers;
687 firstCompatibleLayers.push_back(firstLay);
688 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(theTSOS, firstCompatibleLayers, isUpMuon );
693 if (trackCompatibleLayers.size()!=0 ){
694 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(startTSOS, trackCompatibleLayers, isUpMuon );
695 if (firstLay != nextLayer.second ){
696 firstLay = nextLayer.second;
697 startTSOS = nextLayer.first;
704 if(nwhile > 100)
break;
707 delete theTmpPropagator;
710 delete theTmpPropagator;
731 std::vector<const DetLayer*>::const_iterator itl;
733 for (itl=trackCompatibleLayers.begin();itl!=trackCompatibleLayers.end();++itl) {
743 std::pair<TrajectoryStateOnSurface, const DetLayer* > blabla;
744 blabla.first = sTSOS;
745 blabla.second = &**itl;
746 delete theTmpPropagator;
TkRotation< Scalar > RotationType
T getParameter(std::string const &) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::ESHandle< MagneticField > bField
virtual void setPropagationDirection(PropagationDirection dir)
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)
GlobalPoint globalPosition() 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
Point3DBase< Scalar, GlobalTag > PositionType
MonitorElement * muonCompatibleLayers
const SurfaceType & surface() const
~TrackEfficiencyMonitor()
FreeTrajectoryState const * freeState(bool withErrors=true) const
edm::ESHandle< MeasurementTracker > measurementTrackerHandle
MonitorElement * book1D(Args &&...args)
MonitorElement * trackEta
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
const LocalTrajectoryError & localError() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
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.
T const * product() const
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
const DirectTrackerNavigation * theNavigation
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
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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