28 for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
29 iParam != parameterNames.end(); iParam++ ){
34 const int kMaxMuon = 10000;
35 muonpt =
new float[kMaxMuon];
38 muonet =
new float[kMaxMuon];
39 muone =
new float[kMaxMuon];
45 muonD0 =
new float[kMaxMuon];
49 const int kMaxMuonL2 = 500;
59 const int kMaxMuonL3 = 500;
69 const int kMaxOniaPixel = 500;
78 const int kMaxTrackPixel = 500;
87 const int kMaxMuonL2NoVtx = 500;
98 HltTree->Branch(
"NrecoMuon",&
nmuon,
"NrecoMuon/I");
99 HltTree->Branch(
"recoMuonPt",
muonpt,
"recoMuonPt[NrecoMuon]/F");
100 HltTree->Branch(
"recoMuonPhi",
muonphi,
"recoMuonPhi[NrecoMuon]/F");
101 HltTree->Branch(
"recoMuonEta",
muoneta,
"recoMuonEta[NrecoMuon]/F");
102 HltTree->Branch(
"recoMuonEt",
muonet,
"recoMuonEt[NrecoMuon]/F");
103 HltTree->Branch(
"recoMuonE",
muone,
"recoMuonE[NrecoMuon]/F");
104 HltTree->Branch(
"recoMuonChi2NDF",
muonchi2NDF,
"recoMuonChi2NDF[NrecoMuon]/F");
105 HltTree->Branch(
"recoMuonCharge",
muoncharge ,
"recoMuonCharge[NrecoMuon]/F");
106 HltTree->Branch(
"recoMuonTrkIsoR03",
muonTrkIsoR03 ,
"recoMuonTrkIsoR03[NrecoMuon]/F");
107 HltTree->Branch(
"recoMuonECalIsoR03",
muonECalIsoR03 ,
"recoMuonECalIsoR03[NrecoMuon]/F");
108 HltTree->Branch(
"recoMuonHCalIsoR03",
muonHCalIsoR03 ,
"recoMuonHCalIsoR03[NrecoMuon]/F");
109 HltTree->Branch(
"recoMuonD0",
muonD0 ,
"recoMuonD0[NrecoMuon]/F");
110 HltTree->Branch(
"recoMuonType",
muontype ,
"recoMuonType[NrecoMuon]/I");
111 HltTree->Branch(
"recoMuonNValidTrkHits",
muonNValidTrkHits,
"recoMuonNValidTrkHits[NrecoMuon]/I");
112 HltTree->Branch(
"recoMuonNValidMuonHits",
muonNValidMuonHits,
"recoMuonNValidMuonHits[NrecoMuon]/I");
114 HltTree->Branch(
"NohMuL2",&
nmu2cand,
"NohMuL2/I");
115 HltTree->Branch(
"ohMuL2Pt",
muonl2pt,
"ohMuL2Pt[NohMuL2]/F");
116 HltTree->Branch(
"ohMuL2Phi",
muonl2phi,
"ohMuL2Phi[NohMuL2]/F");
117 HltTree->Branch(
"ohMuL2Eta",
muonl2eta,
"ohMuL2Eta[NohMuL2]/F");
118 HltTree->Branch(
"ohMuL2Chg",
muonl2chg,
"ohMuL2Chg[NohMuL2]/I");
119 HltTree->Branch(
"ohMuL2PtErr",
muonl2pterr,
"ohMuL2PtErr[NohMuL2]/F");
120 HltTree->Branch(
"ohMuL2Iso",
muonl2iso,
"ohMuL2Iso[NohMuL2]/I");
121 HltTree->Branch(
"ohMuL2Dr",
muonl2dr,
"ohMuL2Dr[NohMuL2]/F");
122 HltTree->Branch(
"ohMuL2Dz",
muonl2dz,
"ohMuL2Dz[NohMuL2]/F");
123 HltTree->Branch(
"ohMuL2L1idx",
muonl21idx,
"ohMuL2L1idx[NohMuL2]/I");
124 HltTree->Branch(
"NohMuL3",&
nmu3cand,
"NohMuL3/I");
125 HltTree->Branch(
"ohMuL3Pt",
muonl3pt,
"ohMuL3Pt[NohMuL3]/F");
126 HltTree->Branch(
"ohMuL3Phi",
muonl3phi,
"ohMuL3Phi[NohMuL3]/F");
127 HltTree->Branch(
"ohMuL3Eta",
muonl3eta,
"ohMuL3Eta[NohMuL3]/F");
128 HltTree->Branch(
"ohMuL3Chg",
muonl3chg,
"ohMuL3Chg[NohMuL3]/I");
129 HltTree->Branch(
"ohMuL3PtErr",
muonl3pterr,
"ohMuL3PtErr[NohMuL3]/F");
130 HltTree->Branch(
"ohMuL3Iso",
muonl3iso,
"ohMuL3Iso[NohMuL3]/I");
131 HltTree->Branch(
"ohMuL3Dr",
muonl3dr,
"ohMuL3Dr[NohMuL3]/F");
132 HltTree->Branch(
"ohMuL3Dz",
muonl3dz,
"ohMuL3Dz[NohMuL3]/F");
133 HltTree->Branch(
"ohMuL3L2idx",
muonl32idx,
"ohMuL3L2idx[NohMuL3]/I");
135 HltTree->Branch(
"ohOniaPixelPt",
oniaPixelpt,
"ohOniaPixelPt[NohOniaPixel]/F");
136 HltTree->Branch(
"ohOniaPixelPhi",
oniaPixelphi,
"ohOniaPixelPhi[NohOniaPixel]/F");
137 HltTree->Branch(
"ohOniaPixelEta",
oniaPixeleta,
"ohOniaPixelEta[NohOniaPixel]/F");
138 HltTree->Branch(
"ohOniaPixelChg",
oniaPixelchg,
"ohOniaPixelChg[NohOniaPixel]/I");
139 HltTree->Branch(
"ohOniaPixelDr",
oniaPixeldr,
"ohOniaPixelDr[NohOniaPixel]/F");
140 HltTree->Branch(
"ohOniaPixelDz",
oniaPixeldz,
"ohOniaPixelDz[NohOniaPixel]/F");
141 HltTree->Branch(
"ohOniaPixelHits",
oniaPixelHits,
"ohOniaPixelHits[NohOniaPixel]/I");
142 HltTree->Branch(
"ohOniaPixelNormChi2",
oniaPixelNormChi2,
"ohOniaPixelNormChi2[NohOniaPixel]/F");
144 HltTree->Branch(
"ohOniaTrackPt",
oniaTrackpt,
"ohOniaTrackPt[NohOniaTrack]/F");
145 HltTree->Branch(
"ohOniaTrackPhi",
oniaTrackphi,
"ohOniaTrackPhi[NohOniaTrack]/F");
146 HltTree->Branch(
"ohOniaTrackEta",
oniaTracketa,
"ohOniaTrackEta[NohOniaTrack]/F");
147 HltTree->Branch(
"ohOniaTrackChg",
oniaTrackchg,
"ohOniaTrackChg[NohOniaTrack]/I");
148 HltTree->Branch(
"ohOniaTrackDr",
oniaTrackdr,
"ohOniaTrackDr[NohOniaTrack]/F");
149 HltTree->Branch(
"ohOniaTrackDz",
oniaTrackdz,
"ohOniaTrackDz[NohOniaTrack]/F");
150 HltTree->Branch(
"ohOniaTrackHits",
oniaTrackHits,
"ohOniaTrackHits[NohOniaTrack]/I");
151 HltTree->Branch(
"ohOniaTrackNormChi2",
oniaTrackNormChi2,
"ohOniaTrackNormChi2[NohOniaTrack]/F");
152 HltTree->Branch(
"NohMuL2NoVtx",&
nmu2cand,
"NohMuL2NoVtx/I");
153 HltTree->Branch(
"ohMuL2NoVtxPt",
muonl2novtxpt,
"ohMuL2NoVtxPt[NohMuL2NoVtx]/F");
154 HltTree->Branch(
"ohMuL2NoVtxPhi",
muonl2novtxphi,
"ohMuL2NoVtxPhi[NohMuL2NoVtx]/F");
155 HltTree->Branch(
"ohMuL2NoVtxEta",
muonl2novtxeta,
"ohMuL2NoVtxEta[NohMuL2NoVtx]/F");
156 HltTree->Branch(
"ohMuL2NoVtxChg",
muonl2novtxchg,
"ohMuL2NoVtxChg[NohMuL2NoVtx]/I");
157 HltTree->Branch(
"ohMuL2NoVtxPtErr",
muonl2novtxpterr,
"ohMuL2NoVtxPtErr[NohMuL2NoVtx]/F");
158 HltTree->Branch(
"ohMuL2NoVtxDr",
muonl2novtxdr,
"ohMuL2NoVtxDr[NohMuL2NoVtx]/F");
159 HltTree->Branch(
"ohMuL2NoVtxDz",
muonl2novtxdz,
"ohMuL2NoVtxDz[NohMuL2NoVtx]/F");
160 HltTree->Branch(
"ohMuL2NoVtxL1idx",
muonl2novtx1idx,
"ohMuL2NoVtxL1idx[NohMuL2NoVtx]/I");
183 nmuon = mymuons.size();
184 typedef reco::MuonCollection::const_iterator muiter;
186 for (muiter
i=mymuons.begin();
i!=mymuons.end();
i++)
200 if (
i->globalTrack().isNonnull())
203 muonD0[imu] =
i->globalTrack()->dxy(BSPosition);
210 if (
i->innerTrack().isNonnull())
muonNValidTrkHits[imu] =
i->innerTrack()->numberOfValidHits();
213 if (
i->isGlobalMuon()!=0)
muonNValidMuonHits[imu] =
i->globalTrack()->hitPattern().numberOfValidMuonHits();
222 myMucands1 = * MuCands1;
232 myMucands2 = * MuCands2;
235 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
237 for (cand
i=myMucands2.begin();
i!=myMucands2.end();
i++) {
248 muonl2dr[imu2c] = fabs(tk->dxy(BSPosition));
252 muonl2dz[imu2c] = tk->dz(BSPosition);
260 double l2_err0 = tk->error(0);
261 double l2_abspar0 = fabs(tk->parameter(0));
277 if (isoMap2.isValid()){
292 typedef l1extra::L1MuonParticleCollection::const_iterator candl1;
293 for (candl1
j=myMucands1.begin();
j!=myMucands1.end();
j++) {
294 if((
j->pt() == l1->pt()) &&
295 (
j->eta() == l1->eta()) &&
296 (
j->phi() == l1->phi()) &&
297 (
j->gmtMuonCand().quality() == l1->gmtMuonCand().quality()))
304 else {imu1idx = -999;}
316 myMucands3 = * MuCands3;
319 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
321 for (cand
i=myMucands3.begin();
i!=myMucands3.end();
i++) {
325 typedef reco::MuonTrackLinksCollection::const_iterator l3muon;
332 typedef reco::RecoChargedCandidateCollection::const_iterator candl2;
333 for (candl2
i=myMucands2.begin();
i!=myMucands2.end();
i++) {
335 if ( tkl2 == staTrack ) {
break;}
339 else {imu2idx = -999;}
350 muonl3dr[imu3c] = fabs(tk->dxy(BSPosition));
354 muonl3dz[imu3c] = tk->dz(BSPosition);
362 double l3_err0 = tk->error(0);
363 double l3_abspar0 = fabs(tk->parameter(0));
379 if (isoMap3.isValid()){
394 muNoVtxMucands2 = * MuNoVtxCands2;
397 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
399 for (cand
i=muNoVtxMucands2.begin();
i!=muNoVtxMucands2.end();
i++) {
408 double l2_err0 = tk->error(0);
409 double l2_abspar0 = fabs(tk->parameter(0));
421 typedef l1extra::L1MuonParticleCollection::const_iterator candl1;
422 for (candl1
j=myMucands1.begin();
j!=myMucands1.end();
j++) {
423 if((
j->pt() == l1->pt()) &&
424 (
j->eta() == l1->eta()) &&
425 (
j->phi() == l1->phi()) &&
426 (
j->gmtMuonCand().quality() == l1->gmtMuonCand().quality()))
431 else {imu1idx = -999;}
443 if (oniaPixelCands.
isValid()) {
444 myOniaPixelCands = * oniaPixelCands;
447 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
449 for (cand
i=myOniaPixelCands.begin();
i!=myOniaPixelCands.end();
i++) {
468 if (oniaTrackCands.
isValid()) {
469 myOniaTrackCands = * oniaTrackCands;
472 typedef reco::RecoChargedCandidateCollection::const_iterator cand;
474 for (cand
i=myOniaTrackCands.begin();
i!=myOniaTrackCands.end();
i++) {
T getParameter(std::string const &) const
float * oniaPixelNormChi2
math::XYZPoint Point
point in the space
float * oniaTrackNormChi2
std::vector< Muon > MuonCollection
collection of Muon objects
void setup(const edm::ParameterSet &pSet, TTree *tree)
void analyze(const edm::Handle< reco::MuonCollection > &muon, const edm::Handle< l1extra::L1MuonParticleCollection > &mucands1, const edm::Handle< reco::RecoChargedCandidateCollection > &mucands2, const edm::Handle< edm::ValueMap< bool > > &isoMap2, const edm::Handle< reco::RecoChargedCandidateCollection > &mucands3, const edm::Handle< edm::ValueMap< bool > > &isoMap3, const edm::Handle< reco::RecoChargedCandidateCollection > &oniaPixelCands, const edm::Handle< reco::RecoChargedCandidateCollection > &oniaTrackCands, const edm::Handle< reco::RecoChargedCandidateCollection > &munovtxcands2, const reco::BeamSpot::Point &BSPosition, TTree *tree)
std::vector< std::string > getParameterNames() const
Container::value_type value_type
std::vector< RecoChargedCandidate > RecoChargedCandidateCollection
collectin of RecoChargedCandidate objects