HighLAND
AnalysisUtils.hxx
1 #ifndef AnalysisUtils_h
2 #define AnalysisUtils_h
3 
4 #include "BaseDataClasses.hxx"
5 #include "BinnedParams.hxx"
6 #include "BasicUtils.hxx"
7 #include "SelectionBase.hxx"
8 #include "HEPConstants.hxx"
9 #include "KinematicsUtils.hxx"
10 #include "SubDetUtils.hxx"
11 
12 /// This namespace contains useful functions for analyses. Functions include
13 /// those related to fiducial volumes, accessing tracks with specific
14 /// characteristics, and more.
15 namespace anaUtils{
16 
17  //----- Utility functions -------------
18 
19 
20  /// Get The software version from the path of the package
21  std::string GetSoftwareVersionFromPath(const std::string& path);
22 
23  /// Get the package name provided the name of the executable being run
24  std::string GetPackageNameFromProgram(const std::string& program);
25 
26  /// Get the package name provided a path containing the package name
27  std::string GetPackageNameFromPath(const std::string& path);
28 
29  /// Get the vector of packages ordered following the package hierarchy
30  std::vector<std::string> GetPackageHierarchy();
31 
32  /// Calculate the distance between two points
33  float GetSeparationSquared(const Float_t* pos1, const Float_t* pos2);
34 
35  /// Compute all event weights (FluxWeight, etc. not the systematic ones !!!) and return the vector
36  std::vector<Float_t> ComputeWeights(const AnaEventB& event);
37 
38 
39  /// Get the AnaTrueParticleB in the current spill with the given ID. Return NULL if it can't be found.
40  AnaTrueParticleB* GetTrueParticleByID(const AnaEventB& event, int ID);
41 
42 
43  /// Merge the two vectors of AnaTrackBs into a single vector, with no duplicated tracks.
44  std::vector<AnaTrackB*> MergeUniqueTracks(const std::vector<AnaTrackB*>& tracks1, const std::vector<AnaTrackB*>& tracks2);
45 }
46 
47 #endif
std::vector< AnaTrackB * > MergeUniqueTracks(const std::vector< AnaTrackB *> &tracks1, const std::vector< AnaTrackB *> &tracks2)
Merge the two vectors of AnaTrackBs into a single vector, with no duplicated tracks.
std::string GetPackageNameFromPath(const std::string &path)
Get the package name provided a path containing the package name.
std::string GetPackageNameFromProgram(const std::string &program)
Get the package name provided the name of the executable being run.
float GetSeparationSquared(const Float_t *pos1, const Float_t *pos2)
Calculate the distance between two points.
std::string GetSoftwareVersionFromPath(const std::string &path)
Get The software version from the path of the package.
Representation of a true Monte Carlo trajectory/particle.
AnaTrueParticleB * GetTrueParticleByID(const AnaEventB &event, int ID)
Get the AnaTrueParticleB in the current spill with the given ID. Return NULL if it can&#39;t be found...
std::vector< std::string > GetPackageHierarchy()
Get the vector of packages ordered following the package hierarchy.
This namespace contains useful functions for analyses related to kinematics.
std::vector< Float_t > ComputeWeights(const AnaEventB &event)
Compute all event weights (FluxWeight, etc. not the systematic ones !!!) and return the vector...