15 std::cout <<
"Configuring TrackingAnaProcessor" << std::endl;
33 catch (std::runtime_error& error)
35 std::cout << error.what() << std::endl;
70 for (
unsigned int i_reg = 0;
74 std::cout<<
"Setting up region "<< regname<<std::endl;
80 reg_histos_[regname] = std::make_shared<TrackHistos>(regname);
82 reg_histos_[regname]->doTrackComparisonPlots(
false);
93 tree->SetBranchAddress(
"EventHeader", &
evth_ , &
bevth_);
103 std::cout<<
"Smearing Tool Seed "<<
seed_<<std::endl;
111 "psmear_vs_nHits_hh",
115 "psmear_vs_nHits_top_hh",
119 "psmear_vs_nHits_bot_hh",
125 "psmear_rel_h",200,0,4);
128 "psmear_vs_nHits_rel_hh",
132 "psmear_vs_nHits_top_rel_hh",
136 "psmear_vs_nHits_bot_rel_hh",
149 int n_sel_tracks = 0;
171 bool foundFeeCluster =
false;
173 for (
unsigned int iclu = 0; iclu <
ecal_->size(); iclu++) {
174 if (
ecal_->at(iclu)->getEnergy() > 1.5)
175 foundFeeCluster =
true;
179 if (!foundFeeCluster)
182 bool clusterInTime =
true;
184 for (
unsigned int iclu = 0; iclu <
ecal_->size(); iclu++) {
185 if (
ecal_->at(iclu)->getTime() < 40 ||
ecal_->at(iclu)->getTime() > 70)
186 clusterInTime =
false;
192 for (
int itrack = 0; itrack <
tracks_->size(); ++itrack) {
198 int n2dhits_onTrack = !track->isKalmanTrack() ? track->getTrackerHitCount() * 2 : track->getTrackerHitCount();
201 trk_mom.SetX(track->getMomentum()[0]);
202 trk_mom.SetY(track->getMomentum()[1]);
203 trk_mom.SetZ(track->getMomentum()[2]);
232 Track* truth_track =
nullptr;
236 truth_track = (
Track*) track->getTruthLink().GetObject();
238 std::cout<<
"Warnings::TrackingAnaProcessor::Requested Truth track but couldn't find it in the ntuple"<<std::endl;
243 std::cout<<
"========================================="<<std::endl;
244 std::cout<<
"========================================="<<std::endl;
245 std::cout<<
"Track params: "<<std::endl;
264 track->getPositionAtEcal()[0],
265 track->getPositionAtEcal()[1]);
269 track->getTanLambda(),
273 track->getTrackerHitCount(),
276 if (track->getTanLambda() > 0 )
278 track->getTrackerHitCount(),
282 track->getTrackerHitCount(),
286 track->getTanLambda(),
287 track->getTrackerHitCount(),
303 double nhits = track->getTrackerHitCount();
304 double isTop = track->getTanLambda() > 0 ? true :
false;
351 std::string dirName = it->first;
352 (it->second)->saveHistos(
outF_,dirName);
353 outF_->cd(dirName.c_str());
Helper class for hipster analysis.
#define DECLARE_PROCESSOR(CLASS)
Macro which allows the framework to construct a producer given its name during configuration.
static std::string getFileName(std::string filePath, bool withExtension)
void Fill2DHisto(const std::string &histoName, float valuex, float valuey, float weight=1.)
description
virtual void DefineHistos()
Definition of histograms from json config.
void Fill3DHisto(const std::string &histoName, float valuex, float valuey, float valuez, float weight=1.)
description
void Fill1DHisto(const std::string &histoName, float value, float weight=1.)
description
virtual void loadHistoConfig(const std::string histoConfigFile)
load histogram config
virtual void saveHistos(TFile *outF=nullptr, std::string folder="")
save histograms
Base class for all event processing components.
virtual bool process()
Process the histograms and generate analysis output.
void Fill2DTrack(Track *track, float weight=1., const std::string &trkname="")
Fill 2D track.
void Fill1DHistograms(Track *track=nullptr, Vertex *vtx=nullptr, float weight=1.)
Fill 1D histograms.
void doTrackComparisonPlots(bool doplots)
Compare tracks.
void Fill1DTrackTruth(Track *track, Track *truth_track, float weight=1., const std::string &="")
Truth comparison.
Insert description here. more details.
std::shared_ptr< TrackSmearingTool > smearingTool_
time offset
std::string ecalCollName_
Cluster Collection name.
std::string trkCollName_
Track Collection name.
std::string selectionCfg_
std::string truthHistCfgFilename_
description
std::shared_ptr< TrackSmearingTool > smearingToolRel_
virtual void configure(const ParameterSet ¶meters)
Configure the Ana Processor.
TH2D * psmear_vs_nHits_rel_hh_
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
std::vector< std::string > regionSelections_
track selections
virtual void initialize(TTree *tree)
Callback for the Processor to take any necessary action when the processing of events starts.
std::map< std::string, std::shared_ptr< TrackHistos > >::iterator reg_it
description
std::vector< CalCluster * > * ecal_
TrackingAnaProcessor(const std::string &name, Process &process)
Class constructor.
std::string histCfgFilename_
description
TrackHistos * trkHistos_
description
TH2D * psmear_vs_nHits_hh_
std::string pSmearingFile_
std::map< std::string, std::shared_ptr< BaseSelector > > reg_selectors_
description
TBranch * btracks_
description
TH2D * psmear_vs_nHits_bot_rel_hh_
TrackHistos * truthHistos_
description
TH2D * psmear_vs_nHits_bot_hh_
TH2D * psmear_vs_nHits_top_hh_
TH2D * psmear_vs_nHits_top_rel_hh_
std::vector< Track * > * tracks_
std::vector< std::string > regions_
std::shared_ptr< BaseSelector > trkSelector_
description