71 virtual void endJob()
override ;
209 splitMuons_(iConfig.getParameter<bool> (
"ifSplitMuons")),
325 bool isGolden =
true;
347 if (tracks->size() == 2 && originalTracks->size() == 1 && isGolden){
351 bool topGlobalMuonFlag =
false;
352 bool bottomGlobalMuonFlag =
false;
353 int topGlobalMuon = -1;
354 int bottomGlobalMuon = -1;
355 double topGlobalMuonNorchi2 = 1e10;
356 double bottomGlobalMuonNorchi2 = 1e10;
360 for (std::vector<reco::Muon>::const_iterator gmI = globalMuons->begin(); gmI != globalMuons->end(); gmI++){
362 if ( gmI->isTrackerMuon() && gmI->isStandAloneMuon() && gmI->isGlobalMuon() ){
367 if (gmI->innerTrack() == trackerTrackRef1){
368 if (gmI->globalTrack()->normalizedChi2() < topGlobalMuonNorchi2){
369 topGlobalMuonFlag =
true;
370 topGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
371 topGlobalMuon = gmCtr;
374 if (gmI->innerTrack() == trackerTrackRef2){
375 if (gmI->globalTrack()->normalizedChi2() < bottomGlobalMuonNorchi2){
376 bottomGlobalMuonFlag =
true;
377 bottomGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
378 bottomGlobalMuon = gmCtr;
407 if((*iHit)->isValid()) {
411 int type =(*iHit)->geographicalId().subdetId();
417 if(type==
int( kBPIX)){++nhitinBPIX1;}
418 if(type==
int( kFPIX)){++nhitinFPIX1;}
440 if((*iHit)->isValid()) {
444 int type =(*iHit)->geographicalId().subdetId();
450 if(type==
int( kBPIX)){++nhitinBPIX2;}
451 if(type==
int( kFPIX)){++nhitinFPIX2;}
464 double ddxy_Val = track1.
d0() - track2.
d0();
465 double ddz_Val = track1.
dz() - track2.
dz();
466 double dtheta_Val = track1.
theta() - track2.
theta();
467 double deta_Val = track1.
eta() - track2.
eta();
468 double dphi_Val = track1.
phi() - track2.
phi();
469 double dpt_Val = track1.
pt() - track2.
pt();
470 double dp_Val = track1.
p() - track2.
p();
471 double dqoverpt_Val = track1.
charge() / track1.
pt() - track2.
charge() / track2.
pt();
483 int nhitinBPIXorg =0;
484 int nhitinFPIXorg =0;
487 if((*iHit)->isValid()) {
491 int type =(*iHit)->geographicalId().subdetId();
497 if(type==
int( kBPIX)){++nhitinBPIXorg;}
498 if(type==
int( kFPIX)){++nhitinFPIXorg;}
585 reco::Muon muonTop = globalMuons->at( topGlobalMuon );
586 reco::Muon muonBottom = globalMuons->at( bottomGlobalMuon );
620 dp_sta_ = sta1->p() - sta2->p();
666 dp_glb_ = glb1->p() - glb2->p();
924 if ( 2 != muons.size() )
return false;
926 double mudd0=0., mudphi=0., muddsz=0., mudeta=0.;
927 for (
unsigned int bindex = 0; bindex < muons.size(); ++bindex ) {
934 mudd0+=mutrack->
d0();
935 mudphi+=mutrack->
phi();
936 muddsz+=mutrack->
dsz();
937 mudeta+=mymuon.
eta();
940 mudd0-=mutrack->
d0();
941 mudphi-=mutrack->
phi();
942 muddsz-=mutrack->
dsz();
943 mudeta-=mymuon.
eta();
946 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060))
return true;
double p() const
momentum vector magnitude
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::Service< TFileService > tfile
EventNumber_t event() const
const Point & referencePoint() const
Reference point on the track.
double d0Error() const
error on d0
int goldenPlusTwoTracksCtr
edm::EDGetTokenT< reco::MuonCollection > STAMuonsToken_
edm::EDGetTokenT< reco::MuonCollection > splitGlobalMuonsToken_
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
CosmicSplitterValidation(const edm::ParameterSet &)
virtual double eta() const final
momentum pseudorapidity
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
double theta() const
polar angle
#define DEFINE_FWK_MODULE(type)
double etaError() const
error on eta
double phi() const
azimuthal angle of momentum vector
LuminosityBlockNumber_t luminosityBlock() const
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
edm::InputTag splitTracks_
std::vector< Muon > MuonCollection
collection of Muon objects
edm::EDGetTokenT< std::vector< reco::Track > > splitTracksToken_
~CosmicSplitterValidation()
double eta() const
pseudorapidity of momentum vector
virtual void beginJob() override
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
double phiError() const
error on phi
edm::EDGetTokenT< reco::MuonCollection > originalGlobalMuonsToken_
edm::InputTag splitGlobalMuons_
T const * get() const
Returns C++ pointer to the item.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
T const * product() const
int totalTracksToAnalyzer_
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::InputTag originalGlobalMuons_
int _passesTracksPlusMuonsCuts
virtual void endJob() override
bool is_gold_muon(const edm::Event &e)
int charge() const
track electric charge
edm::EDGetTokenT< std::vector< reco::Track > > originalTracksToken_
edm::InputTag originalTracks_
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
double thetaError() const
error on theta
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.