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
NewVertexAnaProcessor.h
Go to the documentation of this file.
1#ifndef __NEWVERTEX_ANAPROCESSOR_H__
2#define __NEWVERTEX_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 "TrackSmearingTool.h"
21#include "TrackBiasingTool.h"
22#include "FlatTupleMaker.h"
23#include "AnaHelpers.h"
24
25// ROOT
26#include "TFile.h"
27#include "TTree.h"
28#include "TRefArray.h"
29#include "TBranch.h"
30#include "TVector3.h"
31#include "TLorentzVector.h"
32
33// C++
34#include <memory>
35
36struct char_cmp {
37 bool operator () (const char *a,const char *b) const
38 {
39 return strcmp(a,b)<0;
40 }
41};
42
48
49 public:
56 NewVertexAnaProcessor(const std::string& name, Process& process);
57
59
67 virtual bool process(IEvent* ievent);
68
74 virtual void initialize(TTree* tree);
75
80 virtual void finalize();
81
87 virtual void configure(const ParameterSet& parameters);
88
89 private:
90 std::shared_ptr<BaseSelector> vtxSelector;
91 std::vector<std::string> regionSelections_;
92
93 std::string selectionCfg_;
94 std::map<const char*, int, char_cmp> brMap_;
95 TBranch* bts_{nullptr};
96 TBranch* bvtxs_{nullptr};
97 TBranch* bhits_{nullptr};
98 TBranch* bmcParts_{nullptr};
99 TBranch* bevth_{nullptr};
100 TBranch* becal_{nullptr};
101
102 EventHeader* evth_{nullptr};
103 TSData* ts_{nullptr};
104 std::vector<CalCluster*>* ecal_{};
105 std::vector<Vertex*>* vtxs_{};
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 ecalColl_{"RecoEcalClusters"};
114 std::string mcColl_{"MCParticle"};
115 int isRadPDG_{622};
117 TTree* tree_{nullptr};
118
119 std::string pSmearingFile_{""};
120 std::shared_ptr<TrackSmearingTool> smearingTool_;
121 std::string pBiasingFile_{""};
122 std::shared_ptr<TrackBiasingTool> biasingTool_;
123
124 std::shared_ptr<TrackHistos> _vtx_histos;
125 std::shared_ptr<MCAnaHistos> _mc_vtx_histos;
126
128 std::map<std::string, std::shared_ptr<BaseSelector>> _reg_vtx_selectors;
129 std::map<std::string, std::shared_ptr<TrackHistos>> _reg_vtx_histos;
130 std::map<std::string, std::shared_ptr<MCAnaHistos>> _reg_mc_vtx_histos;
131 std::map<std::string, std::shared_ptr<FlatTupleMaker>> _reg_tuples;
132
133 std::vector<std::string> _regions;
134
135 typedef std::map<std::string, std::shared_ptr<TrackHistos>>::iterator reg_it;
136 typedef std::map<std::string, std::shared_ptr<MCAnaHistos>>::iterator reg_mc_it;
137
138 std::string histoCfg_{""};
139 std::string mcHistoCfg_{""};
140 double timeOffset_{-999};
141 double beamE_{2.3};
142 int isData_{0};
143 std::string analysis_{"vertex"};
144
145 std::shared_ptr<AnaHelpers> _ah;
146
147 int debug_{0};
148 std::string beamPosCfg_{""};
150 std::vector<double> beamPosCorrections_ = {0.0,0.0,0.0};
151 std::string v0ProjectionFitsCfg_{""};
153 double eleTrackTimeBias_ = 0.0;
154 double posTrackTimeBias_ = 0.0;
155
158};
159
160#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
Insert description here. more details.
std::shared_ptr< TrackSmearingTool > smearingTool_
std::shared_ptr< MCAnaHistos > _mc_vtx_histos
description
std::string v0ProjectionFitsCfg_
json file w run dependent v0 projection fits
std::string histoCfg_
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
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
TBranch * bvtxs_
description
std::string mcColl_
description
TBranch * becal_
description
double beamE_
In GeV. Default is 2016 value;.
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< TrackBiasingTool > biasingTool_
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::map< const char *, int, char_cmp > brMap_
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
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
bool operator()(const char *a, const char *b) const