1 #ifndef MuonTrackValidatorBase_h
2 #define MuonTrackValidatorBase_h
48 for (
unsigned int www=0;www<
label.size();www++){
54 label(pset.getParameter< std::vector<edm::InputTag> >(
"label")),
55 usetracker(pset.getParameter<bool>(
"usetracker")),
56 usemuon(pset.getParameter<bool>(
"usemuon")),
57 bsSrc(pset.getParameter< edm::InputTag >(
"beamSpot")),
58 label_tp_effic(pset.getParameter< edm::InputTag >(
"label_tp_effic")),
59 label_tp_fake(pset.getParameter< edm::InputTag >(
"label_tp_fake")),
61 out(pset.getParameter<std::
string>(
"outputFile")),
63 min(pset.getParameter<double>(
"min")),
64 max(pset.getParameter<double>(
"max")),
65 nint(pset.getParameter<int>(
"nint")),
66 useFabs(pset.getParameter<bool>(
"useFabsEta")),
67 minpT(pset.getParameter<double>(
"minpT")),
68 maxpT(pset.getParameter<double>(
"maxpT")),
69 nintpT(pset.getParameter<int>(
"nintpT")),
70 minHit(pset.getParameter<double>(
"minHit")),
71 maxHit(pset.getParameter<double>(
"maxHit")),
72 nintHit(pset.getParameter<int>(
"nintHit")),
73 minPhi(pset.getParameter<double>(
"minPhi")),
74 maxPhi(pset.getParameter<double>(
"maxPhi")),
75 nintPhi(pset.getParameter<int>(
"nintPhi")),
76 minDxy(pset.getParameter<double>(
"minDxy")),
77 maxDxy(pset.getParameter<double>(
"maxDxy")),
78 nintDxy(pset.getParameter<int>(
"nintDxy")),
79 minDz(pset.getParameter<double>(
"minDz")),
80 maxDz(pset.getParameter<double>(
"maxDz")),
81 nintDz(pset.getParameter<int>(
"nintDz")),
82 minVertpos(pset.getParameter<double>(
"minVertpos")),
83 maxVertpos(pset.getParameter<double>(
"maxVertpos")),
85 minZpos(pset.getParameter<double>(
"minZpos")),
86 maxZpos(pset.getParameter<double>(
"maxZpos")),
87 nintZpos(pset.getParameter<int>(
"nintZpos")),
88 useInvPt(pset.getParameter<bool>(
"useInvPt")),
100 ptRes_nbin(pset.getParameter<int>(
"ptRes_nbin")),
102 phiRes_nbin(pset.getParameter<int>(
"phiRes_nbin")),
103 dxyRes_nbin(pset.getParameter<int>(
"dxyRes_nbin")),
104 dzRes_nbin(pset.getParameter<int>(
"dzRes_nbin")),
121 TProfile *
p1 = (TProfile*) th2->ProfileX();
125 throw cms::Exception(
"MuonTrackValidator") <<
"Different number of bins!";
144 for (
unsigned int j=0;
j<vec.size();
j++){
151 for (
unsigned int j=0;
j<numerator.size();
j++){
152 if (denominator[
j]!=0){
154 value = ((double) numerator[
j])/((double) denominator[j]);
155 else if (type==
"fakerate")
156 value = 1-((double) numerator[j])/((double) denominator[j]);
158 err =
sqrt( value*(1-value)/(
double) denominator[j] );
171 TAxis *axis = h->GetXaxis();
172 int bins = axis->GetNbins();
174 float from = axis->GetXmin();
175 float to = axis->GetXmax();
176 float width = (to - from) / bins;
177 float *new_bins =
new float[bins + 1];
179 for (
int i = 0;
i <= bins;
i++) {
180 new_bins[
i] = TMath::Power(10, from +
i * width);
183 axis->Set(bins, new_bins);
188 std::vector<double> etaintervalsv;
189 std::vector<double> phiintervalsv;
190 std::vector<double> pTintervalsv;
191 std::vector<double> dxyintervalsv;
192 std::vector<double> dzintervalsv;
193 std::vector<double> vertposintervalsv;
194 std::vector<double> zposintervalsv;
195 std::vector<int> totSIMveta,totASSveta,totASS2veta,totRECveta;
196 std::vector<int> totSIMvpT,totASSvpT,totASS2vpT,totRECvpT;
197 std::vector<int> totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit;
198 std::vector<int> totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi;
199 std::vector<int> totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy;
200 std::vector<int> totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz;
201 std::vector<int> totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos;
204 std::vector<int> totASSveta_Quality05, totASSveta_Quality075;
205 std::vector<int> totASSvpT_Quality05, totASSvpT_Quality075;
206 std::vector<int> totASSv_phi_Quality05, totASSv_phi_Quality075;
210 etaintervalsv.push_back(
min);
213 etaintervalsv.push_back(d);
214 totSIMveta.push_back(0);
215 totASSveta.push_back(0);
216 totASS2veta.push_back(0);
217 totRECveta.push_back(0);
219 totASSveta_Quality05.push_back(0);
220 totASSveta_Quality075.push_back(0);
232 pTintervalsv.push_back(
minpT);
237 pTintervalsv.push_back(d);
238 totSIMvpT.push_back(0);
239 totASSvpT.push_back(0);
240 totASS2vpT.push_back(0);
241 totRECvpT.push_back(0);
243 totASSvpT_Quality05.push_back(0);
244 totASSvpT_Quality075.push_back(0);
256 totSIMv_hit.push_back(0);
257 totASSv_hit.push_back(0);
258 totASS2v_hit.push_back(0);
259 totRECv_hit.push_back(0);
267 phiintervalsv.push_back(
minPhi);
270 phiintervalsv.push_back(d);
271 totSIMv_phi.push_back(0);
272 totASSv_phi.push_back(0);
273 totASS2v_phi.push_back(0);
274 totRECv_phi.push_back(0);
276 totASSv_phi_Quality05.push_back(0);
277 totASSv_phi_Quality075.push_back(0);
289 dxyintervalsv.push_back(
minDxy);
292 dxyintervalsv.push_back(d);
293 totSIMv_dxy.push_back(0);
294 totASSv_dxy.push_back(0);
295 totASS2v_dxy.push_back(0);
296 totRECv_dxy.push_back(0);
306 dzintervalsv.push_back(
minDz);
309 dzintervalsv.push_back(d);
310 totSIMv_dz.push_back(0);
311 totASSv_dz.push_back(0);
312 totASS2v_dz.push_back(0);
313 totRECv_dz.push_back(0);
325 vertposintervalsv.push_back(d);
326 totSIMv_vertpos.push_back(0);
327 totASSv_vertpos.push_back(0);
334 zposintervalsv.push_back(
minZpos);
337 zposintervalsv.push_back(d);
338 totSIMv_zpos.push_back(0);
339 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
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
virtual ~MuonTrackValidatorBase()
Destructor.
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_recophi
std::vector< std::vector< int > > totASSpT
std::vector< std::vector< int > > totASS_phi_Quality075
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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)
std::vector< const TrackAssociatorBase * > associator
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
volatile std::atomic< bool > shutdown_flag false
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
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 * > nCSChits_vs_eta
std::vector< MonitorElement * > h_simuleta
std::vector< MonitorElement * > h_assoc2eta
edm::EDGetTokenT< reco::BeamSpot > bsSrc_Token