176 splitTracks_(iConfig.getParameter<edm::InputTag>(
"splitTracks")),
177 splitGlobalMuons_(iConfig.getParameter<edm::InputTag>(
"splitGlobalMuons")),
178 originalTracks_(iConfig.getParameter<edm::InputTag>(
"originalTracks")),
179 originalGlobalMuons_(iConfig.getParameter<edm::InputTag>(
"originalGlobalMuons")),
180 checkIfGolden_(iConfig.getParameter<bool>(
"checkIfGolden")),
181 splitMuons_(iConfig.getParameter<bool> (
"ifSplitMuons")),
182 totalTracksToAnalyzer_(0),
185 goldenPlusTwoTracksCtr(0),
186 _passesTracksPlusMuonsCuts(0),
188 dcaX1_spl_(0), dcaY1_spl_(0), dcaZ1_spl_(0),
189 dcaX2_spl_(0), dcaY2_spl_(0), dcaZ2_spl_(0),
190 dxy1_spl_(0), dxy2_spl_(0), dz1_spl_(0), dz2_spl_(0),
191 theta1_spl_(0), theta2_spl_(0), phi1_spl_(0), phi2_spl_(0),
192 ddxy_spl_(0), ddz_spl_(0), dtheta_spl_(0), dphi_spl_(0),
193 pt1_spl_(0), pt2_spl_(0), dpt_spl_(0), p1_spl_(0), p2_spl_(0),
194 eta1_spl_(0), eta2_spl_(0), deta_spl_(0),
195 nHits1_spl_(0), nHitsPXB1_spl_(0), nHitsPXF1_spl_(0), nHitsTIB1_spl_(0),
196 nHitsTOB1_spl_(0), nHitsTID1_spl_(0), nHitsTEC1_spl_(0),
197 nHits2_spl_(0), nHitsPXB2_spl_(0), nHitsPXF2_spl_(0), nHitsTIB2_spl_(0),
198 nHitsTOB2_spl_(0), nHitsTID2_spl_(0), nHitsTEC2_spl_(0),
199 pt1Err_spl_(0), pt2Err_spl_(0),
200 theta1Err_spl_(0), theta2Err_spl_(0),
201 phi1Err_spl_(0), phi2Err_spl_(0),
202 d01Err_spl_(0), d02Err_spl_(0),
203 dz1Err_spl_(0), dz2Err_spl_(0),
204 dcaX_org_(0), dcaY_org_(0), dcaZ_org_(0),
205 dxy_org_(0), dz_org_(0),
206 theta_org_(0), phi_org_(0), eta_org_(0), pt_org_(0), p_org_(0),
208 dcaX1_sta_(0), dcaY1_sta_(0), dcaZ1_sta_(0),
209 dcaX2_sta_(0), dcaY2_sta_(0), dcaZ2_sta_(0),
210 dxy1_sta_(0), dxy2_sta_(0), dz1_sta_(0), dz2_sta_(0),
211 theta1_sta_(0), theta2_sta_(0), phi1_sta_(0), phi2_sta_(0),
212 ddxy_sta_(0), ddz_sta_(0), dtheta_sta_(0), dphi_sta_(0),
213 pt1_sta_(0), pt2_sta_(0), dpt_sta_(0), p1_sta_(0), p2_sta_(0),
214 eta1_sta_(0), eta2_sta_(0), deta_sta_(0),
215 pt1Err_sta_(0), pt2Err_sta_(0),
216 theta1Err_sta_(0), theta2Err_sta_(0),
217 phi1Err_sta_(0), phi2Err_sta_(0),
218 d01Err_sta_(0), d02Err_sta_(0),
219 dz1Err_sta_(0), dz2Err_sta_(0),
220 dcaX1_glb_(0), dcaY1_glb_(0), dcaZ1_glb_(0),
221 dcaX2_glb_(0), dcaY2_glb_(0), dcaZ2_glb_(0),
222 dxy1_glb_(0), dxy2_glb_(0), dz1_glb_(0), dz2_glb_(0),
223 theta1_glb_(0), theta2_glb_(0), phi1_glb_(0), phi2_glb_(0),
224 ddxy_glb_(0), ddz_glb_(0), dtheta_glb_(0), dphi_glb_(0),
225 pt1_glb_(0), pt2_glb_(0), dpt_glb_(0), p1_glb_(0), p2_glb_(0),
226 eta1_glb_(0), eta2_glb_(0), deta_glb_(0),
227 norchi1_glb_(0), norchi2_glb_(0),
228 pt1Err_glb_(0), pt2Err_glb_(0),
229 theta1Err_glb_(0), theta2Err_glb_(0),
230 phi1Err_glb_(0), phi2Err_glb_(0),
231 d01Err_glb_(0), d02Err_glb_(0),
232 dz1Err_glb_(0), dz2Err_glb_(0),
233 dcaX_orm_(0), dcaY_orm_(0), dcaZ_orm_(0),
234 dxy_orm_(0), dz_orm_(0),
235 theta_orm_(0), phi_orm_(0), eta_orm_(0), pt_orm_(0), p_orm_(0),
255 bool isGolden =
true;
277 if (tracks->size() == 2 && originalTracks->size() == 1 && isGolden){
281 bool topGlobalMuonFlag =
false;
282 bool bottomGlobalMuonFlag =
false;
283 int topGlobalMuon = -1;
284 int bottomGlobalMuon = -1;
285 double topGlobalMuonNorchi2 = 1e10;
286 double bottomGlobalMuonNorchi2 = 1e10;
290 for (std::vector<reco::Muon>::const_iterator gmI = globalMuons->begin(); gmI != globalMuons->end(); gmI++){
292 if ( gmI->isTrackerMuon() && gmI->isStandAloneMuon() && gmI->isGlobalMuon() ){
297 if (gmI->innerTrack() == trackerTrackRef1){
298 if (gmI->globalTrack()->normalizedChi2() < topGlobalMuonNorchi2){
299 topGlobalMuonFlag =
true;
300 topGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
301 topGlobalMuon = gmCtr;
304 if (gmI->innerTrack() == trackerTrackRef2){
305 if (gmI->globalTrack()->normalizedChi2() < bottomGlobalMuonNorchi2){
306 bottomGlobalMuonFlag =
true;
307 bottomGlobalMuonNorchi2 = gmI->globalTrack()->normalizedChi2();
308 bottomGlobalMuon = gmCtr;
329 double nhitinTIB1 =0;
330 double nhitinTOB1 =0;
331 double nhitinTID1 =0;
332 double nhitinTEC1 =0;
333 double nhitinBPIX1 =0;
334 double nhitinFPIX1 =0;
337 if((*iHit)->isValid()) {
341 int type =(*iHit)->geographicalId().subdetId();
347 if(type==
int( kBPIX)){++nhitinBPIX1;}
348 if(type==
int( kFPIX)){++nhitinFPIX1;}
362 double nhitinTIB2 =0;
363 double nhitinTOB2 =0;
364 double nhitinTID2 =0;
365 double nhitinTEC2 =0;
366 double nhitinBPIX2 =0;
367 double nhitinFPIX2 =0;
370 if((*iHit)->isValid()) {
374 int type =(*iHit)->geographicalId().subdetId();
380 if(type==
int( kBPIX)){++nhitinBPIX2;}
381 if(type==
int( kFPIX)){++nhitinFPIX2;}
394 double dtheta_Val = track1.
theta() - track2.
theta();
395 double dphi_Val = track1.
phi() - track2.
phi();
396 double ddxy_Val = track1.
d0() - track2.
d0();
397 double ddz_Val = track1.
dz() - track2.
dz();
398 double dpt_Val = track1.
pt() - track2.
pt();
459 reco::Muon muonTop = globalMuons->at( topGlobalMuon );
460 reco::Muon muonBottom = globalMuons->at( bottomGlobalMuon );
734 if ( 2 != muons.size() )
return false;
736 double mudd0=0., mudphi=0., muddsz=0., mudeta=0.;
737 for (
unsigned int bindex = 0; bindex < muons.size(); ++bindex ) {
744 mudd0+=mutrack->
d0();
745 mudphi+=mutrack->
phi();
746 muddsz+=mutrack->
dsz();
747 mudeta+=mymuon.
eta();
750 mudd0-=mutrack->
d0();
751 mudphi-=mutrack->
phi();
752 muddsz-=mutrack->
dsz();
753 mudeta-=mymuon.
eta();
756 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
edm::Service< TFileService > tfile
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 &)
double theta() const
polar angle
#define DEFINE_FWK_MODULE(type)
double phi() const
azimuthal angle of momentum vector
const Point & referencePoint() const
Reference point on the track.
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
~CosmicSplitterValidation()
double eta() const
pseudorapidity of momentum vector
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_
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
int totalTracksToAnalyzer_
XYZPointD XYZPoint
point in space with cartesian internal representation
T const * product() const
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
edm::InputTag originalGlobalMuons_
T * make() const
make new ROOT object
int _passesTracksPlusMuonsCuts
bool is_gold_muon(const edm::Event &e)
edm::InputTag originalTracks_
T const * get() const
Returns C++ pointer to the item.
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.