121 histname =
"muonEta_";
130 histname =
"muonPhi_";
139 histname =
"muonD0_";
144 int muonCompatibleLayersBin =
conf_.
getParameter<
int> (
"muonCompatibleLayersBin");
145 double muonCompatibleLayersMin =
conf_.
getParameter<
double>(
"muonCompatibleLayersMin");
146 double muonCompatibleLayersMax =
conf_.
getParameter<
double>(
"muonCompatibleLayersMax");
148 histname =
"muonCompatibleLayers_";
159 histname =
"trackX_";
168 histname =
"trackY_";
177 histname =
"trackZ_";
186 histname =
"trackEta_";
195 histname =
"trackPhi_";
204 histname =
"trackD0_";
209 int trackCompatibleLayersBin =
conf_.
getParameter<
int> (
"trackCompatibleLayersBin");
210 double trackCompatibleLayersMin =
conf_.
getParameter<
double>(
"trackCompatibleLayersMin");
211 double trackCompatibleLayersMax =
conf_.
getParameter<
double>(
"trackCompatibleLayersMax");
213 histname =
"trackCompatibleLayers_";
224 histname =
"deltaX_";
233 histname =
"deltaY_";
242 histname =
"signDeltaX_";
251 histname =
"signDeltaY_";
291 double mudd0 = 0., mudphi = 0., muddsz = 0., mudeta = 0.;
294 if ( staTracks->size() == 2 )
296 for (
unsigned int bindex = 0; bindex < staTracks->size(); ++bindex )
300 mudd0+=(*staTracks)[bindex].d0();
301 mudphi+=(*staTracks)[bindex].phi();
302 muddsz+=(*staTracks)[bindex].dsz();
303 mudeta+=(*staTracks)[bindex].eta();}
305 mudd0-=(*staTracks)[bindex].d0();
306 mudphi-=(*staTracks)[bindex].phi();
307 muddsz-=(*staTracks)[bindex].dsz();
308 mudeta-=(*staTracks)[bindex].eta();}
310 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060)) isGoodMuon =
true;
316 else if ( staTracks->size() == 1 || staTracks->size() == 2)
testTrackerTracks(tkTracks,staTracks);
321 if( (tkTracks->front()).normalizedChi2() < 5 &&
322 (tkTracks->front()).hitPattern().numberOfValidHits() > 8)
339 if(outputMEsInRootFile){
364 for(
unsigned int i =0;
i< staTracks->size();
i++){
385 double d0 = (*staTracks)[idxUpMuon].d0();
394 bool isInTrackerAcceptance =
false;
402 if(isInTrackerAcceptance && (*staTracks)[idxUpMuon].hitPattern().numberOfValidHits() > 28)
413 if(!tkTracks->empty())
419 reco::TrackCollection::const_iterator closestTrk = tkTracks->end();
421 for(reco::TrackCollection::const_iterator tkTrack = tkTracks->begin(); tkTrack != tkTracks->end(); ++tkTrack)
432 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
433 if (DR2<DR2min) { DR2min = DR2; closestTrk = tkTrack;}
434 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
502 double d0 = (*tkTracks)[0].d0();
510 if(!staTracks->empty()){
517 reco::TrackCollection::const_iterator closestTrk = staTracks->end();
519 for(reco::TrackCollection::const_iterator staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack){
532 double DR2 = diffLocal.
x()*diffLocal.
x()+diffLocal.
y()*diffLocal.
y();
533 if (DR2<DR2min) { DR2min = DR2; closestTrk = staTrack;}
534 if (
pow(DR2,0.5) < 100. ) isTrack =
true;
610 const Cylinder::CylinderPointer cyl =
Cylinder::build(pos0, rot0, theRadius);
617 const Cylinder::CylinderPointer cyl2 =
Cylinder::build(pos02, rot02, theRadius -10);
622 const Cylinder::CylinderPointer cyl3 =
Cylinder::build(pos03, rot03, theRadius );
631 delete theTmpPropagator;
650 for (
unsigned int k=0 ;
k < barrelTOBLayers.size() ;
k++ )
652 const DetLayer* firstLay = barrelTOBLayers[barrelTOBLayers.size() -1 -
k];
666 bool isUpMuon =
false;
667 bool firstdtep =
true;
672 if(firstdtep) layers++;
683 std::vector< const DetLayer*> firstCompatibleLayers;
684 firstCompatibleLayers.push_back(firstLay);
685 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(theTSOS, firstCompatibleLayers, isUpMuon );
690 if (trackCompatibleLayers.size()!=0 ){
691 std::pair<TrajectoryStateOnSurface, const DetLayer* > nextLayer =
findNextLayer(startTSOS, trackCompatibleLayers, isUpMuon );
692 if (firstLay != nextLayer.second ){
693 firstLay = nextLayer.second;
694 startTSOS = nextLayer.first;
701 if(nwhile > 100)
break;
704 delete theTmpPropagator;
707 delete theTmpPropagator;
728 std::vector<const DetLayer*>::const_iterator itl;
730 for (itl=trackCompatibleLayers.begin();itl!=trackCompatibleLayers.end();++itl) {
740 std::pair<TrajectoryStateOnSurface, const DetLayer* > blabla;
741 blabla.first = sTSOS;
742 blabla.second = &**itl;
743 delete theTmpPropagator;
int compatibleLayers(TrajectoryStateOnSurface theTSOS)
TkRotation< Scalar > RotationType
T getParameter(std::string const &) const
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
edm::ESHandle< MagneticField > bField
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
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
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 * trackEta
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
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
virtual TrajectoryStateOnSurface propagate(const FreeTrajectoryState &, const Surface &) const
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
edm::InputTag theTKTracksLabel_
T const * product() const
void testTrackerTracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks)
const DirectTrackerNavigation * theNavigation
bool trackerAcceptance(TrajectoryStateOnSurface theTSOS, double theRadius, double theMaxZ)
MonitorElement * signDeltaY
virtual void setPropagationDirection(PropagationDirection dir) const
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)
std::vector< const DetLayer * > nextLayers(Args &&...args) const
void setCurrentFolder(const std::string &fullpath)
void testSTATracks(edm::Handle< TrackCollection > tkTracks, edm::Handle< TrackCollection > staTracks)
edm::EDGetTokenT< reco::TrackCollection > theSTATracksToken_
GlobalVector globalDirection() const