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.
Loading...
Searching...
No Matches
TrackingAnaProcessor.h
Go to the documentation of this file.
1#ifndef __TRACKING_ANAPROCESSOR_H__
2#define __TRACKING_ANAPROCESSOR_H__
3
4//-----------------//
5// C++ StdLib //
6//-----------------//
7#include <iostream>
8#include <string>
9
10//----------//
11// ROOT //
12//----------//
13#include "TClonesArray.h"
14#include "TFile.h"
15#include "TH1D.h"
16#include "TH2D.h"
17#include "TTree.h"
18
19//-----------//
20// hpstr //
21//-----------//
22#include "Processor.h"
23#include "BaseSelector.h"
24#include "Track.h"
25#include "Event.h"
26#include "CalCluster.h"
27#include "EventHeader.h"
28#include "TrackHistos.h"
29#include "TrackSmearingTool.h"
30#include "AnaHelpers.h"
31
37
38 public:
46 TrackingAnaProcessor(const std::string& name, Process& process);
47
50
56 virtual void configure(const ParameterSet& parameters);
57
63 virtual bool process(IEvent* ievent);
64
71 virtual void initialize(TTree* tree);
72
77 virtual void finalize();
78
82 virtual void setFile(TFile* outFile);
83
84 private:
85
87 std::vector<Track*>* tracks_{};
88 TBranch* btracks_{nullptr};
89
91 TBranch* bevth_{nullptr};
92
94 TBranch* becal_{nullptr};
95
96 // Event Header
97 EventHeader* evth_{nullptr};
98 std::vector<CalCluster*>* ecal_{};
99
100 std::string trkCollName_;
101 std::string ecalCollName_{"RecoEcalClusters"};
102
103 // Track Selector configuration
104 std::string selectionCfg_;
105 std::shared_ptr<BaseSelector> trkSelector_;
106 std::vector<std::string> regionSelections_;
107 std::map<std::string, std::shared_ptr<BaseSelector>> reg_selectors_;
108 std::map<std::string, std::shared_ptr<TrackHistos>> reg_histos_;
109 typedef std::map<std::string, std::shared_ptr<TrackHistos>>::iterator reg_it;
110
111 // Containers to hold histogrammer info
112 std::string histCfgFilename_;
116
117 std::vector<std::string> regions_;
118
119 bool doTruth_{false};
120 int isData_{1};
121 int debug_{0};
122 int seed_{0};
123 float time_offset_{0};
125 double clusterTimeMin_{40.0};
126 double clusterTimeMax_{70.0};
127 double clusterTimeMinMC_{40.0};
128 double clusterTimeMaxMC_{70.0};
129 double mcTimeOffset_{5.0};
130
131 //Momentum smearing closure test
132 std::shared_ptr<TrackSmearingTool> smearingTool_;
133 std::shared_ptr<TrackSmearingTool> smearingToolRel_;
134 std::string pSmearingFile_{""};
135 std::string smearingCfgFile_{""};
136 bool doSmearing_{false};
137 double smearingFactor_{1.0};
138 bool requireTruthMatch_{false};
139 bool smearOmega_{false};
140 std::string smearingVariable_{""};
141 std::string scaleCorrVariable_{""};
142
143 // AnaHelpers for decoding per-sensor hit layers
144 std::shared_ptr<AnaHelpers> ah_{nullptr};
145
146 // Output TTree
147 std::unique_ptr<TTree> output_tree_{nullptr};
150 double p_smear_ratio_out_{1.0};
151 // per-layer axial/stereo hit flags (L1-L3)
152 bool L1_axial_out_{false};
153 bool L1_stereo_out_{false};
154 bool L2_axial_out_{false};
155 bool L2_stereo_out_{false};
156 bool L3_axial_out_{false};
157 bool L3_stereo_out_{false};
164
169
170 // z0 smearing validation histograms
174
175 // omega smearing validation histograms
176 TH1D* omega_h_; // unsmeared omega
179 TH1D* omegasmear_h_; // smeared omega (when omega smearing enabled)
182 TH2D* omega_vs_p_hh_; // omega vs momentum
183
184 // omega vs track parameters (unsmeared and smeared)
191
198
199}; // TrackingAnaProcessor
200
201#endif // __TRACKING_ANAPROCESSOR_
Helper class for hipster analysis.
Class used to encapsulate event information.
Class defining methods used to access event information and data collections.
Base classes for all user event processing components to extend.
Class used to encapsulate track information.
Definition IEvent.h:7
description
Processor(const std::string &name, Process &process)
Class constructor.
Definition Processor.cxx:10
virtual bool process()
Process the histograms and generate analysis output.
Definition Processor.h:95
description
Definition TrackHistos.h:17
Definition Track.h:32
bool smearOmega_
Use omega (curvature) smearing instead of p smearing.
std::shared_ptr< TrackSmearingTool > smearingTool_
virtual bool process(IEvent *ievent)
Process the event and put new data products into it.
std::string ecalCollName_
Cluster Collection name.
std::string trkCollName_
Track Collection name.
std::string truthHistCfgFilename_
description
std::shared_ptr< TrackSmearingTool > smearingToolRel_
virtual void configure(const ParameterSet &parameters)
Configure the Ana Processor.
bool requireTruthMatch_
Require truth match for smearing.
Track track_out_
original (unsmeared) track
double clusterTimeMax_
maximum cluster time (data)
virtual void finalize()
Callback for the Processor to take any necessary action when the processing of events finishes.
std::map< std::string, std::shared_ptr< TrackHistos > > reg_histos_
description
double smearingFactor_
Factor to multiply smearing parameters by.
std::string scaleCorrVariable_
if set, omega data-mode scale uses pBinned_ means
bool doSmearing_
Master switch for smearing.
std::vector< std::string > regionSelections_
track selections
double clusterTimeMinMC_
minimum cluster time (MC)
virtual void initialize(TTree *tree)
Callback for the Processor to take any necessary action when the processing of events starts.
virtual void setFile(TFile *outFile)
Set output TFile and create the output TTree.
Track track_smeared_out_
smeared track (identical to track_out_ if no smearing)
std::map< std::string, std::shared_ptr< TrackHistos > >::iterator reg_it
description
std::vector< CalCluster * > * ecal_
std::string smearingVariable_
"flat", "nHits", "tanLambda", "phi0" — explicit lookup; "" = JSON default
TrackingAnaProcessor(const std::string &name, Process &process)
Class constructor.
std::string histCfgFilename_
description
TrackHistos * trkHistos_
description
std::map< std::string, std::shared_ptr< BaseSelector > > reg_selectors_
description
double p_smear_ratio_out_
smeared_p / original_p (1 if no smearing)
double clusterTimeMin_
minimum cluster time (data)
double feeClusterEnergyMin_
time offset
TBranch * btracks_
description
double clusterTimeMaxMC_
maximum cluster time (MC)
TrackHistos * truthHistos_
description
std::shared_ptr< AnaHelpers > ah_
std::vector< Track * > * tracks_
std::vector< std::string > regions_
double mcTimeOffset_
time offset applied to MC tracks
std::shared_ptr< BaseSelector > trkSelector_
description
std::unique_ptr< TTree > output_tree_