119 std::vector<std::pair<RefToBase<Track>,
double> > rvGlb;
121 if(glbsimToRecoCollection.find(tp) != glbsimToRecoCollection.end()){
122 rvGlb = glbsimToRecoCollection[tp];
123 if(rvGlb.size() != 0) {
124 rGlb = rvGlb.begin()->first;
128 std::vector<std::pair<RefToBase<Track>,
double> > rvSta;
130 if(stasimToRecoCollection.find(tp) != stasimToRecoCollection.end()){
131 rvSta = stasimToRecoCollection[tp];
132 if(rvSta.size() != 0) {
133 rSta = rvSta.begin()->first;
137 std::vector<std::pair<RefToBase<Track>,
double> > rvTk;
139 if(tksimToRecoCollection.find(tp) != tksimToRecoCollection.end()){
140 rvTk = tksimToRecoCollection[tp];
141 if(rvTk.size() != 0) {
142 rTk = rvTk.begin()->first;
146 if( rvSta.size() != 0 && rvTk.size() != 0 ){
151 for ( reco::MuonTrackLinksCollection::const_iterator links = muHandle->begin(); links != muHandle->end(); ++links ) {
175 for ( reco::MuonTrackLinksCollection::const_iterator links = muHandle->begin(); links != muHandle->end(); ++links ) {
180 std::vector<std::pair<TrackingParticleRef, double> > tp1;
182 if(glbrecoToSimCollection.find(glbRef) != glbrecoToSimCollection.end()){
183 tp1 = glbrecoToSimCollection[glbRef];
184 if(tp1.size() != 0) {
185 tp1r = tp1.begin()->first;
189 std::vector<std::pair<TrackingParticleRef, double> > tp2;
191 if(starecoToSimCollection.find(staRef) != starecoToSimCollection.end()){
192 tp2 = starecoToSimCollection[staRef];
193 if(tp2.size() != 0) {
194 tp2r = tp2.begin()->first;
198 std::vector<std::pair<TrackingParticleRef, double> > tp3;
200 if(tkrecoToSimCollection.find(tkRef) != tkrecoToSimCollection.end()){
201 tp3 = tkrecoToSimCollection[tkRef];
202 if(tp3.size() != 0) {
203 tp3r = tp3.begin()->first;
208 if(tp1.size() != 0) {
231 std::string
dirName=
"Matcher/";
278 TH2F * h1 = recoTH2->
getTH2F();
279 TH1D*
reco = h1->ProjectionX();
282 TH1D*
sim = h2 ->ProjectionX();
285 TH1F *hEff = (TH1F*) reco->Clone();
289 hEff->SetName(
"tmp_"+TString(reco->GetName()));
292 int nBinsEta = hEff->GetNbinsX();
293 for(
int bin = 1;
bin <= nBinsEta;
bin++) {
294 float nSimHit = sim->GetBinContent(
bin);
295 float eff = hEff->GetBinContent(
bin);
297 if(nSimHit != 0 && eff <= 1) {
298 error =
sqrt(eff*(1-eff)/nSimHit);
300 hEff->SetBinError(
bin, error);
308 TH2F * h1 = recoTH2->
getTH2F();
309 TH1D*
reco = h1->ProjectionY();
312 TH1D*
sim = h2 ->ProjectionY();
315 TH1F *hEff = (TH1F*) reco->Clone();
319 hEff->SetName(
"tmp_"+TString(reco->GetName()));
322 int nBinsPt = hEff->GetNbinsX();
323 for(
int bin = 1;
bin <= nBinsPt;
bin++) {
324 float nSimHit = sim->GetBinContent(
bin);
325 float eff = hEff->GetBinContent(
bin);
327 if(nSimHit != 0 && eff <= 1) {
328 error =
sqrt(eff*(1-eff)/nSimHit);
330 hEff->SetBinError(
bin, error);
MonitorElement * h_goodMatchSim
T getUntrackedParameter(std::string const &, T const &) const
const TrackAssociatorBase * muAssociator_
MonitorElement * h_tkOnlySim
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * h_shouldMatch
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::vector< TrackingParticle > TrackingParticleCollection
~GlobalMuonMatchAnalyzer()
void cd(void)
go to top directory (ie. root)
virtual reco::SimToRecoCollection associateSimToReco(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
MonitorElement * h_fakePt
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< MuonTrackLinks > MuonTrackLinksCollection
collection of MuonTrackLinks
MonitorElement * h_fakeMatch
double eta() const
pseudorapidity of momentum vector
MonitorElement * h_totReco
std::string tkAssociatorName_
void computeEfficiencyPt(MonitorElement *, MonitorElement *recoTH2, MonitorElement *simTH2)
double pt() const
track transverse momentum
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
MonitorElement * h_staOnlySim
std::string muAssociatorName_
GlobalMuonMatchAnalyzer(const edm::ParameterSet &)
T const * product() const
const TrackAssociatorBase * tkAssociator_
MonitorElement * h_efficPt
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
MonitorElement * h_goodMatch
void computeEfficiencyEta(MonitorElement *, MonitorElement *recoTH2, MonitorElement *simTH2)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void setCurrentFolder(const std::string &fullpath)