CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTCaloTowerFilter Class Reference

#include <Work/HLTCaloTowerFilter/src/HLTCaloTowerFilter.cc>

Inheritance diagram for HLTCaloTowerFilter:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HLTCaloTowerFilter (const edm::ParameterSet &)
 ~HLTCaloTowerFilter ()

Private Member Functions

virtual bool filter (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag inputTag_
double max_Eta_
unsigned int min_N_
double min_Pt_
bool saveTag_

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 31 of file HLTCaloTowerFilter.cc.


Constructor & Destructor Documentation

HLTCaloTowerFilter::HLTCaloTowerFilter ( const edm::ParameterSet config) [explicit]

Definition at line 51 of file HLTCaloTowerFilter.cc.

                                                                    :
  inputTag_ (config.getParameter<edm::InputTag>("inputTag")),
  saveTag_  (config.getUntrackedParameter<bool>("saveTag", false)),
  min_Pt_   (config.getParameter<double>       ("MinPt"   )),
  max_Eta_  (config.getParameter<double>       ("MaxEta"  )),
  min_N_    (config.getParameter<unsigned int> ("MinN"    ))
{
  // register your products
  produces<trigger::TriggerFilterObjectWithRefs>();
}
HLTCaloTowerFilter::~HLTCaloTowerFilter ( )

Definition at line 63 of file HLTCaloTowerFilter.cc.

{
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)
}

Member Function Documentation

bool HLTCaloTowerFilter::filter ( edm::Event event,
const edm::EventSetup setup 
) [private, virtual]

Implements HLTFilter.

Definition at line 76 of file HLTCaloTowerFilter.cc.

References abs, HiRecoJets_cff::caloTowers, i, inputTag_, max_Eta_, min_N_, min_Pt_, module(), n, path(), dt_dqm_sourceclient_common_cff::reco, and saveTag_.

                                                                      {
  using namespace std;
  using namespace edm;
  using namespace reco;

  // All HLT filters must create and fill an HLT filter object,
  // recording any reconstructed physics objects satisfying (or not)
  // this HLT filter, and place it in the Event.

  // The filter object
  std::auto_ptr<trigger::TriggerFilterObjectWithRefs> filterobject (new trigger::TriggerFilterObjectWithRefs(path(),module()));
  if (saveTag_) filterobject->addCollectionTag(inputTag_);

  // get hold of collection of objects
  Handle<CaloTowerCollection> caloTowers;
  event.getByLabel(inputTag_, caloTowers);

  // look at all objects, check cuts and add to filter object
  unsigned int n = 0;
  for (CaloTowerCollection::const_iterator i = caloTowers->begin(); i != caloTowers->end(); ++i) {
    if ( (i->pt() >= min_Pt_) and ( (max_Eta_ < 0.0) or (std::abs(i->eta()) <= max_Eta_) ) )
      ++n;
      //edm::Ref<CaloTowerCollection> ref(towers, std::distance(caloTowers->begin(), i));
      //filterobject->addObject(TriggerJet, ref);
  }

  // put filter object into the Event
  event.put(filterobject);

  // filter decision
  return (n >= min_N_);
}

Member Data Documentation

Definition at line 40 of file HLTCaloTowerFilter.cc.

Referenced by filter().

double HLTCaloTowerFilter::max_Eta_ [private]

Definition at line 43 of file HLTCaloTowerFilter.cc.

Referenced by filter().

unsigned int HLTCaloTowerFilter::min_N_ [private]

Definition at line 44 of file HLTCaloTowerFilter.cc.

Referenced by filter().

double HLTCaloTowerFilter::min_Pt_ [private]

Definition at line 42 of file HLTCaloTowerFilter.cc.

Referenced by filter().

Definition at line 41 of file HLTCaloTowerFilter.cc.

Referenced by filter().