15 std::cout <<
"SigAnalysis::initialise() " <<
name() << std::endl;
19 double tmp_absResPt = 0.0005;
21 const int pTResBins = 100;
24 double tmp_maxEta = 3.;
25 double tmp_absResEta = 0.04;
28 double tmp_maxPhi = 3.142;
29 double tmp_absResPhi = 0.02;
33 const int etaResBins = 300;
35 const int phiBins = 36;
36 const int phiResBins = 100;
39 const double zMax = 400;
41 const int zresBins = 100;
42 const double zresMax = 10;
44 const int d0Bins = 100;
45 const double d0Max = 10;
47 const int d0resBins = 100;
48 const double d0resMax = 10;
52 const int a0Bins = 100;
53 const double a0Max = 10;
55 const int a0resBins = 100;
56 const double a0resMax = 5;
62 const int ptnbins = 20;
64 double ptbinlims[ptnbins+1];
65 for (
int i=0 ;
i<=ptnbins ;
i++ ) { ptbinlims[
i] =
std::pow(10, 2.0*
i/ptnbins+2); }
72 std::cout <<
"SigAnalysis::initialize() Directory " <<
gDirectory->GetName() <<
" " <<
name() << std::endl;
77 std::cout <<
"SigAnalysis::initialize() Directory " <<
gDirectory->GetName() <<
" package directory, " <<
name() << std::endl;
128 addHistogram(
new TH1F(
"phi_rec",
"phi_rec", phiBins, -tmp_maxPhi, tmp_maxPhi ) );
134 addHistogram(
new TH1F(
"pT_res",
"pT_res", pTResBins, -tmp_absResPt, tmp_absResPt ) );
135 addHistogram(
new TH1F(
"eta_res",
"eta_res", etaResBins, -tmp_absResEta, tmp_absResEta ) );
136 addHistogram(
new TH1F(
"phi_res",
"phi_res", phiResBins, -tmp_absResPhi, tmp_absResPhi ) );
137 addHistogram(
new TH1F(
"z0_res",
"z0_res", zresBins, -zresMax, zresMax ) );
138 addHistogram(
new TH1F(
"d0_res",
"d0_res", d0resBins, -0.5*d0resMax, 0.5*d0resMax ) );
139 addHistogram(
new TH1F(
"a0_res",
"a0_res", a0resBins, -0.5*a0resMax, 0.5*a0resMax ) );
147 addHistogram(
new TH1F(
"nsct_rec",
"nsct_rec", NHits, -0.5,
float(NHits-0.5) ) );
150 addHistogram(
new TH1F(
"npix_rec",
"npix_rec", NHits, -0.5,
float(NHits-0.5) ) );
153 addHistogram(
new TH1F(
"ntrt_rec",
"ntrt_rec", NHits, -0.5,
float(NHits-0.5) ) );
155 addHistogram(
new TH1F(
"nstraw",
"nstraw", NHits*4, -0.5,
float(4*NHits-0.5) ) );
156 addHistogram(
new TH1F(
"nstraw_rec",
"nstraw_rec", NHits*4, -0.5,
float(4*NHits-0.5) ) );
158 addHistogram(
new TH1F(
"ntracks",
"ntracks", Ntracks, -0.5,
float(Ntracks+0.5) ) );
159 addHistogram(
new TH1F(
"ntracks_rec",
"ntracks_rec", Ntracks, -0.5,
float(Ntracks+0.5) ) );
163 m_h2 =
new TH2F(
"d0vphi",
"d0vphi", phiBins, -3.142, 3.142, d0Bins, -d0Max, d0Max );
164 m_h2r =
new TH2F(
"d0vphi_rec",
"d0vphi_rec", phiBins, -3.142, 3.142, d0Bins, -d0Max, d0Max );
165 m_h2m =
new TH2F(
"d0vphi_match",
"d0vphi_match", phiBins, -3.142, 3.142, d0Bins, -d0Max, d0Max );
178 std::cout <<
"SigAnalysis::finalise() " <<
name() <<
"\tNreco " <<
m_Nreco <<
" tracks" << std::endl;
184 std::cout <<
"SigAnalysis::finalise() " <<
gDirectory->GetName() << std::endl;
198 for (
int i=6 ;
i-- ; ) { hpurity[
i]->
finalise(); }
206 const std::vector<TIDA::Track*>& testtracks,
209 if (
m_print ) std::cout <<
"SigAnalysis::execute() \t " <<
name()
210 <<
"\tref " << reftracks.size()
211 <<
"\ttest " << testtracks.size() << std::endl;
220 static const std::string
varName[10] = {
"pT",
"eta",
"phi",
"z0",
"d0",
"a0",
"nsct",
"npix",
"ntrt",
"nstraw" };
225 if ( hmitr!=
m_histos.end() ) hmitr->second->Fill( reftracks.size() );
227 hmitr =
m_histos.find(
"ntracks_rec");
228 if ( hmitr!=
m_histos.end() ) hmitr->second->Fill( testtracks.size() );
232 for (
int i=reftracks.size() ;
i-- ; ) {
234 double pTt = reftracks[
i]->pT();
235 double z0t = reftracks[
i]->z0();
236 double etat = reftracks[
i]->eta();
237 double phit = reftracks[
i]->phi();
238 double d0t = reftracks[
i]->a0();
243 double nsctt = reftracks[
i]->sctHits();
244 double npixt = reftracks[
i]->pixelHits();
246 double ntrtt = reftracks[
i]->trHits();
247 double nstrawt = reftracks[
i]->strawHits();
251 m_h2->Fill( phit, d0t );
258 double vpart[10] = { std::fabs(pTt), etat, phit, z0t, d0t, a0t, nsctt, npixt, ntrtt, nstrawt };
259 for (
int it=0 ;
it<10 ;
it++ ) {
265 else std::cerr <<
"hmmm histo " <<
varName[
it] <<
" not found" << std::endl;
285 double pTr = matchedreco->
pT();
286 double z0r = matchedreco->
z0();
287 double etar = matchedreco->
eta();
288 double phir = matchedreco->
phi();
289 double d0r = matchedreco->
a0();
295 if (
m_print ) std::cout <<
"SigAnalysis::execute() \t\t" <<
i <<
" "
296 << *reftracks[
i] <<
" -> " << *matchedreco <<
"\t"
297 << pTr <<
" " << pTt <<
" " << d0r <<
" " << d0t << std::endl;
299 double vres[6] = { 1/pTt-1/pTr, etat-etar, phit-phir, z0t-z0r, d0t-d0r, a0t-a0r };
300 for (
int it=0 ;
it<6 ;
it++ ) {
302 else std::cerr <<
"hmmm histo " <<
varName[
it]+
"_res" <<
" not found" << std::endl;
323 if ( std::fabs(pTt)>4000 )
dump =
true;
333 if (
m_print ) std::cout <<
"SigAnalysis::execute() \t " <<
name() <<
"\t " <<
m_icount <<
" events\t " << testtracks.size() <<
" tracks (" <<
m_Nreco <<
")" <<
"\n---------------" << std::endl;
339 for (
int i=testtracks.size() ;
i-- ; ) {
344 double pTr = testtracks[
i]->pT();
345 double etar = testtracks[
i]->eta();
346 double phir = testtracks[
i]->phi();
347 double z0r = testtracks[
i]->z0();
348 double d0r = testtracks[
i]->a0();
354 double nsctr = testtracks[
i]->sctHits();
355 double npixr = testtracks[
i]->pixelHits();
357 double ntrtr = testtracks[
i]->trHits();
358 double nstrawr = testtracks[
i]->strawHits();
368 double vpart[10] = { std::fabs(pTr), etar, phir, z0r, d0r, a0r, nsctr, npixr, ntrtr, nstrawr };
369 for (
int it=0 ;
it<10 ;
it++ ) {
376 else std::cerr <<
"hmmm histo " <<
varName[
it]+
"_rec" <<
" not found" << std::endl;
406 std::cout <<
"SigAnalysis::execute() missed a high pT track - dumping tracks" << std::endl;
408 for (
int i=reftracks.size() ;
i-- ; ) {
410 if ( std::fabs( reftracks[
i]->
pT() ) > 1000 ) {
411 std::cout <<
"\t dump " << *reftracks[
i];
413 if ( matchedreco ) std::cout <<
" <--> " << *matchedreco << std::endl;
414 else std::cout << std::endl;
419 for (
int i=testtracks.size() ;
i-- ; ) {
421 if ( matchedref==0 ) std::cout <<
"\t\t\t\t\t " << *testtracks[
i] << std::endl;