2 #define PFOUTILITIES_H 1
4 #include <EVENT/LCObject.h>
5 #include <EVENT/ReconstructedParticle.h>
6 #include "TrackHitPair.h"
12 #include "HelixClass.h"
13 #include "TrackHitPair.h"
16 #include <marlinutil/GeometryUtil.h>
21 #define FORMATTED_OUTPUT_TRACK_CLUSTER_full(out, N1, E1, E2, E3, N2, E4, N3, E5, E6, E7) \
22 out << std::right << std::setw(widthInt) << N1 << std::right << std::setw(widthFloat) << E1 << std::right \
23 << std::setw(widthFloat) << E2 << std::right << std::setw(widthFloat) << E3 << std::right << std::setw(widthInt) \
24 << N2 << std::right << std::setw(widthFloat) << E4 << std::right << std::setw(widthInt) << N3 << std::right \
25 << std::setw(widthFloat) << E5 << std::right << std::setw(widthFloat) << E6 << std::right << std::setw(widthFloat) \
28 #define FORMATTED_OUTPUT_TRACK_CLUSTER(out, N1, E1, E2, E3, N2, N3) \
29 out << std::right << std::setw(widthInt) << N1 << std::right << std::setw(widthFloat) << E1 << std::right \
30 << std::setw(widthFloat) << E2 << std::right << std::setw(widthFloat) << E3 << std::right << std::setw(widthSmallInt) \
31 << N2 << std::right << std::setw(widthSmallInt) << N3 << std::endl
33 #define FORMATTED_OUTPUT_TRACK(out, N1, E1, E2, E3, N2, N3) \
34 out << std::right << std::setw(widthInt) << N1 << std::right << std::setw(widthFloat) << E1 << std::right \
35 << std::setw(widthFloat) << E2 << std::right << std::setw(widthFloat) << E3 << std::right << std::setw(widthSmallInt) \
36 << N2 << std::right << std::setw(widthSmallInt) << N3 << std::endl
38 #define FORMATTED_OUTPUT_CLUSTER(out, N1, E1, E2, E3, N2, N3) \
39 out << std::right << std::setw(widthInt) << N1 << std::right << std::setw(widthFloat) << E1 << std::right \
40 << std::setw(widthFloat) << E2 << std::right << std::setw(widthFloat) << E3 << std::right << std::setw(widthSmallInt) \
41 << N2 << std::right << std::setw(widthSmallInt) << N3 << std::endl
43 #define FORMATTED_OUTPUT_MC(out, N1, E1) \
44 out << std::right << std::setw(widthInt) << N1 << std::right << std::setw(widthFloat) << E1 << std::endl
48 typedef std::vector<EVENT::ReconstructedParticle*>
PfoList;
50 static bool PfoSortFunction(EVENT::ReconstructedParticle* lhs, EVENT::ReconstructedParticle* rhs) {
53 const float lhs_energy = lhs->getEnergy();
54 const float rhs_energy = rhs->getEnergy();
55 const EVENT::ClusterVec lhs_clusters = lhs->getClusters();
56 const EVENT::TrackVec lhs_tracks = lhs->getTracks();
57 const EVENT::TrackVec rhs_tracks = rhs->getTracks();
58 const EVENT::ClusterVec rhs_clusters = rhs->getClusters();
59 const int lhs_particleType = abs(lhs->getType());
60 const int rhs_particleType = abs(rhs->getType());
65 if (lhs_clusters.size() == 0)
67 if (rhs_clusters.size() == 0)
69 if (lhs_particleType == 22)
71 if (rhs_particleType == 22)
73 if (lhs_particleType == 2112)
75 if (rhs_particleType == 2112)
78 if (lhs_type == rhs_type)
79 return (lhs_energy > rhs_energy);
80 return (lhs_type < rhs_type);
83 float TimeAtEcal(
const Track* pTrack,
float& tof);
86 void GetClusterTimes(
const Cluster* cluster,
float& meanTime,
int& nCaloHitsUsed,
float& meanTimeEcal,
int& nEcal,
87 float& meanTimeHcalEndcap,
int& nHcalEnd,
bool correctHitTimesForTimeOfFlight);
91 #endif // PFOUTILITIES_H
float TimeAtEcal(const Track *pTrack, float &tof)
std::vector< EVENT::ReconstructedParticle * > PfoList
static bool PfoSortFunction(EVENT::ReconstructedParticle *lhs, EVENT::ReconstructedParticle *rhs)
void GetClusterTimes(const Cluster *cluster, float &meanTime, int &nCaloHitsUsed, float &meanTimeEcal, int &nEcal, float &meanTimeHcalEndcap, int &nHcalEnd, bool correctHitTimesForTimeOfFlight)