1 #ifndef MuonTrackValidatorBase_h
2 #define MuonTrackValidatorBase_h
40 label(pset.getParameter< std::vector<edm::InputTag> >(
"label")),
41 usetracker(pset.getParameter<bool>(
"usetracker")),
42 usemuon(pset.getParameter<bool>(
"usemuon")),
43 bsSrc(pset.getParameter< edm::InputTag >(
"beamSpot")),
44 label_tp_effic(pset.getParameter< edm::InputTag >(
"label_tp_effic")),
45 label_tp_fake(pset.getParameter< edm::InputTag >(
"label_tp_fake")),
47 out(pset.getParameter<std::
string>(
"outputFile")),
49 min(pset.getParameter<double>(
"min")),
50 max(pset.getParameter<double>(
"max")),
51 nint(pset.getParameter<int>(
"nint")),
52 useFabs(pset.getParameter<bool>(
"useFabsEta")),
53 minpT(pset.getParameter<double>(
"minpT")),
54 maxpT(pset.getParameter<double>(
"maxpT")),
55 nintpT(pset.getParameter<int>(
"nintpT")),
56 minHit(pset.getParameter<double>(
"minHit")),
57 maxHit(pset.getParameter<double>(
"maxHit")),
58 nintHit(pset.getParameter<int>(
"nintHit")),
59 minPhi(pset.getParameter<double>(
"minPhi")),
60 maxPhi(pset.getParameter<double>(
"maxPhi")),
61 nintPhi(pset.getParameter<int>(
"nintPhi")),
62 minDxy(pset.getParameter<double>(
"minDxy")),
63 maxDxy(pset.getParameter<double>(
"maxDxy")),
64 nintDxy(pset.getParameter<int>(
"nintDxy")),
65 minDz(pset.getParameter<double>(
"minDz")),
66 maxDz(pset.getParameter<double>(
"maxDz")),
67 nintDz(pset.getParameter<int>(
"nintDz")),
68 minVertpos(pset.getParameter<double>(
"minVertpos")),
69 maxVertpos(pset.getParameter<double>(
"maxVertpos")),
71 minZpos(pset.getParameter<double>(
"minZpos")),
72 maxZpos(pset.getParameter<double>(
"maxZpos")),
73 nintZpos(pset.getParameter<int>(
"nintZpos")),
74 useInvPt(pset.getParameter<bool>(
"useInvPt")),
86 ptRes_nbin(pset.getParameter<int>(
"ptRes_nbin")),
90 dzRes_nbin(pset.getParameter<int>(
"dzRes_nbin")),
107 TProfile *
p1 = (TProfile*) th2->ProfileX();
111 throw cms::Exception(
"MuonTrackValidator") <<
"Different number of bins!";
130 for (
unsigned int j=0;
j<vec.size();
j++){
137 for (
unsigned int j=0;
j<numerator.size();
j++){
138 if (denominator[
j]!=0){
140 value = ((double) numerator[
j])/((double) denominator[j]);
141 else if (type==
"fakerate")
142 value = 1-((double) numerator[j])/((double) denominator[j]);
144 err =
sqrt( value*(1-value)/(
double) denominator[j] );
157 TAxis *axis = h->GetXaxis();
158 int bins = axis->GetNbins();
160 float from = axis->GetXmin();
161 float to = axis->GetXmax();
162 float width = (to - from) / bins;
163 float *new_bins =
new float[bins + 1];
165 for (
int i = 0;
i <= bins;
i++) {
166 new_bins[
i] = TMath::Power(10, from +
i * width);
169 axis->Set(bins, new_bins);
174 std::vector<double> etaintervalsv;
175 std::vector<double> phiintervalsv;
176 std::vector<double> pTintervalsv;
177 std::vector<double> dxyintervalsv;
178 std::vector<double> dzintervalsv;
179 std::vector<double> vertposintervalsv;
180 std::vector<double> zposintervalsv;
181 std::vector<int> totSIMveta,totASSveta,totASS2veta,totRECveta;
182 std::vector<int> totSIMvpT,totASSvpT,totASS2vpT,totRECvpT;
183 std::vector<int> totSIMv_hit,totASSv_hit,totASS2v_hit,totRECv_hit;
184 std::vector<int> totSIMv_phi,totASSv_phi,totASS2v_phi,totRECv_phi;
185 std::vector<int> totSIMv_dxy,totASSv_dxy,totASS2v_dxy,totRECv_dxy;
186 std::vector<int> totSIMv_dz,totASSv_dz,totASS2v_dz,totRECv_dz;
187 std::vector<int> totSIMv_vertpos,totASSv_vertpos,totSIMv_zpos,totASSv_zpos;
190 std::vector<int> totASSveta_Quality05, totASSveta_Quality075;
191 std::vector<int> totASSvpT_Quality05, totASSvpT_Quality075;
192 std::vector<int> totASSv_phi_Quality05, totASSv_phi_Quality075;
196 etaintervalsv.push_back(
min);
199 etaintervalsv.push_back(d);
200 totSIMveta.push_back(0);
201 totASSveta.push_back(0);
202 totASS2veta.push_back(0);
203 totRECveta.push_back(0);
205 totASSveta_Quality05.push_back(0);
206 totASSveta_Quality075.push_back(0);
218 pTintervalsv.push_back(
minpT);
223 pTintervalsv.push_back(d);
224 totSIMvpT.push_back(0);
225 totASSvpT.push_back(0);
226 totASS2vpT.push_back(0);
227 totRECvpT.push_back(0);
229 totASSvpT_Quality05.push_back(0);
230 totASSvpT_Quality075.push_back(0);
242 totSIMv_hit.push_back(0);
243 totASSv_hit.push_back(0);
244 totASS2v_hit.push_back(0);
245 totRECv_hit.push_back(0);
253 phiintervalsv.push_back(
minPhi);
256 phiintervalsv.push_back(d);
257 totSIMv_phi.push_back(0);
258 totASSv_phi.push_back(0);
259 totASS2v_phi.push_back(0);
260 totRECv_phi.push_back(0);
262 totASSv_phi_Quality05.push_back(0);
263 totASSv_phi_Quality075.push_back(0);
275 dxyintervalsv.push_back(
minDxy);
278 dxyintervalsv.push_back(d);
279 totSIMv_dxy.push_back(0);
280 totASSv_dxy.push_back(0);
281 totASS2v_dxy.push_back(0);
282 totRECv_dxy.push_back(0);
292 dzintervalsv.push_back(
minDz);
295 dzintervalsv.push_back(d);
296 totSIMv_dz.push_back(0);
297 totASSv_dz.push_back(0);
298 totASS2v_dz.push_back(0);
299 totRECv_dz.push_back(0);
311 vertposintervalsv.push_back(d);
312 totSIMv_vertpos.push_back(0);
313 totASSv_vertpos.push_back(0);
320 zposintervalsv.push_back(
minZpos);
323 zposintervalsv.push_back(d);
324 totSIMv_zpos.push_back(0);
325 totASSv_zpos.push_back(0);
std::vector< MonitorElement * > h_assoc2phi
std::vector< MonitorElement * > h_recoeta
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
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< 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
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
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
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
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)
Constructor.
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
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 * > 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