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
ClusterOnTrackAnaProcessor.cxx
Go to the documentation of this file.
2#include "TBranch.h"
3
4ClusterOnTrackAnaProcessor::ClusterOnTrackAnaProcessor(const std::string& name, Process& process) : Processor(name,process){}
5//TODO CHECK THIS DESTRUCTOR
7
8
10
11 std::cout << "Configuring ClusterOnTrackAnaProcessor" << std::endl;
12 debug_ = parameters.getInteger("debug");
13 anaName_ = parameters.getString("anaName");
14 trkColl_ = parameters.getString("trkColl");
15 baselineFits_ = parameters.getString("BaselineFits");
16 baselineRun_ = parameters.getString("BaselineRun");
17 if(debug_ > 0) std::cout << "Configured: " << baselineFits_ << " " << baselineRun_ << std::endl;
18
19}
20
22 tree_= tree;
24
25 if(debug_ > 0) std::cout << "Loading: " << baselineFits_ << " " << baselineRun_ << std::endl;
26 if (!baselineFits_.empty() && !baselineRun_.empty()) {
27 /*
28 clusterHistos->setBaselineFitsDir(baselineFits_);
29 if (!clusterHistos->LoadBaselineHistos(baselineRun_))
30 std::cout<<"WARNING: baselines not loaded in Cluster on Track histos."<<std::endl;
31 */
33 }
34 if(debug_ > 0) std::cout << "Loaded: " << baselineFits_ << " " << baselineRun_ << std::endl;
35
38 if(debug_ > 0) std::cout << "Histos Defined" << std::endl;
39
40 //TODO Change this.
41 tree_->SetBranchAddress(trkColl_.c_str(),&tracks_,&btracks_);
42 if(debug_ > 0) std::cout << "Branch changed to " << trkColl_ << std::endl;
43
44}
45
47
48
49 for (int itrack = 0; itrack<tracks_->size();itrack++) {
50 Track *track = tracks_->at(itrack);
51 //Loop on hits
52 if (track->getSvtHits().GetEntries()==0) {
53 std::cout<<"WARNING::track doesn't have hits associated to it"<<std::endl;
54 return false;
55 }
56
57 for (int ihit = 0; ihit<track->getSvtHits().GetEntries(); ++ihit) {
58 TrackerHit* hit3d = (TrackerHit*) track->getSvtHits().At(ihit);
59 clusterHistos->FillHistograms(hit3d, 1.);
60 }
61 }
62 return true;
63}
64
71
#define DECLARE_PROCESSOR(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
Definition Processor.h:139
virtual void Define1DHistos()
description
void FillHistograms(TrackerHit *hit, float weight=1.)
description
virtual void Define2DHistos()
description
bool LoadOfflineBaselines(const std::string &baselineFits)
Load offline baseline.
Insert description here. more details.
virtual void configure(const ParameterSet &parameters)
Configure using given parameters.
ClusterOnTrackAnaProcessor(const std::string &name, Process &process)
Constructor.
virtual void initialize(TTree *tree)
description
ClusterHistos * clusterHistos
description
std::vector< Track * > * tracks_
Containers for adding to the TTree.
virtual void saveHistos(TFile *outF=nullptr, std::string folder="")
save histograms
Definition IEvent.h:7
description
Base class for all event processing components.
Definition Processor.h:34
TFile * outF_
Definition Processor.h:125
virtual bool process()
Process the histograms and generate analysis output.
Definition Processor.h:95
Definition Track.h:32