DESY Hbb Analysis Framework
Public Member Functions | Private Types | Private Attributes | List of all members
analysis::tools::Collection< Object > Class Template Reference

#include <Collection.h>

Public Member Functions

void add (const Object &object)
 
template<>
void addGenJets (const std::shared_ptr< Collection< GenJet > > &cands)
 
void addGenJets (const std::shared_ptr< Collection< GenJet > > &)
 
template<>
void associatePartons (const std::shared_ptr< Collection< GenParticle > > &particles, const float &deltaR, const float &ptMin, const bool &pythia8)
 
void associatePartons (const std::shared_ptr< Collection< GenParticle > > &, const float &deltaR=0.4, const float &ptMin=1., const bool &pythia8=true)
 
Object & at (const int &index)
 
template<>
void btagAlgo (const std::string &algo)
 
void btagAlgo (const std::string &)
 
template<>
 Collection (const Objects &objects, const std::string &name)
 
 Collection ()
 
 Collection (const Objects &objects, const std::string &name_="")
 
template<>
void matchTo (const std::vector< Candidate > *vectorcandidates, const std::string &name, const float &deltaR)
 
template<>
void matchTo (const Collection< Candidate > &collection, const float &deltaR)
 
template<>
void matchTo (const Collection< Candidate > &collection, const float &deltaR, const float &delta_pt)
 
template<>
void matchTo (const Collection< TriggerObject > &collection, const float &deltaR)
 
template<>
void matchTo (const std::shared_ptr< Collection< TriggerObject > > collection, const float &deltaR)
 
template<>
void matchTo (const Collection< Jet > &collection, const float &deltaR, const float &delta_pt)
 
void matchTo (const std::vector< Candidate > *vectorcandidates, const std::string &name, const float &deltaR=0.5)
 
void matchTo (const Collection< Candidate > &collection, const float &delta_pT, const float &deltaR)
 
void matchTo (const Collection< Jet > &collection, const float &delta_pT, const float &deltaR)
 
void matchTo (const Collection< Candidate > &collection, const float &deltaR=0.5)
 
void matchTo (const Collection< TriggerObject > &collection, const float &deltaR=0.5)
 
void matchTo (const std::shared_ptr< Collection< TriggerObject > > collection, const float &deltaR=0.5)
 
std::string name () const
 
void setSize (const int &size)
 
int size ()
 
template<>
void smearTo (const Collection< Jet > &collection, const double &n_sigma)
 
void smearTo (const Collection< Jet > &collection, const double &n_sigma=0)
 
std::vector< std::shared_ptr< Object > > vector ()
 
template<>
std::vector< Candidate > * vectorCandidates () const
 
std::vector< Candidate > * vectorCandidates () const
 
 ~Collection ()
 

Private Types

typedef std::vector< Object > Objects
 

Private Attributes

std::vector< Candidatecandidates_
 
std::string name_
 
Objects objects_
 
int size_
 

Detailed Description

template<class Object>
class analysis::tools::Collection< Object >

Definition at line 41 of file Collection.h.

Member Typedef Documentation

template<class Object>
typedef std::vector<Object> analysis::tools::Collection< Object >::Objects
private

Definition at line 43 of file Collection.h.

Constructor & Destructor Documentation

template<class Object >
Collection::Collection ( )

Definition at line 52 of file Collection.cc.

Referenced by analysis::tools::Collection< Object >::Collection().

53 {
54  size_ = 0;
55  candidates_.clear();
56 }
std::vector< Candidate > candidates_
Definition: Collection.h:77
template<class Object >
Collection::Collection ( const Objects objects,
const std::string &  name_ = "" 
)

Definition at line 58 of file Collection.cc.

References analysis::tools::Collection< Object >::Collection(), naf_mult_submit::int, and nano_94X_2017_rereco31Mar18-v1::name.

59 {
60  objects_ = objects;
61  size_ = (int) objects_.size();
62  name_ = name;
63  candidates_.clear();
64  for ( int i = 0; i < size_ ; ++i ) candidates_.push_back(objects_[i]);
65 }
std::vector< Candidate > candidates_
Definition: Collection.h:77
std::string name() const
Definition: Collection.h:89
template<class Object >
Collection::~Collection ( )

Definition at line 77 of file Collection.cc.

78 {
79 // std::cout<< this << " Collection destroyed" << std::endl;
80 
81  // do anything here that needs to be done at desctruction time
82  // (e.g. close files, deallocate resources etc.)
83 }
template<>
analysis::tools::Collection< Vertex >::Collection ( const Objects objects,
const std::string &  name 
)

Member Function Documentation

template<class Object >
void analysis::tools::Collection< Object >::add ( const Object &  object)
inline
template<>
void analysis::tools::Collection< Jet >::addGenJets ( const std::shared_ptr< Collection< GenJet > > &  cands)
template<class Object >
void Collection::addGenJets ( const std::shared_ptr< Collection< GenJet > > &  cands)

Definition at line 115 of file Collection.cc.

116 {
117 }
template<>
void analysis::tools::Collection< Jet >::associatePartons ( const std::shared_ptr< Collection< GenParticle > > &  particles,
const float &  deltaR,
const float &  ptMin,
const bool &  pythia8 
)
template<class Object >
void Collection::associatePartons ( const std::shared_ptr< Collection< GenParticle > > &  particles,
const float &  deltaR = 0.4,
const float &  ptMin = 1.,
const bool &  pythia8 = true 
)

Definition at line 131 of file Collection.cc.

References ConfFile_cfg::p, analysis::tools::Candidate::p4(), and analysis::tools::Jet::partons().

132 {
133 }
template<class Object >
Object & analysis::tools::Collection< Object >::at ( const int &  index)
inline

Definition at line 88 of file Collection.h.

References analysis::tools::Collection< Object >::objects_.

88 { return objects_.at(index); }
template<>
void analysis::tools::Collection< Jet >::btagAlgo ( const std::string &  algo)
template<class Object >
void Collection::btagAlgo ( const std::string &  algo)

Definition at line 103 of file Collection.cc.

104 {
105 }
template<>
void analysis::tools::Collection< Vertex >::matchTo ( const std::vector< Candidate > *  vectorcandidates,
const std::string &  name,
const float &  deltaR 
)
template<>
void analysis::tools::Collection< Vertex >::matchTo ( const Collection< Candidate > &  collection,
const float &  deltaR 
)
template<>
void analysis::tools::Collection< Vertex >::matchTo ( const Collection< Candidate > &  collection,
const float &  deltaR,
const float &  delta_pt 
)
template<>
void analysis::tools::Collection< Vertex >::matchTo ( const Collection< TriggerObject > &  collection,
const float &  deltaR 
)
template<>
void analysis::tools::Collection< Vertex >::matchTo ( const std::shared_ptr< Collection< TriggerObject > >  collection,
const float &  deltaR 
)
template<>
void analysis::tools::Collection< Jet >::matchTo ( const Collection< Jet > &  collection,
const float &  deltaR,
const float &  delta_pt 
)
template<class Object >
void Collection::matchTo ( const std::vector< Candidate > *  vectorcandidates,
const std::string &  name,
const float &  deltaR = 0.5 
)

Definition at line 195 of file Collection.cc.

Referenced by analysis::tools::Collection< Object >::matchTo().

196 {
197  for ( auto & obj : objects_ )
198  obj.matchTo(vectorcandidates,name,deltaR);
199 }
std::string name() const
Definition: Collection.h:89
template<class Object >
void Collection::matchTo ( const Collection< Candidate > &  collection,
const float &  delta_pT,
const float &  deltaR 
)

Definition at line 209 of file Collection.cc.

References analysis::tools::Collection< Object >::matchTo(), analysis::tools::Collection< Object >::name(), and analysis::tools::Collection< Object >::vectorCandidates().

209  {
210  for (auto & obj : objects_){
211  obj.matchTo(collection.vectorCandidates(),collection.name(),delta_pT,deltaR);
212  }
213 }
std::vector< Candidate > * vectorCandidates() const
Definition: Collection.cc:286
std::string name() const
Definition: Collection.h:89
template<class Object>
void analysis::tools::Collection< Object >::matchTo ( const Collection< Jet > &  collection,
const float &  delta_pT,
const float &  deltaR 
)
template<class Object >
void Collection::matchTo ( const Collection< Candidate > &  collection,
const float &  deltaR = 0.5 
)

Definition at line 202 of file Collection.cc.

References analysis::tools::Collection< Object >::name(), and analysis::tools::Collection< Object >::vectorCandidates().

203 {
204  for ( auto & obj : objects_ )
205  obj.matchTo(collection.vectorCandidates(),collection.name(), deltaR);
206 }
std::vector< Candidate > * vectorCandidates() const
Definition: Collection.cc:286
std::string name() const
Definition: Collection.h:89
template<class Object >
void Collection::matchTo ( const Collection< TriggerObject > &  collection,
const float &  deltaR = 0.5 
)

Definition at line 223 of file Collection.cc.

References analysis::tools::Collection< Object >::name(), and analysis::tools::Collection< Object >::vectorCandidates().

224 {
225  for ( auto & obj : objects_ )
226  obj.matchTo(collection.vectorCandidates(),collection.name(),deltaR);
227 }
std::vector< Candidate > * vectorCandidates() const
Definition: Collection.cc:286
std::string name() const
Definition: Collection.h:89
template<class Object >
void Collection::matchTo ( const std::shared_ptr< Collection< TriggerObject > >  collection,
const float &  deltaR = 0.5 
)

Definition at line 230 of file Collection.cc.

References analysis::tools::Collection< Object >::name(), pTordering(), and analysis::tools::Collection< Object >::smearTo().

231 {
232  this->matchTo(*collection, deltaR);
233 }
void matchTo(const std::vector< Candidate > *vectorcandidates, const std::string &name, const float &deltaR=0.5)
Definition: Collection.cc:195
template<class Object >
std::string analysis::tools::Collection< Object >::name ( ) const
inline
template<class Object >
void analysis::tools::Collection< Object >::setSize ( const int &  size)
inline
template<class Object >
int analysis::tools::Collection< Object >::size ( )
inline
template<>
void analysis::tools::Collection< Jet >::smearTo ( const Collection< Jet > &  collection,
const double &  n_sigma 
)
template<class Object>
void analysis::tools::Collection< Object >::smearTo ( const Collection< Jet > &  collection,
const double &  n_sigma = 0 
)
template<class Object >
std::vector< std::shared_ptr< Object > > Collection::vector ( )

Definition at line 92 of file Collection.cc.

93 {
94  std::vector< std::shared_ptr<Object> > objects;
95  for ( auto & obj : objects_ )
96  {
97  std::shared_ptr<Object> sp_obj = std::shared_ptr<Object> ( new Object(obj));
98  objects.push_back(sp_obj);
99  }
100  return objects;
101 }
template<>
std::vector< Candidate > * analysis::tools::Collection< Vertex >::vectorCandidates ( ) const
template<class Object >
std::vector< Candidate > * Collection::vectorCandidates ( ) const

Definition at line 286 of file Collection.cc.

Referenced by analysis::tools::Collection< Object >::matchTo().

287 {
288  return &candidates_;
289 }
std::vector< Candidate > candidates_
Definition: Collection.h:77

Member Data Documentation

template<class Object>
std::vector<Candidate> analysis::tools::Collection< Object >::candidates_
mutableprivate

Definition at line 77 of file Collection.h.

template<class Object>
std::string analysis::tools::Collection< Object >::name_
private

Definition at line 79 of file Collection.h.

Referenced by analysis::tools::Collection< Object >::name().

template<class Object>
Objects analysis::tools::Collection< Object >::objects_
private
template<class Object>
int analysis::tools::Collection< Object >::size_
private

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