CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Types | Private Attributes

HLTDoubletDZ< T1, T2 > Class Template Reference

#include <HLTDoubletDZ.h>

Inheritance diagram for HLTDoubletDZ< T1, T2 >:
HLTFilter edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HLTDoubletDZ (const edm::ParameterSet &)
virtual bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct)
 ~HLTDoubletDZ ()

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)

Private Types

typedef std::vector< T1 > T1Collection
typedef edm::Ref< T1CollectionT1Ref
typedef std::vector< T2 > T2Collection
typedef edm::Ref< T2CollectionT2Ref

Private Attributes

std::vector< T1Refcoll1_
std::vector< T2Refcoll2_
edm::InputTag inputTag1_
edm::InputTag inputTag2_
std::string label_
double maxDZ_
int min_N_
double minDR_
edm::InputTag originTag1_
edm::InputTag originTag2_
bool same_
int triggerType1_
int triggerType2_

Detailed Description

template<typename T1, typename T2>
class HLTDoubletDZ< T1, T2 >

Definition at line 20 of file HLTDoubletDZ.h.


Member Typedef Documentation

template<typename T1 , typename T2 >
typedef std::vector<T1> HLTDoubletDZ< T1, T2 >::T1Collection [private]

Definition at line 44 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
typedef edm::Ref<T1Collection> HLTDoubletDZ< T1, T2 >::T1Ref [private]

Definition at line 45 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
typedef std::vector<T2> HLTDoubletDZ< T1, T2 >::T2Collection [private]

Definition at line 47 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
typedef edm::Ref<T2Collection> HLTDoubletDZ< T1, T2 >::T2Ref [private]

Definition at line 48 of file HLTDoubletDZ.h.


Constructor & Destructor Documentation

template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::HLTDoubletDZ ( const edm::ParameterSet iConfig) [explicit]

Definition at line 21 of file HLTDoubletDZ.cc.

References edm::InputTag::encode(), HLTDoubletDZ< T1, T2 >::inputTag1_, HLTDoubletDZ< T1, T2 >::inputTag2_, and HLTDoubletDZ< T1, T2 >::same_.

                                                                : HLTFilter(iConfig),
  originTag1_(iConfig.template getParameter<edm::InputTag>("originTag1")),
  originTag2_(iConfig.template getParameter<edm::InputTag>("originTag2")),
  inputTag1_(iConfig.template getParameter<edm::InputTag>("inputTag1")),
  inputTag2_(iConfig.template getParameter<edm::InputTag>("inputTag2")),
  triggerType1_(iConfig.template getParameter<int>("triggerType1")),
  triggerType2_(iConfig.template getParameter<int>("triggerType2")),
  minDR_ (iConfig.template getParameter<double>("MinDR")),
  maxDZ_ (iConfig.template getParameter<double>("MaxDZ")),
  min_N_    (iConfig.template getParameter<int>("MinN")),
  label_    (iConfig.getParameter<std::string>("@module_label")),
  coll1_(),
  coll2_()
{
   // same collections to be compared?
   same_ = (inputTag1_.encode()==inputTag2_.encode());
}
template<typename T1 , typename T2 >
HLTDoubletDZ< T1, T2 >::~HLTDoubletDZ ( )

Definition at line 40 of file HLTDoubletDZ.cc.

{
}

Member Function Documentation

