79 virtual void endJob()
override ;
205 splitTracks_(iConfig.getParameter<edm::InputTag>(
"splitTracks")),
206 splitGlobalMuons_(iConfig.getParameter<edm::InputTag>(
"splitGlobalMuons")),
207 originalTracks_(iConfig.getParameter<edm::InputTag>(
"originalTracks")),
208 originalGlobalMuons_(iConfig.getParameter<edm::InputTag>(
"originalGlobalMuons")),
209 checkIfGolden_(iConfig.getParameter<bool>(
"checkIfGolden")),
210 splitMuons_(iConfig.getParameter<bool> (
"ifSplitMuons")),
211 totalTracksToAnalyzer_(0),
214 goldenPlusTwoTracksCtr(0),
215 _passesTracksPlusMuonsCuts(0),
217 runNumber_(0), eventNumber_(0), luminosityBlock_(0),
218 dcaX1_spl_(0), dcaY1_spl_(0), dcaZ1_spl_(0),
219 dcaX2_spl_(0), dcaY2_spl_(0), dcaZ2_spl_(0),
220 dxy1_spl_(0), dxy2_spl_(0), ddxy_spl_(0),
221 dz1_spl_(0), dz2_spl_(0), ddz_spl_(0),
222 theta1_spl_(0), theta2_spl_(0), dtheta_spl_(0),
223 eta1_spl_(0), eta2_spl_(0), deta_spl_(0),
224 phi1_spl_(0), phi2_spl_(0), dphi_spl_(0),
225 pt1_spl_(0), pt2_spl_(0), dpt_spl_(0),
226 p1_spl_(0), p2_spl_(0), dp_spl_(0),
227 qoverpt1_spl_(0), qoverpt2_spl_(0), dqoverpt_spl_(0),
228 nHits1_spl_(0), nHitsPXB1_spl_(0), nHitsPXF1_spl_(0), nHitsTIB1_spl_(0),
229 nHitsTOB1_spl_(0), nHitsTID1_spl_(0), nHitsTEC1_spl_(0),
230 nHits2_spl_(0), nHitsPXB2_spl_(0), nHitsPXF2_spl_(0), nHitsTIB2_spl_(0),
231 nHitsTOB2_spl_(0), nHitsTID2_spl_(0), nHitsTEC2_spl_(0),
233 dxy1Err_spl_(0), dxy2Err_spl_(0),
234 dz1Err_spl_(0), dz2Err_spl_(0),
235 theta1Err_spl_(0), theta2Err_spl_(0),
236 eta1Err_spl_(0), eta2Err_spl_(0),
237 phi1Err_spl_(0), phi2Err_spl_(0),
238 pt1Err_spl_(0), pt2Err_spl_(0),
239 qoverpt1Err_spl_(0), qoverpt2Err_spl_(0),
241 dcaX_org_(0), dcaY_org_(0), dcaZ_org_(0),
242 dxy_org_(0), dz_org_(0),
243 theta_org_(0), eta_org_(0), phi_org_(0),
244 pt_org_(0), p_org_(0), qoverpt_org_(0),
246 nHits_org_(0), nHitsPXB_org_(0), nHitsPXF_org_(0), nHitsTIB_org_(0),
247 nHitsTOB_org_(0), nHitsTID_org_(0), nHitsTEC_org_(0),
249 dxyErr_org_(0), dzErr_org_(0),
250 thetaErr_org_(0), etaErr_org_(0), phiErr_org_(0),
251 ptErr_org_(0), qoverptErr_org_(0),
253 dcaX1_sta_(0), dcaY1_sta_(0), dcaZ1_sta_(0),
254 dcaX2_sta_(0), dcaY2_sta_(0), dcaZ2_sta_(0),
255 dxy1_sta_(0), dxy2_sta_(0), ddxy_sta_(0),
256 dz1_sta_(0), dz2_sta_(0), ddz_sta_(0),
257 theta1_sta_(0), theta2_sta_(0), dtheta_sta_(0),
258 eta1_sta_(0), eta2_sta_(0), deta_sta_(0),
259 phi1_sta_(0), phi2_sta_(0), dphi_sta_(0),
260 pt1_sta_(0), pt2_sta_(0), dpt_sta_(0),
261 p1_sta_(0), p2_sta_(0), dp_sta_(0),
262 qoverpt1_sta_(0), qoverpt2_sta_(0), dqoverpt_sta_(0),
264 dxy1Err_sta_(0), dxy2Err_sta_(0),
265 dz1Err_sta_(0), dz2Err_sta_(0),
266 theta1Err_sta_(0), theta2Err_sta_(0),
267 eta1Err_sta_(0), eta2Err_sta_(0),
268 phi1Err_sta_(0), phi2Err_sta_(0),
269 pt1Err_sta_(0), pt2Err_sta_(0),
270 qoverpt1Err_sta_(0), qoverpt2Err_sta_(0),
272 dcaX1_glb_(0), dcaY1_glb_(0), dcaZ1_glb_(0),
273 dcaX2_glb_(0), dcaY2_glb_(0), dcaZ2_glb_(0),
274 dxy1_glb_(0), dxy2_glb_(0), ddxy_glb_(0),
275 dz1_glb_(0), dz2_glb_(0), ddz_glb_(0),
276 theta1_glb_(0), theta2_glb_(0), dtheta_glb_(0),
277 eta1_glb_(0), eta2_glb_(0), deta_glb_(0),
278 phi1_glb_(0), phi2_glb_(0), dphi_glb_(0),
279 pt1_glb_(0), pt2_glb_(0), dpt_glb_(0),
280 p1_glb_(0), p2_glb_(0), dp_glb_(0),
281 qoverpt1_glb_(0), qoverpt2_glb_(0), dqoverpt_glb_(0),
282 norchi1_glb_(0), norchi2_glb_(0),
284 dxy1Err_glb_(0), dxy2Err_glb_(0),
285 dz1Err_glb_(0), dz2Err_glb_(0),
286 theta1Err_glb_(0), theta2Err_glb_(0),
287 eta1Err_glb_(0), eta2Err_glb_(0),
288 phi1Err_glb_(0), phi2Err_glb_(0),
289 pt1Err_glb_(0), pt2Err_glb_(0),
290 qoverpt1Err_glb_(0), qoverpt2Err_glb_(0),
292 dcaX_orm_(0), dcaY_orm_(0), dcaZ_orm_(0),
293 dxy_orm_(0), dz_orm_(0),
294 theta_orm_(0), eta_orm_(0), phi_orm_(0),
295 pt_orm_(0), p_orm_(0), qoverpt_orm_(0),
297 dxyErr_orm_(0), dzErr_orm_(0),
298 thetaErr_orm_(0), etaErr_orm_(0), phiErr_orm_(0),
299 ptErr_orm_(0), qoverptErr_orm_(0)
318 bool isGolden =
true;
340 if (tracks->size() == 2 && originalTracks->size() == 1 && isGolden){
344 bool topGlobalMuonFlag =
false;
345 bool bottomGlobalMuonFlag =
false;
346 int topGlobalMuon = -1;
347 int bottomGlobalMuon = -1;
348 double topGlobalMuonNorchi2 = 1e10;
349 double bottomGlobalMuonNorchi2 = 1e10;
353 for (std::vector<reco::Muon>::const_iterator gmI = globalMuons->begin(); gmI != globalMuons->end(); gmI++){
355 if ( gmI->isTrackerMuon() && gmI->isStandAloneMuon() && gmI->isGlobalMuon() ){
360 if (gmI->innerTrack() == trackerTrackRef1){
361 if (gmI->globalTrack()->normalizedChi2() < topGlobalMuonNorchi2){
362 topGlobalMuonFlag =
true;
363 topGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
364 topGlobalMuon = gmCtr;
367 if (gmI->innerTrack() == trackerTrackRef2){
368 if (gmI->globalTrack()->normalizedChi2() < bottomGlobalMuonNorchi2){
369 bottomGlobalMuonFlag =
true;
370 bottomGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
371 bottomGlobalMuon = gmCtr;
400 if((*iHit)->isValid()) {
404 int type =(*iHit)->geographicalId().subdetId();
410 if(type==
int( kBPIX)){++nhitinBPIX1;}
411 if(type==
int( kFPIX)){++nhitinFPIX1;}
433 if((*iHit)->isValid()) {
437 int type =(*iHit)->geographicalId().subdetId();
443 if(type==
int( kBPIX)){++nhitinBPIX2;}
444 if(type==
int( kFPIX)){++nhitinFPIX2;}
457 double ddxy_Val = track1.
d0() - track2.
d0();
458 double ddz_Val = track1.
dz() - track2.
dz();
459 double dtheta_Val = track1.
theta() - track2.
theta();
460 double deta_Val = track1.
eta() - track2.
eta();
461 double dphi_Val = track1.
phi() - track2.
phi();
462 double dpt_Val = track1.
pt() - track2.
pt();
463 double dp_Val = track1.
p() - track2.
p();
464 double dqoverpt_Val = track1.
charge() / track1.
pt() - track2.
charge() / track2.
pt();
476 int nhitinBPIXorg =0;
477 int nhitinFPIXorg =0;
480 if((*iHit)->isValid()) {
484 int type =(*iHit)->geographicalId().subdetId();
490 if(type==
int( kBPIX)){++nhitinBPIXorg;}
491 if(type==
int( kFPIX)){++nhitinFPIXorg;}
578 reco::Muon muonTop = globalMuons->at( topGlobalMuon );
579 reco::Muon muonBottom = globalMuons->at( bottomGlobalMuon );
613 dp_sta_ = sta1->p() - sta2->p();
659 dp_glb_ = glb1->p() - glb2->p();
917 if ( 2 != muons.size() )
return false;
919 double mudd0=0., mudphi=0., muddsz=0., mudeta=0.;
920 for (
unsigned int bindex = 0; bindex < muons.size(); ++bindex ) {
927 mudd0+=mutrack->
d0();
928 mudphi+=mutrack->
phi();
929 muddsz+=mutrack->
dsz();
930 mudeta+=mymuon.
eta();
933 mudd0-=mutrack->
d0();
934 mudphi-=mutrack->
phi();
935 muddsz-=mutrack->
dsz();
936 mudeta-=mymuon.
eta();
939 if ((fabs(mudd0)<15.0)&&(fabs(mudphi)<0.045)&&(fabs(muddsz)<20.0)&&(fabs(mudeta)<0.060))
return true;
static const char runNumber_[]
double p() const
momentum vector magnitude
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
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 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
T * make(const Args &...args) const
make new ROOT object
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
~CosmicSplitterValidation()
double eta() const
pseudorapidity of momentum vector
virtual void beginJob() override
virtual float eta() const
momentum pseudorapidity
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::InputTag splitGlobalMuons_
T const * get() const
Returns C++ pointer to the item.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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::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.