1 #ifndef MuonTrackValidatorBase_h
2 #define MuonTrackValidatorBase_h
46 for (
unsigned int www=0;www<
label.size();www++){
52 label(pset.getParameter< std::vector<edm::
InputTag> >(
"label")),
53 usetracker(pset.getParameter<bool>(
"usetracker")),
54 usemuon(pset.getParameter<bool>(
"usemuon")),
59 out(pset.getParameter<std::
string>(
"outputFile")),
61 min(pset.getParameter<double>(
"min")),
62 max(pset.getParameter<double>(
"max")),
63 nint(pset.getParameter<int>(
"nint")),
64 useFabs(pset.getParameter<bool>(
"useFabsEta")),
65 minpT(pset.getParameter<double>(
"minpT")),
66 maxpT(pset.getParameter<double>(
"maxpT")),
67 nintpT(pset.getParameter<int>(
"nintpT")),
68 minHit(pset.getParameter<double>(
"minHit")),
69 maxHit(pset.getParameter<double>(
"maxHit")),
70 nintHit(pset.getParameter<int>(
"nintHit")),
71 minPhi(pset.getParameter<double>(
"minPhi")),
72 maxPhi(pset.getParameter<double>(
"maxPhi")),
73 nintPhi(pset.getParameter<int>(
"nintPhi")),
74 minDxy(pset.getParameter<double>(
"minDxy")),
75 maxDxy(pset.getParameter<double>(
"maxDxy")),
76 nintDxy(pset.getParameter<int>(
"nintDxy")),
77 minDz(pset.getParameter<double>(
"minDz")),
78 maxDz(pset.getParameter<double>(
"maxDz")),
79 nintDz(pset.getParameter<int>(
"nintDz")),
80 minVertpos(pset.getParameter<double>(
"minVertpos")),
81 maxVertpos(pset.getParameter<double>(
"maxVertpos")),
83 minZpos(pset.getParameter<double>(
"minZpos")),
84 maxZpos(pset.getParameter<double>(
"maxZpos")),
85 nintZpos(pset.getParameter<int>(
"nintZpos")),
86 useInvPt(pset.getParameter<bool>(
"useInvPt")),
98 ptRes_nbin(pset.getParameter<int>(
"ptRes_nbin")),
100 phiRes_nbin(pset.getParameter<int>(
"phiRes_nbin")),
101 dxyRes_nbin(pset.getParameter<int>(
"dxyRes_nbin")),
102 dzRes_nbin(pset.getParameter<int>(
"dzRes_nbin")),
119 TProfile *
p1 = (TProfile*) th2->ProfileX();
123 throw cms::Exception(
"MuonTrackValidator") <<
"Different number of bins!";
142 for (
unsigned int j=0;
j<vec.size();
j++){
149 for (
unsigned int j=0;
j<numerator.size();
j++){
150 if (denominator[
j]!=0){
152 value = ((double) numerator[
j])/((double) denominator[j]);
153 else if (type==
"fakerate")
154 value = 1-((double) numerator[j])/((double) denominator[j]);
156 err =
sqrt( value*(1-value)/(
double) denominator[j] );
169 TAxis *axis = h->GetXaxis();
170 int bins = axis->GetNbins();
172 float from = axis->GetXmin();
173 float to = axis->GetXmax();
174 float width = (to - from) / bins;
175 float *new_bins =
new float[bins + 1];
177 for (
int i = 0;
i <= bins;
i++) {
178 new_bins[
i] = TMath::Power(10, from +
i * width);
181 axis->Set(bins, new_bins);
186 std::vector<double> etaintervalsv;
187 std::vector<double> phiintervalsv;
188 std::vector<double> pTintervalsv;
189 std::vector<double> dxyintervalsv;
190 std::vector<double> dzintervalsv;
191 std::vector<double> vertposintervalsv;
192 std::vector<double> zposintervalsv;
193 std::vector<int> totSIMveta,totASSveta,totASS2veta,totRECveta;
194 std::vector<int> totSIMvpT,totASSvpT,totASS2vpT,totRECvpT;
195 std::vector<int> totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit;
196 std::vector<int> totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi;
197 std::vector<int> totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy;
198 std::vector<int> totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz;
199 std::vector<int> totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos;
202 std::vector<int> totASSveta_Quality05, totASSveta_Quality075;
203 std::vector<int> totASSvpT_Quality05, totASSvpT_Quality075;
204 std::vector<int> totASSv_phi_Quality05, totASSv_phi_Quality075;
208 etaintervalsv.push_back(
min);
211 etaintervalsv.push_back(d);
212 totSIMveta.push_back(0);
213 totASSveta.push_back(0);
214 totASS2veta.push_back(0);
215 totRECveta.push_back(0);
217 totASSveta_Quality05.push_back(0);
218 totASSveta_Quality075.push_back(0);
230 pTintervalsv.push_back(
minpT);
235 pTintervalsv.push_back(d);
236 totSIMvpT.push_back(0);
237 totASSvpT.push_back(0);
238 totASS2vpT.push_back(0);
239 totRECvpT.push_back(0);
241 totASSvpT_Quality05.push_back(0);
242 totASSvpT_Quality075.push_back(0);
254 totSIMv_hit.push_back(0);
255 totASSv_hit.push_back(0);
256 totASS2v_hit.push_back(0);
257 totRECv_hit.push_back(0);
265 phiintervalsv.push_back(
minPhi);
268 phiintervalsv.push_back(d);
269 totSIMv_phi.push_back(0);
270 totASSv_phi.push_back(0);
271 totASS2v_phi.push_back(0);
272 totRECv_phi.push_back(0);
274 totASSv_phi_Quality05.push_back(0);
275 totASSv_phi_Quality075.push_back(0);
287 dxyintervalsv.push_back(
minDxy);
290 dxyintervalsv.push_back(d);
291 totSIMv_dxy.push_back(0);
292 totASSv_dxy.push_back(0);
293 totASS2v_dxy.push_back(0);
294 totRECv_dxy.push_back(0);
304 dzintervalsv.push_back(
minDz);
307 dzintervalsv.push_back(d);
308 totSIMv_dz.push_back(0);
309 totASSv_dz.push_back(0);
310 totASS2v_dz.push_back(0);
311 totRECv_dz.push_back(0);
323 vertposintervalsv.push_back(d);
324 totSIMv_vertpos.push_back(0);
325 totASSv_vertpos.push_back(0);
332 zposintervalsv.push_back(
minZpos);
335 zposintervalsv.push_back(d);
336 totSIMv_zpos.push_back(0);
337 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)
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