1 #ifndef MuonTrackValidatorBase_h 2 #define MuonTrackValidatorBase_h 45 for (
unsigned int www=0;www<
label.size();www++){
51 label(pset.getParameter<
std::vector<
edm::InputTag> >(
"label")),
52 usetracker(pset.getParameter<bool>(
"usetracker")),
53 usemuon(pset.getParameter<bool>(
"usemuon")),
54 bsSrc(pset.getParameter<
edm::InputTag >(
"beamSpot")),
60 min(pset.getParameter<double>(
"min")),
61 max(pset.getParameter<double>(
"max")),
62 nint(pset.getParameter<
int>(
"nint")),
63 useFabs(pset.getParameter<bool>(
"useFabsEta")),
64 minpT(pset.getParameter<double>(
"minpT")),
65 maxpT(pset.getParameter<double>(
"maxpT")),
67 minHit(pset.getParameter<double>(
"minHit")),
68 maxHit(pset.getParameter<double>(
"maxHit")),
70 minPhi(pset.getParameter<double>(
"minPhi")),
71 maxPhi(pset.getParameter<double>(
"maxPhi")),
73 minDxy(pset.getParameter<double>(
"minDxy")),
74 maxDxy(pset.getParameter<double>(
"maxDxy")),
76 minDz(pset.getParameter<double>(
"minDz")),
77 maxDz(pset.getParameter<double>(
"maxDz")),
79 minVertpos(pset.getParameter<double>(
"minVertpos")),
80 maxVertpos(pset.getParameter<double>(
"maxVertpos")),
82 minZpos(pset.getParameter<double>(
"minZpos")),
83 maxZpos(pset.getParameter<double>(
"maxZpos")),
85 useInvPt(pset.getParameter<bool>(
"useInvPt")),
118 TProfile *
p1 = (TProfile*) th2->ProfileX();
122 throw cms::Exception(
"MuonTrackValidator") <<
"Different number of bins!";
141 for (
unsigned int j=0;
j<vec.size();
j++){
148 for (
unsigned int j=0;
j<numerator.size();
j++){
149 if (denominator[
j]!=0){
151 value = ((double) numerator[
j])/((double) denominator[j]);
152 else if (type==
"fakerate")
153 value = 1-((double) numerator[j])/((double) denominator[j]);
155 err =
sqrt( value*(1-value)/(
double) denominator[j] );
168 TAxis *axis = h->GetXaxis();
169 int bins = axis->GetNbins();
171 float from = axis->GetXmin();
172 float to = axis->GetXmax();
173 float width = (to - from) / bins;
174 float *new_bins =
new float[bins + 1];
176 for (
int i = 0;
i <=
bins;
i++) {
177 new_bins[
i] = TMath::Power(10, from +
i * width);
180 axis->Set(bins, new_bins);
185 std::vector<double> etaintervalsv;
186 std::vector<double> phiintervalsv;
187 std::vector<double> pTintervalsv;
188 std::vector<double> dxyintervalsv;
189 std::vector<double> dzintervalsv;
190 std::vector<double> vertposintervalsv;
191 std::vector<double> zposintervalsv;
192 std::vector<int> totSIMveta,totASSveta,totASS2veta,totRECveta;
193 std::vector<int> totSIMvpT,totASSvpT,totASS2vpT,totRECvpT;
194 std::vector<int> totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit;
195 std::vector<int> totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi;
196 std::vector<int> totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy;
197 std::vector<int> totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz;
198 std::vector<int> totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos;
201 std::vector<int> totASSveta_Quality05, totASSveta_Quality075;
202 std::vector<int> totASSvpT_Quality05, totASSvpT_Quality075;
203 std::vector<int> totASSv_phi_Quality05, totASSv_phi_Quality075;
207 etaintervalsv.push_back(
min);
210 etaintervalsv.push_back(d);
211 totSIMveta.push_back(0);
212 totASSveta.push_back(0);
213 totASS2veta.push_back(0);
214 totRECveta.push_back(0);
216 totASSveta_Quality05.push_back(0);
217 totASSveta_Quality075.push_back(0);
229 pTintervalsv.push_back(
minpT);
234 pTintervalsv.push_back(d);
235 totSIMvpT.push_back(0);
236 totASSvpT.push_back(0);
237 totASS2vpT.push_back(0);
238 totRECvpT.push_back(0);
240 totASSvpT_Quality05.push_back(0);
241 totASSvpT_Quality075.push_back(0);
253 totSIMv_hit.push_back(0);
254 totASSv_hit.push_back(0);
255 totASS2v_hit.push_back(0);
256 totRECv_hit.push_back(0);
264 phiintervalsv.push_back(
minPhi);
267 phiintervalsv.push_back(d);
268 totSIMv_phi.push_back(0);
269 totASSv_phi.push_back(0);
270 totASS2v_phi.push_back(0);
271 totRECv_phi.push_back(0);
273 totASSv_phi_Quality05.push_back(0);
274 totASSv_phi_Quality075.push_back(0);
286 dxyintervalsv.push_back(
minDxy);
289 dxyintervalsv.push_back(d);
290 totSIMv_dxy.push_back(0);
291 totASSv_dxy.push_back(0);
292 totASS2v_dxy.push_back(0);
293 totRECv_dxy.push_back(0);
303 dzintervalsv.push_back(
minDz);
306 dzintervalsv.push_back(d);
307 totSIMv_dz.push_back(0);
308 totASSv_dz.push_back(0);
309 totASS2v_dz.push_back(0);
310 totRECv_dz.push_back(0);
322 vertposintervalsv.push_back(d);
323 totSIMv_vertpos.push_back(0);
324 totASSv_vertpos.push_back(0);
331 zposintervalsv.push_back(
minZpos);
334 zposintervalsv.push_back(d);
335 totSIMv_zpos.push_back(0);
336 totASSv_zpos.push_back(0);
std::vector< MonitorElement * > h_assoc2phi
std::vector< MonitorElement * > h_recoeta
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< MonitorElement * > nrecHit_vs_nsimHit_sim2rec
std::vector< MonitorElement * > h_DThits_eta
std::vector< MonitorElement * > h_assoc2hit
std::vector< std::vector< int > > totASS_zpos
std::vector< MonitorElement * > h_PurityVsQuality
std::vector< std::vector< int > > totASSeta_Quality05
std::vector< MonitorElement * > h_recopT
edm::ESHandle< MagneticField > theMF
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< std::vector< int > > totREC_phi
double cotThetaRes_rangeMin
std::vector< MonitorElement * > h_assoc2dxy
std::vector< MonitorElement * > nrecHit_vs_nsimHit_rec2sim
std::vector< std::vector< int > > totASS2_hit
std::vector< edm::EDGetTokenT< edm::View< reco::Track > > > track_Collection_Token
void fillPlotFromVectors(MonitorElement *h, std::vector< int > &numerator, std::vector< int > &denominator, std::string type)
std::vector< MonitorElement * > h_assocpT_Quality075
std::vector< std::vector< int > > totRECpT
std::vector< TrackingParticle > TrackingParticleCollection
std::vector< std::vector< int > > totREC_dz
std::vector< MonitorElement * > nrec_vs_nsim
std::vector< MonitorElement * > h_pullDz
std::vector< MonitorElement * > h_recohit
std::vector< MonitorElement * > h_etaSIM
bool ignoremissingtkcollection_
std::vector< MonitorElement * > h_assocvertpos
std::vector< MonitorElement * > h_fakes
virtual double getEta(double eta)
std::vector< MonitorElement * > h_eta
std::vector< std::vector< int > > totASS_dz
std::vector< std::vector< double > > etaintervals
std::vector< MonitorElement * > h_pt
std::vector< MonitorElement * > h_pullQoverp
std::string parametersDefiner
std::vector< std::vector< int > > totSIM_zpos
std::vector< MonitorElement * > h_CSChits_eta
std::vector< std::vector< int > > totASS2_dz
std::vector< std::vector< int > > totASS_phi_Quality05
double cotThetaRes_rangeMax
std::vector< MonitorElement * > h_assoceta
std::vector< MonitorElement * > h_tracks
std::vector< std::vector< double > > dxyintervals
std::vector< MonitorElement * > h_assoceta_Quality075
std::vector< MonitorElement * > nDThits_vs_eta
std::vector< std::vector< int > > totASS_phi
std::vector< std::vector< int > > totASS_dxy
virtual ~MuonTrackValidatorBase()(false)
Destructor.
std::vector< MonitorElement * > h_simuldxy
std::vector< std::vector< int > > totSIM_dxy
std::vector< MonitorElement * > h_simuldz
std::vector< std::vector< int > > totASSeta_Quality075
std::vector< MonitorElement * > nhits_vs_eta
virtual double getPt(double pt)
edm::InputTag label_tp_fake
std::vector< MonitorElement * > h_assoczpos
std::vector< MonitorElement * > h_simulphi
std::vector< std::vector< int > > totASS2pT
std::vector< MonitorElement * > h_vertposSIM
edm::EDGetTokenT< TrackingParticleCollection > tp_fake_Token
virtual void doProfileX(TH2 *th2, MonitorElement *me)
std::vector< edm::InputTag > label
std::vector< MonitorElement * > h_assocSharedHit
std::vector< std::vector< double > > pTintervals
std::vector< std::vector< int > > totASS2eta
std::vector< std::vector< int > > totSIMpT
std::vector< std::vector< int > > totREC_dxy
std::vector< MonitorElement * > h_assoc2dz
MuonTrackValidatorBase(const edm::ParameterSet &pset, edm::ConsumesCollector iC)
Constructor.
std::vector< MonitorElement * > h_pullPhi
std::vector< std::vector< int > > totSIM_hit
std::vector< MonitorElement * > h_GEMhits_eta
std::vector< MonitorElement * > h_recophi
std::vector< std::vector< int > > totASSpT
std::vector< std::vector< int > > totASS_phi_Quality075
std::vector< MonitorElement * > nME0hits_vs_eta
std::vector< MonitorElement * > h_pullTheta
std::vector< std::vector< int > > totSIM_vertpos
std::vector< std::vector< int > > totASSpT_Quality05
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
std::vector< std::vector< int > > totREC_hit
std::vector< MonitorElement * > h_simulhit
std::vector< std::vector< int > > totSIMeta
std::vector< std::vector< int > > totASS2_dxy
std::vector< MonitorElement * > h_charge
std::vector< MonitorElement * > h_assocphi
virtual void doProfileX(MonitorElement *th2m, MonitorElement *me)
std::vector< std::vector< int > > totASS2_phi
std::vector< std::vector< double > > phiintervals
edm::InputTag label_tp_effic
std::vector< std::vector< int > > totASSpT_Quality075
std::vector< MonitorElement * > h_assocpT
std::vector< MonitorElement * > h_pullDxy
std::vector< MonitorElement * > h_simulpT
std::vector< MonitorElement * > h_tracksSIM
std::vector< MonitorElement * > h_assocphi_Quality05
std::vector< MonitorElement * > h_simulzpos
std::vector< MonitorElement * > h_recodz
std::vector< MonitorElement * > h_assocphi_Quality075
std::vector< std::vector< int > > totSIM_phi
void fillPlotFromVector(MonitorElement *h, std::vector< int > &vec)
std::vector< MonitorElement * > h_hits_eta
std::vector< MonitorElement * > h_hits
std::vector< std::vector< int > > totASSeta
std::vector< MonitorElement * > h_simulvertpos
MuonTrackValidatorBase(const edm::ParameterSet &pset)
TProfile * getTProfile(void) const
std::vector< std::vector< int > > totRECeta
std::vector< std::vector< double > > vertposintervals
std::vector< std::vector< double > > dzintervals
std::vector< MonitorElement * > h_recodxy
std::vector< MonitorElement * > h_ptSIM
int getNbinsX(void) const
get # of bins in X-axis
std::vector< MonitorElement * > h_assocdz
std::vector< std::vector< double > > zposintervals
std::vector< MonitorElement * > h_assocpT_Quality05
std::vector< MonitorElement * > h_RPChits_eta
std::vector< MonitorElement * > h_assoc2pT
std::vector< MonitorElement * > h_assocFraction
TH2F * getTH2F(void) const
std::vector< std::vector< int > > totSIM_dz
std::vector< std::string > associators
std::vector< MonitorElement * > h_assoceta_Quality05
std::vector< MonitorElement * > h_assocdxy
std::vector< MonitorElement * > h_ME0hits_eta
edm::EDGetTokenT< TrackingParticleCollection > tp_effic_Token
std::vector< MonitorElement * > nRPChits_vs_eta
std::vector< std::vector< int > > totASS_vertpos
std::vector< MonitorElement * > h_assochit
Power< A, B >::type pow(const A &a, const B &b)
std::vector< std::vector< int > > totASS_hit
std::vector< MonitorElement * > nGEMhits_vs_eta
std::vector< MonitorElement * > nCSChits_vs_eta
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > h_assoc2eta
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token