35 theMuTrackCollectionLabel_ = consumes<reco::TrackCollection>(
parameters.getParameter<
edm::InputTag>(
"MuTrackCollection"));
54 theDbe->setCurrentFolder(
"Muons/SegmentTrackAnalyzer");
59 hitsNotUsed = theDbe->book1D(
"HitsNotUsedForGlobalTracking_"+trackCollection,
"recHits not used for GLB ["+trackCollection+
"]", 50, -0.5, 49.5);
60 hitsNotUsedPercentual = theDbe->book1D(
"HitsNotUsedForGlobalTrackingDvHitUsed_"+trackCollection,
"(recHits_{notUsedForGLB}) / (recHits_{GLB}) ["+trackCollection+
"]", 100, 0, 1.);
62 TrackSegm = theDbe->book2D(
"trackSegments_"+trackCollection,
"Number of segments associated to the track ["+trackCollection+
"]", 3, 0.5, 3.5, 8, 0, 8);
63 TrackSegm->setBinLabel(1,
"DT+CSC",1);
64 TrackSegm->setBinLabel(2,
"DT",1);
65 TrackSegm->setBinLabel(3,
"CSC",1);
67 hitStaProvenance = theDbe->book1D(
"trackHitStaProvenance_"+trackCollection,
"Number of recHits_{STAinTrack} ["+trackCollection+
"]", 7, 0.5, 7.5);
68 hitStaProvenance->setBinLabel(1,
"DT");
69 hitStaProvenance->setBinLabel(2,
"CSC");
70 hitStaProvenance->setBinLabel(3,
"RPC");
71 hitStaProvenance->setBinLabel(4,
"DT+CSC");
72 hitStaProvenance->setBinLabel(5,
"DT+RPC");
73 hitStaProvenance->setBinLabel(6,
"CSC+RPC");
74 hitStaProvenance->setBinLabel(7,
"DT+CSC+RPC");
77 if(trackCollection!=
"standAloneMuons"){
78 hitTkrProvenance = theDbe->book1D(
"trackHitTkrProvenance_"+trackCollection,
"Number of recHits_{TKinTrack} ["+trackCollection+
"]", 6, 0.5, 6.5);
79 hitTkrProvenance->setBinLabel(1,
"PixBarrel");
80 hitTkrProvenance->setBinLabel(2,
"PixEndCap");
81 hitTkrProvenance->setBinLabel(3,
"TIB");
82 hitTkrProvenance->setBinLabel(4,
"TID");
83 hitTkrProvenance->setBinLabel(5,
"TOB");
84 hitTkrProvenance->setBinLabel(6,
"TEC");
87 int etaBin =
parameters.getParameter<
int>(
"etaBin");
90 trackHitPercentualVsEta = theDbe->book2D(
"trackHitDivtrackSegmHitVsEta_"+trackCollection,
"(recHits_{Track} / recHits_{associatedSegm}) vs #eta [" +trackCollection+
"]", etaBin, etaMin, etaMax, 20, 0, 1);
91 dtTrackHitPercentualVsEta = theDbe->book2D(
"dtTrackHitDivtrackSegmHitVsEta_"+trackCollection,
"(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+
"]", etaBin, etaMin, etaMax, 20, 0, 1);
92 cscTrackHitPercentualVsEta = theDbe->book2D(
"cscTrackHitDivtrackSegmHitVsEta_"+trackCollection,
"(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #eta [" +trackCollection+
"]", etaBin, etaMin, etaMax, 20, 0, 1);
94 int phiBin =
parameters.getParameter<
int>(
"phiBin");
97 trackHitPercentualVsPhi = theDbe->book2D(
"trackHitDivtrackSegmHitVsPhi_"+trackCollection,
"(recHits_{Track} / recHits_{associatedSegm}) vs #phi [" +trackCollection+
"]", phiBin, phiMin, phiMax, 20, 0, 1);
98 trackHitPercentualVsPhi->setAxisTitle(
"rad",2);
99 dtTrackHitPercentualVsPhi = theDbe->book2D(
"dtTrackHitDivtrackSegmHitVsPhi_"+trackCollection,
"(recHits_{DTinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+
"]", phiBin, phiMin, phiMax, 20, 0, 1);
100 dtTrackHitPercentualVsPhi->setAxisTitle(
"rad",2);
101 cscTrackHitPercentualVsPhi = theDbe->book2D(
"cscTrackHitDivtrackSegmHitVsPhi_"+trackCollection,
"(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs #phi [" +trackCollection+
"]", phiBin, phiMin, phiMax, 20, 0, 1);
102 cscTrackHitPercentualVsPhi->setAxisTitle(
"rad",2);
104 int ptBin =
parameters.getParameter<
int>(
"ptBin");
107 trackHitPercentualVsPt = theDbe->book2D(
"trackHitDivtrackSegmHitVsPt_"+trackCollection,
"(recHits_{Track} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+
"]", ptBin, ptMin, ptMax, 20, 0, 1);
108 trackHitPercentualVsPt->setAxisTitle(
"GeV",2);
109 dtTrackHitPercentualVsPt = theDbe->book2D(
"dtTrackHitDivtrackSegmHitVsPt_"+trackCollection,
"(recHits_{DTinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+
"]", ptBin, ptMin, ptMax, 20, 0, 1);
110 dtTrackHitPercentualVsPt->setAxisTitle(
"GeV",2);
111 cscTrackHitPercentualVsPt = theDbe->book2D(
"cscTrackHitDivtrackSegmHitVsPt_"+trackCollection,
"(recHits_{CSCinTrack} / recHits_{associatedSegm}) vs 1/p_{t} [" +trackCollection+
"]", ptBin, ptMin, ptMax, 20, 0, 1);
112 cscTrackHitPercentualVsPt->setAxisTitle(
"GeV",2);
119 theService->update(iSetup);
122 iEvent.
getByToken(theMuTrackCollectionLabel_,glbTracks);
124 for (reco::TrackCollection::const_iterator recoTrack = glbTracks->begin(); recoTrack!=glbTracks->end(); ++recoTrack){
128 cout <<
"[SegmentTrackAnalyzer] # of segments associated to the track: "<<(segments).
size() <<endl;
130 LogTrace(
metname)<<
"[SegmentTrackAnalyzer] # of segments associated to the track: "<<(segments).
size();
138 int hitsFromSegmDt=0;
139 int hitsFromSegmCsc=0;
144 for (MuonTransientTrackingRecHit::MuonRecHitContainer::const_iterator segment=segments.begin();
145 segment!=segments.end(); segment++) {
147 DetId id = (*segment)->geographicalId();
153 if((*seg4D).hasPhi())
155 if((*seg4D).hasZed())
156 hitsFromSegmDt+=(*seg4D).zSegment()->specificRecHits().size();
162 hitsFromSegmCsc+=(*segment)->recHits().size();
173 DetId id = (*recHit)->geographicalId();
187 hitTkrProvenance->Fill(1);
189 hitTkrProvenance->Fill(2);
191 hitTkrProvenance->Fill(3);
193 hitTkrProvenance->Fill(4);
195 hitTkrProvenance->Fill(5);
197 hitTkrProvenance->Fill(6);
203 hitsNotUsed->Fill(hitsFromSegmDt+hitsFromSegmCsc+hitsFromRpc+hitsFromTk-hitsFromTrack);
204 hitsNotUsedPercentual->Fill(
double(hitsFromSegmDt+hitsFromSegmCsc+hitsFromRpc+hitsFromTk-hitsFromTrack)/hitsFromTrack);
206 if(hitsFromDt!=0 && hitsFromCsc!=0)
207 TrackSegm->Fill(1,segmFromDt+segmFromCsc);
208 if(hitsFromDt!=0 && hitsFromCsc==0)
209 TrackSegm->Fill(2,segmFromDt);
210 if(hitsFromDt==0 && hitsFromCsc!=0)
211 TrackSegm->Fill(3,segmFromCsc);
213 if(hitsFromDt!=0 && hitsFromCsc==0 && hitsFromRpc==0) hitStaProvenance->Fill(1);
214 if(hitsFromCsc!=0 && hitsFromDt==0 && hitsFromRpc==0) hitStaProvenance->Fill(2);
215 if(hitsFromRpc!=0 && hitsFromDt==0 && hitsFromCsc==0) hitStaProvenance->Fill(3);
216 if(hitsFromDt!=0 && hitsFromCsc!=0 && hitsFromRpc==0) hitStaProvenance->Fill(4);
217 if(hitsFromDt!=0 && hitsFromRpc!=0 && hitsFromCsc==0) hitStaProvenance->Fill(5);
218 if(hitsFromCsc!=0 && hitsFromRpc!=0 && hitsFromDt==0) hitStaProvenance->Fill(6);
219 if(hitsFromDt!=0 && hitsFromCsc!=0 && hitsFromRpc!=0) hitStaProvenance->Fill(7);
221 if(hitsFromSegmDt+hitsFromSegmCsc !=0){
222 trackHitPercentualVsEta->Fill(recoTrack->eta(), double(hitsFromDt+hitsFromCsc)/(hitsFromSegmDt+hitsFromSegmCsc));
223 trackHitPercentualVsPhi->Fill(recoTrack->phi(), double(hitsFromDt+hitsFromCsc)/(hitsFromSegmDt+hitsFromSegmCsc));
224 trackHitPercentualVsPt->Fill(recoTrack->pt(), double(hitsFromDt+hitsFromCsc)/(hitsFromSegmDt+hitsFromSegmCsc));
227 if(hitsFromSegmDt!=0){
228 dtTrackHitPercentualVsEta->Fill(recoTrack->eta(), double(hitsFromDt)/hitsFromSegmDt);
229 dtTrackHitPercentualVsPhi->Fill(recoTrack->phi(), double(hitsFromDt)/hitsFromSegmDt);
230 dtTrackHitPercentualVsPt->Fill(recoTrack->pt(), double(hitsFromDt)/hitsFromSegmDt);
233 if(hitsFromSegmCsc!=0){
234 cscTrackHitPercentualVsEta->Fill(recoTrack->eta(), double(hitsFromCsc)/hitsFromSegmCsc);
235 cscTrackHitPercentualVsPhi->Fill(recoTrack->phi(), double(hitsFromCsc)/hitsFromSegmCsc);
236 cscTrackHitPercentualVsPt->Fill(recoTrack->pt(), double(hitsFromCsc)/hitsFromSegmCsc);
static PFTauRenderPlugin instance
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string metname
const DTChamberRecSegment2D * phiSegment() const
The superPhi segment: 0 if no phi projection available.
void beginJob()
Inizialize parameters for histo binning.
SegmentTrackAnalyzer(const edm::ParameterSet &)
Constructor.
std::vector< DTRecHit1D > specificRecHits() const
Access to specific components.
void analyze(const edm::Event &, const edm::EventSetup &)
Get the analysis.
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
std::vector< MuonRecHitPointer > MuonRecHitContainer
tuple size
Write out results.