hpstr
The Heavy Photon Search Toolkit for Reconstruction (hpstr) provides an interface to physics data from the HPS experiment saved in the LCIO format and converts it into an ROOT based format.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
VertexAnaProcessor.h
Go to the documentation of this file.
1#ifndef __VERTEX_ANAPROCESSOR_H__
2#define __VERTEX_ANAPROCESSOR_H__
3
4// HPSTR
5#include "HpsEvent.h"
6#include "Collections.h"
7#include "EventHeader.h"
8#include "TSData.h"
9#include "Vertex.h"
10#include "Track.h"
11#include "TrackerHit.h"
12#include "MCParticle.h"
13#include "Particle.h"
14#include "Processor.h"
15#include "BaseSelector.h"
16#include "TrackHistos.h"
17#include "MCAnaHistos.h"
18#include "utilities.h"
19
20#include "FlatTupleMaker.h"
21#include "AnaHelpers.h"
22
23// ROOT
24#include "TFile.h"
25#include "TTree.h"
26#include "TRefArray.h"
27#include "TBranch.h"
28#include "TVector3.h"
29#include "TLorentzVector.h"
30
31// C++
32#include <memory>
33
34struct char_cmp {
35 bool operator () (const char *a,const char *b) const
36 {
37 return strcmp(a,b)<0;
38 }
39};
40
46
47 public:
54 VertexAnaProcessor(const std::string& name, Process& process);
55
57
65 virtual bool process(IEvent* ievent);
66
72 virtual void initialize(TTree* tree);
73
78 virtual void finalize();
79
85 virtual void configure(const ParameterSet& parameters);
86
87 private:
88 std::shared_ptr<BaseSelector> vtxSelector;
89 std::vector<std::string> regionSelections_;
90
91 std::string selectionCfg_;
92 std::map<const char*, int, char_cmp> brMap_;
93 TBranch* bts_{nullptr};
94 TBranch* bvtxs_{nullptr};
95 TBranch* bhits_{nullptr};
96 TBranch* btrks_{nullptr};
97 TBranch* bmcParts_{nullptr};
98 TBranch* bevth_{nullptr};
99 TBranch* becal_{nullptr};
100
101 EventHeader* evth_{nullptr};
102 TSData* ts_{nullptr};
103 std::vector<CalCluster*>* ecal_{};
104 std::vector<Vertex*>* vtxs_{};
105 std::vector<Track*>* trks_{};
106 std::vector<TrackerHit*>* hits_{};
107 std::vector<MCParticle*>* mcParts_{};
108
109 std::string anaName_{"vtxAna"};
110 std::string tsColl_{"TSBank"};
111 std::string vtxColl_{"Vertices"};
112 std::string hitColl_{"RotatedHelicalTrackHits"};
113 std::string trkColl_{"GBLTracks"};
114 std::string ecalColl_{"RecoEcalClusters"};
115 std::string mcColl_{"MCParticle"};
116 int isRadPDG_{622};
118 TTree* tree_{nullptr};
119
120 std::shared_ptr<TrackHistos> _vtx_histos;
121 std::shared_ptr<MCAnaHistos> _mc_vtx_histos;
122
124 std::map<std::string, std::shared_ptr<BaseSelector>> _reg_vtx_selectors;
125 std::map<std::string, std::shared_ptr<TrackHistos>> _reg_vtx_histos;
126 std::map<std::string, std::shared_ptr<MCAnaHistos>> _reg_mc_vtx_histos;
127 std::map<std::string, std::shared_ptr<FlatTupleMaker>> _reg_tuples;
128
129 std::vector<std::string> _regions;
130
131 typedef std::map<std::string, std::shared_ptr<TrackHistos>>::iterator reg_it;
132 typedef std::map<std::string, std::shared_ptr<MCAnaHistos>>::iterator reg_mc_it;
133
134 std::string histoCfg_{""};
135 std::string mcHistoCfg_{""};
136 double timeOffset_{-999};
137 double beamE_{2.3};
138 int isData_{0};
139 std::string analysis_{"vertex"};
140
141 std::shared_ptr<AnaHelpers> _ah;
142
143 int debug_{0};
144 std::string beamPosCfg_{""};
146 std::vector<double> beamPosCorrections_ = {0.0,0.0,0.0};
147 std::string v0ProjectionFitsCfg_{""};
149 double eleTrackTimeBias_ = 0.0;
150 double posTrackTimeBias_ = 0.0;
152
153 bool mc_reg_on_ = false;
154};
155
156#endif
Helper class for hipster analysis.
nlohmann::json json
Class used to encapsulate event information.
Class used to encapsulate information about a mc particle.
Class used to encapsulate information about a particle.
Base classes for all user event processing components to extend.
Class used to decode TS words.
Class used to encapsulate track information.
Class used to encapsulate tracker hit information.
Class used to encapsulate Vertex information.
Definition IEvent.h:7
description
Base class for all event processing components.
Definition Processor.h:34
virtual bool process()
Process the histograms and generate analysis output.
Definition Processor.h:95
Insert description here. more details.
std::shared_ptr< MCAnaHistos > _mc_vtx_histos
description
std::string v0ProjectionFitsCfg_
json file w run dependent v0 projection fits
json bpc_configs_
json object
std::string histoCfg_
description
double timeOffset_
description
std::string selectionCfg_
description
std::string anaName_
description
int makeFlatTuple_
make true in config to save flat tuple
virtual void configure(const ParameterSet &parameters)
description
virtual void finalize()
description
TSData * ts_
description
std::vector< std::string > regionSelections_
description
virtual void initialize(TTree *tree)
description
std::map< std::string, std::shared_ptr< TrackHistos > > _reg_vtx_histos
description
std::map< std::string, std::shared_ptr< MCAnaHistos > >::iterator reg_mc_it
description
std::string analysis_
description
TTree * tree_
description
TBranch * bvtxs_
description
std::string mcColl_
description
TBranch * becal_
description
double beamE_
In GeV. Default is 2016 value;.
std::vector< Track * > * trks_
description
std::map< std::string, std::shared_ptr< BaseSelector > > _reg_vtx_selectors
description
std::map< std::string, std::shared_ptr< TrackHistos > >::iterator reg_it
description
std::shared_ptr< BaseSelector > vtxSelector
description
std::shared_ptr< TrackHistos > _vtx_histos
description
std::vector< CalCluster * > * ecal_
description
EventHeader * evth_
description
TBranch * bmcParts_
description
std::vector< TrackerHit * > * hits_
description
std::string tsColl_
description
json v0proj_fits_
json object v0proj
std::string beamPosCfg_
json containing run dep beamspot positions
std::map< std::string, std::shared_ptr< FlatTupleMaker > > _reg_tuples
description
int current_run_number_
track current run number
std::shared_ptr< AnaHelpers > _ah
description
TBranch * bevth_
description
std::string trkColl_
description
std::map< const char *, int, char_cmp > brMap_
description
TBranch * btrks_
description
std::string vtxColl_
description
std::string ecalColl_
description
std::map< std::string, std::shared_ptr< MCAnaHistos > > _reg_mc_vtx_histos
description
TBranch * bts_
description
std::string hitColl_
description
std::string mcHistoCfg_
description
std::vector< Vertex * > * vtxs_
description
std::vector< double > beamPosCorrections_
holds beam position corrections
TBranch * bhits_
description
std::vector< std::string > _regions
description
std::vector< MCParticle * > * mcParts_
description
bool operator()(const char *a, const char *b) const