71 virtual void endJob()
override ;
204 splitTracks_(iConfig.getParameter<edm::
InputTag>(
"splitTracks")),
205 splitGlobalMuons_(iConfig.getParameter<edm::
InputTag>(
"splitGlobalMuons")),
206 originalTracks_(iConfig.getParameter<edm::
InputTag>(
"originalTracks")),
207 originalGlobalMuons_(iConfig.getParameter<edm::
InputTag>(
"originalGlobalMuons")),
208 checkIfGolden_(iConfig.getParameter<bool>(
"checkIfGolden")),
209 splitMuons_(iConfig.getParameter<bool> (
"ifSplitMuons")),
210 totalTracksToAnalyzer_(0),
213 goldenPlusTwoTracksCtr(0),
214 _passesTracksPlusMuonsCuts(0),
216 runNumber_(0), eventNumber_(0), luminosityBlock_(0),
217 dcaX1_spl_(0), dcaY1_spl_(0), dcaZ1_spl_(0),
218 dcaX2_spl_(0), dcaY2_spl_(0), dcaZ2_spl_(0),
219 dxy1_spl_(0), dxy2_spl_(0), ddxy_spl_(0),
220 dz1_spl_(0), dz2_spl_(0), ddz_spl_(0),
221 theta1_spl_(0), theta2_spl_(0), dtheta_spl_(0),
222 eta1_spl_(0), eta2_spl_(0), deta_spl_(0),
223 phi1_spl_(0), phi2_spl_(0), dphi_spl_(0),
224 pt1_spl_(0), pt2_spl_(0), dpt_spl_(0),
225 p1_spl_(0), p2_spl_(0), dp_spl_(0),
226 qoverpt1_spl_(0), qoverpt2_spl_(0), dqoverpt_spl_(0),
227 nHits1_spl_(0), nHitsPXB1_spl_(0), nHitsPXF1_spl_(0), nHitsTIB1_spl_(0),
228 nHitsTOB1_spl_(0), nHitsTID1_spl_(0), nHitsTEC1_spl_(0),
229 nHits2_spl_(0), nHitsPXB2_spl_(0), nHitsPXF2_spl_(0), nHitsTIB2_spl_(0),
230 nHitsTOB2_spl_(0), nHitsTID2_spl_(0), nHitsTEC2_spl_(0),
232 dxy1Err_spl_(0), dxy2Err_spl_(0),
233 dz1Err_spl_(0), dz2Err_spl_(0),
234 theta1Err_spl_(0), theta2Err_spl_(0),
235 eta1Err_spl_(0), eta2Err_spl_(0),
236 phi1Err_spl_(0), phi2Err_spl_(0),
237 pt1Err_spl_(0), pt2Err_spl_(0),
238 qoverpt1Err_spl_(0), qoverpt2Err_spl_(0),
240 dcaX_org_(0), dcaY_org_(0), dcaZ_org_(0),
241 dxy_org_(0), dz_org_(0),
242 theta_org_(0), eta_org_(0), phi_org_(0),
243 pt_org_(0), p_org_(0), qoverpt_org_(0),
245 nHits_org_(0), nHitsPXB_org_(0), nHitsPXF_org_(0), nHitsTIB_org_(0),
246 nHitsTOB_org_(0), nHitsTID_org_(0), nHitsTEC_org_(0),
248 dxyErr_org_(0), dzErr_org_(0),
249 thetaErr_org_(0), etaErr_org_(0), phiErr_org_(0),
250 ptErr_org_(0), qoverptErr_org_(0),
252 dcaX1_sta_(0), dcaY1_sta_(0), dcaZ1_sta_(0),
253 dcaX2_sta_(0), dcaY2_sta_(0), dcaZ2_sta_(0),
254 dxy1_sta_(0), dxy2_sta_(0), ddxy_sta_(0),
255 dz1_sta_(0), dz2_sta_(0), ddz_sta_(0),
256 theta1_sta_(0), theta2_sta_(0), dtheta_sta_(0),
257 eta1_sta_(0), eta2_sta_(0), deta_sta_(0),
258 phi1_sta_(0), phi2_sta_(0), dphi_sta_(0),
259 pt1_sta_(0), pt2_sta_(0), dpt_sta_(0),
260 p1_sta_(0), p2_sta_(0), dp_sta_(0),
261 qoverpt1_sta_(0), qoverpt2_sta_(0), dqoverpt_sta_(0),
263 dxy1Err_sta_(0), dxy2Err_sta_(0),
264 dz1Err_sta_(0), dz2Err_sta_(0),
265 theta1Err_sta_(0), theta2Err_sta_(0),
266 eta1Err_sta_(0), eta2Err_sta_(0),
267 phi1Err_sta_(0), phi2Err_sta_(0),
268 pt1Err_sta_(0), pt2Err_sta_(0),
269 qoverpt1Err_sta_(0), qoverpt2Err_sta_(0),
271 dcaX1_glb_(0), dcaY1_glb_(0), dcaZ1_glb_(0),
272 dcaX2_glb_(0), dcaY2_glb_(0), dcaZ2_glb_(0),
273 dxy1_glb_(0), dxy2_glb_(0), ddxy_glb_(0),
274 dz1_glb_(0), dz2_glb_(0), ddz_glb_(0),
275 theta1_glb_(0), theta2_glb_(0), dtheta_glb_(0),
276 eta1_glb_(0), eta2_glb_(0), deta_glb_(0),
277 phi1_glb_(0), phi2_glb_(0), dphi_glb_(0),
278 pt1_glb_(0), pt2_glb_(0), dpt_glb_(0),
279 p1_glb_(0), p2_glb_(0), dp_glb_(0),
280 qoverpt1_glb_(0), qoverpt2_glb_(0), dqoverpt_glb_(0),
281 norchi1_glb_(0), norchi2_glb_(0),
283 dxy1Err_glb_(0), dxy2Err_glb_(0),
284 dz1Err_glb_(0), dz2Err_glb_(0),
285 theta1Err_glb_(0), theta2Err_glb_(0),
286 eta1Err_glb_(0), eta2Err_glb_(0),
287 phi1Err_glb_(0), phi2Err_glb_(0),
288 pt1Err_glb_(0), pt2Err_glb_(0),
289 qoverpt1Err_glb_(0), qoverpt2Err_glb_(0),
291 dcaX_orm_(0), dcaY_orm_(0), dcaZ_orm_(0),
292 dxy_orm_(0), dz_orm_(0),
293 theta_orm_(0), eta_orm_(0), phi_orm_(0),
294 pt_orm_(0), p_orm_(0), qoverpt_orm_(0),
296 dxyErr_orm_(0), dzErr_orm_(0),
297 thetaErr_orm_(0), etaErr_orm_(0), phiErr_orm_(0),
298 ptErr_orm_(0), qoverptErr_orm_(0)
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;
static const char runNumber_[]
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 &)
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
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...
virtual double eta() const
momentum pseudorapidity
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.