10#include "TDirectory.h"
19 res =
new TH1F(prefix+
"res",
"res",100,-100.,100.);
20 pull =
new TH1F(prefix+
"pull",
"pull",100,-10.,10.);
21 exerr =
new TH1F(prefix+
"exerr",
"exerr",100,0,100.);
30 res_p =
new TH2F(prefix+
"res_p",
"res_p",100,-100.,100.,100,0.,300.);
31 pull_p =
new TH2F(prefix+
"pull_p",
"pull_p",100,-10.,10.,100,0.,300.);
32 exerr_p =
new TH2F(prefix+
"exerr_p",
"exerr_p",100,0.,100.,100,0.,300.);
41 TDirectory* ndir = dir->mkdir(prefix+
"Chamber");
45 for(
unsigned int i=0;i<
plots.size();++i ){
46 TString name = prefix +
"chIndex_" + std::to_string(i).c_str() +
"_";
54 if( chIndex_ <0 ||
static_cast<unsigned>(chIndex_) >=
plots.size() )
return;
56 plots[chIndex_].fill(res_,pull_,exerr_);
57 plots_p[chIndex_].fill(res_,pull_,exerr_,p_);
69 fill( (*hits.id.chIndex)[
index], (*hits.residuals.residual)[
index],
70 (*hits.residuals.pull)[
index], (*hits.residuals.expos_err)[
index], p_);
74 void HitPlots::fill(
int chIndex_,
float res_,
float pull_,
float exerr_,
float p_ ) {
75 all.fill(res_,pull_,exerr_);
76 all_p.fill(res_,pull_,exerr_,p_);
77 chamber.fill(chIndex_,res_,pull_,exerr_,p_);
82 bool isMDT = (
type == 1 ||
type == 10);
89 if(
type == 10 ) timeRange = 800;
91 time =
new TH1F(prefix+
"time",
"time",100,-20.,100.);
92 error =
new TH1F(prefix+
"error",
"error",100,0.,15.);
93 timeRes =
new TH1F(prefix+
"timeRes",
"timeRes",200,tmin,tmax);
94 timePull =
new TH1F(prefix+
"pullRes",
"pullRes",200,-7,7);
95 beta =
new TH1F(prefix+
"beta",
"beta",100,.0,2.);
96 betaRes =
new TH1F(prefix+
"betaRes",
"betaRes",200,-1.2,1.2);
97 betaPull =
new TH1F(prefix+
"betaPull",
"betaPull",200,-7,7);
98 invBetaRes =
new TH1F(prefix+
"invBetaRes",
"invBetaRes",200,-1.2,1.2);
99 invBetaPull =
new TH1F(prefix+
"invBetaPull",
"invBetaPull",200,-7,7);
103 timeResScat =
new TH2F(prefix+
"timeResScat",
"timeResScat",100,tmin,timeRange,100,tmin,tmax);
104 timePullScat =
new TH2F(prefix+
"pullResScat",
"pullResScat",100,tmin,timeRange,100,-7.,7.);
106 error_time =
new TH2F(prefix+
"error_time",
"error_time",100,tmin,timeRange,100,0.,15.);
107 errorRT =
new TH1F(prefix+
"errorRT",
"errorRT",100,-20.,100.);
108 errorTrack =
new TH1F(prefix+
"errorTrack",
"errorTrack",100,-20.,100.);
109 errorRT_Track =
new TH2F(prefix+
"errorRT_Track",
"errorRT_Track",100,-20.,100.,100,-20.,100.);
110 timeResCor =
new TH1F(prefix+
"timeResCor",
"timeResCor",200,tmin,tmax);
111 timePullCor =
new TH1F(prefix+
"timePullCor",
"timePullCor",200,-7,7);
112 timeRes0_10 =
new TH1F(prefix+
"timeRes0_10",
"timeRes0_10",200,tmin,tmax);
113 timeRes10_70 =
new TH1F(prefix+
"timeRes10_70",
"timeRes10_70",200,tmin,tmax);
114 timeRes70_150 =
new TH1F(prefix+
"timeRes70_150",
"timeRes70_150",200,tmin,tmax);
115 timeRes150_350 =
new TH1F(prefix+
"timeRes150_350",
"timeRes150_350",200,tmin,tmax);
116 timeRes350_800 =
new TH1F(prefix+
"timeRes350_800",
"timeRes350_800",200,tmin,tmax);
118 timePull0_10 =
new TH1F(prefix+
"timePull0_10",
"timePull0_10",200,-7,7);
119 timePull10_70 =
new TH1F(prefix+
"timePull10_70",
"timePull10_70",200,-7,7);
120 timePull70_150 =
new TH1F(prefix+
"timePull70_150",
"timePull70_150",200,-7,7);
121 timePull150_350 =
new TH1F(prefix+
"timePull150_350",
"timePull150_350",200,-7,7);
122 timePull350_800 =
new TH1F(prefix+
"timePull350_800",
"timePull350_800",200,-7,7);
123 }
else if(
type == 1 ){
124 timeResCor =
new TH1F(prefix+
"timeResLargeError",
"timeResLargeError",200,tmin,tmax);
125 timePullCor =
new TH1F(prefix+
"timePullLargError",
"timePullLargError",200,-7,7);
130 float dist = (*times.d)[
index];
132 float err = (*times.err)[
index];
133 float t = (*times.time)[
index];
136 float timeTrack = betaUtils.
calculateTof(betaTrack,dist);
137 float t0_ = (*times.time)[
index]+tof;
144 beta->Fill(betaMeas);
145 float res = t0_-timeTrack;
146 float pull =
res/err;
147 if(
type != 1 || err < 7 ){
151 float betaResidual = betaMeas-betaTrack;
153 betaPull->Fill(betaResidual/betaError);
154 float invBetaResidual = invBetaMeas-1./betaTrack;
158 float fullTime = (*times.timeProp)[
index];
163 float errTrk = (*times.avTimeProp)[
index];
165 float errRT = sqrt(err*err-errTrk*errTrk);
168 float rescor =
res-(*times.timeCor)[
index];
169 float pullcor = rescor/err;
184 }
else if(
type == 1 && err > 7 ){
192 max =
new TH1F(prefix+
"max",
"max",100,0.,30.);
193 max_pull =
new TH2F(prefix+
"max_pull",
"max_pull",100,0.,30.,100,-10.,10.);
199 fill( (*hough.id.chIndex)[
index], (*hough.residuals.residual)[
index],
200 (*hough.residuals.pull)[
index], (*hough.residuals.expos_err)[
index], p_, (*hough.maximum)[
index]);
203 void HoughPlots::fill(
int chIndex_,
float res_,
float pull_,
float exerr_,
float p_,
float max_ ){
206 all.fill(res_,pull_,exerr_);
207 chamber.fill(chIndex_,res_,pull_,exerr_,p_);
211 t0 =
new TH1F(prefix+
"t0",
"t0",100,-20.,50.);
212 t0Trig =
new TH1F(prefix+
"t0Trig",
"t0Trig",100,-20.,50.);
213 beta =
new TH1F(prefix+
"beta",
"beta",100,.0,2.);
214 beta2 =
new TH2F(prefix+
"betaTrack",
"betaTrack",100,.0,2.,100,.0,2.);
215 betaTrig =
new TH1F(prefix+
"betaTrig",
"betaTrig",100,.0,2.);
216 t0Res =
new TH1F(prefix+
"t0Res",
"t0Res",200,-15,15);
217 t0ResTrig =
new TH1F(prefix+
"t0TrigRes",
"t0TrigRes",200,-15,15);
218 betaRes =
new TH1F(prefix+
"betaRes",
"betaRes",200,-1.2,1.2);
219 betaResTrig =
new TH1F(prefix+
"betaTrigRes",
"betaTrigRes",200,-1.2,1.2);
220 quality =
new TH1F(prefix+
"quality",
"quality",6,-0.5,5.5);
221 quality_chIndex =
new TH2F(prefix+
"quality_chIndex",
"quality_chIndex",6,-0.5,5.5,
toInt(ChIndex::ChIndexMax),-0.5,-0.5+
toInt(ChIndex::ChIndexMax));
222 quality_sector =
new TH2F(prefix+
"quality_sector",
"quality_sector",6,-0.5,5.5,16,0.5,16.5);
224 allx.book(prefix+
"x_");
227 ally.book(prefix+
"y_");
230 allxz.book(prefix+
"xz_");
233 allyz.book(prefix+
"yz_");
236 allcy.book(prefix+
"cy_");
273 float t0_ = (*segments.
t0)[
index]+tof;
281 beta2->Fill(betaSeg,betaTrack);
283 t0Res->Fill(t0_-t0Track);
285 betaRes->Fill(betaSeg-betaTrack);
296 beta =
new TH1F(prefix+
"beta",
"beta",100,0,1.5);
297 chi2Ndof =
new TH1F(prefix+
"chi2Ndof",
"chi2Ndof",100,0,50.);
298 ndof =
new TH1F(prefix+
"ndof",
"ndof",51,-0.5,50.5);
299 res =
new TH1F(prefix+
"res",
"res",500,-1.,1.);
304 if( ndof_ > 0 )
chi2Ndof->Fill(chi2_/ndof_);
306 res->Fill(beta_-betaTruth_);
310 mdt.book(dir,prefix+
"mdt_");
311 mdtt.book(dir,prefix+
"mdtt_");
314 rpc.book(dir,prefix+
"rpc_");
315 rpct.book(dir,prefix+
"rpcr_");
316 all.book(dir,prefix+
"all_");
317 allt.book(dir,prefix+
"allt_");
324 pt =
new TH1F(prefix+
"pt",
"pt",100,0,300.);
325 eta =
new TH1F(prefix+
"eta",
"eta",100,-3,3);
326 phi =
new TH1F(prefix+
"phi",
"phi",100,-3,3);
327 beta =
new TH1F(prefix+
"beta",
"beta",100,0,1);
328 nseg =
new TH1F(prefix+
"nseg",
"nseg",10,-0.5,9.5);
344 etaMissed =
new TH1F(prefix+
"etaMissed",
"etaMissed",100,-3,3);
345 etaMissedCombined =
new TH1F(prefix+
"etaMissedCombined",
"etaMissedCombined",100,-3,3);
346 etaBetaMissed =
new TH2F(prefix+
"etaBetaMissed",
"etaBetaMissed",100,-3,3,100,0.,1.);
347 betaMissed =
new TH1F(prefix+
"betaMissed",
"betaMissed",100,0.,1.);
348 betaMissedCombined =
new TH1F(prefix+
"betaMissedCombined",
"betaMissedCombined",100,0.,1.);
349 ncandidates =
new TH1F(prefix+
"ncandidates",
"ncandidates",10,-0.5,9.5);
350 ncombinedCandidates =
new TH1F(prefix+
"ncombinedCandidates",
"ncombinedCandidates",10,-0.5,9.5);
357 pt =
new TH1F(prefix+
"pt",
"pt",100,0,300.);
358 eta =
new TH1F(prefix+
"eta",
"eta",100,-3,3);
359 phi =
new TH1F(prefix+
"phi",
"phi",100,-3,3);
360 beta =
new TH1F(prefix+
"beta",
"beta",100,0,1);
361 pdg =
new TH1F(prefix+
"pdg",
"pdg",31,-15.5,15.5);
362 ntruth =
new TH1F(prefix+
"ntruth",
"ntruth",10,-0.5,9.5);
363 nseg =
new TH1F(prefix+
"nseg",
"nseg",10,-0.5,9.5);
364 nseg1 =
new TH1F(prefix+
"nseg1",
"nseg",10,-0.5,9.5);
365 nseg2 =
new TH1F(prefix+
"nseg2",
"nseg",10,-0.5,9.5);
366 nseg3 =
new TH1F(prefix+
"nseg3",
"nseg",10,-0.5,9.5);
367 nhough =
new TH1F(prefix+
"nhough",
"nhough",10,-0.5,9.5);
368 ntruth_seg =
new TH2F(prefix+
"ntruth_seg",
"ntruth_seg",10,-0.5,9.5,10,-0.5,9.5);
369 ntruth_seg1 =
new TH2F(prefix+
"ntruth_seg1",
"ntruth_seg",10,-0.5,9.5,10,-0.5,9.5);
370 ntruth_hough =
new TH2F(prefix+
"ntruth_hough",
"ntruth_hough",10,-0.5,9.5,10,-0.5,9.5);
372 TDirectory* ldir = dir->mkdir(
"hits");
374 hits.book(ldir,prefix+
"h_");
376 ldir = dir->mkdir(
"hough");
378 hough.book(ldir,prefix+
"ho_");
380 ldir = dir->mkdir(
"segments");
387 ldir = dir->mkdir(
"times");
389 std::vector<int>
types = { 1,2,10,12,1001,1010};
390 std::vector<std::string> typeNames = {
"BarrelMDT",
"BarrelRPC",
"BarrelMDTT",
"BarrelRPCT",
"EndcapMDT",
"EndcapMDTT"};
391 for(
unsigned int i=0;i<
types.size();++i ){
393 TString name = typeNames[i].c_str();
401 ldir = dir->mkdir(
"betaFits");
403 barrel.book(ldir,prefix+
"barrel_",
true);
404 endcap.book(ldir,prefix+
"endcap_",
false);
406 ldir = dir->mkdir(
"candidates");
408 for(
unsigned int i=0;i<4;++i ){
409 TString name =
"stage";
424 void TrackPlots::fill(
int ntruth_,
int nseg_,
int nseg1_,
int nseg2_,
int nseg3_,
int nhough_ ) {
438 TDirectory* ndir = dir->mkdir(
"Muon");
440 muon.book(ndir,prefix);
441 ndir = dir->mkdir(
"Stau");
443 stau.book(ndir,prefix);
444 ndir = dir->mkdir(
"Rest");
446 rest.book(ndir,prefix);
std::pair< std::vector< unsigned int >, bool > res
static const std::vector< std::string > types
float calculateTof(float beta, float dist)
float calculateInverseBetaError(float error, float dist)
float calculateBeta(float time, float dist)
float calculateBetaError(float time, float error, float dist)
float calculateInverseBeta(float time, float dist)
constexpr int toInt(const EnumType enumVal)
bool isBarrel(const ChIndex index)
Returns true if the chamber index points to a barrel chamber.
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
void fill(float beta_, float betaTruth_, float chi2_, int ndof_)
void book(TDirectory *dir, const TString &prefix)
void book(TDirectory *dir, const TString &prefix, bool isBarrel)
BetaFitPlots betaCandidates
void book(TDirectory *dir, const TString &prefix)
candidate based plots
void fill(int ntruth_, int nseg_, int nseg1_, int nhough_)
BetaFitPlots betaBestCandidate
std::vector< ResPlotsPt > plots_p
std::vector< ResPlots > plots
void fill(int chIndex_, float res_, float pull_, float exerr_, float p_)
void book(TDirectory *dir, const TString &prefix)
void fill(const MuonValidationHitBlock &hits, int index, float p_)
void book(TDirectory *dir, const TString &prefix)
void fill(const MuonValidationHoughBlock &hough, int index, float p_)
void book(TDirectory *dir, const TString &prefix)
void book(TDirectory *dir, const TString &prefix)
Block with hough maxima information.
std::vector< int > * sector
std::vector< int > * chIndex
std::vector< float > * residual
std::vector< float > * expos_err
std::vector< float > * pull
Block with segment information.
std::vector< float > * t0
std::vector< int > * quality
MuonValidationResidualBlock xresiduals
MuonValidationResidualBlock combinedYZ
MuonValidationResidualBlock angleYZ
std::vector< float > * t0Trig
MuonValidationResidualBlock angleXZ
MuonValidationResidualBlock yresiduals
Block with timing information.
Block with information on the incoming track particle.
std::vector< float > * phi
std::vector< float > * eta
std::vector< float > * pt
MuonValidationTruthBlock truth
std::vector< float > * beta
void book(const TString &prefix)
void fill(float res_, float pull_, float exerr_, float pt)
void fill(float res_, float pull_, float exerr_)
void book(const TString &prefix)
ChamberResPlots chamberyz
void fill(int chIndex_, int sector_, int quality_)
ChamberResPlots chamberxz
void book(TDirectory *dir, const TString &prefix)
ChamberResPlots chambercy
CandidatePlots tagCandidates
CandidatePlots combinedCandidates
void book(TDirectory *dir, const TString &prefix)
candidates based plots
CandidatePlots allCandidates
TH1 * ncombinedCandidates
void book(TDirectory *dir, const TString &prefix, int type)
void fill(const MuonValidationTimeBlock ×, int index, float betaTrack)
void fill(int ntruth_, int nseg_, int nseg1_, int nseg2_, int nseg3_, int nhough_)
std::vector< StageSummaryPlots > candidateStages
BetaFitRegionPlots barrel
void book(TDirectory *dir, const TString &prefix)
BetaFitRegionPlots endcap
std::vector< TimePlots > timePlots