30 #include "TDirectory.h"
105 std::cout <<
"Error: signal %d:\n" <<
sig << std::endl;
106 backtrace_symbols_fd(
array,
size, STDERR_FILENO);
118 std::string
s(ctime(&
t));
121 return s.substr(0,
s.find(
'\n'));
131 std::sprintf(
check,
"%d",
i );
132 if ( std::string(
check)!=
s )
return -1;
155 if (
s3==
"0" )
return 0;
156 if (
s3==
"1" )
return 1;
157 if (
s3==
"2" )
return 2;
165 double etaHalfWidth=-999,
166 double phiHalfWidth=-999,
169 double roi_eta = roi.
eta();
170 double roi_phi = roi.
phi();
171 double roi_zed = roi.
zed();
174 double etaPlus = roi.
etaPlus();
177 double zedPlus = roi.
zedPlus();
180 double phiPlus = roi.
phiPlus();
182 if ( etaHalfWidth != -999 ) {
183 etaMinus = roi_eta - etaHalfWidth;
184 etaPlus = roi_eta + etaHalfWidth;
187 if ( phiHalfWidth != -999 ) {
188 phiMinus = roi_phi - phiHalfWidth;
189 phiPlus = roi_phi + phiHalfWidth;
198 roi_phi, phiMinus, phiPlus,
199 roi_zed, zedMinus, zedPlus );
208 std::ostream&
operator<<( std::ostream&
s,
const std::vector<T*>&
v ) {
209 for (
size_t i=0 ;
i<
v.size() ;
i++ )
s <<
"\t" << *
v[
i] <<
"\n";
216 if (
v.size()<5 )
for (
unsigned i=0 ;
i<
v.size() ;
i++ )
s <<
"\t" <<
v[
i];
217 else for (
unsigned i=0 ;
i<
v.size() ;
i++ )
s <<
"\n\t" <<
v[
i];
222 const std::vector<TIDA::Track>
ibl_filter(
const std::vector<TIDA::Track>& tv ) {
231 h =
new TH2D(
"hzvphi",
"hzvphi", 150, -300, 300, 150, -
M_PI,
M_PI );
232 h2 =
new TH2D(
"hzvphi2",
"hzvphi", 150, -300, 300, 150, -
M_PI,
M_PI );
235 for (
size_t i=tv.size() ;
i-- ; ) {
237 if ( tv[
i].
author()!=5 )
break;
239 double eta = tv[
i].eta();
247 if ( !tv[
i].expectBL() ) {
248 std::cout <<
"missing IBL: phi: " << tv[
i].phi() <<
"\tz: " <<
z <<
" (" <<
eta <<
" " <<
theta*180/
M_PI <<
")" << std::endl;
249 if (
h )
h->Fill(
z, tv[
i].
phi() );
252 if ( h2 ) h2->Fill(
z, tv[
i].
phi() );
260 gPad->Print(
"zphimap.pdf");
262 gPad->Print(
"zphimap2.pdf");
272 const std::vector<TIDA::Track>
replaceauthor(
const std::vector<TIDA::Track>& tv,
int a0=5,
int a1=4 ) {
274 if (
a0==a1 )
return tv;
276 std::vector<TIDA::Track> tr;
277 tr.reserve(tv.size());
279 for (
size_t i=0 ;
i<tv.size() ;
i++ ) {
283 tr.push_back(
TIDA::Track(
t.eta(),
t.phi(),
t.z0(),
t.a0(),
t.pT(),
t.chi2(),
t.dof(),
284 t.deta(),
t.dphi(),
t.dz0(),
t.da0(),
t.dpT(),
285 t.bLayerHits(),
t.pixelHits(),
t.sctHits(),
t.siHits(),
286 t.strawHits(),
t.trHits(),
287 t.hitPattern(),
t.multiPattern(),
a,
t.hasTruth(),
288 t.barcode(),
t.match_barcode(),
t.expectBL(),
t.id() ) );
302 std::cout <<
"event_list::event_list() ";
309 while (
file>>evnt ) {
313 std::cout <<
"event_list::event_list() ";
314 std::cout <<
mevents.size() << std::endl;
332 std::ostream&
s = std::cout;
334 s <<
"Usage: " <<
name <<
" <config filename> [OPTIONS]" << std::endl;
335 s <<
"\nOptions: \n";
336 s <<
" -o, -f, --file value\toutput filename, \n";
337 s <<
" -b, --binConfig value\tconfig file for histogram configuration, \n";
338 s <<
" -r, --refChain value\treference chain. + separated keys will be merged, \n";
339 s <<
" -t, --testChain value\ttest chain, \n";
340 s <<
" -p, --pdgId value\tpdg ID of truth particle if requiring truth particle processing,\n";
341 s <<
" --vt value\tuse value as the test vertex selector - overrides value in the config file,\n";
342 s <<
" --vr value\tuse value as the reference vertex selector - overrides value in the config file,\n";
343 s <<
" -n, --nofit \ttest do not fit resplots, \n";
344 s <<
" --rms \ttest force new rms95 errors, \n";
345 s <<
" -e, --entries value\ttest only run over value entries, \n";
347 s <<
" -h, --help \tthis help\n";
349 s <<
"\nReport bugs to sutt@cern.ch";
368 std::vector<T*> vp(
v.size(),0);
369 for (
unsigned i=
v.size() ;
i-- ; ) vp[
i] = &
v[
i];
388 bool ETselection = std::fabs(tobj.
pt())>=
ETmin;
389 bool ETovPTselection =
true;
390 if (
t ) ETovPTselection = std::fabs(tobj.
pt()/
t->pT())>=
ETovPTmin;
391 return ETselection&ETovPTselection;
408 std::cout <<
"getFilter(): refname " << refname << std::endl;
410 if ( refname==
"Offline" )
return foff;
411 else if ( refname==
"InDetLargeD0TrackParticles" )
return foff;
412 else if (
contains( refname,
"Electrons") )
return foff;
413 else if (
contains( refname,
"LRTElectrons") )
return foff;
414 else if (
contains( refname,
"Muons" ) )
return fmu;
415 else if (
contains( refname,
"MuonsLRT" ) )
return fmu;
416 else if (
contains( refname,
"Taus" ) )
return foff;
417 else if (
contains( refname,
"1Prong" ) )
return foff;
418 else if (
contains( refname,
"3Prong" ) )
return foff;
419 else if ( refname==
"Truth" && pdgId!=0 )
return ftruth;
420 else if ( refname==
"Truth" && pdgId==0 )
return foff;
422 std::cerr <<
"unknown reference chain defined" << std::endl;
429 const std::vector<TIDA::Chain>&
chains,
434 bool foundReference =
false;
440 foundReference =
true;
451 std::vector<TIDA::Track> tmptracks =
chains[
ic][0].tracks();
453 for (
size_t ix=
chains.size() ; ix-- ; ) {
457 std::vector<TIDA::Track> extracks =
chains[ix][0].tracks();
459 std::vector<TIDA::Track*> refp;
460 std::vector<TIDA::Track*> refx;
462 for (
size_t it=tmptracks.size() ;
it-- ; ) refp.push_back( &tmptracks[
it] );
463 for (
size_t it=extracks.size() ;
it-- ; ) refx.push_back( &extracks[
it] );
468 ex_matcher->
match( refp, refx );
470 std::vector<TIDA::Track*> refp_ex;
472 for (
size_t it=refp.size() ;
it-- ; ) {
474 if ( ex_matcher->
matched(refp[
it])==0 ) refp_ex.push_back(refp[
it]);
482 std::cout <<
"\nexclude: " << refp.size() <<
"\t" << refp_ex.size() << std::endl;
483 std::cout <<
"exclude:\n" << extracks << std::endl;
484 std::cout <<
"reference tracks: " << std::endl;
486 size_t it0 = refp_ex.size();
488 for (
size_t it=0 ;
it<refp.size() && it0>0 ;
it++ ) {
489 if ( refp[
it]==refp_ex[it0-1] ) std::cout <<
it <<
"\t" << *refp[
it] <<
"\t" << *refp_ex[--it0] << std::endl;
490 else std::cout <<
"\n" <<
it <<
"\t" << *refp[
it] <<
"\t----\n" << std::endl;
511 return foundReference;
531 std::cerr <<
"Error: no config file specified\n" << std::endl;
545 std::cout <<
"$0 :: compiled " << __DATE__ <<
" " << __TIME__ << std::endl;
549 std::string histofilename(
"");
551 std::string datafile =
"";
553 std::vector<std::string> refChains(0);
555 std::vector<TrackFilter*> refFilters(0);
560 std::string refChain =
"";
564 std::vector<std::string> testChains;
566 std::string binningConfigFile =
"";
568 bool useoldrms =
true;
571 std::string vertexSelection =
"";
572 std::string vertexSelection_rec =
"";
574 unsigned Nentries = 0;
576 for (
int i=1 ;
i<
argc ;
i++ ) {
577 if ( std::string(
argv[
i])==
"-h" || std::string(
argv[
i])==
"--help" ) {
580 else if ( std::string(
argv[
i])==
"-e" || std::string(
argv[
i])==
"--entries" ) {
584 else if ( std::string(
argv[
i])==
"-o" || std::string(
argv[
i])==
"-f" || std::string(
argv[
i])==
"--file" ) {
586 histofilename =
argv[
i];
587 if ( histofilename.find(
".root")==std::string::npos ) histofilename +=
".root";
589 else if ( std::string(
argv[
i])==
"-r" || std::string(
argv[
i])==
"--refChain" ) {
594 if (refChain.find(
"+") != string::npos){
595 std::istringstream iss(refChain);
597 while (std::getline(iss, token,
'+')){
598 refChains.push_back(token);
599 refFilters.push_back(0);
603 refChains.push_back(
argv[
i]);
604 refFilters.push_back(0);
607 else if ( std::string(
argv[
i])==
"--rms" ) useoldrms =
false;
608 else if ( std::string(
argv[
i])==
"-n" || std::string(
argv[
i])==
"--nofit" ) nofit =
true;
609 else if ( std::string(
argv[
i])==
"-t" || std::string(
argv[
i])==
"--testChain" ) {
611 testChains.push_back(
argv[
i]);
613 else if ( std::string(
argv[
i])==
"-p" || std::string(
argv[
i])==
"--pdgId" ) {
617 else if ( std::string(
argv[
i])==
"--vr" ) {
619 vertexSelection =
argv[
i];
621 else if ( std::string(
argv[
i])==
"--vt" ) {
623 vertexSelection_rec =
argv[
i];
625 else if ( std::string(
argv[
i])==
"-b" || std::string(
argv[
i])==
"--binConfig" ) {
627 binningConfigFile = std::string(
argv[
i]);
629 else if ( std::string(
argv[
i]).
find(
'-')==0 ) {
631 std::cerr <<
"unknown option " <<
argv[
i] << std::endl;
641 if ( datafile==
"" ) {
642 std::cerr <<
"no config file specifed\n" << endl;
646 std::cout <<
time_str() << std::endl;
655 bool oldrms95 =
true;
656 inputdata.declareProperty(
"OldRMS95", oldrms95 );
657 std::cout <<
"setting Resplot old rms95 " << oldrms95 << std::endl;
661 std::cout <<
"setting Resplot old rms95 " << useoldrms << std::endl;
667 std::cout <<
"Not fitting resplots " << std::endl;
673 inputdata.declareProperty(
"NFiles", nfiles );
676 if ( histofilename==
"" ){
677 if (
inputdata.isTagDefined(
"outputFile") ) histofilename =
inputdata.GetString(
"outputFile");
679 std::cerr <<
"Error: no output file defined\n" << std::endl;
685 TFile foutput( histofilename.c_str(),
"recreate" );
686 if (!foutput.IsOpen()) {
687 std::cerr <<
"Error: could not open output file\n" << std::endl;
693 std::cout <<
"writing output to " << histofilename << std::endl;
695 TH1D* hevent =
new TH1D(
"event",
"event", 1000, 10000, 80000 );
696 Resplot* hcorr =
new Resplot(
"correlation", 21, -0.5, 20.5, 75, 0, 600);
714 bool expectBL =
false;
728 double massMax = 130;
733 bool rotate_testtracks =
false;
735 if (
inputdata.isTagDefined(
"RotateTestTracks") ) rotate_testtracks = (
inputdata.GetValue(
"RotateTestTracks") ? true : false );
737 bool truthMatch =
false;
739 if (
inputdata.isTagDefined(
"TruthMatch") ) truthMatch = (
inputdata.GetValue(
"TruthMatch") ? true : false );
744 std::vector<size_t> refPtOrd_indices;
745 bool use_pt_ordered_ref =
false;
747 if (
inputdata.isTagDefined(
"UsePtOrderedRefTracks") ) {
748 std::vector<double> refPtOrd_indices_tmp;
750 use_pt_ordered_ref =
true;
751 refPtOrd_indices_tmp = (
inputdata.GetVector(
"UsePtOrderedRefTracks") );
753 std::cout <<
"using PT ordered reference tracks: " << refPtOrd_indices_tmp << std::endl;
755 for (
size_t i=refPtOrd_indices_tmp.size();
i-- ; ) {
756 refPtOrd_indices.push_back( refPtOrd_indices_tmp.at(
i) );
778 if (
inputdata.isTagDefined(
"npixholes") ) npixholes =
inputdata.GetValue(
"npixholes");
779 if (
inputdata.isTagDefined(
"nsctholes") ) nsctholes =
inputdata.GetValue(
"nsctholes");
780 if (
inputdata.isTagDefined(
"expectBL") ) expectBL = (
inputdata.GetValue(
"expectBL") > 0.5 ? true : false );
791 if ( pdgId==0 &&
inputdata.isTagDefined(
"pdgId") ) pdgId =
inputdata.GetValue(
"pdgId");
793 if (
inputdata.isTagDefined(
"InvMassMax") ) massMax =
inputdata.GetValue(
"InvMassMax");
794 if (
inputdata.isTagDefined(
"InvMassMin") ) massMin =
inputdata.GetValue(
"InvMassMin");
807 std::string useMatcher =
"DeltaR";
808 if (
inputdata.isTagDefined(
"UseMatcher") ) useMatcher =
inputdata.GetString(
"UseMatcher");
812 if ( refChain==
"" ) {
813 if (
inputdata.isTagDefined(
"refChain") ) {
814 refChain =
inputdata.GetString(
"refChain");
815 refChains.push_back(refChain);
816 refFilters.push_back(0);
819 std::cerr <<
"Error: no reference chain defined\n" << std::endl;
829 if (
inputdata.isTagDefined(
"Exclude") ) {
834 if (refChains.size() == 0){
835 std::cerr <<
"Error: refChains is empty\n" <<std::endl;
840 if ( testChains.size()==0 ) {
841 if (
inputdata.isTagDefined(
"testChains") ) testChains =
inputdata.GetStringVector(
"testChains");
842 else if (
inputdata.isTagDefined(
"testChain") ) testChains.push_back(
inputdata.GetString(
"testChain") );
848 std::vector<ChainString> chainConfig;
850 for (
size_t ic=0 ;
ic<testChains.size() ;
ic++ ) {
852 testChains[
ic] = chainConfig.back().pre();
863 bool select_roi =
true;
869 bool use_custom_ref_roi =
false;
870 const int custRefRoi_nParams = 3;
872 double custRefRoi_params[custRefRoi_nParams] = {-999., -999., -999.};
873 std::vector<std::string> custRefRoi_chainList;
874 std::set<std::string> customRoi_chains;
876 if (
inputdata.isTagDefined(
"customRefRoi_etaHalfWidth") ) custRefRoi_params[0] =
inputdata.GetValue(
"customRefRoi_etaHalfWidth");
877 if (
inputdata.isTagDefined(
"customRefRoi_phiHalfWidth") ) custRefRoi_params[1] =
inputdata.GetValue(
"customRefRoi_phiHalfWidth");
878 if (
inputdata.isTagDefined(
"customRefRoi_zedHalfWidth") ) custRefRoi_params[2] =
inputdata.GetValue(
"customRefRoi_zedHalfWidth");
880 if (
inputdata.isTagDefined(
"customRefRoi_chainList") ) custRefRoi_chainList =
inputdata.GetStringVector(
"customRefRoi_chainList");
882 for (
unsigned ic=0 ;
ic<custRefRoi_chainList.size() ;
ic++ ) customRoi_chains.insert( custRefRoi_chainList[
ic] );
884 for (
int param_idx=0 ; param_idx<custRefRoi_nParams ; param_idx++ ) {
885 if ( custRefRoi_params[param_idx] != -999 ) {
887 use_custom_ref_roi =
true;
891 if ( use_custom_ref_roi ) {
892 std::cout <<
"**** \t****" << std::endl;
893 std::cout <<
"**** Custom RoI will be used to filter ref. tracks\t****" << std::endl;
895 if ( custRefRoi_params[0] != -999. ) std::cout <<
"**** etaHalfWidth = " << custRefRoi_params[0] <<
"\t\t\t\t****" << std::endl;
896 else std::cout <<
"**** etaHalfWidth = value used in trigger RoI\t****" << std::endl;
898 if ( custRefRoi_params[1] != -999. ) std::cout <<
"**** phiHalfWidth = " << custRefRoi_params[1] <<
"\t\t\t\t****" << std::endl;
899 else std::cout <<
"**** phiHalfWidth = value used in trigger RoI\t****" << std::endl;
901 if ( custRefRoi_params[2] != -999. ) std::cout <<
"**** zedHalfWidth = " << custRefRoi_params[2] <<
"\t\t\t\t****" << std::endl;
902 else std::cout <<
"**** zedHalfWidth = value used in trigger RoI\t****" << std::endl;
904 if ( !custRefRoi_chainList.empty() ) {
905 std::cout <<
"**** \t****" << std::endl;
906 std::cout <<
"**** Applying custom RoI only to specified chains\t****" << std::endl;
908 std::cout <<
"**** \t****" << std::endl;
913 if (
inputdata.isTagDefined(
"SelectRoi") ) {
914 select_roi = (
inputdata.GetValue(
"SelectRoi")!=0 ? true : false );
918 std::cout <<
"**** ****" << std::endl;
919 std::cout <<
"**** RoI filtering of reference tracks is disabled ****" << std::endl;
920 std::cout <<
"**** ****" << std::endl;
935 std::vector<std::string> grlvector =
inputdata.GetStringVector(
"GRL");
936 std::cout <<
"Reading GRL from: " << grlvector << std::endl;
937 for (
size_t igrl=0 ; igrl<grlvector.size() ; igrl++ )
goodrunslist.read( grlvector[igrl] );
940 else if (
inputdata.isTagDefined(
"LumiBlocks") ) {
953 if ( vertexSelection ==
"" ) {
954 if (
inputdata.isTagDefined(
"VertexSelection") ) vertexSelection =
inputdata.GetString(
"VertexSelection");
957 bool bestPTVtx =
false;
958 bool bestPT2Vtx =
false;
961 if ( vertexSelection!=
"" ) {
962 if ( vertexSelection==
"BestPT" ) bestPTVtx =
true;
963 else if ( vertexSelection==
"BestPT2" ) bestPT2Vtx =
true;
972 if ( vertexSelection_rec ==
"" ) {
973 if (
inputdata.isTagDefined(
"VertexSelectionRec") ) vertexSelection_rec =
inputdata.GetString(
"VertexSelectionRec");
976 bool bestPTVtx_rec =
false;
977 bool bestPT2Vtx_rec =
false;
980 if ( vertexSelection_rec!=
"" ) {
981 if ( vertexSelection_rec==
"BestPT" ) bestPTVtx_rec =
true;
982 else if ( vertexSelection_rec==
"BestPT2" ) bestPT2Vtx_rec =
true;
983 else vtxind_rec =
atoi_check( vertexSelection_rec );
986 std::cout <<
"vertexSelection: " << vertexSelection << std::endl;
987 std::cout <<
"vertexSelection_rec: " << vertexSelection_rec << std::endl;
995 bool useBestVertex =
false;
996 if (
inputdata.isTagDefined(
"useBestVertex") ) useBestVertex = (
inputdata.GetValue(
"useBestVertex") ? 1 : 0 );
998 bool useSumPtVertex =
true;
999 if (
inputdata.isTagDefined(
"useSumPtVertex") ) useSumPtVertex = (
inputdata.GetValue(
"useSumPtVertex") ? 1 : 0 );
1001 int MinVertices = 1;
1002 if (
inputdata.isTagDefined(
"MinVertices") ) MinVertices =
inputdata.GetValue(
"MinVertices");
1009 bool useVertexTracks =
false;
1010 if (
inputdata.isTagDefined(
"UseVertexTracks") ) useVertexTracks = (
inputdata.GetValue(
"UseVertexTracks") > 0 );
1013 std::string vertex_refname =
"Vertex";
1014 if (
inputdata.isTagDefined(
"VertexReference") ) vertex_refname +=
":" +
inputdata.GetString(
"VertexReference");
1017 int NVtxTrackCut = 2;
1018 if (
inputdata.isTagDefined(
"NVtxTrackCut") ) NVtxTrackCut =
inputdata.GetValue(
"NVtxTrackCut");
1022 bool event_selector_flag =
false;
1028 if ( es.size() ) event_selector_flag =
true;
1031 std::vector<double> beamTest;
1032 std::vector<double> beamRef;
1035 bool correctBeamlineRef =
false;
1036 bool correctBeamlineTest =
false;
1038 if (
inputdata.isTagDefined(
"CorrectBeamlineRef") ) correctBeamlineRef = (
inputdata.GetValue(
"CorrectBeamlineRef") == 0 ? false : true );
1039 if (
inputdata.isTagDefined(
"CorrectBeamlineTest") ) correctBeamlineTest = (
inputdata.GetValue(
"CorrectBeamlineTest") == 0 ? false : true );
1042 if (
inputdata.isTagDefined(
"BeamTest") ) beamTest =
inputdata.GetVector(
"BeamTest");
1044 if (
inputdata.isTagDefined(
"BeamTestx") ) beamTest.push_back(
inputdata.GetValue(
"BeamTestx"));
1045 if (
inputdata.isTagDefined(
"BeamTesty") ) beamTest.push_back(
inputdata.GetValue(
"BeamTesty"));
1051 if (
inputdata.isTagDefined(
"BeamRefx") ) beamRef.push_back(
inputdata.GetValue(
"BeamRefx"));
1052 if (
inputdata.isTagDefined(
"BeamRefy") ) beamRef.push_back(
inputdata.GetValue(
"BeamRefy"));
1057 if ( ( beamTest.size()!=0 && beamTest.size()!=2 && beamTest.size()!=3 ) ||
1058 ( beamRef.size()!=0 && beamRef.size()!=2 && beamRef.size()!=3 ) ) {
1059 std::cerr <<
"incorrectly specified beamline position" << std::endl;
1063 if ( beamTest.size()>0 ) correctBeamlineTest =
true;
1064 if ( beamRef.size()>0 ) correctBeamlineRef =
true;
1066 if ( correctBeamlineRef ) std::cout <<
"main() correcting beamline for reference tracks" << std::endl;
1067 if ( correctBeamlineTest ) std::cout <<
"main() correcting beamline for test tracks" << std::endl;
1071 if ( beamRef.size()>0 ) std::cout <<
"beamref " << beamRef << std::endl;
1072 if ( beamTest.size()>0 ) std::cout <<
"beamtest " << beamTest << std::endl;
1081 double a0vrec = 1000;
1082 double z0vrec = 2000;
1087 bool initialiseFirstEvent =
false;
1088 if (
inputdata.isTagDefined(
"InitialiseFirstEvent") ) initialiseFirstEvent =
inputdata.GetValue(
"InitialiseFirstEvent");
1095 bool doPurity =
false;
1096 if (
inputdata.isTagDefined(
"doPurity") ) doPurity = (
inputdata.GetValue(
"doPurity")==0 ? false : true );
1101 bool monitorZBeam =
false;
1102 if (
inputdata.isTagDefined(
"MonitorinZBeam") ) monitorZBeam = (
inputdata.GetValue(
"MonitorZBeam")==0 ? false : true );
1104 std::cout <<
"dbg " << __LINE__ << std::endl;
1110 if ( binningConfigFile!=
"" ) binningConfig =
new ReadCards( binningConfigFile );
1122 if ( binningConfig!=&
inputdata )
delete binningConfig;
1127 int selectcharge = 0;
1131 std::cout <<
"using reference " << refChain << std::endl;
1132 if ( refChain.find(
"Truth") != string::npos ) std::cout <<
"using pdgId " << pdgId << std::endl;
1133 if ( refChains.size() > 1 ) std::cout<<
"Multiple reference chains split to: " << refChains <<std::endl;
1146 std::cout <<
"a0v: " << a0v << std::endl;
1147 std::cout <<
"z0v: " << z0v << std::endl;
1152 npix, nsct, -1, nbl,
1154 npixholes, nsctholes, nsiholes, expectBL );
1156 if ( selectcharge!=0 ) filter_offline.
chargeSelection( selectcharge );
1157 if ( pTMax>
pT ) filter_offline.
maxpT( pTMax );
1184 Filter_Track filter_onlinekine( eta_rec, 1000, 0., 2000,
pT, -1, npix, nsct, -1, -2, -2);
1186 Filter_Combined filter_online( &filter_onlinekine, &filter_onlinevertex );
1188 Filter_Track filter_offkinetight( 5, 1000, 0., 2000,
pT, -1, 0, 0, -1, -2, -2);
1189 Filter_Combined filter_offtight( &filter_offkinetight, &filter_inout );
1197 if (
inputdata.isTagDefined(
"Filter" ) ) {
1199 std::cout <<
"Filter: " <<
inputdata.GetString(
"Filter") <<
" : " <<
filter << std::endl;
1200 if (
filter.head()==
"Offline2017" ) {
1201 std::string filter_type =
filter.tail();
1203 filter_off2017 =
new Filter_Combined ( filter_offline2017, &filter_vertex);
1204 refFilter = filter_off2017;
1207 std::cerr <<
"unimplemented Filter requested: " <<
filter.head() << std::endl;
1212 if ( !(refFilter =
getFilter( refChains[0], pdgId, &filter_off, &filter_muon, &filter_truth ) ) ) {
1213 std::cerr <<
"unknown reference chain defined" << std::endl;
1218 refFilters.push_back(refFilter);
1221 std::map<std::string,TIDA::Reference>
ref;
1223 std::vector<NtupleTrackSelector*> refSelectors;
1230 for (
size_t ic=0 ;
ic<refChains.size() ;
ic++ ) {
1232 if ( refFilter==0 ) {
1233 if ( !(refFilters[
ic] =
getFilter( refChains[
ic], pdgId, &filter_off, &filter_muon, &filter_truth ) ) ) {
1234 std::cerr <<
"unknown reference chain defined" << std::endl;
1237 refFilter = refFilters[
ic];
1239 else refFilters[
ic] = refFilter;
1247 if (pdgId==0) truthFilter = &filter_off;
1248 else truthFilter = &filter_truth;
1254 std::cout <<
"filter_passthrough" << std::endl;
1256 Filter_Track filter_passthrough( 10, 1000, 0., 2000, pT_rec, npix_rec, nsct_rec, 1, -2, -2, -2);
1261 std::cout <<
"using tracks: " << refChain <<
" for reference sample" << std::endl;
1267 std::vector<std::string>& test_chains = testChains;
1272 std::map<std::string,TrackAnalysis*> analysis;
1278 std::vector<TrackAnalysis*>
analyses;
1279 analyses.reserve(test_chains.size());
1281 std::cout <<
"booking " << test_chains.size() <<
" analyses" << std::endl;
1283 for (
unsigned i=0 ;
i<test_chains.size() ;
i++ ) {
1287 std::vector<std::string> chainnames;
1289 chainnames.push_back(chainname);
1297 std::string probe_extra = probe.
extra();
1299 if ( probe_extra.empty() ) probe_extra = probe.
postvalue(
"extra");
1301 if ( probe_extra.find(
"_tag")!=std::string::npos || probe.
extra().find(
"_tag")!=std::string::npos ) {
1302 std::cout <<
"rejecting tag chain " << probe << std::endl;
1307 size_t p = probe_extra.find(
"_probe");
1309 if (
p!=std::string::npos ) {
1311 std::string probe_ref = refChains[0];
1313 if ( !probe.
postvalue(
"ref").empty() ) {
1317 if ( refChains[0] != probe_ref ) {
1318 std::cerr <<
"default and probe chain references do not match: probe ref: " << probe_ref <<
" ref: " << refChains[0] << std::endl;
1325 std::string probe_key = probe_extra.erase(
p, 6);
1327 for (
unsigned j=0 ; j<test_chains.size(); ++j) {
1329 if (
i==j )
continue;
1333 if (
tag.head() != probe.
head() )
continue;
1337 std::string tag_extra =
tag.extra();
1339 if ( tag_extra.empty() ) tag_extra =
tag.postvalue(
"extra");
1340 if ( tag_extra.find(
"_tag")==std::string::npos )
continue;
1343 std::string tag_key = tag_extra.erase( tag_extra.find(
"_tag"), 4) ;
1346 if ( tag_key != probe_key )
continue;
1348 if (
tag.element() == probe.
element() )
continue;
1350 std::string tag_ref = refChains[0];
1358 if ( !
tag.postvalue(
"ref").empty() ) {
1360 tag_ref =
tag.postvalue(
"ref");
1363 std::cout <<
"tag ref: " << tag_ref << std::endl;
1365 if (
ref.find(tag_ref)==
ref.end() ) {
1376 TnP_tool =
new TagNProbe( tag_ref, probe_ref, massMin, massMax);
1378 TnP_tool->
probe(probe);
1379 std::cout <<
"Tag and probe pair found! \n\t Tag : " <<
tag <<
"\n\t Probe : " << probe
1380 <<
"\n\t tag ref: " << tag_ref
1381 <<
"\n\tprobe ref: " << probe_ref
1382 <<
"\n-------------------" << std::endl;
1393 if ( TnP_tool )
replace( chainname,
"/",
"_" );
1400 std::string vtxTool = chainConfig[
i].postvalue(
"rvtx");
1402 if ( vtxTool!=
"" ) {
1407 analy_conf->
store().
insert( anal_confvtx,
"rvtx" );
1424 std::cout <<
"chain:: " << chainname <<
" : size " << chainConfig[
i].values().size() << std::endl;
1425 for (
unsigned ik=chainConfig[
i].
values().
size() ; ik-- ; ) {
1426 std::cout <<
"\tchainconfig: " << ik <<
"\tkey " << chainConfig[
i].keys()[ik] <<
" " << chainConfig[
i].values()[ik] << std::endl;
1433 if ( analysis.find( chainname )==analysis.end() ) {
1434 analysis.insert( std::map<std::string,TrackAnalysis*>::value_type( chainname, analy_conf ) );
1438 std::cerr <<
"WARNING: Duplicated chain"
1440 <<
"---------------------------------"
1441 <<
"---------------------------------"
1442 <<
"---------------------------------" << std::endl;
1446 std::cout <<
"analysis: " << chainname <<
"\t" << analy_conf
1448 <<
"---------------------------------"
1449 <<
"---------------------------------"
1450 <<
"---------------------------------" << std::endl;
1454 std::cout <<
"purity " << (chainnames[0]+
"-purity") << std::endl;
1458 analysis[chainnames[0]+
"-purity"] = analp;
1464 std::cout <<
"main() finished looping" << std::endl;
1468 bool fullyContainTracks =
false;
1470 if (
inputdata.isTagDefined(
"FullyContainTracks") ) {
1471 fullyContainTracks = (
inputdata.GetValue(
"FullyContainTracks")==0 ? false : true );
1474 bool containTracksPhi =
true;
1476 if (
inputdata.isTagDefined(
"ContainTracksPhi") ) {
1477 containTracksPhi = (
inputdata.GetValue(
"ContainTracksPhi")==0 ? false : true );
1482 dynamic_cast<Filter_Combined*
>(refFilter)->containtracks(fullyContainTracks);
1483 dynamic_cast<Filter_Combined*
>(refFilter)->containtracksPhi(containTracksPhi);
1500 bool filterRoi =
false;
1503 bool roicomposite =
false;
1506 if (
inputdata.isTagDefined(
"FilterRoi" ) ) {
1510 std::vector<double> filter_values =
inputdata.GetVector(
"FilterRoi" );
1512 if ( filter_values.size()>0 ) roieta = filter_values[0];
1513 if ( filter_values.size()>1 ) roicomposite = ( filter_values[1]==0 ? false : true );
1514 if ( filter_values.size()>2 ) roimult =
int(filter_values[2]+0.5);
1518 RoiFilter roiFilter( roieta, roicomposite, roimult );
1525 else if ( useMatcher ==
"DeltaRZ" || useMatcher ==
"DeltaRZSinTheta" ) {
1529 if (
inputdata.isTagDefined(
"Matcher_deta" ) ) deta =
inputdata.GetValue(
"Matcher_deta");
1530 if (
inputdata.isTagDefined(
"Matcher_dphi" ) ) dphi =
inputdata.GetValue(
"Matcher_dphi");
1531 if (
inputdata.isTagDefined(
"Matcher_dzed" ) ) dzed =
inputdata.GetValue(
"Matcher_dzed");
1536 else if ( useMatcher ==
"pT_2" ) {
1537 double pTmatchLim_2 = 1.0;
1538 if (
inputdata.isTagDefined(
"Matcher_pTLim_2") ) pTmatchLim_2 =
inputdata.GetValue(
"Matcher_pTLim_2");
1541 else if ( useMatcher ==
"Truth" ) {
1554 else if ( useMatcher ==
"DeltaRZ" || useMatcher ==
"DeltaRZSinTheta" ) {
1558 if (
inputdata.isTagDefined(
"Matcher_deta" ) ) deta =
inputdata.GetValue(
"Matcher_deta");
1559 if (
inputdata.isTagDefined(
"Matcher_dphi" ) ) dphi =
inputdata.GetValue(
"Matcher_dphi");
1560 if (
inputdata.isTagDefined(
"Matcher_dzed" ) ) dzed =
inputdata.GetValue(
"Matcher_dzed");
1565 else if ( useMatcher ==
"pT_2" ) {
1566 double pTmatchLim_2 = 1.0;
1567 if (
inputdata.isTagDefined(
"Matcher_pTLim_2") ) pTmatchLim_2 =
inputdata.GetValue(
"Matcher_pTLim_2");
1570 else if ( useMatcher ==
"Truth" ) {
1594 if (
inputdata.isTagDefined(
"DataSets") ) {
1596 std::cout <<
"fetching dataset details" << std::endl;
1597 std::vector<std::string> datasets =
inputdata.GetStringVector(
"DataSets");
1598 for (
unsigned int ids=0 ;
ids<datasets.size() ;
ids++ ) {
1599 std::cout <<
"\tdataset " << datasets[
ids] << std::endl;
1601 std::vector<std::string> filenames_ =
d.datafiles();
1602 std::cout <<
"\tdataset contains " << filenames_.size() <<
" files" << std::endl;
1608 std::cerr <<
"no input data specified" << std::endl;
1618 bool show_release =
true;
1620 std::vector<std::string> release_data;
1622 std::string release_data_save =
"";
1624 if ( show_release ){
1630 TFile* finput = TFile::Open(
filenames[
i].c_str() );
1633 if ( finput==0 || !finput->IsOpen() || finput->IsZombie() ) {
1634 std::cerr <<
"Error: could not open input file: " <<
filenames[
i] << std::endl;
1638 TTree* dataTree = (TTree*)finput->Get(
"dataTree");
1639 TString* releaseData =
new TString(
"");
1642 dataTree->SetBranchAddress(
"ReleaseMetaData", &releaseData);
1644 for (
unsigned int i=0;
i<dataTree->GetEntries() ;
i++ ) {
1645 dataTree->GetEntry(
i);
1646 release_data.push_back( releaseData->Data() );
1647 if ( release_data_save != release_data.back() ) {
1648 std::cout <<
"main() release data: " << release_data.back() <<
" : " << *releaseData << std::endl;
1651 release_data_save = release_data.back();
1655 if ( finput )
delete finput;
1660 if ( !release_data.empty() ) {
1661 std::sort(release_data.begin(), release_data.end());
1662 release_data.erase(std::unique(release_data.begin(), release_data.end()), release_data.end());
1668 TTree* dataTree =
new TTree(
"dataTree",
"dataTree");
1669 TString* releaseData =
new TString(
"");
1672 dataTree->Branch(
"ReleaseMetaData",
"TString", &releaseData);
1674 for (
unsigned ird=0 ; ird<release_data.size() ; ird++ ) {
1675 *releaseData = release_data[ird];
1679 dataTree->Write(
"", TObject::kOverwrite);
1697 if ( Nentries==0 &&
inputdata.isTagDefined(
"Nentries") ) {
1703 typedef std::pair<int,double> zpair;
1704 std::vector<zpair> refz;
1705 std::vector<zpair> testz;
1707 std::vector<double> beamline_ref;
1708 std::vector<double> beamline_test;
1713 std::cout <<
"opening files" << std::endl;
1717 int pregrl_events = 0;
1718 int grl_counter = 0;
1721 std::cout <<
"starting event loop " <<
time_str() << std::endl;
1725 if ( nfiles!=0 && nfiles<max_files ) max_files = nfiles;
1734 if ( finput==0 || !finput->IsOpen() || finput->IsZombie() ) {
1735 std::cerr <<
"Error: could not open output file " <<
filenames[
ifile] << std::endl;
1739 TTree*
data = (TTree*)finput->Get(
"tree");
1742 std::cerr <<
"Error: cannot open TTree: " <<
filenames[
ifile] << std::endl;
1750 data->SetBranchAddress(
"TIDA::Event",&track_ev);
1756 unsigned cNentries =
data->GetEntries();
1762 for (
unsigned int i=0;
skip &&
run &&
i<cNentries ;
i++ ) {
1784 if ( !ingrl )
continue;
1790 if ( event_selector_flag && !es.
in(
event ) )
continue;
1792 if ( mintime>
ts ) mintime =
ts;
1793 if ( maxtime<
ts ) maxtime =
ts;
1797 std::cout <<
"breaking out " <<
run << std::endl;
1807 hevent->Fill(
event );
1810 if ( (cNentries<10) ||
i%(cNentries/10)==0 ||
i%1000==0 ||
debugPrintout ) {
1811 std::cout <<
"run " << track_ev->
run_number()
1814 <<
"\tchains " << track_ev->
chains().size()
1816 std::cout <<
"\t : processed " <<
i <<
" events so far (" <<
int((1000*
i)/cNentries)*0.1 <<
"%)\t" <<
time_str() << std::endl;
1823 if ( nfiles>0 ) pfiles = nfiles;
1826 std::cout <<
"file entries=" <<
data->GetEntries();
1828 if (
data->GetEntries()<100 ) std::cout <<
" ";
1829 if (
data->GetEntries()<1000 ) std::cout <<
" ";
1830 if (
data->GetEntries()<10000 ) std::cout <<
" ";
1835 std::cout <<
"run " << track_ev->
run_number()
1838 <<
"\tchains " << track_ev->
chains().size()
1841 std::cout <<
"\t : processed " <<
ifile <<
" files so far (" <<
int((1
e3*
ifile)/pfiles)*0.1 <<
"%)\t" <<
time_str() << std::endl;
1854 truthTracks.
clear();
1855 refPurityTracks.
clear();
1859 mit->second.selector()->clear();
1865 const std::vector<TIDA::Chain>&
chains = track_ev->
chains();
1879 for (
const std::string& rc : refChains){
1884 beamline_ref =
chains[
ic][0].user();
1893 std::vector<TIDA::Vertex> vertices;
1897 if ( vtxchain && vtxchain->
size()>0 ) {
1899 const std::vector<TIDA::Vertex>& mv = vtxchain->
at(0).
vertices();
1904 if (
debugPrintout ) std::cout <<
"vertices:\n" << mv << std::endl;
1906 if ( bestPTVtx || bestPT2Vtx ) {
1907 for (
size_t iv=0 ; iv<mv.size() ; iv++ ) {
1908 if ( mv[iv].Ntracks()==0 )
continue;
1909 double selection_ = 0.0;
1912 for (
unsigned itr=0; itr<vtx_temp.
tracks().
size(); itr++) {
1914 if ( bestPTVtx ) selection_ += std::fabs(tr->
pT());
1915 else if ( bestPT2Vtx ) selection_ += std::fabs(tr->
pT())*std::fabs(tr->
pT());
1922 if ( selectvtx!=-1 ) {
1923 vertices.push_back( mv[selectvtx] );
1926 else if ( vtxind>=0 ) {
1927 if (
size_t(vtxind)<mv.size() ) {
1928 vertices.push_back( mv[vtxind] );
1932 for (
size_t iv=0 ; iv<mv.size() ; iv++ ) {
1933 vertices.push_back( mv[iv] );
1944 for (
unsigned iv=0 ; iv<mv.size() ; iv++ ) {
1945 int Ntracks = mv[iv].Ntracks();
1946 if ( Ntracks>NVtxTrackCut ) {
1963 bool foundReference =
false;
1972 for (
const std::string& rc : refChains ) {
1981 std::string refname = mitr->first;
1990 *mitr->second.tom() = rtom;
2004 if ( !foundReference )
continue;
2007 std::cout <<
"reference chain:\n" << *refchain << std::endl;
2021 if ( analitr==analysis.end() )
continue;
2024 std::cout <<
"test chain:\n" <<
chain << std::endl;
2029 std::vector<TIDA::Roi*>
rois;
2049 if ( TnP_tool->
type0() == TnP_tool->
type1() ) {
2051 rois = TnP_tool->
GetRois( track_ev->
chains(), selector0, filter0, invmass, invmass_obj, rtom );
2065 for (
size_t ia=0 ; ia<selector1->
tracks().size() ; ia++ ) {
2067 std::cout << ia <<
"\t" << *
track << std::endl;
2068 std::cout <<
"\t" << rtom1->
object(
track->id()) << std::endl;
2071 std::cout << *TnP_tool << std::endl;
2074 rois = TnP_tool->
GetRois( track_ev->
chains(), selector0, filter0, selector1, filter1, invmass, invmass_obj, rtom, rtom1 );
2084 if (
false ) std::cout <<
"++++++++++++ rois size = " <<
rois.size() <<
" +++++++++++" << std::endl;
2087 for (
unsigned int ir=0 ;
ir<
rois.size() ;
ir++ ) {
2100 std::vector<TIDA::Track*> testp = testTracks.
tracks();
2105 if ( filterRoi && !roiFilter.
filter( roi ) )
continue;
2108 const std::vector<TIDA::Vertex>& mvt = troi.
vertices();
2110 std::vector<TIDA::Vertex> vertices_test;
2115 if ( bestPTVtx_rec || bestPT2Vtx_rec ) {
2119 for (
unsigned iv=0 ; iv<mvt.size() ; iv++ ) {
2120 double selection_ = 0.0;
2123 for (
unsigned itr=0; itr<vtx_temp.
tracks().
size(); itr++) {
2125 if ( bestPTVtx ) selection_ += std::fabs(tr->
pT());
2126 else if ( bestPT2Vtx ) selection_ += std::fabs(tr->
pT())*std::fabs(tr->
pT());
2133 if ( selectvtx!=-1 ) {
2136 vertices_test.push_back(selected);
2139 else if ( vtxind_rec!=-1 ) {
2140 if (
unsigned(vtxind_rec)<mvt.size() ) {
2143 vertices_test.push_back( selected );
2147 for (
unsigned iv=0 ; iv<mvt.size() ; iv++ ) {
2150 vertices_test.push_back( selected );
2155 beamline_test =
rois[
ir]->user();
2162 if ( correctBeamlineTest ) {
2163 if ( beamTest.size()==2 ) analy_track->
setBeamTest( beamTest[0], beamTest[1] );
2166 if ( !
inputdata.isTagDefined(
"BeamTest") ) {
2167 if ( beamline_test.size()==2 ) analy_track->
setBeamTest( beamline_test[0], beamline_test[1] );
2173 if ( correctBeamlineRef ) {
2174 if ( beamRef.size()==2 ) analy_track->
setBeamRef( beamRef[0], beamRef[1] );
2177 if ( !
inputdata.isTagDefined(
"BeamRef") ) {
2178 if ( beamline_ref.size()==2 ) analy_track->
setBeamRef( beamline_ref[0], beamline_ref[1] );
2197 bool customRefRoi_thisChain =
false;
2199 if ( use_custom_ref_roi ) {
2200 if ( customRoi_chains.size() ) {
2201 if ( customRoi_chains.find(
chain.name() )!=customRoi_chains.end() ) customRefRoi_thisChain =
true;
2203 else customRefRoi_thisChain =
true;
2206 if ( use_custom_ref_roi && customRefRoi_thisChain ) {
2207 refRoi =
makeCustomRefRoi( roi, custRefRoi_params[0], custRefRoi_params[1], custRefRoi_params[2] );
2223 std::vector<TIDA::Track*> refp_vec = refTracks.
tracks( refFilter );
2228 if ( select_roi )
dynamic_cast<Filter_Combined*
>(truthFilter)->setRoi(&roi);
2229 const std::vector<TIDA::Track*>& truth = truthTracks.
tracks(truthFilter);
2230 const std::vector<TIDA::Track*>& refp_tmp = refp_vec;
2233 truth_matcher->
match( refp_tmp, truth );
2235 std::vector<TIDA::Track*> refp_matched;
2238 for (
unsigned i=0 ;
i<refp_vec.size() ;
i++ ) {
2239 if ( truth_matcher->
matched( refp_vec[
i] ) ) refp_matched.push_back( refp_vec[
i] );
2243 refp_vec = refp_matched;
2247 if ( use_pt_ordered_ref ) {
2248 std::sort( refp_vec.begin(), refp_vec.end(),
trackPtGrtr );
2250 size_t nRefTracks = refp_vec.size();
2252 std::vector<TIDA::Track*> refp_chosenPtOrd;
2256 for (
size_t sidx=refPtOrd_indices.size() ; sidx-- ; ) {
2257 if ( refPtOrd_indices.at(sidx)>nRefTracks ) {
2258 std::cout <<
"WARNING: for event " <<
event
2259 <<
", pT ordered reference track at vector position " << refPtOrd_indices.at(sidx)
2260 <<
" requested but not found" << std::endl;
2266 for (
size_t sidx=refPtOrd_indices.size() ; sidx-- ; ) {
2267 for (
size_t idx=0 ;
idx<refp_vec.size() ;
idx++ ) {
2268 if (
idx == refPtOrd_indices.at(sidx) ) {
2269 refp_chosenPtOrd.push_back(refp_vec.at(
idx));
2276 refp_vec = refp_chosenPtOrd;
2287 if ( ptconfig!=
"" ) {
2290 std::vector<TIDA::Track*> reft; reft.reserve(refp_vec.size());
2291 for ( std::vector<TIDA::Track*>::const_iterator itr=refp_vec.begin() ; itr!=refp_vec.end() ; ++itr ) {
2292 if ( std::fabs((*itr)->pT())>=
pt ) reft.push_back( *itr );
2301 if ( d0config!=
"" ) {
2304 std::vector<TIDA::Track*> reft; reft.reserve(refp_vec.size());
2305 for ( std::vector<TIDA::Track*>::const_iterator itr=refp_vec.begin() ; itr!=refp_vec.end() ; ++itr ) {
2306 if ( std::fabs((*itr)->a0())<=
d0 ) reft.push_back( *itr );
2323 if ( objectET !=
"" ) {
2325 double ETconfig =
std::atof( objectET.c_str() );
2331 while ( itr!=refp_vec.end() ) {
2334 if ( tobj==0 || tobj->
pt()<ETconfig )
2335 itr=refp_vec.erase( itr );
2343 const std::vector<TIDA::Track*>& refp = refp_vec;
2360 std::vector<TIDA::Vertex> vertices_roi;
2368 vertices_roi.clear();
2370 const std::vector<TIDA::Vertex>& mv = vertices;
2375 for (
unsigned iv=0 ; iv<mv.size() ; iv++ ) {
2381 bool accept_vertex =
false;
2384 if ( roi[
ir]->zedMinus()<=vx.
z() && roi[
ir]->
zedPlus()>=vx.
z() ) accept_vertex =
true;
2391 if ( !accept_vertex )
continue;
2397 if ( useVertexTracks ) {
2401 trackcount = vertex_roi.
Ntracks();
2402 if ( trackcount>=ntracks && trackcount>0 ) {
2403 vertices_roi.push_back( vertex_roi );
2408 for (
unsigned itr=0; itr<refp.size(); itr++){
2411 double dzsintheta = std::fabs( (vx.
z()-tr->
z0()) *
std::sin(theta_) );
2412 if( dzsintheta < 1.5 ) trackcount++;
2417 if ( trackcount>=ntracks && trackcount>0 ) {
2419 vertices_roi.push_back( vertex_roi );
2427 if ( rotate_testtracks )
for (
size_t i=testp.size() ;
i-- ; ) testp[
i]->rotate();
2433 if ( monitorZBeam ) {
2434 if ( beamline_ref.size()>2 && beamline_test.size()>2 ) {
2435 refz.push_back( zpair(
lb, beamline_ref[2]) );
2436 testz.push_back( zpair(
lb, beamline_test[2]) );
2440 matcher->
match( refp, testp);
2442 if ( tom.
status() ) analitr->second->execute( refp, testp, matcher, &tom );
2443 else analitr->second->execute( refp, testp, matcher );
2446 analitr->second->store().find( vtxanal,
"rvtx" );
2450 if ( vtxanal && ( refp.size() >=
size_t(ntracks) ) ) {
2469 std::cout <<
"\nselected tracks:" <<
chain.name() << std::endl;
2470 std::cout <<
"ref tracks refp.size() " << refp.size() <<
"\n" << refp << std::endl;
2471 std::cout <<
"test tracks testp.size() " << testp.size() <<
"\n" << testp << std::endl;
2473 TrackAssociator::map_type::const_iterator titr = matcher->TrackAssociator::matched().begin();
2474 TrackAssociator::map_type::const_iterator
tend = matcher->TrackAssociator::matched().end();
2476 std::cout <<
"track matches:\n";
2477 while (titr!=
tend) {
2478 std::cout <<
"\t" <<
im++ <<
"\t" << *titr->first <<
" ->\n\t\t" << *titr->second << std::endl;
2483 std::cout <<
"completed : " <<
chain.name() <<
"\n";
2484 std::cout <<
"-----------------------------------" << std::endl;
2489 if ( _matcher->size()<refp.size() ) {
2491 if ( refp.size()==1 && testp.size()==0 ) {
2492 std::cout << track_ev->
chains()[
ic] <<std::endl;
2493 std::cout <<
"roi\n" << track_ev->
chains()[
ic].rois()[
ir] << endl;
2503 const std::vector<TIDA::Track*>& refpp = refPurityTracks.
tracks( refFilter );
2505 testPurityTracks.
clear();
2508 std::vector<TIDA::Track*> testpp = testPurityTracks.
tracks();
2510 matcher->
match(refpp, testpp);
2515 if ( analitrp == analysis.end() )
continue;
2518 analitrp->second->execute( refpp, testpp, matcher );
2539 <<
"\ttimes " << mintime <<
" " << maxtime
2540 <<
"\t( grl: " << grl_counter <<
" / " << pregrl_events <<
" )" << std::endl;
2542 if ( monitorZBeam )
zbeam zb( refz, testz );
2556 analyses[
i]->store().find( vtxanal,
"rvtx" );
2557 if ( vtxanal ) vtxanal->
finalise();
2568 mit->second.Clean();
2572 if ( ex_matcher )
delete ex_matcher;
2574 std::cout <<
"done" << std::endl;