template<typename T1 , typename T2 >
void HLTDoubletDZ< T1, T2 >::fillDescriptions ( edm::ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDFilter.

Definition at line 46 of file HLTDoubletDZ.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::add(), and mergeVDriftHistosByStation::name.

                                                                                {
  edm::ParameterSetDescription desc;
  makeHLTFilterDescription(desc);
  desc.add<edm::InputTag>("originTag1",edm::InputTag("hltOriginal1"));
  desc.add<edm::InputTag>("originTag2",edm::InputTag("hltOriginal2"));
  desc.add<edm::InputTag>("inputTag1",edm::InputTag("hltFiltered1"));
  desc.add<edm::InputTag>("inputTag2",edm::InputTag("hltFiltered2"));
  desc.add<int>("triggerType1",0);
  desc.add<int>("triggerType2",0);
  desc.add<double>("MinDR",-1.0);
  desc.add<double>("MaxDZ",0.2);
  desc.add<int>("MinN",1);
  descriptions.add(std::string("hlt")+std::string(typeid(HLTDoubletDZ<T1,T2>).name()),desc);
}
template<typename T1 , typename T2 >
bool HLTDoubletDZ< T1, T2 >::hltFilter ( edm::Event iEvent,
const edm::EventSetup iSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) [virtual]

Implements HLTFilter.

Definition at line 64 of file HLTDoubletDZ.cc.

References abs, accept(), trigger::TriggerFilterObjectWithRefs::addCollectionTag(), trigger::TriggerRefsCollections::addObject(), edm::HandleBase::clear(), reco::deltaR(), edm::InputTag::encode(), edm::Event::getByLabel(), edm::Event::getProvenance(), Exhume::I, instance, label, edm::Provenance::moduleLabel(), n, AlCaHLTBitMon_ParallelJobs::p, p1, p2, evf::utils::pid, align_tpl::process, edm::Provenance::processName(), edm::Provenance::productInstanceName(), diffTwoXMLs::r1, diffTwoXMLs::r2, dt_dqm_sourceclient_common_cff::reco, CommPDSkim_cfg::saveTags, and reco::Candidate::vz().

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

   // 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.

   bool accept(false);

   LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 0 " << std::endl;

   // get hold of pre-filtered object collections
   Handle<TriggerFilterObjectWithRefs> coll1,coll2;
   if (iEvent.getByLabel (inputTag1_,coll1) && iEvent.getByLabel (inputTag2_,coll2)) {
     coll1_.clear();
     coll1->getObjects(triggerType1_,coll1_);
     const size_type n1(coll1_.size());
     coll2_.clear();
     coll2->getObjects(triggerType2_,coll2_);
     const size_type n2(coll2_.size());

     if (saveTags()) {
       InputTag tagOld;
       filterproduct.addCollectionTag(originTag1_);
       LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 1a " << originTag1_.encode() << std::endl;
       tagOld=InputTag();
       for (size_type i1=0; i1!=n1; ++i1) {
         const ProductID pid(coll1_[i1].id());
         const string&    label(iEvent.getProvenance(pid).moduleLabel());
         const string& instance(iEvent.getProvenance(pid).productInstanceName());
         const string&  process(iEvent.getProvenance(pid).processName());
         InputTag tagNew(InputTag(label,instance,process));
         if (tagOld.encode()!=tagNew.encode()) {
           filterproduct.addCollectionTag(tagNew);
           tagOld=tagNew;
           LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 1b " << tagNew.encode() << std::endl;
         }
       }
       filterproduct.addCollectionTag(originTag1_);
       LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 2a " << originTag2_.encode() << std::endl;
       tagOld=InputTag();
       for (size_type i2=0; i2!=n2; ++i2) {
         const ProductID pid(coll2_[i2].id());
         const string&    label(iEvent.getProvenance(pid).moduleLabel());
         const string& instance(iEvent.getProvenance(pid).productInstanceName());
         const string&  process(iEvent.getProvenance(pid).processName());
         InputTag tagNew(InputTag(label,instance,process));
         if (tagOld.encode()!=tagNew.encode()) {
           filterproduct.addCollectionTag(tagNew);
           tagOld=tagNew;
           LogVerbatim("HLTDoubletDZ") << " XXX " << label_ << " 2b " << tagNew.encode() << std::endl;
         }
       }
     }

     int n(0);
     T1Ref r1;
     T2Ref r2;
     Particle::LorentzVector p1,p2,p;
     for (unsigned int i1=0; i1!=n1; i1++) {
       r1=coll1_[i1];
       const reco::Candidate& candidate1(*r1);
       unsigned int I(0);
       if (same_) {I=i1+1;}
       for (unsigned int i2=I; i2!=n2; i2++) {
         r2=coll2_[i2];
         const reco::Candidate& candidate2(*r2);
         if ( reco::deltaR(candidate1, candidate2) < minDR_ ) continue;
         if ( std::abs(candidate1.vz()-candidate2.vz()) > maxDZ_ ) continue;
         n++;
         filterproduct.addObject(triggerType1_,r1);
         filterproduct.addObject(triggerType2_,r2);
       }
     }
     // filter decision
     accept = accept || (n>=min_N_);
   }

   return accept;
}

Member Data Documentation

template<typename T1 , typename T2 >
std::vector<T1Ref> HLTDoubletDZ< T1, T2 >::coll1_ [private]

Definition at line 46 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
std::vector<T2Ref> HLTDoubletDZ< T1, T2 >::coll2_ [private]

Definition at line 49 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
edm::InputTag HLTDoubletDZ< T1, T2 >::inputTag1_ [private]

Definition at line 33 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

template<typename T1 , typename T2 >
edm::InputTag HLTDoubletDZ< T1, T2 >::inputTag2_ [private]

Definition at line 34 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

template<typename T1 , typename T2 >
std:: string HLTDoubletDZ< T1, T2 >::label_ [private]

Definition at line 42 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
double HLTDoubletDZ< T1, T2 >::maxDZ_ [private]

Definition at line 38 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
int HLTDoubletDZ< T1, T2 >::min_N_ [private]

Definition at line 40 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
double HLTDoubletDZ< T1, T2 >::minDR_ [private]

Definition at line 37 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
edm::InputTag HLTDoubletDZ< T1, T2 >::originTag1_ [private]

Definition at line 31 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
edm::InputTag HLTDoubletDZ< T1, T2 >::originTag2_ [private]

Definition at line 32 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
bool HLTDoubletDZ< T1, T2 >::same_ [private]

Definition at line 39 of file HLTDoubletDZ.h.

Referenced by HLTDoubletDZ< T1, T2 >::HLTDoubletDZ().

template<typename T1 , typename T2 >
int HLTDoubletDZ< T1, T2 >::triggerType1_ [private]

Definition at line 35 of file HLTDoubletDZ.h.

template<typename T1 , typename T2 >
int HLTDoubletDZ< T1, T2 >::triggerType2_ [private]

Definition at line 36 of file HLTDoubletDZ.h.