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
PreselectAndCategorizeSimp2016 Class Reference

#include <PreselectAndCategorizeSimp2016.h>

Inheritance diagram for PreselectAndCategorizeSimp2016:
PreselectAndCategorize Processor

Public Member Functions

 PreselectAndCategorizeSimp2016 (const std::string &name, Process &process)
 ~PreselectAndCategorizeSimp2016 ()=default
virtual void configure (const ParameterSet &parameters) final
 Callback for the Processor to configure itself from the given set of parameters.
virtual void initialize (TTree *tree) final
 Callback for the Processor to take any necessary action when the processing of events starts, such as creating histograms.
virtual void setFile (TFile *out_file) final
 Set output TFile for AnaProcessors.
virtual bool process (IEvent *ievent) final
 Process the event and put new data products into it.
virtual void finalize () final
 Callback for the Processor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
Public Member Functions inherited from PreselectAndCategorize
 PreselectAndCategorize (const std::string &name, Process &process)
 ~PreselectAndCategorize ()=default
virtual void setVtxColl (std::string vtx_coll)
virtual void setMCColl (std::string mc_coll)
json preselect_json_load (const std::string &filepath)
bool getIsSignal () const
bool getIsData () const
Public Member Functions inherited from Processor
 Processor (const std::string &name, Process &process)
 Class constructor.
virtual ~Processor ()
virtual void initialize (std::string inFilename, std::string outFilename)
 Callback for the Processor to take any necessary action when the processing of events starts, such as initializing files.
virtual bool process ()
 Process the histograms and generate analysis output.

Additional Inherited Members

Static Public Member Functions inherited from Processor
static void declare (const std::string &classname, ProcessorMaker *)
 Internal function which is part of the ProcessorFactory machinery.
Protected Attributes inherited from PreselectAndCategorize
EventBus bus_
std::unique_ptr< TTree > output_tree_
std::string vtxColl_ {"UnconstrainedV0Vertices_KF"}
std::string mcColl_ {"MCParticle"}
 description
bool isData_ {false}
bool isSignal_ {false}
double calTimeOffset_ {0.0}
Cutflow vertex_cf_ {"vertex", "reconstructed"}
Cutflow event_cf_ {"event", "readout"}
std::unique_ptr< TH2F > n_vertices_h_
std::shared_ptr< TrackSmearingTool > smearingTool_
std::shared_ptr< AnaHelpers > _ah
 description
std::map< int, std::vector< double > > beamspot_corrections_
json v0proj_fits_
std::map< std::string, double > track_corrections_
Protected Attributes inherited from Processor
Process & process_
TFile * outF_ {nullptr}
std::string name_

Detailed Description

Definition at line 16 of file PreselectAndCategorizeSimp2016.h.

Constructor & Destructor Documentation

◆ PreselectAndCategorizeSimp2016()

PreselectAndCategorizeSimp2016 ( const std::string & name,
Process & process )
inline

Definition at line 18 of file PreselectAndCategorizeSimp2016.h.

◆ ~PreselectAndCategorizeSimp2016()

Member Function Documentation

◆ configure()

void configure ( const ParameterSet & parameters)
finalvirtual

Callback for the Processor to configure itself from the given set of parameters.

Parameters
parametersParameterSet for configuration.

Alic has updated to be what is shown below, but in the same update, stopped using the beamspot corrections anywhere in the analyzer. The only JSON data file in hpstr on his branch with these keys is the v0 projection fits config for the simulation samples. beamspot_corrections_[std::stoi(run)] = { entry["unrotated_mean_x"], entry["unrotated_mean_y"] };

Reimplemented from PreselectAndCategorize.

Definition at line 20 of file PreselectAndCategorizeSimp2016.cxx.

◆ finalize()

void finalize ( )
finalvirtual

Callback for the Processor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.

Reimplemented from PreselectAndCategorize.

Definition at line 461 of file PreselectAndCategorizeSimp2016.cxx.

◆ initialize()

void initialize ( TTree * tree)
finalvirtual

Callback for the Processor to take any necessary action when the processing of events starts, such as creating histograms.

Parameters
tree

Reimplemented from PreselectAndCategorize.

Definition at line 86 of file PreselectAndCategorizeSimp2016.cxx.

◆ process()

bool process ( IEvent * ievent)
finalvirtual

Process the event and put new data products into it.

Parameters
eventThe Event to process.
Returns
status of the processing, false will move to next event and skip other processes.

pre-selection on vertices defining "quality" vertices

In this process of pre-selecting vertices, we also apply corrections and momentum smearing to the underlying particle tracks and clusters. These are then stored in our new copy of these objects in the resulting preselected_vtx collection (vtx, ele, pos).

We need to keep the particles separately since the particles "stored" within Vertex are references to the collections. We make a copy here to apply corrections and do not modify the collections referenced elsewhere in memory.

When the user provides a set of beamspot corrections, we apply them to the tracks in a vertex shifting the track_z0 by the beamspot y. (Same direction just different coordinate names.)

This is separate from the track_corrections_ because, for real data, the beamspot_corrections_ change run-by-run while for simulation samples, they do not.

In the samples inherited from Alic and the L1L1 analysis, these beamspot corrections were applied earlier in the chain for data and so do not need to be re-applied at this level; however, I am leaving this code here since it was helpful to confirm this.

This is where the output TTree is filled, if we leave before this point, then the event will not be kept as part of pre-selection.

We wait until here to copy over the MCParticles to avoid unnecessary copying if the event is not going to be kept anyways.

Before we loop through the MCParticles we go through the the hits on the electron track in this vertex and find out which MCParticle has the most hits on the track.

The implementation of the beam-overlay mechanism very rarely causes two signal events to occur within the same software event (or no signal event to happen at all). The complexity of handling these cases is too high and the rarity (both in simulation and expected due to small cross section) motivates just removing these events from the sample.

The warnings are still printed so an estimate on the number of events being dropped can be retrieved from the logs.

Reimplemented from PreselectAndCategorize.

Definition at line 158 of file PreselectAndCategorizeSimp2016.cxx.

◆ setFile()

void setFile ( TFile * outFile)
finalvirtual

Set output TFile for AnaProcessors.

Parameters
pointerto output TFile

Reimplemented from PreselectAndCategorize.

Definition at line 128 of file PreselectAndCategorizeSimp2016.cxx.


The documentation for this class was generated from the following files: