CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
SuperClusterImporter Class Reference
Inheritance diagram for SuperClusterImporter:
BlockElementImporterBase

Public Member Functions

void importToBlock (const edm::Event &, ElementList &) const override
 
 SuperClusterImporter (const edm::ParameterSet &, edm::ConsumesCollector &)
 
void updateEventSetup (const edm::EventSetup &es) override
 
- Public Member Functions inherited from BlockElementImporterBase
 BlockElementImporterBase (const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)
 
 BlockElementImporterBase (const BlockElementImporterBase &)=delete
 
const std::string & name () const
 
BlockElementImporterBaseoperator= (const BlockElementImporterBase &)=delete
 

Private Attributes

std::unique_ptr< EgammaHadTower_hadTower
 
const double _maxHoverE
 
const double _minSCPt
 
const double _pTbyPass
 
edm::EDGetTokenT
< reco::SuperClusterCollection
_srcEB
 
edm::EDGetTokenT
< reco::SuperClusterCollection
_srcEE
 
edm::EDGetTokenT
< CaloTowerCollection
_srcTowers
 
bool _superClustersArePF
 

Static Private Attributes

static const math::XYZPoint _zero = math::XYZPoint(0,0,0)
 

Additional Inherited Members

- Public Types inherited from BlockElementImporterBase
typedef std::vector
< std::unique_ptr
< reco::PFBlockElement > > 
ElementList
 

Detailed Description

Definition at line 23 of file SuperClusterImporter.cc.

Constructor & Destructor Documentation

SuperClusterImporter::SuperClusterImporter ( const edm::ParameterSet conf,
edm::ConsumesCollector sumes 
)

Definition at line 47 of file SuperClusterImporter.cc.

48  :
49  BlockElementImporterBase(conf,sumes),
52  _srcTowers(sumes.consumes<CaloTowerCollection>(conf.getParameter<edm::InputTag>("source_towers"))),
53  _maxHoverE(conf.getParameter<double>("maximumHoverE")),
54  _pTbyPass(conf.getParameter<double>("minPTforBypass")),
55  _minSCPt(conf.getParameter<double>("minSuperClusterPt")),
57  _superClustersArePF(conf.getParameter<bool>("superClustersArePF")) {
58 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEE
#define NULL
Definition: scimark2.h:8
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEB
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
std::unique_ptr< EgammaHadTower > _hadTower
edm::EDGetTokenT< CaloTowerCollection > _srcTowers
BlockElementImporterBase(const edm::ParameterSet &conf, edm::ConsumesCollector &sumes)

Member Function Documentation

void SuperClusterImporter::importToBlock ( const edm::Event e,
BlockElementImporterBase::ElementList elems 
) const
overridevirtual

Implements BlockElementImporterBase.

Definition at line 66 of file SuperClusterImporter.cc.

References _hadTower, _maxHoverE, _minSCPt, _pTbyPass, _srcEB, _srcEE, _srcTowers, _superClustersArePF, _zero, a, HLT_25ns14e33_v1_cff::distance, edm::Event::getByToken(), NULL, edm::Handle< T >::product(), ptFast(), reco::PFBlockElement::SC, reco::PFBlockElementSuperCluster::setFromPFSuperCluster(), and HLT_25ns14e33_v1_cff::towers.

67  {
70  e.getByToken(_srcEB,eb_scs);
72  e.getByToken(_srcEE,ee_scs);
74  e.getByToken(_srcTowers,towers);
75  _hadTower->setTowerCollection(towers.product());
76  elems.reserve(elems.size()+eb_scs->size()+ee_scs->size());
77  // setup our elements so that all the SCs are grouped together
78  auto SCs_end = std::partition(elems.begin(),elems.end(),
79  [](const ElementType& a){
80  return a->type() == reco::PFBlockElement::SC;
81  });
82  // add eb superclusters
83  auto bsc = eb_scs->cbegin();
84  auto esc = eb_scs->cend();
87  for( auto sc = bsc; sc != esc; ++sc ) {
88  scref = reco::SuperClusterRef(eb_scs,std::distance(bsc,sc));
89  PFBlockElementSCEqual myEqual(scref);
90  auto sc_elem = std::find_if(elems.begin(),SCs_end,myEqual);
91  const double scpT = ptFast(sc->energy(),sc->position(),_zero);
92  const double H_tower = ( _hadTower->getDepth1HcalESum(*sc) +
93  _hadTower->getDepth2HcalESum(*sc) );
94  const double HoverE = H_tower/sc->energy();
95  if( sc_elem == SCs_end && scpT > _minSCPt &&
96  (scpT > _pTbyPass || HoverE < _maxHoverE) ) {
97  scbe = new reco::PFBlockElementSuperCluster(scref);
99  SCs_end = elems.insert(SCs_end,ElementType(scbe));
100  ++SCs_end; // point to element *after* the new one
101  }
102  }// loop on eb superclusters
103  // add ee superclusters
104  bsc = ee_scs->cbegin();
105  esc = ee_scs->cend();
106  for( auto sc = bsc; sc != esc; ++sc ) {
107  scref = reco::SuperClusterRef(ee_scs,std::distance(bsc,sc));
108  PFBlockElementSCEqual myEqual(scref);
109  auto sc_elem = std::find_if(elems.begin(),SCs_end,myEqual);
110  const double scpT = ptFast(sc->energy(),sc->position(),_zero);
111  const double H_tower = ( _hadTower->getDepth1HcalESum(*sc) +
112  _hadTower->getDepth2HcalESum(*sc) );
113  const double HoverE = H_tower/sc->energy();
114  if( sc_elem == SCs_end && scpT > _minSCPt &&
115  (scpT > _pTbyPass || HoverE < _maxHoverE)) {
116  scbe = new reco::PFBlockElementSuperCluster(scref);
118  SCs_end = elems.insert(SCs_end,ElementType(scbe));
119  ++SCs_end; // point to element *after* the new one
120  }
121  }// loop on ee superclusters
122  elems.shrink_to_fit();
123 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEE
#define NULL
Definition: scimark2.h:8
edm::Ref< SuperClusterCollection > SuperClusterRef
reference to an object in a collection of SuperCluster objects
edm::EDGetTokenT< reco::SuperClusterCollection > _srcEB
double ptFast(const double energy, const math::XYZPoint &position, const math::XYZPoint &origin)
std::unique_ptr< EgammaHadTower > _hadTower
Container::value_type value_type
edm::EDGetTokenT< CaloTowerCollection > _srcTowers
T const * product() const
Definition: Handle.h:81
double a
Definition: hdecay.h:121
static const math::XYZPoint _zero
void SuperClusterImporter::updateEventSetup ( const edm::EventSetup es)
overridevirtual

Reimplemented from BlockElementImporterBase.

Definition at line 61 of file SuperClusterImporter.cc.

References _hadTower, and EgammaHadTower::SingleTower.

Member Data Documentation

std::unique_ptr<EgammaHadTower> SuperClusterImporter::_hadTower
private

Definition at line 36 of file SuperClusterImporter.cc.

Referenced by importToBlock(), and updateEventSetup().

const double SuperClusterImporter::_maxHoverE
private

Definition at line 35 of file SuperClusterImporter.cc.

Referenced by importToBlock().

const double SuperClusterImporter::_minSCPt
private

Definition at line 35 of file SuperClusterImporter.cc.

Referenced by importToBlock().

const double SuperClusterImporter::_pTbyPass
private

Definition at line 35 of file SuperClusterImporter.cc.

Referenced by importToBlock().

edm::EDGetTokenT<reco::SuperClusterCollection> SuperClusterImporter::_srcEB
private

Definition at line 33 of file SuperClusterImporter.cc.

Referenced by importToBlock().

edm::EDGetTokenT<reco::SuperClusterCollection> SuperClusterImporter::_srcEE
private

Definition at line 33 of file SuperClusterImporter.cc.

Referenced by importToBlock().

edm::EDGetTokenT<CaloTowerCollection> SuperClusterImporter::_srcTowers
private

Definition at line 34 of file SuperClusterImporter.cc.

Referenced by importToBlock().

bool SuperClusterImporter::_superClustersArePF
private

Definition at line 37 of file SuperClusterImporter.cc.

Referenced by importToBlock().

const math::XYZPoint SuperClusterImporter::_zero = math::XYZPoint(0,0,0)
staticprivate

Definition at line 38 of file SuperClusterImporter.cc.

Referenced by importToBlock().