17 #include <phgeom/PHGeomUtility.h>
28 #include <g4hough/SvtxCluster.h>
29 #include <g4hough/SvtxClusterMap.h>
30 #include <g4hough/SvtxHitMap.h>
31 #include <g4hough/SvtxTrack.h>
32 #include <g4hough/SvtxVertex.h>
33 #include <g4hough/SvtxTrackMap.h>
34 #include <g4hough/SvtxVertexMap.h>
36 #include <g4jets/JetMap.h>
37 #include <g4jets/Jet.h>
42 #include <g4detectors/PHG4CylinderGeom_MAPS.h>
43 #include <g4detectors/PHG4CylinderGeom_Siladders.h>
45 #include <phgenfit/Fitter.h>
46 #include <phgenfit/PlanarMeasurement.h>
47 #include <phgenfit/Track.h>
48 #include <phgenfit/SpacepointMeasurement.h>
51 #include <GenFit/FieldManager.h>
52 #include <GenFit/GFRaveConverters.h>
53 #include <GenFit/GFRaveVertex.h>
54 #include <GenFit/GFRaveVertexFactory.h>
55 #include <GenFit/MeasuredStateOnPlane.h>
56 #include <GenFit/RKTrackRep.h>
57 #include <GenFit/StateOnPlane.h>
61 #include <rave/Version.h>
62 #include <rave/Track.h>
63 #include <rave/VertexFactory.h>
64 #include <rave/ConstantMagneticField.h>
67 #include <HepMC/GenEvent.h>
68 #include <HepMC/GenVertex.h>
70 #include <HFJetTruthGeneration/HFJetDefs.h>
74 #include "TLorentzVector.h"
79 #include "TDecompSVD.h"
90 #define LogDebug(exp) std::cout<<"DEBUG: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
91 #define LogError(exp) std::cout<<"ERROR: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
92 #define LogWarning(exp) std::cout<<"WARNING: " <<__FILE__<<": "<<__LINE__<<": "<< exp <<"\n"
104 for (
int il = 0; il < 4; il++)
121 hlayer =
new TH1D(
"hlayer",
";layer", 6, -0.5, 5.5);
123 for (
int il = 0; il < 4; il++)
125 hsize_phi[il] =
new TH1D(Form(
"hsize_phi_l%i", il),
126 ";cluster size #phi [cm]",
129 hsize_z[il] =
new TH1D(Form(
"hsize_z_l%i", il),
130 ";cluster size z [cm]",
133 hphiz[il] =
new TH2D(Form(
"hphiz_l%i", il),
138 hdphi[il] =
new TH1D(Form(
"hdphi_l%i", il),
142 hdz[il] =
new TH1D(Form(
"hdz_l%i", il),
179 std::cout <<
"AnaMvtxTelescopeHits::process_event()" << std::endl;
193 std::cout <<
"-- evnt:" <<
_ievent << std::endl;
194 std::cout <<
"-- Nclus:" <<
_clustermap->size() << std::endl;
203 std::cout <<
"-- Looping over clusters" << std::endl;
211 SvtxCluster *clus = iter->second;
213 hlayer->Fill(clus->get_layer());
215 unsigned int lyr = clus->get_layer();
216 if (lyr < 0 || lyr > 3)
218 hsize_phi[lyr]->Fill(clus->get_phi_size());
219 hsize_z[lyr]->Fill(clus->get_z_size());
221 double phi = TMath::ATan2(clus->get_y(), clus->get_x());
222 hphiz[lyr]->Fill(clus->get_z(),
phi);
225 _mmap_lyr_clus.insert(std::make_pair(lyr, clus));
229 std::cout <<
"-- _mmap_lyr_clus.size():" << _mmap_lyr_clus.size() << std::endl;
236 std::cout <<
"-- Performing simple tracking" << std::endl;
239 LyrClusMap::iterator lyr0_itr;
240 LyrClusMap::iterator lyr_itr;
241 LyrClusMap::iterator lyr3_itr;
242 for ( lyr0_itr = _mmap_lyr_clus.lower_bound(0);
243 lyr0_itr != _mmap_lyr_clus.upper_bound(0);
246 SvtxCluster* clus0 = lyr0_itr->second;
250 std::cout <<
"WARNING: clus0 not found" << std::endl;
255 double r0 = TMath::Sqrt(TMath::Power(clus0->get_x(), 2) + TMath::Power(clus0->get_y(), 2));
256 double p0 = TMath::ATan2(clus0->get_y(), clus0->get_x());
257 double z0 = clus0->get_z();
261 std::cout <<
"-- clus0:(" << r0 <<
", " << p0 <<
", " << z0 <<
")" << std::endl;
265 for ( lyr3_itr = _mmap_lyr_clus.lower_bound(3);
266 lyr3_itr != _mmap_lyr_clus.upper_bound(3);
269 SvtxCluster* clus3 = lyr3_itr->second;
273 std::cout <<
"WARNING: clus3 not found" << std::endl;
278 double r3 = TMath::Sqrt(TMath::Power(clus3->get_x(), 2) + TMath::Power(clus3->get_y(), 2));
279 double p3 = TMath::ATan2(clus3->get_y(), clus3->get_x());
280 double z3 = clus3->get_z();
293 std::cout <<
"-- clus3:(" << r3 <<
", " << p3 <<
", " << z3 <<
")" << std::endl;
294 std::cout <<
"-- mpr:" << mpr <<
" bpr:" << bpr << std::endl;
295 std::cout <<
"-- mzr:" << mzr <<
" bzr:" << bzr << std::endl;
301 for (
int ilyr = 1; ilyr <= 2; ilyr++)
303 for ( lyr_itr = _mmap_lyr_clus.lower_bound(ilyr);
304 lyr_itr != _mmap_lyr_clus.upper_bound(ilyr);
307 SvtxCluster* clus = lyr_itr->second;
313 double r = TMath::Sqrt(TMath::Power(clus->get_x(), 2) + TMath::Power(clus->get_y(), 2));
314 double phi = TMath::ATan2(clus->get_y(), clus->get_x());
315 double z = clus->get_z();
322 double dphi = (phi_proj -
phi) * 1e4;
323 double dz = (z_proj -
z) * 1e4;
327 std::cout <<
"WARNING!! can't find hdphi or hdz for lyr:" << ilyr << std::endl;
331 hdphi[ilyr]->Fill(dphi);
337 std::cout <<
"------------------" << std::endl;
338 std::cout <<
"-- clus" << clus->get_layer() <<
":(" << r3 <<
", " << p3 <<
", " << z3 <<
")" << std::endl;
339 std::cout <<
"-- proj:(" << phi_proj <<
", " << z_proj <<
")" << std::endl;
340 std::cout <<
"-- dphi [micron]: " << dphi << std::endl;
341 std::cout <<
"-- dz [micron]: " << dz << std::endl;
342 std::cout <<
"------------------" << std::endl;
354 std::cout <<
"-- Done simple tracking" << std::endl;
398 _clustermap = findNode::getClass<SvtxClusterMap>(topNode,
"SvtxClusterMap");
400 std::cout <<
PHWHERE <<
" SvtxClusterMap node not found on node tree"
415 return (y1 - y0) / (x1 -
x0);